query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
3ab212d67275632838c26facaff8cace
Removes all keyvalue entries from the map.
[ { "docid": "a1c16153d9285b507b13d1c4bf2b381b", "score": "0.0", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}", "title": "" } ]
[ { "docid": "4f4725c7fa4ecb066ed06f33df6b540b", "score": "0.7590112", "text": "clear() {\n var map = this._map;\n var keys = Object.keys(map);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n map[key].clear();\n }\n }", "title": "" }, { "docid": "e286e288f04a1bd69edfbfe660a6c1ee", "score": "0.70694387", "text": "clear() {\n log.map(\"Clearing the map of all the entries\");\n this._map.clear();\n }", "title": "" }, { "docid": "7f106f43c7db80957f778a7787945d80", "score": "0.6735414", "text": "function multiMapRemove(map, key, value) {\n const values = map.get(key);\n if (values) {\n array_1.removeUnordered(values, value);\n if (values.length === 0)\n map.delete(key);\n }\n}", "title": "" }, { "docid": "e71b42c04935573c2b61630766d569e8", "score": "0.6652174", "text": "function _cleanupKeys()\n {\n if (this._count == this._keys.length) {\n return;\n }\n var srcIndex = 0;\n var destIndex = 0;\n var seen = {};\n while (srcIndex < this._keys.length) {\n var key = this._keys[srcIndex];\n if (_hasKey(this._map, key)\n && !_hasKey(seen, key)\n ) {\n this._keys[destIndex++] = key;\n seen[key] = true;\n }\n srcIndex++;\n }\n this._keys.length = destIndex;\n }", "title": "" }, { "docid": "2e7e617e2f307a994e40d7471623ce92", "score": "0.6530006", "text": "function clear() {\n this.keys.forEach((key) => {\n this._store[key] = undefined;\n delete this._store[key];\n });\n}", "title": "" }, { "docid": "a4da9f05dee3cc1204c2edb2808f3c0d", "score": "0.6267597", "text": "remove() {\n for (var key of this.keys) {\n this.elements[key].remove();\n }\n }", "title": "" }, { "docid": "7a6134218067b617cdd8cfa10aaf3025", "score": "0.62582785", "text": "function mapClear(){this.__data__={'hash':new Hash(),'map':Map?new Map():[],'string':new Hash()};}", "title": "" }, { "docid": "7a6134218067b617cdd8cfa10aaf3025", "score": "0.62582785", "text": "function mapClear(){this.__data__={'hash':new Hash(),'map':Map?new Map():[],'string':new Hash()};}", "title": "" }, { "docid": "7a6134218067b617cdd8cfa10aaf3025", "score": "0.62582785", "text": "function mapClear(){this.__data__={'hash':new Hash(),'map':Map?new Map():[],'string':new Hash()};}", "title": "" }, { "docid": "5009edd161fca6726caf92268f708f31", "score": "0.617115", "text": "function mapClear() {\n this.__data__ = { 'hash': new Hash, 'map': Map ? new Map : [], 'string': new Hash };\n }", "title": "" }, { "docid": "5009edd161fca6726caf92268f708f31", "score": "0.617115", "text": "function mapClear() {\n this.__data__ = { 'hash': new Hash, 'map': Map ? new Map : [], 'string': new Hash };\n }", "title": "" }, { "docid": "5009edd161fca6726caf92268f708f31", "score": "0.617115", "text": "function mapClear() {\n this.__data__ = { 'hash': new Hash, 'map': Map ? new Map : [], 'string': new Hash };\n }", "title": "" }, { "docid": "3608b575d5617142faefd31f6f9fa1bc", "score": "0.6166302", "text": "function mapClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': Map ? new Map : [],\n\t 'string': new Hash\n\t };\n\t }", "title": "" }, { "docid": "5b5c38b74bc0e352cc4ba7d1376c5daf", "score": "0.61519635", "text": "remove(key) {\r\n const hash = this.calculateHash(key);\r\n if(this.values.hasOwnProperty(hash) && this.values[hash].hasOwnProperty(key)) {\r\n delete this.values[hash][key];\r\n this.numberOfValues--;\r\n }\r\n }", "title": "" }, { "docid": "4d5c2a4635390609e98faafdc516474d", "score": "0.614778", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "4d5c2a4635390609e98faafdc516474d", "score": "0.614778", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "4d5c2a4635390609e98faafdc516474d", "score": "0.614778", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "4d5c2a4635390609e98faafdc516474d", "score": "0.614778", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "4d5c2a4635390609e98faafdc516474d", "score": "0.614778", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "4d5c2a4635390609e98faafdc516474d", "score": "0.614778", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "4d5c2a4635390609e98faafdc516474d", "score": "0.614778", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "4d5c2a4635390609e98faafdc516474d", "score": "0.614778", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "4d5c2a4635390609e98faafdc516474d", "score": "0.614778", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "a0a56adfb720ce3555c9c9207f5175a6", "score": "0.6128783", "text": "function mapClear() {\n\t this.__data__ = {\n\t 'hash': new Hash(),\n\t 'map': Map ? new Map() : [],\n\t 'string': new Hash()\n\t };\n\t}", "title": "" }, { "docid": "3eea86690b18488117e6437f5f4a53e3", "score": "0.6107819", "text": "function mapClear() {\n\t this.__data__ = { 'hash': new Hash, 'map': Map ? new Map : [], 'string': new Hash };\n\t}", "title": "" }, { "docid": "2ffb2927052dfe95c334271bdac0fec2", "score": "0.61020905", "text": "function mapClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': Map ? new Map : [],\n\t 'string': new Hash\n\t };\n\t}", "title": "" }, { "docid": "2ffb2927052dfe95c334271bdac0fec2", "score": "0.61020905", "text": "function mapClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': Map ? new Map : [],\n\t 'string': new Hash\n\t };\n\t}", "title": "" }, { "docid": "2ffb2927052dfe95c334271bdac0fec2", "score": "0.61020905", "text": "function mapClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': Map ? new Map : [],\n\t 'string': new Hash\n\t };\n\t}", "title": "" }, { "docid": "2ffb2927052dfe95c334271bdac0fec2", "score": "0.61020905", "text": "function mapClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': Map ? new Map : [],\n\t 'string': new Hash\n\t };\n\t}", "title": "" }, { "docid": "2ffb2927052dfe95c334271bdac0fec2", "score": "0.61020905", "text": "function mapClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': Map ? new Map : [],\n\t 'string': new Hash\n\t };\n\t}", "title": "" }, { "docid": "2ffb2927052dfe95c334271bdac0fec2", "score": "0.61020905", "text": "function mapClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': Map ? new Map : [],\n\t 'string': new Hash\n\t };\n\t}", "title": "" }, { "docid": "b5f607226e74c5ffb736134de103b60d", "score": "0.60481024", "text": "clear() {\n this.map = {};\n if (this.store) this.store.clear();\n }", "title": "" }, { "docid": "83c7e7b35b6f37e30252cf7260393933", "score": "0.60264283", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n}", "title": "" }, { "docid": "83c7e7b35b6f37e30252cf7260393933", "score": "0.60264283", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n}", "title": "" }, { "docid": "83c7e7b35b6f37e30252cf7260393933", "score": "0.60264283", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n}", "title": "" }, { "docid": "83c7e7b35b6f37e30252cf7260393933", "score": "0.60264283", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n}", "title": "" }, { "docid": "83c7e7b35b6f37e30252cf7260393933", "score": "0.60264283", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n}", "title": "" }, { "docid": "83c7e7b35b6f37e30252cf7260393933", "score": "0.60264283", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n}", "title": "" }, { "docid": "83c7e7b35b6f37e30252cf7260393933", "score": "0.60264283", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n}", "title": "" }, { "docid": "f1df703a47fd416cce72ca5665902deb", "score": "0.6025953", "text": "function clear()\r{\r\tvar end = mapping_names.length;\r\r\tfor(var i=end-1; i>=0; i--){\r\t\tremove(mapping_names[i]);\r\t}\r\twhile(mapping_names.pop());\r\twhile(mapping_sources.pop());\r\twhile(mapping_destinations.pop());\r\twhile(mapping_algorithms.pop());\r}", "title": "" }, { "docid": "7324f929a0601e66adb582ca28e173d0", "score": "0.6008959", "text": "function filterMutateMap(map, predicate) {\n for (const [key, value] of map) {\n if (!predicate(key, value)) {\n map.delete(key);\n }\n }\n}", "title": "" }, { "docid": "b75a50c92f3d999eafc798f021bc4b92", "score": "0.60038495", "text": "delete(key) {\n this.map[key] = undefined;\n if (this.store) this.store.removeItem(key);\n }", "title": "" }, { "docid": "9f0360ebb1cbacf000c94f6b876da995", "score": "0.5983478", "text": "mapRemove() {\n\n\t\tthis.map.remove();\n\n\t}", "title": "" }, { "docid": "6b4008987563826317e5b45ceb7a883a", "score": "0.59401333", "text": "garbageCollect() {\n // Q: Can we delete keys from the map while iterating over it?\n // A: The ECMA spec states that yes, keys may be deleted during forEach.\n // It is less clear for iterators.\n let deleteBefore = new Date().getTime() - MAX_GLOBAL_COOLDOWN;\n this._cooldowns.forEach((value, key) => {\n if (value < deleteBefore) {\n this._cooldowns.delete(key);\n }\n });\n }", "title": "" }, { "docid": "37fa4e7e453c4b56aa3e3d0b66a36538", "score": "0.5922161", "text": "function clearAll(){\r\n\tObject.keys(this.datastore).forEach((key)=>\r\n\t{\r\n\t\tdelete this.datastore[key];\r\n\t});\t\r\n}", "title": "" }, { "docid": "b0d34fe72bd528d575ee699ed01f08bc", "score": "0.5904722", "text": "async clear() {\n return await keyv.clear();\n }", "title": "" }, { "docid": "f3aff239abb19ece81794e489cfbb24f", "score": "0.5903561", "text": "clear() {\n for (const key of Object.keys(this.datastore)) {\n delete this.datastore[key];\n // this.remove(key);\n }\n }", "title": "" }, { "docid": "9ee986f053b39389acbbe858887ee6f1", "score": "0.58624434", "text": "function clearObjects() {\n setMapOnAll(null);\n}", "title": "" }, { "docid": "111ad65f61d64a40736c44047c23538e", "score": "0.58589303", "text": "clear() {\n const _ = this;\n _._map.clear();\n _._nameSet.clear();\n }", "title": "" }, { "docid": "676caf4729828e7ec2aacb0ecd70d147", "score": "0.5847903", "text": "function mapCacheClear(){this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "676caf4729828e7ec2aacb0ecd70d147", "score": "0.5847903", "text": "function mapCacheClear(){this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "676caf4729828e7ec2aacb0ecd70d147", "score": "0.5847903", "text": "function mapCacheClear(){this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "676caf4729828e7ec2aacb0ecd70d147", "score": "0.5847903", "text": "function mapCacheClear(){this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "2e82c3ab8fbc88de012975d43faaf789", "score": "0.58467245", "text": "function clear () {\n keys().each(function (cookie) {\n remove(cookie);\n });\n }", "title": "" }, { "docid": "6b1355c4db15b5ca80a21844347360ca", "score": "0.5841128", "text": "function clean_maps() {\n var count;\n list_maps();\n\n for (var k in maps) {\n for (var i = 0; i < maps[k].length; i++) {\n var map = maps[k][i];\n count++;\n\n // if map render job is idle and last render process is older than\n // an hour, remove map\n if (map.renderer_idle && (time() - map.renderer_stop > 3600000)) {\n console.log(k + '/' + i + ': garbage collector removes map');\n maps[k].splice(i, 1);\n i--;\n }\n }\n }\n}", "title": "" }, { "docid": "a5a97a03c63f1e323511c727b3c8aef2", "score": "0.58262974", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map$1||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "104448b62b50e5d5999eb71eaad62465", "score": "0.57226574", "text": "stopAll() {\n const _ = this;\n for (const entry of _._map.values()) {\n clearTimeout(entry.handle);\n }\n _._map.clear();\n }", "title": "" }, { "docid": "ec283d00f2860b4c105f699aaad1355f", "score": "0.5719132", "text": "function mapCacheClear() {\n\t\t this.size = 0;\n\t\t this.__data__ = {\n\t\t 'hash': new Hash,\n\t\t 'map': new (Map || ListCache),\n\t\t 'string': new Hash\n\t\t };\n\t\t}", "title": "" }, { "docid": "30f06520d9728e5c00e76d452ebdfe52", "score": "0.5708688", "text": "function mapCacheClear() {\n\t\t this.__data__ = {\n\t\t 'hash': new Hash,\n\t\t 'map': new (Map || ListCache),\n\t\t 'string': new Hash\n\t\t };\n\t\t}", "title": "" }, { "docid": "30f06520d9728e5c00e76d452ebdfe52", "score": "0.5708688", "text": "function mapCacheClear() {\n\t\t this.__data__ = {\n\t\t 'hash': new Hash,\n\t\t 'map': new (Map || ListCache),\n\t\t 'string': new Hash\n\t\t };\n\t\t}", "title": "" }, { "docid": "9315d4b174dcbeffb03e5bf67e56b213", "score": "0.57040244", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new _Hash,\n 'map': new (_Map || _ListCache),\n 'string': new _Hash\n };\n }", "title": "" }, { "docid": "96dbd6871f2d1622b7b01ba8f7ac8d1c", "score": "0.56992704", "text": "function mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash(),\n 'map': new (Map$1 || ListCache)(),\n 'string': new Hash()\n };\n }", "title": "" }, { "docid": "96dbd6871f2d1622b7b01ba8f7ac8d1c", "score": "0.56992704", "text": "function mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash(),\n 'map': new (Map$1 || ListCache)(),\n 'string': new Hash()\n };\n }", "title": "" }, { "docid": "32a9961e480604db2a24b675d2b38471", "score": "0.5689804", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new _Hash(),\n 'map': new (_Map || _ListCache)(),\n 'string': new _Hash()\n };\n }", "title": "" }, { "docid": "04fc9516f6694f0801ea1905305b2bad", "score": "0.5685224", "text": "clearance () {\n mapDoS.forEach((val, key, map) => {\n if (val.at < moment().utc().subtract(val.interval, 'seconds')) {\n map.delete(key)\n }\n })\n }", "title": "" }, { "docid": "a5cf7e31e8fdae5ddefbb2fe49e4cae8", "score": "0.5684027", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new _Hash.default(),\n 'map': new (_Map.default || _ListCache.default)(),\n 'string': new _Hash.default()\n };\n }", "title": "" }, { "docid": "c0aabc8a9687c6a5536b4ecbc33083ae", "score": "0.5682696", "text": "function mapCacheClear() {\n\t this.size = 0;\n\t this.__data__ = {\n\t 'hash': new _Hash(),\n\t 'map': new (_Map || _ListCache)(),\n\t 'string': new _Hash()\n\t };\n\t}", "title": "" }, { "docid": "27733fce2253c9ed08bc78fafd4ad5e4", "score": "0.56815845", "text": "function clearEntry () {\n\n nextValue = null;\n}", "title": "" }, { "docid": "4285e41191ba30ec22cb2d0d124fadbf", "score": "0.56811434", "text": "remove(key) {\n let index = this._hash(key);\n if (this.keyMap[index] && this.keyMap[index].length) {\n this.keyMap[index] = undefined;\n this.size--;\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "e9e1341c2eae1e68f1aba8da71a0ccd2", "score": "0.5673945", "text": "function mapCacheClear() {\n\t this.size = 0;\n\t this.__data__ = {\n\t 'hash': new _Hash,\n\t 'map': new (_Map || _ListCache),\n\t 'string': new _Hash\n\t };\n\t}", "title": "" }, { "docid": "e9e1341c2eae1e68f1aba8da71a0ccd2", "score": "0.5673945", "text": "function mapCacheClear() {\n\t this.size = 0;\n\t this.__data__ = {\n\t 'hash': new _Hash,\n\t 'map': new (_Map || _ListCache),\n\t 'string': new _Hash\n\t };\n\t}", "title": "" }, { "docid": "e9e1341c2eae1e68f1aba8da71a0ccd2", "score": "0.5673945", "text": "function mapCacheClear() {\n\t this.size = 0;\n\t this.__data__ = {\n\t 'hash': new _Hash,\n\t 'map': new (_Map || _ListCache),\n\t 'string': new _Hash\n\t };\n\t}", "title": "" }, { "docid": "e9e1341c2eae1e68f1aba8da71a0ccd2", "score": "0.5673945", "text": "function mapCacheClear() {\n\t this.size = 0;\n\t this.__data__ = {\n\t 'hash': new _Hash,\n\t 'map': new (_Map || _ListCache),\n\t 'string': new _Hash\n\t };\n\t}", "title": "" }, { "docid": "8b3ae011b83a8d6ab25b7ed437306025", "score": "0.5673529", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map$1 || ListCache),\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "8b3ae011b83a8d6ab25b7ed437306025", "score": "0.5673529", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map$1 || ListCache),\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "6cf1932ba6ebe9c38e7612d9a92961cc", "score": "0.5672286", "text": "function mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map$1 || ListCache),\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "6cf1932ba6ebe9c38e7612d9a92961cc", "score": "0.5672286", "text": "function mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map$1 || ListCache),\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "6cf1932ba6ebe9c38e7612d9a92961cc", "score": "0.5672286", "text": "function mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map$1 || ListCache),\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "26754389bb3c52b41fb4dc52cb191e9e", "score": "0.5660965", "text": "function clearAllMarkers() {\n setMarkersOnMap(null);\n}", "title": "" }, { "docid": "7390261772898beaf5df2586321c0709", "score": "0.5659265", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash(),\n 'map': new (Map || ListCache)(),\n 'string': new Hash()\n };\n }", "title": "" }, { "docid": "7390261772898beaf5df2586321c0709", "score": "0.5659265", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash(),\n 'map': new (Map || ListCache)(),\n 'string': new Hash()\n };\n }", "title": "" }, { "docid": "52c87104e35da88f2b20fc9ed344feae", "score": "0.5655427", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new _Hash,\n 'map': new (_Map || _ListCache),\n 'string': new _Hash\n };\n }", "title": "" }, { "docid": "52c87104e35da88f2b20fc9ed344feae", "score": "0.5655427", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new _Hash,\n 'map': new (_Map || _ListCache),\n 'string': new _Hash\n };\n }", "title": "" }, { "docid": "52c87104e35da88f2b20fc9ed344feae", "score": "0.5655427", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new _Hash,\n 'map': new (_Map || _ListCache),\n 'string': new _Hash\n };\n }", "title": "" }, { "docid": "4bc1f98f0b99d888642d1217b7046113", "score": "0.56540984", "text": "clear () {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n this.forEach(function (_value, key, map) {\n typeMapDelete(transaction, map, key)\n })\n })\n } else {\n /** @type {Map<string, any>} */ (this._prelimContent).clear()\n }\n }", "title": "" }, { "docid": "c28a90dfad83ee7095f008fb9c8a2bed", "score": "0.5646518", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map$1 || ListCache),\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "67e3f2015a3bf7ba22f50d185a14de58", "score": "0.56439686", "text": "function mapCacheClear() {\n\tthis.size = 0;\n\tthis.__data__ = {\n\t\thash: new _Hash(),\n\t\tmap: new ( _Map || _ListCache )(),\n\t\tstring: new _Hash(),\n\t};\n}", "title": "" }, { "docid": "aa749bce53c20cc2e857399e5c99ed88", "score": "0.5634391", "text": "function mapCacheClear() {\n\t this.__data__ = {\n\t 'hash': new Hash(),\n\t 'map': new (Map || ListCache)(),\n\t 'string': new Hash()\n\t };\n\t }", "title": "" }, { "docid": "a11db3bf77d6b48eedb3b54161cd6fa5", "score": "0.5630649", "text": "function clearAllMarkers() {\n setAllMap(null);\n}", "title": "" }, { "docid": "931a8c4bc72a2ee7e0021e8dd2a102c5", "score": "0.5630361", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash(),\n 'map': new (Map || ListCache)(),\n 'string': new Hash()\n };\n }", "title": "" }, { "docid": "931a8c4bc72a2ee7e0021e8dd2a102c5", "score": "0.5630361", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash(),\n 'map': new (Map || ListCache)(),\n 'string': new Hash()\n };\n }", "title": "" }, { "docid": "931a8c4bc72a2ee7e0021e8dd2a102c5", "score": "0.5630361", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash(),\n 'map': new (Map || ListCache)(),\n 'string': new Hash()\n };\n }", "title": "" } ]
2b364528760b6b02795ae8488b953db7
Computes a final transform result after the transform has been acknowledged by the server, potentially using the serverprovided transformResult.
[ { "docid": "39d273d9de14d4aaa836412f3fbccc55", "score": "0.0", "text": "function Ne(t, e, n) {\n // The server just sends null as the transform result for array operations,\n // so we have to calculate a result the same as we do for local\n // applications.\n return t instanceof $e ? Oe(t, e) : t instanceof Fe ? Me(t, e) : n;\n}", "title": "" } ]
[ { "docid": "d00a3645bf880b15f565f347b6d6ea3f", "score": "0.6185749", "text": "withResultTransform(transform) {\n _classPrivateFieldBase(this, _transformResult)[_transformResult] = transform;\n return this;\n }", "title": "" }, { "docid": "cdb928f02f006f0e6ec56f50d3e24df2", "score": "0.56374353", "text": "function ReturnResult(result) {\n if (errors.length) {\n result.errors = errors;\n }\n var state = data.state;\n if (state) {\n var AMS = MathJax.Extension[\"TeX/AMSmath\"];\n var GLYPH = (MathJax.OutputJax.SVG||{}).BBOX.GLYPH;\n state.AMS.startNumber = AMS.startNumber;\n state.AMS.labels = AMS.labels;\n state.AMS.IDs = AMS.IDs;\n state.mmlID = MathJax.ElementJax.mml.SUPER.ID;\n state.glyphs = GLYPH.glyphs;\n state.defs = GLYPH.defs;\n state.n = GLYPH.n;\n state.ID = ID;\n }\n serverState = STATE.READY;\n callback(result, originalData);\n if (serverState === STATE.READY) StartQueue();\n}", "title": "" }, { "docid": "5a809acc9ec4bb623070283e4d303d26", "score": "0.5542237", "text": "function finish (err, result) {\n self.emit([ 'dispatch', 'post' ], event, err || null, result || null);\n out(err, result);\n }", "title": "" }, { "docid": "f491066e6ff66574246d0f63e10dce17", "score": "0.5179141", "text": "function transmitTransformations(payload) {\n\n var runPayload = angular.copy(payload);\n Util.ensureUniqueParameterMappingVars(runPayload.task.job.mappings);\n\n var finishMessage = createTransformationStatusMessage(runPayload.task, runPayload.persist);\n\n var finalPayload = Util.toJson(runPayload);\n\n ngProgress.start();\n\n if(finalPayload.persist) { delete finalPayload['at_most']; }\n\n TaskResource.execute({}, finalPayload).$promise.then(function(result) {\n ngProgress.complete();\n showAlert.show($scope, 'info', finishMessage('successfully finished.'));\n PubSub.broadcast('transformationFinished', result);\n }, function(resp) {\n ngProgress.complete();\n showAlert.show($scope, 'danger', finishMessage('failed.'), 5000);\n console.log(resp);\n $window.alert(resp.message || resp.data.error);\n });\n }", "title": "" }, { "docid": "e66ab05710c742683c89b6176402aafc", "score": "0.516601", "text": "function finish() {\n t.equal(counts.transform, 1, 'Transform only performed once.')\n t.equal(counts.bundle, called, 'Bundle called twice.')\n t.end()\n }", "title": "" }, { "docid": "bd49b11b4af3f6296a1c470b0bd3cb25", "score": "0.51098514", "text": "function subproviderEnd(err, result) {\n if (err) return end(err)\n if (result)\n res.result = result\n end()\n }", "title": "" }, { "docid": "2058bf683ec041688b481c935bce5045", "score": "0.5092443", "text": "updateTransform(){}", "title": "" }, { "docid": "ade51fd2d358119bc42465c0f01489f2", "score": "0.5072195", "text": "function gotResult(err, img) {\n resultImg.attribute('src', img.src);\n if (isTransferring) {\n style.transfer(gotResult);\n }\n}", "title": "" }, { "docid": "9547c4ed642605ab358a6f5f0e093f44", "score": "0.50393987", "text": "TransformFinalBlock() {\n\n }", "title": "" }, { "docid": "2d75d03c9a22554a6168068a350319ae", "score": "0.4943742", "text": "function transform() {\n xsltProcessor = new XSLTProcessor();\n xsltProcessor.importStylesheet(xsltFile);\n resultDocument = xsltProcessor.transformToFragment(pmmlDoc, document);\n console.log(resultDocument);\n return {code: resultDocument.textContent};\n}", "title": "" }, { "docid": "c7309bc7fe1f710f169277a2a1115556", "score": "0.49426156", "text": "function successHandler(){\n doLater(function(){\n if(onSuccess){\n let callbackResult;\n try {\n callbackResult = onSuccess(operation.result);\n } catch (error) {\n proxyOp.fail(error);\n return;\n }\n proxyOp.resolve(callbackResult);\n } else {\n proxyOp.resolve(operation.result);\n }\n })\n }", "title": "" }, { "docid": "a15363169c16ccc21be2eb8e71548b7d", "score": "0.49095827", "text": "_final(cb) {\n // flush outstream\n this.flushOutstream(true)\n .then(() => {\n cb();\n })\n .catch((err) => cb(err)); // cb and return\n }", "title": "" }, { "docid": "1af74d3aef3fbda685424d8f6c4d1716", "score": "0.48833323", "text": "get transform() {}", "title": "" }, { "docid": "1af74d3aef3fbda685424d8f6c4d1716", "score": "0.48833323", "text": "get transform() {}", "title": "" }, { "docid": "1af74d3aef3fbda685424d8f6c4d1716", "score": "0.48833323", "text": "get transform() {}", "title": "" }, { "docid": "1af74d3aef3fbda685424d8f6c4d1716", "score": "0.48833323", "text": "get transform() {}", "title": "" }, { "docid": "e8a31a824e19c38c3ae3cd62e5328b2f", "score": "0.4821506", "text": "function applyTransforms(transforms, t, callback) {\n log.debug('applying', transforms.length, 'transforms');\n for (var i = 0; i < transforms.length; i++) {\n var transform = transforms[i];\n log.debug('next transform', transform);\n if (transform.isAsync) {\n log.debug('transform is asynchronous');\n // asynchronous case\n return transform(t, function(t) {\n // this is only called when the async transform was successful,\n // otherwise t.callback has already been called with an error.\n log.debug('asynchronous transform finished successfully, applying ' +\n 'remaining transforms.');\n applyTransforms(transforms.slice(i + 1), t, callback);\n });\n } else {\n log.debug('transform is synchronous');\n // synchronous case\n var result = transform(t);\n if (!result) {\n log.debug('transform has failed');\n // stop processing t.callback has already been called\n return;\n }\n log.debug('transform successful');\n }\n }\n log.debug('all transforms done');\n return process.nextTick(function() {\n callback(t);\n });\n}", "title": "" }, { "docid": "9d9849a7c8c95e85a48166592a220971", "score": "0.48159802", "text": "function final(result , delay) { console.log('Finaal: ', result , \" na \" + delay + \" msec.\"); }", "title": "" }, { "docid": "0f65d00a35a7b837eb0e571a112e78f6", "score": "0.47981235", "text": "function handleExecResult(m, workerIdx) {\n\tvar job = jobs[m.context.jobID];\n\t\t\n\tjob.cb(m.err, m.result);\n\n\t// Worker is finished.\n\tworkerJobCount[workerIdx]--;\n\tdispatchWorkItems();\n}", "title": "" }, { "docid": "d9d27e668477b1348d6b848a0fab4dc9", "score": "0.478705", "text": "function TransformResult(ast) {\n var extra = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n _classCallCheck$5(this, TransformResult);\n\n this._ast = ast;\n this._source = null;\n this._string = null;\n this._regexp = null;\n this._extra = extra;\n }", "title": "" }, { "docid": "9cb521e841a9a12ca07e53a51e90f04e", "score": "0.47732267", "text": "multiplyMatrixTransform(other, result) {\n if (!result)\n return Transform_1.Transform.createRefs(this.multiplyXYZ(other.origin.x, other.origin.y, other.origin.z), this.multiplyMatrixMatrix(other.matrix));\n // be sure to do the point mulitplication first before aliasing changes the matrix ..\n this.multiplyXYZtoXYZ(other.origin, result.origin);\n this.multiplyMatrixMatrix(other.matrix, result.matrix);\n return result;\n }", "title": "" }, { "docid": "fa6ae970177e228816a5d9c66cb549ab", "score": "0.4770614", "text": "getResult() {\n const state = this.operation.state;\n return state.result;\n }", "title": "" }, { "docid": "686492d540e866f4913123182e9f60e5", "score": "0.476125", "text": "function finalize(promise, resolve, reject, value, transform) {\n\t setImmediate(function () {\n\t try {\n\t // Transform the value through and check whether it's a promise\n\t value = transform(value);\n\t transform = value && (is(obj, value) | is(func, value)) && value.then;\n\t // Return the result if it's not a promise\n\t if (!is(func, transform))\n\t resolve(value);\n\t // If it's a promise, make sure it's not circular\n\t else if (value == promise)\n\t reject(TypeError());\n\t // Take over the promise's state\n\t else\n\t transform.call(value, resolve, reject);\n\t }\n\t catch (error) { reject(error); }\n\t });\n\t }", "title": "" }, { "docid": "bfb19cd88baa9a0b458bf9440f6430ad", "score": "0.47581935", "text": "function handleResult(err, result) {\n if (err) {\n // Just an example. You may want to do something with the error.\n console.error(\"ERROR BACKUP...ERROR BACKUP\");\n // You should return in this branch, since there is no result to use\n // later and that could cause an exception.\n res.send('fail');\n return;\n }else{\n //else means the function has been complete\n console.log(\"SUCCESS\");\n res.send('done');\n }\n }", "title": "" }, { "docid": "08b4553d9e8c2c8d55100864099b0733", "score": "0.4751044", "text": "function TransformProcessor () {}", "title": "" }, { "docid": "bd7398521b08ef8dc7f44187dc5f4489", "score": "0.47426096", "text": "function getResult() {\n return result;\n }", "title": "" }, { "docid": "b8aadef624ecf218f587410b881cc31e", "score": "0.47418705", "text": "function finalResultDisplay() {\r\n let finalResult = result.join('');\r\n resultElement.innerHTML = finalResult;\r\n }", "title": "" }, { "docid": "4a34bbcb5f109d4604702af8c018f766", "score": "0.47378", "text": "transformResource (resourceObject, transformConfig, transformationService, result, extractPath) {\n extractPath = extractPath || [];\n const curValue = _.get(transformConfig, extractPath, transformConfig);\n const keys = Object.keys(curValue);\n const isEndKey = _.includes(keys, 'path');\n if (isEndKey) {\n const transformations = curValue.transform;\n const selectPath = curValue.path;\n result = _.merge(\n result,\n this.transformResourceField(resourceObject, selectPath, extractPath, transformations, transformationService)\n );\n } else {\n keys.forEach((key) => {\n if (_.isObject(curValue[key])) {\n const newExtractPath = extractPath.slice();\n newExtractPath.push(key);\n this.transformResource(resourceObject, transformConfig, transformationService, result, newExtractPath);\n }\n });\n }\n }", "title": "" }, { "docid": "a9e476ca73eb6b7b8c3f697f8e49bffe", "score": "0.47374636", "text": "reduce_result(z_result, h_node) {\n\t\tlet {\n\t\t\tgroup: k_group,\n\t\t\treductions: k_pairwise_tree,\n\t\t\treduce_task: h_task_ready,\n\t\t} = this;\n\n\t\t// final result\n\t\tif(HP_WORKER_NOTIFICATION !== z_result) {\n\t\t\tlet z_completion = this.complete_callback(z_result);\n\n\t\t\t// add to outer stream\n\t\t\tif(z_completion instanceof active_group) {\n\t\t\t\tlet k_lake = this.lake();\n\t\t\t\tlet fk_lake = k_lake.complete_callback;\n\t\t\t\tlet hp_lock = Symbol('key');\n\n\t\t\t\tz_completion.end(() => {\n\t\t\t\t\tk_group.unlock(hp_lock);\n\t\t\t\t});\n\n\t\t\t\t// rewrap completion callback function\n\t\t\t\tk_lake.complete_callback = () => {\n\t\t\t\t\tk_group.wait(hp_lock, () => {\n\t\t\t\t\t\tfk_lake();\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\t// notification\n\t\telse {\n\t\t\tif(this.debug) {\n\t\t\t\tconsole.warn('\\t == committed '+h_node.left+' </> '+h_node.right);\n\t\t\t}\n\n\t\t\t// able to perform a reduction\n\t\t\tlet h_merge = k_pairwise_tree.commit(h_node);\n\t\t\t// k_pairwise_tree.print();\n\t\t\tif(h_merge) {\n\t\t\t\tif(this.debug) {\n\t\t\t\t\tconsole.warn('merged '+h_merge.node.left+' <-> '+h_merge.node.right);\n\t\t\t\t}\n\t\t\t\tlet k_worker = h_node.item.worker;\n\n\t\t\t\t// this reduction will be the last one; do not hold result\n\t\t\t\tif(h_merge.makes_root) {\n\t\t\t\t\th_task_ready = Object.assign({}, h_task_ready);\n\t\t\t\t\th_task_ready.hold = false;\n\t\t\t\t}\n\n\t\t\t\t// after reduction;\n\t\t\t\tlet fk_reduction = (z_result_reduction, i_task_reduction, k_worker_reduction) => {\n\t\t\t\t\t// if(this.debug) debugger;\n\n\t\t\t\t\t// recurse on reduction; update sender for callback scope\n\t\t\t\t\tthis.reduce_result(z_result_reduction, Object.assign(h_merge.node, {\n\t\t\t\t\t\titem: {\n\t\t\t\t\t\t\tworker: k_worker_reduction,\n\t\t\t\t\t\t\ttask_id: i_task_reduction,\n\t\t\t\t\t\t},\n\t\t\t\t\t}));\n\t\t\t\t};\n\n\t\t\t\t// give reduction task to worker that finished earlier; pass to the right\n\t\t\t\tif(k_worker === h_merge.left.worker) {\n\t\t\t\t\tk_group.relay({\n\t\t\t\t\t\tdebug: this.debug,\n\t\t\t\t\t\tsender: h_node.item,\n\t\t\t\t\t\treceiver: h_merge.right,\n\t\t\t\t\t\treceiver_primary: false,\n\t\t\t\t\t\ttask_ready: h_task_ready,\n\t\t\t\t\t}, fk_reduction);\n\t\t\t\t}\n\t\t\t\t// pass to the left\n\t\t\t\telse {\n\t\t\t\t\tk_group.relay({\n\t\t\t\t\t\tdebug: this.debug,\n\t\t\t\t\t\tsender: h_node.item,\n\t\t\t\t\t\treceiver: h_merge.left,\n\t\t\t\t\t\treceiver_primary: true,\n\t\t\t\t\t\ttask_ready: h_task_ready,\n\t\t\t\t\t}, fk_reduction);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "07b894f5b1185183b8d36289f9063abd", "score": "0.47334436", "text": "function cb(res) {\n setTimeout(function() {\n result = res;\n }, 0);\n }", "title": "" }, { "docid": "d4e8ffb9ece0f7d30213c7a90a4fa7ae", "score": "0.47319594", "text": "_flush(cb) {\n console.log(\"this method is called at the end of all transformations\");\n }", "title": "" }, { "docid": "5c75d427aa94d35d3327e1fb1421b22d", "score": "0.472595", "text": "__debouncedOnEnd(result) {\n var onEnd = this.__onEnd;\n this.__onEnd = null;\n onEnd && onEnd(result);\n }", "title": "" }, { "docid": "28b4e1f55ebe978f16509c1e4d4d2405", "score": "0.47140092", "text": "finish() {\r\n this.updateStatus('success');\r\n\r\n // Prepare variables\r\n let transferCompleteMessage = indiwt.transferCompleteMessage;\r\n let transferCompleteShowUrl = indiwt.transferCompleteShowUrl ? indiwt.transferCompleteShowUrl : 'false';\r\n if (this.getType() === 'cf7') {\r\n transferCompleteMessage = indiwt_cf7.transferCompleteMessage;\r\n transferCompleteShowUrl = indiwt_cf7.transferCompleteShowUrl ? indiwt_cf7.transferCompleteShowUrl : 'false';\r\n }\r\n\r\n // Update template\r\n this.replaceTemplate(SuccessTemplate, [\r\n {'${message}': transferCompleteMessage},\r\n {'${showurl}': transferCompleteShowUrl},\r\n {'${url}': this.transfer.url}\r\n ]);\r\n\r\n // Update form field\r\n this.updateForFieldValue();\r\n\r\n // Trigger success event\r\n this.triggerSuccessEvent();\r\n }", "title": "" }, { "docid": "48d0bc4103cf97ca93b8168213d46a3f", "score": "0.47081336", "text": "function SuccessFrameGrabberRecognizerResult(nativeResult) {\n RecognizerResult.call(this, nativeResult.resultState);\n /** Camera frame at the time slave recognizer finished recognition */\n this.successFrame = nativeResult.successFrame;\n}", "title": "" }, { "docid": "8a4c514dae5deb6102f575b9398826d0", "score": "0.4698437", "text": "onSuccess() {\n this.emit(\"success\");\n this.cleanup();\n }", "title": "" }, { "docid": "f991ee1cb0aed44052971712f691e1c1", "score": "0.46775207", "text": "async function onFinish() {\n\n results.sections.length === 0 && evaluate(); // no evaluation results? => evaluate now\n results.total = results.sections.length; // add total number of gaps in result data\n\n // update buttons and remove progress bar\n $.render( $.html( self.html.buttons, self, onReset ), self.element.querySelector( '#buttons' ) );\n $.render( $.html( self.html.conclusion ), self.element.querySelector( '#conclusion' ) );\n\n self.logger && self.logger.log( 'finish', $.clone( results ) ); // logging of 'finish' event\n $.onFinish( self ); // trigger finish actions\n\n }", "title": "" }, { "docid": "73bfa5085c1215c3153995d7129c0a25", "score": "0.46722344", "text": "commit() {\n if (!this.body.isSimulationRunning && this.transform) {\n this.body.restoreTransform = null;\n }\n }", "title": "" }, { "docid": "6293a4bddf3f278ae637fd761087a9a2", "score": "0.4660224", "text": "async function pushClientResult(payload) {\n await _pushClientResult(payload);\n\n const { useCase, name, iteration } = getCurrentContext();\n\n let postProcessingResult;\n if (useCase.postProcess != null) {\n orchestratorLogger.console.log(\n `Post processing use case \"${highlight(name)}\", iteration ${highlight(iteration)}`,\n );\n const data = results.results[name].iterations[iteration];\n postProcessingResult = await useCase.postProcess({\n data,\n console: orchestratorLogger.console,\n useCase,\n name,\n iteration,\n });\n }\n await pushPostProcessingResult({ useCase: name, iteration, data: postProcessingResult });\n }", "title": "" }, { "docid": "cff0fe3d2ee2b0de79d40e13ab3fda04", "score": "0.46460468", "text": "function taskCompleted(res) {\n that.state = \"COMPLETED\";\n that.result = res != null ? res : null;\n return res;\n }", "title": "" }, { "docid": "2b4d4de6d6d83aa10cebd088643412c7", "score": "0.4638592", "text": "onSuccess() {\n this.emit(\"success\");\n this.cleanup();\n }", "title": "" }, { "docid": "2b4d4de6d6d83aa10cebd088643412c7", "score": "0.4638592", "text": "onSuccess() {\n this.emit(\"success\");\n this.cleanup();\n }", "title": "" }, { "docid": "2b4d4de6d6d83aa10cebd088643412c7", "score": "0.4638592", "text": "onSuccess() {\n this.emit(\"success\");\n this.cleanup();\n }", "title": "" }, { "docid": "2b4d4de6d6d83aa10cebd088643412c7", "score": "0.4638592", "text": "onSuccess() {\n this.emit(\"success\");\n this.cleanup();\n }", "title": "" }, { "docid": "2b4d4de6d6d83aa10cebd088643412c7", "score": "0.4638592", "text": "onSuccess() {\n this.emit(\"success\");\n this.cleanup();\n }", "title": "" }, { "docid": "46ab3359098a2d6c61113f6f203e90bc", "score": "0.4622646", "text": "done(error) {\n if (error) { this.error(error); }\n if (this.nodeInstance.ordered || this.nodeInstance.autoOrdering) {\n this.result.__resolved = true;\n this.nodeInstance.processOutputQueue();\n }\n return this.nodeInstance.load--;\n }", "title": "" }, { "docid": "163d202afe619e74919470c03811616d", "score": "0.46193275", "text": "function returnResult(context) {\r\n Logger.log({\r\n data: Logger.activeLogLevel === 0 /* Verbose */ ? context.result : {},\r\n level: 1 /* Info */,\r\n message: `[${context.requestId}] (${(new Date()).getTime()}) Returning result from pipeline. Set logging to verbose to see data.`,\r\n });\r\n return Promise.resolve(context.result);\r\n}", "title": "" }, { "docid": "564f111b0d58ecd8ae26c79055b1f3ee", "score": "0.4602135", "text": "transformReply(result) {\n if (this.replyEncoding) {\n result = (0, utils_1.convertBufferToString)(result, this.replyEncoding);\n }\n const transformer = Command._transformer.reply[this.name];\n if (transformer) {\n result = transformer(result);\n }\n return result;\n }", "title": "" }, { "docid": "a06b4e8e2c0bf21ba21d74360c2e4d6e", "score": "0.46017143", "text": "function transformCKANResult (result, callback) {\n var transformed = {\n \"title\": result.title,\n \"name\": result.name,\n \"notes\": result.notes,\n \"tags\": result.tags,\n \"record_last_modified\": result.metadata_modified\n };\n\n // trim the tags\n async.concat(result.tags, function(item, tagsCallback) {\n tagsCallback(null, {\"display_name\": item.display_name,\n \"id\": item.id})},\n function (error, results) {\n transformed.tags = results;\n });\n\n // trim the resources\n async.concat(result.resources, function(item, resourceCallback) {\n resourceCallback(null, {\"name\": item.name,\n \"url\": item.url})},\n function (error, results) {\n transformed.resources = results;\n });\n\n callback(null, transformed);\n }", "title": "" }, { "docid": "a24c70d623c31f85150e3d677625aae8", "score": "0.459755", "text": "onComplete() {\n this._done = true;\n }", "title": "" }, { "docid": "4fc236b38812785aa71c4902e4a977b2", "score": "0.4592178", "text": "function getResult() {\n return result;\n}", "title": "" }, { "docid": "cc222f7f2e016bcc70bee09074200df8", "score": "0.45743227", "text": "_wireTransformedObservableWithOperation(transformedObservable,operationFn){const observerTransform=new Observer(value=>{if(transformedObservable.lastError===undefined&&!transformedObservable.isComplete){try{transformedObservable.lastValuePreTransformed=value;operationFn(value);}catch(error){this._throwIfJavascriptCoreError(error);transformedObservable.emitError(error);}}},error=>{if(transformedObservable.lastError===undefined&&!transformedObservable.isComplete){transformedObservable.emitError(error);}},()=>{if(transformedObservable.lastError===undefined&&!transformedObservable.isComplete){transformedObservable.complete();}});this._decorateTransformedObservableWithSubscriptionOptimizationLogic(transformedObservable,observerTransform);}", "title": "" }, { "docid": "00ee4e64d874a42767e60a8cdc12b586", "score": "0.45733637", "text": "chain(transformation) {\n let deferred = new Deferred(); // eslint-disable-line prefer-const\n this.listen({\n onCancelled: () => deferred.cancel(),\n onRejected: reason => deferred.reject(reason),\n onResolved: value => {\n transformation(value).listen({\n onCancelled: () => deferred.cancel(),\n onRejected: reason => deferred.reject(reason),\n onResolved: value2 => deferred.resolve(value2)\n });\n }\n });\n\n return deferred.future();\n }", "title": "" }, { "docid": "eec42bf966fb5f895b21002d223ed047", "score": "0.45651567", "text": "function sendResultCb(result) {\n if (message.sendResponse) {\n this.port.postMessage({\n cmd: 'response',\n portId: this.id,\n reqId: message.reqId,\n resultValid: true,\n result: result\n });\n }\n }", "title": "" }, { "docid": "9ad1d99689dac39211e34c2938af72e8", "score": "0.456448", "text": "map(transformation) {\n return this.chain(value => Future.of(transformation(value)));\n }", "title": "" }, { "docid": "d10b5040177cebcb29fe152db68130e1", "score": "0.4563294", "text": "function Transform() {\n var self = this;\n this.apply = function(state) { return state; }\n this.undo = function(state) { return state; }\n this.token = function() {}\n this.then = function(other) {\n if (other === noop) { return self; }\n var result = new Transform();\n result.apply = function(state,token) {\n state = other.apply(state,token);\n if (state) {\n var applied = self.apply(state,token);\n if (applied) {\n return applied;\n } else {\n other.undo(state,token);\n }\n }\n };\n result.undo = function(state,token) {\n state = self.undo(state,token);\n if (state) {\n var undone = other.undo(state,token);\n if (undone) {\n return undone;\n } else {\n self.apply(state,token);\n }\n }\n };\n result.token = function(state) {\n var result = self.token(state);\n if (result) { return result; }\n state = self.undo(state);\n if (state) {\n result = other.token(state);\n self.apply(state);\n return result;\n }\n };\n return result;\n }; \n }", "title": "" }, { "docid": "14bed2c19976fb0ebcaead177b0b1d34", "score": "0.45147806", "text": "function cleanClientResultForPosting(result) {\n const err = result.err;\n if (!err) {\n return result;\n }\n // replace err with serializable version\n return Object.assign({}, result, {\n err: {\n name: err.name,\n message: err.message,\n // event should have been simplified (serialisable) by resource-loader\n event: err.event,\n duration: err.duration\n }\n });\n }", "title": "" }, { "docid": "4f3bce8d6cee6ea483c82d26cf347e78", "score": "0.45047694", "text": "function returnResult(context) {\r\n _pnp_logging__WEBPACK_IMPORTED_MODULE_2__[\"Logger\"].log({\r\n data: _pnp_logging__WEBPACK_IMPORTED_MODULE_2__[\"Logger\"].activeLogLevel === 0 /* Verbose */ ? context.result : {},\r\n level: 1 /* Info */,\r\n message: \"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Returning result from pipeline. Set logging to verbose to see data.\",\r\n });\r\n return Promise.resolve(context.result);\r\n}", "title": "" }, { "docid": "4f3bce8d6cee6ea483c82d26cf347e78", "score": "0.45047694", "text": "function returnResult(context) {\r\n _pnp_logging__WEBPACK_IMPORTED_MODULE_2__[\"Logger\"].log({\r\n data: _pnp_logging__WEBPACK_IMPORTED_MODULE_2__[\"Logger\"].activeLogLevel === 0 /* Verbose */ ? context.result : {},\r\n level: 1 /* Info */,\r\n message: \"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Returning result from pipeline. Set logging to verbose to see data.\",\r\n });\r\n return Promise.resolve(context.result);\r\n}", "title": "" }, { "docid": "2c50535206159bfa98bb9956db53f051", "score": "0.4500998", "text": "function onResult(result) {\n // redefine this part if needed\n try {\n let output = JSON.stringify(result, null, 2);\n const ws = fs.createWriteStream(config.file.output);\n ws.write(output, e => {\n if (e) console.error(e);\n else\n console.log(\"Export successful output wrote in \", config.file.output);\n ws.close();\n process.exit(1);\n });\n } catch (e) {\n console.error(e);\n }\n}", "title": "" }, { "docid": "bbc714db42b0ebf0bf55ea7e639eb5bf", "score": "0.4488081", "text": "save() {\n this.transform.save();\n }", "title": "" }, { "docid": "03025015a99aab6ba4370eeaafa78461", "score": "0.44839436", "text": "function finalCall(result){\n document.getElementById('b2').style.display = 'none';\n document.getElementById(opt).style.display = 'none';\n document.getElementById('d09').style.display = 'block';\n console.log(result.success);\n var str=result.success;\n\t str = str.split('$#').join('<br>');\n $('.success', element).html(str);\n }", "title": "" }, { "docid": "6045da6b6cdcf8b122b4ba7d871be0e8", "score": "0.44776297", "text": "function execution(callback) {\n interceptor.on('finish', function () {\n callback(interceptor._accum[0]);\n });\n reader.pipe(converter).pipe(interceptor);\n }", "title": "" }, { "docid": "b5bb0a71d07d890b2de76b1dace6473d", "score": "0.44644362", "text": "function handleArrayResult(m, workerIdx) {\n\tvar job = jobs[m.context.jobID],\n\t\tpartition = m.context.partition,\n\t\tsubResult = m.result,\n\t\tresult = [],\n\t\ti;\n\t\n\tjob.result[partition] = subResult;\n\n\t// Increase callback count.\n\tjob.cbCount++;\n\t\n\t// When all workers are finished return result\n\tif(job.cbCount === workers.length) {\n\t\tfor (i = 0; i < job.result.length; i++) {\n\t\t\tresult = result.concat(job.result[i]);\n\t\t};\n\t\t\n\t\t// Cle\n\t\tjob.cb(null, result);\n\t}\n\n\t// Worker is finished.\n\tworkerJobCount[workerIdx]--;\n\tdispatchWorkItems();\n}", "title": "" }, { "docid": "4510a98dfe863c09039955cf31e69997", "score": "0.4454063", "text": "function CyprusIdBackRecognizerResult(nativeResult) {\n RecognizerResult.call(this, nativeResult.resultState);\n \n /** \n * full document image if enabled with returnFullDocumentImage property. \n */\n this.fullDocumentImage = nativeResult.fullDocumentImage;\n \n /** \n * The data extracted from the machine readable zone. \n */\n this.mrzResult = nativeResult.mrzResult != null ? new MrzResult(nativeResult.mrzResult) : null;\n \n}", "title": "" }, { "docid": "e8697150b647bd3ed0f4e281f56814f2", "score": "0.44525042", "text": "call(onResult) {\n this.queue.redirect({\n userKey: this.response.passengerKey,\n route: 'order-submitted',\n });\n onResult();\n }", "title": "" }, { "docid": "1e82e142ff408de692e850b00cd88d1b", "score": "0.44519183", "text": "function returnResult(context) {\r\n __WEBPACK_IMPORTED_MODULE_1__pnp_logging__[\"a\" /* Logger */].log({\r\n data: __WEBPACK_IMPORTED_MODULE_1__pnp_logging__[\"a\" /* Logger */].activeLogLevel === 0 /* Verbose */ ? context.result : {},\r\n level: 1 /* Info */,\r\n message: \"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Returning result from pipeline. Set logging to verbose to see data.\",\r\n });\r\n return Promise.resolve(context.result);\r\n}", "title": "" }, { "docid": "adf2fc2342659f236815d1b0075c9b54", "score": "0.44512078", "text": "onComplete(resolve, state) {\n this.clear();\n\n if (typeof resolve !== 'undefined' && typeof resolve === 'function') {\n resolve({\n receiver: this.receiver,\n state,\n });\n }\n }", "title": "" }, { "docid": "7eae7010bd5ebb08823ae632a7988cb2", "score": "0.4445665", "text": "function onComplete() {\n var map = configService.getSync.map.instance;\n var originalPanDuration = map.mapDefault('panDuration');\n map.mapDefault('panDuration', 0);\n // TODO: fix after geoapi allows this through\n map._map.resize();\n map._map.reposition();\n\n // wait for a bit before recentring the map\n // if call right after animation completes, the map object still confused about its true size and extent\n $timeout(function () {\n // center the map\n map._map.centerAt(ref.trueCenterPoint);\n\n // clear offset properties on the map container node\n animationService.set(ref.mapContainerNode, {\n clearProps: 'top,left'\n });\n\n map.mapDefault('panDuration', originalPanDuration);\n }, 500);\n }", "title": "" }, { "docid": "8e16f6008a170ede00811276eb6ea65c", "score": "0.4440144", "text": "applyResult (result, callback) {\n try {\n callback(JSON.parse(JSON.stringify(result)))\n } catch (error) {\n callback(null)\n console.error(error)\n }\n }", "title": "" }, { "docid": "e1f3a113b8b00efc9c6eb22ffc81c46d", "score": "0.4427489", "text": "function fetchSuccessVaccinationAction(result) {\n return {\n type: FETCH_VACCINATION_SUCCEEDED,\n result\n }\n}", "title": "" }, { "docid": "b8cd1e4e14d75ed7ff83d2838eef658e", "score": "0.44235364", "text": "function postResult() {\n postMessage({\n 'status': \"RESULT\",\n 'task': task_obj\n });\n close();\n}", "title": "" }, { "docid": "9866ad77a3b2d32c79da281a47d36db3", "score": "0.44234", "text": "forEach (cb = () => {}) {\n const { transform } = this\n this.transform = chunk => {\n const transformed = transform(chunk)\n cb(transformed)\n return transformed\n }\n return this\n }", "title": "" }, { "docid": "d4739ac034402e691e67a956c9aa0d82", "score": "0.44215283", "text": "function wrap(result) {\n return async(dispatch, getState) => result\n}", "title": "" }, { "docid": "d31e2201a03f6d4423c375c0772335e7", "score": "0.44150773", "text": "function handleResult(next, result) {\n // Do wait up; assume that any return value has a callback\n if ('undefined' !== typeof result) {\n if ('function' === typeof result.when) {\n result.when(next);\n } else if ('function' === typeof result) {\n result(next);\n } else {\n next(result);\n }\n }\n }", "title": "" }, { "docid": "5639e2972b922ecaf7fe319c9e10f4af", "score": "0.4413941", "text": "_final(cb) {\n cb();\n }", "title": "" }, { "docid": "70e9d7ddf3ac15c4dfb8e4ab50232529", "score": "0.4413252", "text": "sendDone(outputMap) {\n this.send(outputMap);\n return this.done();\n }", "title": "" }, { "docid": "fe6064a460ba4221db97689e6216f1ad", "score": "0.44123387", "text": "function handleSuccess(res) {\n return res;\n }", "title": "" }, { "docid": "f814122ce395992121fffbb0ef3576a0", "score": "0.4405717", "text": "function gotResultMountain(err, img) {\n //adds the atribute of 'src' to the object resultImg\n resultImg.attribute('src', img.src);\n //keeps doing the transfer\n styleMountain.transfer(gotResultMountain);\n}", "title": "" }, { "docid": "eed83a6a4ca39581cd6c21ffbdaf3d6a", "score": "0.44019932", "text": "async transform(text) {\n return await this.get(\"transform\", {text: text}).catch(e => {\n throw(e);\n });\n }", "title": "" }, { "docid": "53b70f286bc287db9f6746131d95f77c", "score": "0.44004625", "text": "function finalTransactionCompleted()\n{\n debug('The final transaction completed.');\n done();\n}", "title": "" }, { "docid": "510f837149e8892148bc5678c434152b", "score": "0.43873045", "text": "finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }", "title": "" }, { "docid": "f0d173626a81991e107cb1779ad83c9e", "score": "0.4384355", "text": "function cc(e, result) {\n c(result);\n }", "title": "" }, { "docid": "06230eab6b83b670a1fd5001e323f3b1", "score": "0.4378428", "text": "function applyTransforms(initial) {\n var transforms = slice(transformStack);\n\n // Default behavior is to return the raw value if a single built-in reduce\n // function was appied, otherwise return the full output object\n if (inArray(aliases, '_')) {\n transforms.push(makeIndexer('_'));\n } else if (!isFunction(combinator)) {\n // Create a new output object with no intermediate fields\n transforms.push(function(output) {\n return aliases.reduce(function(result, alias) {\n result[alias] = output[alias];\n return result;\n }, {});\n });\n }\n\n // If there's only one anonymous reducer, assume transform functions\n // operate on its value, and not the full output object\n return transforms.reduce(function(result, transform) {\n return transform(result);\n }, initial);\n }", "title": "" }, { "docid": "61ecb6f745d555ea63e04b6338532a61", "score": "0.43765622", "text": "_processResolution(chainedPromise) {\n chainedPromise._trigger(this._succeeded, this._result)\n }", "title": "" }, { "docid": "5951d49fdd352f2e50e10236814bd2b8", "score": "0.43748412", "text": "function finalize() {\n var childId = 0;\n var processChildNode = function() {\n if (childId >= _self.childNodes.length) {\n outputStream.write('\\r\\n--' + _self.boundary + '--\\r\\n');\n return callback();\n }\n var child = _self.childNodes[childId++];\n outputStream.write((childId > 1 ? '\\r\\n' : '') + '--' + _self.boundary + '\\r\\n');\n child.stream(outputStream, options, function() {\n setImmediate(processChildNode);\n });\n };\n\n if (_self.multipart) {\n setImmediate(processChildNode);\n } else {\n return callback();\n }\n }", "title": "" }, { "docid": "a15bccb04d9079158c40ded20d6779df", "score": "0.4368645", "text": "function sendComputedEvaluationToServer(evalEntity) {\n server.sendPostRequest(server_url + \"LAEvaluation/addSingleComputed\", {\n userId: 1,\n star: evalEntity.star,\n candidates: evalEntity.candidates,\n id: evalEntity.id,\n classificationResult: evalEntity.accuracy * 100,\n }, function () {\n logger.log_info(\"Succesfully sent analysis to server\");\n });\n}", "title": "" }, { "docid": "f12e9b6edb4d4c9f61ffffc7b2b41a68", "score": "0.4365405", "text": "result() {\n return this.core.result;\n }", "title": "" }, { "docid": "b311a28b3f495cfe847b374a2eb52e03", "score": "0.43653613", "text": "_calculateTransformation() {\n const body = this.collider ? this.collider.body : null;\n const pos = body ? body.pos.add(this.offset) : this.offset;\n const angle = body ? body.rotation : 0;\n const scale = body ? body.scale : Vector.One;\n const len = this.points.length;\n this._transformedPoints.length = 0; // clear out old transform\n for (let i = 0; i < len; i++) {\n this._transformedPoints[i] = this.points[i].scale(scale).rotate(angle).add(pos);\n }\n }", "title": "" }, { "docid": "bafb60cd730f3474f1b824d089aaca10", "score": "0.43585598", "text": "transform(tree) {\r\n return this._transform_tree(tree);\r\n }", "title": "" }, { "docid": "7646448a02646680221177f8aa0df805", "score": "0.43514496", "text": "function gotResultFuchun(err, img) {\n //adds the atribute of 'src' to the object resultImg\n resultImg.attribute('src', img.src);\n //keeps doing the transfer\n styleFuchun.transfer(gotResultFuchun);\n}", "title": "" }, { "docid": "778e4e24d4a566b5ee6e48c5019b0c2b", "score": "0.4346226", "text": "finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }", "title": "" }, { "docid": "778e4e24d4a566b5ee6e48c5019b0c2b", "score": "0.4346226", "text": "finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }", "title": "" }, { "docid": "778e4e24d4a566b5ee6e48c5019b0c2b", "score": "0.4346226", "text": "finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }", "title": "" }, { "docid": "ea5b1988e4b5f0c7e557587945c5afc3", "score": "0.43415305", "text": "get result() {\n this._logger.debug(\"get result\");\n\n return this._result;\n }", "title": "" }, { "docid": "7be8afabbe9d9eda306c485e5444110d", "score": "0.4339887", "text": "function KuwaitIdBackRecognizerResult(nativeResult) {\n RecognizerResult.call(this, nativeResult.resultState);\n \n /** \n * full document image if enabled with returnFullDocumentImage property. \n */\n this.fullDocumentImage = nativeResult.fullDocumentImage;\n \n /** \n * The data extracted from the machine readable zone \n */\n this.mrzResult = nativeResult.mrzResult != null ? new MrzResult(nativeResult.mrzResult) : null;\n \n /** \n * The serial number of Kuwait ID \n */\n this.serialNo = nativeResult.serialNo;\n \n}", "title": "" }, { "docid": "1efc563181ca6067a5ae0b0ce45845f3", "score": "0.4328542", "text": "update(result) {\n this.store.result = result.work || {};\n this.store.info = result.info || {};\n this.store.error.concat(result.error || []);\n this.trigger(this.store);\n }", "title": "" }, { "docid": "41a553fdcc87b57e55e6080254526f03", "score": "0.43283167", "text": "function onComplete (err) {\n if (err) return reject(err)\n\n resolve({ id: this.lastID })\n }", "title": "" }, { "docid": "c49ec3c2490b4ef63d25dafad1d8e262", "score": "0.43163952", "text": "function combineTransforms(transform, initialTransform) {\n return initialTransform ? (transform + ' ' + initialTransform) : transform;\n}", "title": "" }, { "docid": "0dc488367b9d15dc00f4265c36535d27", "score": "0.4308957", "text": "function processPutResultAndEtag(path, results, successCallback) {\n\n // If things went OK, write out the new etag unless we are in transfer mode.\n if (processPutResult(path, results) && !inTransferMode()) {\n\n writeEtag(path, results.response.headers.etag)\n\n // Looking good - call the succes callback if there is one.\n successCallback && successCallback(path)\n }\n}", "title": "" }, { "docid": "df92fe430aa3ab4f2a5137d5dc36627a", "score": "0.43075746", "text": "_resolve() {\r\n if (this._rejection || !this._result) {\r\n return;\r\n }\r\n // Set the length of the resulting array in case some undefined results affected this\r\n this._result.length = this._invocations;\r\n this._state = task_1.TaskState.Terminated;\r\n if (this._resultConverter) {\r\n try {\r\n this._returnResult = this._resultConverter(this._result);\r\n }\r\n catch (err) {\r\n this._reject(err);\r\n return;\r\n }\r\n }\r\n else {\r\n this._returnResult = this._result;\r\n }\r\n // discard the original array to free memory\r\n this._result = undefined;\r\n if (this._deferreds.length) {\r\n this._deferreds.forEach((deferred) => {\r\n deferred.resolve(this._returnResult);\r\n });\r\n this._deferreds.length = 0;\r\n }\r\n }", "title": "" }, { "docid": "7237282755a966d4adb267eab009aae2", "score": "0.43028605", "text": "onSubmitSuccess() {\n this.isSubmitting_ = false;\n this.submittedFormData_ = this.takeFormDataSnapshot_();\n this.clearDirtyFields_();\n this.updateClassAndDispatchEventIfDirtyStateChanged_();\n }", "title": "" } ]
6467bb0e57befdc97181dbfaf13206af
ECMA262 11.6 Identifier Names and Identifiers
[ { "docid": "c150c4c503cb1894c5969bf6c03d54da", "score": "0.0", "text": "function fromCodePoint(cp) {\n return (cp < 0x10000) ? String.fromCharCode(cp) :\n String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) +\n String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023));\n }", "title": "" } ]
[ { "docid": "4d09fbf5711d1cf6902b391c7abd83e9", "score": "0.7452734", "text": "function parseIdentifier() {\n _index3.next.call(void 0, );\n _base.state.tokens[_base.state.tokens.length - 1].type = _types3.TokenType.name;\n}", "title": "" }, { "docid": "a5df2d236cafda4c0e68bc09c7b5dd0f", "score": "0.72903466", "text": "function identifer () {\n let result = repeat1(\n choice(\n range('a', 'z'),\n range('A', 'Z'),\n ch('_'),\n ch('$')\n ) \n );\n return action(result, function(ast){\n return {\n type: 'identifer',\n value: ast.join('')\n };\n });\n}", "title": "" }, { "docid": "958924ef2f4a06c57621e054b2a96767", "score": "0.72137946", "text": "lesx_parseIdentifier() {\n var node = this.startNode();\n if (this.type === tt.lesxName) {\n node.name = this.value;\n } else if (this.type.keyword) {\n node.name = this.type.keyword;\n } else {\n this.unexpected();\n }\n\n this.next();\n\n return this.finishNode(node, 'LesxIdentifier');\n }", "title": "" }, { "docid": "c0f31bfac7e50fa2964be1dd66cc4290", "score": "0.7208743", "text": "Identifier() {\n const name = this._eat(\"IDENTIFIER\").value;\n return {\n type: \"Identifier\",\n name,\n };\n }", "title": "" }, { "docid": "245367126b0bdcd41123049528ca3e45", "score": "0.7202843", "text": "parseIdentifier() {\n const node = this.startNode();\n node.name = this.expect(Token.IDENTIFIER).value;\n return this.finishNode(node, 'Identifier');\n }", "title": "" }, { "docid": "a4e35f543e763db002c8a37fed7950c2", "score": "0.6991389", "text": "function parseIdent(liberal) {\n var node = startNode();\n if (liberal && options.forbidReserved == \"everywhere\") liberal = false;\n if (tokType === _name) {\n if (!liberal &&\n (options.forbidReserved &&\n (options.ecmaVersion === 3 ? isReservedWord3 : isReservedWord5)(tokVal) ||\n strict && isStrictReservedWord(tokVal)) &&\n input.slice(tokStart, tokEnd).indexOf(\"\\\\\") == -1)\n raise(tokStart, \"The keyword '\" + tokVal + \"' is reserved\");\n node.name = tokVal;\n } else if (liberal && tokType.keyword) {\n node.name = tokType.keyword;\n } else {\n unexpected();\n }\n tokRegexpAllowed = false;\n next();\n return finishNode(node, \"Identifier\");\n }", "title": "" }, { "docid": "a4e35f543e763db002c8a37fed7950c2", "score": "0.6991389", "text": "function parseIdent(liberal) {\n var node = startNode();\n if (liberal && options.forbidReserved == \"everywhere\") liberal = false;\n if (tokType === _name) {\n if (!liberal &&\n (options.forbidReserved &&\n (options.ecmaVersion === 3 ? isReservedWord3 : isReservedWord5)(tokVal) ||\n strict && isStrictReservedWord(tokVal)) &&\n input.slice(tokStart, tokEnd).indexOf(\"\\\\\") == -1)\n raise(tokStart, \"The keyword '\" + tokVal + \"' is reserved\");\n node.name = tokVal;\n } else if (liberal && tokType.keyword) {\n node.name = tokType.keyword;\n } else {\n unexpected();\n }\n tokRegexpAllowed = false;\n next();\n return finishNode(node, \"Identifier\");\n }", "title": "" }, { "docid": "a96262949d447e4bc7d7752a7e51bdde", "score": "0.6986584", "text": "function isValidIdentifier(name) {\n\t if (typeof name !== \"string\" || _esutils2[\"default\"].keyword.isReservedWordES6(name, true)) {\n\t return false;\n\t } else {\n\t return _esutils2[\"default\"].keyword.isIdentifierNameES6(name);\n\t }\n\t}", "title": "" }, { "docid": "78af11eb4333fc9d5eba14980e5a98e9", "score": "0.69519144", "text": "function isIdentifier (s) {\n \treturn /^[a-z]+$/.test(s);\n}", "title": "" }, { "docid": "e6cee8a1c3c97651b028c9037d3993ee", "score": "0.68767166", "text": "function jsIdentifier(name){\n return !/$[a-zA-Z_$][\\w_$]*$/.test(name);\n}", "title": "" }, { "docid": "b3a6eb84805b1c58ac86cac0964ff236", "score": "0.67735416", "text": "function isIdentifierName(node) {\n\t var parent = node.parent;\n\t switch (parent.kind) {\n\t case 143 /* PropertyDeclaration */:\n\t case 142 /* PropertySignature */:\n\t case 145 /* MethodDeclaration */:\n\t case 144 /* MethodSignature */:\n\t case 147 /* GetAccessor */:\n\t case 148 /* SetAccessor */:\n\t case 251 /* EnumMember */:\n\t case 249 /* PropertyAssignment */:\n\t case 170 /* PropertyAccessExpression */:\n\t // Name in member declaration or property name in property access\n\t return parent.name === node;\n\t case 137 /* QualifiedName */:\n\t // Name on right hand side of dot in a type query\n\t if (parent.right === node) {\n\t while (parent.kind === 137 /* QualifiedName */) {\n\t parent = parent.parent;\n\t }\n\t return parent.kind === 156 /* TypeQuery */;\n\t }\n\t return false;\n\t case 167 /* BindingElement */:\n\t case 230 /* ImportSpecifier */:\n\t // Property name in binding element or import specifier\n\t return parent.propertyName === node;\n\t case 234 /* ExportSpecifier */:\n\t // Any name in an export specifier\n\t return true;\n\t }\n\t return false;\n\t }", "title": "" }, { "docid": "d5fa332867c27f9c57a4010f17a12d6a", "score": "0.67701775", "text": "function isValidIdentifier(name) {\n if (typeof name !== \"string\" || _esutils2.default.keyword.isReservedWordES6(name, true)) {\n return false;\n } else {\n return _esutils2.default.keyword.isIdentifierNameES6(name);\n }\n}", "title": "" }, { "docid": "cf18a2314f921feaab85e0c5518e7099", "score": "0.6760512", "text": "function isIdentifierPart(ch) {\n\t // Generated by `tools/generate-identifier-regex.js`.\n\t var NonAsciiIdentifierPart = new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]');\n\n\t return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)\n\t (ch >= 65 && ch <= 90) || // A..Z\n\t (ch >= 97 && ch <= 122) || // a..z\n\t (ch >= 48 && ch <= 57) || // 0..9\n\t (ch === 92) || // \\ (backslash)\n\t ((ch >= 0x80) && NonAsciiIdentifierPart.test(String.fromCharCode(ch)));\n\t }", "title": "" }, { "docid": "2f283c5b07b3f3e8074f7e12ff5f6e72", "score": "0.6719461", "text": "function isIdentifierPart(ch) {\n // Generated by `tools/generate-identifier-regex.js`.\n var NonAsciiIdentifierPart = new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]');\n\n return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)\n (ch >= 65 && ch <= 90) || // A..Z\n (ch >= 97 && ch <= 122) || // a..z\n (ch >= 48 && ch <= 57) || // 0..9\n (ch === 92) || // \\ (backslash)\n ((ch >= 0x80) && NonAsciiIdentifierPart.test(String.fromCharCode(ch)));\n }", "title": "" }, { "docid": "2f283c5b07b3f3e8074f7e12ff5f6e72", "score": "0.6719461", "text": "function isIdentifierPart(ch) {\n // Generated by `tools/generate-identifier-regex.js`.\n var NonAsciiIdentifierPart = new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]');\n\n return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)\n (ch >= 65 && ch <= 90) || // A..Z\n (ch >= 97 && ch <= 122) || // a..z\n (ch >= 48 && ch <= 57) || // 0..9\n (ch === 92) || // \\ (backslash)\n ((ch >= 0x80) && NonAsciiIdentifierPart.test(String.fromCharCode(ch)));\n }", "title": "" }, { "docid": "2064c3aff53c509a70e671e3d972a609", "score": "0.6698792", "text": "function isIdentifierPart(ch) {\n // Generated by `tools/generate-identifier-regex.js`.\n var NonAsciiIdentifierPartOnly = /[0-9_\\xB7\\u0300-\\u036F\\u0387\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u0669\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u06F0-\\u06F9\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07C0-\\u07C9\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08D3-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096F\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09E6-\\u09EF\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A66-\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AE6-\\u0AEF\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B66-\\u0B6F\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C04\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CE6-\\u0CEF\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D66-\\u0D6F\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0E50-\\u0E59\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1040-\\u1049\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F-\\u109D\\u135D-\\u135F\\u1369-\\u1371\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u194F\\u19D0-\\u19DA\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AB0-\\u1ABD\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BB0-\\u1BB9\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1C40-\\u1C49\\u1C50-\\u1C59\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DF9\\u1DFB-\\u1DFF\\u200C\\u200D\\u203F\\u2040\\u2054\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA620-\\uA629\\uA66F\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F1\\uA8FF-\\uA909\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9D0-\\uA9D9\\uA9E5\\uA9F0-\\uA9F9\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA50-\\uAA59\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF10-\\uFF19\\uFF3F]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD801[\\uDCA0-\\uDCA9]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD803[\\uDD24-\\uDD27\\uDD30-\\uDD39\\uDF46-\\uDF50]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC66-\\uDC6F\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDCF0-\\uDCF9\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD36-\\uDD3F\\uDD45\\uDD46\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDDC9-\\uDDCC\\uDDD0-\\uDDD9\\uDE2C-\\uDE37\\uDE3E\\uDEDF-\\uDEEA\\uDEF0-\\uDEF9\\uDF00-\\uDF03\\uDF3B\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDC35-\\uDC46\\uDC50-\\uDC59\\uDC5E\\uDCB0-\\uDCC3\\uDCD0-\\uDCD9\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDDDC\\uDDDD\\uDE30-\\uDE40\\uDE50-\\uDE59\\uDEAB-\\uDEB7\\uDEC0-\\uDEC9\\uDF1D-\\uDF2B\\uDF30-\\uDF39]|\\uD806[\\uDC2C-\\uDC3A\\uDCE0-\\uDCE9\\uDE01-\\uDE0A\\uDE33-\\uDE39\\uDE3B-\\uDE3E\\uDE47\\uDE51-\\uDE5B\\uDE8A-\\uDE99]|\\uD807[\\uDC2F-\\uDC36\\uDC38-\\uDC3F\\uDC50-\\uDC59\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD31-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD45\\uDD47\\uDD50-\\uDD59\\uDD8A-\\uDD8E\\uDD90\\uDD91\\uDD93-\\uDD97\\uDDA0-\\uDDA9\\uDEF3-\\uDEF6]|\\uD81A[\\uDE60-\\uDE69\\uDEF0-\\uDEF4\\uDF30-\\uDF36\\uDF50-\\uDF59]|\\uD81B[\\uDF51-\\uDF7E\\uDF8F-\\uDF92]|\\uD82F[\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD835[\\uDFCE-\\uDFFF]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A]|\\uD83A[\\uDCD0-\\uDCD6\\uDD44-\\uDD4A\\uDD50-\\uDD59]|\\uDB40[\\uDD00-\\uDDEF]/;\n\n return isIdentifierStart(ch) ||\n (ch >= 48 && ch <= 57) || // 0..9\n ((ch >= 0x80) && NonAsciiIdentifierPartOnly.test(fromCodePoint(ch)));\n }", "title": "" }, { "docid": "2064c3aff53c509a70e671e3d972a609", "score": "0.6698792", "text": "function isIdentifierPart(ch) {\n // Generated by `tools/generate-identifier-regex.js`.\n var NonAsciiIdentifierPartOnly = /[0-9_\\xB7\\u0300-\\u036F\\u0387\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u0669\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u06F0-\\u06F9\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07C0-\\u07C9\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08D3-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096F\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09E6-\\u09EF\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A66-\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AE6-\\u0AEF\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B66-\\u0B6F\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C04\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CE6-\\u0CEF\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D66-\\u0D6F\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0E50-\\u0E59\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1040-\\u1049\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F-\\u109D\\u135D-\\u135F\\u1369-\\u1371\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u194F\\u19D0-\\u19DA\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AB0-\\u1ABD\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BB0-\\u1BB9\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1C40-\\u1C49\\u1C50-\\u1C59\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DF9\\u1DFB-\\u1DFF\\u200C\\u200D\\u203F\\u2040\\u2054\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA620-\\uA629\\uA66F\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F1\\uA8FF-\\uA909\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9D0-\\uA9D9\\uA9E5\\uA9F0-\\uA9F9\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA50-\\uAA59\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF10-\\uFF19\\uFF3F]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD801[\\uDCA0-\\uDCA9]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD803[\\uDD24-\\uDD27\\uDD30-\\uDD39\\uDF46-\\uDF50]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC66-\\uDC6F\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDCF0-\\uDCF9\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD36-\\uDD3F\\uDD45\\uDD46\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDDC9-\\uDDCC\\uDDD0-\\uDDD9\\uDE2C-\\uDE37\\uDE3E\\uDEDF-\\uDEEA\\uDEF0-\\uDEF9\\uDF00-\\uDF03\\uDF3B\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDC35-\\uDC46\\uDC50-\\uDC59\\uDC5E\\uDCB0-\\uDCC3\\uDCD0-\\uDCD9\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDDDC\\uDDDD\\uDE30-\\uDE40\\uDE50-\\uDE59\\uDEAB-\\uDEB7\\uDEC0-\\uDEC9\\uDF1D-\\uDF2B\\uDF30-\\uDF39]|\\uD806[\\uDC2C-\\uDC3A\\uDCE0-\\uDCE9\\uDE01-\\uDE0A\\uDE33-\\uDE39\\uDE3B-\\uDE3E\\uDE47\\uDE51-\\uDE5B\\uDE8A-\\uDE99]|\\uD807[\\uDC2F-\\uDC36\\uDC38-\\uDC3F\\uDC50-\\uDC59\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD31-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD45\\uDD47\\uDD50-\\uDD59\\uDD8A-\\uDD8E\\uDD90\\uDD91\\uDD93-\\uDD97\\uDDA0-\\uDDA9\\uDEF3-\\uDEF6]|\\uD81A[\\uDE60-\\uDE69\\uDEF0-\\uDEF4\\uDF30-\\uDF36\\uDF50-\\uDF59]|\\uD81B[\\uDF51-\\uDF7E\\uDF8F-\\uDF92]|\\uD82F[\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD835[\\uDFCE-\\uDFFF]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A]|\\uD83A[\\uDCD0-\\uDCD6\\uDD44-\\uDD4A\\uDD50-\\uDD59]|\\uDB40[\\uDD00-\\uDDEF]/;\n\n return isIdentifierStart(ch) ||\n (ch >= 48 && ch <= 57) || // 0..9\n ((ch >= 0x80) && NonAsciiIdentifierPartOnly.test(fromCodePoint(ch)));\n }", "title": "" }, { "docid": "2064c3aff53c509a70e671e3d972a609", "score": "0.6698792", "text": "function isIdentifierPart(ch) {\n // Generated by `tools/generate-identifier-regex.js`.\n var NonAsciiIdentifierPartOnly = /[0-9_\\xB7\\u0300-\\u036F\\u0387\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u0669\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u06F0-\\u06F9\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07C0-\\u07C9\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08D3-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096F\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09E6-\\u09EF\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A66-\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AE6-\\u0AEF\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B66-\\u0B6F\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C04\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CE6-\\u0CEF\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D66-\\u0D6F\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0E50-\\u0E59\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1040-\\u1049\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F-\\u109D\\u135D-\\u135F\\u1369-\\u1371\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u194F\\u19D0-\\u19DA\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AB0-\\u1ABD\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BB0-\\u1BB9\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1C40-\\u1C49\\u1C50-\\u1C59\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DF9\\u1DFB-\\u1DFF\\u200C\\u200D\\u203F\\u2040\\u2054\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA620-\\uA629\\uA66F\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F1\\uA8FF-\\uA909\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9D0-\\uA9D9\\uA9E5\\uA9F0-\\uA9F9\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA50-\\uAA59\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF10-\\uFF19\\uFF3F]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD801[\\uDCA0-\\uDCA9]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD803[\\uDD24-\\uDD27\\uDD30-\\uDD39\\uDF46-\\uDF50]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC66-\\uDC6F\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDCF0-\\uDCF9\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD36-\\uDD3F\\uDD45\\uDD46\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDDC9-\\uDDCC\\uDDD0-\\uDDD9\\uDE2C-\\uDE37\\uDE3E\\uDEDF-\\uDEEA\\uDEF0-\\uDEF9\\uDF00-\\uDF03\\uDF3B\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDC35-\\uDC46\\uDC50-\\uDC59\\uDC5E\\uDCB0-\\uDCC3\\uDCD0-\\uDCD9\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDDDC\\uDDDD\\uDE30-\\uDE40\\uDE50-\\uDE59\\uDEAB-\\uDEB7\\uDEC0-\\uDEC9\\uDF1D-\\uDF2B\\uDF30-\\uDF39]|\\uD806[\\uDC2C-\\uDC3A\\uDCE0-\\uDCE9\\uDE01-\\uDE0A\\uDE33-\\uDE39\\uDE3B-\\uDE3E\\uDE47\\uDE51-\\uDE5B\\uDE8A-\\uDE99]|\\uD807[\\uDC2F-\\uDC36\\uDC38-\\uDC3F\\uDC50-\\uDC59\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD31-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD45\\uDD47\\uDD50-\\uDD59\\uDD8A-\\uDD8E\\uDD90\\uDD91\\uDD93-\\uDD97\\uDDA0-\\uDDA9\\uDEF3-\\uDEF6]|\\uD81A[\\uDE60-\\uDE69\\uDEF0-\\uDEF4\\uDF30-\\uDF36\\uDF50-\\uDF59]|\\uD81B[\\uDF51-\\uDF7E\\uDF8F-\\uDF92]|\\uD82F[\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD835[\\uDFCE-\\uDFFF]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A]|\\uD83A[\\uDCD0-\\uDCD6\\uDD44-\\uDD4A\\uDD50-\\uDD59]|\\uDB40[\\uDD00-\\uDDEF]/;\n\n return isIdentifierStart(ch) ||\n (ch >= 48 && ch <= 57) || // 0..9\n ((ch >= 0x80) && NonAsciiIdentifierPartOnly.test(fromCodePoint(ch)));\n }", "title": "" }, { "docid": "2064c3aff53c509a70e671e3d972a609", "score": "0.6698792", "text": "function isIdentifierPart(ch) {\n // Generated by `tools/generate-identifier-regex.js`.\n var NonAsciiIdentifierPartOnly = /[0-9_\\xB7\\u0300-\\u036F\\u0387\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u0669\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u06F0-\\u06F9\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07C0-\\u07C9\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08D3-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096F\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09E6-\\u09EF\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A66-\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AE6-\\u0AEF\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B66-\\u0B6F\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C04\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CE6-\\u0CEF\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D66-\\u0D6F\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0E50-\\u0E59\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1040-\\u1049\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F-\\u109D\\u135D-\\u135F\\u1369-\\u1371\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u194F\\u19D0-\\u19DA\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AB0-\\u1ABD\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BB0-\\u1BB9\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1C40-\\u1C49\\u1C50-\\u1C59\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DF9\\u1DFB-\\u1DFF\\u200C\\u200D\\u203F\\u2040\\u2054\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA620-\\uA629\\uA66F\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F1\\uA8FF-\\uA909\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9D0-\\uA9D9\\uA9E5\\uA9F0-\\uA9F9\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA50-\\uAA59\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF10-\\uFF19\\uFF3F]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD801[\\uDCA0-\\uDCA9]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD803[\\uDD24-\\uDD27\\uDD30-\\uDD39\\uDF46-\\uDF50]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC66-\\uDC6F\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDCF0-\\uDCF9\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD36-\\uDD3F\\uDD45\\uDD46\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDDC9-\\uDDCC\\uDDD0-\\uDDD9\\uDE2C-\\uDE37\\uDE3E\\uDEDF-\\uDEEA\\uDEF0-\\uDEF9\\uDF00-\\uDF03\\uDF3B\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDC35-\\uDC46\\uDC50-\\uDC59\\uDC5E\\uDCB0-\\uDCC3\\uDCD0-\\uDCD9\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDDDC\\uDDDD\\uDE30-\\uDE40\\uDE50-\\uDE59\\uDEAB-\\uDEB7\\uDEC0-\\uDEC9\\uDF1D-\\uDF2B\\uDF30-\\uDF39]|\\uD806[\\uDC2C-\\uDC3A\\uDCE0-\\uDCE9\\uDE01-\\uDE0A\\uDE33-\\uDE39\\uDE3B-\\uDE3E\\uDE47\\uDE51-\\uDE5B\\uDE8A-\\uDE99]|\\uD807[\\uDC2F-\\uDC36\\uDC38-\\uDC3F\\uDC50-\\uDC59\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD31-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD45\\uDD47\\uDD50-\\uDD59\\uDD8A-\\uDD8E\\uDD90\\uDD91\\uDD93-\\uDD97\\uDDA0-\\uDDA9\\uDEF3-\\uDEF6]|\\uD81A[\\uDE60-\\uDE69\\uDEF0-\\uDEF4\\uDF30-\\uDF36\\uDF50-\\uDF59]|\\uD81B[\\uDF51-\\uDF7E\\uDF8F-\\uDF92]|\\uD82F[\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD835[\\uDFCE-\\uDFFF]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A]|\\uD83A[\\uDCD0-\\uDCD6\\uDD44-\\uDD4A\\uDD50-\\uDD59]|\\uDB40[\\uDD00-\\uDDEF]/;\n\n return isIdentifierStart(ch) ||\n (ch >= 48 && ch <= 57) || // 0..9\n ((ch >= 0x80) && NonAsciiIdentifierPartOnly.test(fromCodePoint(ch)));\n }", "title": "" }, { "docid": "3881167edd8106c0726438be9a89a500", "score": "0.6677341", "text": "function isIdentifierPart(ch) {\n // Generated by `tools/generate-identifier-regex.js`.\n var NonAsciiIdentifierPartOnly = /[\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u0669\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u06F0-\\u06F9\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07C0-\\u07C9\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08E4-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096F\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09E6-\\u09EF\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A66-\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B66-\\u0B6F\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CE6-\\u0CEF\\u0D01-\\u0D03\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D66-\\u0D6F\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0E50-\\u0E59\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1040-\\u1049\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F-\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u194F\\u19B0-\\u19C0\\u19C8\\u19C9\\u19D0-\\u19D9\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AB0-\\u1ABD\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BB0-\\u1BB9\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1C40-\\u1C49\\u1C50-\\u1C59\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF8\\u1CF9\\u1DC0-\\u1DF5\\u1DFC-\\u1DFF\\u200C\\u200D\\u203F\\u2040\\u2054\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA620-\\uA629\\uA66F\\uA674-\\uA67D\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F1\\uA900-\\uA909\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9D0-\\uA9D9\\uA9E5\\uA9F0-\\uA9F9\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA50-\\uAA59\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF10-\\uFF19\\uFF3F]/;\n\n return isIdentifierStart(ch) ||\n ((ch >= 0x80) && NonAsciiIdentifierPartOnly.test(String.fromCharCode(ch)));\n }", "title": "" }, { "docid": "67ffdd7a732aabb63794e283467fe507", "score": "0.66641974", "text": "function isIdentifierPart(ch) {\n // Generated by `tools/generate-identifier-regex.js`.\n var NonAsciiIdentifierPart = new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]');\n\n return ch === 36 || ch === 95 || // $ (dollar) and _ (underscore)\n ch >= 65 && ch <= 90 || // A..Z\n ch >= 97 && ch <= 122 || // a..z\n ch >= 48 && ch <= 57 || // 0..9\n ch === 92 || // \\ (backslash)\n ch >= 0x80 && NonAsciiIdentifierPart.test(String.fromCharCode(ch));\n }", "title": "" }, { "docid": "2981e9c94e6ee48c5fed30bff7079d12", "score": "0.66361696", "text": "function readIdentifier() {\n var id = {};\n id.key = check(reIdentifier);\n // possible index or macro params\n switch (text[0]) {\n case '[': // index\n id.index = readExpression();\n break;\n case '(': // macro params\n id.params = readExpression();\n break;\n }\n return id;\n }", "title": "" }, { "docid": "cbbf8a7d6d1a1e6aaa500e9946e3916c", "score": "0.66190016", "text": "jsx_parseIdentifier() {\n let node = this.startNode();\n if (this.type === tok.jsxName)\n node.name = this.value;\n else if (this.type.keyword)\n node.name = this.type.keyword;\n else\n this.unexpected();\n this.next();\n return this.finishNode(node, 'JSXIdentifier');\n }", "title": "" }, { "docid": "cbbf8a7d6d1a1e6aaa500e9946e3916c", "score": "0.66190016", "text": "jsx_parseIdentifier() {\n let node = this.startNode();\n if (this.type === tok.jsxName)\n node.name = this.value;\n else if (this.type.keyword)\n node.name = this.type.keyword;\n else\n this.unexpected();\n this.next();\n return this.finishNode(node, 'JSXIdentifier');\n }", "title": "" }, { "docid": "9639197efb239d4ad70f40d889a0377d", "score": "0.6617819", "text": "function isIdentifierName(node) {\n var parent = node.parent;\n switch (parent.kind) {\n case 149 /* PropertyDeclaration */:\n case 148 /* PropertySignature */:\n case 151 /* MethodDeclaration */:\n case 150 /* MethodSignature */:\n case 153 /* GetAccessor */:\n case 154 /* SetAccessor */:\n case 264 /* EnumMember */:\n case 261 /* PropertyAssignment */:\n case 179 /* PropertyAccessExpression */:\n // Name in member declaration or property name in property access\n return parent.name === node;\n case 143 /* QualifiedName */:\n // Name on right hand side of dot in a type query\n if (parent.right === node) {\n while (parent.kind === 143 /* QualifiedName */) {\n parent = parent.parent;\n }\n return parent.kind === 162 /* TypeQuery */;\n }\n return false;\n case 176 /* BindingElement */:\n case 242 /* ImportSpecifier */:\n // Property name in binding element or import specifier\n return parent.propertyName === node;\n case 246 /* ExportSpecifier */:\n // Any name in an export specifier\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "64061804d8d872ebe9e33f4e684b4c95", "score": "0.66147774", "text": "function cIsReservedIdentifier(token){if(!token||2>token.length)return!1;if(\"_\"!=token[0])return!1;return\"_\"==token[1]||token[1]!==token[1].toLowerCase()}", "title": "" }, { "docid": "b7de9fe060cc14d6d816b662b4b97579", "score": "0.6612223", "text": "jsx_parseIdentifier() {\n var node = this.startNode();\n if (this.type === tok.jsxName)\n { node.name = this.value; }\n else if (this.type.keyword)\n { node.name = this.type.keyword; }\n else\n { this.unexpected(); }\n this.next();\n return this.finishNode(node, 'JSXIdentifier');\n }", "title": "" }, { "docid": "1a3832d7bddaf686e94ba642973ea68b", "score": "0.6611713", "text": "function isIdentifierPart(ch) {\n return IDENT_PART_EXPR.test(ch);\n}", "title": "" }, { "docid": "19fe29c28648f544d22c28d37f025fa7", "score": "0.66085464", "text": "static isValidIdentifier(t){return ut.test(t);}", "title": "" }, { "docid": "862fe9ce9ce68e554e0a0e02f57514e3", "score": "0.6588171", "text": "jsx_parseIdentifier() {\n let node = this.startNode();\n if (this.type === tok.jsxName) node.name = this.value;else if (this.type.keyword) node.name = this.type.keyword;else this.unexpected();\n this.next();\n return this.finishNode(node, 'JSXIdentifier');\n }", "title": "" }, { "docid": "517b46b9d3a70661dd4ca3b01aa19019", "score": "0.65838325", "text": "function isIdentifierChar(code) {\n let l = code.length;\n while (l--) {\n const ch = code.charCodeAt(code.length - l);\n return validationChar(ch) || ch === 0x24 /* $ */ || ch === 0x5f /* _ */ || ch === 0x200c /* <ZWNJ> */ || ch === 0x200d; /* <ZWJ> */\n }\n}", "title": "" }, { "docid": "014d55b5ad1682518aeb24336db386e9", "score": "0.6576458", "text": "function isIdentifier(node) {\n return node.type === \"Identifier\";\n}", "title": "" }, { "docid": "aee033c53c367e6d65fb025688d56053", "score": "0.6531598", "text": "function isIdentifierChar(code) {\n if (code < 48) return code === 36;\n if (code < 58) return true;\n if (code < 65) return false;\n if (code < 91) return true;\n if (code < 97) return code === 95;\n if (code < 123) return true;\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n}", "title": "" }, { "docid": "aee033c53c367e6d65fb025688d56053", "score": "0.6531598", "text": "function isIdentifierChar(code) {\n if (code < 48) return code === 36;\n if (code < 58) return true;\n if (code < 65) return false;\n if (code < 91) return true;\n if (code < 97) return code === 95;\n if (code < 123) return true;\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n}", "title": "" }, { "docid": "c030ffa045d0d314a752b98b7b577a76", "score": "0.6530556", "text": "function isIdentifierChar(code) {\n\t if (code < 48) return code === 36;\n\t if (code < 58) return true;\n\t if (code < 65) return false;\n\t if (code < 91) return true;\n\t if (code < 97) return code === 95;\n\t if (code < 123) return true;\n\t if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n\t return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n\t}", "title": "" }, { "docid": "c030ffa045d0d314a752b98b7b577a76", "score": "0.6530556", "text": "function isIdentifierChar(code) {\n\t if (code < 48) return code === 36;\n\t if (code < 58) return true;\n\t if (code < 65) return false;\n\t if (code < 91) return true;\n\t if (code < 97) return code === 95;\n\t if (code < 123) return true;\n\t if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n\t return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n\t}", "title": "" }, { "docid": "c030ffa045d0d314a752b98b7b577a76", "score": "0.6530556", "text": "function isIdentifierChar(code) {\n\t if (code < 48) return code === 36;\n\t if (code < 58) return true;\n\t if (code < 65) return false;\n\t if (code < 91) return true;\n\t if (code < 97) return code === 95;\n\t if (code < 123) return true;\n\t if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n\t return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n\t}", "title": "" }, { "docid": "f06fa30fca94637388a0dc17fa57c0ee", "score": "0.6502061", "text": "function isIdentifierPart(ch) {\n // Generated by `tools/generate-identifier-regex.js`.\n var NonAsciiIdentifierPart = new RegExp('[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԯԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠ-ࢲࣤ-ॣ०-९ॱ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఀ-ఃఅ-ఌఎ-ఐఒ-నప-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಁ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲഁ-ഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟ෦-෯ෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤞᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧ᪰-᪽ᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶ᳸᳹ᴀ-᷵᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚝꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꧠ-ꧾꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︭︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]');\n\n return ch === 36 || ch === 95 || // $ (dollar) and _ (underscore)\n ch >= 65 && ch <= 90 || // A..Z\n ch >= 97 && ch <= 122 || // a..z\n ch >= 48 && ch <= 57 || // 0..9\n ch === 92 || // \\ (backslash)\n ch >= 0x80 && NonAsciiIdentifierPart.test(String.fromCharCode(ch));\n }", "title": "" }, { "docid": "844caf6900c1db8a24d088666eb28d04", "score": "0.6473941", "text": "static isValidIdentifier(t) {\n return ht.test(t);\n }", "title": "" }, { "docid": "fa9ea25f096a5847a556ea3f41ef1c5e", "score": "0.64698994", "text": "function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && RegexNonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }", "title": "" }, { "docid": "015126158f96acaf502440dda6f2c3de", "score": "0.645249", "text": "function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && RegexNonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n}", "title": "" }, { "docid": "348956929e871b785d97986c7af68910", "score": "0.6451243", "text": "function isIdentifierStart(ch) {\r\n return (ch == 0x40) || (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\r\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\r\n (ch >= 0x61 && ch <= 0x7A) || // a..z\r\n (ch === 0x5C) || // \\ (backslash)\r\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\r\n }", "title": "" }, { "docid": "ef577bef901cffddfffbf4623fb1eda1", "score": "0.6448274", "text": "readIdentifier() {\n const location = this.getLocation();\n let value = '';\n let type = constants_1.TOKEN_TYPE.IDENTIFIER;\n if (this.peekChar() === '@') {\n type = constants_1.TOKEN_TYPE.ALIAS;\n this.readChar(); // => '@'\n }\n if (this.peekChar() === '$') {\n type = constants_1.TOKEN_TYPE.EXPORT;\n this.readChar(); // => '$'\n }\n while (!this.isEOF() && /[a-zA-Z_]/.test(this.peekChar())) {\n value += this.readChar();\n }\n return new Token_1.default(type, value, location);\n }", "title": "" }, { "docid": "ac192f31eb377d7e6cfca66e847d97b4", "score": "0.64373094", "text": "function scanJsxIdentifier() {\n if (tokenIsIdentifierOrKeyword(token)) {\n var firstCharPosition = pos;\n while (pos < end) {\n var ch = text.charCodeAt(pos);\n if (ch === 45 /* minus */ || ((firstCharPosition === pos) ? isIdentifierStart(ch, languageVersion) : isIdentifierPart(ch, languageVersion))) {\n pos++;\n }\n else {\n break;\n }\n }\n tokenValue += text.substr(firstCharPosition, pos - firstCharPosition);\n }\n return token;\n }", "title": "" }, { "docid": "8b30da810d04340f703844e92887412a", "score": "0.6437257", "text": "function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }", "title": "" }, { "docid": "8b30da810d04340f703844e92887412a", "score": "0.6437257", "text": "function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }", "title": "" }, { "docid": "8b30da810d04340f703844e92887412a", "score": "0.6437257", "text": "function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }", "title": "" }, { "docid": "5771f80deb2b4d91a7595d95ccf5b851", "score": "0.6426824", "text": "function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && RegexNonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }", "title": "" }, { "docid": "aa56edd60f1040aaf1a9985a4da9c716", "score": "0.64185977", "text": "function toIdentifier(str){return str.split(' ').map(function(token){return token.slice(0,1).toUpperCase() + token.slice(1);}).join('').replace(/[^ _0-9a-z]/gi,'');}", "title": "" }, { "docid": "473094fedd0437131db4f2bb8c0c8f86", "score": "0.64131176", "text": "function scanJsxIdentifier() {\n\t if (tokenIsIdentifierOrKeyword(token)) {\n\t var firstCharPosition = pos;\n\t while (pos < end) {\n\t var ch = text.charCodeAt(pos);\n\t if (ch === 45 /* minus */ || ((firstCharPosition === pos) ? isIdentifierStart(ch, languageVersion) : isIdentifierPart(ch, languageVersion))) {\n\t pos++;\n\t }\n\t else {\n\t break;\n\t }\n\t }\n\t tokenValue += text.substr(firstCharPosition, pos - firstCharPosition);\n\t }\n\t return token;\n\t }", "title": "" }, { "docid": "ee05af56ba498f7a93a70a7748e85dd9", "score": "0.6407492", "text": "function isIdentifierStart(ch) {\n\t\t return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n\t\t (ch >= 0x41 && ch <= 0x5A) || // A..Z\n\t\t (ch >= 0x61 && ch <= 0x7A) || // a..z\n\t\t (ch === 0x5C) || // \\ (backslash)\n\t\t ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n\t\t }", "title": "" }, { "docid": "5de0143ab3f01d750d2ccb48c89bc723", "score": "0.6405267", "text": "get identifier() {\n\n\t\tconst match = name.match( /[a-zA-Z].*/ );\n\t\tif ( ! match )\n\t\t\tthrow new Error( `Cannot make '${this.string}' an identifier` );\n\t\tconst identifier = match[ 0 ]\n\t\t\t.replace( /[^0-9A-Za-z-._ ]/g, \"\" )\n\t\t\t.replace( /[-._]/g, \" \" );\n\n\t\treturn new Formatter( identifier );\n\n\t}", "title": "" }, { "docid": "460c3f2e18f816d485dd4d6de33a767b", "score": "0.6404083", "text": "function scanIdentifier() {\n const identStart = source.charAt(pos);\n const start = ++pos;\n while (isIdentifierPart(source.charAt(pos))) {\n pos++;\n }\n value = '' + identStart + source.substring(start, pos);\n type = value === 'function' || value === 'class' ? value : 'ident';\n if (type !== 'ident') {\n value = '';\n }\n return value;\n }", "title": "" }, { "docid": "e11565f2769f2b5e33cb8549caf2bd64", "score": "0.64013475", "text": "function mkIdentifier(s) {\n s = '' + s;\n return s\n // Convert dashed ids to Camel Case (though NOT lowercasing the initial letter though!), \n // e.g. `camelCase('camels-have-one-hump')` => `'camelsHaveOneHump'`\n .replace(/-\\w/g, function (match) {\n var c = match.charAt(1);\n var rv = c.toUpperCase();\n // do not mutate 'a-2' to 'a2':\n if (c === rv && c.match(/\\d/)) {\n return match;\n }\n return rv;\n })\n // cleanup: replace any non-suitable character series to a single underscore:\n .replace(/^[^\\w_]/, '_')\n // do not accept numerics at the leading position, despite those matching regex `\\w`:\n .replace(/^\\d/, '_').replace(/[^\\w\\d_]/g, '_')\n // and only accept multiple (double, not triple) underscores at start or end of identifier name:\n .replace(/^__+/, '#').replace(/__+$/, '#').replace(/_+/g, '_').replace(/#/g, '__');\n}", "title": "" }, { "docid": "04b80c2f4bb0a3e2d3f93ed1e888d9e4", "score": "0.6392016", "text": "function extractValueFromIdentifier(value) {\n\t var name = value.name;\n\t\n\t\n\t if (JS_RESERVED.hasOwnProperty(name)) {\n\t return JS_RESERVED[name];\n\t }\n\t\n\t return name;\n\t}", "title": "" }, { "docid": "4116cd0fe860ebca9be7223c3a920778", "score": "0.6387724", "text": "function extractValueFromIdentifier(value) {\n var name = value.name;\n\n\n if (Object.hasOwnProperty.call(JS_RESERVED, name)) {\n return JS_RESERVED[name];\n }\n\n return name;\n}", "title": "" }, { "docid": "8a1fd51ca862448483cc3d2ce7abf5c0", "score": "0.6387357", "text": "function isIdentifierChar(code, astral) {\n\t \t if (code < 48) { return code === 36 }\n\t \t if (code < 58) { return true }\n\t \t if (code < 65) { return false }\n\t \t if (code < 91) { return true }\n\t \t if (code < 97) { return code === 95 }\n\t \t if (code < 123) { return true }\n\t \t if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }\n\t \t if (astral === false) { return false }\n\t \t return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n\t \t}", "title": "" }, { "docid": "27961e6dda5480363de05e011a7ec200", "score": "0.6382562", "text": "escapeIdentifier(str) {\n return utils.escapeIdentifier(str)\n }", "title": "" }, { "docid": "ef93521f1de03ec9f369434a2b1e9eb5", "score": "0.63806933", "text": "_$name() {\n super._$name();\n\n const type = this._node.declarations[0].id.type;\n switch (type) {\n case 'Identifier':\n this._value.name = this._node.declarations[0].id.name;\n break;\n case 'ObjectPattern':\n // TODO: optimize for multi variables.\n // e.g. export const {a, b} = obj\n this._value.name = this._node.declarations[0].id.properties[0].key.name;\n break;\n case 'ArrayPattern':\n // TODO: optimize for multi variables.\n // e.g. export cont [a, b] = arr\n this._value.name = this._node.declarations[0].id.elements.find(v => v).name;\n break;\n default:\n throw new Error(`unknown declarations type: ${ type }`);\n }\n }", "title": "" }, { "docid": "d6500402cee88b2a0e3a4588cbfb0d69", "score": "0.6378404", "text": "function isIdentifierChar(code, astral) {\n\t if (code < 48) return code === 36\n\t if (code < 58) return true\n\t if (code < 65) return false\n\t if (code < 91) return true\n\t if (code < 97) return code === 95\n\t if (code < 123) return true\n\t if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code))\n\t if (astral === false) return false\n\t return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n\t }", "title": "" }, { "docid": "48eece83adeafedd0bc008111fb4ab0b", "score": "0.6363401", "text": "function isIdentifierStart(ch) {\n\t return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n\t (ch >= 0x41 && ch <= 0x5A) || // A..Z\n\t (ch >= 0x61 && ch <= 0x7A) || // a..z\n\t (ch === 0x5C) || // \\ (backslash)\n\t ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n\t }", "title": "" }, { "docid": "ede4da80af23407cfc583973a7561f86", "score": "0.63607794", "text": "parseIdentifier(token) {\n if (token.name === tokens.names.IDENTIFIER) {\n return new Identifier(token);\n }\n }", "title": "" }, { "docid": "913c8162ab6152bad4d373efa3abe59c", "score": "0.6349951", "text": "function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }", "title": "" }, { "docid": "913c8162ab6152bad4d373efa3abe59c", "score": "0.6349951", "text": "function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }", "title": "" }, { "docid": "913c8162ab6152bad4d373efa3abe59c", "score": "0.6349951", "text": "function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }", "title": "" }, { "docid": "913c8162ab6152bad4d373efa3abe59c", "score": "0.6349951", "text": "function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }", "title": "" }, { "docid": "913c8162ab6152bad4d373efa3abe59c", "score": "0.6349951", "text": "function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }", "title": "" }, { "docid": "913c8162ab6152bad4d373efa3abe59c", "score": "0.6349951", "text": "function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }", "title": "" }, { "docid": "913c8162ab6152bad4d373efa3abe59c", "score": "0.6349951", "text": "function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }", "title": "" }, { "docid": "be704e2b9cc33c8ca83c5b53f01a8713", "score": "0.63377154", "text": "function isIdentifierStart(ch) {\n return (ch == 0x40) || (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }", "title": "" }, { "docid": "be704e2b9cc33c8ca83c5b53f01a8713", "score": "0.63377154", "text": "function isIdentifierStart(ch) {\n return (ch == 0x40) || (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }", "title": "" }, { "docid": "ded632a4dcf9a538670c82db13dfef5b", "score": "0.6318772", "text": "function escapeIdentifier(identifier) {\n\t return identifier.length >= 2 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ ? \"_\" + identifier : identifier;\n\t }", "title": "" }, { "docid": "d2153b942a86017ef428cf8582cabe68", "score": "0.63173383", "text": "parseIdentifierReference() {\n const node = this.startNode();\n const token = this.next();\n switch (token.type) {\n case Token.IDENTIFIER:\n node.name = token.value;\n break;\n case Token.ESCAPED_KEYWORD:\n node.name = token.value;\n break;\n case Token.YIELD:\n if (this.scope.hasYield()) {\n this.unexpected(token);\n }\n node.name = 'yield';\n break;\n case Token.AWAIT:\n if (this.scope.hasAwait()) {\n this.unexpected(token);\n }\n node.name = 'await';\n break;\n default:\n this.unexpected(token);\n }\n if (node.name === 'yield' && (this.scope.hasYield() || this.scope.isModule())) {\n this.raiseEarly('UnexpectedToken', token);\n }\n if (node.name === 'await' && (this.scope.hasAwait() || this.scope.isModule())) {\n this.raiseEarly('UnexpectedToken', token);\n }\n if (this.isStrictMode() && isReservedWordStrict(node.name)) {\n this.raiseEarly('UnexpectedToken', token);\n }\n if (node.name !== 'yield'\n && node.name !== 'await'\n && isKeywordRaw(node.name)) {\n this.raiseEarly('UnexpectedToken', token);\n }\n return this.finishNode(node, 'IdentifierReference');\n }", "title": "" }, { "docid": "a55b09b614642f0f2168ac9883ab0860", "score": "0.6312595", "text": "function isIdentifierChar(code, astral) {\n if (code < 48) return code === 36;\n if (code < 58) return true;\n if (code < 65) return false;\n if (code < 91) return true;\n if (code < 97) return code === 95;\n if (code < 123) return true;\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n if (astral === false) return false;\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n }", "title": "" }, { "docid": "9d372194047437dcea67b15a2f973cfc", "score": "0.63069445", "text": "function isIdentifierChar(code, astral) {\n if (code < 48) return code === 36\n if (code < 58) return true\n if (code < 65) return false\n if (code < 91) return true\n if (code < 97) return code === 95\n if (code < 123) return true\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code))\n if (astral === false) return false\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n }", "title": "" }, { "docid": "9d372194047437dcea67b15a2f973cfc", "score": "0.63069445", "text": "function isIdentifierChar(code, astral) {\n if (code < 48) return code === 36\n if (code < 58) return true\n if (code < 65) return false\n if (code < 91) return true\n if (code < 97) return code === 95\n if (code < 123) return true\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code))\n if (astral === false) return false\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n }", "title": "" }, { "docid": "ec9325cb58c12d2cc8259ed1fee7717d", "score": "0.62983364", "text": "function isESSymbolIdentifier(node) {\n\t return node.kind === 69 /* Identifier */ && node.text === \"Symbol\";\n\t }", "title": "" }, { "docid": "e540917cc0aeb95a91eaa7a04fdf9ee4", "score": "0.62920415", "text": "function isIdentifierChar(code, astral) {\n\t if (code < 48) { return code === 36 }\n\t if (code < 58) { return true }\n\t if (code < 65) { return false }\n\t if (code < 91) { return true }\n\t if (code < 97) { return code === 95 }\n\t if (code < 123) { return true }\n\t if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }\n\t if (astral === false) { return false }\n\t return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n\t}", "title": "" }, { "docid": "e1ed2d880076841537bd492217258c2c", "score": "0.6284809", "text": "identifier() {\n const characters = [this.currentChar()]\n const start = this.start\n\n this.advance()\n\n while (this.isAlphaNumeric(this.currentChar())) {\n characters.push(this.currentChar())\n this.advance()\n }\n\n const lexeme = characters.join('')\n\n // The Keywords object is a dictionary of keyword lexemes as keys\n // and functions to generate the associated token as values\n // If the current lexeme is a keyword, use its token generating function,\n // otherwise use the default ID token generator (stored in '_')\n const tokenGenerator = Keywords[lexeme] || Keywords._\n\n return tokenGenerator(lexeme, this.line, start)\n }", "title": "" }, { "docid": "5a60420a17533ce847577665cb279a77", "score": "0.6279505", "text": "function isIdentifierChar(code, astral) {\n if (code < 48) return code === 36\n if (code < 58) return true\n if (code < 65) return false\n if (code < 91) return true\n if (code < 97) return code === 95\n if (code < 123) return true\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code))\n if (astral === false) return false\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n}", "title": "" }, { "docid": "5a60420a17533ce847577665cb279a77", "score": "0.6279505", "text": "function isIdentifierChar(code, astral) {\n if (code < 48) return code === 36\n if (code < 58) return true\n if (code < 65) return false\n if (code < 91) return true\n if (code < 97) return code === 95\n if (code < 123) return true\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code))\n if (astral === false) return false\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n}", "title": "" }, { "docid": "5a60420a17533ce847577665cb279a77", "score": "0.6279505", "text": "function isIdentifierChar(code, astral) {\n if (code < 48) return code === 36\n if (code < 58) return true\n if (code < 65) return false\n if (code < 91) return true\n if (code < 97) return code === 95\n if (code < 123) return true\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code))\n if (astral === false) return false\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n}", "title": "" }, { "docid": "ebb87b75e7f058f631131bb309f83173", "score": "0.627809", "text": "function isIdentifierStart(ch) {\n return (\n ch === '$' ||\n ch === '_' ||\n ch === '\\\\' ||\n (ch >= 'a' && ch <= 'z') ||\n (ch >= 'A' && ch <= 'Z') ||\n (ch.charCodeAt(0) >= 0x80 &&\n Regex.NonAsciiIdentifierStart.test(ch))\n );\n }", "title": "" }, { "docid": "9087afd7a06dc4b12b66763c950d660c", "score": "0.62765235", "text": "_id() {\n let result = \"\";\n while (this.currentChar && this.currentChar.match(/[a-zA-Z_0-9]/)) {\n result += this.currentChar;\n this.advance();\n }\n\n // if the identifier is a reserved keyword, return that token instead\n const token = RESERVED_KEYWORDS[result]\n ? new Token(RESERVED_KEYWORDS[result], result)\n : new Token(tokens.ID, result);\n return token;\n }", "title": "" }, { "docid": "d7a486b0dfb5bf05779b1075b6f31e45", "score": "0.6273797", "text": "function isIdentifierChar(code, astral) {\n if (code < 48) { return code === 36 }\n if (code < 58) { return true }\n if (code < 65) { return false }\n if (code < 91) { return true }\n if (code < 97) { return code === 95 }\n if (code < 123) { return true }\n if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }\n if (astral === false) { return false }\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n }", "title": "" }, { "docid": "d7a486b0dfb5bf05779b1075b6f31e45", "score": "0.6273797", "text": "function isIdentifierChar(code, astral) {\n if (code < 48) { return code === 36 }\n if (code < 58) { return true }\n if (code < 65) { return false }\n if (code < 91) { return true }\n if (code < 97) { return code === 95 }\n if (code < 123) { return true }\n if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }\n if (astral === false) { return false }\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n }", "title": "" }, { "docid": "d7a486b0dfb5bf05779b1075b6f31e45", "score": "0.6273797", "text": "function isIdentifierChar(code, astral) {\n if (code < 48) { return code === 36 }\n if (code < 58) { return true }\n if (code < 65) { return false }\n if (code < 91) { return true }\n if (code < 97) { return code === 95 }\n if (code < 123) { return true }\n if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }\n if (astral === false) { return false }\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n }", "title": "" }, { "docid": "d7a486b0dfb5bf05779b1075b6f31e45", "score": "0.6273797", "text": "function isIdentifierChar(code, astral) {\n if (code < 48) { return code === 36 }\n if (code < 58) { return true }\n if (code < 65) { return false }\n if (code < 91) { return true }\n if (code < 97) { return code === 95 }\n if (code < 123) { return true }\n if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }\n if (astral === false) { return false }\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n }", "title": "" }, { "docid": "46b3ce4b77205f964b208cd7ff3a43ee", "score": "0.6254246", "text": "function isIdentifier() {\n if (token() === 71 /* Identifier */) {\n return true;\n }\n // If we have a 'yield' keyword, and we're in the [yield] context, then 'yield' is\n // considered a keyword and is not an identifier.\n if (token() === 116 /* YieldKeyword */ && inYieldContext()) {\n return false;\n }\n // If we have a 'await' keyword, and we're in the [Await] context, then 'await' is\n // considered a keyword and is not an identifier.\n if (token() === 121 /* AwaitKeyword */ && inAwaitContext()) {\n return false;\n }\n return token() > 107 /* LastReservedWord */;\n }", "title": "" }, { "docid": "f3a6541771b56b2974f8636897555585", "score": "0.6249909", "text": "function cIsReservedIdentifier(token) {\n if (!token || token.length < 2) return false;\n if (token[0] != '_') return false;\n return (token[1] == '_') || (token[1] !== token[1].toLowerCase());\n }", "title": "" }, { "docid": "b8776911f154c020289e2c4fa42c0c5a", "score": "0.6248072", "text": "function isIdentifierChar(code, astral) {\n if (code < 48) { return code === 36 }\n if (code < 58) { return true }\n if (code < 65) { return false }\n if (code < 91) { return true }\n if (code < 97) { return code === 95 }\n if (code < 123) { return true }\n if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }\n if (astral === false) { return false }\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n}", "title": "" }, { "docid": "b8776911f154c020289e2c4fa42c0c5a", "score": "0.6248072", "text": "function isIdentifierChar(code, astral) {\n if (code < 48) { return code === 36 }\n if (code < 58) { return true }\n if (code < 65) { return false }\n if (code < 91) { return true }\n if (code < 97) { return code === 95 }\n if (code < 123) { return true }\n if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }\n if (astral === false) { return false }\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n}", "title": "" }, { "docid": "b8776911f154c020289e2c4fa42c0c5a", "score": "0.6248072", "text": "function isIdentifierChar(code, astral) {\n if (code < 48) { return code === 36 }\n if (code < 58) { return true }\n if (code < 65) { return false }\n if (code < 91) { return true }\n if (code < 97) { return code === 95 }\n if (code < 123) { return true }\n if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }\n if (astral === false) { return false }\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n}", "title": "" }, { "docid": "b8776911f154c020289e2c4fa42c0c5a", "score": "0.6248072", "text": "function isIdentifierChar(code, astral) {\n if (code < 48) { return code === 36 }\n if (code < 58) { return true }\n if (code < 65) { return false }\n if (code < 91) { return true }\n if (code < 97) { return code === 95 }\n if (code < 123) { return true }\n if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }\n if (astral === false) { return false }\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n}", "title": "" }, { "docid": "b8776911f154c020289e2c4fa42c0c5a", "score": "0.6248072", "text": "function isIdentifierChar(code, astral) {\n if (code < 48) { return code === 36 }\n if (code < 58) { return true }\n if (code < 65) { return false }\n if (code < 91) { return true }\n if (code < 97) { return code === 95 }\n if (code < 123) { return true }\n if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }\n if (astral === false) { return false }\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n}", "title": "" }, { "docid": "b8776911f154c020289e2c4fa42c0c5a", "score": "0.6248072", "text": "function isIdentifierChar(code, astral) {\n if (code < 48) { return code === 36 }\n if (code < 58) { return true }\n if (code < 65) { return false }\n if (code < 91) { return true }\n if (code < 97) { return code === 95 }\n if (code < 123) { return true }\n if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }\n if (astral === false) { return false }\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n}", "title": "" }, { "docid": "b8776911f154c020289e2c4fa42c0c5a", "score": "0.6248072", "text": "function isIdentifierChar(code, astral) {\n if (code < 48) { return code === 36 }\n if (code < 58) { return true }\n if (code < 65) { return false }\n if (code < 91) { return true }\n if (code < 97) { return code === 95 }\n if (code < 123) { return true }\n if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }\n if (astral === false) { return false }\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n}", "title": "" }, { "docid": "b8776911f154c020289e2c4fa42c0c5a", "score": "0.6248072", "text": "function isIdentifierChar(code, astral) {\n if (code < 48) { return code === 36 }\n if (code < 58) { return true }\n if (code < 65) { return false }\n if (code < 91) { return true }\n if (code < 97) { return code === 95 }\n if (code < 123) { return true }\n if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }\n if (astral === false) { return false }\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n}", "title": "" }, { "docid": "b8776911f154c020289e2c4fa42c0c5a", "score": "0.6248072", "text": "function isIdentifierChar(code, astral) {\n if (code < 48) { return code === 36 }\n if (code < 58) { return true }\n if (code < 65) { return false }\n if (code < 91) { return true }\n if (code < 97) { return code === 95 }\n if (code < 123) { return true }\n if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }\n if (astral === false) { return false }\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n}", "title": "" }, { "docid": "b8776911f154c020289e2c4fa42c0c5a", "score": "0.6248072", "text": "function isIdentifierChar(code, astral) {\n if (code < 48) { return code === 36 }\n if (code < 58) { return true }\n if (code < 65) { return false }\n if (code < 91) { return true }\n if (code < 97) { return code === 95 }\n if (code < 123) { return true }\n if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }\n if (astral === false) { return false }\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n}", "title": "" }, { "docid": "b8776911f154c020289e2c4fa42c0c5a", "score": "0.6248072", "text": "function isIdentifierChar(code, astral) {\n if (code < 48) { return code === 36 }\n if (code < 58) { return true }\n if (code < 65) { return false }\n if (code < 91) { return true }\n if (code < 97) { return code === 95 }\n if (code < 123) { return true }\n if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }\n if (astral === false) { return false }\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n}", "title": "" } ]
f20ee5d811c6a51169f57e637a91a7c3
particular li clicked function
[ { "docid": "d61f5c6e8aedd3b1ccb81eeab7720372", "score": "0.708135", "text": "function clicked(element){\r\n let getLiIndex = element.getAttribute(\"li-index\");\r\n musicIndex = getLiIndex; //updating current song index with clicked li index\r\n loadMusic(musicIndex);\r\n playMusic();\r\n playingSong();\r\n}", "title": "" } ]
[ { "docid": "7af1f16b8d36a848676f274ee501fa0f", "score": "0.7080392", "text": "function clicked(element){\n let getLiIndex = element.getAttribute(\"li-index\");\n musicIndex = getLiIndex; //updating current song index with clicked li index\n loadMusic(musicIndex);\n playMusic();\n playingSong();\n}", "title": "" }, { "docid": "992d9fee8540b5bb7be7ddc1213b1b57", "score": "0.6911757", "text": "function handle_list_item() {\n $('.list_item').click(function() {\n window.location = $(this).find('h2 a').attr('href').toString();\n return false;\n });\n // Kliknutim na obec nebo na ikonu LM/FM nechceme skocit na detail ubytovani\n $('.list_item .place a, .list_item .icon').click(function(event) {\n event.stopPropagation();\n });\n}", "title": "" }, { "docid": "fee63b35223bac585fd8e4cfe09a9da0", "score": "0.6886791", "text": "function clicked(element) {\n let getLiIndex = element.getAttribute('li-index');\n musicIndex = getLiIndex;\n loadMusic(musicIndex);\n playMusic();\n playingNow();\n}", "title": "" }, { "docid": "77169ea813ad042ca00567d4c1aeb00e", "score": "0.68422675", "text": "function jqListClicked() {\n $('#eventsForm li').each(function () {\n $(this).on('click', function () {\n $(\"#eventsForm p\").html($(this).text());\n })\n });\n}", "title": "" }, { "docid": "80d2e90fc6b0d7f9e57fd997d7d4096d", "score": "0.6804685", "text": "function handler(event) {\n var target = $(event.target);\n if (target.is(\"li\")) {\n target.children().toggle();\n }\n }", "title": "" }, { "docid": "025adab27d407e88cd108cd2dbd69af1", "score": "0.6739575", "text": "function _handleClick(e) {\n if(e.target.nodeName == \"UL\") {\n return;\n }\n\n let index = e.target.getAttribute(\"data-id\");\n\n _selectItem(index);\n }", "title": "" }, { "docid": "168a19d69493382ef3bdfc7d3f802674", "score": "0.66514546", "text": "function on_listClick (event) {\n var t = event.currentTarget;\n var id = $(t).attr('id');\n id = id.split(\"-\")[1];\n this.setChess(id);\n }", "title": "" }, { "docid": "597e353322e6d60acfa260e465a89c2c", "score": "0.66121376", "text": "function addClickEventListenerToUl(ul, studentLiItems){\n const links = ul.children;\n\n ul.addEventListener('click', (e) => {\n if (e.target.tagName === 'A'){\n for (let i = 0; i < links.length; i++){\n let a = links[i].firstElementChild;\n a.className = '';\n }\n const link = e.target;\n const pageNumber = link.textContent;\n link.className = 'active';\n showPage(studentLiItems, pageNumber);\n }\n });\n}", "title": "" }, { "docid": "e16418373b3c4518dab314f6e056f75f", "score": "0.6541924", "text": "handleListSelection() {\n $(function () {\n $('body').on('click', '.list-group-item', function () {\n $('.list-group-item').removeClass('active');\n $(this).closest('.list-group-item').addClass('active');\n });\n });\n }", "title": "" }, { "docid": "5848760a5b2668de81c5ccbb4a1cc89a", "score": "0.6534043", "text": "function handleUlClick(element) {\n listItemDone(element);\n deleteListElement(element);\n}", "title": "" }, { "docid": "236f5e00b63b39c67a5d318bf73aee89", "score": "0.65207756", "text": "function itemClick(event) {\n\n\n $(this).find(\"input[type=checkbox]\").click();\n\n updateCompletedBtn();\n updateCheckCount();\n\n // Don't bubble up the event to the enclosing <li> element ?? Ask Willis\n event.stopPropagation();\n}", "title": "" }, { "docid": "17c3d1ca168ce734a5f4fe2da625368d", "score": "0.64993644", "text": "function bindItemClicked(){\n // handle when user item is clicked.\n var userListItems = userList.find(\"li\");\n userListItems.click(function(){\n selectUser($(this));\n });\n }", "title": "" }, { "docid": "69e0cc5ee2559fcb9463686e562536c0", "score": "0.64652973", "text": "function toggleListItem(e) {\r\n var target; // Declare variables\r\n target = getTarget(e); // Get the item clicked link\r\n\r\n if (target.nodeName.toLowerCase() == \"li\") { // If user clicked on a list element\r\n \r\n // Test whether list item is already selected\r\n if (e.target.className == 'selected_item') { \r\n e.target.classList.remove('selected_item');\r\n e.target.classList.add('unselected_item');\r\n } else {\r\n e.target.classList.remove('unselected_item');\r\n e.target.classList.add('selected_item');\r\n }\r\n totalItems();\r\n }\r\n}", "title": "" }, { "docid": "b234ba5326d49d156aa86e0af187c1d0", "score": "0.64629996", "text": "function itemClicked(){\n $(\".listing-container li > div\").off().on(\"click\",function(){ \n if ($(this).children(\"i:first-child\").hasClass(\"permision_ok\") ){\n ulelment=$(\"[path='\"+$(this).parent(\"li\").attr(\"path\")+\"']\").find(\"ul\") \n //ajaxGetChildren($(\"#\"+$(this).parent(\"li\").attr(\"id\")+\"_ul\"),$(this).parent(\"li\").attr(\"path\"),1,0)\n if ($(this).parent(\"li\").attr(\"ftype\")===\"file\"){\n $(\".listing-container ul,li div.bg-primary\").removeClass(\"bg-primary\");\n $(this).addClass(\"bg-primary\"); \n }\n else if (ulelment.is(':visible')){\n $(\"[path='\"+$(this).parent(\"li\").attr(\"path\")+\"'] > ul\").hide()\n }\n else {\n $(\".listing-container ul,li div.bg-primary\").removeClass(\"bg-primary\");\n $(this).addClass(\"bg-primary\");\n $(this).parent(\"li\").find(\"ul\").remove()\n $(\".loader\").show()\n $(this).parent(\"li\").append(\"<ul level='\"+$(this).parent(\"li\").attr(\"level\")+\"_ul' ></ul>\")\n ajaxGetChildren($(\"[path='\"+$(this).parent(\"li\").attr(\"path\")+\"'] > ul\"),$(this).parent(\"li\").attr(\"path\"),parseInt($(this).parent(\"li\").attr(\"level\").match(/(\\d+)$/)[0])+1,parseInt($(this).parent(\"li\").attr(\"level\").match(/(\\d+)$/)[0]))\n $(\"[path='\"+$(this).parent(\"li\").attr(\"path\")+\"'] > ul\").show() \n }\n itemClicked()\n \n }\n\n //console.log(this.parentElement.find(\"ul\"))\n //this.parent().find(\"ul\").slideToggle()\n });\n }", "title": "" }, { "docid": "25b6814339612364dcf8fec1959089ee", "score": "0.6459803", "text": "handleListClick(me, item, e){\n\n\t\t//check if the target has an id:\n\t\tvar targetID = $(e.target).attr('id');\n\t\tif(!(typeof(targetID)===\"undefined\")){\n\n\t\t\t//make sure the first half of the id is \"style_\"\n\t\t\tif(targetID.substr(0, 6)==\"style_\"){\n\n\t\t\t\t//get the ID of the class item clicked:\n\t\t\t\tvar styleID = parseInt(targetID.split('_')[1]);\n\n\t\t\t\t//change which item is selected:\n\t\t\t\tme.setSelectedItem(styleID);\n\n\t\t\t}//matches correct id pattern\n\n\t\t}//end if has ID\n\n\t}", "title": "" }, { "docid": "15509d5c1527ad89dda48b3d650a4d6b", "score": "0.64344066", "text": "function listViewHandler(state) {\n if (typeof $ === 'undefined') {\n return;\n }\n var listHtml = '';\n for (var i = 0; i < state.list.length; i++) {\n listHtml += '<li onclick=\"selectItem()\" data-index=\"' + i + '\" class=\"list-item\">' + state.list[i] + '</li>';\n }\n $('#list').html(listHtml);\n \n $($('#list').children()[state.selected]).addClass('selected');\n}", "title": "" }, { "docid": "02a4da72c5bbeda2bc1a410f7679fe5d", "score": "0.64136857", "text": "itemClick (listView, listItem) {\n Log.log(listItem);\n }", "title": "" }, { "docid": "1d7fec3607b4f296f4f3ae40b2fa6206", "score": "0.6391466", "text": "onClickListItem() {\n const openInfoWindow = e => {\n const index = this.state.markers.findIndex(\n marker =>\n marker.title.toLowerCase() === e.target.innerText.toLowerCase()\n );\n let newMarker = this.state.markers[index];\n let newInfoWindow = this.state.infoWindow;\n\n this.showInfoWindow(newMarker, newInfoWindow);\n // console.log(newMarker);\n };\n\n //we catch event on clicking the list by checking if we clicked withing <ul> and nodeName of event target was li (technique from 3rd project)\n document.getElementById(\"list\").addEventListener(\"click\", e => {\n if (e.target && e.target.nodeName === \"LI\") {\n openInfoWindow(e);\n // console.log(e.target)\n }\n });\n }", "title": "" }, { "docid": "570daaac394af00cda73a4405cbbc374", "score": "0.63859755", "text": "handleListClick(me, item, e){\n\n\t\t//check if the target has an id:\n\t\tvar targetID = $(e.target).attr('id');\n\t\tif(!(typeof(targetID)===\"undefined\")){\n\n\t\t\t//make sure the first half of the id is \"clsItm_\"\n\t\t\tif(targetID.substr(0, 7)==\"clsItm_\"){\n\n\t\t\t\t//get the ID of the class item clicked:\n\t\t\t\tvar ClassItemID = parseInt(targetID.split('_')[1]);\n\n\t\t\t\t//change which item is selected:\n\t\t\t\tme.setSelectedItem(ClassItemID);\n\n\t\t\t}//matches correct id pattern\n\n\t\t}//end if has ID\n\n\t}", "title": "" }, { "docid": "a3a0f63d1017febd5494b40bdad2f059", "score": "0.63725346", "text": "function addAnswerClickListener(){\n\t$(\"li\").on(\"click\", function() {\n\n\t\t//Set selected answer to selected list item \n\t\tselectedAnswer = $(this).html();\n\n\t\t//Show answer page.\n\t\tshowSection (answerPage);\n\n\t\t//Add answer information to answer page \n\t\tcreateAnswerSection(selectedAnswer);\n\t});\n}", "title": "" }, { "docid": "a986e211ddbd84f12ffc1c12e3ca7889", "score": "0.6335314", "text": "function onBulletClick(event, bulletIndex){\n\t\tg_gallery.selectItem(bulletIndex);\t\t\n\t}", "title": "" }, { "docid": "e52cbd8f42ec204b1149a3e3b5207c62", "score": "0.63281983", "text": "function listItemsClick() {\n var $listItem = $(this);\n var listItemName = $listItem.attr('data-scroll-item');\n var contentItem = $('[data-scroll-content=\"' + listItemName + '\"]');\n var contentItemOffset = contentItem.get(0).offsetTop;\n $scrollContainer.animate({ scrollTop: contentItemOffset - 20 });\n $listItems.removeClass('is-active');\n $listItem.addClass('is-active');\n }", "title": "" }, { "docid": "a1f8caab8baffb7ddea2f1891ac58d65", "score": "0.63127023", "text": "function liClicked(_id, name, html) {\n console.log(\"liClicked:\", _id, \" \", name, html);\n\n var elementLi = document.querySelector(\"trix-editor\");\n elementLi.editor.setSelectedRange([0, 999999999999999]);\n elementLi.editor.deleteInDirection(\"forward\");\n elementLi.editor.insertHTML(html); // is a Trix.Editor instance\n\n // setActive( { _id: _id, name: name, html: html } );\n\n socket.emit(\"activeDoc\", _id);\n\n setActiveId(_id);\n setActiveName(name);\n setActiveHTML(html);\n }", "title": "" }, { "docid": "4599fbf614b265bbd5ad26a0750e7b26", "score": "0.6311246", "text": "function deviceClicked(event) {\r\n // change list colors\r\n $(\"li\").css(\"background-color\", \"white\");\r\n $(event.currentTarget).css(\"background-color\", \"#dddddd\");\r\n\r\n // save current device's id\r\n device_id = event.currentTarget.id;\r\n // console.log(\"Device \" + device_id + \" clicked\");\r\n}", "title": "" }, { "docid": "51bc48e18db3d401ffe5422e6e830e91", "score": "0.6268183", "text": "onclick(elem) {\n\t callback(elem.target.id)\n\t $(\".loopliactive\").removeClass(\"loopliactive\");\n\t $(\"#\"+elem.target.id).parent().addClass(\"loopliactive\");\n\t}", "title": "" }, { "docid": "89d4e91bd772e03cbabe0f81178e96bf", "score": "0.61857", "text": "function clickedCard(event) {\n if (event.target.nodeName === 'LI') {\n displayCard(event.target);\n }\n}", "title": "" }, { "docid": "7091dd31f50d6848e9d21c7077ad0ae3", "score": "0.6184597", "text": "function addItem()\r\n{\r\n let listItem=$('<li>',{\r\n 'class':'list-group-item',\r\n text:inpNewTask.val()\r\n })\r\n listItem.click(()=>{\r\n /* for using this in commented box pass event argumet inside the function\r\n console.log(\"clicked\",$(event.target));\r\n $(event.target).toggleClass('disabled');*/\r\n listItem.toggleClass('done');\r\n })\r\n ulTasks.append(listItem);\r\n inpNewTask.val(\" \");\r\n toggleInputButtons();\r\n\r\n}", "title": "" }, { "docid": "87af01498f9938616f640d18678d0ea7", "score": "0.6178913", "text": "function valoriser(){\r\n\t\t\t$(\".list-03H a\").click(function(){\r\n\t\t\t\t$(\".list-03H li\").removeClass(\"valor\");\r\n\t\t\t\t$(this).parent(\"li\").addClass(\"valor\");\r\n\t\t});\t}", "title": "" }, { "docid": "4afe6260e5999fb53c7faf69e5e39edf", "score": "0.6166714", "text": "function whenClickOnTallasAndColors() {\n $(\"#list_tallas li a\").click(function(e) {\n e.preventDefault();\n $(\"#list_tallas li a\").removeClass(\"active\");\n $(this).addClass(\"active\");\n $(\"#key_talla_val\").val($(this).data(\"key_talla\"));\n });\n $(\"#list_colors li\").click(function(e) {\n e.preventDefault();\n $(\"#list_colors li\").removeClass(\"active\");\n $(this).addClass(\"active\");\n $(\"#key_color_val\").val($(this).data(\"key_color\"));\n });\n}", "title": "" }, { "docid": "69404f2a1144f0c4a537c3a0e164d4b7", "score": "0.6155364", "text": "bindShowCitiesHandler() {\n document.getElementById(\"list-container\").addEventListener(\"click\", (e) => {\n e.target.tagName === \"LI\" && this.onClickShowCities(e.target.getAttribute(\"index\"))\n })\n }", "title": "" }, { "docid": "9a95739136200945439d735e043247d7", "score": "0.6131628", "text": "function liClick(event) {\n var taskDetails = location.href;\n var splitDetails = taskDetails.split('index.html');\n var detailTitle = document.createElement(\"p\");\n detailTitle.innerHTML = this.textContent;\n var title = detailTitle.innerHTML;\n var newURL = splitDetails[0] + 'details.html' + '?' + 'title' + '=' + title;\n window.location.href = newURL;\n}", "title": "" }, { "docid": "3bb01efb6dca7274c29dbd8e46ed1b92", "score": "0.6124252", "text": "function setSpecificListItemListener(listId, eventHandler){\n\t$(\"#\" + listId + \" li:not(:first)\").click(function(){\n\t\t$(\"#\" + listId + \" li\").removeClass(\"active\");\n\t\t$(this).addClass(\"active\");\n\t\teventHandler($(this),listId);\n\t});\n}", "title": "" }, { "docid": "d882716035104d062cd0c91f4e3f137a", "score": "0.60799515", "text": "function clicked(d,i) {\n\n}", "title": "" }, { "docid": "998b64d7cb2e9016cd550cea1dccd907", "score": "0.607277", "text": "function menuClicks() {\n \"use strict\";\n\n $('.main-nav ul li a').on(\"click\", function() {\n $('.main-nav ul li a').removeClass('activeMenuItem');\n $(this).addClass('activeMenuItem');\n });\n\n}", "title": "" }, { "docid": "1ee81c43ff40c902e152869106cac654", "score": "0.6064078", "text": "function clickMenu(idLi) {\n\tvar active = idLi.split(\"-\");\n\tvar pnt = active[0];\n\tvar child = active[1];\n\n\t$(\".page-sidebar-menu li\").removeClass(\"active\");\n\t$(\".page-sidebar-menu li\").removeClass(\"open\");\n\t$(\"#\" + pnt).addClass(\"active\");\n\tif(child){\n\t\t$(\"#\" + child).addClass(\"active\");\n\t}\n}", "title": "" }, { "docid": "f021c64fa51ecfd609eb8ce1923e4af6", "score": "0.60636514", "text": "handleClick(i) {\n\t\t//TODO\n\t}", "title": "" }, { "docid": "aa906c4cea1cbce606fbddd7cb9d1b0c", "score": "0.6052887", "text": "function clicked() {\n\n}", "title": "" }, { "docid": "ffae67bb58587f56cc0396eef38b8933", "score": "0.6029293", "text": "function ACListClick(e) {\r\n var ele = e.target;\r\n if(ele.tagName == \"STRONG\") ele = ele.parentNode;\r\n if(ele.tagName != \"LI\") return true;\r\n e.stopPropagation();\r\n changeSuggest();\r\n curPattern = \"\";\r\n completeFlag = 0;\r\n closeACList();\r\n }", "title": "" }, { "docid": "321990f983974ba4445edc0bf3ab1995", "score": "0.60233724", "text": "function listTypeSelected(e) {\n\n getMovieList(e.sender.selectedIndex);\n }", "title": "" }, { "docid": "9bd4145b2ee36d832acac7ee72cdab33", "score": "0.6019862", "text": "function listTog() {\n\t$('.list-options input.slider').click(function() {\n\t\tvar id = $(this).next(\".slid\");\n\t\t$(id).slideToggle('fast');\n\t});\n}", "title": "" }, { "docid": "979ddd6c417060b858827fe1c8393c50", "score": "0.60118926", "text": "function ACListMouseover(e) {\r\n var ele = e.target;\r\n if(ele.tagName == \"STRONG\") ele = ele.parentNode;\r\n if(ele.tagName != \"LI\") return true;\r\n e.stopPropagation();\r\n var acList = document.getElementById(\"ac-list\");\r\n if(listIndex != -1) {\r\n acList.childNodes[listIndex].className = \"\";\r\n }\r\n listIndex = ele.getAttribute(\"rel\");\r\n acList.childNodes[listIndex].className = \"ac-active\";\r\n }", "title": "" }, { "docid": "5c47dd33b644d23f3661f1cd0b4ffe24", "score": "0.60082936", "text": "function liDoubleClicked(e) {\n e.target.remove();\n }", "title": "" }, { "docid": "1ab61f2722cc87b13a4bddd97079c0aa", "score": "0.5988094", "text": "function selectionFeedback() {\n $('li').on('click', function() {\n if (questions[currentQuestion].correct == this.id) {\n $(this).toggleClass('correct-li');\n numberCorrect += 1;\n } else {\n $(this).toggleClass('incorrect-li');\n }\n });\n }", "title": "" }, { "docid": "4ac5ca313bd333236bc820bf41a4ad40", "score": "0.5975277", "text": "function accordionClickEvent(listing) {\n\t\t\n\t\tlisting.click(function(){\n\t\t\tif ($(this).parents('li').hasClass('active')) {\n\t\t\t\t//if the listing is active\n\t\t\t\t$(this).siblings('.detail').slideUp(function(){\n\t\t\t\t\t$(this).parents('li').removeClass('active');\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t//if the listing is not active\n\t\t\t\t\n\t\t\t\t//close all listing\n\t\t\t\tlisting.each(function(){\n\t\t\t\t\t$(this).siblings('.detail').slideUp(function(){\n\t\t\t\t\t\t$(this).parents('li').removeClass('active');\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t//open this listing\n\t\t\t\t$(this).siblings('.detail').slideDown(function(){\n\t\t\t\t\t$(this).parents('li').addClass('active');\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "f900d435abc3b0dcc20e476089a4ccd3", "score": "0.59631467", "text": "function doneElement() {\n $(\"ul\").on(\"click\", \"li\", function() {\n $(this).toggleClass(\"done\");\n });\n}", "title": "" }, { "docid": "3217d9e5ecc5fbeb96e3121f80ac574b", "score": "0.59565014", "text": "function bind_follow_show_buttons() {\n $('.autocomplete_item').bind('click', function(e) {\n // Ensure that only the list item and divs are matched\n var t = e.currentTarget;\n if (t.nodeName == 'LI') {\n var id = t.id.match(/^follow(\\d+)/)[1];\n follow(id);\n } else if (t.nodeName == 'DIV') {\n alert('howdy');\n var id = t.id.match(/^follow(\\d+)/)[1];\n follow(id);\n }\n });\n}", "title": "" }, { "docid": "e945ffdd2598b893c82e442bdefbd7f2", "score": "0.5955375", "text": "function ulListener(ev) {\r\n var list = document.querySelector('ul');\r\n if (ev.target.tagName === 'LI') {\r\n ev.target.classList.toggle('checked');\r\n\t\t\r\n\t\tvar checkedvalue = 0;\r\n if(ev.target.classList.contains(\"checked\"))\r\n checkedvalue = 1;\r\n\t\tupdatePHP(ev.target.id, checkedvalue);\r\n }\r\n sortList(document.getElementsByClassName('list')[0]);\r\n}", "title": "" }, { "docid": "fa2ca058a5a22324e79c5d98be8482fe", "score": "0.5936485", "text": "function listListen() {\n let listItems = document.querySelectorAll('.li');\n listItems.forEach(function (l) {\n l.addEventListener('click', liClicked);\n l.addEventListener('dblclick', liDoubleClicked);\n });\n function liClicked(e) {\n randomColor(e);\n };\n\n // Create a function that if a list item is double clicked it removes the list item from the DOM.\n function liDoubleClicked(e) {\n e.target.remove();\n }\n }", "title": "" }, { "docid": "dc37f82dd65b978a5532b5f5f25792a1", "score": "0.5929167", "text": "function add_onclick(index, location) {\n $(location).on(\"click\", function() {\n // undone: find other, better ways of doing this\n $(\"#blop-info-pane\").html(\"<h2>Current selection: \" + index + \"</h2>\");\n });\n}", "title": "" }, { "docid": "bb34499a863fc391397d92a244e62efd", "score": "0.59243894", "text": "function clickOnItemHandler(ev) {\n var item = ev.target;\n if ( item.nodeName === 'LI' && !item.classList.contains('modal') ) {\n item.setAttribute('data-selected', '');\n pubSub.publish('selectItem', item.id);\n }\n }", "title": "" }, { "docid": "eb995681182e7917401a6c1a154ad8c2", "score": "0.5911836", "text": "function openThreeDotsMenu(item) {\n $(item).click()\n}", "title": "" }, { "docid": "c2320bf6ccb9f692568c52e5efcfe56a", "score": "0.59090096", "text": "function addListenerToLi(item){\n\titem.addEventListener(\"click\", toggleDone);\n\titem.addEventListener(\"dblclick\",removeItem);\n}", "title": "" }, { "docid": "5570ad5141ec26dcbbd0f070ccea9114", "score": "0.5898641", "text": "function navListClick(e) {\n var temp = e.text.toLowerCase();\n $(\"#navpane\").ejmNavigationDrawer(\"close\");\n $('.navsubpage').hide();\n $('#' + temp).show();\n ej.getCurrentPage().find(\"#default_rightscroller .e-m-scroll\").ejmScrollPanel(\"refresh\");\n}", "title": "" }, { "docid": "7904fc1f9bbe59cdc8f02f31182d38bf", "score": "0.58933645", "text": "function clickHandler(item) {\n var view = list[item];\n setView(view);\n var viewKey1 = Object.keys(view);\n setViewKey(viewKey1);\n }", "title": "" }, { "docid": "41310e8de88787e41e3f08d38c1fd731", "score": "0.58904994", "text": "function overviewImgClick(e){\n\tvar i,j,tname,turl,item,c,li,\n\t\ttarget = e.target || e.srcElement,\n\t\ttype = default_types_1,\n\t\tpremium;\n\n\tturl = target.u;\n\n\t//디폴트 타입에서 필요 li 검색\n\tfor (i = 0; i < type.length; i++) {\n\t\ttname = type[i].n;\n\t\tif (tname === turl) {\n\t\t\titem = type[i];\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (!item)\n\t\treturn;\n\n\t// click 된 overview Image Name을 가지고 온다.\n\titem.imgName = target.childNodes[0].innerHTML;\n\n\titem.over = true;\n\tactiveMainLi(item, false);\n}", "title": "" }, { "docid": "7a242febc7d701b7da2d7c16fc74a93a", "score": "0.5888414", "text": "function activateItem(e) {\n if (e.target.nodeName == \"LI\") {\n ourHeadline.innerHTML = e.target.innerHTML;\n for (i = 0; i < e.target.parentNode.children.length; i++) {\n e.target.parentNode.children[i].classList.remove(\"active\");\n }\n e.target.classList.add(\"active\");\n }\n}", "title": "" }, { "docid": "15e0926209fc1366d4fe5742c299cbd8", "score": "0.5887964", "text": "function ActiveSelector() {\r\n \t$('li a').click(function(e) {\r\n \t\te.preventDefault();\r\n \t\tvar $this = $(this);\r\n \t\t$this.closest('ul').find('.active').removeClass('active');\r\n \t\t$this.parent().addClass('active');\r\n\r\n \t});\r\n }", "title": "" }, { "docid": "07d2133d4fbdfaf8ed102cc604ece0cc", "score": "0.5866453", "text": "function usedletters(e) {\n let li = e.target;\n if (li.tagName === \"LI\" && !li.classList.contains(\"clicked\")) {\n li.classList.add(\"clicked\");\n let letter = li.innerText;\n check(letter, mot_a_trouver);\n }\n}", "title": "" }, { "docid": "74e414a63a3736af9a93a6836b6dc007", "score": "0.58603686", "text": "function setAddItemListener() {\n $('.itemOptions').click('li', addItem);\n}", "title": "" }, { "docid": "408c31a0563588f2363e499584b0077a", "score": "0.58543277", "text": "function clickImage(div_list,list,movie_list) {\n\t\t// console.log(div_list.length);\n\t\t// console.log(movie_list.length);\n\t\tfor (var i = 0; i < div_list.length; i++) {\n\t\t\tvar div_clicked = div_list[i];\n\t\t\tvar movie = movie_list[i];\n\t\t\tdiv_clicked.style.cursor = \"pointer\";\n\t\t\t//add click event (if click the heart will be red) to every image element\n\t\t\tmovie.onclick = changeColor;\n\t\t\t// div_clicked.setAttribute(\"class\", \"beenClicked\");\n\t\t\t// var flag = \"true\";\n\t\t\t// addToLikedList(i,list,div_clicked,flag);\n\t\t\taddToLikedList(i,list,div_clicked);\t\n\t\t}\n\t}", "title": "" }, { "docid": "5eb8453cbdf75c2438e84c18b40babb4", "score": "0.58460826", "text": "function clickedChildMusic(element) {\n let getLiIndex = element.getAttribute(\"li-index\");\n indexMusic = getLiIndex;\n loadMusic(indexMusic);\n playMusic();\n playingNow();\n}", "title": "" }, { "docid": "64cf8396f20cb88edeac3dacd48f6a93", "score": "0.5840573", "text": "function bindEventToNavigation() {\n $.each($(\"#primary-menu li a\"), function (index, element) {\n $(element).click(function (event) {\n breadcrumbStateSaver($(this).attr('href'), $(this).text());\n showBreadCrumb();\n });\n });\n}", "title": "" }, { "docid": "d73b763918a2c020a6941d04d1144402", "score": "0.58400965", "text": "function addClick(){\n $(\".menu-inner\").on('click','.left-item',function(e){\n //添加active class\n $(e.currentTarget).addClass('active');\n $(e.currentTarget).siblings().removeClass('active');\n\n //获取left-item上的数据\n var data=$(e.currentTarget).data('itemData');\n //将数据传给右侧列表\n window.Right.refresh(data);\n })\n }", "title": "" }, { "docid": "f17dfeea2ba0d76a9cbd8a39266c68b9", "score": "0.58307016", "text": "function linkClicked(obj)\n{\n //grab current page number\n currentPage = $(obj).attr(\"id\").substring(4,5);\n\n //set remove old active and add new\n $('.active').removeClass('active');\n $(\"#nav > .list-link-wrapper:nth-child(\"+currentPage+\")\").addClass('active');\n\n //change page on portal\n $(\"#main-content-portal\").attr(\"src\",$(obj).attr('value'));\n\n //change url\n changeURL(\"?page=\"+currentPage);\n\n\n}", "title": "" }, { "docid": "2ee580b2dbe2cbdfb609baea34552ac4", "score": "0.58293575", "text": "function _eventClick() {\n ui.tabsNav.find(\"span\").on(ui.eventTypes.mousedown, function(e) {\n e.preventDefault();\n \n var item = this.getAttribute(\"data-tab\");\n\n ui.tabsNav.find(\"li\").removeClass(ui.tabsActiveNavItemCls)\n $(this).parent().addClass(ui.tabsActiveNavItemCls);\n\n ui.tabsContent.children(\".\" + ui.tabsContentItemCls).hide();\n ui.tabsContent.children(item).fadeIn(300);\n });\n\n return false;\n }", "title": "" }, { "docid": "b6c739b4728f232c73d18a843a18878f", "score": "0.58214766", "text": "function handleToggleClick() {\n\t$('.container').on('click', 'li', function() {\n\t\tconst toggle = store.findById(this.id);\n\t\tif (toggle !== undefined) {\n\t\t\ttoggle.expanded = !toggle.expanded;\n\t\t\tlist.render();\n\t\t};\n\t});\n}", "title": "" }, { "docid": "b69dba3273deb66459e8b250d8785798", "score": "0.5798298", "text": "function menuClickOpenTab() {\r\n\t$('#leftMenu a').bind('click', function() {\r\n\t\tconsole.log(this);\r\n\t\tvar currAUrl = $(this).attr('href');\r\n\t\tconsole.log(currAUrl);\r\n\t\talert(currAUrl);\r\n\t\treturn false;\r\n\t});\r\n\t//add content adjust\r\n\r\n}", "title": "" }, { "docid": "9ef32d2b4d571f3cf8ccea698b9955d3", "score": "0.5792963", "text": "function setActive() {\n\t\t$('#filters').on('click','li',function(){\n\t\t\t$('#filters li.active').removeClass('active');\n\t\t\t$(this).addClass('active');\n\t\t});\n\t}", "title": "" }, { "docid": "f0e3aa1c412b2148b5eb2baf1340985e", "score": "0.57915425", "text": "function list_musics(list) {\n\n $(\".music-items\").empty();\n\n //var html = '<div class=\"music-nav\"><div id=\"music-name\">歌曲</div><div id=\"music-author\">歌手</div></div>'\n\n //var element = $(html);\n\n //$(\"#music-content\").append(element); \n\n $.each(list, function(index, item) {\n\n\n var html = '<div class=\"music-item\"><div id=\"music-name\">' + item.name + '</div><div id=\"music-author\">' + item.author + '</div></div>'\n\n var element = $(html);\n\n element.click(function() {\n\n //console.log(\"click\");\n $(\".current-music-item\").removeClass(\"current-music-item\");\n\n $(this).addClass(\"current-music-item\");\n\n $(\"#playing-song-info\").html(item.name);\n\n audioPlayer.play(item.file_name);\n\n lyric.init(item.name);\n\n });\n\n $(\".music-items\").append(element);\n\n });\n }", "title": "" }, { "docid": "65aea5345c4e804c8aa5b3c076dd0911", "score": "0.57910603", "text": "function attachClick() {\n $('.artists-dropdown').off('click', 'li').on('click', 'li', function() {\n showOnly($(this).text());\n })\n}", "title": "" }, { "docid": "76c2a39afcac58174700c3bcb4b97e5a", "score": "0.5769942", "text": "function ListItemController(item, list){\n var strOfClasses = \"item\" + item.item;\n $(\"#List\" + list.name).append(\"<li class=\" + strOfClasses + \">\" + item.item +\"</li>\");\n $(\".item\" + item.item).click(function(event){\n event.preventDefault();\n if ($(\"#List\" + list.name + \" li.item\" + item.item).hasClass(\"lineThrough\")){\n $(\"#List\" + list.name + \" li.item\" + item.item).removeClass(\"lineThrough\");\n } else {\n $(\"#List\" + list.name + \" li.item\" + item.item).addClass(\"lineThrough\");\n }\n })\n}", "title": "" }, { "docid": "b758f5f6459de16b00d14eea328b242d", "score": "0.5764885", "text": "function dropDownClick( clicked ){\n if($(clicked).find('ul').css('display') == 'none'){\n $(clicked).find('ul').css({'display': 'inline-block'});\n }else{\n $(clicked).find('ul').css({'display': 'none'});\n }\n}", "title": "" }, { "docid": "fb703339c2f58706b78a2471a4dd2c6b", "score": "0.57554626", "text": "function itemClicked(event)\n{\n var list = document.getElementById(\"list\").object;\n var browser = document.getElementById('browser').object;\n var selectedObjects = list.selectedObjects();\n \n if (selectedObjects && (1 == selectedObjects.length)){\n // The Browser's goForward method is used to make the browser push down to a new level.\n // Going back to previous levels is handled automatically.\n browser.goForward(document.getElementById('detailLevel'), selectedObjects[0].valueForKey(\"name\"));\n } \n}", "title": "" }, { "docid": "c58be9183092f909334eb3d5081f88c3", "score": "0.57508576", "text": "function show_tab_onclick() { \n $('#collections-select li a').on('click', function () { \n var select_list = $('#collections-select').parent();\n var tab_href = $(this).attr('href');\n var tab_title = $(this).text();\n var tab = $.parseHTML('<li class=\"active\"><a href=\"'+tab_href+'\" data-toggle=\"tab\">'+tab_title+' <i class=\"icon-remove\"></i></a></li>');\n \n $(tab).insertBefore(select_list);\n $(\"#collections-list li.active\").removeClass(\"active\");\n $(tab).addClass('active');\n close_tab_onclick(tab);\n $(this).parent().toggle();\n $(\"table.citation\").sortable({items: \"tr\"});\n\n });\n}", "title": "" }, { "docid": "bf2418a395f2604f9a8230a2b200bcf7", "score": "0.57488817", "text": "function toggleTouchItem($element){\r\n $element\r\n .siblings('li')\r\n .removeClass('open')\r\n .end()\r\n .toggleClass('open');\r\n }", "title": "" }, { "docid": "b72c69731e9ac34cfbfae1ce040e9b47", "score": "0.574859", "text": "function customDelete() {\n\t$(\".list-details li .delete\").live(\"click\", function() {\n\t\t$(this).closest(\"li\").remove();\n\t});\n}", "title": "" }, { "docid": "57886ecfcbfa683eaa1af6c3a23cd15f", "score": "0.5745675", "text": "_bindEvent(listItem, relatedModule) {\n listItem.on('click', () => {\n this._showRelatedModuleAndHideOtherModules(relatedModule);\n listItem.addClass('current');\n listItem.siblings('li').removeClass('current');\n });\n }", "title": "" }, { "docid": "05bd4fbd5f5ba9f875cbccc9ff5894c5", "score": "0.5744756", "text": "function listClicked(elm, value){\n \nvar listitemid = elm.getAttribute('value'); \nif(listitemid === null){\n listitemid = value;\n}\n $('#searchtxt').val($(\"#listitem\").text());\n console.log(listitemid);\n $('#list').hide();\nconfirmItemstatus(); //CHECK ITEM STATUS BEFORE ADDING TO LIST\n}", "title": "" }, { "docid": "57ab87cdd5dd5f5e2bee6a852fd19d45", "score": "0.5736438", "text": "function activeMenu(element,className) {\n\n\t\t$(element).each(function(){\n\n\t\t\tvar currIndex = $(this).index();\n\n\t\t\tvar currClass = '.' + $(this).attr('class');\n\n\t\t\t$(currClass).click(function(){\n\n\t\t\t\t$(currClass).parent('ul').children().removeClass(className);\n\n\t\t\t\t$(currClass).addClass(className);\n\n\t\t\t\t//console.log(currClass);\n\n\t\t\t});\n\n\t\t});\n\n\t}", "title": "" }, { "docid": "0ec5fd1447422607d2d133735b1f8ecf", "score": "0.57302153", "text": "function linkClick () {\n\tlet $link = $pagination.find('a'); \n\t$link.on('click', function () {\n\t\tlet num = parseInt($(this).html());\n\t\t//Give link active class\n\t\t$('a.active').removeClass(\"active\");\n\t\t$(this).addClass(\"active\"); \n\t\tdisplayStudents(num); \n\t});\n}", "title": "" }, { "docid": "29a08a637ad00353b558c871976acbaa", "score": "0.57289755", "text": "function controlClickHandler () {\n // get the ancestor li element, mark as active, mark siblings as inactive\n this.parentNode.parentNode.childNodes.forEach( (e) => {\n e.classList.remove('active');\n } );\n this.parentNode.classList.add('active');\n _chart.animate({ name: this.name, value: this.value });\n }", "title": "" }, { "docid": "c6bf7f739fe7e78803c7c0eedecfa8cf", "score": "0.572731", "text": "function handleItemCheckClicked() {\n $('.js-shopping-list').on('click', '.js-item-toggle', event => {\n const itemIndex = $(event.currentTarget).closest('li').attr('data-item-index');\n toggleCheck(itemIndex);\n renderShoppingList();\n });\n}", "title": "" }, { "docid": "f601803b1d02ac551e12d986e58a5268", "score": "0.5726897", "text": "function onClick(){\n \t$(this).closest('.list-item').remove();\n }", "title": "" }, { "docid": "aaac9b1bf9f88ca1af1786694a70c414", "score": "0.57206", "text": "menuClick() {\n\t\tthis.mvc.controller.menuClicked();\n }", "title": "" }, { "docid": "80dfbc2699995c930d0237761dc387c7", "score": "0.5719852", "text": "async onItemClick(link, evt) {\n if (link.localName == \"li\") {\n link = link.querySelector(\"a\") // if someone passed the item and not the link\n }\n \n if (evt.type == \"click\") {\n this.updateFilter(\"\")\n }\n \n if (evt.shiftKey && evt.code != \"Enter\") {\n link.parentElement.classList.toggle(\"selected\")\n this.lastSelection = this.getSelection() \n } else {\n this.lastSelection = []\n // collapse previousely expanded tree\n var item = link.parentElement\n \n if (this.isSelected(item) || this.hasDetails(item) && item== \"Enter\") { \n this.currentDir = null\n item.classList.remove(\"selected\")\n var sublist = item.querySelector(\"ul\")\n if (sublist) sublist.remove()\n } else {\n if (evt.shiftKey) {\n var container = lively.query(this, \"lively-container\")\n if (container) await container.editFile();\n } \n // non-http(s) paths are not normalized by default\n const href = System.normalizeSync(link.href);\n await this.followPath(link.href);\n }\n \n \n }\n this.updateFilter(\"\")\n this.focusFiles()\n this.setCursorItem(null)\n }", "title": "" }, { "docid": "3dcfffb56d4a56007ea094243fe8d16e", "score": "0.57192063", "text": "clickEventListener(item) {\n if (item === 1) {\n this._FacebookNavigate();\n }\n if (item === 2) {\n this._WebNavigate();\n }\n }", "title": "" }, { "docid": "138a9cdc70a803466531854f95e4f638", "score": "0.5718889", "text": "function changeSelected(e){\n for(var i = 0; i < listItems.length; i++){\n listItems[i].className = \"\";\n }\n e.target.className = \"selected\";\n changePicture(e.target);\n}", "title": "" }, { "docid": "04655e91749d2409d766eb63529f2920", "score": "0.57165736", "text": "function toggleListOption(element) {\n\n\t\tvar listOptionDetailsHolder = $('.listOptionDetailsHolder');\n\n\t\t$('.listOptionsHolder').html(listOptionDetailsHolder);\n\n\t\t$(element).each(function(){\n\n\t\t\t$(this).children().find('.fileLabel').click(function(){\n\n\t\t\t\t$(this).parent().parent().parent().parent().toggleClass('selectedList');\n\n\t\t\t\t//console.log($(this).parent().parent().parent().parent());\n\n\t\t\t});\n\n\t\t\t\n\t\t});\n\n\t}", "title": "" }, { "docid": "1292c99d6d67542f782d211a9dfed90b", "score": "0.5705145", "text": "function navClick(event) {\n // Get element of what to go to. Id is determined by the list name\n const idName = dataToID(event.target.textContent);\n const elem = document.querySelector('#' + idName);\n\n // Scroll to the selected element\n // Scrolling will handle the active\n elem.scrollIntoView({\n behavior: 'smooth'\n });\n}", "title": "" }, { "docid": "0c8f7803a1b4d9d52ae9879149895ade", "score": "0.5704506", "text": "function makeInteractive() {\n var totalList = document.getElementById('mushroom_selector');\n totalList.addEventListener(\"mouseover\", function(e) {\n if(e.target && e.target.nodeName == \"LI\") {\n mushroomOver();\n }\n } );\n totalList.addEventListener(\"mouseout\", function(e) {\n if (e.target && e.target.nodeName == \"LI\") {\n mushroomOut();\n }\n } );\n totalList.addEventListener(\"click\", function(e) {\n // e.target is the li which was clicked\n if(e.target && e.target.nodeName == \"LI\") {\n if (e.target.id != \"alltypes\") {\n mushroomClick();\n } else {\n resetPage();\n }\n }\n } );\n}", "title": "" }, { "docid": "1aa92561ed86e47c8a532fbaaa633676", "score": "0.57022417", "text": "function putSelected(){\n\tvar list = $(\".lista_desplegable_b\").find(\".level2\"); /* Level2 list. */\n\tvar links = $(list).find(\"a\"); /* Links of the level2 list. */\n\t/* Click event on link. */\n\t$(links).click(function(){\n\t\t/* Remove \"active\" class from all links. */\n\t\tif(!$(this).hasClass(\"active\")){\t\t\t\n\t\t\tfor(var i=0;i<links.length;i++){\n\t\t\t\tif($(links[i]).hasClass(\"active\")){\n\t\t\t\t\t$(links[i]).removeClass(\"active\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t/* Add \"active\" class to this link. */\n\t\t\t$(this).addClass(\"active\");\n\t\t}\n\t});\t\n}", "title": "" }, { "docid": "caace6eeeffbb36033e9aef29caac23a", "score": "0.5702233", "text": "function bindListItemEvents() {\n list.find('li').click( function(e) {\n var target = $(e.target);\n var id = target.data('id');\n selectCallback( target, input, list, state );\n if(multi) {\n if( selected.indexOf(id) === -1 ) {\n selected.push( id );\n }\n }\n else {\n selected = [id];\n }\n dbgInput.val( selected.join( ',' ) );\n $(window).trigger('ajaxfilter:' + dbgId, [selected]);\n } );\n }", "title": "" }, { "docid": "c0688017fad6e137533cbdc463171b75", "score": "0.5699624", "text": "function changeActive(e) {\n\t$('.main-menu li').removeClass('active');\n\t$(e).addClass('active');\n}", "title": "" }, { "docid": "35eca585190c1b9f4db072b4cd3e0202", "score": "0.56982785", "text": "function checkIfComplete(){\n $(\"ul\").on(\"click\", \"li\", function(){\n $(this).toggleClass(\"complete\");\n });\n}", "title": "" }, { "docid": "e5feb6612bcf7055e527fe8d7ee25eb6", "score": "0.56982297", "text": "function handleMenuItemClicked() {\n console.log('handleMenuItemClicked');\n // bring to appropriate view\n // get the item clicked in the menu\n // send event to restaurantLists with the item to render the appropriate component\n const itemClicked = $(this).attr('data-item');\n if(itemClicked === \"history\" || itemClicked === \"liked\" || itemClicked === \"disliked\") {\n event.preventDefault();\n pubSub.emit('renderRestaurantList', {itemClicked: itemClicked});\n toggleMenu();\n }\n if(itemClicked === \"search\") {\n pubSub.emit('renderRestaurantSearch');\n toggleMenu();\n }\n }", "title": "" }, { "docid": "cb069abb3a7f6889e1db3711a012e97d", "score": "0.5697336", "text": "function showListForSelection(list_type) {\n if(list_type === 'student'){\n var courseList = $('#list-of-courses-to-add');\n allCourses.forEach(function (course) {\n var item = $('<li/>')\n .attr('id', 'course-item-' + course.c_ID)\n .addClass('list-group-item')\n .text(course.c_name)\n .appendTo(courseList)\n .on('click', function () {\n $(this).toggleClass('active');\n });\n });\n }\n else if(list_type === 'course'){\n var studentList = $('#list-of-students-to-add');\n allStudents.forEach(function (student) {\n var item = $('<li/>')\n .attr('id', 'student-item-' + student.s_ID)\n .addClass('list-group-item')\n .text(student.s_name)\n .appendTo(studentList)\n .on('click', function () {\n $(this).toggleClass('active');\n });\n });\n }\n }", "title": "" }, { "docid": "cf9ba2743308ef7642fa7b7744a3f904", "score": "0.5695135", "text": "function set_active_to_index( index ){\n if ( jQuery( '.wp-tw-nav li.wp-tw-title', tabs ).eq( index ).length > 0 ) {\n jQuery( '.wp-tw-nav li.wp-tw-title', tabs ).eq( index ).trigger( 'click' );\n } else {\n jQuery( '.wp-tw-nav li.wp-tw-title', tabs ).eq( 0 ).trigger( 'click' );\n }\n }", "title": "" }, { "docid": "23a3537abb6ba0d4a072b41b791fb234", "score": "0.56892586", "text": "function createSideMenuEventListener ($element) {\n\n\t\tdocument.getElementById(\"main-content__side-menu__item--\"+$element['tagName']).addEventListener(\"click\", function() {getPostList($element['tagName'])});\n\n}", "title": "" }, { "docid": "25bee364167fafa0645f7201a4e51a43", "score": "0.56868213", "text": "function listing_selected() {\n var is_separate = is_detail_separate();\n var url = $(this).attr('detail-url');\n\n selection_url = url;\n separate_on_selection = is_separate;\n\n $('.listing-list .listing.selection').removeClass('selection');\n $(this).addClass('selection');\n\n display_listing_detail(is_separate, $(detail_container_name(is_separate)), url);\n}", "title": "" }, { "docid": "af252856293799e90d79f969b77cf3cf", "score": "0.5685734", "text": "function activateCurrent(e) {\n const selected = document.querySelector(\".selected a, a.selected\");\n if (selected) {\n e.preventDefault();\n selected.click();\n }\n}", "title": "" } ]
16d6f1f625330dd4b9fff5a8b9a97150
Get the latest Data published by CDC regarding the current ILI activity at state level.
[ { "docid": "d62f95b4f1ab2b19f7c35de3a6370259", "score": "0.0", "text": "function populateStateData() {\n var data = {};\n\n // craft the URL\n var url = window.location.origin + '/flutracker/guest/api/getLatestActualData/CDC/stateActivity/';\n\n\n // Do a synchronous get request\n $.ajax(url, {\n success: function (response) {\n json_response = response;\n //console.log(json_response);\n },\n async: false,\n dataType: \"json\"\n });\n for (var i in json_response.state) {\n var state = json_response.state[i].abbrev;\n data[state] = {};\n data[state].fillKey = json_response.state[i].label;\n data[state].hoverData = json_response.state[i].label;\n }\n return data;\n}", "title": "" } ]
[ { "docid": "55b8bc741e523b1cb0170b6a9a162ddb", "score": "0.5644796", "text": "getCurrentActivity() {\n debug('retrieve current activity');\n const payload = {\n hubId: this.remoteId,\n timeout: 30,\n hbus: {\n cmd: 'vnd.logitech.harmony/vnd.logitech.harmony.engine?getCurrentActivity',\n id: 0,\n params: {\n verb: 'get',\n format: 'json'\n }\n }\n };\n return this.wsClient.sendRequest(payload)\n .then((response) => {\n return response.data.result;\n });\n }", "title": "" }, { "docid": "8a22f5e76a2e968592a6c9c541790fb3", "score": "0.5531377", "text": "getRecentActivityData() {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n let routeValues = {};\n try {\n let verData = yield this.vsoClient.getVersioningData(\"6.0-preview.2\", \"wit\", \"1bc988f4-c15f-4072-ad35-497c87e3a909\", routeValues);\n let url = verData.requestUrl;\n let options = this.createRequestOptions('application/json', verData.apiVersion);\n let res;\n res = yield this.rest.get(url, options);\n let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.AccountRecentActivityWorkItemModel2, true);\n resolve(ret);\n }\n catch (err) {\n reject(err);\n }\n }));\n });\n }", "title": "" }, { "docid": "9c9896098542924f17e367258a155da3", "score": "0.5392714", "text": "getContent() {\n \n let state = stores.activityHome.data.readState;\n switch (state) {\n case State.DEFAULT:\n return this.getDefaultContent();\n case State.STARTED:\n return this.getStartedContent();\n case State.FAILURE:\n return this.getFailureContent();\n case State.SUCCESS:\n return this.getSuccessContent();\n }\n return this.getStartedContent();\n }", "title": "" }, { "docid": "6edc19e8233c880ebe6ae95d2b09757a", "score": "0.53157836", "text": "getData() {\n return eventCenter.getData(formatEventName(this.appName, true));\n }", "title": "" }, { "docid": "bc61b9c79560150d6049f179234a03e5", "score": "0.52651954", "text": "function getDataState() {\n return {\n allDatas: DataStore.getAll()\n };\n}", "title": "" }, { "docid": "c6099a2847210b58e50c158fc3edcb97", "score": "0.52455676", "text": "function getData() {\n document.getElementById('widgetBody').innerHTML = 'Requesting activities...';\n var req = opensocial.newDataRequest();\n\n // TODO: figure out if there is a way to get the viewer's and friend's activities\n // together. FOR NOW: get these separately as was done when using 0.7 API\n\n // viewer's activities\n var spec = new opensocial.IdSpec();\n spec.setField(opensocial.IdSpec.Field.USER_ID, opensocial.IdSpec.PersonId.VIEWER);\n req.add(req.newFetchActivitiesRequest(spec), 'viewerActivities');\n\n // friends' data request\n var spec = new opensocial.IdSpec();\n spec.setField(opensocial.IdSpec.Field.USER_ID, opensocial.IdSpec.PersonId.VIEWER);\n spec.setField(opensocial.IdSpec.Field.GROUP_ID, 'FRIENDS');\n spec.setField(opensocial.IdSpec.Field.NETWORK_DISTANCE, 1);\n req.add(req.newFetchActivitiesRequest(spec), 'friendsActivities');\n\n req.send(onLoadActivities);\n}", "title": "" }, { "docid": "6a938a377cd0e9b0254136902bf83f4a", "score": "0.52392286", "text": "RetrieveData() {\n return stateVars;\n }", "title": "" }, { "docid": "70d6d1f557994c18ff93a6fe6e85ce0a", "score": "0.52297807", "text": "function getCurrentActivity() {\n if (Time.secondsUntil(state.json.compo.start_date) > 0) {\n return activity_enum.waitUntilStart;\n } else if (Time.secondsUntil(state.json.compo.submit_deadline) > 0) {\n return activity_enum.waitUntilDeadline;\n }\n if (state.json.compo.have_listening_party) {\n if (Time.secondsUntil(state.json.compo.listening_party_start_date) > 0) {\n return activity_enum.waitForLPStart;\n } else if (Time.secondsUntil(state.json.compo.listening_party_end_date) > 0) {\n return activity_enum.ongoingLP;\n }\n }\n if (Time.secondsUntil(state.json.compo.vote_deadline) > 0) {\n return activity_enum.voting;\n } else {\n return activity_enum.closed;\n }\n }", "title": "" }, { "docid": "93f810dbe218b634c13eece9be6f0a89", "score": "0.52250224", "text": "get state() {\n return this._state.getValueAtTime(this.context.transport.ticks);\n }", "title": "" }, { "docid": "df519069d98b69c6b96f705244351e09", "score": "0.5196851", "text": "get state() {\n return this._state.getValueAtTime(this.now());\n }", "title": "" }, { "docid": "7c5261c790246d23014586943f672608", "score": "0.5193831", "text": "get state() {\n return this._state.getValueAtTime(this.context.transport.ticks);\n }", "title": "" }, { "docid": "2526958edd31ace1c943d75d8a8af931", "score": "0.5182287", "text": "ACTIVITIES (state, data) {\n state.activities = data\n }", "title": "" }, { "docid": "8e8de48b77fa1b1e2add3c7232628a61", "score": "0.5174529", "text": "function allActivities(state=initAllActivities,action){\n switch(action.type){\n case GET_ALL_ACTIVITIES:\n return action.data\n default:\n return state\n }\n}", "title": "" }, { "docid": "af0f31f20dc27daf56469acc0bdcab63", "score": "0.51520437", "text": "getTimelineData() {\n return this.state.timelineData;\n }", "title": "" }, { "docid": "8fdf1444e63cc6a2e5c3d76b796e3c68", "score": "0.5150708", "text": "get state() {\n return this.getStateAtTime(this.now());\n }", "title": "" }, { "docid": "8fdf1444e63cc6a2e5c3d76b796e3c68", "score": "0.5150708", "text": "get state() {\n return this.getStateAtTime(this.now());\n }", "title": "" }, { "docid": "c01a1d98789f05fd96ca15fe46de854e", "score": "0.5145017", "text": "get state() {\n return this._state.getValueAtTime(this.now());\n }", "title": "" }, { "docid": "c01a1d98789f05fd96ca15fe46de854e", "score": "0.5145017", "text": "get state() {\n return this._state.getValueAtTime(this.now());\n }", "title": "" }, { "docid": "08bfac70d0d12828a9ef0f7c641db936", "score": "0.51411635", "text": "function getGroupFetchDataFullHistory(key){\r\n\treturn gAlarm['realtimeHistoryAlarms']['Results'][key];\r\n}", "title": "" }, { "docid": "077daed74d68940555f858693fe2c24e", "score": "0.5115358", "text": "getRecentConversatnios(state) {\n return state.all;\n }", "title": "" }, { "docid": "39c444f8ab4cf5be709dcc2161a4d2fc", "score": "0.5106377", "text": "ACTIVITY (state, data) {\n state.activity = data\n }", "title": "" }, { "docid": "ae5ff266842fdba031af367b250663d2", "score": "0.51040024", "text": "get activity () {\r\n\t\treturn this._activity;\r\n\t}", "title": "" }, { "docid": "6f1b33f93606d867ee7d070d2858e5c4", "score": "0.51029676", "text": "getChatHistory() {\n return this.crud.getData('/chats/list?page=0&limit=100000');\n }", "title": "" }, { "docid": "8ac77f1775e9c386f5ed3479776c157b", "score": "0.5085439", "text": "RetrieveData() {\n return {\n currentCount: stateVars.currentCount,\n masteriesCompleted: stateVars.masteriesCompleted\n };\n }", "title": "" }, { "docid": "7e826a067f3e1ccf74665357eda26e06", "score": "0.50801057", "text": "function getState() {\n setupConfig();\n\n var activityId = $(\"#document-activity-id\").val();\n var actorEmail = $(\"#document-actor-email\").val(); // TODO: Agent\n var stateId = $(\"#get-document-state-id\").val();\n // registration\n var since = $(\"#get-document-since-date input\").val();\n var sinceDate = (since == \"\") ? null : new Date(since);\n // callback\n\n ADL.XAPIWrapper.getState(activityId, {\"mbox\":\"mailto:\" + actorEmail}, stateId, null, sinceDate, function(r) {\n $.notify({ title: \"Status \" + r.status + \" \" + r.statusText }, notificationSettings);\n //$(\"#received-documents\").append(\"<p>Received State <b>\" + stateId + \"</b>: \" + r.response + \"</p>\");\n if (validateJSON(r.response) != true) {\n var stateValue = r.response;\n } else {\n var stateValue = JSON.stringify($.parseJSON(r.response), undefined, 4);\n }\n $(\"#received-documents\").append(styleDocumentsView(\"State: \" + stateId, stateValue));\n if (validateJSON(r.response) == true) {\n PR.prettyPrint();\n }\n console.log(r);\n });\n}", "title": "" }, { "docid": "f05d5af19a650acec4df6344ae93240f", "score": "0.5079051", "text": "getHistory() {\n\t\treturn this.call('get_clean_summary')\n\t\t\t.then(result => {\n\t\t\t\treturn {\n\t\t\t\t\tcount: result[2],\n\t\t\t\t\tdays: result[3].map(ts => new Date(ts * 1000))\n\t\t\t\t};\n\t\t\t});\n\t}", "title": "" }, { "docid": "05e6ecb36b976cf0001c2541f9d661df", "score": "0.5078218", "text": "get state() {\n return this.getStateAtTime(this.now());\n }", "title": "" }, { "docid": "05e6ecb36b976cf0001c2541f9d661df", "score": "0.5078218", "text": "get state() {\n return this.getStateAtTime(this.now());\n }", "title": "" }, { "docid": "2bbf053c74a6c78ee42b7a5e284a0020", "score": "0.50744367", "text": "async getAll() {\n this.setEndpoint('activities')\n const response = await this.get()\n return response\n }", "title": "" }, { "docid": "8d05c61404d8133cfe4f7a7432db18d8", "score": "0.50702846", "text": "getData() {\n\t\t// clear current data\n\t\tthis.data = undefined;\n\t\t// set status\n\t\tthis.setStatus(STATUS.loading);\n\n\t\t// recalculate navigation timing (in case it was modified in the constructor)\n\t\tthis.calcNavTiming();\n\t}", "title": "" }, { "docid": "8d579c59b99a8537c14ad11050297165", "score": "0.5059425", "text": "getDataConnectionsStateData() {\n const stateData = [];\n\n for (let i = 0; i < this.joints.length; i++) {\n const joint = this.joints[i];\n const jointState = joint.getState();\n // Ignore connections connections that do not have data\n if (this.isDataConnection(joint)) {\n stateData.push(jointState);\n }\n }\n\n return stateData;\n }", "title": "" }, { "docid": "636290d79d80ec1d0215eeef97931bbb", "score": "0.5042745", "text": "get activity() {\n\t\treturn this.__activity;\n\t}", "title": "" }, { "docid": "84797a77ba5dac94602eb1ba530f52cc", "score": "0.50302535", "text": "get FatalityData()\r\n\t\t{\r\n\t\t\treturn this.activeData;\r\n\t\t}", "title": "" }, { "docid": "56dc7243173701af7248a839edf5c840", "score": "0.501504", "text": "get data() { this.assertNotStale('access', 'data'); return __classPrivateFieldGet(this, _data); }", "title": "" }, { "docid": "425f9cc7cc4aedd42e5dbdc6704165f9", "score": "0.5012267", "text": "async getData() {\r\n try {\r\n const gb = await this.getGlobalVariables();\r\n const varName = this.getGlobalVariableName(gb, \"design history\");\r\n var designHistory = gb.vars[varName];\r\n var dhContents = designHistory.value.contents;\r\n return this.getObject(dhContents);\r\n } catch (error) {\r\n alert(error.message);\r\n }\r\n }", "title": "" }, { "docid": "bf6c150376defffa77fe5be59fb9b424", "score": "0.50037616", "text": "function readLatest() {\n console.log(\"reading latest\");\n curStoreId = curStore.id;\n console.log(\"curStoreId: \" + curStoreId);\n}", "title": "" }, { "docid": "937507b239736662361d4a2350f68e86", "score": "0.49937227", "text": "function getActivity() {\n\t\treturn _store2.default.state.activity.activity;\n\t}", "title": "" }, { "docid": "1f17058a043005796b691fbe8f729fc7", "score": "0.49858975", "text": "function fetchPublishedData () {\n request(DATA_URL, function (error, response, body) {\n if (error) console.error(error)\n var data = JSON.parse(body)\n var rowsUpdatedAt = new Date(data['rowsUpdatedAt'] * 1000)\n var filename = rowsUpdatedAt.toISOString().replace(/-/g, '').slice(0, 8)\n request(`${DATA_URL}/rows.csv`).pipe(fs.createWriteStream(`./input/${filename}.csv`))\n })\n}", "title": "" }, { "docid": "9b7bd8d051fc49de77fdaf0757e9100f", "score": "0.49682236", "text": "getConnectionsStateData() {\n const stateData = [];\n\n for (let i = 0; i < this.joints.length; i++) {\n const joint = this.joints[i];\n const jointState = joint.getState();\n stateData.push(jointState);\n }\n\n return stateData;\n }", "title": "" }, { "docid": "1c9039c72aaeabc41fc3f221f39868c9", "score": "0.49595657", "text": "function getLatestData(dataKind) {\n let jsonData = JSON.parse(fs.readFileSync(\"logs/log.json\", \"utf8\"));\n return JSON.stringify(jsonData[jsonData.length - 1]);\n}", "title": "" }, { "docid": "26c2c3bbe68fb8782e9d43e16898838b", "score": "0.49587035", "text": "function IDataStateManager() { }", "title": "" }, { "docid": "c1f8d3a821a08a8e2e52a0bc547766a2", "score": "0.49576077", "text": "static get latestData() {\n return Wallet.getObjectForId();\n }", "title": "" }, { "docid": "b03dfff8d266a7db09ebed029afa3c38", "score": "0.49541858", "text": "async _fetchHistory() {\n\t\tconst { ApplicationStore } = this.props;\n\t\tconst _id = this._id;\n\t\tconst history = await ApplicationStore.restQueryData(\n\t\t\t'LogModel',\n\t\t\tCONFIG_MODEL.LOGModel(_id)\n\t\t);\n\n\t\tif (history === null || history.body.length === 0) {\n\t\t\treturn;\n\t\t} else {\n\t\t\treturn history;\n\t\t}\n\t}", "title": "" }, { "docid": "381d0c034f456175228d0f82a99efb1a", "score": "0.4946647", "text": "getUpdateData () {\n\t\treturn {\n\t\t\tisArchived: true\n\t\t};\n\t}", "title": "" }, { "docid": "881d58e0ca96928638fdb991e4895ff9", "score": "0.4944345", "text": "function getData() {\r\n return data;\r\n }", "title": "" }, { "docid": "f9553058e50c993ee7c9aba5b5f81834", "score": "0.49306363", "text": "function getCovidDate(data,clickedState){\n let covid = data[2]\n var date = []\n for (var i=0; i< covid.length; i++){\n if (covid[i]['State'].toLowerCase() == clickedState.toLowerCase()){\n date.push(covid[i]['Last_Update'])\n }\n }\n console.log(date)\n return date;\n}", "title": "" }, { "docid": "958cc7d852f12282eb4751b77abaeaba", "score": "0.49218524", "text": "getData() {\n\t \treturn this.data;\n\t }", "title": "" }, { "docid": "19d4e0fbc19b5035acc057718a1c78a9", "score": "0.49158368", "text": "function getInProgressData(){\n \n fetch('inprogress.json'\n ,{\n headers : { \n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n }\n }\n )\n .then(function(response){\n return response.json();\n })\n .then(function(myJson) {\n setInProgressData(myJson)\n });\n }", "title": "" }, { "docid": "289200ee11dd3a2fb2dad43e59d2b59d", "score": "0.4908886", "text": "function getData() {\n dataCounter++;\n console.log(Date() + '- Getting data');\n var req = http.get('http://www.tfl.gov.uk/tfl/syndication/feeds/cycle-hire/livecyclehireupdates.xml', function (res) {\n // save the data\n var xml = '';\n res.on('data', function (chunk) {\n xml += chunk;\n });\n\n res.on('end', function () {\n console.log(Date() + '- Converting data to JSON');\n parseString(xml, function (err, result) {\n if (lastCallTimeStamp != result.stations['$'].lastUpdate) {\n lastCallTimeStamp = result.stations['$'].lastUpdate;\n stationsRealTime = result.stations['station'];\n saveData(result.stations['station']);\n } else {\n console.log(Date() + '- No new updates since last run');\n }\n });\n\n console.log(Date() + '- Finished data capture run: ' + dataCounter);\n });\n\n });\n\n req.on('error', function (err) {\n // debug error\n });\n}", "title": "" }, { "docid": "80ee455f1a59fa77358b5b756b9aeb17", "score": "0.49055973", "text": "function _getAuditData() {\n\t\t\t\tvar data = {};\n\n\t\t\t\tif (!_isNewFlag) {\n\t\t\t\t\tdata._id = _audit._id;\n\t\t\t\t}\n\n\t\t\t\tdata.title = $.trim($('#' + _namespace + '_configuration_title').val());\n\t\t\t\tdata.notify_emails = _normalizeEmailList($('#' + _namespace + '_configuration_emails').val());\n\t\t\t\tdata.notes = $.trim($('#' + _namespace + '_configuration_notes').val());\n\t\t\t\tdata.current_sitemap_ids = [];\n\n\t\t\t\t// Ensure that we are sending an array of emails\n\t\t\t\tdata.notify_emails = data.notify_emails.split(',');\n\n\t\t\t\tvar $sitemapList = $('#' + _namespace + '_sitemaps').find(':checkbox:checked');\n\t\t\t\t$.each($sitemapList, function() {\n\t\t\t\t\tvar id = $(this).parents('.editableListItem').attr('id');\n\t\t\t\t\tif (id) {\n\t\t\t\t\t\tid = id.replace(/[^0-9]/g, '');\n\t\t\t\t\t\tdata.current_sitemap_ids.push(_containerMap[id]._id);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn data;\n\t\t\t}", "title": "" }, { "docid": "78126a7c1b775114ab8761b953aafe23", "score": "0.4902916", "text": "function GetActiveActivities() {\n var endpointUrl = appweburl + \"/_api/web/lists/getbytitle('Activity')/Items/?$select=*,ActivityCategory/Title,AssignedTo/Title&$expand=ActivityCategory,AssignedTo&$filter=Project/Id eq \" + getQueryStringParameter(\"ID\") + \" and ActivityStatus eq 'Active'\";\n return $.ajax({\n url: endpointUrl,\n type: \"GET\",\n headers: { \"accept\": \"application/json;odata=verbose\" }\n });\n}", "title": "" }, { "docid": "2d51fa24c579d0af5a5b688641f420c8", "score": "0.4893212", "text": "getAlldatoschest(state){\n return state.datoschest\n }", "title": "" }, { "docid": "a7e32eca2c5dabe4f9a623c6bfd627e3", "score": "0.48886546", "text": "i2cInfo() {\n return this.i2cinfo;\n }", "title": "" }, { "docid": "c6f7c975a113471fae44cb30e449813f", "score": "0.48850995", "text": "function getData() {\n return data;\n }", "title": "" }, { "docid": "ba892a6194673c89b04f8bf3f844df59", "score": "0.4870568", "text": "get currentStatus() {\r\n return this.i.currentStatus;\r\n }", "title": "" }, { "docid": "ba892a6194673c89b04f8bf3f844df59", "score": "0.4870568", "text": "get currentStatus() {\r\n return this.i.currentStatus;\r\n }", "title": "" }, { "docid": "325dcda516c84cba2c43f64628e86e9b", "score": "0.48681173", "text": "function getActivities(access){\n // console.log(callActivities + access)\n fetch(callActivities + access)\n .then(res => res.json())\n .then(data => setActivities(data), setIsLoading(prev => !prev))\n .catch(e => console.log(e))\n }", "title": "" }, { "docid": "ea6935344921b3d77d7ca9075cadec8b", "score": "0.48676097", "text": "function getAllActivities(callback, err_call){\n requestService.getDataOnce([prefix, activity_suffix], callback, err_call);\n }", "title": "" }, { "docid": "ac520d68ab3394df0e603ce339be0085", "score": "0.48584", "text": "function getData() {\r\n\t\tdata = {\r\n currentPlatform: currentPlatform\r\n/*\t\t\tscrollValue: scrollPosition,\r\n\t\t\tzoomValue: zoom,\r\n\t\t\tparams:{\r\n\t\t\t\t'win':'timeline',\r\n\t\t\t\t'scrollValue': scrollPosition,\r\n\t\t\t\t'zoomValue': zoom,\r\n\t\t\t}*/\r\n\t\t}\r\n\t\treturn data\r\n\t}", "title": "" }, { "docid": "3e622c823e4dcdea3a8868b21666fb1d", "score": "0.48497254", "text": "function getSavedActivities(uuid) {\n return $http({\n method: 'GET',\n url: '/api/itinerary',\n params: { uuid: uuid }\n })\n .then(function(res) {\n return res.data;\n })\n .catch(function(err) {\n return err;\n });\n }", "title": "" }, { "docid": "c48f181454c4c33e470e96016e8cc91b", "score": "0.48418435", "text": "function getActivitiesPage( itcb ) {\n function onRawActivitiesLoaded( err, result) {\n if ( err ) { return itcb( err ); }\n items = result.result ? result.result : result;\n itcb( null );\n }\n\n args.options.lean = true;\n\n Y.doccirrus.mongodb.runDb( {\n user: args.user,\n model: 'mirroractivity',\n action: 'get',\n query: args.query,\n options: args.options,\n callback: onRawActivitiesLoaded\n } );\n }", "title": "" }, { "docid": "c140cf3997c3578cb1fe7a7adc600d12", "score": "0.48367813", "text": "function getDailyData() {\n changeTemperatureReporting(temperatureReadings.daily.data);\n useDaily = true;\n }", "title": "" }, { "docid": "c02a98034d9e3566aa296ee27b97cb7a", "score": "0.48288482", "text": "async getChangelogs() {\n const response = await fetch(this.api + \"changelog\");\n const data = await response.json();\n return data;\n }", "title": "" }, { "docid": "08f74dac2fa504f3cfe92b09da93401e", "score": "0.48287046", "text": "get state() {\n\t\treturn this.record\n\t}", "title": "" }, { "docid": "4d7d4dd080dcf4513675451d25d1dee3", "score": "0.4821216", "text": "async getViewStateFromDB() {\n this.viewState = await idbAdapter.getViewState();\n }", "title": "" }, { "docid": "273acce733cb9dfdf91791caefe9983b", "score": "0.48135695", "text": "getActivities() {\n return __awaiter(this, void 0, void 0, function* () {\n debug('retrieve activities');\n const availableCommands = yield this.getAvailableCommands();\n return availableCommands.activity;\n });\n }", "title": "" }, { "docid": "0edb6ba9b7444eda9200203f21f2db7f", "score": "0.48130766", "text": "function GetActivities() {\n var endpointUrl = appweburl + \"/_api/web/lists/getbytitle('Activity')/Items/?$select=*,ActivityCategory/Title,AssignedTo/Title&$expand=ActivityCategory,AssignedTo&$filter=Project/Id eq \" + getQueryStringParameter(\"ID\");\n return $.ajax({\n url: endpointUrl,\n type: \"GET\",\n headers: { \"accept\": \"application/json;odata=verbose\" }\n });\n}", "title": "" }, { "docid": "62389bfd654a9abb822b2376756ef3c4", "score": "0.48090068", "text": "getCacheData() {\n\t\treturn this.cacheData\n\t}", "title": "" }, { "docid": "0e4f68eb4edcd756089584e48cb714a1", "score": "0.4800826", "text": "get state() {\n return this._clock.getStateAtTime(this.now());\n }", "title": "" }, { "docid": "aa0ce3c9d1dec846a917f21eb4e0ac7f", "score": "0.47896084", "text": "async getData() {\n const { node } = this.props\n /* sets state for number of tasks active/completed if call was successful */\n const { targets } = (await callApi(`nodes/stats/completed?node=${node.node_name}`)).json\n if (targets !== null && targets !== undefined) {\n this.setState({ active: targets.active })\n this.setState({ completed: targets.completed })\n }\n\n /* sets state for historic data if */\n const { json } = await callApi(`nodes/stats/status?node=${node.node_name}`)\n if (json !== null && json !== undefined && json.filteredStats !== null\n && this.state.historicData !== json.filteredStats) {\n this.setState({ historicData: json.filteredStats })\n }\n }", "title": "" }, { "docid": "9433b4b8fe2ce78df02025181891752a", "score": "0.47835597", "text": "function getDatadata() {\n\n // create new instance of data export\n var dataExport = new DataExport();\n\n // load export metadata\n dataExport.exportMetaDataStore.load({\n params: {result_instance_id1: GLOBAL.CurrentSubsetIDs[1], result_instance_id2: GLOBAL.CurrentSubsetIDs[2]},\n scope: dataExport,\n callback: dataExport.displayResult\n });\n}", "title": "" }, { "docid": "fac9cb69ad702b2c579ffd212e211a51", "score": "0.4782895", "text": "getCurrentState () {\n const {\n client,\n encoding\n } = this.constructor\n\n if (encoding === 'buffer') {\n // TODO: should really be using `.multi()` here, but `getBuffer()` is broken in it\n return Promise.all([\n client.getBuffer(this.VALUE),\n client.get(this.RUNNING),\n client.get(this.ERROR)\n ]).then(formatGetCurrentStateResults)\n }\n\n return client.mget([\n this.VALUE,\n this.RUNNING,\n this.ERROR\n ]).then(formatGetCurrentStateResults)\n }", "title": "" }, { "docid": "4b0efca970b3d9d2f5424f3818c6a2c2", "score": "0.478075", "text": "static get RECEIVED_DATA() { return _RECEIVED_DATA; }", "title": "" }, { "docid": "1495bd7f5d9f8c37c30889446c982296", "score": "0.4780098", "text": "constructor() {\n super();\n this.state = {comicData: [], currentComicData: []}\n }", "title": "" }, { "docid": "43f681ce252ca754e9456c96bf12b004", "score": "0.4773595", "text": "function getData() {\n return getApi.get().$promise;\n }", "title": "" }, { "docid": "3137d21ea54e54c9bdecb0901faf3a75", "score": "0.47708413", "text": "getClockInOutState(){\n\t\treturn {\n\t\t\tstatus: AttendanceClockInOutStore.getStatus(),\n\t\t\tresult: AttendanceClockInOutStore.getResult(),\n\t\t\tuser: AttendanceClockInOutStore.getUsername()\n\t\t};\n\t}", "title": "" }, { "docid": "6b0fd8f3867e7b884609e56d462345a7", "score": "0.47706342", "text": "static async fetchLatestStatuses() {\n logger().info('Fetching the latest status');\n\n const results = await db.knex.raw(statusLogQuery.LATEST_STATUS);\n\n return camelize(results);\n }", "title": "" }, { "docid": "aa5004967661a7943e9f6dec7c697f58", "score": "0.47704512", "text": "get Data()\r\n\t\t{\r\n\t\t\treturn this.fullData;\r\n\t\t}", "title": "" }, { "docid": "c363024db153fd9812f98e4174c13f89", "score": "0.4768286", "text": "function getData(state: TExampleAsync = null, action: TAction): TExampleAsync {\n\n\tconst { type, data } = action;\n\n\tswitch (type) {\n\t\tcase GET_ASYNC_ACTION: {\n\t\t\treturn data || state;\n\t\t}\n\t\tdefault: {\n\t\t\treturn state;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "44fdd98a7b457e64823b62031d3310fa", "score": "0.47594452", "text": "getData() {\n return this.wrapped.getData();\n }", "title": "" }, { "docid": "0359fe5af5fe2c32a068fbdb6267c083", "score": "0.4754367", "text": "async getUserActivity(){\n //Get Activity Data\n const activityDataRes = await this.getActivityData()\n\n //Filter just results by this user\n const userActivityRes = activityDataRes.filter(function(item){\n return item.userID == sessionStorage.getItem('UserID'); \n });\n\n //Finally, filter results by sleep measurements\n const userActivitySleep = userActivityRes.filter(function(item){\n return item.activityType == 'sleep' \n });\n\n return userActivitySleep\n }", "title": "" }, { "docid": "8b69c264475709d84b8aaff7c36c834b", "score": "0.4751916", "text": "function getData() {\n return esriRequest(aedurl).then(function(response) {\n //console.log(response);\n return response;\n }).otherwise(function(error) {\n console.log('request failed, grabbing local feed');\n return esriRequest(\"scripts/aedfeed.json\", {responseType: \"json\"});\n });\n }", "title": "" }, { "docid": "ee175135a0613d8754f20d3b47ae3d41", "score": "0.4748991", "text": "get state() {\n return this._clock.getStateAtTime(this.now());\n }", "title": "" }, { "docid": "14757c271fd11d1e04d13c514ffb1166", "score": "0.4747263", "text": "getStatus() {\n return this.read;\n }", "title": "" }, { "docid": "31a91c00283f3d3127bce5847c08fc5f", "score": "0.47419238", "text": "function getData(){\r\n if(displayMode == 1){//flow line\r\n if(curLayer == 0) return bus_data[curHour];\r\n if(curLayer == 1) return taxi_data[curHour];\r\n if(curLayer == 2) return subway_data[curHour];\r\n }else{//stack bar\r\n if(curLayer == 0) return bus_count[curHour];\r\n if(curLayer == 1) return taxi_count[curHour];\r\n if(curLayer == 2) return subway_count[curHour];\r\n }\r\n\r\n if(curLayer == -1) return [];\r\n}", "title": "" }, { "docid": "547daab8b799433eaf1051f474bd2cb3", "score": "0.4737789", "text": "function getLocalData() {\n return store.get(\"app_state\"); // fetch the data from local storage that is stored in the \"app_state\" key\n}", "title": "" }, { "docid": "4cf3810ef4c68928eb483cf6664025d5", "score": "0.47368923", "text": "function get_state() {\n $table.bootstrapTable('showLoading');\n console.log(\"Fetching project table state\");\n console.log(`API GET ${projects_endpoint}`);\n $.get({\n url: projects_endpoint\n }).then((data) => {\n // update global state\n projects = data.reverse();\n console.log(\"Response: \", projects);\n // inject html for table use load for event listener\n // temp timeout for load wheel debug\n setTimeout(() => {$table.bootstrapTable('load', projects)}, 1000);\n }).catch(() => {\n console.error(\"API request failed\");\n alert(\"API Request Failed\");\n });\n // manually reset remove and edit options since the table selections are cleared on reload\n $remove.prop('disabled', true);\n $edit.prop('disabled', true);\n}", "title": "" }, { "docid": "32399ba22b8c93ea7223ca6fdfb7b25a", "score": "0.47362408", "text": "function getdata() {\n firestore()\n .collection('Datas')\n .orderBy('createdAt', 'desc')\n .limit(3)\n .onSnapshot(QuerySnapshot => {\n console.log('Got Users collection result.', QuerySnapshot.docs.length);\n return QuerySnapshot;\n // QuerySnapshot.forEach(documentSnapshot => {\n // console.log('Fetched', documentSnapshot.data().g_reading);\n // data = documentSnapshot.data();\n // setState({data: documentSnapshot.data()});\n // });\n }, onError);\n\n // console.log('PPP', data);\n // .get();\n // if (typeof collection !== 'undefined') {\n // collection.forEach(documentSnapshot => {\n // console.log('Fetched', documentSnapshot.data().g_reading);\n // data = documentSnapshot.data();\n // });\n // }\n // return data.g_reading;\n\n // console.log('PPP', data);\n\n // return data ? data.g_reading : 10;\n}", "title": "" }, { "docid": "b1f212a5bf722ceb1173cb3a68f69844", "score": "0.4735441", "text": "fetchLiveStatus() {\n this.liveEventsService.find({query: {event_id: this.listingID}})\n .then(result => {\n const publishState = result.total > 0 ? 'live' : 'dropped';\n this.setState({publishState});\n })\n .catch(err => {\n printToConsole(err);\n displayErrorMessages('fetch', 'event\\'s publish status', err, this.updateMessagePanel, 'reload');\n });\n }", "title": "" }, { "docid": "0e0ce0d58a510175dbbf82c28a544f72", "score": "0.4733529", "text": "retrieveAuditHistory(selectedAudit){\n\t\tif (this.state.auditInitialized) {\n\t\t\tlet auditList = [];\n\t\t\tconst maxHist = 1000;\n\t\t\tlet thisRef = this;\n\n\t\t\t//take the info off of the top or selected audit\n\t\t\tlet top = {};\n\t\t\tif (selectedAudit != null) {\n\t\t\t\tauditList = this.state.audits;\n\t\t\t\ttop = selectedAudit;\n\t\t\t} else {\n\t\t\t\t//reverse the order\n\t\t\t\tauditList = this.state.audits.reverse();\n\t\t\t\t//remove all but the most recent ones\n\t\t\t\tif(auditList.length>maxHist){\n\t\t\t\t\tauditList.splice(maxHist);\n\t\t\t\t}\n\t\t\t\ttop = auditList[0];\n\t\t\t}\n\n\t\t\t//map to their rendered states.\n\t\t\tauditList=auditList.map((audit)=>(thisRef.renderAudit(audit, top)));\n\n\t\t\tthis.setState({\n\t\t\t\tauditHistory: auditList,\n\t\t\t\tcurrentAudit: top,\n\t\t\t\tcourses: top.takenCourses\n\t\t\t});\n\n\t\t\tthis.updatePieChart(top.takenCredits, top.neededCredits);\n\t\t\tthis.retrieveCourseHistory(top.takenCourses);\n\t\t}\n\t}", "title": "" }, { "docid": "83895ecc8e01966f89343de02844eae6", "score": "0.47324935", "text": "get state() {\n const id = this[kID];\n if (this.destroyed || id === undefined)\n return Object.create(null);\n return getStreamState(this[kSession][kHandle], id);\n }", "title": "" }, { "docid": "d895c72056d2ed7b8323ce446002e0ea", "score": "0.47307414", "text": "function getAllEventCachedData() {\n var req = window.indexedDB.open(DB_NAME, 1);\n req.onsuccess = function (ev) {\n console.log(\"event success\");\n var db = ev.target.result;\n var tx = db.transaction([EVENT_STORE_NAME], \"readonly\");\n var store = tx.objectStore(EVENT_STORE_NAME);\n var r = store.openCursor();\n var res = [];\n r.onsuccess = function (ev1) {\n var cursor = ev1.target.result;\n if (cursor) {\n res.push(cursor.value);\n cursor.continue()\n } else {\n console.log(\"res of events\", res);\n var urlArr = handleUrl();\n if (urlArr[1] === \"\") {\n addToHeatEvent(res);\n addToNewPostEventSelector(res)\n } else if (urlArr[1] === \"events\") {\n addToEventCard(res);\n addEventToSearchSelector(res);\n // allResult(res.length);\n }\n }\n }\n }\n}", "title": "" }, { "docid": "6b91ce9c658e0a8f451cf2917676c4af", "score": "0.47226417", "text": "function allActivities_(Period, UUID) {\n\n var actlists = getActivityList_(Period);\n\n var num = 0;\n if (actlists) {\n\n var maxact = actlists.getLastRow();\n\n var ActivityData = actlists.getSheetValues(2, ACTIVITY_DATA[\"UAID\"], maxact, ACTIVITY_DATA[\"LENGTH\"]); //[[]]\n\n var ReturnData = [\n []\n ];\n var num = 0;\n for (var set = 0; set < ActivityData.length; set++) {\n if (ActivityData[set][ACTIVITY_DATA[\"UAID\"] - 1] && ActivityData[set][ACTIVITY_DATA[\"NAME\"] - 1]) {\n ReturnData[num] = ActivityData[set];\n num++;\n }\n }\n\n var myData = deanGetActivities(Period, UUID);\n\n }\n\n if (ReturnData && ReturnData.length > 0) {\n ReturnData.sort(\n function (x, y) {\n return x[ACTIVITY_DATA[\"NAME\"] - 1].localeCompare(y[ACTIVITY_DATA[\"NAME\"] - 1]);\n }\n );\n return [ReturnData, myData];\n } else\n return -1;\n\n}", "title": "" }, { "docid": "bc05d1292cce1acbf0153b855a138c6b", "score": "0.4720258", "text": "getStateData() {\n return {\n roomID: this.roomID,\n humanName: this.humanName,\n architecture: this.architecture,\n architectureName: this.architectureName,\n people: Object.values(this.people),\n maxPeople: this.maxPeople,\n links: this.links,\n }\n }", "title": "" }, { "docid": "20e48ffff442d4b4a2cc722228e5f00d", "score": "0.47146413", "text": "function getAttendanceHistory(id){\n fetch(process.env.REACT_APP_API+'attendanceHistory/'+id+'/',{\n method:'GET',\n header:{'Accept':'application/json',\n 'Content-Type':'application/json'}\n\n // convert the data to a json format then set the data\n }).then(response=>response.json())\n .then(data=>{\n setemployes(data)\n setattendanceHistoryShow(true)\n\n //att.status = data[0].status\n //att.date = data[0].date\n //setattendances(att)\n //console.log(data,\"=================\")\n });\n\n // make an event for getAttendanceHistory \n }", "title": "" }, { "docid": "9f60ee20550d355b6c95790fe933c9bf", "score": "0.4704151", "text": "getConnectivityState() {\n return this.connectivityState;\n }", "title": "" }, { "docid": "b48d235b8fd1cafa75f00738fc1271cb", "score": "0.4699505", "text": "function getData() {\n dataCounter++;\n console.log(Date() + '- Getting data');\n var req = http.get('http://www.tfl.gov.uk/tfl/syndication/feeds/cycle-hire/livecyclehireupdates.xml', function (res) {\n // save the data\n var xml = '';\n res.on('data', function (chunk) {\n xml += chunk;\n });\n\n res.on('end', function () {\n console.log(Date() + '- Converting data to JSON');\n // Bug fix for incorrect white spacing\n xml = xml.replace(\"\\ufeff\", \"\");\n parseString(xml, function (err, result) {\n if (result.hasOwnProperty('stations')) {\n if (lastCallTimeStamp != result.stations['$'].lastUpdate) {\n lastCallTimeStamp = result.stations['$'].lastUpdate;\n stationsRealTime = result.stations['station'];\n // commented this out during testing\n saveData(result.stations['station']);\n } else {\n console.log(Date() + '- No new updates since last run');\n }\n }\n });\n\n console.log(Date() + '- Finished data capture run: ' + dataCounter);\n });\n \n res.on('error', function (err) {\n // error in processing\n console.log(err);\n });\n });\n\n req.on('error', function (err) {\n // error in receiving\n });\n}", "title": "" }, { "docid": "86fadd46d99ec592d35f24403788c46a", "score": "0.46985453", "text": "async function fetchData() {\n const { id } = this;\n const { xivapiDate } = window.config;\n\n if (window.config.offline || (this.cache && this.recentlyUpdated)) {\n return this.cache;\n }\n\n this.recentlyUpdated = true;\n\n if (this.cache && this.cache.info && this.cache.info.fc) {\n const lastUpdated = this.cache.xivapiLastUpdated;\n\n const xivapiCache = await new Promise(\n (resolve) => fetch(\n `https://xivapi.com/character/${id}?data=AC&columns=Info.Achievements.Updated,Info.Character.State,Info.Character.Updated&key=f5e2c6eac7604e07b2cd&af=${+new Date()}`\n )\n .then(response => response.json())\n .then(resolve)\n .catch(window.config.handleXIVAPIError)\n );\n\n if (xivapiCache.Info.Character.State === 2\n && Number(`${xivapiCache.Info.Character.Updated}000`) <= lastUpdated\n && Number(`${xivapiCache.Info.Achievements.Updated}000`) <= lastUpdated)\n return this.cache;\n }\n\n const characterData = await new Promise(\n (resolve) => fetch(\n `https://xivapi.com/character/${id}?data=AC,FC&columns=Achievements.List,Character.Avatar,Character.ClassJobs,Character.Gender,Character.Minions,Character.Mounts,Character.Name,Character.Server,Character.Title,FreeCompany.Crest,FreeCompany.ID,FreeCompany.Name,FreeCompany.Tag,Info.Achievements.State,Info.Achievements.Updated,Info.Character.State,Info.Character.Updated,Info.FreeCompany.State,Info.FreeCompany.Updated&key=f5e2c6eac7604e07b2cd&af=${+new Date()}`\n )\n .then(response => response.json())\n .then(resolve)\n .catch(window.config.handleXIVAPIError)\n );\n\n switch (+characterData.Info.Character.State) {\n case 1:\n return {\n state: 'new'\n };\n\n case 2:\n // Found.\n break;\n\n case 3:\n return {\n state: 'not-found'\n };\n\n case 4:\n return {\n state: 'blacklisted'\n };\n \n default:\n return {\n state: +characterData.State\n }\n }\n \n const response = {\n info: {\n avatar: characterData.Character.Avatar,\n gender: characterData.Character.Gender === 2 ? 'female' : 'male',\n name: characterData.Character.Name,\n server: characterData.Character.Server,\n title: characterData.Character.Title\n }\n }\n\n if (characterData.FreeCompany.ID && characterData.Info.FreeCompany.State === 2)\n response.info.fc = {\n id: characterData.FreeCompany.ID,\n name: characterData.FreeCompany.Name,\n tag: characterData.FreeCompany.Tag\n }\n\n let achievements;\n\n if (characterData.Info.Achievements.State !== 2) {\n response.isPrivate = true;\n achievements = [];\n } else {\n achievements = characterData.Achievements.List;\n }\n\n if (!(achievements instanceof Array))\n achievements = [];\n\n const achievementsLastChanged = +xivapiDate(characterData.Info.Achievements.Updated);\n const dataLastChanged = +xivapiDate(characterData.Info.Character.Updated);\n\n response.xivapiLastUpdated = achievementsLastChanged > dataLastChanged ? achievementsLastChanged : dataLastChanged;\n response.achievements = achievements.map(o => {\n return {\n id: o.ID,\n date: +xivapiDate(o.Date)\n }\n }).sort((a, b) => +a.date < b.date ? -1 : 1);\n response.minions = characterData.Character.Minions || [];\n response.mounts = characterData.Character.Mounts || [];\n\n const characterAvailableAchievements = await getCharacterAvailableAchievements.call(this, response);\n const characterClassJobs = characterData.Character.ClassJobs;\n\n response.counts = {\n achievements: characterAvailableAchievements.length,\n achievementPoints: characterAvailableAchievements.length && characterAvailableAchievements.map(a => a.points).reduce((a, b) => a + b),\n achievementRewards: characterAvailableAchievements.filter(a => a.reward && a.reward.item).length,\n combinedLevel: characterClassJobs && typeof characterClassJobs === 'object' ? Object.values(characterClassJobs).filter(c => c.JobID !== 28).map(c => c.Level).reduce((a,b) => a + b) : 0,\n minions: await getAvailableMinionsCount.call(this, response),\n mounts: await getAvailableMountsCount.call(this, response),\n titles: characterAvailableAchievements.filter(a => a.reward && a.reward.title).length\n }\n\n if (localStorage) {\n localStorage.setItem('character.' + this.id, JSON.stringify(response));\n }\n\n return response;\n}", "title": "" }, { "docid": "1598ad84d816a1e8205b206214b7dfb9", "score": "0.46958405", "text": "getDataForErrorMessage() {\n if (!this.failedToLoadUpdatedData) {\n throw 'Only call me when fetching new data failed!';\n }\n return this.currentData;\n }", "title": "" }, { "docid": "27796f9bb6323767948de898aa7121e6", "score": "0.46933267", "text": "fetch() {\n return this._fetchData();\n }", "title": "" }, { "docid": "c7086ae81c43332e8436199733f548b7", "score": "0.46930858", "text": "function getActiveChannels(){\n var data = self.data;\n var length = data.length;\n\n for(var n = 0; n < length; n++){\n var event = data[n][0].event;\n if (typeof(event.channel) === \"number\" && \n typeof(active_channels[event.channel]) !== \"number\"){\n if(event.programNumber){\t\t\n active_channels[event.channel] = event.programNumber;\n }else{\n active_channels[event.channel] = 0;\n }\n }\n }\n }", "title": "" } ]
e65a3dd774fe200864e4667c11f326e0
Determines whether to skip/remove the backtick or not.
[ { "docid": "92b18e94c5b5c634bb91281f5dce171d", "score": "0.7530884", "text": "function shouldSkipOrRemoveBacktick(Editor) {\n var Components = Editor.Components;\n\n var _Components$Selection = Components.Selection.get(),\n start = _Components$Selection.start;\n\n var info = Components.Code.lines.getInfoAt(start);\n\n if (info && info.category === CATEGORY_STRING) {\n return compare(start, [start[0], info.to - 1]) === 0;\n }\n\n return false;\n}", "title": "" } ]
[ { "docid": "eb25f751389ee30df69fcb6904781929", "score": "0.624169", "text": "function shouldCloseBacktick(Editor) {\n var Components = Editor.Components;\n var Input = Components.Input;\n var prevInfo = Input.info;\n\n if (prevInfo && prevInfo.category === CATEGORY_STRING) {\n return false;\n }\n\n var after = Input.after;\n return !Components.Scope.isIn('comment') && (!after || /^\\s/.test(after));\n}", "title": "" }, { "docid": "e40a9808bfbf66fab2106e3cd7156ddc", "score": "0.5629274", "text": "function shouldSkipOrRemove(Editor, config) {\n return validateQuotes(Editor, config, true);\n}", "title": "" }, { "docid": "29f7ff137c04cd7e7dc92ea4edc8b680", "score": "0.5315723", "text": "_skipCommandChar() {\n if (this.commandChar === undefined) {\n return;\n }\n \n if (this._hasNext() && (this._getCurrentChar() === this.commandChar)) {\n this.position++;\n }\n }", "title": "" }, { "docid": "db298a22b3eb0ad3f98976bb495b76c0", "score": "0.5236946", "text": "_putDoubleQuotes(i) {\n let excludeList = ['qop', 'nc'];\n\n return !_.includes(excludeList, i);\n }", "title": "" }, { "docid": "c3d5a1dc541f647078496aec0bdf8cf7", "score": "0.51664394", "text": "function skipString() {\n const quote = source.charAt(pos);\n pos++;\n while (pos < source.length) {\n const ch = source.charAt(pos);\n const prev = source.charAt(pos - 1);\n // Checks if the quote was escaped.\n if (ch === quote && prev !== '\\\\') {\n pos++;\n return;\n }\n // Template strings are a bit tougher, we want to skip the interpolated values.\n if (quote === '`') {\n const next = source.charAt(pos + 1);\n if (next === '$') {\n const afterDollar = source.charAt(pos + 2);\n if (afterDollar === '{') {\n // This is the start of an interpolation; skip the ${\n pos = pos + 2;\n // Skip strings and whitespace until we reach the ending }.\n // This includes skipping nested interpolated strings. :D\n skipUntil((ch) => ch === '}');\n }\n }\n }\n pos++;\n }\n }", "title": "" }, { "docid": "682eb1816f3d1b2fd858c34921680302", "score": "0.50960964", "text": "shouldIgnoreTicks() { return this.ignore_ticks; }", "title": "" }, { "docid": "44a365f645516b39c11347c5c22ece18", "score": "0.50085694", "text": "skipCommand() {\n this.log(`Encountered skip tag`);\n while (\n this.index < this.lines.length &&\n !this.matchValues(\":\", /^endskip/i)\n ) {\n var skipped = this.advance();\n this.log(` > Skipping text: \"${combine(skipped)}\"`);\n }\n this.addInstruction(\"skipped\");\n }", "title": "" }, { "docid": "3d6019547867adebe49e96ad65239cb0", "score": "0.49657774", "text": "function skipComment () {\n\t i += 2;\n\t while (i < jsString.length && (curr() !== '*' || next() !== '/')) {\n\t i++;\n\t }\n\t i += 2;\n\t }", "title": "" }, { "docid": "70b5ca700a6445e3de4bd778b8895346", "score": "0.49580836", "text": "[SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE](cp) {\n if (cp === $.SOLIDUS) {\n this.tempBuff = [];\n this.state = SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE;\n\n this._emitChars('/');\n } else {\n this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "acde097edf14b6ba2e222dddb1b6b21f", "score": "0.49536765", "text": "testExcessCoffeeSymbols() {\n if (this.ext === 'coffee') {\n /*\n * string starts\n * whitespace 0 or more\n * not : or # or ( or ) or whitespace 1 or more [CAPTURED]\n * grab (\n * grab all non ) characters (atleast 1)\n * find a )\n * string ends\n */\n /* sample catches\n $wrap = @$el.find('> .background.temp')\n $el = if e then $(e.currentTarget) else @$el.find('.footer span').eq(0)\n $others = @$el.find('.filter').not($filter)\n */\n\n /* ignores because of repeated .data function\n $(a).data('index') - $(b).data('index')\n */\n const msg = 'excess parenthesis or spacing detected';\n for (let index = 0; index < this.lines.length; index++) {\n const line = this.lines[index];\n const lineMatch = line.match(/\\s*([^:#()\\s]+)\\([^)]+\\)$/);\n const match = lineMatch ? lineMatch[1] : null;\n\n // if the function used more than once in the same\n // line then allow it\n if (match && (line.indexOf(match) === line.lastIndexOf(match))) {\n this.fail(index + 1, msg, line);\n }\n }\n }\n }", "title": "" }, { "docid": "d0634e8cea11fd33ad87d6f23dbea663", "score": "0.49523267", "text": "function shouldInsertEmptyLineAfter(node) {\n const { originalText } = options;\n const nextCharIndex = getNextNonSpaceNonCommentCharacterIndex(\n originalText,\n node,\n options\n );\n const nextChar = originalText.charAt(nextCharIndex);\n\n // if it is cut off by a parenthesis, we only account for one typed empty\n // line after that parenthesis\n if (nextChar === \")\") {\n return isNextLineEmptyAfterIndex(\n originalText,\n nextCharIndex + 1,\n options\n );\n }\n\n return isNextLineEmpty(originalText, node, options);\n }", "title": "" }, { "docid": "7ecf6dd99ca5330c7d0b4bfc1e3f96ff", "score": "0.49192196", "text": "function skipExpression() {\n skipUntil((ch) => {\n const isAtRoot = parenLeft === parenRight + 1;\n if (ch === ',' && isAtRoot) {\n return true;\n }\n if (ch === '(') {\n parenLeft++;\n return false;\n }\n if (ch === ')') {\n parenRight++;\n if (isAtRoot) {\n return true;\n }\n }\n return false;\n });\n }", "title": "" }, { "docid": "04c1e5d45635171ba57d33dc8be0ac21", "score": "0.4910058", "text": "function sansFrite(aliment) {\n return aliment !== \"🍟\";\n}", "title": "" }, { "docid": "66a1166ba33f314255754001df40bfdc", "score": "0.48915076", "text": "function noMultiStr() {\n const backticks = `Line 1\n Line 2`;\n const nl = 'Line 1\\n' +\n 'Line 2';\n return [backticks, nl];\n}", "title": "" }, { "docid": "4f160b4ae72a1e30e1f775557398aa7b", "score": "0.48677105", "text": "get isSkipped() {\n return (this.flags & 2) > 0;\n }", "title": "" }, { "docid": "559e6451803f7ffb2392aac5530737f7", "score": "0.48634326", "text": "stripFlag(val) {\n return kawkah_parser_1.stripFlag(val, this.options.charNegate);\n }", "title": "" }, { "docid": "35694c26ac859d9818f54f2a07774531", "score": "0.48488572", "text": "function advanceSlash() {\n var regex, previous, check;\n\n function testKeyword(value) {\n return value && (value.length > 1) && (value[0] >= 'a') && (value[0] <= 'z');\n }\n\n previous = extra.tokenValues[extra.tokens.length - 1];\n regex = (previous !== null);\n\n switch (previous) {\n case 'this':\n case ']':\n regex = false;\n break;\n\n case ')':\n check = extra.tokenValues[extra.openParenToken - 1];\n regex = (check === 'if' || check === 'while' || check === 'for' || check === 'with');\n break;\n\n case '}':\n // Dividing a function by anything makes little sense,\n // but we have to check for that.\n regex = false;\n if (testKeyword(extra.tokenValues[extra.openCurlyToken - 3])) {\n // Anonymous function, e.g. function(){} /42\n check = extra.tokenValues[extra.openCurlyToken - 4];\n regex = check ? (FnExprTokens.indexOf(check) < 0) : false;\n } else if (testKeyword(extra.tokenValues[extra.openCurlyToken - 4])) {\n // Named function, e.g. function f(){} /42/\n check = extra.tokenValues[extra.openCurlyToken - 5];\n regex = check ? (FnExprTokens.indexOf(check) < 0) : true;\n }\n }\n\n return regex ? collectRegex() : scanPunctuator();\n }", "title": "" }, { "docid": "35694c26ac859d9818f54f2a07774531", "score": "0.48488572", "text": "function advanceSlash() {\n var regex, previous, check;\n\n function testKeyword(value) {\n return value && (value.length > 1) && (value[0] >= 'a') && (value[0] <= 'z');\n }\n\n previous = extra.tokenValues[extra.tokens.length - 1];\n regex = (previous !== null);\n\n switch (previous) {\n case 'this':\n case ']':\n regex = false;\n break;\n\n case ')':\n check = extra.tokenValues[extra.openParenToken - 1];\n regex = (check === 'if' || check === 'while' || check === 'for' || check === 'with');\n break;\n\n case '}':\n // Dividing a function by anything makes little sense,\n // but we have to check for that.\n regex = false;\n if (testKeyword(extra.tokenValues[extra.openCurlyToken - 3])) {\n // Anonymous function, e.g. function(){} /42\n check = extra.tokenValues[extra.openCurlyToken - 4];\n regex = check ? (FnExprTokens.indexOf(check) < 0) : false;\n } else if (testKeyword(extra.tokenValues[extra.openCurlyToken - 4])) {\n // Named function, e.g. function f(){} /42/\n check = extra.tokenValues[extra.openCurlyToken - 5];\n regex = check ? (FnExprTokens.indexOf(check) < 0) : true;\n }\n }\n\n return regex ? collectRegex() : scanPunctuator();\n }", "title": "" }, { "docid": "0ace5660f1471758a19d1bd8df90193a", "score": "0.4842728", "text": "function isTypewriterSkipChar(ch) {\n if (ch === \" \" || ch === \"\\n\" || ch === \"\\t\") return true;\n return false;\n}", "title": "" }, { "docid": "425ff64adb43a1a288e04e74828a2482", "score": "0.48373038", "text": "function testBackslashToken() {\n\tvar input = fs.readFileSync(\"../TestCases/gitHub#83-backslash_largerOutput.js\", { encoding:\"utf8\"});\n\n\tvar options = {\n\t\t\twithMath : false,\n\t\t\thash2DContext : false,\n\t\t\thashWebGLContext : false,\n\t\t\thashAudioContext : false,\n\t\t\tcontextVariableName : false,\n\t\t\tcontextType : parseInt(0),\n\t\t\treassignVars : false,\n\t\t\tvarsNotReassigned : [],\n\t\t\tcrushGainFactor : parseFloat(2),\n\t\t\tcrushLengthFactor : parseFloat(1),\n\t\t\tcrushCopiesFactor : parseFloat(0),\n\t\t\tcrushTiebreakerFactor : parseInt(1),\n\t\t\twrapInSetInterval : false,\n\t\t\ttimeVariableName : \"\",\n\t\t\tuseES6 : true\n\t\t};\n\t\t\n\tvar resultWithBackspaceToken = RegPack.packer.runPacker(input+\")\", options);\n\tvar resultWithoutBackspaceToken = RegPack.packer.runPacker(input+\"\\\\\", options);\n\t\n\t// With the extra token available, compression should be at least as good (lower final size) as without it\n\tassert(resultWithBackspaceToken[0].result[1][0] <= resultWithoutBackspaceToken[0].result[1][0]);\n}", "title": "" }, { "docid": "0df24f35d64f59fa9319b8953f27c42a", "score": "0.4827438", "text": "function skipEmpty(state, delimiterCharCode) {\n while (state.position < state.length) {\n var c = state.data.charCodeAt(state.position);\n if (c !== 9 && c !== 32 && c !== delimiterCharCode) { // \\t or ' '\n return c === 10 || c === 13; // \\n or \\r\n }\n ++state.position;\n }\n}", "title": "" }, { "docid": "83fb0a573544379c7d8ed261bba8efd4", "score": "0.48158172", "text": "get isSkipped() { return (this.flags & 2 /* Skipped */) > 0; }", "title": "" }, { "docid": "83fb0a573544379c7d8ed261bba8efd4", "score": "0.48158172", "text": "get isSkipped() { return (this.flags & 2 /* Skipped */) > 0; }", "title": "" }, { "docid": "1c1ad21b48361c7f4aea1e1827f6b440", "score": "0.48050863", "text": "function advanceSlash() {\n var regex, previous, check;\n\n function testKeyword(value) {\n return value && (value.length > 1) && (value[0] >= 'a') && (value[0] <= 'z');\n }\n\n previous = extra.tokenValues[extra.tokenValues.length - 1];\n regex = (previous !== null);\n\n switch (previous) {\n case 'this':\n case ']':\n regex = false;\n break;\n\n case ')':\n check = extra.tokenValues[extra.openParenToken - 1];\n regex = (check === 'if' || check === 'while' || check === 'for' || check === 'with');\n break;\n\n case '}':\n // Dividing a function by anything makes little sense,\n // but we have to check for that.\n regex = false;\n if (testKeyword(extra.tokenValues[extra.openCurlyToken - 3])) {\n // Anonymous function, e.g. function(){} /42\n check = extra.tokenValues[extra.openCurlyToken - 4];\n regex = check ? (FnExprTokens.indexOf(check) < 0) : false;\n } else if (testKeyword(extra.tokenValues[extra.openCurlyToken - 4])) {\n // Named function, e.g. function f(){} /42/\n check = extra.tokenValues[extra.openCurlyToken - 5];\n regex = check ? (FnExprTokens.indexOf(check) < 0) : true;\n }\n }\n\n return regex ? collectRegex() : scanPunctuator();\n }", "title": "" }, { "docid": "95e59df8e63f1e35690e61a292a2c183", "score": "0.47811112", "text": "function checkPuncAndSkip(ch) {\n if (is_punc(ch)) input.next();\n else input.croak(\"Expecting punctuation: \\\"\" + ch + \"\\\"\");\n }", "title": "" }, { "docid": "18b4095511840602aaeb74916cb9e484", "score": "0.4776623", "text": "function isPrevComment(flags, i) {\n return flags[i ? i - 1 : 0] !== ' ';\n }", "title": "" }, { "docid": "de8080e77e48be8a301636f6bf4b047d", "score": "0.4771696", "text": "function skipUntil(callback, dumb = false) {\n while (pos < source.length) {\n let ch = source.charAt(pos);\n if (callback(ch)) {\n return;\n }\n if (!dumb) {\n if (isWhiteSpace(ch)) {\n pos++;\n continue;\n }\n if (isStringQuote(ch)) {\n skipString();\n continue;\n }\n }\n pos++;\n }\n }", "title": "" }, { "docid": "5ea4577f8070f6a2131b6595d74487ec", "score": "0.47631165", "text": "function unflagged() {\n\t\tresult._.push(nextString());\n\t}", "title": "" }, { "docid": "00c4ae838136d78582e89ea96a0bd044", "score": "0.4754183", "text": "function isWrapped(cmd) {\n return cmd.endsWith(\")\");\n}", "title": "" }, { "docid": "b2eeed88b9bb95383b03ab8911210f24", "score": "0.47351247", "text": "[SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE](cp) {\n if (cp === $.SOLIDUS) {\n this.tempBuff = [];\n this.state = SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE;\n this._emitChars('/');\n } else {\n this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "b2eeed88b9bb95383b03ab8911210f24", "score": "0.47351247", "text": "[SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE](cp) {\n if (cp === $.SOLIDUS) {\n this.tempBuff = [];\n this.state = SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE;\n this._emitChars('/');\n } else {\n this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "b2eeed88b9bb95383b03ab8911210f24", "score": "0.47351247", "text": "[SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE](cp) {\n if (cp === $.SOLIDUS) {\n this.tempBuff = [];\n this.state = SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE;\n this._emitChars('/');\n } else {\n this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "b2eeed88b9bb95383b03ab8911210f24", "score": "0.47351247", "text": "[SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE](cp) {\n if (cp === $.SOLIDUS) {\n this.tempBuff = [];\n this.state = SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE;\n this._emitChars('/');\n } else {\n this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "632e7c4f52ddb990c0171f6171026afe", "score": "0.47287416", "text": "get isSkipped() { return (this.flags & 2 /* NodeFlag.Skipped */) > 0; }", "title": "" }, { "docid": "1f6988c58efe4d102c84439064101de2", "score": "0.4726316", "text": "async _nextWithoutNewline() {\n let result = await this._next()\n const expectedPromptPosition = result.length - PROMPT.length\n if (result.indexOf(PROMPT) !== expectedPromptPosition) {\n throw new TodoServiceError('No new line? Result:\\n' + result)\n }\n return result.substring(0, expectedPromptPosition)\n }", "title": "" }, { "docid": "cdcc3a6844e3b58e2459adf6b061fcfb", "score": "0.4721751", "text": "statementNeedsParens(): boolean {\n return false;\n }", "title": "" }, { "docid": "289877fdb9235ff1fc8ae221e770dabd", "score": "0.47040096", "text": "function getTokenSkipNewline () {\n do {\n getToken();\n }\n while (token === '\\n');\n }", "title": "" }, { "docid": "289877fdb9235ff1fc8ae221e770dabd", "score": "0.47040096", "text": "function getTokenSkipNewline () {\n do {\n getToken();\n }\n while (token === '\\n');\n }", "title": "" }, { "docid": "3e597f65983febf18d1bccbe8a8b24fb", "score": "0.47039253", "text": "checkSkip(str) {\n for(let temp of this.state.skipques) {\n if(temp === str) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "bb5a1d951969569795d9ffdc40891075", "score": "0.46946678", "text": "function advanceSlash() {\n\t var regex, previous, check;\n\n\t function testKeyword(value) {\n\t return value && (value.length > 1) && (value[0] >= 'a') && (value[0] <= 'z');\n\t }\n\n\t previous = extra.tokenValues[extra.tokenValues.length - 1];\n\t regex = (previous !== null);\n\n\t switch (previous) {\n\t case 'this':\n\t case ']':\n\t regex = false;\n\t break;\n\n\t case ')':\n\t check = extra.tokenValues[extra.openParenToken - 1];\n\t regex = (check === 'if' || check === 'while' || check === 'for' || check === 'with');\n\t break;\n\n\t case '}':\n\t // Dividing a function by anything makes little sense,\n\t // but we have to check for that.\n\t regex = false;\n\t if (testKeyword(extra.tokenValues[extra.openCurlyToken - 3])) {\n\t // Anonymous function, e.g. function(){} /42\n\t check = extra.tokenValues[extra.openCurlyToken - 4];\n\t regex = check ? (FnExprTokens.indexOf(check) < 0) : false;\n\t } else if (testKeyword(extra.tokenValues[extra.openCurlyToken - 4])) {\n\t // Named function, e.g. function f(){} /42/\n\t check = extra.tokenValues[extra.openCurlyToken - 5];\n\t regex = check ? (FnExprTokens.indexOf(check) < 0) : true;\n\t }\n\t }\n\n\t return regex ? collectRegex() : scanPunctuator();\n\t }", "title": "" }, { "docid": "bb5a1d951969569795d9ffdc40891075", "score": "0.46946678", "text": "function advanceSlash() {\n\t var regex, previous, check;\n\n\t function testKeyword(value) {\n\t return value && (value.length > 1) && (value[0] >= 'a') && (value[0] <= 'z');\n\t }\n\n\t previous = extra.tokenValues[extra.tokenValues.length - 1];\n\t regex = (previous !== null);\n\n\t switch (previous) {\n\t case 'this':\n\t case ']':\n\t regex = false;\n\t break;\n\n\t case ')':\n\t check = extra.tokenValues[extra.openParenToken - 1];\n\t regex = (check === 'if' || check === 'while' || check === 'for' || check === 'with');\n\t break;\n\n\t case '}':\n\t // Dividing a function by anything makes little sense,\n\t // but we have to check for that.\n\t regex = false;\n\t if (testKeyword(extra.tokenValues[extra.openCurlyToken - 3])) {\n\t // Anonymous function, e.g. function(){} /42\n\t check = extra.tokenValues[extra.openCurlyToken - 4];\n\t regex = check ? (FnExprTokens.indexOf(check) < 0) : false;\n\t } else if (testKeyword(extra.tokenValues[extra.openCurlyToken - 4])) {\n\t // Named function, e.g. function f(){} /42/\n\t check = extra.tokenValues[extra.openCurlyToken - 5];\n\t regex = check ? (FnExprTokens.indexOf(check) < 0) : true;\n\t }\n\t }\n\n\t return regex ? collectRegex() : scanPunctuator();\n\t }", "title": "" }, { "docid": "bb5a1d951969569795d9ffdc40891075", "score": "0.46946678", "text": "function advanceSlash() {\n\t var regex, previous, check;\n\n\t function testKeyword(value) {\n\t return value && (value.length > 1) && (value[0] >= 'a') && (value[0] <= 'z');\n\t }\n\n\t previous = extra.tokenValues[extra.tokenValues.length - 1];\n\t regex = (previous !== null);\n\n\t switch (previous) {\n\t case 'this':\n\t case ']':\n\t regex = false;\n\t break;\n\n\t case ')':\n\t check = extra.tokenValues[extra.openParenToken - 1];\n\t regex = (check === 'if' || check === 'while' || check === 'for' || check === 'with');\n\t break;\n\n\t case '}':\n\t // Dividing a function by anything makes little sense,\n\t // but we have to check for that.\n\t regex = false;\n\t if (testKeyword(extra.tokenValues[extra.openCurlyToken - 3])) {\n\t // Anonymous function, e.g. function(){} /42\n\t check = extra.tokenValues[extra.openCurlyToken - 4];\n\t regex = check ? (FnExprTokens.indexOf(check) < 0) : false;\n\t } else if (testKeyword(extra.tokenValues[extra.openCurlyToken - 4])) {\n\t // Named function, e.g. function f(){} /42/\n\t check = extra.tokenValues[extra.openCurlyToken - 5];\n\t regex = check ? (FnExprTokens.indexOf(check) < 0) : true;\n\t }\n\t }\n\n\t return regex ? collectRegex() : scanPunctuator();\n\t }", "title": "" }, { "docid": "24f64a9524bcfd08069b7edd9a545e18", "score": "0.46909335", "text": "function runextNOT ()\n{\n flag = !flag ;\n}", "title": "" }, { "docid": "088210dd09dd66cc1e32701e4fc09033", "score": "0.46669573", "text": "function sansOignon(aliment) {\n return aliment !== \"😭\";\n}", "title": "" }, { "docid": "da481f8187d85fde3758fab634f7e0a3", "score": "0.4662582", "text": "skipTo(ch) {\n let found = this.string.indexOf(ch, this.pos);\n if (found > -1) {\n this.pos = found;\n return true;\n }\n }", "title": "" }, { "docid": "f6a6598b7c12461bead43487aecd147d", "score": "0.4661111", "text": "_not(statement, str) {\n if (statement.not) return `not ${str}`;\n return str;\n }", "title": "" }, { "docid": "ed3fa102583e1da0d4039fc3fc46f29e", "score": "0.4654447", "text": "function nextUntilUnescaped(source, end) {\n var escaped = false;\n while (!source.endOfLine()) {\n var next = source.next();\n if (next == end && !escaped)\n return false;\n escaped = !escaped && next == \"\\\\\";\n }\n return escaped;\n }", "title": "" }, { "docid": "dfbdc9133466503bba1eb8189aeaa37a", "score": "0.4652056", "text": "function getTokenSkipNewline () {\n do {\n getToken();\n }\n while (token == '\\n');\n }", "title": "" }, { "docid": "dfbdc9133466503bba1eb8189aeaa37a", "score": "0.4652056", "text": "function getTokenSkipNewline () {\n do {\n getToken();\n }\n while (token == '\\n');\n }", "title": "" }, { "docid": "dfbdc9133466503bba1eb8189aeaa37a", "score": "0.4652056", "text": "function getTokenSkipNewline () {\n do {\n getToken();\n }\n while (token == '\\n');\n }", "title": "" }, { "docid": "dfbdc9133466503bba1eb8189aeaa37a", "score": "0.4652056", "text": "function getTokenSkipNewline () {\n do {\n getToken();\n }\n while (token == '\\n');\n }", "title": "" }, { "docid": "ac2e277045fff4be60a0ff82b48ec2f7", "score": "0.46479705", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "ac2e277045fff4be60a0ff82b48ec2f7", "score": "0.46479705", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "92c29c04f059d115bb0a1ea6c26c59bd", "score": "0.46471506", "text": "function peekLineTerminator() {\n\t\t\t\t\t\t\t\t var pos, line, start, found;\n\n\t\t\t\t\t\t\t\t pos = index;\n\t\t\t\t\t\t\t\t line = lineNumber;\n\t\t\t\t\t\t\t\t start = lineStart;\n\t\t\t\t\t\t\t\t skipComment();\n\t\t\t\t\t\t\t\t found = lineNumber !== line;\n\t\t\t\t\t\t\t\t index = pos;\n\t\t\t\t\t\t\t\t lineNumber = line;\n\t\t\t\t\t\t\t\t lineStart = start;\n\n\t\t\t\t\t\t\t\t return found;\n\t\t\t\t\t\t\t\t }", "title": "" }, { "docid": "d62e16e929a2426cdcfecbf4f80b66d0", "score": "0.46414682", "text": "function skip(lexer, kind) {\n if (lexer.token.kind === kind) {\n lexer.advance();\n return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "859fcf46b8f8988b74e47f891190ba6a", "score": "0.4638033", "text": "function nextUntilUnescaped(source, end) {\n var escaped = false;\n while (!source.endOfLine()) {\n var next = source.next();\n if (next == end && !escaped) return false;\n escaped = !escaped && next == \"\\\\\";\n }\n return escaped;\n }", "title": "" }, { "docid": "7aedc1f59d3372939b2a9736f26e07d5", "score": "0.46239933", "text": "function makeSentinel() {\n sentinelFlag = !sentinelFlag;\n if (sentinelFlag) {\n return \"#\";\n }\n else {\n return \"$\";\n }\n }", "title": "" }, { "docid": "2318c819747248d046b0465a8ab5a322", "score": "0.46231034", "text": "function peekLineTerminator(){var pos,line,start,found;pos=index;line=lineNumber;start=lineStart;skipComment();found=lineNumber!==line;index=pos;lineNumber=line;lineStart=start;return found;} // Throw an exception", "title": "" }, { "docid": "e4f1af9680ae107ea1d1136fc5efc5c9", "score": "0.46089166", "text": "function nextUntilUnescaped(source, end) {\n var escaped = false;\n while(!source.endOfLine()){\n var next = source.next();\n if (next == end && !escaped)\n return false;\n escaped = next == \"\\\\\" && !escaped;\n }\n return escaped;\n }", "title": "" }, { "docid": "32b53ed8b8eb0c6e84d03aa4c5e87015", "score": "0.46063507", "text": "function excludeLine (line) {\n const excludes = [\n /^ {10}at Test\\..*?node_modules.*/,\n /^ {10}at Immediate.next /,\n /^ {10}at processImmediate/\n ]\n\n for (var i = 0; i < excludes.length; i++) {\n if (line.match(excludes[i])) {\n return true\n }\n }\n return false\n}", "title": "" }, { "docid": "ab3b32f659a0f32294cdffe513730359", "score": "0.46001843", "text": "function advanceSlash() {\n\t var regex, previous, check;\n\t\n\t function testKeyword(value) {\n\t return value && (value.length > 1) && (value[0] >= 'a') && (value[0] <= 'z');\n\t }\n\t\n\t previous = extra.tokenValues[extra.tokenValues.length - 1];\n\t regex = (previous !== null);\n\t\n\t switch (previous) {\n\t case 'this':\n\t case ']':\n\t regex = false;\n\t break;\n\t\n\t case ')':\n\t check = extra.tokenValues[extra.openParenToken - 1];\n\t regex = (check === 'if' || check === 'while' || check === 'for' || check === 'with');\n\t break;\n\t\n\t case '}':\n\t // Dividing a function by anything makes little sense,\n\t // but we have to check for that.\n\t regex = false;\n\t if (testKeyword(extra.tokenValues[extra.openCurlyToken - 3])) {\n\t // Anonymous function, e.g. function(){} /42\n\t check = extra.tokenValues[extra.openCurlyToken - 4];\n\t regex = check ? (FnExprTokens.indexOf(check) < 0) : false;\n\t } else if (testKeyword(extra.tokenValues[extra.openCurlyToken - 4])) {\n\t // Named function, e.g. function f(){} /42/\n\t check = extra.tokenValues[extra.openCurlyToken - 5];\n\t regex = check ? (FnExprTokens.indexOf(check) < 0) : true;\n\t }\n\t }\n\t\n\t return regex ? collectRegex() : scanPunctuator();\n\t }", "title": "" }, { "docid": "d3a50f95f77e22f33e8cf4bf72e17247", "score": "0.45917156", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "d3a50f95f77e22f33e8cf4bf72e17247", "score": "0.45917156", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "d7d8aeb6dfc2b9dce393717936dc17d3", "score": "0.4562185", "text": "function skipBlancs(s){\n if (s == \"\")\n return \"\";\n else{\n var x;\n while (s.length > 0){\n x = s.substring(0, 1);\n if (x == \"#\")\n s = parseComment(s); \n else if (x == \" \" || x == \"\\n\" || x == \"\\r\" || x == \"\\t\")\n s = s.substring(1, s.length);\n else\n return s;\n } \n }\n return \"\";\n}", "title": "" }, { "docid": "5f9d9dba56d2c6129d71ee5a6aa172f7", "score": "0.45578754", "text": "function moveNext () {\n\t\tvar expect = self.expect;\n\t\tvar ch = it.next();\n\t\tif(ch === undefined)\n\t\t\treturn ch;\n\t\tfunction ignore_line () {\n\t\t\tvar chCode = ch.charCodeAt(0);\n\t\t\twhile(chCode != 10) {\n\t\t\t\tch = it.next();\n\t\t\t\tcharacters++;\n\t\t\t\tif(ch === undefined)\n\t\t\t\t\treturn ch;\n\t\t\t\tchCode = ch.charCodeAt(0);\n\t\t\t\tif(chCode == 10) {\n\t\t\t\t\tself.character = 1;\n\t\t\t\t\tself.line++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tch = it.next();\n\t\t\tself.line++;\n\t\t}\n\t\tif(self.character == 1 && ch == '#') {\n\t\t\tch = it.next();\n\t\t\tif(ch == '!') {\n\t\t\t\tch = it.next();\n\t\t\t\t// Shebang, ignore line\n\t\t\t\tignore_line();\n\t\t\t} else\n\t\t\t\tit.prev();\n\t\t}\n\t\tcharacters++;\n\t\tself.character++;\n\t\tif(ch === undefined)\n\t\t\treturn ch;\n\t\tif(ch == '%' && !(self.expect & EX_STRING_CHARACTER)) {\n\t\t\t// Comment and not in speech, ignore this line.\n\t\t\t// Must keep running in a loop, in case there are more\n\t\t\t// comments.\n\t\t\twhile(ch == '%') {\n\t\t\t\tparser_debug(\"COMMENT\");\n\t\t\t\tignore_line();\n\t\t\t}\n\t\t}\n\t\treturn ch;\n\t}", "title": "" }, { "docid": "a79029c3616e6986c952cfc2cfb348dc", "score": "0.45540178", "text": "function stateCommentEndBang(char) {\n if (char === '-') {\n // We read the sequence '--!-' inside of a comment. The last dash\n // could signify that the comment is going to close\n state = 17 /* CommentEndDash */;\n }\n else if (char === '>') {\n // End of comment with the sequence '--!>'\n emitTagAndPreviousTextNode();\n }\n else {\n // The '--!' was not followed by a '>', continue reading the \n // comment's text\n state = 16 /* Comment */;\n }\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "27856a3c34f2caed114b261c27159ed1", "score": "0.45527127", "text": "function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }", "title": "" }, { "docid": "dcd1b0b5153c22820429d02bbbe6689d", "score": "0.45524806", "text": "function getTokenSkipNewline(state) {\n do {\n getToken(state);\n } while (state.token === '\\n'); // eslint-disable-line no-unmodified-loop-condition\n\n }", "title": "" }, { "docid": "dcd1b0b5153c22820429d02bbbe6689d", "score": "0.45524806", "text": "function getTokenSkipNewline(state) {\n do {\n getToken(state);\n } while (state.token === '\\n'); // eslint-disable-line no-unmodified-loop-condition\n\n }", "title": "" }, { "docid": "dcd1b0b5153c22820429d02bbbe6689d", "score": "0.45524806", "text": "function getTokenSkipNewline(state) {\n do {\n getToken(state);\n } while (state.token === '\\n'); // eslint-disable-line no-unmodified-loop-condition\n\n }", "title": "" }, { "docid": "dcd1b0b5153c22820429d02bbbe6689d", "score": "0.45524806", "text": "function getTokenSkipNewline(state) {\n do {\n getToken(state);\n } while (state.token === '\\n'); // eslint-disable-line no-unmodified-loop-condition\n\n }", "title": "" }, { "docid": "44fabe802a4e364f44cb2586077440fd", "score": "0.45516762", "text": "function skip_sep(curr, next, save){\n var count = 0;\n var ch = curr();\n if (ch != '[' && ch != ']'){\n throw \"Lexical internal error!\";\n }\n if (save){\n save(ch);\n }\n next()\n while (curr() == '='){\n next();\n if (save){\n save(curr());\n }\n ++count;\n }\n return curr() == ch ? count : (-count - 1);\n}", "title": "" }, { "docid": "2b6a5a924430687caf0e1570aa2a18df", "score": "0.45449007", "text": "function answerIsBranched(answer) {\n return _.trim(answer).indexOf(';') >= 0;\n}", "title": "" }, { "docid": "f2fca17441bf58d9e240201c45de72fd", "score": "0.45340103", "text": "function isPlainSafe(c, prev) {\n // Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"\n // where nb-char ::= c-printable - b-char - c-byte-order-mark.\n return isPrintable(c) && c !== 0xFEFF\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // - \":\" - \"#\"\n // /* An ns-char preceding */ \"#\"\n && c !== CHAR_COLON\n && ((c !== CHAR_SHARP) || (prev && isNsChar(prev)));\n }", "title": "" }, { "docid": "536af5bcd6dfa44d23e436b5630744c3", "score": "0.4527611", "text": "antiMove(expectedNextMove) {\r\n switch(expectedNextMove) {\r\n case('R'): return 'P';\r\n case('P'): return 'S';\r\n case('S'): return 'R';\r\n }\r\n }", "title": "" }, { "docid": "2de1be67e121541312f8505eb4569504", "score": "0.4524062", "text": "function checkOpAndSkip(op) {\n if (is_op(op)) input.next();\n else input.croak(\"Expecting operator: \\\"\" + op + \"\\\"\");\n }", "title": "" }, { "docid": "23fa5350bdf3370bb00ea23196e4c059", "score": "0.45191303", "text": "function skipCommentLine(state) {\n while (state.position < state.length) {\n var c = state.data.charCodeAt(state.position);\n if (c === 10 || c === 13) {\n return;\n }\n ++state.position;\n }\n}", "title": "" } ]
bada1bc5036dbfa5fd64ee3d73b7e34e
Enable the wikipathwayspvjs custom element
[ { "docid": "7a559b3a872f8737062fcf7601cc8601", "score": "0.68406606", "text": "function registerWikiPathwaysPvjsElement(Pvjs) {\n 'use strict';\n\n var DivPrototype = Object.create(window.HTMLDivElement.prototype);\n\n DivPrototype.attributeChangedCallback = function(\n attrName, oldValue, newValue) {\n if (attrName === 'alt') {\n this.textContent = newValue;\n }\n };\n\n var WikiPathwaysPvjsPrototype = Object.create(DivPrototype);\n\n WikiPathwaysPvjsPrototype.createdCallback = function() {\n var vm = this;\n var args = {};\n\n var alt = args.alt = vm.getAttribute('alt');\n if (!!alt) {\n vm.attributeChangedCallback('alt', null, alt);\n }\n\n var displayErrors = args.displayErrors =\n Boolean(vm.getAttribute('display-errors'));\n vm.attributeChangedCallback('display-errors', null, displayErrors);\n\n var displayWarnings = args.displayWarnings =\n Boolean(vm.getAttribute('display-warnings'));\n vm.attributeChangedCallback('display-warnings', null, displayWarnings);\n\n var displaySuccess = args.displaySuccess =\n Boolean(vm.getAttribute('display-success'));\n vm.attributeChangedCallback('display-success', null, displaySuccess);\n\n var fitToContainer = args.fitToContainer =\n Boolean(vm.getAttribute('fit-to-container'));\n vm.attributeChangedCallback('fit-to-container', null, fitToContainer);\n\n var highlights = vm.getAttribute('highlights');\n if (!!highlights) {\n highlights = args.highlights = JSON.parse(decodeURIComponent(highlights));\n vm.attributeChangedCallback('highlights', null, highlights);\n }\n\n var hashEditorStateComponents = window.location.hash.match('editor\\/(.*)$');\n var hashEditorState;\n if (!!hashEditorStateComponents && !!hashEditorStateComponents.length) {\n hashEditorState = hashEditorStateComponents[1];\n }\n var editor = args.editor = hashEditorState ||\n vm.getAttribute('editor');\n if (!!editor) {\n vm.attributeChangedCallback('editor', null, editor);\n }\n\n var resource = args.resource = vm.getAttribute('resource');\n if (!!resource) {\n vm.attributeChangedCallback('resource', null, resource);\n }\n\n var version = args.version = parseFloat(vm.getAttribute('version'));\n if (!!version) {\n vm.attributeChangedCallback('version', null, version);\n }\n\n /* TODO should this be enabled? It doesn't seem needed for the web-component.\n var manualRender = args.manualRender =\n Boolean(vm.getAttribute('manual-render'));\n if (!!manualRender) {\n vm.attributeChangedCallback('manual-render', null, manualRender);\n }\n //*/\n\n var src = vm.getAttribute('src');\n if (!!src) {\n vm.attributeChangedCallback('src', null, src);\n }\n args.sourceData = [\n {\n uri: src,\n // TODO we should be able to use the content type\n // header from the server response instead of relying\n // on this.\n // Think analogous to image/png, image/gif, etc. for the img tag.\n fileType:'gpml' // generally will correspond to filename extension\n }\n ];\n\n vm.innerHTML = '';\n\n var pvjs = new Pvjs(vm, args);\n };\n\n // Public: WikiPathwaysPvjsPrototype constructor.\n //\n // # => <wikipathways-pvjs></wikipathways-pvjs>\n //\n window.WikiPathwaysPvjs = document.registerElement(\n 'wikipathways-pvjs', {\n prototype: WikiPathwaysPvjsPrototype\n });\n }", "title": "" } ]
[ { "docid": "5d24f9d7ce6aca35ce243056a6a88da8", "score": "0.6006504", "text": "enable() {\n this.enabled_ = true;\n this.removeClass('vjs-disabled');\n\n this.menuButton_.enable();\n }", "title": "" }, { "docid": "1688515638984721de45c82adb35dbc1", "score": "0.59339607", "text": "function videoOnOff(){\n const enabled = myVideoStream.getVideoTracks()[0].enabled\n if (enabled) {\n myVideoStream.getVideoTracks()[0].enabled = false\n unsetVideoButton()\n } else {\n myVideoStream.getVideoTracks()[0].enabled = true\n setVideoButton()\n }\n}", "title": "" }, { "docid": "57f46e58dd495215875d9fa8123ca5fe", "score": "0.5783275", "text": "showVideo() {\n document.getElementById(this.props.ownStreamContainerId).appendChild(this.pixiApp.view);\n }", "title": "" }, { "docid": "db4bb2cd6503202910707b8e36e8aa87", "score": "0.57664615", "text": "function startVideo(elem){\n\t var url = $(\"#\"+elem.id).children(\"source\").attr(\"src\");\n\t player.startup();\n\t player.attachView(document.querySelector(\"#\"+elem.id));\n\t player.setAutoPlay(false);\n\t player.attachSource(url);\n}", "title": "" }, { "docid": "3b6d3549ed9c0921323b99c7448e6bcc", "score": "0.5710975", "text": "sliderActive_() {\n this.addClass('vjs-slider-active');\n }", "title": "" }, { "docid": "b7b39ce737959d36c53aacf3b0c3f7aa", "score": "0.56786025", "text": "function onPlayerReady(event) {\n //event.target.playVideo();\n}", "title": "" }, { "docid": "9b9f14321741463caa45dc69c0e40f8e", "score": "0.56664526", "text": "function onPlayerReady(event) {\n //event.target.playVideo();\n}", "title": "" }, { "docid": "1afe1a28d5d0bac7e46eab99579cfdef", "score": "0.56664175", "text": "function MoonshinePluginPlayerWmpControls (moonshine_player) {\n this.MoonshinePlayer = moonshine_player;\n}", "title": "" }, { "docid": "7249aa3858677368900ca6becbab1bfd", "score": "0.56513816", "text": "function onPlayerReady(event) {\n //event.target.playVideo();\n}", "title": "" }, { "docid": "f1d620a520a3ae94050207b84ba69bde", "score": "0.56284344", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n //event.target.pauseVideo();\n var playPauseBtn = document.getElementById(\"playPauseBtn\");\n console.log(playPauseBtn.children[0]);\n playPauseBtn.children[0].className = \"glyphicon glyphicon-play\";\n var $ = document.querySelector.bind(document);\n iframe = $('#player');\n}", "title": "" }, { "docid": "75e5bbf05dafca5b590473e587cde3c0", "score": "0.5604777", "text": "function addVideoControls() {\n const controls = document.createAttribute(\"controls\");\n const video = lightBoxContainer.querySelector(\"video\");\n\n if (video) {\n video.setAttributeNode(controls);\n }\n}", "title": "" }, { "docid": "b2aa4ac762323129d7461f3671d15893", "score": "0.55997425", "text": "function pano2vrSkin(player,base) {\n\tplayer.addVariable('ht_ani', 2, false);\n\tplayer.addVariable('open_tag', 0, \"\");\n\tplayer.addVariable('close_nodes', 2, false);\n\tplayer.addVariable('category_visible', 2, false);\n\tplayer.addVariable('category_follow', 2, false);\n\tplayer.addVariable('opt_thumbnail_menu_tooltip', 2, true);\n\tplayer.addVariable('vis_thumbnail_menu', 2, true);\n\tplayer.addVariable('vis_loader', 2, true);\n\tplayer.addVariable('vis_video_file', 2, false);\n\tplayer.addVariable('vis_info_popup', 2, false);\n\tplayer.addVariable('vis_video_youtube', 2, false);\n\tplayer.addVariable('vis_website', 2, false);\n\tplayer.addVariable('opt_url', 2, false);\n\tvar me=this;\n\tvar skin=this;\n\tvar flag=false;\n\tvar hotspotTemplates={};\n\tvar skinKeyPressed = 0;\n\tthis.player=player;\n\tthis.player.skinObj=this;\n\tthis.divSkin=player.divSkin;\n\tthis.ggUserdata=player.userdata;\n\tthis.lastSize={ w: -1,h: -1 };\n\tvar basePath=\"\";\n\t// auto detect base path\n\tif (base=='?') {\n\t\tvar scripts = document.getElementsByTagName('script');\n\t\tfor(var i=0;i<scripts.length;i++) {\n\t\t\tvar src=scripts[i].src;\n\t\t\tif (src.indexOf('skin.js')>=0) {\n\t\t\t\tvar p=src.lastIndexOf('/');\n\t\t\t\tif (p>=0) {\n\t\t\t\t\tbasePath=src.substr(0,p+1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else\n\tif (base) {\n\t\tbasePath=base;\n\t}\n\tthis.elementMouseDown=[];\n\tthis.elementMouseOver=[];\n\tvar cssPrefix='';\n\tvar domTransition='transition';\n\tvar domTransform='transform';\n\tvar prefixes='Webkit,Moz,O,ms,Ms'.split(',');\n\tvar i;\n\tvar hs,el,els,elo,ela,elHorScrollFg,elHorScrollBg,elVertScrollFg,elVertScrollBg,elCornerBg;\n\tif (typeof document.body.style['transform'] == 'undefined') {\n\t\tfor(var i=0;i<prefixes.length;i++) {\n\t\t\tif (typeof document.body.style[prefixes[i] + 'Transform'] !== 'undefined') {\n\t\t\t\tcssPrefix='-' + prefixes[i].toLowerCase() + '-';\n\t\t\t\tdomTransition=prefixes[i] + 'Transition';\n\t\t\t\tdomTransform=prefixes[i] + 'Transform';\n\t\t\t}\n\t\t}\n\t}\n\t\n\tplayer.setMargins(0,0,0,0);\n\t\n\tthis.updateSize=function(startElement) {\n\t\tvar stack=[];\n\t\tstack.push(startElement);\n\t\twhile(stack.length>0) {\n\t\t\tvar e=stack.pop();\n\t\t\tif (e.ggUpdatePosition) {\n\t\t\t\te.ggUpdatePosition();\n\t\t\t}\n\t\t\tif (e.hasChildNodes()) {\n\t\t\t\tfor(var i=0;i<e.childNodes.length;i++) {\n\t\t\t\t\tstack.push(e.childNodes[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\tthis.callNodeChange=function(startElement) {\n\t\tvar stack=[];\n\t\tstack.push(startElement);\n\t\twhile(stack.length>0) {\n\t\t\tvar e=stack.pop();\n\t\t\tif (e.ggNodeChange) {\n\t\t\t\te.ggNodeChange();\n\t\t\t}\n\t\t\tif (e.hasChildNodes()) {\n\t\t\t\tfor(var i=0;i<e.childNodes.length;i++) {\n\t\t\t\t\tstack.push(e.childNodes[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tplayer.addListener('changenode', function() { me.ggUserdata=player.userdata; me.callNodeChange(me.divSkin); });\n\t\n\tvar parameterToTransform=function(p) {\n\t\tvar hs='translate(' + p.rx + 'px,' + p.ry + 'px) rotate(' + p.a + 'deg) scale(' + p.sx + ',' + p.sy + ')';\n\t\treturn hs;\n\t}\n\t\n\tthis.findElements=function(id,regex) {\n\t\tvar r=[];\n\t\tvar stack=[];\n\t\tvar pat=new RegExp(id,'');\n\t\tstack.push(me.divSkin);\n\t\twhile(stack.length>0) {\n\t\t\tvar e=stack.pop();\n\t\t\tif (regex) {\n\t\t\t\tif (pat.test(e.ggId)) r.push(e);\n\t\t\t} else {\n\t\t\t\tif (e.ggId==id) r.push(e);\n\t\t\t}\n\t\t\tif (e.hasChildNodes()) {\n\t\t\t\tfor(var i=0;i<e.childNodes.length;i++) {\n\t\t\t\t\tstack.push(e.childNodes[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn r;\n\t}\n\t\n\tthis.addSkin=function() {\n\t\tvar hs='';\n\t\tthis.ggCurrentTime=new Date().getTime();\n\t\tel=me._ht_node_timer=document.createElement('div');\n\t\tel.ggTimestamp=this.ggCurrentTime;\n\t\tel.ggLastIsActive=true;\n\t\tel.ggTimeout=500;\n\t\tel.ggId=\"ht_node_timer\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_timer \";\n\t\tel.ggType='timer';\n\t\ths ='';\n\t\ths+='height : 32px;';\n\t\ths+='left : 62px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 23px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 32px;';\n\t\ths+='pointer-events:none;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_node_timer.ggIsActive=function() {\n\t\t\treturn (me._ht_node_timer.ggTimestamp==0 ? false : (Math.floor((me.ggCurrentTime - me._ht_node_timer.ggTimestamp) / me._ht_node_timer.ggTimeout) % 2 == 0));\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._ht_node_timer.ggActivate=function () {\n\t\t\tplayer.setVariableValue('ht_ani', true);\n\t\t}\n\t\tme._ht_node_timer.ggDeactivate=function () {\n\t\t\tplayer.setVariableValue('ht_ani', false);\n\t\t}\n\t\tme._ht_node_timer.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme.divSkin.appendChild(me._ht_node_timer);\n\t\tel=me._menu_background=document.createElement('div');\n\t\tel.ggId=\"menu_background\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_rectangle \";\n\t\tel.ggType='rectangle';\n\t\ths ='';\n\t\ths+='background : rgba(0,0,0,0.501961);';\n\t\ths+='border : 1px solid #000000;';\n\t\ths+='cursor : default;';\n\t\ths+='height : 100%;';\n\t\ths+='left : 0px;';\n\t\ths+='opacity : 0;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 0px;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 178px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._menu_background.ggIsActive=function() {\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._menu_background.logicBlock_alpha = function() {\n\t\t\tvar newLogicStateAlpha;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('vis_thumbnail_menu') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateAlpha = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateAlpha = -1;\n\t\t\t}\n\t\t\tif (me._menu_background.ggCurrentLogicStateAlpha != newLogicStateAlpha) {\n\t\t\t\tme._menu_background.ggCurrentLogicStateAlpha = newLogicStateAlpha;\n\t\t\t\tme._menu_background.style[domTransition]='opacity 500ms ease 0ms';\n\t\t\t\tif (me._menu_background.ggCurrentLogicStateAlpha == 0) {\n\t\t\t\t\tme._menu_background.style.visibility=me._menu_background.ggVisible?'inherit':'hidden';\n\t\t\t\t\tme._menu_background.style.opacity=1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tsetTimeout(function() { if (me._menu_background.style.opacity == 0.0) { me._menu_background.style.visibility=\"hidden\"; } }, 505);\n\t\t\t\t\tme._menu_background.style.opacity=0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._menu_background.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._node_scroller=document.createElement('div');\n\t\tels=me._node_scroller__content=document.createElement('div');\n\t\tels.className='ggskin ggskin_subelement ggskin_scrollarea';\n\t\tel.ggContent=els;\n\t\tel.appendChild(els);\n\t\tel.ggHorScrollVisible = false;\n\t\tel.ggVertScrollVisible = false;\n\t\tel.ggContentLeftOffset = 0;\n\t\tel.ggContentTopOffset = 0;\n\t\tel.ggDragInertiaX = 0;\n\t\tel.ggDragInertiaY = 0;\n\t\tel.ggVPercentVisible = 1.0;\n\t\tel.ggHPercentVisible = 1.0;\n\t\ths ='';\n\t\ths+='height : 99px;';\n\t\ths+='left : 0px;';\n\t\ths+='overflow : visible;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 0px;';\n\t\ths+='width : 149.5px;';\n\t\ths+=\"\";\n\t\tels.setAttribute('style',hs);\n\t\tme._node_scroller.ggScrollByX = function(diffX) {\n\t\t\tif(!me._node_scroller.ggHorScrollVisible || diffX == 0 || me._node_scroller.ggHPercentVisible >= 1.0) return;\n\t\t\tme._node_scroller.ggScrollPosX = (me._node_scroller__horScrollFg.offsetLeft + diffX);\n\t\t\tme._node_scroller.ggScrollPosX = Math.max(me._node_scroller.ggScrollPosX, 0);\n\t\t\tme._node_scroller.ggScrollPosX = Math.min(me._node_scroller.ggScrollPosX, me._node_scroller__horScrollBg.offsetWidth - me._node_scroller__horScrollFg.offsetWidth);\n\t\t\tme._node_scroller__horScrollFg.style.left = me._node_scroller.ggScrollPosX + 'px';\n\t\t\tme._node_scroller__content.style.left = -(Math.round(me._node_scroller.ggScrollPosX / me._node_scroller.ggHPercentVisible)) + me._node_scroller.ggContentLeftOffset + 'px';\n\t\t\tme._node_scroller.ggScrollPosXPercent = (me._node_scroller__horScrollFg.offsetLeft / me._node_scroller__horScrollBg.offsetWidth);\n\t\t}\n\t\tme._node_scroller.ggScrollByXSmooth = function(diffX) {\n\t\t\tif(!me._node_scroller.ggHorScrollVisible || diffX == 0 || me._node_scroller.ggHPercentVisible >= 1.0) return;\n\t\t\tvar scrollPerInterval = diffX / 25;\n\t\t\tvar scrollCurrX = 0;\n\t\t\tvar id = setInterval(function() {\n\t\t\t\tscrollCurrX += scrollPerInterval;\n\t\t\t\tme._node_scroller.ggScrollPosX += scrollPerInterval;\n\t\t\t\tif (diffX > 0 && (scrollCurrX >= diffX || me._node_scroller.ggScrollPosX >= me._node_scroller__horScrollBg.offsetWidth - me._node_scroller__horScrollFg.offsetWidth)) {\n\t\t\t\t\tme._node_scroller.ggScrollPosX = Math.min(me._node_scroller.ggScrollPosX, me._node_scroller__horScrollBg.offsetWidth - me._node_scroller__horScrollFg.offsetWidth);\n\t\t\t\t\tclearInterval(id);\n\t\t\t\t}\n\t\t\t\tif (diffX < 0 && (scrollCurrX <= diffX || me._node_scroller.ggScrollPosX <= 0)) {\n\t\t\t\t\tme._node_scroller.ggScrollPosX = Math.max(me._node_scroller.ggScrollPosX, 0);\n\t\t\t\t\tclearInterval(id);\n\t\t\t\t}\n\t\t\tme._node_scroller__horScrollFg.style.left = me._node_scroller.ggScrollPosX + 'px';\n\t\t\tme._node_scroller__content.style.left = -(Math.round(me._node_scroller.ggScrollPosX / me._node_scroller.ggHPercentVisible)) + me._node_scroller.ggContentLeftOffset + 'px';\n\t\t\tme._node_scroller.ggScrollPosXPercent = (me._node_scroller__horScrollFg.offsetLeft / me._node_scroller__horScrollBg.offsetWidth);\n\t\t\t}, 10);\n\t\t}\n\t\tme._node_scroller.ggScrollByY = function(diffY) {\n\t\t\tif(!me._node_scroller.ggVertScrollVisible || diffY == 0 || me._node_scroller.ggVPercentVisible >= 1.0) return;\n\t\t\tme._node_scroller.ggScrollPosY = (me._node_scroller__vertScrollFg.offsetTop + diffY);\n\t\t\tme._node_scroller.ggScrollPosY = Math.max(me._node_scroller.ggScrollPosY, 0);\n\t\t\tme._node_scroller.ggScrollPosY = Math.min(me._node_scroller.ggScrollPosY, me._node_scroller__vertScrollBg.offsetHeight - me._node_scroller__vertScrollFg.offsetHeight);\n\t\t\tme._node_scroller__vertScrollFg.style.top = me._node_scroller.ggScrollPosY + 'px';\n\t\t\tme._node_scroller__content.style.top = -(Math.round(me._node_scroller.ggScrollPosY / me._node_scroller.ggVPercentVisible)) + me._node_scroller.ggContentTopOffset + 'px';\n\t\t\tme._node_scroller.ggScrollPosYPercent = (me._node_scroller__vertScrollFg.offsetTop / me._node_scroller__vertScrollBg.offsetHeight);\n\t\t}\n\t\tme._node_scroller.ggScrollByYSmooth = function(diffY) {\n\t\t\tif(!me._node_scroller.ggVertScrollVisible || diffY == 0 || me._node_scroller.ggVPercentVisible >= 1.0) return;\n\t\t\tvar scrollPerInterval = diffY / 25;\n\t\t\tvar scrollCurrY = 0;\n\t\t\tvar id = setInterval(function() {\n\t\t\t\tscrollCurrY += scrollPerInterval;\n\t\t\t\tme._node_scroller.ggScrollPosY += scrollPerInterval;\n\t\t\t\tif (diffY > 0 && (scrollCurrY >= diffY || me._node_scroller.ggScrollPosY >= me._node_scroller__vertScrollBg.offsetHeight - me._node_scroller__vertScrollFg.offsetHeight)) {\n\t\t\t\t\tme._node_scroller.ggScrollPosY = Math.min(me._node_scroller.ggScrollPosY, me._node_scroller__vertScrollBg.offsetHeight - me._node_scroller__vertScrollFg.offsetHeight);\n\t\t\t\t\tclearInterval(id);\n\t\t\t\t}\n\t\t\t\tif (diffY < 0 && (scrollCurrY <= diffY || me._node_scroller.ggScrollPosY <= 0)) {\n\t\t\t\t\tme._node_scroller.ggScrollPosY = Math.max(me._node_scroller.ggScrollPosY, 0);\n\t\t\t\t\tclearInterval(id);\n\t\t\t\t}\n\t\t\tme._node_scroller__vertScrollFg.style.top = me._node_scroller.ggScrollPosY + 'px';\n\t\t\tme._node_scroller__content.style.top = -(Math.round(me._node_scroller.ggScrollPosY / me._node_scroller.ggVPercentVisible)) + me._node_scroller.ggContentTopOffset + 'px';\n\t\t\tme._node_scroller.ggScrollPosYPercent = (me._node_scroller__vertScrollFg.offsetTop / me._node_scroller__vertScrollBg.offsetHeight);\n\t\t\t}, 10);\n\t\t}\n\t\tme._node_scroller.ggScrollIntoView = function(posX, posY, width, height) {\n\t\t\tif (me._node_scroller.ggHorScrollVisible) {\n\t\t\t\tif (posX < 0) {\n\t\t\t\t\tvar diffX = Math.floor(posX * me._node_scroller.ggHPercentVisible);\n\t\t\t\t\tme._node_scroller.ggScrollByXSmooth(diffX);\n\t\t\t\t} else if (posX + width > me._node_scroller.offsetWidth - (me._node_scroller.ggVertScrollVisible ? 15 : 0)) {\n\t\t\t\t\tvar diffX = Math.ceil(((posX + width) - (me._node_scroller.offsetWidth - (me._node_scroller.ggVertScrollVisible ? 15 : 0))) * me._node_scroller.ggHPercentVisible);\n\t\t\t\t\tme._node_scroller.ggScrollByXSmooth(diffX);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (me._node_scroller.ggVertScrollVisible) {\n\t\t\t\tif (posY < 0) {\n\t\t\t\t\tvar diffY = Math.floor(posY * me._node_scroller.ggVPercentVisible);\n\t\t\t\t\tme._node_scroller.ggScrollByYSmooth(diffY);\n\t\t\t\t} else if (posY + height > me._node_scroller.offsetHeight - (me._node_scroller.ggHorScrollVisible ? 15 : 0)) {\n\t\t\t\t\tvar diffY = Math.ceil(((posY + height) - (me._node_scroller.offsetHeight - (me._node_scroller.ggHorScrollVisible ? 15 : 0))) * me._node_scroller.ggVPercentVisible);\n\t\t\t\t\tme._node_scroller.ggScrollByYSmooth(diffY);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tels.ontouchstart = function(e) {\n\t\t\te = e || window.event;\n\t\t\tvar t = e.touches;\n\t\t\tme._node_scroller.ggDragLastX = t ? t[0].clientX : e.clientX;\n\t\t\tme._node_scroller.ggDragLastY = t ? t[0].clientY : e.clientY;\n\t\t\tme._node_scroller__content.ontouchend = function() {\n\t\t\t\tlet inertiaInterval = setInterval(function() {\n\t\t\t\t\tme._node_scroller.ggDragInertiaX *= 0.65;\n\t\t\t\t\tme._node_scroller.ggDragInertiaY *= 0.65;\n\t\t\t\t\tme._node_scroller.ggScrollByX(me._node_scroller.ggDragInertiaX);\n\t\t\t\t\tme._node_scroller.ggScrollByY(me._node_scroller.ggDragInertiaY);\n\t\t\t\t\tif (Math.abs(me._node_scroller.ggDragInertiaX) < 1.0 && Math.abs(me._node_scroller.ggDragInertiaY) < 1.0) {\n\t\t\t\t\t\tclearInterval(inertiaInterval);\n\t\t\t\t\t}\n\t\t\t\t\t}, 50);\n\t\t\t\tme._node_scroller__content.ontouchend = null;\n\t\t\t\tme._node_scroller__content.ontouchmove = null;\n\t\t\t\tme._node_scroller__content.onpointerup = null;\n\t\t\t\tme._node_scroller__content.onpointermove = null;\n\t\t\t}\n\t\tif (player.getOS() == 1 && navigator.maxTouchPoints > 0) {\n\t\t\tme._node_scroller__content.onpointerup = me._node_scroller__content.ontouchend;\n\t\t}\n\t\t\tme._node_scroller__content.ontouchmove = function(e) {\n\t\t\t\te = e || window.event;\n\t\t\t\te.preventDefault();\n\t\t\t\tvar t = e.touches;\n\t\t\t\tvar diffX = ((t ? t[0].clientX : e.clientX) - me._node_scroller.ggDragLastX) * me._node_scroller.ggHPercentVisible;\n\t\t\t\tvar diffY = ((t ? t[0].clientY : e.clientY) - me._node_scroller.ggDragLastY) * me._node_scroller.ggVPercentVisible;\n\t\t\t\tme._node_scroller.ggDragInertiaX = -diffX;\n\t\t\t\tme._node_scroller.ggDragInertiaY = -diffY;\n\t\t\t\tme._node_scroller.ggDragLastX = t ? t[0].clientX : e.clientX;\n\t\t\t\tme._node_scroller.ggDragLastY = t ? t[0].clientY : e.clientY;\n\t\t\t\tme._node_scroller.ggScrollByX(-diffX);\n\t\t\t\tme._node_scroller.ggScrollByY(-diffY);\n\t\t\t}\n\t\t\tif (player.getOS() == 1 && navigator.maxTouchPoints > 0) {\n\t\t\t\tme._node_scroller__content.onpointermove = me._node_scroller__content.ontouchmove;\n\t\t\t}\n\t\t}\n\t\tif (player.getOS() == 1 && navigator.maxTouchPoints > 0) {\n\t\t\tels.onpointerdown = els.ontouchstart;\n\t\t}\n\t\telVertScrollBg = me._node_scroller__vertScrollBg = document.createElement('div');\n\t\tel.appendChild(elVertScrollBg);\n\t\telVertScrollBg.setAttribute('style', 'position: absolute; right: 0px; top: 0px; visibility: hidden; width: 15px; height: 350px; background-color: rgba(0,0,0,0.12549); pointer-events: auto;');\n\t\telVertScrollBg.className='ggskin ggskin_scrollarea_vscrollbg';\n\t\telVertScrollFg = me._node_scroller__vertScrollFg = document.createElement('div');\n\t\telVertScrollBg.appendChild(elVertScrollFg);\n\t\telVertScrollFg.setAttribute('style', 'position: absolute; left: 0px; top: 0px; visibility: hidden; width: 15px; height: 350px; background-color: rgba(255,255,255,0.25098); pointer-events: auto;');\n\t\telVertScrollFg.className='ggskin ggskin_scrollarea_vscrollfg';\n\t\tme._node_scroller.ggScrollPosY = 0;\n\t\tme._node_scroller.ggScrollPosYPercent = 0.0;\n\t\telVertScrollFg.onmousedown = function(e) {\n\t\t\tif (player.getOS() == 1 && navigator.maxTouchPoints > 0) return;\n\t\t\te = e || window.event;\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tme._node_scroller.ggDragLastY = e.clientY;\n\t\t\tdocument.onmouseup = function() {\n\t\t\t\tlet inertiaInterval = setInterval(function() {\n\t\t\t\t\tme._node_scroller.ggDragInertiaY *= 0.65;\n\t\t\t\t\tme._node_scroller.ggScrollByY(me._node_scroller.ggDragInertiaY);\n\t\t\t\t\tif (Math.abs(me._node_scroller.ggDragInertiaY) < 1.0) {\n\t\t\t\t\t\tclearInterval(inertiaInterval);\n\t\t\t\t\t}\n\t\t\t\t\t}, 50);\n\t\t\t\tdocument.onmouseup = null;\n\t\t\t\tdocument.onmousemove = null;\n\t\t\t}\n\t\t\tdocument.onmousemove = function(e) {\n\t\t\t\te = e || window.event;\n\t\t\t\te.preventDefault();\n\t\t\t\tvar diffY = e.clientY - me._node_scroller.ggDragLastY;\n\t\t\t\tme._node_scroller.ggDragInertiaY = diffY;\n\t\t\t\tme._node_scroller.ggDragLastY = e.clientY;\n\t\t\t\tme._node_scroller.ggScrollByY(diffY);\n\t\t\t}\n\t\t}\n\t\telVertScrollFg.ontouchstart = function(e) {\n\t\t\te = e || window.event;\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tvar t = e.touches;\n\t\t\tme._node_scroller.ggDragLastY = t ? t[0].clientY : e.clientY;\n\t\t\tdocument.ontouchend = function() {\n\t\t\t\tlet inertiaInterval = setInterval(function() {\n\t\t\t\t\tme._node_scroller.ggDragInertiaY *= 0.65;\n\t\t\t\t\tme._node_scroller.ggScrollByY(me._node_scroller.ggDragInertiaY);\n\t\t\t\t\tif (Math.abs(me._node_scroller.ggDragInertiaY) < 1.0) {\n\t\t\t\t\t\tclearInterval(inertiaInterval);\n\t\t\t\t\t}\n\t\t\t\t\t}, 50);\n\t\t\t\tdocument.ontouchend = null;\n\t\t\t\tdocument.ontouchmove = null;\n\t\t\t\tdocument.onpointerup = null;\n\t\t\t\tdocument.onpointermove = null;\n\t\t\t}\n\t\t\tif (player.getOS() == 1 && navigator.maxTouchPoints > 0) {\n\t\t\t\tdocument.onpointerup = document.ontouchend;\n\t\t\t}\n\t\t\tdocument.ontouchmove = function(e) {\n\t\t\t\te = e || window.event;\n\t\t\t\te.preventDefault();\n\t\t\t\tvar t = e.touches;\n\t\t\t\tvar diffY = (t ? t[0].clientY : e.clientY) - me._node_scroller.ggDragLastY;\n\t\t\t\tme._node_scroller.ggDragInertiaY = diffY;\n\t\t\t\tme._node_scroller.ggDragLastY = t ? t[0].clientY : e.clientY;\n\t\t\t\tme._node_scroller.ggScrollByY(diffY);\n\t\t\t}\n\t\t\tif (player.getOS() == 1 && navigator.maxTouchPoints > 0) {\n\t\t\t\tdocument.onpointermove = document.ontouchmove;\n\t\t\t}\n\t\t}\n\t\tif (player.getOS() == 1 && navigator.maxTouchPoints > 0) {\n\t\t\telVertScrollFg.onpointerdown = elVertScrollFg.ontouchstart;\n\t\t}\n\t\telVertScrollBg.onmousedown = function(e) {\n\t\t\te = e || window.event;\n\t\t\te.preventDefault();\n\t\t\tvar diffY = me._node_scroller.ggScrollHeight;\n\t\t\tif (e.offsetY < me._node_scroller.ggScrollPosY) {\n\t\t\t\tdiffY = diffY * -1;\n\t\t\t}\n\t\t\tme._node_scroller.ggScrollByYSmooth(diffY);\n\t\t}\n\t\telVertScrollBg.ontouchstart = function(e) {\n\t\t\te = e || window.event;\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tvar t = e.touches;\n\t\t\tvar rect = me._node_scroller__vertScrollBg.getBoundingClientRect();\n\t\t\tvar diffY = me._node_scroller.ggScrollHeight;\n\t\t\tif ((t[0].clientY - rect.top) < me._node_scroller.ggScrollPosY) {\n\t\t\t\tdiffY = diffY * -1;\n\t\t\t}\n\t\t\tme._node_scroller.ggScrollByYSmooth(diffY);\n\t\t}\n\t\tel.addEventListener('wheel', function(e) {\n\t\t\te.preventDefault();\n\t\t\tvar wheelDelta = Math.sign(e.deltaY);\n\t\t\tme._node_scroller.ggScrollByYSmooth(20 * wheelDelta);\n\t\t});\n\t\telCornerBg = me._node_scroller__cornerBg = document.createElement('div');\n\t\tel.appendChild(elCornerBg);\n\t\telCornerBg.setAttribute('style', 'position: absolute; right: 0px; bottom: 0px; visibility: hidden; width: 15px; height: 15px; background-color: rgba(255,255,255,1);');\n\t\telCornerBg.className='ggskin ggskin_scrollarea_scrollcorner';\n\t\tel.ggId=\"node_scroller\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_scrollarea \";\n\t\tel.ggType='scrollarea';\n\t\ths ='';\n\t\ths+='border : 1px solid rgba(0, 0, 0, 0);';\n\t\ths+='height : calc(100% - 50px);';\n\t\ths+='left : 0px;';\n\t\ths+='overflow : hidden;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 50px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 178px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._node_scroller.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._node_scroller.ggUpdatePosition=function (useTransition) {\n\t\t\t{\n\t\t\t\tvar horScrollWasVisible = this.ggHorScrollVisible;\n\t\t\t\tvar vertScrollWasVisible = this.ggVertScrollVisible;\n\t\t\t\tthis.ggContent.style.left = '0px';\n\t\t\t\tthis.ggContent.style.top = '0px';\n\t\t\t\tthis.ggContentLeftOffset = 0;\n\t\t\t\tthis.ggContentTopOffset = 0;\n\t\t\t\tvar offsetWidthWithScale = this.getBoundingClientRect().width;\n\t\t\t\tvar offsetHeightWithScale = this.getBoundingClientRect().height;\n\t\t\t\tvar domRectContent = this.ggContent.getBoundingClientRect();\n\t\t\t\tvar minX = 0;\n\t\t\t\tvar minY = 0;\n\t\t\t\tvar maxX = 0;\n\t\t\t\tvar maxY = 0;\n\t\t\t\tvar stack=[];\n\t\t\t\tstack.push(this.ggContent);\n\t\t\t\twhile(stack.length>0) {\n\t\t\t\t\tvar e=stack.pop();\n\t\t\t\t\tif (e!=this.ggContent && e.getBoundingClientRect && e.style['display']!='none') {\n\t\t\t\t\t\tvar domRectChild = e.getBoundingClientRect();\n\t\t\t\t\t\tvar diffX = domRectChild.left - domRectContent.left;\n\t\t\t\t\t\tminX = Math.min(minX, diffX);\n\t\t\t\t\t\tmaxX = Math.max(maxX, diffX + domRectChild.width);\n\t\t\t\t\t\tvar diffY = domRectChild.top - domRectContent.top;\n\t\t\t\t\t\tminY = Math.min(minY, diffY);\n\t\t\t\t\t\tmaxY = Math.max(maxY, diffY + domRectChild.height);\n\t\t\t\t\t}\n\t\t\t\t\tif (e.hasChildNodes() && e.style['display']!='none') {\n\t\t\t\t\t\tfor(var i=0;i<e.childNodes.length;i++) {\n\t\t\t\t\t\t\tstack.push(e.childNodes[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (minX < 0) this.ggContentLeftOffset = -minX;\n\t\t\t\tif (minY < 0) this.ggContentTopOffset = -minY;\n\t\t\t\tvar contentWidth = maxX - minX;\n\t\t\t\tvar contentHeight = maxY - minY;\n\t\t\t\tthis.ggContent.style.left = this.ggContentLeftOffset + 'px';\n\t\t\t\tthis.ggContent.style.top = this.ggContentTopOffset + 'px';\n\t\t\t\tthis.ggContent.style.width = contentWidth + 'px';\n\t\t\t\tthis.ggContent.style.height = contentHeight + 'px';\n\t\t\t\tthis.ggContent.style.left = this.ggContentLeftOffset + 'px';\n\t\t\t\tthis.ggContent.style.marginLeft = '0px';\n\t\t\t\tthis.ggContent.style.top = -(Math.round(me._node_scroller.ggScrollPosY / me._node_scroller.ggVPercentVisible)) + this.ggContentTopOffset + 'px';\n\t\t\t\tthis.ggContent.style.marginTop = '0px';\n\t\t\t\tif ((me._node_scroller.ggHorScrollVisible && contentHeight > this.offsetHeight - 15) || (!me._node_scroller.ggHorScrollVisible && contentHeight > this.offsetHeight)) {\n\t\t\t\t\tme._node_scroller__vertScrollBg.style.visibility = 'inherit';\n\t\t\t\t\tme._node_scroller__vertScrollFg.style.visibility = 'inherit';\n\t\t\t\t\tme._node_scroller.ggVertScrollVisible = true;\n\t\t\t\t} else {\n\t\t\t\t\tme._node_scroller__vertScrollBg.style.visibility = 'hidden';\n\t\t\t\t\tme._node_scroller__vertScrollFg.style.visibility = 'hidden';\n\t\t\t\t\tme._node_scroller.ggVertScrollVisible = false;\n\t\t\t\t}\n\t\t\t\tif(me._node_scroller.ggVertScrollVisible) {\n\t\t\t\t\tme._node_scroller.ggAvailableWidth = me._node_scroller.offsetWidth - 15;\n\t\t\t\t\tif (me._node_scroller.ggHorScrollVisible) {\n\t\t\t\t\t\tme._node_scroller.ggAvailableHeight = me._node_scroller.offsetHeight - 15;\n\t\t\t\t\t\tme._node_scroller.ggAvailableHeightWithScale = me._node_scroller.getBoundingClientRect().height - me._node_scroller__vertScrollBg.getBoundingClientRect().width;\n\t\t\t\t\t\tme._node_scroller__cornerBg.style.visibility = 'inherit';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tme._node_scroller.ggAvailableHeight = me._node_scroller.offsetHeight;\n\t\t\t\t\t\tme._node_scroller.ggAvailableHeightWithScale = me._node_scroller.getBoundingClientRect().height;\n\t\t\t\t\t\tme._node_scroller__cornerBg.style.visibility = 'hidden';\n\t\t\t\t\t}\n\t\t\t\t\tme._node_scroller__vertScrollBg.style.height = me._node_scroller.ggAvailableHeight + 'px';\n\t\t\t\t\tme._node_scroller.ggVPercentVisible = contentHeight != 0 ? me._node_scroller.ggAvailableHeightWithScale / contentHeight : 0.0;\n\t\t\t\t\tif (me._node_scroller.ggVPercentVisible > 1.0) me._node_scroller.ggVPercentVisible = 1.0;\n\t\t\t\t\tme._node_scroller.ggScrollHeight = Math.round(me._node_scroller__vertScrollBg.offsetHeight * me._node_scroller.ggVPercentVisible);\n\t\t\t\t\tme._node_scroller__vertScrollFg.style.height = me._node_scroller.ggScrollHeight + 'px';\n\t\t\t\t\tme._node_scroller.ggScrollPosY = me._node_scroller.ggScrollPosYPercent * me._node_scroller.ggAvailableHeight;\n\t\t\t\t\tme._node_scroller.ggScrollPosY = Math.min(me._node_scroller.ggScrollPosY, me._node_scroller__vertScrollBg.offsetHeight - me._node_scroller__vertScrollFg.offsetHeight);\n\t\t\t\t\tme._node_scroller__vertScrollFg.style.top = me._node_scroller.ggScrollPosY + 'px';\n\t\t\t\t\tif (me._node_scroller.ggVPercentVisible < 1.0) {\n\t\t\t\t\t\tme._node_scroller__content.style.top = -(Math.round(me._node_scroller.ggScrollPosY / me._node_scroller.ggVPercentVisible)) + this.ggContentTopOffset + 'px';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tme._node_scroller.ggAvailableWidth = me._node_scroller.offsetWidth;\n\t\t\t\t\tme._node_scroller.ggScrollPosY = 0;\n\t\t\t\t\tme._node_scroller.ggScrollPosYPercent = 0.0;\n\t\t\t\t\tme._node_scroller__content.style.top = this.ggContentTopOffset + 'px';\n\t\t\t\t\tme._node_scroller__cornerBg.style.visibility = 'hidden';\n\t\t\t\t}\n\t\t\t\tif(horScrollWasVisible != me._node_scroller.ggHorScrollVisible || vertScrollWasVisible != me._node_scroller.ggVertScrollVisible) {\n\t\t\t\t\tme.updateSize(me._node_scroller);\n\t\t\t\t\tme._node_scroller.ggUpdatePosition();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tel=me._node_cloner=document.createElement('div');\n\t\tel.ggPermeable=false;\n\t\tel.ggNumRepeat = 1;\n\t\tel.ggNumRows = 0;\n\t\tel.ggNumCols = 0;\n\t\tel.ggWidth = 140;\n\t\tel.ggHeight = 100;\n\t\tel.ggUpdating = false;\n\t\tel.ggFilter = [];\n\t\tel.ggInstances = [];\n\t\tme._node_cloner.callChildLogicBlocks_changenode = function(){\n\t\t\tif(me._node_cloner.ggInstances) {\n\t\t\t\tvar i;\n\t\t\t\tfor(i = 0; i < me._node_cloner.ggInstances.length; i++) {\n\t\t\t\t\tif (me._node_cloner.ggInstances[i]._node_title && me._node_cloner.ggInstances[i]._node_title.logicBlock_visible) {\n\t\t\t\t\t\tme._node_cloner.ggInstances[i]._node_title.logicBlock_visible();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._node_cloner.callChildLogicBlocks_mouseover = function(){\n\t\t\tif(me._node_cloner.ggInstances) {\n\t\t\t\tvar i;\n\t\t\t\tfor(i = 0; i < me._node_cloner.ggInstances.length; i++) {\n\t\t\t\t\tif (me._node_cloner.ggInstances[i]._node_visited && me._node_cloner.ggInstances[i]._node_visited.logicBlock_bordercolor) {\n\t\t\t\t\t\tme._node_cloner.ggInstances[i]._node_visited.logicBlock_bordercolor();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._node_cloner.callChildLogicBlocks_active = function(){\n\t\t\tif(me._node_cloner.ggInstances) {\n\t\t\t\tvar i;\n\t\t\t\tfor(i = 0; i < me._node_cloner.ggInstances.length; i++) {\n\t\t\t\t\tif (me._node_cloner.ggInstances[i]._node_visited && me._node_cloner.ggInstances[i]._node_visited.logicBlock_bordercolor) {\n\t\t\t\t\t\tme._node_cloner.ggInstances[i]._node_visited.logicBlock_bordercolor();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._node_cloner.callChildLogicBlocks_changevisitednodes = function(){\n\t\t\tif(me._node_cloner.ggInstances) {\n\t\t\t\tvar i;\n\t\t\t\tfor(i = 0; i < me._node_cloner.ggInstances.length; i++) {\n\t\t\t\t\tif (me._node_cloner.ggInstances[i]._node_visited && me._node_cloner.ggInstances[i]._node_visited.logicBlock_bordercolor) {\n\t\t\t\t\t\tme._node_cloner.ggInstances[i]._node_visited.logicBlock_bordercolor();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._node_cloner.callChildLogicBlocks_activehotspotchanged = function(){\n\t\t\tif(me._node_cloner.ggInstances) {\n\t\t\t\tvar i;\n\t\t\t\tfor(i = 0; i < me._node_cloner.ggInstances.length; i++) {\n\t\t\t\t\tif (me._node_cloner.ggInstances[i]._node_title && me._node_cloner.ggInstances[i]._node_title.logicBlock_visible) {\n\t\t\t\t\t\tme._node_cloner.ggInstances[i]._node_title.logicBlock_visible();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._node_cloner.callChildLogicBlocks_varchanged_opt_thumbnail_menu_tooltip = function(){\n\t\t\tif(me._node_cloner.ggInstances) {\n\t\t\t\tvar i;\n\t\t\t\tfor(i = 0; i < me._node_cloner.ggInstances.length; i++) {\n\t\t\t\t\tif (me._node_cloner.ggInstances[i]._node_title && me._node_cloner.ggInstances[i]._node_title.logicBlock_visible) {\n\t\t\t\t\t\tme._node_cloner.ggInstances[i]._node_title.logicBlock_visible();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tel.ggUpdate = function(filter) {\n\t\t\tif(me._node_cloner.ggUpdating == true) return;\n\t\t\tme._node_cloner.ggUpdating = true;\n\t\t\tvar el=me._node_cloner;\n\t\t\tvar curNumCols = 0;\n\t\t\tcurNumCols = me._node_cloner.ggNumRepeat;\n\t\t\tif (curNumCols < 1) curNumCols = 1;\n\t\t\tif (typeof filter=='object') {\n\t\t\t\tel.ggFilter = filter;\n\t\t\t} else {\n\t\t\t\tfilter = el.ggFilter;\n\t\t\t};\n\t\t\tfilter=filter.sort();\n\t\t\tif ((el.ggNumCols == curNumCols) && (el.ggInstances.length > 0) && (filter.length === el.ggCurrentFilter.length) && (filter.every(function(value, index) { return value === el.ggCurrentFilter[index] }) )) {\n\t\t\t\tme._node_cloner.ggUpdating = false;\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tel.ggNumRows = 1;\n\t\t\t\tel.ggNumCols = curNumCols;\n\t\t\t}\n\t\t\tel.ggCurrentFilter = filter;\n\t\t\tel.ggInstances = [];\n\t\t\tif (el.hasChildNodes() == true) {\n\t\t\t\twhile (el.firstChild) {\n\t\t\t\t\tel.removeChild(el.firstChild);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar tourNodes = player.getNodeIds();\n\t\t\tvar row = 0;\n\t\t\tvar column = 0;\n\t\t\tvar currentIndex = 0;\n\t\t\tfor (var i=0; i < tourNodes.length; i++) {\n\t\t\t\tvar nodeId = tourNodes[i];\n\t\t\t\tvar passed = true;\n\t\t\t\tvar nodeData = player.getNodeUserdata(nodeId);\n\t\t\t\tif (filter.length > 0) {\n\t\t\t\t\tfor (var j=0; j < filter.length; j++) {\n\t\t\t\t\t\tif (nodeData['tags'].indexOf(filter[j]) == -1) passed = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (passed) {\n\t\t\t\tvar parameter={};\n\t\t\t\tparameter.top=(row * me._node_cloner.ggHeight) + 'px';\n\t\t\t\tparameter.left=(column * me._node_cloner.ggWidth) + 'px';\n\t\t\t\tparameter.width=me._node_cloner.ggWidth + 'px';\n\t\t\t\tparameter.height=me._node_cloner.ggHeight + 'px';\n\t\t\t\tparameter.index=currentIndex;\n\t\t\t\tparameter.title=nodeData['title'];\n\t\t\t\tvar inst = new SkinCloner_node_cloner_Class(nodeId, me, el, parameter);\n\t\t\t\tcurrentIndex++;\n\t\t\t\tel.ggInstances.push(inst);\n\t\t\t\tel.appendChild(inst.__div);\n\t\t\t\tinst.__div.ggObj=inst;\n\t\t\t\tskin.updateSize(inst.__div);\n\t\t\t\tcolumn++;\n\t\t\t\tif (column >= el.ggNumCols) {\n\t\t\t\t\tcolumn = 0;\n\t\t\t\t\trow++;\n\t\t\t\t\tel.ggNumRows++;\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tme._node_cloner.callChildLogicBlocks_changenode();\n\t\t\tme._node_cloner.callChildLogicBlocks_mouseover();\n\t\t\tme._node_cloner.callChildLogicBlocks_active();\n\t\t\tme._node_cloner.callChildLogicBlocks_changevisitednodes();\n\t\t\tme._node_cloner.callChildLogicBlocks_activehotspotchanged();\n\t\t\tme._node_cloner.callChildLogicBlocks_varchanged_opt_thumbnail_menu_tooltip();\n\t\t\tme._node_cloner.ggUpdating = false;\n\t\t\tplayer.triggerEvent('clonerchanged');\n\t\t\tif (me._node_cloner.parentNode.classList.contains('ggskin_subelement') && me._node_cloner.parentNode.parentNode.classList.contains('ggskin_scrollarea')) me._node_cloner.parentNode.parentNode.ggUpdatePosition();\n\t\t}\n\t\tel.ggFilter = [];\n\t\tel.ggId=\"node_cloner\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_cloner \";\n\t\tel.ggType='cloner';\n\t\ths ='';\n\t\ths+='height : 100px;';\n\t\ths+='left : 10px;';\n\t\ths+='overflow : visible;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 0px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 140px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._node_cloner.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._node_cloner.ggUpdateConditionNodeChange=function () {\n\t\t\tvar cnode=player.getCurrentNode();\n\t\t\tfor(var i=0; i<me._node_cloner.childNodes.length; i++) {\n\t\t\t\tvar child=me._node_cloner.childNodes[i];\n\t\t\t\tif (child.ggObj && child.ggObj.ggNodeId==cnode) {\n\t\t\t var childOffX = child.offsetLeft;\n\t\t\t var childOffY = child.offsetTop;\n\t\t\t\t\tvar p = child.parentElement;\n\t\t\t while (p != null && p!==this.divSkin) {\n\t\t\t\t\t\tif (p.ggType && p.ggType == 'scrollarea') {\n\t\t\t\t\t\t\tp.ggScrollIntoView(childOffX, childOffY, child.clientWidth, child.clientHeight);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tchildOffX += p.offsetLeft;\n\t\t\t\t\t\tchildOffY += p.offsetTop;\n\t\t\t\t\t\tp = p.parentElement;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._node_cloner.ggUpdatePosition=function (useTransition) {\n\t\t\t\tme._node_cloner.ggUpdate();\n\t\t}\n\t\tme._node_cloner.ggNodeChange=function () {\n\t\t\tme._node_cloner.ggUpdateConditionNodeChange();\n\t\t}\n\t\tme._node_scroller__content.appendChild(me._node_cloner);\n\t\tme._menu_background.appendChild(me._node_scroller);\n\t\tme.divSkin.appendChild(me._menu_background);\n\t\tel=me._menu_open=document.createElement('div');\n\t\tels=me._menu_open__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJz8+CjwhRE9DVFlQRSBzdmcgUFVCTElDICctLy9XM0MvL0RURCBTVkcgMS4xLy9FTicgJ2h0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCc+CjxzdmcgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgdmVyc2lvbj0iMS4xIiBmaWxsPSIjZmZmZmZmIiBpZD0iTGF5ZXJfMSIgZmlsbC1vcGFjaXR5PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiB2aWV3Qm94PSIwIDAgMzIgMzIiIG'+\n\t\t\t'hlaWdodD0iMzJweCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiA8cGF0aCBkPSJNNCwxMGgyNGMxLjEwNCwwLDItMC44OTYsMi0ycy0wLjg5Ni0yLTItMkg0QzIuODk2LDYsMiw2Ljg5NiwyLDhTMi44OTYsMTAsNCwxMHogTTI4LDE0SDRjLTEuMTA0LDAtMiwwLjg5Ni0yLDIgIHMwLjg5NiwyLDIsMmgyNGMxLjEwNCwwLDItMC44OTYsMi0yUzI5LjEwNCwxNCwyOCwxNHogTTI4LDIySDRjLTEuMTA0LDAtMiwwLjg5Ni0yLDJzMC44OTYsMiwyLDJoMjRjMS4xMDQsMCwyLTAuODk2LDItMiAgUzI5LjEwNCwyMiwyOCwyMnoiLz4KPC9zdmc+Cg==';\n\t\tme._menu_open__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\tel.ggId=\"menu_open\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 32px;';\n\t\ths+='left : 5px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 5px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 32px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._menu_open.ggIsActive=function() {\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._menu_open.logicBlock_position = function() {\n\t\t\tvar newLogicStatePosition;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('vis_thumbnail_menu') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStatePosition = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStatePosition = -1;\n\t\t\t}\n\t\t\tif (me._menu_open.ggCurrentLogicStatePosition != newLogicStatePosition) {\n\t\t\t\tme._menu_open.ggCurrentLogicStatePosition = newLogicStatePosition;\n\t\t\t\tme._menu_open.style[domTransition]='left 500ms ease 0ms, top 500ms ease 0ms';\n\t\t\t\tif (me._menu_open.ggCurrentLogicStatePosition == 0) {\n\t\t\t\t\tme._menu_open.style.left='130px';\n\t\t\t\t\tme._menu_open.style.top='5px';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._menu_open.style.left='5px';\n\t\t\t\t\tme._menu_open.style.top='5px';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._menu_open.onclick=function (e) {\n\t\t\tplayer.setVariableValue('vis_thumbnail_menu', !player.getVariableValue('vis_thumbnail_menu'));\n\t\t}\n\t\tme._menu_open.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme.divSkin.appendChild(me._menu_open);\n\t\tel=me._loading=document.createElement('div');\n\t\tel.ggId=\"loading\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_container \";\n\t\tel.ggType='container';\n\t\ths ='';\n\t\ths+='height : 60px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 210px;';\n\t\ths+='pointer-events:none;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._loading.ggIsActive=function() {\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._loading.onclick=function (e) {\n\t\t\tme._loading.style[domTransition]='none';\n\t\t\tme._loading.style.visibility='hidden';\n\t\t\tme._loading.ggVisible=false;\n\t\t}\n\t\tme._loading.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t}\n\t\tel=me._loadingbg=document.createElement('div');\n\t\tel.ggId=\"loadingbg\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_rectangle \";\n\t\tel.ggType='rectangle';\n\t\ths ='';\n\t\ths+='background : rgba(0,0,0,0.666667);';\n\t\ths+='border : 0px solid #000000;';\n\t\ths+='cursor : default;';\n\t\ths+='height : 60px;';\n\t\ths+='left : 0px;';\n\t\ths+='opacity : 0.5;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 0px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 210px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._loadingbg.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._loadingbg.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme._loading.appendChild(me._loadingbg);\n\t\tel=me._loadingtext=document.createElement('div');\n\t\tels=me._loadingtext__text=document.createElement('div');\n\t\tel.className='ggskin ggskin_textdiv';\n\t\tel.ggTextDiv=els;\n\t\tel.ggId=\"loadingtext\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_text \";\n\t\tel.ggType='text';\n\t\ths ='';\n\t\ths+='height : 23px;';\n\t\ths+='left : 16px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 12px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 178px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='0% 50%';\n\t\ths ='position:absolute;';\n\t\ths += 'box-sizing: border-box;';\n\t\ths+='cursor: default;';\n\t\ths+='left: 0px;';\n\t\ths+='top: 0px;';\n\t\ths+='width: auto;';\n\t\ths+='height: auto;';\n\t\ths+='border: 0px solid #000000;';\n\t\ths+='color: rgba(255,255,255,1);';\n\t\ths+='text-align: left;';\n\t\ths+='white-space: nowrap;';\n\t\ths+='padding: 0px 1px 0px 1px;';\n\t\ths+='overflow: hidden;';\n\t\tels.setAttribute('style',hs);\n\t\tme._loadingtext.ggUpdateText=function() {\n\t\t\tvar hs=\"Loading... \"+(player.getPercentLoaded()*100.0).toFixed(0)+\"%\";\n\t\t\tif (hs!=this.ggText) {\n\t\t\t\tthis.ggText=hs;\n\t\t\t\tthis.ggTextDiv.innerHTML=hs;\n\t\t\t\tif (this.ggUpdatePosition) this.ggUpdatePosition();\n\t\t\t}\n\t\t}\n\t\tme._loadingtext.ggUpdateText();\n\t\tplayer.addListener('downloadprogress', function() {\n\t\t\tme._loadingtext.ggUpdateText();\n\t\t});\n\t\tel.appendChild(els);\n\t\tme._loadingtext.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._loadingtext.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme._loading.appendChild(me._loadingtext);\n\t\tel=me._loadingbar=document.createElement('div');\n\t\tel.ggId=\"loadingbar\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_rectangle \";\n\t\tel.ggType='rectangle';\n\t\ths ='';\n\t\ths+='background : #ffffff;';\n\t\ths+='border : 0px solid #808080;';\n\t\ths+='cursor : default;';\n\t\ths+='height : 13px;';\n\t\ths+='left : 15px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 35px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 182px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='0% 50%';\n\t\tme._loadingbar.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._loadingbar.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme._loading.appendChild(me._loadingbar);\n\t\tme.divSkin.appendChild(me._loading);\n\t\tel=me._video_screentint_file=document.createElement('div');\n\t\tel.ggId=\"video_screentint_file\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_rectangle \";\n\t\tel.ggType='rectangle';\n\t\ths ='';\n\t\ths+='background : rgba(0,0,0,0.392157);';\n\t\ths+='border : 0px solid #000000;';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 100%;';\n\t\ths+='left : 0%;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 0%;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 100%;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._video_screentint_file.ggIsActive=function() {\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._video_screentint_file.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('vis_video_file') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._video_screentint_file.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._video_screentint_file.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._video_screentint_file.style[domTransition]='';\n\t\t\t\tif (me._video_screentint_file.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._video_screentint_file.style.visibility=(Number(me._video_screentint_file.style.opacity)>0||!me._video_screentint_file.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._video_screentint_file.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._video_screentint_file.style.visibility=\"hidden\";\n\t\t\t\t\tme._video_screentint_file.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._video_screentint_file.onclick=function (e) {\n\t\t\tplayer.setVariableValue('vis_video_file', false);\n\t\t}\n\t\tme._video_screentint_file.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme.divSkin.appendChild(me._video_screentint_file);\n\t\tel=me._video_popup_file=document.createElement('div');\n\t\tel.ggId=\"video_popup_file\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_container \";\n\t\tel.ggType='container';\n\t\ths ='';\n\t\ths+='height : 80%;';\n\t\ths+='left : 10%;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 10%;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 80%;';\n\t\ths+='pointer-events:none;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._video_popup_file.ggIsActive=function() {\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._video_popup_file.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('vis_video_file') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._video_popup_file.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._video_popup_file.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._video_popup_file.style[domTransition]='';\n\t\t\t\tif (me._video_popup_file.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._video_popup_file.style.visibility=(Number(me._video_popup_file.style.opacity)>0||!me._video_popup_file.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._video_popup_file.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._video_popup_file.style.visibility=\"hidden\";\n\t\t\t\t\tme._video_popup_file.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._video_popup_file.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._loading_video_file=document.createElement('div');\n\t\tels=me._loading_video_file__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PHN2ZyBmaWxsPSJ3aGl0ZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iNjQiIHZpZXdCb3g9IjAgMCAzMiAzMiIgaGVpZ2h0PSI2NCI+CiA8Y2lyY2xlIGN5PSIzIiByPSIwIiBjeD0iMTYiPgogIDxhbmltYXRlIGJlZ2luPSIwIiBjYWxjTW9kZT0ic3BsaW5lIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIga2V5U3BsaW5lcz0iMC4yIDAuMiAwLjQgMC44OzAuMiAwLjIgMC40IDAuODswLjIgMC4yIDAuNCAwLjgiIHZhbHVlcz0iMDszOzA7MCIgYXR0cmlidXRlTmFtZT0iciIgZHVyPSIxcyIvPgogPC9jaXJjbGU+CiA8Y2lyY2xlIGN5PSIzIiByPSIwIiB0cmFuc2'+\n\t\t\t'Zvcm09InJvdGF0ZSg0NSAxNiAxNikiIGN4PSIxNiI+CiAgPGFuaW1hdGUgYmVnaW49IjAuMTI1cyIgY2FsY01vZGU9InNwbGluZSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGtleVNwbGluZXM9IjAuMiAwLjIgMC40IDAuODswLjIgMC4yIDAuNCAwLjg7MC4yIDAuMiAwLjQgMC44IiB2YWx1ZXM9IjA7MzswOzAiIGF0dHJpYnV0ZU5hbWU9InIiIGR1cj0iMXMiLz4KIDwvY2lyY2xlPgogPGNpcmNsZSBjeT0iMyIgcj0iMCIgdHJhbnNmb3JtPSJyb3RhdGUoOTAgMTYgMTYpIiBjeD0iMTYiPgogIDxhbmltYXRlIGJlZ2luPSIwLjI1cyIgY2FsY01vZGU9InNwbGluZSIgcmVwZWF0Q291bnQ9Imlu'+\n\t\t\t'ZGVmaW5pdGUiIGtleVNwbGluZXM9IjAuMiAwLjIgMC40IDAuODswLjIgMC4yIDAuNCAwLjg7MC4yIDAuMiAwLjQgMC44IiB2YWx1ZXM9IjA7MzswOzAiIGF0dHJpYnV0ZU5hbWU9InIiIGR1cj0iMXMiLz4KIDwvY2lyY2xlPgogPGNpcmNsZSBjeT0iMyIgcj0iMCIgdHJhbnNmb3JtPSJyb3RhdGUoMTM1IDE2IDE2KSIgY3g9IjE2Ij4KICA8YW5pbWF0ZSBiZWdpbj0iMC4zNzVzIiBjYWxjTW9kZT0ic3BsaW5lIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIga2V5U3BsaW5lcz0iMC4yIDAuMiAwLjQgMC44OzAuMiAwLjIgMC40IDAuODswLjIgMC4yIDAuNCAwLjgiIHZhbHVlcz0iMDszOzA7MCIgYX'+\n\t\t\t'R0cmlidXRlTmFtZT0iciIgZHVyPSIxcyIvPgogPC9jaXJjbGU+CiA8Y2lyY2xlIGN5PSIzIiByPSIwIiB0cmFuc2Zvcm09InJvdGF0ZSgxODAgMTYgMTYpIiBjeD0iMTYiPgogIDxhbmltYXRlIGJlZ2luPSIwLjVzIiBjYWxjTW9kZT0ic3BsaW5lIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIga2V5U3BsaW5lcz0iMC4yIDAuMiAwLjQgMC44OzAuMiAwLjIgMC40IDAuODswLjIgMC4yIDAuNCAwLjgiIHZhbHVlcz0iMDszOzA7MCIgYXR0cmlidXRlTmFtZT0iciIgZHVyPSIxcyIvPgogPC9jaXJjbGU+CiA8Y2lyY2xlIGN5PSIzIiByPSIwIiB0cmFuc2Zvcm09InJvdGF0ZSgyMjUgMTYgMTYpIiBj'+\n\t\t\t'eD0iMTYiPgogIDxhbmltYXRlIGJlZ2luPSIwLjYyNXMiIGNhbGNNb2RlPSJzcGxpbmUiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBrZXlTcGxpbmVzPSIwLjIgMC4yIDAuNCAwLjg7MC4yIDAuMiAwLjQgMC44OzAuMiAwLjIgMC40IDAuOCIgdmFsdWVzPSIwOzM7MDswIiBhdHRyaWJ1dGVOYW1lPSJyIiBkdXI9IjFzIi8+CiA8L2NpcmNsZT4KIDxjaXJjbGUgY3k9IjMiIHI9IjAiIHRyYW5zZm9ybT0icm90YXRlKDI3MCAxNiAxNikiIGN4PSIxNiI+CiAgPGFuaW1hdGUgYmVnaW49IjAuNzVzIiBjYWxjTW9kZT0ic3BsaW5lIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIga2V5U3BsaW5lcz0iMC'+\n\t\t\t'4yIDAuMiAwLjQgMC44OzAuMiAwLjIgMC40IDAuODswLjIgMC4yIDAuNCAwLjgiIHZhbHVlcz0iMDszOzA7MCIgYXR0cmlidXRlTmFtZT0iciIgZHVyPSIxcyIvPgogPC9jaXJjbGU+CiA8Y2lyY2xlIGN5PSIzIiByPSIwIiB0cmFuc2Zvcm09InJvdGF0ZSgzMTUgMTYgMTYpIiBjeD0iMTYiPgogIDxhbmltYXRlIGJlZ2luPSIwLjg3NXMiIGNhbGNNb2RlPSJzcGxpbmUiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBrZXlTcGxpbmVzPSIwLjIgMC4yIDAuNCAwLjg7MC4yIDAuMiAwLjQgMC44OzAuMiAwLjIgMC40IDAuOCIgdmFsdWVzPSIwOzM7MDswIiBhdHRyaWJ1dGVOYW1lPSJyIiBkdXI9IjFz'+\n\t\t\t'Ii8+CiA8L2NpcmNsZT4KIDxjaXJjbGUgY3k9IjMiIHI9IjAiIHRyYW5zZm9ybT0icm90YXRlKDE4MCAxNiAxNikiIGN4PSIxNiI+CiAgPGFuaW1hdGUgYmVnaW49IjAuNXMiIGNhbGNNb2RlPSJzcGxpbmUiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBrZXlTcGxpbmVzPSIwLjIgMC4yIDAuNCAwLjg7MC4yIDAuMiAwLjQgMC44OzAuMiAwLjIgMC40IDAuOCIgdmFsdWVzPSIwOzM7MDswIiBhdHRyaWJ1dGVOYW1lPSJyIiBkdXI9IjFzIi8+CiA8L2NpcmNsZT4KPC9zdmc+Cg==';\n\t\tme._loading_video_file__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\tel.ggId=\"loading_video_file\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='height : 40px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 40px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._loading_video_file.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._loading_video_file.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t}\n\t\tme._video_popup_file.appendChild(me._loading_video_file);\n\t\tel=me._popup_video_file=document.createElement('div');\n\t\tme._popup_video_file.seekbars = [];\n\t\tme._popup_video_file.seekbars.push('seekbar_file');\n\t\tme._popup_video_file.ggInitMedia = function(media) {\n\t\t\tvar notifySeekbars = function() {\n\t\t\t\tfor (var i = 0; i < me._popup_video_file.seekbars.length; i++) {\n\t\t\t\t\tvar seekbar = me.findElements(me._popup_video_file.seekbars[i]);\n\t\t\t\t\tif (seekbar.length > 0) seekbar[0].connectToMediaEl();\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (me._popup_video_file.hasChildNodes()) {\n\t\t\t\tme._popup_video_file.removeChild(me._popup_video_file.lastChild);\n\t\t\t}\n\t\t\tif (me._popup_video_file__vid) {\n\t\t\t\tme._popup_video_file__vid.pause();\n\t\t\t}\n\t\t\tif(media == '') {\n\t\t\t\tnotifySeekbars();\n\t\t\tif (me._popup_video_file.ggVideoNotLoaded ==false && me._popup_video_file.ggDeactivate) { me._popup_video_file.ggDeactivate(); }\n\t\t\t\tme._popup_video_file.ggVideoNotLoaded = true;\n\t\t\tvar mediaObj = player.getMediaObject('popup_video_file');\n\t\t\tif (mediaObj) {\n\t\t\t\tmediaObj.autoplay = false;\n\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tme._popup_video_file.ggVideoNotLoaded = false;\n\t\t\tme._popup_video_file__vid=document.createElement('video');\n\t\t\tme._popup_video_file__vid.className='ggskin ggskin_video';\n\t\t\tme._popup_video_file__vid.setAttribute('width', '100%');\n\t\t\tme._popup_video_file__vid.setAttribute('height', '100%');\n\t\t\tme._popup_video_file__vid.setAttribute('controlsList', 'nodownload');\n\t\t\tme._popup_video_file__vid.setAttribute('oncontextmenu', 'return false;');\n\t\t\tme._popup_video_file__source=document.createElement('source');\n\t\t\tme._popup_video_file__source.setAttribute('src', media);\n\t\t\tme._popup_video_file__vid.setAttribute('playsinline', 'playsinline');\n\t\t\tme._popup_video_file__vid.setAttribute('style', ';');\n\t\t\tme._popup_video_file__vid.style.outline = 'none';\n\t\t\tme._popup_video_file__vid.appendChild(me._popup_video_file__source);\n\t\t\tme._popup_video_file.appendChild(me._popup_video_file__vid);\n\t\t\tvar videoEl = player.registerVideoElement('popup_video_file', me._popup_video_file__vid);\n\t\t\tvideoEl.autoplay = false;\n\t\t\tnotifySeekbars();\n\t\t\tme._popup_video_file.ggVideoSource = media;\n\t\t}\n\t\tel.ggId=\"popup_video_file\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_video \";\n\t\tel.ggType='video';\n\t\ths ='';\n\t\ths+='height : 100%;';\n\t\ths+='left : 0%;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 0%;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 100%;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._popup_video_file.ggIsActive=function() {\n\t\t\tif (me._popup_video_file__vid != null) {\n\t\t\t\treturn (me._popup_video_file__vid.paused == false && me._popup_video_file__vid.ended == false);\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._popup_video_file.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('vis_video_file') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._popup_video_file.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._popup_video_file.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._popup_video_file.style[domTransition]='';\n\t\t\t\tif (me._popup_video_file.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._popup_video_file.style.visibility=(Number(me._popup_video_file.style.opacity)>0||!me._popup_video_file.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tif (me._popup_video_file.ggVideoNotLoaded) {\n\t\t\t\t\t\tme._popup_video_file.ggInitMedia(me._popup_video_file.ggVideoSource);\n\t\t\t\t\t}\n\t\t\t\t\tme._popup_video_file.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._popup_video_file.style.visibility=\"hidden\";\n\t\t\t\t\tme._popup_video_file.ggInitMedia('');\n\t\t\t\t\tme._popup_video_file.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._popup_video_file.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme._video_popup_file.appendChild(me._popup_video_file);\n\t\tme.divSkin.appendChild(me._video_popup_file);\n\t\tel=me._video_popup_controls_file=document.createElement('div');\n\t\tel.ggId=\"video_popup_controls_file\";\n\t\tel.ggDx=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_container \";\n\t\tel.ggType='container';\n\t\ths ='';\n\t\ths+='bottom : 6px;';\n\t\ths+='height : 25px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 284px;';\n\t\ths+='pointer-events:none;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._video_popup_controls_file.ggIsActive=function() {\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._video_popup_controls_file.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('vis_video_file') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._video_popup_controls_file.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._video_popup_controls_file.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._video_popup_controls_file.style[domTransition]='';\n\t\t\t\tif (me._video_popup_controls_file.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._video_popup_controls_file.style.visibility=(Number(me._video_popup_controls_file.style.opacity)>0||!me._video_popup_controls_file.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._video_popup_controls_file.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._video_popup_controls_file.style.visibility=\"hidden\";\n\t\t\t\t\tme._video_popup_controls_file.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._video_popup_controls_file.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t}\n\t\t}\n\t\tel=me._seekbar_file=document.createElement('div');\n\t\tme._seekbar_file__playhead=document.createElement('div');\n\t\tme._seekbar_file.mediaEl = null;\n\t\tme._seekbar_file.fromBufferSource = false;\n\t\tel.ggId=\"seekbar_file\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_seekbar \";\n\t\tel.ggType='seekbar';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 14px;';\n\t\ths+='left : 0px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 6px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 249px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._seekbar_file.connectToMediaEl = function() {\n\t\t\tvar disableSeekbar = function() {\n\t\t\t\tme._seekbar_file__playhead.style.visibility = 'hidden';\n\t\t\t\tme._seekbar_file.style.background = '#000000';\n\t\t\t\tme._seekbar_file.ggConnected = false;\n\t\t\t}\n\t\t\tif (me._seekbar_file.mediaEl != null) {\n\t\t\t\tif (me._seekbar_file.fromBufferSource) {\n\t\t\t\t\tplayer.removeEventListener('bufferSoundTimeupdate', me._seekbar_file.updatePlayback);\n\t\t\t\t\tif (me._seekbar_file.ggActivate) {\n\t\t\t\t\t\tplayer.removeEventListener('bufferSoundPlay', me._seekbar_file.bufferSoundActivate);\n\t\t\t\t\t}\n\t\t\t\t\tif (me._seekbar_file.ggDeactivate) {\n\t\t\t\t\t\tplayer.removeEventListener('bufferSoundPause', me._seekbar_file.bufferSoundDeactivate);\n\t\t\t\t\t\tplayer.removeEventListener('bufferSoundStop', me._seekbar_file.bufferSoundDeactivate);\n\t\t\t\t\t\tplayer.removeEventListener('bufferSoundEnded', me._seekbar_file.bufferSoundDeactivate);\n\t\t\t\t\t}\n\t\t\t\t\tif (me._seekbar_file.ggMediaEnded) {\n\t\t\t\t\t\tplayer.removeEventListener('bufferSoundEnded', me._seekbar_file.bufferSoundMediaEnded);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tme._seekbar_file.mediaEl.removeEventListener('progress', me._seekbar_file.updatePlayback);\n\t\t\t\t\tme._seekbar_file.mediaEl.removeEventListener('canplay', me._seekbar_file.updatePlayback);\n\t\t\t\t\tme._seekbar_file.mediaEl.removeEventListener('timeupdate', me._seekbar_file.updatePlayback);\n\t\t\t\t\tif (me._seekbar_file.ggActivate) {\n\t\t\t\t\t\tme._seekbar_file.mediaEl.removeEventListener('play', me._seekbar_file.ggActivate);\n\t\t\t\t\t}\n\t\t\t\t\tif (me._seekbar_file.ggDeactivate) {\n\t\t\t\t\t\tme._seekbar_file.mediaEl.removeEventListener('ended', me._seekbar_file.ggDeactivate);\n\t\t\t\t\t\tme._seekbar_file.mediaEl.removeEventListener('pause', me._seekbar_file.ggDeactivate);\n\t\t\t\t\t}\n\t\t\t\t\tif (me._seekbar_file.ggMediaEnded) {\n\t\t\t\t\t\tme._seekbar_file.mediaEl.removeEventListener('ended', me._seekbar_file.ggMediaEnded);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tme._seekbar_file.mediaEl = player.getMediaObject('popup_video_file');\n\t\t\tif (me._seekbar_file.mediaEl) {\n\t\t\t\tme._seekbar_file.fromBufferSource = false;\n\t\t\t} else {\n\t\t\t\tme._seekbar_file.mediaEl = player.getMediaBufferSourceObject('popup_video_file');\n\t\t\t\tme._seekbar_file.fromBufferSource = true;\n\t\t\t}\n\t\t\tif (me._seekbar_file.mediaEl != null) {\n\t\t\t\tme._seekbar_file__playhead.style.visibility = 'inherit';\n\t\t\t\tme._seekbar_file__playhead.style.left = '1px';\n\t\t\t\tif (me._seekbar_file.fromBufferSource) {\n\t\t\t\t\tplayer.addListener('bufferSoundTimeupdate', me._seekbar_file.updatePlayback);\n\t\t\t\t\tif (me._seekbar_file.ggActivate) {\n\t\t\t\t\t\tme._seekbar_file.bufferSoundActivate = function(args) { if (args['id'] == me._seekbar_file.mediaEl.id) me._seekbar_file.ggActivate(); };\n\t\t\t\t\t\tplayer.addListener('bufferSoundPlay', me._seekbar_file.bufferSoundActivate);\n\t\t\t\t\t}\n\t\t\t\t\tif (me._seekbar_file.ggDeactivate) {\n\t\t\t\t\t\tme._seekbar_file.bufferSoundDeactivate = function(args) { if (args['id'] == me._seekbar_file.mediaEl.id) me._seekbar_file.ggDeactivate(); };\n\t\t\t\t\t\tplayer.addListener('bufferSoundPause', me._seekbar_file.bufferSoundDeactivate);\n\t\t\t\t\t\tplayer.addListener('bufferSoundStop', me._seekbar_file.bufferSoundDeactivate);\n\t\t\t\t\t\tplayer.addListener('bufferSoundEnded', me._seekbar_file.bufferSoundDeactivate);\n\t\t\t\t\t}\n\t\t\t\t\tif (me._seekbar_file.ggMediaEnded) {\n\t\t\t\t\t\tme._seekbar_file.bufferSoundMediaEnded = function(args) { if (args['id'] == me._seekbar_file.mediaEl.id) me._seekbar_file.ggMediaEnded(); };\n\t\t\t\t\t\tplayer.addListener('bufferSoundEnded', me._seekbar_file.bufferSoundMediaEnded);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tme._seekbar_file.mediaEl.addEventListener('progress', me._seekbar_file.updatePlayback);\n\t\t\t\t\tme._seekbar_file.mediaEl.addEventListener('canplay', me._seekbar_file.updatePlayback);\n\t\t\t\t\tme._seekbar_file.mediaEl.addEventListener('timeupdate', me._seekbar_file.updatePlayback);\n\t\t\t\t\tif (me._seekbar_file.ggActivate) {\n\t\t\t\t\t\tme._seekbar_file.mediaEl.addEventListener('play', me._seekbar_file.ggActivate);\n\t\t\t\t\t}\n\t\t\t\t\tif (me._seekbar_file.ggDeactivate) {\n\t\t\t\t\t\tme._seekbar_file.mediaEl.addEventListener('ended', me._seekbar_file.ggDeactivate);\n\t\t\t\t\t\tme._seekbar_file.mediaEl.addEventListener('pause', me._seekbar_file.ggDeactivate);\n\t\t\t\t\t}\n\t\t\t\t\tif (me._seekbar_file.ggMediaEnded) {\n\t\t\t\t\t\tme._seekbar_file.mediaEl.addEventListener('ended', me._seekbar_file.ggMediaEnded);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tme._seekbar_file.ggConnected = true;\n\t\t\t} else {\n\t\t\t\tdisableSeekbar();\n\t\t\t}\n\t\t\tvar videoEl = me.findElements('popup_video_file');\n\t\t\tif (videoEl.length > 0 && !videoEl[0].hasChildNodes()) {\n\t\t\t\tdisableSeekbar();\n\t\t\t}\n\t\t}\n\t\tme._seekbar_file.updatePlayback = function(args) {\n\t\t\tif (!me._seekbar_file.ggConnected) return;\n\t\t\tif (me._seekbar_file.mediaEl != null) {\n\t\t\t\tif (me._seekbar_file.mediaEl.readyState || (me._seekbar_file.fromBufferSource && args && args['id'] == me._seekbar_file.mediaEl.id)) {\n\t\t\t\t\tif (me._seekbar_file.fromBufferSource) {\n\t\t\t\t\t\tvar percent = me._seekbar_file.mediaEl.bufferSoundCurrentTime() / me._seekbar_file.mediaEl.bufferSoundDuration();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar percent = me._seekbar_file.mediaEl.currentTime / me._seekbar_file.mediaEl.duration;\n\t\t\t\t\t}\n\t\t\t\t\tpercent = Math.min(percent, 1.0);\n\t\t\t\t\tvar playheadpos = Math.round((me._seekbar_file.clientWidth - 2 * 8 + 1) * percent);\n\t\t\t\t\tplayheadpos += 1;\n\t\t\t\t\tme._seekbar_file__playhead.style.left = playheadpos.toString() + 'px';\n\t\t\t\t\tvar offsetPercent = Math.round(100.0 * (8 / me._seekbar_file.clientWidth));\n\t\t\t\t\tvar currPos = offsetPercent + Math.round(percent * (100 - 2 * offsetPercent));\n\t\t\t\t\tvar gradientString ='linear-gradient(90deg, #808080 0%, #808080 ' + currPos + '%';\n\t\t\t\t\tif (me._seekbar_file.fromBufferSource) {\n\t\t\t\t\t\tgradientString += ', #c0c0c0 ' + currPos +'%, #c0c0c0 100%';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor (var i = 0; i < me._seekbar_file.mediaEl.buffered.length; i++) {\n\t\t\t\t\t\t\tvar rangeStart = Math.round((me._seekbar_file.mediaEl.buffered.start(i) / me._seekbar_file.mediaEl.duration) * 100.0);\n\t\t\t\t\t\t\tvar rangeEnd = Math.ceil((me._seekbar_file.mediaEl.buffered.end(i) / me._seekbar_file.mediaEl.duration) * 100.0);\n\t\t\t\t\t\t\tif (rangeEnd > currPos) {\n\t\t\t\t\t\t\t\tif (rangeStart < currPos) {\n\t\t\t\t\t\t\t\t\tgradientString += ', #c0c0c0 ' + currPos + '%';\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tgradientString += ', #000000 ' + currPos + '%, #000000 ' + rangeStart + '%';\n\t\t\t\t\t\t\t\t\tgradientString += ', #c0c0c0 ' + rangeStart + '%';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tgradientString += ', #c0c0c0 ' + rangeEnd + '%';\n\t\t\t\t\t\t\t\tcurrPos = rangeEnd;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (currPos < 100) {\n\t\t\t\t\t\t\tgradientString += ', #000000 ' + currPos + '%';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tgradientString += ')';\n\t\t\t\t\tme._seekbar_file.style.background = gradientString;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._seekbar_file.appendChild(me._seekbar_file__playhead);\n\t\ths+='background: #000000;';\n\t\ths+='border: 1px solid #000000;';\n\t\ths+='border-radius: 8px;';\n\t\ths+=cssPrefix + 'border-radius: 8px;';\n\t\tvar hs_playhead = 'height: 14px;';\n\t\ths_playhead += 'width: 14px;';\n\t\ths_playhead += 'border: 0px;';\n\t\ths_playhead += 'position: absolute;';\n\t\ths_playhead += 'left: 1px;';\n\t\ths_playhead += 'top: 0px;';\n\t\ths_playhead += 'border-radius: 7;';\n\t\ths_playhead += cssPrefix + 'border-radius: 7px;';\n\t\ths_playhead += 'background-color: rgba(255,255,255,1);';\n\t\ths_playhead += 'pointer-events: none;';\n\t\tme._seekbar_file.setAttribute('style', hs);\n\t\tme._seekbar_file__playhead.setAttribute('style', hs_playhead);\n\t\tme._seekbar_file.ggIsActive=function() {\n\t\t\tif (me._seekbar_file.mediaEl != null) {\n\t\t\t\treturn (me._seekbar_file.mediaEl.paused == false && me._seekbar_file.mediaEl.ended == false);\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._seekbar_file.onmousedown=function (e) {\n\t\t\tif (e.buttons == 1 || (e.buttons == null && e.which == 1) || e.type == 'touchend' || e.type == 'mouseup') {\n\t\t\t\tif (me._seekbar_file.mediaEl != null) {\n\t\t\t\t\tvar eventXPos;\n\t\t\t\t\tif(e.type == 'touchend') eventXPos = e.layerX; else eventXPos = e.offsetX;\n\t\t\t\t\tif (me._seekbar_file.fromBufferSource) {\n\t\t\t\t\t\tvar seekpos = (eventXPos / me._seekbar_file.clientWidth) * me._seekbar_file.mediaEl.bufferSoundDuration();\n\t\t\t\t\t\tif (e.type == 'mousemove' || e.type == 'mousedown') {\n\t\t\t\t\t\t\tme._seekbar_file.mediaEl.bufferSoundSetDragTime(seekpos);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tme._seekbar_file.mediaEl.bufferSoundSetTime(seekpos);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar seekpos = (eventXPos / me._seekbar_file.clientWidth) * me._seekbar_file.mediaEl.duration;\n\t\t\t\t\t\tme._seekbar_file.mediaEl.currentTime = seekpos;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._seekbar_file.onmouseup=function (e) {\n\t\t\tif (e.buttons == 1 || (e.buttons == null && e.which == 1) || e.type == 'touchend' || e.type == 'mouseup') {\n\t\t\t\tif (me._seekbar_file.mediaEl != null) {\n\t\t\t\t\tvar eventXPos;\n\t\t\t\t\tif(e.type == 'touchend') eventXPos = e.layerX; else eventXPos = e.offsetX;\n\t\t\t\t\tif (me._seekbar_file.fromBufferSource) {\n\t\t\t\t\t\tvar seekpos = (eventXPos / me._seekbar_file.clientWidth) * me._seekbar_file.mediaEl.bufferSoundDuration();\n\t\t\t\t\t\tif (e.type == 'mousemove' || e.type == 'mousedown') {\n\t\t\t\t\t\t\tme._seekbar_file.mediaEl.bufferSoundSetDragTime(seekpos);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tme._seekbar_file.mediaEl.bufferSoundSetTime(seekpos);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar seekpos = (eventXPos / me._seekbar_file.clientWidth) * me._seekbar_file.mediaEl.duration;\n\t\t\t\t\t\tme._seekbar_file.mediaEl.currentTime = seekpos;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._seekbar_file.onmousemove=function (e) {\n\t\t\tif (e.buttons == 1 || (e.buttons == null && e.which == 1) || e.type == 'touchend' || e.type == 'mouseup') {\n\t\t\t\tif (me._seekbar_file.mediaEl != null) {\n\t\t\t\t\tvar eventXPos;\n\t\t\t\t\tif(e.type == 'touchend') eventXPos = e.layerX; else eventXPos = e.offsetX;\n\t\t\t\t\tif (me._seekbar_file.fromBufferSource) {\n\t\t\t\t\t\tvar seekpos = (eventXPos / me._seekbar_file.clientWidth) * me._seekbar_file.mediaEl.bufferSoundDuration();\n\t\t\t\t\t\tif (e.type == 'mousemove' || e.type == 'mousedown') {\n\t\t\t\t\t\t\tme._seekbar_file.mediaEl.bufferSoundSetDragTime(seekpos);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tme._seekbar_file.mediaEl.bufferSoundSetTime(seekpos);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar seekpos = (eventXPos / me._seekbar_file.clientWidth) * me._seekbar_file.mediaEl.duration;\n\t\t\t\t\t\tme._seekbar_file.mediaEl.currentTime = seekpos;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._seekbar_file.ontouchend=function (e) {\n\t\t\tif (e.buttons == 1 || (e.buttons == null && e.which == 1) || e.type == 'touchend' || e.type == 'mouseup') {\n\t\t\t\tif (me._seekbar_file.mediaEl != null) {\n\t\t\t\t\tvar eventXPos;\n\t\t\t\t\tif(e.type == 'touchend') eventXPos = e.layerX; else eventXPos = e.offsetX;\n\t\t\t\t\tif (me._seekbar_file.fromBufferSource) {\n\t\t\t\t\t\tvar seekpos = (eventXPos / me._seekbar_file.clientWidth) * me._seekbar_file.mediaEl.bufferSoundDuration();\n\t\t\t\t\t\tif (e.type == 'mousemove' || e.type == 'mousedown') {\n\t\t\t\t\t\t\tme._seekbar_file.mediaEl.bufferSoundSetDragTime(seekpos);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tme._seekbar_file.mediaEl.bufferSoundSetTime(seekpos);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar seekpos = (eventXPos / me._seekbar_file.clientWidth) * me._seekbar_file.mediaEl.duration;\n\t\t\t\t\t\tme._seekbar_file.mediaEl.currentTime = seekpos;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._seekbar_file.ggActivate=function () {\n\t\t\tme._ht_video_pause_file.style[domTransition]='none';\n\t\t\tme._ht_video_pause_file.style.visibility=(Number(me._ht_video_pause_file.style.opacity)>0||!me._ht_video_pause_file.style.opacity)?'inherit':'hidden';\n\t\t\tme._ht_video_pause_file.ggVisible=true;\n\t\t\tme._ht_video_play_file.style[domTransition]='none';\n\t\t\tme._ht_video_play_file.style.visibility='hidden';\n\t\t\tme._ht_video_play_file.ggVisible=false;\n\t\t}\n\t\tme._seekbar_file.ggDeactivate=function () {\n\t\t\tme._ht_video_play_file.style[domTransition]='none';\n\t\t\tme._ht_video_play_file.style.visibility=(Number(me._ht_video_play_file.style.opacity)>0||!me._ht_video_play_file.style.opacity)?'inherit':'hidden';\n\t\t\tme._ht_video_play_file.ggVisible=true;\n\t\t\tme._ht_video_pause_file.style[domTransition]='none';\n\t\t\tme._ht_video_pause_file.style.visibility='hidden';\n\t\t\tme._ht_video_pause_file.ggVisible=false;\n\t\t}\n\t\tme._seekbar_file.ggUpdatePosition=function (useTransition) {\n\t\t\tme._seekbar_file.updatePlayback();\n\t\t}\n\t\tme._seekbar_file.ggNodeChange=function () {\n\t\t\tme._seekbar_file.connectToMediaEl();\n\t\t}\n\t\tme._video_popup_controls_file.appendChild(me._seekbar_file);\n\t\tel=me._ht_video_play_file=document.createElement('div');\n\t\tels=me._ht_video_play_file__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yNDAgMzMyIDEzMCAxMzAiIGJhc2VQcm9maWxlPSJ0aW55IiB4PSIwcHgiIHk9IjBweCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiA8ZyBpZD0iTG'+\n\t\t\t'F5ZXJfMV8xXyI+CiAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xNzUsMzQwLjljLTMxLDAtNTYuMSwyNS4xLTU2LjEsNTYuMWMwLDMxLDI1LjEsNTYuMSw1Ni4xLDU2LjFzNTYuMS0yNS4xLDU2LjEtNTYuMSYjeGQ7JiN4YTsmI3g5OyYjeDk7Qy0xMTguOSwzNjYtMTQ0LDM0MC45LTE3NSwzNDAuOXogTS0xNTAuNSwzOTguNmwtMzguMSwyNi42Yy0xLjMsMC45LTIuMywwLjMtMi4zLTEuMlYzNzBjMC0xLjUsMS0yLjEsMi4zLTEuMmwzOC4yLDI2LjYmI3hkOyYjeGE7JiN4OTsmI3g5O0MtMTQ5LjMsMzk2LjMtMTQ5LjMsMzk3LjctMTUwLjUsMzk4LjZ6Ii8+CiA8L2c+CiA8ZyBpZD0iTGF5ZXJf'+\n\t\t\t'MiI+CiAgPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTS0xOTEsMzcwYzAtMS41LDEtMi4xLDIuMy0xLjJsMzguMiwyNi42YzEuMywwLjksMS4zLDIuMywwLDMuMmwtMzguMiwyNi42Yy0xLjMsMC45LTIuMywwLjMtMi4zLTEuMlYzNzB6Ii8+CiA8L2c+Cjwvc3ZnPgo=';\n\t\tme._ht_video_play_file__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\telo=me._ht_video_play_file__imgo=document.createElement('img');\n\t\telo.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yNDAgMzMyIDEzMCAxMzAiIGJhc2VQcm9maWxlPSJ0aW55IiB4PSIwcHgiIHk9IjBweCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiA8ZyBpZD0iTG'+\n\t\t\t'F5ZXJfMV8xXyI+CiAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xNzUsMzM0LjZjLTM0LjQsMC02Mi40LDI3LjktNjIuNCw2Mi40YzAsMzQuNCwyNy45LDYyLjQsNjIuNCw2Mi40czYyLjQtMjcuOSw2Mi40LTYyLjQmI3hkOyYjeGE7JiN4OTsmI3g5O0MtMTEyLjYsMzYyLjYtMTQwLjYsMzM0LjYtMTc1LDMzNC42eiBNLTE0Ny44LDM5OC44bC00Mi40LDI5LjZjLTEuNCwxLTIuNiwwLjQtMi42LTEuM1YzNjdjMC0xLjcsMS4yLTIuMywyLjYtMS4zbDQyLjQsMjkuNiYjeGQ7JiN4YTsmI3g5OyYjeDk7Qy0xNDYuNCwzOTYuMi0xNDYuNCwzOTcuOC0xNDcuOCwzOTguOHoiLz4KIDwvZz4KIDxnIGlk'+\n\t\t\t'PSJMYXllcl8yIj4KICA8cGF0aCBmaWxsPSIjRkZGRkZGIiBkPSJNLTE5Mi44LDM2N2MwLTEuNywxLjItMi4zLDIuNi0xLjNsNDIuNCwyOS42YzEuNCwxLDEuNCwyLjYsMCwzLjZsLTQyLjQsMjkuNmMtMS40LDEtMi42LDAuNC0yLjYtMS4zVjM2N3oiLz4KIDwvZz4KPC9zdmc+Cg==';\n\t\tme._ht_video_play_file__imgo.setAttribute('src',hs);\n\t\telo.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;visibility:hidden;pointer-events:none;;');\n\t\telo['ondragstart']=function() { return false; };\n\t\tel.appendChild(elo);\n\t\tel.ggId=\"ht_video_play_file\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 25px;';\n\t\ths+='left : 259px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 0px;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 25px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_video_play_file.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._ht_video_play_file.onclick=function (e) {\n\t\t\tif (me._popup_video_file.ggApiPlayer) {\n\t\t\t\tif (me._popup_video_file.ggApiPlayerType == 'youtube') {\n\t\t\t\t\tlet youtubeMediaFunction = function() {\n\t\t\t\t\t\tme._popup_video_file.ggApiPlayer.playVideo();\n\t\t\t\t\t};\n\t\t\t\t\tif (me._popup_video_file.ggApiPlayerReady) {\n\t\t\t\t\t\tyoutubeMediaFunction();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet youtubeApiInterval = setInterval(function() {\n\t\t\t\t\t\t\tif (me._popup_video_file.ggApiPlayerReady) {\n\t\t\t\t\t\t\t\tclearInterval(youtubeApiInterval);\n\t\t\t\t\t\t\t\tyoutubeMediaFunction();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, 100);\n\t\t\t\t\t}\n\t\t\t\t} else if (me._popup_video_file.ggApiPlayerType == 'vimeo') {\n\t\t\t\t\tme._popup_video_file.ggApiPlayer.play();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tplayer.playSound(\"popup_video_file\",\"1\");\n\t\t\t}\n\t\t\tme._ht_video_play_file.style[domTransition]='none';\n\t\t\tme._ht_video_play_file.style.visibility='hidden';\n\t\t\tme._ht_video_play_file.ggVisible=false;\n\t\t\tme._ht_video_pause_file.style[domTransition]='none';\n\t\t\tme._ht_video_pause_file.style.visibility=(Number(me._ht_video_pause_file.style.opacity)>0||!me._ht_video_pause_file.style.opacity)?'inherit':'hidden';\n\t\t\tme._ht_video_pause_file.ggVisible=true;\n\t\t}\n\t\tme._ht_video_play_file.onmouseover=function (e) {\n\t\t\tme._ht_video_play_file__img.style.visibility='hidden';\n\t\t\tme._ht_video_play_file__imgo.style.visibility='inherit';\n\t\t}\n\t\tme._ht_video_play_file.onmouseout=function (e) {\n\t\t\tme._ht_video_play_file__img.style.visibility='inherit';\n\t\t\tme._ht_video_play_file__imgo.style.visibility='hidden';\n\t\t}\n\t\tme._ht_video_play_file.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme._video_popup_controls_file.appendChild(me._ht_video_play_file);\n\t\tel=me._ht_video_pause_file=document.createElement('div');\n\t\tels=me._ht_video_pause_file__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yNDAgMzMyIDEzMCAxMzAiIGJhc2VQcm9maWxlPSJ0aW55IiB4PSIwcHgiIHk9IjBweCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiA8ZyBpZD0iTG'+\n\t\t\t'F5ZXJfMV8xXyI+CiAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xNzUsMzQwLjljLTMxLDAtNTYuMSwyNS4xLTU2LjEsNTYuMWMwLDMxLDI1LjEsNTYuMSw1Ni4xLDU2LjFzNTYuMS0yNS4xLDU2LjEtNTYuMSYjeGQ7JiN4YTsmI3g5OyYjeDk7Qy0xMTguOSwzNjYtMTQ0LDM0MC45LTE3NSwzNDAuOXogTS0xNzcuNyw0MTYuM2MwLDEuMy0xLDIuMy0yLjMsMi4zaC0xNC4zYy0xLjMsMC0yLjMtMS0yLjMtMi4zdi0zOC42YzAtMS4zLDEtMi4zLDIuMy0yLjNoMTQuMyYjeGQ7JiN4YTsmI3g5OyYjeDk7YzEuMywwLDIuMywxLDIuMywyLjNDLTE3Ny43LDM3Ny43LTE3Ny43LDQxNi4zLTE3Ny43LDQx'+\n\t\t\t'Ni4zeiBNLTE1My40LDQxNi4zYzAsMS4zLTEsMi4zLTIuMywyLjNILTE3MGMtMS4zLDAtMi4zLTEtMi4zLTIuM3YtMzguNiYjeGQ7JiN4YTsmI3g5OyYjeDk7YzAtMS4zLDEtMi4zLDIuMy0yLjNoMTQuM2MxLjMsMCwyLjMsMSwyLjMsMi4zQy0xNTMuNCwzNzcuNy0xNTMuNCw0MTYuMy0xNTMuNCw0MTYuM3oiLz4KIDwvZz4KIDxnIGlkPSJMYXllcl8yIj4KICA8Zz4KICAgPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTS0xODAsMzc1LjRoLTE0LjNjLTEuMywwLTIuMywxLTIuMywyLjN2MzguNmMwLDEuMywxLDIuMywyLjMsMi4zaDE0LjNjMS4zLDAsMi4zLTEsMi4zLTIuM3YtMzguNiYjeGQ7JiN4YT'+\n\t\t\t'smI3g5OyYjeDk7JiN4OTtDLTE3Ny43LDM3Ni40LTE3OC43LDM3NS40LTE4MCwzNzUuNHoiLz4KICAgPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTS0xNTUuNywzNzUuNEgtMTcwYy0xLjMsMC0yLjMsMS0yLjMsMi4zdjM4LjZjMCwxLjMsMSwyLjMsMi4zLDIuM2gxNC4zYzEuMywwLDIuMy0xLDIuMy0yLjN2LTM4LjYmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7Qy0xNTMuNCwzNzYuNC0xNTQuNCwzNzUuNC0xNTUuNywzNzUuNHoiLz4KICA8L2c+CiA8L2c+Cjwvc3ZnPgo=';\n\t\tme._ht_video_pause_file__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\telo=me._ht_video_pause_file__imgo=document.createElement('img');\n\t\telo.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yNDAgMzMyIDEzMCAxMzAiIGJhc2VQcm9maWxlPSJ0aW55IiB4PSIwcHgiIHk9IjBweCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiA8ZyBpZD0iTG'+\n\t\t\t'F5ZXJfMV8xXyI+CiAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xNzUsMzM0LjZjLTM0LjQsMC02Mi40LDI3LjktNjIuNCw2Mi40YzAsMzQuNCwyNy45LDYyLjQsNjIuNCw2Mi40czYyLjQtMjcuOSw2Mi40LTYyLjQmI3hkOyYjeGE7JiN4OTsmI3g5O0MtMTEyLjYsMzYyLjYtMTQwLjYsMzM0LjYtMTc1LDMzNC42eiBNLTE3OCw0MTguNGMwLDEuNC0xLjEsMi42LTIuNiwyLjZoLTE1LjljLTEuNCwwLTIuNi0xLjEtMi42LTIuNnYtNDIuOSYjeGQ7JiN4YTsmI3g5OyYjeDk7YzAtMS40LDEuMS0yLjYsMi42LTIuNmgxNS45YzEuNCwwLDIuNiwxLjEsMi42LDIuNkMtMTc4LDM3NS41LTE3OCw0MTgu'+\n\t\t\t'NC0xNzgsNDE4LjR6IE0tMTUxLDQxOC40YzAsMS40LTEuMSwyLjYtMi42LDIuNmgtMTUuOSYjeGQ7JiN4YTsmI3g5OyYjeDk7Yy0xLjQsMC0yLjYtMS4xLTIuNi0yLjZ2LTQyLjljMC0xLjQsMS4xLTIuNiwyLjYtMi42aDE1LjljMS40LDAsMi42LDEuMSwyLjYsMi42Qy0xNTEsMzc1LjUtMTUxLDQxOC40LTE1MSw0MTguNHoiLz4KIDwvZz4KIDxnIGlkPSJMYXllcl8yIj4KICA8Zz4KICAgPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTS0xODAuNSwzNzNoLTE1LjljLTEuNCwwLTIuNiwxLjEtMi42LDIuNnY0Mi45YzAsMS40LDEuMSwyLjYsMi42LDIuNmgxNS45YzEuNCwwLDIuNi0xLjEsMi42LTIuNn'+\n\t\t\t'YtNDIuOSYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTtDLTE3OCwzNzQuMS0xNzkuMSwzNzMtMTgwLjUsMzczeiIvPgogICA8cGF0aCBmaWxsPSIjRkZGRkZGIiBkPSJNLTE1My41LDM3M2gtMTUuOWMtMS40LDAtMi42LDEuMS0yLjYsMi42djQyLjljMCwxLjQsMS4xLDIuNiwyLjYsMi42aDE1LjljMS40LDAsMi42LTEuMSwyLjYtMi42di00Mi45JiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5O0MtMTUxLDM3NC4xLTE1Mi4xLDM3My0xNTMuNSwzNzN6Ii8+CiAgPC9nPgogPC9nPgo8L3N2Zz4K';\n\t\tme._ht_video_pause_file__imgo.setAttribute('src',hs);\n\t\telo.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;visibility:hidden;pointer-events:none;;');\n\t\telo['ondragstart']=function() { return false; };\n\t\tel.appendChild(elo);\n\t\tel.ggId=\"ht_video_pause_file\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 25px;';\n\t\ths+='left : 259px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 0px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 25px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_video_pause_file.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._ht_video_pause_file.onclick=function (e) {\n\t\t\tif (me._popup_video_file.ggApiPlayer) {\n\t\t\t\tif (me._popup_video_file.ggApiPlayerType == 'youtube') {\n\t\t\t\t\tlet youtubeMediaFunction = function() {\n\t\t\t\t\t\tme._popup_video_file.ggApiPlayer.pauseVideo();\n\t\t\t\t\t};\n\t\t\t\t\tif (me._popup_video_file.ggApiPlayerReady) {\n\t\t\t\t\t\tyoutubeMediaFunction();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet youtubeApiInterval = setInterval(function() {\n\t\t\t\t\t\t\tif (me._popup_video_file.ggApiPlayerReady) {\n\t\t\t\t\t\t\t\tclearInterval(youtubeApiInterval);\n\t\t\t\t\t\t\t\tyoutubeMediaFunction();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, 100);\n\t\t\t\t\t}\n\t\t\t\t} else if (me._popup_video_file.ggApiPlayerType == 'vimeo') {\n\t\t\t\t\tme._popup_video_file.ggApiPlayer.pause();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tplayer.pauseSound(\"popup_video_file\");\n\t\t\t}\n\t\t\tme._ht_video_pause_file.style[domTransition]='none';\n\t\t\tme._ht_video_pause_file.style.visibility='hidden';\n\t\t\tme._ht_video_pause_file.ggVisible=false;\n\t\t\tme._ht_video_play_file.style[domTransition]='none';\n\t\t\tme._ht_video_play_file.style.visibility=(Number(me._ht_video_play_file.style.opacity)>0||!me._ht_video_play_file.style.opacity)?'inherit':'hidden';\n\t\t\tme._ht_video_play_file.ggVisible=true;\n\t\t}\n\t\tme._ht_video_pause_file.onmouseover=function (e) {\n\t\t\tme._ht_video_pause_file__img.style.visibility='hidden';\n\t\t\tme._ht_video_pause_file__imgo.style.visibility='inherit';\n\t\t}\n\t\tme._ht_video_pause_file.onmouseout=function (e) {\n\t\t\tme._ht_video_pause_file__img.style.visibility='inherit';\n\t\t\tme._ht_video_pause_file__imgo.style.visibility='hidden';\n\t\t}\n\t\tme._ht_video_pause_file.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme._video_popup_controls_file.appendChild(me._ht_video_pause_file);\n\t\tme.divSkin.appendChild(me._video_popup_controls_file);\n\t\tel=me._video_popup_close_file=document.createElement('div');\n\t\tels=me._video_popup_close_file__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yNDAgMzMyIDEzMCAxMzAiIGJhc2VQcm9maWxlPSJ0aW55IiB4PSIwcHgiIHk9IjBweCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiA8ZyBpZD0iTG'+\n\t\t\t'F5ZXJfMV8xXyI+CiAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xMzUuMywzNTcuM2MtMjEuOS0yMS45LTU3LjUtMjEuOS03OS40LDBjLTIxLjksMjEuOS0yMS45LDU3LjUsMCw3OS40YzIxLjksMjEuOSw1Ny41LDIxLjksNzkuNCwwJiN4ZDsmI3hhOyYjeDk7JiN4OTtTLTExMy40LDM3OS4yLTEzNS4zLDM1Ny4zeiBNLTE0NS44LDQxMi43YzAuOCwwLjgsMC44LDEuNS0wLjEsMi40bC0xMC45LDEwLjljLTAuNCwwLjQtMC44LDAuNS0xLjMsMC41Yy0wLjUsMC0wLjktMC4xLTEuMS0wLjQmI3hkOyYjeGE7JiN4OTsmI3g5O2wtMTUuOC0xNS44bC0xNS43LDE1LjdjLTAuNCwwLjQtMC44LDAuNS0x'+\n\t\t\t'LjMsMC41cy0wLjktMC4xLTEuMS0wLjRsLTExLjEtMTEuMWMtMC4zLTAuMy0wLjQtMC42LTAuNC0xLjFjMC0wLjUsMC4xLTAuOSwwLjUtMS4zJiN4ZDsmI3hhOyYjeDk7JiN4OTtsMTUuNy0xNS43bC0xNS44LTE1LjhjLTAuMy0wLjMtMC40LTAuNi0wLjQtMS4xYzAtMC41LDAuMS0wLjksMC41LTEuM2wxMC45LTEwLjljMC45LTAuOSwxLjctMC45LDIuNC0wLjFsMTUuOCwxNS44bDE1LjctMTUuNyYjeGQ7JiN4YTsmI3g5OyYjeDk7YzAuOS0wLjksMS43LTAuOSwyLjQtMC4xbDExLjEsMTEuMWMwLjgsMC44LDAuOCwxLjUtMC4xLDIuNGwtMTUuNywxNS43TC0xNDUuOCw0MTIuN3oiLz4KIDwvZz4KID'+\n\t\t\t'xnIGlkPSJMYXllcl8yIj4KICA8cGF0aCBmaWxsPSIjRkZGRkZGIiBkPSJNLTE2MS42LDM5Ni45bDE1LjgsMTUuOGMwLjgsMC44LDAuOCwxLjUtMC4xLDIuNGwtMTAuOSwxMC45Yy0wLjQsMC40LTAuOCwwLjUtMS4zLDAuNSYjeGQ7JiN4YTsmI3g5OyYjeDk7Yy0wLjUsMC0wLjktMC4xLTEuMS0wLjRsLTE1LjgtMTUuOGwtMTUuNywxNS43Yy0wLjQsMC40LTAuOCwwLjUtMS4zLDAuNXMtMC45LTAuMS0xLjEtMC40bC0xMS4xLTExLjFjLTAuMy0wLjMtMC40LTAuNi0wLjQtMS4xJiN4ZDsmI3hhOyYjeDk7JiN4OTtjMC0wLjUsMC4xLTAuOSwwLjUtMS4zbDE1LjctMTUuN2wtMTUuOC0xNS44Yy0wLjMt'+\n\t\t\t'MC4zLTAuNC0wLjYtMC40LTEuMWMwLTAuNSwwLjEtMC45LDAuNS0xLjNsMTAuOS0xMC45YzAuOS0wLjksMS43LTAuOSwyLjQtMC4xJiN4ZDsmI3hhOyYjeDk7JiN4OTtsMTUuOCwxNS44bDE1LjctMTUuN2MwLjktMC45LDEuNy0wLjksMi40LTAuMWwxMS4xLDExLjFjMC44LDAuOCwwLjgsMS41LTAuMSwyLjRMLTE2MS42LDM5Ni45eiIvPgogPC9nPgo8L3N2Zz4K';\n\t\tme._video_popup_close_file__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\telo=me._video_popup_close_file__imgo=document.createElement('img');\n\t\telo.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yNDAgMzMyIDEzMCAxMzAiIGJhc2VQcm9maWxlPSJ0aW55IiB4PSIwcHgiIHk9IjBweCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiA8ZyBpZD0iTG'+\n\t\t\t'F5ZXJfMV8xXyI+CiAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xMzAuOSwzNTIuOWMtMjQuNC0yNC40LTYzLjgtMjQuNC04OC4yLDBjLTI0LjQsMjQuNC0yNC40LDYzLjgsMCw4OC4yYzI0LjQsMjQuNCw2My44LDI0LjQsODguMiwwJiN4ZDsmI3hhOyYjeDk7JiN4OTtTLTEwNi41LDM3Ny4zLTEzMC45LDM1Mi45eiBNLTE0Mi41LDQxNC41YzAuOCwwLjgsMC44LDEuNy0wLjEsMi43bC0xMi4yLDEyLjJjLTAuNCwwLjQtMC44LDAuNi0xLjQsMC42Yy0wLjYsMC0xLTAuMS0xLjMtMC40JiN4ZDsmI3hhOyYjeDk7JiN4OTtsLTE3LjUtMTcuNWwtMTcuNCwxNy40Yy0wLjQsMC40LTAuOCwwLjYtMS40'+\n\t\t\t'LDAuNmMtMC42LDAtMS0wLjEtMS4zLTAuNGwtMTIuMy0xMi4zYy0wLjMtMC4zLTAuNC0wLjctMC40LTEuM2MwLTAuNiwwLjEtMSwwLjYtMS40JiN4ZDsmI3hhOyYjeDk7JiN4OTtsMTcuNC0xNy40bC0xNy41LTE3LjVjLTAuMy0wLjMtMC40LTAuNy0wLjQtMS4zYzAtMC42LDAuMS0xLDAuNi0xLjRsMTIuMi0xMi4yYzEtMSwxLjgtMSwyLjctMC4xbDE3LjUsMTcuNWwxNy40LTE3LjQmI3hkOyYjeGE7JiN4OTsmI3g5O2MxLTEsMS44LTEsMi43LTAuMWwxMi4zLDEyLjNjMC44LDAuOCwwLjgsMS43LTAuMSwyLjdsLTE3LjQsMTcuNEwtMTQyLjUsNDE0LjV6Ii8+CiA8L2c+CiA8ZyBpZD0iTGF5ZXJfMi'+\n\t\t\t'I+CiAgPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTS0xNjAuMSwzOTYuOWwxNy41LDE3LjVjMC44LDAuOCwwLjgsMS43LTAuMSwyLjdsLTEyLjIsMTIuMmMtMC40LDAuNC0wLjgsMC42LTEuNCwwLjYmI3hkOyYjeGE7JiN4OTsmI3g5O2MtMC42LDAtMS0wLjEtMS4zLTAuNGwtMTcuNS0xNy41bC0xNy40LDE3LjRjLTAuNCwwLjQtMC44LDAuNi0xLjQsMC42Yy0wLjYsMC0xLTAuMS0xLjMtMC40bC0xMi4zLTEyLjNjLTAuMy0wLjMtMC40LTAuNy0wLjQtMS4zJiN4ZDsmI3hhOyYjeDk7JiN4OTtjMC0wLjYsMC4xLTEsMC42LTEuNGwxNy40LTE3LjRsLTE3LjUtMTcuNWMtMC4zLTAuMy0wLjQtMC43LTAu'+\n\t\t\t'NC0xLjNjMC0wLjYsMC4xLTEsMC42LTEuNGwxMi4yLTEyLjJjMS0xLDEuOC0xLDIuNy0wLjFsMTcuNSwxNy41JiN4ZDsmI3hhOyYjeDk7JiN4OTtsMTcuNC0xNy40YzEtMSwxLjgtMSwyLjctMC4xbDEyLjMsMTIuM2MwLjgsMC44LDAuOCwxLjctMC4xLDIuN0wtMTYwLjEsMzk2Ljl6Ii8+CiA8L2c+Cjwvc3ZnPgo=';\n\t\tme._video_popup_close_file__imgo.setAttribute('src',hs);\n\t\telo.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;visibility:hidden;pointer-events:none;;');\n\t\telo['ondragstart']=function() { return false; };\n\t\tel.appendChild(elo);\n\t\tel.ggId=\"video_popup_close_file\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 32px;';\n\t\ths+='position : absolute;';\n\t\ths+='right : 5px;';\n\t\ths+='top : 5px;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 32px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._video_popup_close_file.ggIsActive=function() {\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._video_popup_close_file.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('vis_video_file') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._video_popup_close_file.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._video_popup_close_file.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._video_popup_close_file.style[domTransition]='';\n\t\t\t\tif (me._video_popup_close_file.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._video_popup_close_file.style.visibility=(Number(me._video_popup_close_file.style.opacity)>0||!me._video_popup_close_file.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._video_popup_close_file.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._video_popup_close_file.style.visibility=\"hidden\";\n\t\t\t\t\tme._video_popup_close_file.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._video_popup_close_file.onclick=function (e) {\n\t\t\tplayer.setVariableValue('vis_video_file', false);\n\t\t}\n\t\tme._video_popup_close_file.onmouseover=function (e) {\n\t\t\tme._video_popup_close_file__img.style.visibility='hidden';\n\t\t\tme._video_popup_close_file__imgo.style.visibility='inherit';\n\t\t}\n\t\tme._video_popup_close_file.onmouseout=function (e) {\n\t\t\tme._video_popup_close_file__img.style.visibility='inherit';\n\t\t\tme._video_popup_close_file__imgo.style.visibility='hidden';\n\t\t}\n\t\tme._video_popup_close_file.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme.divSkin.appendChild(me._video_popup_close_file);\n\t\tel=me._screentint_info0=document.createElement('div');\n\t\tel.ggId=\"screentint_info\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_rectangle \";\n\t\tel.ggType='rectangle';\n\t\ths ='';\n\t\ths+='background : rgba(0,0,0,0.392157);';\n\t\ths+='border : 0px solid #000000;';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 100%;';\n\t\ths+='left : 0%;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 0%;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 100%;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._screentint_info0.ggIsActive=function() {\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._screentint_info0.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('vis_info_popup') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._screentint_info0.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._screentint_info0.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._screentint_info0.style[domTransition]='';\n\t\t\t\tif (me._screentint_info0.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._screentint_info0.style.visibility=(Number(me._screentint_info0.style.opacity)>0||!me._screentint_info0.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._screentint_info0.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._screentint_info0.style.visibility=\"hidden\";\n\t\t\t\t\tme._screentint_info0.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._screentint_info0.onclick=function (e) {\n\t\t\tplayer.setVariableValue('vis_info_popup', false);\n\t\t\tme._info_title.ggText=\"\";\n\t\t\tme._info_title.ggTextDiv.innerHTML=me._info_title.ggText;\n\t\t\tif (me._info_title.ggUpdateText) {\n\t\t\t\tme._info_title.ggUpdateText=function() {\n\t\t\t\t\tvar hs=\"\";\n\t\t\t\t\tif (hs!=this.ggText) {\n\t\t\t\t\t\tthis.ggText=hs;\n\t\t\t\t\t\tthis.ggTextDiv.innerHTML=hs;\n\t\t\t\t\t\tif (this.ggUpdatePosition) this.ggUpdatePosition();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (me._info_title.ggUpdatePosition) {\n\t\t\t\tme._info_title.ggUpdatePosition();\n\t\t\t}\n\t\t\tme._info_title.ggTextDiv.scrollTop = 0;\n\t\t\tme._info_text_body.ggText=\"\";\n\t\t\tme._info_text_body.ggTextDiv.innerHTML=me._info_text_body.ggText;\n\t\t\tif (me._info_text_body.ggUpdateText) {\n\t\t\t\tme._info_text_body.ggUpdateText=function() {\n\t\t\t\t\tvar hs=\"\";\n\t\t\t\t\tif (hs!=this.ggText) {\n\t\t\t\t\t\tthis.ggText=hs;\n\t\t\t\t\t\tthis.ggTextDiv.innerHTML=hs;\n\t\t\t\t\t\tif (this.ggUpdatePosition) this.ggUpdatePosition();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (me._info_text_body.ggUpdatePosition) {\n\t\t\t\tme._info_text_body.ggUpdatePosition();\n\t\t\t}\n\t\t\tme._info_text_body.ggTextDiv.scrollTop = 0;\n\t\t}\n\t\tme._screentint_info0.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme.divSkin.appendChild(me._screentint_info0);\n\t\tel=me._screentint_info=document.createElement('div');\n\t\tel.ggId=\"screentint_info\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_rectangle \";\n\t\tel.ggType='rectangle';\n\t\ths ='';\n\t\ths+='background : rgba(0,0,0,0.392157);';\n\t\ths+='border : 0px solid #000000;';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 100%;';\n\t\ths+='left : 0%;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 0%;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 100%;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._screentint_info.ggIsActive=function() {\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._screentint_info.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('vis_info_popup') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._screentint_info.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._screentint_info.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._screentint_info.style[domTransition]='';\n\t\t\t\tif (me._screentint_info.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._screentint_info.style.visibility=(Number(me._screentint_info.style.opacity)>0||!me._screentint_info.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._screentint_info.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._screentint_info.style.visibility=\"hidden\";\n\t\t\t\t\tme._screentint_info.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._screentint_info.onclick=function (e) {\n\t\t\tplayer.setVariableValue('vis_info_popup', false);\n\t\t\tme._info_title.ggText=\"\";\n\t\t\tme._info_title.ggTextDiv.innerHTML=me._info_title.ggText;\n\t\t\tif (me._info_title.ggUpdateText) {\n\t\t\t\tme._info_title.ggUpdateText=function() {\n\t\t\t\t\tvar hs=\"\";\n\t\t\t\t\tif (hs!=this.ggText) {\n\t\t\t\t\t\tthis.ggText=hs;\n\t\t\t\t\t\tthis.ggTextDiv.innerHTML=hs;\n\t\t\t\t\t\tif (this.ggUpdatePosition) this.ggUpdatePosition();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (me._info_title.ggUpdatePosition) {\n\t\t\t\tme._info_title.ggUpdatePosition();\n\t\t\t}\n\t\t\tme._info_title.ggTextDiv.scrollTop = 0;\n\t\t\tme._info_text_body.ggText=\"\";\n\t\t\tme._info_text_body.ggTextDiv.innerHTML=me._info_text_body.ggText;\n\t\t\tif (me._info_text_body.ggUpdateText) {\n\t\t\t\tme._info_text_body.ggUpdateText=function() {\n\t\t\t\t\tvar hs=\"\";\n\t\t\t\t\tif (hs!=this.ggText) {\n\t\t\t\t\t\tthis.ggText=hs;\n\t\t\t\t\t\tthis.ggTextDiv.innerHTML=hs;\n\t\t\t\t\t\tif (this.ggUpdatePosition) this.ggUpdatePosition();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (me._info_text_body.ggUpdatePosition) {\n\t\t\t\tme._info_text_body.ggUpdatePosition();\n\t\t\t}\n\t\t\tme._info_text_body.ggTextDiv.scrollTop = 0;\n\t\t}\n\t\tme._screentint_info.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme.divSkin.appendChild(me._screentint_info);\n\t\tel=me._information=document.createElement('div');\n\t\tel.ggId=\"information\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_container \";\n\t\tel.ggType='container';\n\t\ths ='';\n\t\ths+='height : 250px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 480px;';\n\t\ths+='pointer-events:none;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._information.ggIsActive=function() {\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._information.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('vis_info_popup') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._information.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._information.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._information.style[domTransition]='';\n\t\t\t\tif (me._information.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._information.style.visibility=(Number(me._information.style.opacity)>0||!me._information.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._information.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._information.style.visibility=\"hidden\";\n\t\t\t\t\tme._information.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._information.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t}\n\t\tel=me._informationbg=document.createElement('div');\n\t\tel.ggId=\"informationbg\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_rectangle \";\n\t\tel.ggType='rectangle';\n\t\ths ='';\n\t\ths+=cssPrefix + 'border-radius : 10px;';\n\t\ths+='border-radius : 10px;';\n\t\ths+='background : rgba(0,0,0,0.509804);';\n\t\ths+='border : 2px solid #ffffff;';\n\t\ths+='cursor : default;';\n\t\ths+='height : 250px;';\n\t\ths+='left : 0px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 0px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 480px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._informationbg.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._informationbg.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme._information.appendChild(me._informationbg);\n\t\tel=me._info_text_body=document.createElement('div');\n\t\tels=me._info_text_body__text=document.createElement('div');\n\t\tel.className='ggskin ggskin_textdiv';\n\t\tel.ggTextDiv=els;\n\t\tel.ggId=\"info_text_body\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_text \";\n\t\tel.ggType='text';\n\t\ths ='';\n\t\ths+='height : 193px;';\n\t\ths+='left : 12px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 45px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 458px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\ths ='position:absolute;';\n\t\ths += 'box-sizing: border-box;';\n\t\ths+='cursor: default;';\n\t\ths+='left: 0px;';\n\t\ths+='top: 0px;';\n\t\ths+='width: 458px;';\n\t\ths+='height: 193px;';\n\t\ths+='border: 0px solid #000000;';\n\t\ths+='color: rgba(255,255,255,1);';\n\t\ths+='text-align: left;';\n\t\ths+='white-space: pre-wrap;';\n\t\ths+='padding: 0px 1px 0px 1px;';\n\t\ths+='overflow: hidden;';\n\t\ths+='overflow-y: auto;';\n\t\tels.setAttribute('style',hs);\n\t\tme._info_text_body.ggUpdateText=function() {\n\t\t\tvar hs=player.hotspot.description;\n\t\t\tif (hs!=this.ggText) {\n\t\t\t\tthis.ggText=hs;\n\t\t\t\tthis.ggTextDiv.innerHTML=hs;\n\t\t\t\tif (this.ggUpdatePosition) this.ggUpdatePosition();\n\t\t\t}\n\t\t}\n\t\tme._info_text_body.ggUpdateText();\n\t\tplayer.addListener('activehotspotchanged', function() {\n\t\t\tme._info_text_body.ggUpdateText();\n\t\t});\n\t\tel.appendChild(els);\n\t\tme._info_text_body.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._info_text_body.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme._information.appendChild(me._info_text_body);\n\t\tel=me._info_title=document.createElement('div');\n\t\tels=me._info_title__text=document.createElement('div');\n\t\tel.className='ggskin ggskin_textdiv';\n\t\tel.ggTextDiv=els;\n\t\tel.ggId=\"info_title\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_text \";\n\t\tel.ggType='text';\n\t\ths ='';\n\t\ths+='height : 20px;';\n\t\ths+='left : 12px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 15px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 245px;';\n\t\ths+='pointer-events:auto;';\n\t\ths+='font-weight: bold;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\ths ='position:absolute;';\n\t\ths += 'box-sizing: border-box;';\n\t\ths+='cursor: default;';\n\t\ths+='left: 0px;';\n\t\ths+='top: 0px;';\n\t\ths+='width: 245px;';\n\t\ths+='height: 20px;';\n\t\ths+='border: 0px solid #000000;';\n\t\ths+='color: rgba(255,255,255,1);';\n\t\ths+='text-align: left;';\n\t\ths+='white-space: nowrap;';\n\t\ths+='padding: 0px 1px 0px 1px;';\n\t\ths+='overflow: hidden;';\n\t\tels.setAttribute('style',hs);\n\t\tme._info_title.ggUpdateText=function() {\n\t\t\tvar hs=player.hotspot.title;\n\t\t\tif (hs!=this.ggText) {\n\t\t\t\tthis.ggText=hs;\n\t\t\t\tthis.ggTextDiv.innerHTML=hs;\n\t\t\t\tif (this.ggUpdatePosition) this.ggUpdatePosition();\n\t\t\t}\n\t\t}\n\t\tme._info_title.ggUpdateText();\n\t\tplayer.addListener('activehotspotchanged', function() {\n\t\t\tme._info_title.ggUpdateText();\n\t\t});\n\t\tel.appendChild(els);\n\t\tme._info_title.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._info_title.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme._information.appendChild(me._info_title);\n\t\tel=me._ht_info_close=document.createElement('div');\n\t\tels=me._ht_info_close__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgJy0vL1czQy8vRFREIFNWRyAxLjEvL0VOJyAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE1LjAuMiwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC'+\n\t\t\t'9zdmciIHdpZHRoPSIzMnB4IiB2aWV3Qm94PSIwIDAgMzIgMzIiIGhlaWdodD0iMzJweCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzIgMzIiIHg9IjBweCIgeT0iMHB4IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KIDxnIG9wYWNpdHk9IjAuNCI+CiAgPHBhdGggc3Ryb2tlPSIjM0MzQzNDIiBkPSJNMjEuMTMyLDE5LjQzOUwxNy42OTIsMTZsMy40NC0zLjQ0YzAuNDY4LTAuNDY3LDAuNDY4LTEuMjI1LDAtMS42OTMmI3hkOyYjeGE7JiN4OTsmI3g5O2MtMC40NjctMC40NjctMS4yMjUtMC40NjctMS42OTEsMC4wMDFMMTYsMTQuMzA4bC0zLjQ0MS0zLjQ0MWMtMC40NjctMC40NjctMS4yMjQt'+\n\t\t\t'MC40NjctMS42OTEsMC4wMDEmI3hkOyYjeGE7JiN4OTsmI3g5O2MtMC40NjcsMC40NjctMC40NjcsMS4yMjQsMCwxLjY5TDE0LjMwOSwxNmwtMy40NCwzLjQ0Yy0wLjQ2NywwLjQ2Ny0wLjQ2NywxLjIyNiwwLDEuNjkyYzAuNDY3LDAuNDY3LDEuMjI2LDAuNDY3LDEuNjkyLDAmI3hkOyYjeGE7JiN4OTsmI3g5O2wzLjQ0LTMuNDRsMy40MzksMy40MzljMC40NjgsMC40NjgsMS4yMjUsMC40NjgsMS42OTEsMC4wMDFDMjEuNTk5LDIwLjY2NCwyMS42LDE5LjkwNywyMS4xMzIsMTkuNDM5eiBNMjQuODM5LDcuMTYxJiN4ZDsmI3hhOyYjeDk7JiN4OTtjLTQuODgyLTQuODgyLTEyLjc5Ni00Ljg4Mi0xNy'+\n\t\t\t'42NzgsMGMtNC44ODEsNC44ODEtNC44ODEsMTIuNzk1LDAsMTcuNjc4YzQuODgxLDQuODgsMTIuNzk2LDQuODgsMTcuNjc4LDAmI3hkOyYjeGE7JiN4OTsmI3g5O0MyOS43MiwxOS45NTYsMjkuNzIsMTIuMDQyLDI0LjgzOSw3LjE2MXogTTE2LDI2LjEwNmMtMi41ODktMC4wMDEtNS4xNy0wLjk4NS03LjE0Ni0yLjk2MVM1Ljg5NSwxOC41OSw1Ljg5NCwxNiYjeGQ7JiN4YTsmI3g5OyYjeDk7YzAtMi41OTEsMC45ODQtNS4xNywyLjk2LTcuMTQ3QzEwLjgzLDYuODc4LDEzLjQwOSw1Ljg5NCwxNiw1Ljg5NGMyLjU5MSwwLjAwMSw1LjE3LDAuOTg0LDcuMTQ3LDIuOTU5JiN4ZDsmI3hhOyYjeDk7JiN4'+\n\t\t\t'OTtjMS45NzYsMS45NzcsMi45NTcsNC41NTYsMi45Niw3LjE0N2MtMC4wMDEsMi41OTEtMC45ODUsNS4xNjktMi45Niw3LjE0OEMyMS4xNjksMjUuMTIyLDE4LjU5MSwyNi4xMDYsMTYsMjYuMTA2eiIgc3Ryb2tlLXdpZHRoPSIxLjUiLz4KIDwvZz4KIDxnPgogIDxwYXRoIGZpbGw9IiNGRkZGRkYiIHN0cm9rZT0iIzAwMDAwMCIgZD0iTTIxLjEzMiwxOS40MzlMMTcuNjkyLDE2bDMuNDQtMy40NGMwLjQ2OC0wLjQ2NywwLjQ2OC0xLjIyNSwwLTEuNjkzJiN4ZDsmI3hhOyYjeDk7JiN4OTtjLTAuNDY3LTAuNDY3LTEuMjI1LTAuNDY3LTEuNjkxLDAuMDAxTDE2LDE0LjMwOGwtMy40NDEtMy40NDFjLT'+\n\t\t\t'AuNDY3LTAuNDY3LTEuMjI0LTAuNDY3LTEuNjkxLDAuMDAxJiN4ZDsmI3hhOyYjeDk7JiN4OTtjLTAuNDY3LDAuNDY3LTAuNDY3LDEuMjI0LDAsMS42OUwxNC4zMDksMTZsLTMuNDQsMy40NGMtMC40NjcsMC40NjctMC40NjcsMS4yMjYsMCwxLjY5MmMwLjQ2NywwLjQ2NywxLjIyNiwwLjQ2NywxLjY5MiwwJiN4ZDsmI3hhOyYjeDk7JiN4OTtsMy40NC0zLjQ0bDMuNDM5LDMuNDM5YzAuNDY4LDAuNDY4LDEuMjI1LDAuNDY4LDEuNjkxLDAuMDAxQzIxLjU5OSwyMC42NjQsMjEuNiwxOS45MDcsMjEuMTMyLDE5LjQzOXogTTI0LjgzOSw3LjE2MSYjeGQ7JiN4YTsmI3g5OyYjeDk7Yy00Ljg4Mi00Ljg4'+\n\t\t\t'Mi0xMi43OTYtNC44ODItMTcuNjc4LDBjLTQuODgxLDQuODgxLTQuODgxLDEyLjc5NSwwLDE3LjY3OGM0Ljg4MSw0Ljg4LDEyLjc5Niw0Ljg4LDE3LjY3OCwwJiN4ZDsmI3hhOyYjeDk7JiN4OTtDMjkuNzIsMTkuOTU2LDI5LjcyLDEyLjA0MiwyNC44MzksNy4xNjF6IE0xNiwyNi4xMDZjLTIuNTg5LTAuMDAxLTUuMTctMC45ODUtNy4xNDYtMi45NjFTNS44OTUsMTguNTksNS44OTQsMTYmI3hkOyYjeGE7JiN4OTsmI3g5O2MwLTIuNTkxLDAuOTg0LTUuMTcsMi45Ni03LjE0N0MxMC44Myw2Ljg3OCwxMy40MDksNS44OTQsMTYsNS44OTRjMi41OTEsMC4wMDEsNS4xNywwLjk4NCw3LjE0NywyLjk1OS'+\n\t\t\t'YjeGQ7JiN4YTsmI3g5OyYjeDk7YzEuOTc2LDEuOTc3LDIuOTU3LDQuNTU2LDIuOTYsNy4xNDdjLTAuMDAxLDIuNTkxLTAuOTg1LDUuMTY5LTIuOTYsNy4xNDhDMjEuMTY5LDI1LjEyMiwxOC41OTEsMjYuMTA2LDE2LDI2LjEwNnoiIHN0cm9rZS13aWR0aD0iMC4yIi8+CiA8L2c+Cjwvc3ZnPgo=';\n\t\tme._ht_info_close__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\telo=me._ht_info_close__imgo=document.createElement('img');\n\t\telo.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgJy0vL1czQy8vRFREIFNWRyAxLjEvL0VOJyAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE1LjAuMiwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC'+\n\t\t\t'9zdmciIHdpZHRoPSIzMnB4IiB2aWV3Qm94PSIwIDAgMzIgMzIiIGhlaWdodD0iMzJweCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzIgMzIiIHg9IjBweCIgeT0iMHB4IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE2LDE2KSBzY2FsZSgxLjEpIHRyYW5zbGF0ZSgtMTYsLTE2KSIgb3BhY2l0eT0iMC40Ij4KICA8cGF0aCBzdHJva2U9IiMzQzNDM0MiIGQ9Ik0yMS4xMzIsMTkuNDM5TDE3LjY5MywxNmwzLjQzOS0zLjQ0YzAuNDY4LTAuNDY3LDAuNDY4LTEuMjI2LDAuMDAxLTEuNjkzJiN4ZDsmI3hhOyYjeDk7JiN4OTtjLTAuNDY3LTAuNDY3LTEu'+\n\t\t\t'MjI1LTAuNDY3LTEuNjkyLDAuMDAxbC0zLjQ0LDMuNDRsLTMuNDQxLTMuNDQxYy0wLjQ2OC0wLjQ2OC0xLjIyNS0wLjQ2Ny0xLjY5MywwJiN4ZDsmI3hhOyYjeDk7JiN4OTtjLTAuNDY3LDAuNDY3LTAuNDY3LDEuMjI1LDAsMS42OTJMMTQuMzA5LDE2bC0zLjQ0LDMuNDRjLTAuNDY3LDAuNDY2LTAuNDY3LDEuMjI0LDAsMS42OTFjMC40NjcsMC40NjcsMS4yMjYsMC40NjcsMS42OTIsMC4wMDEmI3hkOyYjeGE7JiN4OTsmI3g5O2wzLjQ0LTMuNDRsMy40NCwzLjQzOWMwLjQ2OCwwLjQ2OCwxLjIyNCwwLjQ2NywxLjY5MSwwQzIxLjU5OCwyMC42NjQsMjEuNiwxOS45MDcsMjEuMTMyLDE5LjQzOXogTT'+\n\t\t\t'I0LjgzOSw3LjE2MSYjeGQ7JiN4YTsmI3g5OyYjeDk7Yy00Ljg4Mi00Ljg4Mi0xMi43OTYtNC44ODItMTcuNjc4LDBjLTQuODgxLDQuODgxLTQuODgxLDEyLjc5NiwwLDE3LjY3OGM0Ljg4Miw0Ljg4MSwxMi43OTYsNC44ODEsMTcuNjc4LDAmI3hkOyYjeGE7JiN4OTsmI3g5O0MyOS43MiwxOS45NTcsMjkuNzIxLDEyLjA0MywyNC44MzksNy4xNjF6IE0xNiwyNi4xMDZjLTIuNTksMC01LjE3MS0wLjk4NC03LjE0Ni0yLjk1OUM2Ljg3OCwyMS4xNyw1Ljg5NSwxOC41OTEsNS44OTQsMTYmI3hkOyYjeGE7JiN4OTsmI3g5O2MwLTIuNTkxLDAuOTgzLTUuMTcsMi45NTktNy4xNDdjMS45NzctMS45NzYs'+\n\t\t\t'NC41NTYtMi45NTksNy4xNDgtMi45NmMyLjU5MSwwLjAwMSw1LjE3LDAuOTg0LDcuMTQ3LDIuOTU5JiN4ZDsmI3hhOyYjeDk7JiN4OTtjMS45NzUsMS45NzcsMi45NTcsNC41NTYsMi45NTksNy4xNDdjLTAuMDAxLDIuNTkyLTAuOTg0LDUuMTctMi45Niw3LjE0OEMyMS4xNywyNS4xMjMsMTguNTkxLDI2LjEwNywxNiwyNi4xMDZ6IiBzdHJva2Utd2lkdGg9IjEuNSIvPgogPC9nPgogPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTYsMTYpIHNjYWxlKDEuMSkgdHJhbnNsYXRlKC0xNiwtMTYpIj4KICA8cGF0aCBmaWxsPSIjRkZGRkZGIiBzdHJva2U9IiMwMDAwMDAiIGQ9Ik0yMS4xMzIsMTkuNDM5TD'+\n\t\t\t'E3LjY5MywxNmwzLjQzOS0zLjQ0JiN4ZDsmI3hhOyYjeDk7JiN4OTtjMC40NjgtMC40NjcsMC40NjgtMS4yMjYsMC4wMDEtMS42OTNjLTAuNDY3LTAuNDY3LTEuMjI1LTAuNDY3LTEuNjkyLDAuMDAxbC0zLjQ0LDMuNDRsLTMuNDQxLTMuNDQxJiN4ZDsmI3hhOyYjeDk7JiN4OTtjLTAuNDY4LTAuNDY4LTEuMjI1LTAuNDY3LTEuNjkzLDBjLTAuNDY3LDAuNDY3LTAuNDY3LDEuMjI1LDAsMS42OTJMMTQuMzA5LDE2bC0zLjQ0LDMuNDRjLTAuNDY3LDAuNDY2LTAuNDY3LDEuMjI0LDAsMS42OTEmI3hkOyYjeGE7JiN4OTsmI3g5O2MwLjQ2NywwLjQ2NywxLjIyNiwwLjQ2NywxLjY5MiwwLjAwMWwzLjQ0'+\n\t\t\t'LTMuNDRsMy40NCwzLjQzOWMwLjQ2OCwwLjQ2OCwxLjIyNCwwLjQ2NywxLjY5MSwwJiN4ZDsmI3hhOyYjeDk7JiN4OTtDMjEuNTk4LDIwLjY2NCwyMS42LDE5LjkwNywyMS4xMzIsMTkuNDM5eiBNMjQuODM5LDcuMTYxYy00Ljg4Mi00Ljg4Mi0xMi43OTYtNC44ODItMTcuNjc4LDBjLTQuODgxLDQuODgxLTQuODgxLDEyLjc5NiwwLDE3LjY3OCYjeGQ7JiN4YTsmI3g5OyYjeDk7YzQuODgyLDQuODgxLDEyLjc5Niw0Ljg4MSwxNy42NzgsMEMyOS43MiwxOS45NTcsMjkuNzIxLDEyLjA0MywyNC44MzksNy4xNjF6IE0xNiwyNi4xMDZjLTIuNTksMC01LjE3MS0wLjk4NC03LjE0Ni0yLjk1OSYjeGQ7Ji'+\n\t\t\t'N4YTsmI3g5OyYjeDk7QzYuODc4LDIxLjE3LDUuODk1LDE4LjU5MSw1Ljg5NCwxNmMwLTIuNTkxLDAuOTgzLTUuMTcsMi45NTktNy4xNDdjMS45NzctMS45NzYsNC41NTYtMi45NTksNy4xNDgtMi45NiYjeGQ7JiN4YTsmI3g5OyYjeDk7YzIuNTkxLDAuMDAxLDUuMTcsMC45ODQsNy4xNDcsMi45NTljMS45NzUsMS45NzcsMi45NTcsNC41NTYsMi45NTksNy4xNDdjLTAuMDAxLDIuNTkyLTAuOTg0LDUuMTctMi45Niw3LjE0OCYjeGQ7JiN4YTsmI3g5OyYjeDk7QzIxLjE3LDI1LjEyMywxOC41OTEsMjYuMTA3LDE2LDI2LjEwNnoiIHN0cm9rZS13aWR0aD0iMC4yIi8+CiA8L2c+Cjwvc3ZnPgo=';\n\t\tme._ht_info_close__imgo.setAttribute('src',hs);\n\t\telo.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;visibility:hidden;pointer-events:none;;');\n\t\telo['ondragstart']=function() { return false; };\n\t\tel.appendChild(elo);\n\t\tel.ggId=\"ht_info_close\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 32px;';\n\t\ths+='position : absolute;';\n\t\ths+='right : 1px;';\n\t\ths+='top : 4px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 32px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_info_close.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._ht_info_close.onclick=function (e) {\n\t\t\tplayer.setVariableValue('vis_info_popup', false);\n\t\t}\n\t\tme._ht_info_close.onmouseover=function (e) {\n\t\t\tme._ht_info_close__img.style.visibility='hidden';\n\t\t\tme._ht_info_close__imgo.style.visibility='inherit';\n\t\t}\n\t\tme._ht_info_close.onmouseout=function (e) {\n\t\t\tme._ht_info_close__img.style.visibility='inherit';\n\t\t\tme._ht_info_close__imgo.style.visibility='hidden';\n\t\t}\n\t\tme._ht_info_close.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme._information.appendChild(me._ht_info_close);\n\t\tme.divSkin.appendChild(me._information);\n\t\tel=me._video_screentint_youtube=document.createElement('div');\n\t\tel.ggId=\"video_screentint_youtube\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_rectangle \";\n\t\tel.ggType='rectangle';\n\t\ths ='';\n\t\ths+='background : rgba(0,0,0,0.392157);';\n\t\ths+='border : 0px solid #000000;';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 100%;';\n\t\ths+='left : 0%;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 0%;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 100%;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._video_screentint_youtube.ggIsActive=function() {\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._video_screentint_youtube.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('vis_video_youtube') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._video_screentint_youtube.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._video_screentint_youtube.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._video_screentint_youtube.style[domTransition]='';\n\t\t\t\tif (me._video_screentint_youtube.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._video_screentint_youtube.style.visibility=(Number(me._video_screentint_youtube.style.opacity)>0||!me._video_screentint_youtube.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._video_screentint_youtube.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._video_screentint_youtube.style.visibility=\"hidden\";\n\t\t\t\t\tme._video_screentint_youtube.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._video_screentint_youtube.onclick=function (e) {\n\t\t\tplayer.setVariableValue('vis_video_youtube', false);\n\t\t}\n\t\tme._video_screentint_youtube.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme.divSkin.appendChild(me._video_screentint_youtube);\n\t\tel=me._video_popup_youtube=document.createElement('div');\n\t\tel.ggId=\"video_popup_youtube\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_container \";\n\t\tel.ggType='container';\n\t\ths ='';\n\t\ths+='height : 80%;';\n\t\ths+='left : 10%;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 10%;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 80%;';\n\t\ths+='pointer-events:none;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._video_popup_youtube.ggIsActive=function() {\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._video_popup_youtube.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('vis_video_youtube') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._video_popup_youtube.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._video_popup_youtube.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._video_popup_youtube.style[domTransition]='';\n\t\t\t\tif (me._video_popup_youtube.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._video_popup_youtube.style.visibility=(Number(me._video_popup_youtube.style.opacity)>0||!me._video_popup_youtube.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._video_popup_youtube.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._video_popup_youtube.style.visibility=\"hidden\";\n\t\t\t\t\tme._video_popup_youtube.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._video_popup_youtube.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._loading_video_youtube=document.createElement('div');\n\t\tels=me._loading_video_youtube__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PHN2ZyBmaWxsPSJ3aGl0ZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iNjQiIHZpZXdCb3g9IjAgMCAzMiAzMiIgaGVpZ2h0PSI2NCI+CiA8Y2lyY2xlIGN5PSIzIiByPSIwIiBjeD0iMTYiPgogIDxhbmltYXRlIGJlZ2luPSIwIiBjYWxjTW9kZT0ic3BsaW5lIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIga2V5U3BsaW5lcz0iMC4yIDAuMiAwLjQgMC44OzAuMiAwLjIgMC40IDAuODswLjIgMC4yIDAuNCAwLjgiIHZhbHVlcz0iMDszOzA7MCIgYXR0cmlidXRlTmFtZT0iciIgZHVyPSIxcyIvPgogPC9jaXJjbGU+CiA8Y2lyY2xlIGN5PSIzIiByPSIwIiB0cmFuc2'+\n\t\t\t'Zvcm09InJvdGF0ZSg0NSAxNiAxNikiIGN4PSIxNiI+CiAgPGFuaW1hdGUgYmVnaW49IjAuMTI1cyIgY2FsY01vZGU9InNwbGluZSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGtleVNwbGluZXM9IjAuMiAwLjIgMC40IDAuODswLjIgMC4yIDAuNCAwLjg7MC4yIDAuMiAwLjQgMC44IiB2YWx1ZXM9IjA7MzswOzAiIGF0dHJpYnV0ZU5hbWU9InIiIGR1cj0iMXMiLz4KIDwvY2lyY2xlPgogPGNpcmNsZSBjeT0iMyIgcj0iMCIgdHJhbnNmb3JtPSJyb3RhdGUoOTAgMTYgMTYpIiBjeD0iMTYiPgogIDxhbmltYXRlIGJlZ2luPSIwLjI1cyIgY2FsY01vZGU9InNwbGluZSIgcmVwZWF0Q291bnQ9Imlu'+\n\t\t\t'ZGVmaW5pdGUiIGtleVNwbGluZXM9IjAuMiAwLjIgMC40IDAuODswLjIgMC4yIDAuNCAwLjg7MC4yIDAuMiAwLjQgMC44IiB2YWx1ZXM9IjA7MzswOzAiIGF0dHJpYnV0ZU5hbWU9InIiIGR1cj0iMXMiLz4KIDwvY2lyY2xlPgogPGNpcmNsZSBjeT0iMyIgcj0iMCIgdHJhbnNmb3JtPSJyb3RhdGUoMTM1IDE2IDE2KSIgY3g9IjE2Ij4KICA8YW5pbWF0ZSBiZWdpbj0iMC4zNzVzIiBjYWxjTW9kZT0ic3BsaW5lIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIga2V5U3BsaW5lcz0iMC4yIDAuMiAwLjQgMC44OzAuMiAwLjIgMC40IDAuODswLjIgMC4yIDAuNCAwLjgiIHZhbHVlcz0iMDszOzA7MCIgYX'+\n\t\t\t'R0cmlidXRlTmFtZT0iciIgZHVyPSIxcyIvPgogPC9jaXJjbGU+CiA8Y2lyY2xlIGN5PSIzIiByPSIwIiB0cmFuc2Zvcm09InJvdGF0ZSgxODAgMTYgMTYpIiBjeD0iMTYiPgogIDxhbmltYXRlIGJlZ2luPSIwLjVzIiBjYWxjTW9kZT0ic3BsaW5lIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIga2V5U3BsaW5lcz0iMC4yIDAuMiAwLjQgMC44OzAuMiAwLjIgMC40IDAuODswLjIgMC4yIDAuNCAwLjgiIHZhbHVlcz0iMDszOzA7MCIgYXR0cmlidXRlTmFtZT0iciIgZHVyPSIxcyIvPgogPC9jaXJjbGU+CiA8Y2lyY2xlIGN5PSIzIiByPSIwIiB0cmFuc2Zvcm09InJvdGF0ZSgyMjUgMTYgMTYpIiBj'+\n\t\t\t'eD0iMTYiPgogIDxhbmltYXRlIGJlZ2luPSIwLjYyNXMiIGNhbGNNb2RlPSJzcGxpbmUiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBrZXlTcGxpbmVzPSIwLjIgMC4yIDAuNCAwLjg7MC4yIDAuMiAwLjQgMC44OzAuMiAwLjIgMC40IDAuOCIgdmFsdWVzPSIwOzM7MDswIiBhdHRyaWJ1dGVOYW1lPSJyIiBkdXI9IjFzIi8+CiA8L2NpcmNsZT4KIDxjaXJjbGUgY3k9IjMiIHI9IjAiIHRyYW5zZm9ybT0icm90YXRlKDI3MCAxNiAxNikiIGN4PSIxNiI+CiAgPGFuaW1hdGUgYmVnaW49IjAuNzVzIiBjYWxjTW9kZT0ic3BsaW5lIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIga2V5U3BsaW5lcz0iMC'+\n\t\t\t'4yIDAuMiAwLjQgMC44OzAuMiAwLjIgMC40IDAuODswLjIgMC4yIDAuNCAwLjgiIHZhbHVlcz0iMDszOzA7MCIgYXR0cmlidXRlTmFtZT0iciIgZHVyPSIxcyIvPgogPC9jaXJjbGU+CiA8Y2lyY2xlIGN5PSIzIiByPSIwIiB0cmFuc2Zvcm09InJvdGF0ZSgzMTUgMTYgMTYpIiBjeD0iMTYiPgogIDxhbmltYXRlIGJlZ2luPSIwLjg3NXMiIGNhbGNNb2RlPSJzcGxpbmUiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBrZXlTcGxpbmVzPSIwLjIgMC4yIDAuNCAwLjg7MC4yIDAuMiAwLjQgMC44OzAuMiAwLjIgMC40IDAuOCIgdmFsdWVzPSIwOzM7MDswIiBhdHRyaWJ1dGVOYW1lPSJyIiBkdXI9IjFz'+\n\t\t\t'Ii8+CiA8L2NpcmNsZT4KIDxjaXJjbGUgY3k9IjMiIHI9IjAiIHRyYW5zZm9ybT0icm90YXRlKDE4MCAxNiAxNikiIGN4PSIxNiI+CiAgPGFuaW1hdGUgYmVnaW49IjAuNXMiIGNhbGNNb2RlPSJzcGxpbmUiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBrZXlTcGxpbmVzPSIwLjIgMC4yIDAuNCAwLjg7MC4yIDAuMiAwLjQgMC44OzAuMiAwLjIgMC40IDAuOCIgdmFsdWVzPSIwOzM7MDswIiBhdHRyaWJ1dGVOYW1lPSJyIiBkdXI9IjFzIi8+CiA8L2NpcmNsZT4KPC9zdmc+Cg==';\n\t\tme._loading_video_youtube__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\tel.ggId=\"loading_video_youtube\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='height : 40px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 40px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._loading_video_youtube.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._loading_video_youtube.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t}\n\t\tme._video_popup_youtube.appendChild(me._loading_video_youtube);\n\t\tel=me._popup_video_youtube=document.createElement('div');\n\t\tme._popup_video_youtube.seekbars = [];\n\t\t\tme._popup_video_youtube.ggYoutubeApiReady = function() { me._popup_video_youtube.ggYoutubeApiLoaded = true;}\n\t\tme._popup_video_youtube.ggInitMedia = function(media) {\n\t\t\tvar notifySeekbars = function() {\n\t\t\t\tfor (var i = 0; i < me._popup_video_youtube.seekbars.length; i++) {\n\t\t\t\t\tvar seekbar = me.findElements(me._popup_video_youtube.seekbars[i]);\n\t\t\t\t\tif (seekbar.length > 0) seekbar[0].connectToMediaEl();\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (me._popup_video_youtube.hasChildNodes()) {\n\t\t\t\tme._popup_video_youtube.removeChild(me._popup_video_youtube.lastChild);\n\t\t\t}\n\t\t\tif(media == '') {\n\t\t\t\tnotifySeekbars();\n\t\t\tif (me._popup_video_youtube.ggVideoNotLoaded ==false && me._popup_video_youtube.ggDeactivate) { me._popup_video_youtube.ggDeactivate(); }\n\t\t\t\tme._popup_video_youtube.ggVideoNotLoaded = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tme._popup_video_youtube.ggVideoNotLoaded = false;\n\t\t\tme._popup_video_youtube__vid=document.createElement('iframe');\n\t\t\tme._popup_video_youtube__vid.className='ggskin ggskin_video';\n\t\t\tvar ggVideoParams = '?autoplay=1&amp;controls=1&amp;loop=0&amp;enablejsapi=0&amp;rel=0';\n\t\t\tvar ggVideoUrl = 'https://www.youtube.com/embed/' + media + ggVideoParams;\n\t\t\tme._popup_video_youtube__vid.setAttribute('src', ggVideoUrl);\n\t\t\tme._popup_video_youtube__vid.setAttribute('width', '100%');\n\t\t\tme._popup_video_youtube__vid.setAttribute('height', '100%');\n\t\t\tme._popup_video_youtube__vid.setAttribute('allow', 'autoplay');\n\t\t\tme._popup_video_youtube__vid.setAttribute('allowfullscreen', 'true');\n\t\t\tme._popup_video_youtube__vid.setAttribute('style', 'border:none; ; ;');\n\t\t\tme._popup_video_youtube.appendChild(me._popup_video_youtube__vid);\n\t\t\tme._popup_video_youtube.ggVideoSource = media;\n\t\t\tif (me._popup_video_youtube.ggYoutubeApiLoaded && me._popup_video_youtube.ggYoutubeApiLoaded == true) {me._popup_video_youtube.ggYoutubeApiReady();}\n\t\t}\n\t\tel.ggId=\"popup_video_youtube\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_video \";\n\t\tel.ggType='video';\n\t\ths ='';\n\t\ths+='height : 100%;';\n\t\ths+='left : 0%;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 0%;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 100%;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._popup_video_youtube.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._popup_video_youtube.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('vis_video_youtube') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._popup_video_youtube.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._popup_video_youtube.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._popup_video_youtube.style[domTransition]='';\n\t\t\t\tif (me._popup_video_youtube.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._popup_video_youtube.style.visibility=(Number(me._popup_video_youtube.style.opacity)>0||!me._popup_video_youtube.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tif (me._popup_video_youtube.ggVideoNotLoaded) {\n\t\t\t\t\t\tme._popup_video_youtube.ggInitMedia(me._popup_video_youtube.ggVideoSource);\n\t\t\t\t\t}\n\t\t\t\t\tme._popup_video_youtube.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._popup_video_youtube.style.visibility=\"hidden\";\n\t\t\t\t\tme._popup_video_youtube.ggInitMedia('');\n\t\t\t\t\tme._popup_video_youtube.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._popup_video_youtube.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme._video_popup_youtube.appendChild(me._popup_video_youtube);\n\t\tme.divSkin.appendChild(me._video_popup_youtube);\n\t\tel=me._video_popup_close_youtube=document.createElement('div');\n\t\tels=me._video_popup_close_youtube__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yNDAgMzMyIDEzMCAxMzAiIGJhc2VQcm9maWxlPSJ0aW55IiB4PSIwcHgiIHk9IjBweCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiA8ZyBpZD0iTG'+\n\t\t\t'F5ZXJfMV8xXyI+CiAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xMzUuMywzNTcuM2MtMjEuOS0yMS45LTU3LjUtMjEuOS03OS40LDBjLTIxLjksMjEuOS0yMS45LDU3LjUsMCw3OS40YzIxLjksMjEuOSw1Ny41LDIxLjksNzkuNCwwJiN4ZDsmI3hhOyYjeDk7JiN4OTtTLTExMy40LDM3OS4yLTEzNS4zLDM1Ny4zeiBNLTE0NS44LDQxMi43YzAuOCwwLjgsMC44LDEuNS0wLjEsMi40bC0xMC45LDEwLjljLTAuNCwwLjQtMC44LDAuNS0xLjMsMC41Yy0wLjUsMC0wLjktMC4xLTEuMS0wLjQmI3hkOyYjeGE7JiN4OTsmI3g5O2wtMTUuOC0xNS44bC0xNS43LDE1LjdjLTAuNCwwLjQtMC44LDAuNS0x'+\n\t\t\t'LjMsMC41cy0wLjktMC4xLTEuMS0wLjRsLTExLjEtMTEuMWMtMC4zLTAuMy0wLjQtMC42LTAuNC0xLjFjMC0wLjUsMC4xLTAuOSwwLjUtMS4zJiN4ZDsmI3hhOyYjeDk7JiN4OTtsMTUuNy0xNS43bC0xNS44LTE1LjhjLTAuMy0wLjMtMC40LTAuNi0wLjQtMS4xYzAtMC41LDAuMS0wLjksMC41LTEuM2wxMC45LTEwLjljMC45LTAuOSwxLjctMC45LDIuNC0wLjFsMTUuOCwxNS44bDE1LjctMTUuNyYjeGQ7JiN4YTsmI3g5OyYjeDk7YzAuOS0wLjksMS43LTAuOSwyLjQtMC4xbDExLjEsMTEuMWMwLjgsMC44LDAuOCwxLjUtMC4xLDIuNGwtMTUuNywxNS43TC0xNDUuOCw0MTIuN3oiLz4KIDwvZz4KID'+\n\t\t\t'xnIGlkPSJMYXllcl8yIj4KICA8cGF0aCBmaWxsPSIjRkZGRkZGIiBkPSJNLTE2MS42LDM5Ni45bDE1LjgsMTUuOGMwLjgsMC44LDAuOCwxLjUtMC4xLDIuNGwtMTAuOSwxMC45Yy0wLjQsMC40LTAuOCwwLjUtMS4zLDAuNSYjeGQ7JiN4YTsmI3g5OyYjeDk7Yy0wLjUsMC0wLjktMC4xLTEuMS0wLjRsLTE1LjgtMTUuOGwtMTUuNywxNS43Yy0wLjQsMC40LTAuOCwwLjUtMS4zLDAuNXMtMC45LTAuMS0xLjEtMC40bC0xMS4xLTExLjFjLTAuMy0wLjMtMC40LTAuNi0wLjQtMS4xJiN4ZDsmI3hhOyYjeDk7JiN4OTtjMC0wLjUsMC4xLTAuOSwwLjUtMS4zbDE1LjctMTUuN2wtMTUuOC0xNS44Yy0wLjMt'+\n\t\t\t'MC4zLTAuNC0wLjYtMC40LTEuMWMwLTAuNSwwLjEtMC45LDAuNS0xLjNsMTAuOS0xMC45YzAuOS0wLjksMS43LTAuOSwyLjQtMC4xJiN4ZDsmI3hhOyYjeDk7JiN4OTtsMTUuOCwxNS44bDE1LjctMTUuN2MwLjktMC45LDEuNy0wLjksMi40LTAuMWwxMS4xLDExLjFjMC44LDAuOCwwLjgsMS41LTAuMSwyLjRMLTE2MS42LDM5Ni45eiIvPgogPC9nPgo8L3N2Zz4K';\n\t\tme._video_popup_close_youtube__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\telo=me._video_popup_close_youtube__imgo=document.createElement('img');\n\t\telo.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yNDAgMzMyIDEzMCAxMzAiIGJhc2VQcm9maWxlPSJ0aW55IiB4PSIwcHgiIHk9IjBweCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiA8ZyBpZD0iTG'+\n\t\t\t'F5ZXJfMV8xXyI+CiAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xMzAuOSwzNTIuOWMtMjQuNC0yNC40LTYzLjgtMjQuNC04OC4yLDBjLTI0LjQsMjQuNC0yNC40LDYzLjgsMCw4OC4yYzI0LjQsMjQuNCw2My44LDI0LjQsODguMiwwJiN4ZDsmI3hhOyYjeDk7JiN4OTtTLTEwNi41LDM3Ny4zLTEzMC45LDM1Mi45eiBNLTE0Mi41LDQxNC41YzAuOCwwLjgsMC44LDEuNy0wLjEsMi43bC0xMi4yLDEyLjJjLTAuNCwwLjQtMC44LDAuNi0xLjQsMC42Yy0wLjYsMC0xLTAuMS0xLjMtMC40JiN4ZDsmI3hhOyYjeDk7JiN4OTtsLTE3LjUtMTcuNWwtMTcuNCwxNy40Yy0wLjQsMC40LTAuOCwwLjYtMS40'+\n\t\t\t'LDAuNmMtMC42LDAtMS0wLjEtMS4zLTAuNGwtMTIuMy0xMi4zYy0wLjMtMC4zLTAuNC0wLjctMC40LTEuM2MwLTAuNiwwLjEtMSwwLjYtMS40JiN4ZDsmI3hhOyYjeDk7JiN4OTtsMTcuNC0xNy40bC0xNy41LTE3LjVjLTAuMy0wLjMtMC40LTAuNy0wLjQtMS4zYzAtMC42LDAuMS0xLDAuNi0xLjRsMTIuMi0xMi4yYzEtMSwxLjgtMSwyLjctMC4xbDE3LjUsMTcuNWwxNy40LTE3LjQmI3hkOyYjeGE7JiN4OTsmI3g5O2MxLTEsMS44LTEsMi43LTAuMWwxMi4zLDEyLjNjMC44LDAuOCwwLjgsMS43LTAuMSwyLjdsLTE3LjQsMTcuNEwtMTQyLjUsNDE0LjV6Ii8+CiA8L2c+CiA8ZyBpZD0iTGF5ZXJfMi'+\n\t\t\t'I+CiAgPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTS0xNjAuMSwzOTYuOWwxNy41LDE3LjVjMC44LDAuOCwwLjgsMS43LTAuMSwyLjdsLTEyLjIsMTIuMmMtMC40LDAuNC0wLjgsMC42LTEuNCwwLjYmI3hkOyYjeGE7JiN4OTsmI3g5O2MtMC42LDAtMS0wLjEtMS4zLTAuNGwtMTcuNS0xNy41bC0xNy40LDE3LjRjLTAuNCwwLjQtMC44LDAuNi0xLjQsMC42Yy0wLjYsMC0xLTAuMS0xLjMtMC40bC0xMi4zLTEyLjNjLTAuMy0wLjMtMC40LTAuNy0wLjQtMS4zJiN4ZDsmI3hhOyYjeDk7JiN4OTtjMC0wLjYsMC4xLTEsMC42LTEuNGwxNy40LTE3LjRsLTE3LjUtMTcuNWMtMC4zLTAuMy0wLjQtMC43LTAu'+\n\t\t\t'NC0xLjNjMC0wLjYsMC4xLTEsMC42LTEuNGwxMi4yLTEyLjJjMS0xLDEuOC0xLDIuNy0wLjFsMTcuNSwxNy41JiN4ZDsmI3hhOyYjeDk7JiN4OTtsMTcuNC0xNy40YzEtMSwxLjgtMSwyLjctMC4xbDEyLjMsMTIuM2MwLjgsMC44LDAuOCwxLjctMC4xLDIuN0wtMTYwLjEsMzk2Ljl6Ii8+CiA8L2c+Cjwvc3ZnPgo=';\n\t\tme._video_popup_close_youtube__imgo.setAttribute('src',hs);\n\t\telo.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;visibility:hidden;pointer-events:none;;');\n\t\telo['ondragstart']=function() { return false; };\n\t\tel.appendChild(elo);\n\t\tel.ggId=\"video_popup_close_youtube\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 32px;';\n\t\ths+='position : absolute;';\n\t\ths+='right : 5px;';\n\t\ths+='top : 5px;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 32px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._video_popup_close_youtube.ggIsActive=function() {\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._video_popup_close_youtube.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('vis_video_youtube') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._video_popup_close_youtube.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._video_popup_close_youtube.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._video_popup_close_youtube.style[domTransition]='';\n\t\t\t\tif (me._video_popup_close_youtube.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._video_popup_close_youtube.style.visibility=(Number(me._video_popup_close_youtube.style.opacity)>0||!me._video_popup_close_youtube.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._video_popup_close_youtube.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._video_popup_close_youtube.style.visibility=\"hidden\";\n\t\t\t\t\tme._video_popup_close_youtube.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._video_popup_close_youtube.onclick=function (e) {\n\t\t\tplayer.setVariableValue('vis_video_youtube', false);\n\t\t}\n\t\tme._video_popup_close_youtube.onmouseover=function (e) {\n\t\t\tme._video_popup_close_youtube__img.style.visibility='hidden';\n\t\t\tme._video_popup_close_youtube__imgo.style.visibility='inherit';\n\t\t}\n\t\tme._video_popup_close_youtube.onmouseout=function (e) {\n\t\t\tme._video_popup_close_youtube__img.style.visibility='inherit';\n\t\t\tme._video_popup_close_youtube__imgo.style.visibility='hidden';\n\t\t}\n\t\tme._video_popup_close_youtube.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme.divSkin.appendChild(me._video_popup_close_youtube);\n\t\tel=me._screen_tint_url=document.createElement('div');\n\t\tel.ggId=\"screen_tint_url\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_rectangle \";\n\t\tel.ggType='rectangle';\n\t\ths ='';\n\t\ths+='background : rgba(0,0,0,0.392157);';\n\t\ths+='border : 0px solid #000000;';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 100%;';\n\t\ths+='left : 0%;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 0%;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 100%;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._screen_tint_url.ggIsActive=function() {\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._screen_tint_url.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('vis_website') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._screen_tint_url.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._screen_tint_url.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._screen_tint_url.style[domTransition]='';\n\t\t\t\tif (me._screen_tint_url.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._screen_tint_url.style.visibility=(Number(me._screen_tint_url.style.opacity)>0||!me._screen_tint_url.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._screen_tint_url.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._screen_tint_url.style.visibility=\"hidden\";\n\t\t\t\t\tme._screen_tint_url.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._screen_tint_url.onclick=function (e) {\n\t\t\tplayer.setVariableValue('vis_website', false);\n\t\t}\n\t\tme._screen_tint_url.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme.divSkin.appendChild(me._screen_tint_url);\n\t\tel=me._web_page=document.createElement('div');\n\t\tels=me._web_page__text=document.createElement('div');\n\t\tel.className='ggskin ggskin_textdiv';\n\t\tel.ggTextDiv=els;\n\t\tel.ggId=\"web_page\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_text \";\n\t\tel.ggType='text';\n\t\ths ='';\n\t\ths+='height : 90%;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 90%;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='0% 0%';\n\t\ths ='position:absolute;';\n\t\ths += 'box-sizing: border-box;';\n\t\ths+='cursor: default;';\n\t\ths+='left: 0px;';\n\t\ths+='top: 0px;';\n\t\ths+='width: 100%;';\n\t\ths+='height: 100%;';\n\t\ths+='border: 0px solid #000000;';\n\t\ths+='color: #000000;';\n\t\ths+='text-align: center;';\n\t\ths+='white-space: nowrap;';\n\t\ths+='padding: 0px 1px 0px 1px;';\n\t\ths+='overflow: hidden;';\n\t\tels.setAttribute('style',hs);\n\t\tels.innerHTML=\"\";\n\t\tel.appendChild(els);\n\t\tme._web_page.ggIsActive=function() {\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._web_page.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('vis_website') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._web_page.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._web_page.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._web_page.style[domTransition]='';\n\t\t\t\tif (me._web_page.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._web_page.style.visibility=(Number(me._web_page.style.opacity)>0||!me._web_page.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._web_page.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._web_page.style.visibility=\"hidden\";\n\t\t\t\t\tme._web_page.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._web_page.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=((this.ggDx * pw)/100.0 + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=((this.ggDy * ph)/100.0 + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t}\n\t\tme.divSkin.appendChild(me._web_page);\n\t\tel=me._close_url=document.createElement('div');\n\t\tels=me._close_url__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yNDAgMzMyIDEzMCAxMzAiIGJhc2VQcm9maWxlPSJ0aW55IiB4PSIwcHgiIHk9IjBweCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiA8ZyBpZD0iTG'+\n\t\t\t'F5ZXJfMV8xXyI+CiAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xMzUuMywzNTcuM2MtMjEuOS0yMS45LTU3LjUtMjEuOS03OS40LDBjLTIxLjksMjEuOS0yMS45LDU3LjUsMCw3OS40YzIxLjksMjEuOSw1Ny41LDIxLjksNzkuNCwwJiN4ZDsmI3hhOyYjeDk7JiN4OTtTLTExMy40LDM3OS4yLTEzNS4zLDM1Ny4zeiBNLTE0NS44LDQxMi43YzAuOCwwLjgsMC44LDEuNS0wLjEsMi40bC0xMC45LDEwLjljLTAuNCwwLjQtMC44LDAuNS0xLjMsMC41Yy0wLjUsMC0wLjktMC4xLTEuMS0wLjQmI3hkOyYjeGE7JiN4OTsmI3g5O2wtMTUuOC0xNS44bC0xNS43LDE1LjdjLTAuNCwwLjQtMC44LDAuNS0x'+\n\t\t\t'LjMsMC41cy0wLjktMC4xLTEuMS0wLjRsLTExLjEtMTEuMWMtMC4zLTAuMy0wLjQtMC42LTAuNC0xLjFjMC0wLjUsMC4xLTAuOSwwLjUtMS4zJiN4ZDsmI3hhOyYjeDk7JiN4OTtsMTUuNy0xNS43bC0xNS44LTE1LjhjLTAuMy0wLjMtMC40LTAuNi0wLjQtMS4xYzAtMC41LDAuMS0wLjksMC41LTEuM2wxMC45LTEwLjljMC45LTAuOSwxLjctMC45LDIuNC0wLjFsMTUuOCwxNS44bDE1LjctMTUuNyYjeGQ7JiN4YTsmI3g5OyYjeDk7YzAuOS0wLjksMS43LTAuOSwyLjQtMC4xbDExLjEsMTEuMWMwLjgsMC44LDAuOCwxLjUtMC4xLDIuNGwtMTUuNywxNS43TC0xNDUuOCw0MTIuN3oiLz4KIDwvZz4KID'+\n\t\t\t'xnIGlkPSJMYXllcl8yIj4KICA8cGF0aCBmaWxsPSIjRkZGRkZGIiBkPSJNLTE2MS42LDM5Ni45bDE1LjgsMTUuOGMwLjgsMC44LDAuOCwxLjUtMC4xLDIuNGwtMTAuOSwxMC45Yy0wLjQsMC40LTAuOCwwLjUtMS4zLDAuNSYjeGQ7JiN4YTsmI3g5OyYjeDk7Yy0wLjUsMC0wLjktMC4xLTEuMS0wLjRsLTE1LjgtMTUuOGwtMTUuNywxNS43Yy0wLjQsMC40LTAuOCwwLjUtMS4zLDAuNXMtMC45LTAuMS0xLjEtMC40bC0xMS4xLTExLjFjLTAuMy0wLjMtMC40LTAuNi0wLjQtMS4xJiN4ZDsmI3hhOyYjeDk7JiN4OTtjMC0wLjUsMC4xLTAuOSwwLjUtMS4zbDE1LjctMTUuN2wtMTUuOC0xNS44Yy0wLjMt'+\n\t\t\t'MC4zLTAuNC0wLjYtMC40LTEuMWMwLTAuNSwwLjEtMC45LDAuNS0xLjNsMTAuOS0xMC45YzAuOS0wLjksMS43LTAuOSwyLjQtMC4xJiN4ZDsmI3hhOyYjeDk7JiN4OTtsMTUuOCwxNS44bDE1LjctMTUuN2MwLjktMC45LDEuNy0wLjksMi40LTAuMWwxMS4xLDExLjFjMC44LDAuOCwwLjgsMS41LTAuMSwyLjRMLTE2MS42LDM5Ni45eiIvPgogPC9nPgo8L3N2Zz4K';\n\t\tme._close_url__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\telo=me._close_url__imgo=document.createElement('img');\n\t\telo.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yNDAgMzMyIDEzMCAxMzAiIGJhc2VQcm9maWxlPSJ0aW55IiB4PSIwcHgiIHk9IjBweCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiA8ZyBpZD0iTG'+\n\t\t\t'F5ZXJfMV8xXyI+CiAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xMzAuOSwzNTIuOWMtMjQuNC0yNC40LTYzLjgtMjQuNC04OC4yLDBjLTI0LjQsMjQuNC0yNC40LDYzLjgsMCw4OC4yYzI0LjQsMjQuNCw2My44LDI0LjQsODguMiwwJiN4ZDsmI3hhOyYjeDk7JiN4OTtTLTEwNi41LDM3Ny4zLTEzMC45LDM1Mi45eiBNLTE0Mi41LDQxNC41YzAuOCwwLjgsMC44LDEuNy0wLjEsMi43bC0xMi4yLDEyLjJjLTAuNCwwLjQtMC44LDAuNi0xLjQsMC42Yy0wLjYsMC0xLTAuMS0xLjMtMC40JiN4ZDsmI3hhOyYjeDk7JiN4OTtsLTE3LjUtMTcuNWwtMTcuNCwxNy40Yy0wLjQsMC40LTAuOCwwLjYtMS40'+\n\t\t\t'LDAuNmMtMC42LDAtMS0wLjEtMS4zLTAuNGwtMTIuMy0xMi4zYy0wLjMtMC4zLTAuNC0wLjctMC40LTEuM2MwLTAuNiwwLjEtMSwwLjYtMS40JiN4ZDsmI3hhOyYjeDk7JiN4OTtsMTcuNC0xNy40bC0xNy41LTE3LjVjLTAuMy0wLjMtMC40LTAuNy0wLjQtMS4zYzAtMC42LDAuMS0xLDAuNi0xLjRsMTIuMi0xMi4yYzEtMSwxLjgtMSwyLjctMC4xbDE3LjUsMTcuNWwxNy40LTE3LjQmI3hkOyYjeGE7JiN4OTsmI3g5O2MxLTEsMS44LTEsMi43LTAuMWwxMi4zLDEyLjNjMC44LDAuOCwwLjgsMS43LTAuMSwyLjdsLTE3LjQsMTcuNEwtMTQyLjUsNDE0LjV6Ii8+CiA8L2c+CiA8ZyBpZD0iTGF5ZXJfMi'+\n\t\t\t'I+CiAgPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTS0xNjAuMSwzOTYuOWwxNy41LDE3LjVjMC44LDAuOCwwLjgsMS43LTAuMSwyLjdsLTEyLjIsMTIuMmMtMC40LDAuNC0wLjgsMC42LTEuNCwwLjYmI3hkOyYjeGE7JiN4OTsmI3g5O2MtMC42LDAtMS0wLjEtMS4zLTAuNGwtMTcuNS0xNy41bC0xNy40LDE3LjRjLTAuNCwwLjQtMC44LDAuNi0xLjQsMC42Yy0wLjYsMC0xLTAuMS0xLjMtMC40bC0xMi4zLTEyLjNjLTAuMy0wLjMtMC40LTAuNy0wLjQtMS4zJiN4ZDsmI3hhOyYjeDk7JiN4OTtjMC0wLjYsMC4xLTEsMC42LTEuNGwxNy40LTE3LjRsLTE3LjUtMTcuNWMtMC4zLTAuMy0wLjQtMC43LTAu'+\n\t\t\t'NC0xLjNjMC0wLjYsMC4xLTEsMC42LTEuNGwxMi4yLTEyLjJjMS0xLDEuOC0xLDIuNy0wLjFsMTcuNSwxNy41JiN4ZDsmI3hhOyYjeDk7JiN4OTtsMTcuNC0xNy40YzEtMSwxLjgtMSwyLjctMC4xbDEyLjMsMTIuM2MwLjgsMC44LDAuOCwxLjctMC4xLDIuN0wtMTYwLjEsMzk2Ljl6Ii8+CiA8L2c+Cjwvc3ZnPgo=';\n\t\tme._close_url__imgo.setAttribute('src',hs);\n\t\telo.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;visibility:hidden;pointer-events:none;;');\n\t\telo['ondragstart']=function() { return false; };\n\t\tel.appendChild(elo);\n\t\tel.ggId=\"close_url\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 32px;';\n\t\ths+='position : absolute;';\n\t\ths+='right : 5px;';\n\t\ths+='top : 5px;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 32px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._close_url.ggIsActive=function() {\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._close_url.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('vis_website') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._close_url.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._close_url.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._close_url.style[domTransition]='';\n\t\t\t\tif (me._close_url.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._close_url.style.visibility=(Number(me._close_url.style.opacity)>0||!me._close_url.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._close_url.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._close_url.style.visibility=\"hidden\";\n\t\t\t\t\tme._close_url.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._close_url.onclick=function (e) {\n\t\t\tplayer.setVariableValue('vis_website', false);\n\t\t\tme._web_page.ggText=\"\";\n\t\t\tme._web_page.ggTextDiv.innerHTML=me._web_page.ggText;\n\t\t\tif (me._web_page.ggUpdateText) {\n\t\t\t\tme._web_page.ggUpdateText=function() {\n\t\t\t\t\tvar hs=\"\";\n\t\t\t\t\tif (hs!=this.ggText) {\n\t\t\t\t\t\tthis.ggText=hs;\n\t\t\t\t\t\tthis.ggTextDiv.innerHTML=hs;\n\t\t\t\t\t\tif (this.ggUpdatePosition) this.ggUpdatePosition();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (me._web_page.ggUpdatePosition) {\n\t\t\t\tme._web_page.ggUpdatePosition();\n\t\t\t}\n\t\t\tme._web_page.ggTextDiv.scrollTop = 0;\n\t\t}\n\t\tme._close_url.onmouseover=function (e) {\n\t\t\tme._close_url__img.style.visibility='hidden';\n\t\t\tme._close_url__imgo.style.visibility='inherit';\n\t\t}\n\t\tme._close_url.onmouseout=function (e) {\n\t\t\tme._close_url__img.style.visibility='inherit';\n\t\t\tme._close_url__imgo.style.visibility='hidden';\n\t\t}\n\t\tme._close_url.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme.divSkin.appendChild(me._close_url);\n\t\tme._popup_video_file.ggVideoSource = 'media/';\n\t\tme._popup_video_file.ggVideoNotLoaded = true;\n\t\tme._popup_video_youtube.ggVideoSource = '';\n\t\tme._popup_video_youtube.ggVideoNotLoaded = true;\n\t\tplayer.addListener('sizechanged', function() {\n\t\t\tme.updateSize(me.divSkin);\n\t\t});\n\t\tplayer.addListener('configloaded', function() {\n\t\t\tme._node_cloner.ggUpdate();\n\t\t});\n\t\tplayer.addListener('imagesready', function() {\n\t\t\tme._node_scroller.ggUpdatePosition();\n\t\t\tme._loading.style[domTransition]='none';\n\t\t\tme._loading.style.visibility='hidden';\n\t\t\tme._loading.ggVisible=false;\n\t\t});\n\t\tplayer.addListener('beforechangenode', function() {\n\t\t\tif (\n\t\t\t\t(\n\t\t\t\t\t((player.getVariableValue('vis_loader') == true))\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tme._loading.style[domTransition]='none';\n\t\t\t\tme._loading.style.visibility=(Number(me._loading.style.opacity)>0||!me._loading.style.opacity)?'inherit':'hidden';\n\t\t\t\tme._loading.ggVisible=true;\n\t\t\t}\n\t\t});\n\t\tplayer.addListener('tilesrequested', function() {\n\t\t\tplayer.setVariableValue('vis_loader', false);\n\t\t});\n\t};\n\tthis.hotspotProxyClick=function(id, url) {\n\t}\n\tthis.hotspotProxyDoubleClick=function(id, url) {\n\t}\n\tme.hotspotProxyOver=function(id, url) {\n\t}\n\tme.hotspotProxyOut=function(id, url) {\n\t}\n\tme.callChildLogicBlocksHotspot_ht_node_zoom_changenode = function(){\n\t\tif(hotspotTemplates['ht_node_zoom']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_zoom'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_node_zoom'][i]._ht_node_image && hotspotTemplates['ht_node_zoom'][i]._ht_node_image.logicBlock_scaling) {\n\t\t\t\t\thotspotTemplates['ht_node_zoom'][i]._ht_node_image.logicBlock_scaling();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_node_zoom_mouseover = function(){\n\t\tif(hotspotTemplates['ht_node_zoom']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_zoom'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_node_zoom'][i]._tt_ht_node && hotspotTemplates['ht_node_zoom'][i]._tt_ht_node.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_node_zoom'][i]._tt_ht_node.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_node_zoom_varchanged_ht_ani = function(){\n\t\tif(hotspotTemplates['ht_node_zoom']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_zoom'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_node_zoom'][i]._ht_node_image && hotspotTemplates['ht_node_zoom'][i]._ht_node_image.logicBlock_scaling) {\n\t\t\t\t\thotspotTemplates['ht_node_zoom'][i]._ht_node_image.logicBlock_scaling();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_node_enter_changenode = function(){\n\t\tif(hotspotTemplates['ht_node_enter']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_enter'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_node_enter'][i]._ht_node_image_1_1 && hotspotTemplates['ht_node_enter'][i]._ht_node_image_1_1.logicBlock_scaling) {\n\t\t\t\t\thotspotTemplates['ht_node_enter'][i]._ht_node_image_1_1.logicBlock_scaling();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_node_enter_mouseover = function(){\n\t\tif(hotspotTemplates['ht_node_enter']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_enter'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_node_enter'][i]._tt_ht_node_1_1 && hotspotTemplates['ht_node_enter'][i]._tt_ht_node_1_1.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_node_enter'][i]._tt_ht_node_1_1.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_node_enter_varchanged_ht_ani = function(){\n\t\tif(hotspotTemplates['ht_node_enter']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_enter'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_node_enter'][i]._ht_node_image_1_1 && hotspotTemplates['ht_node_enter'][i]._ht_node_image_1_1.logicBlock_scaling) {\n\t\t\t\t\thotspotTemplates['ht_node_enter'][i]._ht_node_image_1_1.logicBlock_scaling();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_node_enter_recycle_changenode = function(){\n\t\tif(hotspotTemplates['ht_node_enter_recycle']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_enter_recycle'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_node_enter_recycle'][i]._ht_node_image_1_2 && hotspotTemplates['ht_node_enter_recycle'][i]._ht_node_image_1_2.logicBlock_scaling) {\n\t\t\t\t\thotspotTemplates['ht_node_enter_recycle'][i]._ht_node_image_1_2.logicBlock_scaling();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_node_enter_recycle_mouseover = function(){\n\t\tif(hotspotTemplates['ht_node_enter_recycle']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_enter_recycle'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_node_enter_recycle'][i]._tt_ht_node_1_2 && hotspotTemplates['ht_node_enter_recycle'][i]._tt_ht_node_1_2.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_node_enter_recycle'][i]._tt_ht_node_1_2.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_node_enter_recycle_varchanged_ht_ani = function(){\n\t\tif(hotspotTemplates['ht_node_enter_recycle']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_enter_recycle'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_node_enter_recycle'][i]._ht_node_image_1_2 && hotspotTemplates['ht_node_enter_recycle'][i]._ht_node_image_1_2.logicBlock_scaling) {\n\t\t\t\t\thotspotTemplates['ht_node_enter_recycle'][i]._ht_node_image_1_2.logicBlock_scaling();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_node_b2b_changenode = function(){\n\t\tif(hotspotTemplates['ht_node_b2b']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_b2b'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_node_b2b'][i]._ht_node_image_1 && hotspotTemplates['ht_node_b2b'][i]._ht_node_image_1.logicBlock_scaling) {\n\t\t\t\t\thotspotTemplates['ht_node_b2b'][i]._ht_node_image_1.logicBlock_scaling();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_node_b2b_mouseover = function(){\n\t\tif(hotspotTemplates['ht_node_b2b']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_b2b'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_node_b2b'][i]._tt_ht_node_1 && hotspotTemplates['ht_node_b2b'][i]._tt_ht_node_1.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_node_b2b'][i]._tt_ht_node_1.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_node_b2b_varchanged_ht_ani = function(){\n\t\tif(hotspotTemplates['ht_node_b2b']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_b2b'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_node_b2b'][i]._ht_node_image_1 && hotspotTemplates['ht_node_b2b'][i]._ht_node_image_1.logicBlock_scaling) {\n\t\t\t\t\thotspotTemplates['ht_node_b2b'][i]._ht_node_image_1.logicBlock_scaling();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_node_exit_changenode = function(){\n\t\tif(hotspotTemplates['ht_node_exit']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_exit'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_node_exit'][i]._ht_node_image_1_1_1 && hotspotTemplates['ht_node_exit'][i]._ht_node_image_1_1_1.logicBlock_scaling) {\n\t\t\t\t\thotspotTemplates['ht_node_exit'][i]._ht_node_image_1_1_1.logicBlock_scaling();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_node_exit_mouseover = function(){\n\t\tif(hotspotTemplates['ht_node_exit']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_exit'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_node_exit'][i]._tt_ht_node_1_1_1 && hotspotTemplates['ht_node_exit'][i]._tt_ht_node_1_1_1.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_node_exit'][i]._tt_ht_node_1_1_1.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_node_exit_varchanged_ht_ani = function(){\n\t\tif(hotspotTemplates['ht_node_exit']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_exit'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_node_exit'][i]._ht_node_image_1_1_1 && hotspotTemplates['ht_node_exit'][i]._ht_node_image_1_1_1.logicBlock_scaling) {\n\t\t\t\t\thotspotTemplates['ht_node_exit'][i]._ht_node_image_1_1_1.logicBlock_scaling();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_node_link_changenode = function(){\n\t\tif(hotspotTemplates['ht_node_link']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_link'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_node_link'][i]._ht_node_link_ico && hotspotTemplates['ht_node_link'][i]._ht_node_link_ico.logicBlock_scaling) {\n\t\t\t\t\thotspotTemplates['ht_node_link'][i]._ht_node_link_ico.logicBlock_scaling();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_node_link_mouseover = function(){\n\t\tif(hotspotTemplates['ht_node_link']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_link'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_node_link'][i]._ht_info_d && hotspotTemplates['ht_node_link'][i]._ht_info_d.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_node_link'][i]._ht_info_d.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_node_link_varchanged_ht_ani = function(){\n\t\tif(hotspotTemplates['ht_node_link']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_link'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_node_link'][i]._ht_node_link_ico && hotspotTemplates['ht_node_link'][i]._ht_node_link_ico.logicBlock_scaling) {\n\t\t\t\t\thotspotTemplates['ht_node_link'][i]._ht_node_link_ico.logicBlock_scaling();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_video_file_changenode = function(){\n\t\tif(hotspotTemplates['ht_video_file']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_video_file'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_video_file'][i]._ht_video_video_file && hotspotTemplates['ht_video_file'][i]._ht_video_video_file.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_video_file'][i]._ht_video_video_file.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_video_file'][i]._tt_ht_video_file && hotspotTemplates['ht_video_file'][i]._tt_ht_video_file.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_video_file'][i]._tt_ht_video_file.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_video_file'][i]._ht_video_file_customimage && hotspotTemplates['ht_video_file'][i]._ht_video_file_customimage.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_video_file'][i]._ht_video_file_customimage.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_video_file_configloaded = function(){\n\t\tif(hotspotTemplates['ht_video_file']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_video_file'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_video_file'][i]._tt_ht_video_file && hotspotTemplates['ht_video_file'][i]._tt_ht_video_file.logicBlock_position) {\n\t\t\t\t\thotspotTemplates['ht_video_file'][i]._tt_ht_video_file.logicBlock_position();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_video_file_mouseover = function(){\n\t\tif(hotspotTemplates['ht_video_file']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_video_file'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_video_file'][i]._tt_ht_video_file && hotspotTemplates['ht_video_file'][i]._tt_ht_video_file.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_video_file'][i]._tt_ht_video_file.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_video_file_hastouch = function(){\n\t\tif(hotspotTemplates['ht_video_file']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_video_file'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_video_file'][i]._tt_ht_video_file && hotspotTemplates['ht_video_file'][i]._tt_ht_video_file.logicBlock_position) {\n\t\t\t\t\thotspotTemplates['ht_video_file'][i]._tt_ht_video_file.logicBlock_position();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_video_file_activehotspotchanged = function(){\n\t\tif(hotspotTemplates['ht_video_file']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_video_file'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_video_file'][i]._ht_video_video_file && hotspotTemplates['ht_video_file'][i]._ht_video_video_file.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_video_file'][i]._ht_video_video_file.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_video_file'][i]._tt_ht_video_file && hotspotTemplates['ht_video_file'][i]._tt_ht_video_file.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_video_file'][i]._tt_ht_video_file.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_video_file'][i]._ht_video_file_customimage && hotspotTemplates['ht_video_file'][i]._ht_video_file_customimage.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_video_file'][i]._ht_video_file_customimage.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_info0_changenode = function(){\n\t\tif(hotspotTemplates['ht_info']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_info'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_info'][i]._ht_info_image0 && hotspotTemplates['ht_info'][i]._ht_info_image0.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_info'][i]._ht_info_image0.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_info'][i]._tt_information0 && hotspotTemplates['ht_info'][i]._tt_information0.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_info'][i]._tt_information0.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_info'][i]._ht_info_customimage0 && hotspotTemplates['ht_info'][i]._ht_info_customimage0.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_info'][i]._ht_info_customimage0.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_info0_configloaded = function(){\n\t\tif(hotspotTemplates['ht_info']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_info'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_info'][i]._tt_information0 && hotspotTemplates['ht_info'][i]._tt_information0.logicBlock_position) {\n\t\t\t\t\thotspotTemplates['ht_info'][i]._tt_information0.logicBlock_position();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_info0_mouseover = function(){\n\t\tif(hotspotTemplates['ht_info']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_info'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_info'][i]._tt_information0 && hotspotTemplates['ht_info'][i]._tt_information0.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_info'][i]._tt_information0.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_info0_hastouch = function(){\n\t\tif(hotspotTemplates['ht_info']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_info'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_info'][i]._tt_information0 && hotspotTemplates['ht_info'][i]._tt_information0.logicBlock_position) {\n\t\t\t\t\thotspotTemplates['ht_info'][i]._tt_information0.logicBlock_position();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_info0_activehotspotchanged = function(){\n\t\tif(hotspotTemplates['ht_info']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_info'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_info'][i]._ht_info_image0 && hotspotTemplates['ht_info'][i]._ht_info_image0.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_info'][i]._ht_info_image0.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_info'][i]._tt_information0 && hotspotTemplates['ht_info'][i]._tt_information0.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_info'][i]._tt_information0.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_info'][i]._ht_info_customimage0 && hotspotTemplates['ht_info'][i]._ht_info_customimage0.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_info'][i]._ht_info_customimage0.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_info_changenode = function(){\n\t\tif(hotspotTemplates['ht_info']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_info'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_info'][i]._ht_info_image && hotspotTemplates['ht_info'][i]._ht_info_image.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_info'][i]._ht_info_image.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_info'][i]._ht_info_customimage && hotspotTemplates['ht_info'][i]._ht_info_customimage.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_info'][i]._ht_info_customimage.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_info_configloaded = function(){\n\t\tif(hotspotTemplates['ht_info']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_info'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_info'][i]._tt_information && hotspotTemplates['ht_info'][i]._tt_information.logicBlock_position) {\n\t\t\t\t\thotspotTemplates['ht_info'][i]._tt_information.logicBlock_position();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_info_mouseover = function(){\n\t\tif(hotspotTemplates['ht_info']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_info'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_info'][i]._tt_information && hotspotTemplates['ht_info'][i]._tt_information.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_info'][i]._tt_information.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_info_hastouch = function(){\n\t\tif(hotspotTemplates['ht_info']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_info'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_info'][i]._tt_information && hotspotTemplates['ht_info'][i]._tt_information.logicBlock_position) {\n\t\t\t\t\thotspotTemplates['ht_info'][i]._tt_information.logicBlock_position();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_info_activehotspotchanged = function(){\n\t\tif(hotspotTemplates['ht_info']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_info'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_info'][i]._ht_info_image && hotspotTemplates['ht_info'][i]._ht_info_image.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_info'][i]._ht_info_image.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_info'][i]._ht_info_customimage && hotspotTemplates['ht_info'][i]._ht_info_customimage.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_info'][i]._ht_info_customimage.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_video_youtube_changenode = function(){\n\t\tif(hotspotTemplates['ht_video_youtube']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_video_youtube'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_video_youtube'][i]._ht_video_video_youtube && hotspotTemplates['ht_video_youtube'][i]._ht_video_video_youtube.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_video_youtube'][i]._ht_video_video_youtube.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_video_youtube'][i]._tt_ht_video_youtube && hotspotTemplates['ht_video_youtube'][i]._tt_ht_video_youtube.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_video_youtube'][i]._tt_ht_video_youtube.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_video_youtube'][i]._ht_video_youtube_customimage && hotspotTemplates['ht_video_youtube'][i]._ht_video_youtube_customimage.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_video_youtube'][i]._ht_video_youtube_customimage.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_video_youtube_configloaded = function(){\n\t\tif(hotspotTemplates['ht_video_youtube']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_video_youtube'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_video_youtube'][i]._tt_ht_video_youtube && hotspotTemplates['ht_video_youtube'][i]._tt_ht_video_youtube.logicBlock_position) {\n\t\t\t\t\thotspotTemplates['ht_video_youtube'][i]._tt_ht_video_youtube.logicBlock_position();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_video_youtube_mouseover = function(){\n\t\tif(hotspotTemplates['ht_video_youtube']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_video_youtube'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_video_youtube'][i]._tt_ht_video_youtube && hotspotTemplates['ht_video_youtube'][i]._tt_ht_video_youtube.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_video_youtube'][i]._tt_ht_video_youtube.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_video_youtube_hastouch = function(){\n\t\tif(hotspotTemplates['ht_video_youtube']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_video_youtube'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_video_youtube'][i]._tt_ht_video_youtube && hotspotTemplates['ht_video_youtube'][i]._tt_ht_video_youtube.logicBlock_position) {\n\t\t\t\t\thotspotTemplates['ht_video_youtube'][i]._tt_ht_video_youtube.logicBlock_position();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_video_youtube_activehotspotchanged = function(){\n\t\tif(hotspotTemplates['ht_video_youtube']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_video_youtube'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_video_youtube'][i]._ht_video_video_youtube && hotspotTemplates['ht_video_youtube'][i]._ht_video_video_youtube.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_video_youtube'][i]._ht_video_video_youtube.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_video_youtube'][i]._tt_ht_video_youtube && hotspotTemplates['ht_video_youtube'][i]._tt_ht_video_youtube.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_video_youtube'][i]._tt_ht_video_youtube.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_video_youtube'][i]._ht_video_youtube_customimage && hotspotTemplates['ht_video_youtube'][i]._ht_video_youtube_customimage.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_video_youtube'][i]._ht_video_youtube_customimage.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_url_sizechanged = function(){\n\t\tif(hotspotTemplates['ht_url']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_url'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_url'][i]._ht_url.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_url'][i]._ht_url.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_url_changenode = function(){\n\t\tif(hotspotTemplates['ht_url']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_url'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_url'][i]._ht_url.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_url'][i]._ht_url.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_url'][i]._ht_url_image && hotspotTemplates['ht_url'][i]._ht_url_image.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_url'][i]._ht_url_image.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_url'][i]._tt_ht_url && hotspotTemplates['ht_url'][i]._tt_ht_url.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_url'][i]._tt_ht_url.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_url'][i]._ht_url_customimage && hotspotTemplates['ht_url'][i]._ht_url_customimage.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_url'][i]._ht_url_customimage.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_url_configloaded = function(){\n\t\tif(hotspotTemplates['ht_url']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_url'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_url'][i]._tt_ht_url && hotspotTemplates['ht_url'][i]._tt_ht_url.logicBlock_position) {\n\t\t\t\t\thotspotTemplates['ht_url'][i]._tt_ht_url.logicBlock_position();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_url_mouseover = function(){\n\t\tif(hotspotTemplates['ht_url']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_url'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_url'][i]._tt_ht_url && hotspotTemplates['ht_url'][i]._tt_ht_url.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_url'][i]._tt_ht_url.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_url_hastouch = function(){\n\t\tif(hotspotTemplates['ht_url']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_url'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_url'][i]._tt_ht_url && hotspotTemplates['ht_url'][i]._tt_ht_url.logicBlock_position) {\n\t\t\t\t\thotspotTemplates['ht_url'][i]._tt_ht_url.logicBlock_position();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_url_activehotspotchanged = function(){\n\t\tif(hotspotTemplates['ht_url']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_url'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_url'][i]._ht_url_image && hotspotTemplates['ht_url'][i]._ht_url_image.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_url'][i]._ht_url_image.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_url'][i]._tt_ht_url && hotspotTemplates['ht_url'][i]._tt_ht_url.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_url'][i]._tt_ht_url.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_url'][i]._ht_url_customimage && hotspotTemplates['ht_url'][i]._ht_url_customimage.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_url'][i]._ht_url_customimage.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_url_varchanged_vis_info_popup = function(){\n\t\tif(hotspotTemplates['ht_url']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_url'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_url'][i]._ht_url.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_url'][i]._ht_url.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_url_varchanged_vis_website = function(){\n\t\tif(hotspotTemplates['ht_url']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_url'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_url'][i]._ht_url.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_url'][i]._ht_url.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_form_sizechanged = function(){\n\t\tif(hotspotTemplates['ht_form']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_form'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_form'][i]._ht_form.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_form'][i]._ht_form.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_form_changenode = function(){\n\t\tif(hotspotTemplates['ht_form']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_form'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_form'][i]._ht_form.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_form'][i]._ht_form.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_form'][i]._ht_url_image_1 && hotspotTemplates['ht_form'][i]._ht_url_image_1.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_form'][i]._ht_url_image_1.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_form'][i]._tt_ht_url_1 && hotspotTemplates['ht_form'][i]._tt_ht_url_1.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_form'][i]._tt_ht_url_1.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_form_configloaded = function(){\n\t\tif(hotspotTemplates['ht_form']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_form'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_form'][i]._tt_ht_url_1 && hotspotTemplates['ht_form'][i]._tt_ht_url_1.logicBlock_position) {\n\t\t\t\t\thotspotTemplates['ht_form'][i]._tt_ht_url_1.logicBlock_position();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_form_mouseover = function(){\n\t\tif(hotspotTemplates['ht_form']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_form'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_form'][i]._tt_ht_url_1 && hotspotTemplates['ht_form'][i]._tt_ht_url_1.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_form'][i]._tt_ht_url_1.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_form_hastouch = function(){\n\t\tif(hotspotTemplates['ht_form']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_form'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_form'][i]._tt_ht_url_1 && hotspotTemplates['ht_form'][i]._tt_ht_url_1.logicBlock_position) {\n\t\t\t\t\thotspotTemplates['ht_form'][i]._tt_ht_url_1.logicBlock_position();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_form_activehotspotchanged = function(){\n\t\tif(hotspotTemplates['ht_form']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_form'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_form'][i]._ht_url_image_1 && hotspotTemplates['ht_form'][i]._ht_url_image_1.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_form'][i]._ht_url_image_1.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_form'][i]._tt_ht_url_1 && hotspotTemplates['ht_form'][i]._tt_ht_url_1.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_form'][i]._tt_ht_url_1.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_form_varchanged_vis_info_popup = function(){\n\t\tif(hotspotTemplates['ht_form']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_form'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_form'][i]._ht_form.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_form'][i]._ht_form.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_form_varchanged_vis_website = function(){\n\t\tif(hotspotTemplates['ht_form']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_form'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_form'][i]._ht_form.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_form'][i]._ht_form.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_pdf_sizechanged = function(){\n\t\tif(hotspotTemplates['ht_pdf']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_pdf'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_pdf'][i]._ht_pdf.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_pdf'][i]._ht_pdf.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_pdf_changenode = function(){\n\t\tif(hotspotTemplates['ht_pdf']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_pdf'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_pdf'][i]._ht_pdf.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_pdf'][i]._ht_pdf.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_pdf'][i]._ht_url_image_1_1 && hotspotTemplates['ht_pdf'][i]._ht_url_image_1_1.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_pdf'][i]._ht_url_image_1_1.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_pdf'][i]._tt_ht_url_1_1 && hotspotTemplates['ht_pdf'][i]._tt_ht_url_1_1.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_pdf'][i]._tt_ht_url_1_1.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_pdf_configloaded = function(){\n\t\tif(hotspotTemplates['ht_pdf']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_pdf'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_pdf'][i]._tt_ht_url_1_1 && hotspotTemplates['ht_pdf'][i]._tt_ht_url_1_1.logicBlock_position) {\n\t\t\t\t\thotspotTemplates['ht_pdf'][i]._tt_ht_url_1_1.logicBlock_position();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_pdf_mouseover = function(){\n\t\tif(hotspotTemplates['ht_pdf']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_pdf'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_pdf'][i]._tt_ht_url_1_1 && hotspotTemplates['ht_pdf'][i]._tt_ht_url_1_1.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_pdf'][i]._tt_ht_url_1_1.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_pdf_hastouch = function(){\n\t\tif(hotspotTemplates['ht_pdf']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_pdf'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_pdf'][i]._tt_ht_url_1_1 && hotspotTemplates['ht_pdf'][i]._tt_ht_url_1_1.logicBlock_position) {\n\t\t\t\t\thotspotTemplates['ht_pdf'][i]._tt_ht_url_1_1.logicBlock_position();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_pdf_activehotspotchanged = function(){\n\t\tif(hotspotTemplates['ht_pdf']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_pdf'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_pdf'][i]._ht_url_image_1_1 && hotspotTemplates['ht_pdf'][i]._ht_url_image_1_1.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_pdf'][i]._ht_url_image_1_1.logicBlock_visible();\n\t\t\t\t}\n\t\t\t\tif (hotspotTemplates['ht_pdf'][i]._tt_ht_url_1_1 && hotspotTemplates['ht_pdf'][i]._tt_ht_url_1_1.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_pdf'][i]._tt_ht_url_1_1.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_pdf_varchanged_vis_info_popup = function(){\n\t\tif(hotspotTemplates['ht_pdf']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_pdf'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_pdf'][i]._ht_pdf.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_pdf'][i]._ht_pdf.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_pdf_varchanged_vis_website = function(){\n\t\tif(hotspotTemplates['ht_pdf']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_pdf'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_pdf'][i]._ht_pdf.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_pdf'][i]._ht_pdf.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tplayer.addListener('changenode', function() {\n\t\tme.ggUserdata=player.userdata;\n\t});\n\tme.skinTimerEvent=function() {\n\t\tme.ggCurrentTime=new Date().getTime();\n\t\tif (me._ht_node_timer.ggLastIsActive!=me._ht_node_timer.ggIsActive()) {\n\t\t\tme._ht_node_timer.ggLastIsActive=me._ht_node_timer.ggIsActive();\n\t\t\tif (me._ht_node_timer.ggLastIsActive) {\n\t\t\t\tplayer.setVariableValue('ht_ani', true);\n\t\t\t} else {\n\t\t\t\tplayer.setVariableValue('ht_ani', false);\n\t\t\t}\n\t\t}\n\t\tvar hs='';\n\t\tif (me._loadingbar.ggParameter) {\n\t\t\ths+=parameterToTransform(me._loadingbar.ggParameter) + ' ';\n\t\t}\n\t\ths+='scale(' + (1 * player.getPercentLoaded() + 0) + ',1.0) ';\n\t\tme._loadingbar.style[domTransform]=hs;\n\t};\n\tplayer.addListener('timer', me.skinTimerEvent);\n\tfunction SkinHotspotClass_ht_node_zoom(parentScope,hotspot) {\n\t\tvar me=this;\n\t\tvar flag=false;\n\t\tvar hs='';\n\t\tme.parentScope=parentScope;\n\t\tme.hotspot=hotspot;\n\t\tvar nodeId=String(hotspot.url);\n\t\tnodeId=(nodeId.charAt(0)=='{')?nodeId.substr(1, nodeId.length - 2):''; // }\n\t\tme.ggUserdata=skin.player.getNodeUserdata(nodeId);\n\t\tme.elementMouseDown=[];\n\t\tme.elementMouseOver=[];\n\t\tme.findElements=function(id,regex) {\n\t\t\treturn skin.findElements(id,regex);\n\t\t}\n\t\tel=me._ht_node_zoom=document.createElement('div');\n\t\tel.ggId=\"ht_node_zoom\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_hotspot \";\n\t\tel.ggType='hotspot';\n\t\ths ='';\n\t\ths+='height : 0px;';\n\t\ths+='left : 78px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 39px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 0px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_node_zoom.ggIsActive=function() {\n\t\t\treturn player.getCurrentNode()==this.ggElementNodeId();\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif (me.hotspot.url!='' && me.hotspot.url.charAt(0)=='{') { // }\n\t\t\t\treturn me.hotspot.url.substr(1, me.hotspot.url.length - 2);\n\t\t\t} else {\n\t\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t\t} else {\n\t\t\t\t\treturn player.getCurrentNode();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_node_zoom.onclick=function (e) {\n\t\t\tplayer.openUrl(me.hotspot.url,me.hotspot.target);\n\t\t\tskin.hotspotProxyClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_zoom.ondblclick=function (e) {\n\t\t\tskin.hotspotProxyDoubleClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_zoom.onmouseover=function (e) {\n\t\t\tplayer.setActiveHotspot(me.hotspot);\n\t\t\tme._tt_ht_node.style[domTransition]='none';\n\t\t\tme._tt_ht_node.style.visibility=(Number(me._tt_ht_node.style.opacity)>0||!me._tt_ht_node.style.opacity)?'inherit':'hidden';\n\t\t\tme._tt_ht_node.ggVisible=true;\n\t\t\tme.elementMouseOver['ht_node_zoom']=true;\n\t\t\tme._tt_ht_node.logicBlock_visible();\n\t\t\tskin.hotspotProxyOver(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_zoom.onmouseout=function (e) {\n\t\t\tplayer.setActiveHotspot(null);\n\t\t\tme._tt_ht_node.style[domTransition]='none';\n\t\t\tme._tt_ht_node.style.visibility='hidden';\n\t\t\tme._tt_ht_node.ggVisible=false;\n\t\t\tme.elementMouseOver['ht_node_zoom']=false;\n\t\t\tme._tt_ht_node.logicBlock_visible();\n\t\t\tskin.hotspotProxyOut(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_zoom.ontouchend=function (e) {\n\t\t\tme.elementMouseOver['ht_node_zoom']=false;\n\t\t\tme._tt_ht_node.logicBlock_visible();\n\t\t}\n\t\tme._ht_node_zoom.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._tt_ht_node=document.createElement('div');\n\t\tels=me._tt_ht_node__text=document.createElement('div');\n\t\tel.className='ggskin ggskin_textdiv';\n\t\tel.ggTextDiv=els;\n\t\tel.ggId=\"tt_ht_node\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_text \";\n\t\tel.ggType='text';\n\t\ths ='';\n\t\ths+='z-index: 100;';\n\t\ths+='height : 20px;';\n\t\ths+='left : -50px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 21px;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 100px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\ths ='position:absolute;';\n\t\ths += 'box-sizing: border-box;';\n\t\ths+='cursor: default;';\n\t\ths+='left: 0px;';\n\t\ths+='top: 0px;';\n\t\ths+='width: auto;';\n\t\ths+='height: auto;';\n\t\ths+='background: #000000;';\n\t\ths+='background: rgba(0,0,0,0.666667);';\n\t\ths+='border: 0px solid #000000;';\n\t\ths+='color: rgba(255,255,255,1);';\n\t\ths+='text-align: center;';\n\t\ths+='white-space: nowrap;';\n\t\ths+='padding: 2px 5px 2px 5px;';\n\t\ths+='overflow: hidden;';\n\t\tels.setAttribute('style',hs);\n\t\tels.innerHTML=me.hotspot.title;\n\t\tel.appendChild(els);\n\t\tme._tt_ht_node.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._tt_ht_node.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.elementMouseOver['ht_node_zoom'] == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._tt_ht_node.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._tt_ht_node.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._tt_ht_node.style[domTransition]='';\n\t\t\t\tif (me._tt_ht_node.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._tt_ht_node.style.visibility=(Number(me._tt_ht_node.style.opacity)>0||!me._tt_ht_node.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._tt_ht_node.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._tt_ht_node.style.visibility=\"hidden\";\n\t\t\t\t\tme._tt_ht_node.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._tt_ht_node.ggUpdatePosition=function (useTransition) {\n\t\t\tthis.style[domTransition]='left 0';\n\t\t\tthis.ggTextDiv.style.left=((98-this.ggTextDiv.offsetWidth)/2) + 'px';\n\t\t}\n\t\tme._ht_node_zoom.appendChild(me._tt_ht_node);\n\t\tel=me._ht_node_image=document.createElement('div');\n\t\tels=me._ht_node_image__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI0LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA2NCA2NDsiIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDY0IDY0IiB4PSIwcHgiIHk9IjBweCIgeG1sOnNwYWNlPSJwcmVzZX'+\n\t\t\t'J2ZSI+CiA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPiYjeGQ7Cgkuc3Qwe2ZpbGw6I0ZGRkZGRjt9JiN4ZDsKPC9zdHlsZT4KIDxjaXJjbGUgY3k9IjMyIiByPSIzMSIgY3g9IjMyIi8+CiA8cGF0aCBkPSJNMzQuNyw0MC43bDkuNiw5LjZjMS41LDEuNSw0LDEuNSw1LjYsMGMxLjUtMS41LDEuNS00LDAtNS42bC05LjYtOS42YzQtNi41LDMuMi0xNS4xLTIuNS0yMC43JiN4ZDsmI3hhOyYjeDk7Yy02LjYtNi42LTE3LjMtNi42LTIzLjgsMHMtNi42LDE3LjMsMCwyMy44QzE5LjYsNDMuOSwyOC4yLDQ0LjcsMzQuNyw0MC43eiBNMTcuNCwxNy45YzQuNi00LjYsMTIuMi00LjYsMTYuOSwwJiN4ZDsmI3hh'+\n\t\t\t'OyYjeDk7YzQuNiw0LjYsNC42LDEyLjIsMCwxNi45Yy00LjYsNC42LTEyLjIsNC42LTE2LjksMFMxMi44LDIyLjYsMTcuNCwxNy45eiBNMTguOSwyNi4yYzAtMS4xLDAuOS0yLDItMkgyNFYyMWMwLTEuMSwwLjktMiwyLTImI3hkOyYjeGE7JiN4OTtjMS4xLDAsMiwwLjksMiwydjMuMkgzMWMxLjEsMCwyLDAuOSwyLDJjMCwxLjEtMC45LDItMiwyaC0zLjJ2My4yYzAsMS4xLTAuOSwyLTIsMmMtMS4xLDAtMi0wLjktMi0ydi0zLjJoLTMuMiYjeGQ7JiN4YTsmI3g5O0MxOS44LDI4LjEsMTguOSwyNy4yLDE4LjksMjYuMnoiIGNsYXNzPSJzdDAiLz4KPC9zdmc+Cg==';\n\t\tme._ht_node_image__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\tel.ggId=\"ht_node_image\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 32px;';\n\t\ths+='left : -16px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -16px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 32px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_node_image.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_node_image.logicBlock_scaling = function() {\n\t\t\tvar newLogicStateScaling;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('ht_ani') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateScaling = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateScaling = -1;\n\t\t\t}\n\t\t\tif (me._ht_node_image.ggCurrentLogicStateScaling != newLogicStateScaling) {\n\t\t\t\tme._ht_node_image.ggCurrentLogicStateScaling = newLogicStateScaling;\n\t\t\t\tme._ht_node_image.style[domTransition]='' + cssPrefix + 'transform 500ms ease 0ms';\n\t\t\t\tif (me._ht_node_image.ggCurrentLogicStateScaling == 0) {\n\t\t\t\t\tme._ht_node_image.ggParameter.sx = 1.1;\n\t\t\t\t\tme._ht_node_image.ggParameter.sy = 1.1;\n\t\t\t\t\tme._ht_node_image.style[domTransform]=parameterToTransform(me._ht_node_image.ggParameter);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._ht_node_image.ggParameter.sx = 1;\n\t\t\t\t\tme._ht_node_image.ggParameter.sy = 1;\n\t\t\t\t\tme._ht_node_image.style[domTransform]=parameterToTransform(me._ht_node_image.ggParameter);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_node_image.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme._ht_node_zoom.appendChild(me._ht_node_image);\n\t\tme.__div = me._ht_node_zoom;\n\t};\n\tfunction SkinHotspotClass_ht_controll(parentScope,hotspot) {\n\t\tvar me=this;\n\t\tvar flag=false;\n\t\tvar hs='';\n\t\tme.parentScope=parentScope;\n\t\tme.hotspot=hotspot;\n\t\tvar nodeId=String(hotspot.url);\n\t\tnodeId=(nodeId.charAt(0)=='{')?nodeId.substr(1, nodeId.length - 2):''; // }\n\t\tme.ggUserdata=skin.player.getNodeUserdata(nodeId);\n\t\tme.elementMouseDown=[];\n\t\tme.elementMouseOver=[];\n\t\tme.findElements=function(id,regex) {\n\t\t\treturn skin.findElements(id,regex);\n\t\t}\n\t\tel=me._ht_controll=document.createElement('div');\n\t\tel.ggId=\"ht_controll\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_hotspot \";\n\t\tel.ggType='hotspot';\n\t\ths ='';\n\t\ths+='height : 0px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 0px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_controll.ggIsActive=function() {\n\t\t\treturn player.getCurrentNode()==this.ggElementNodeId();\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif (me.hotspot.url!='' && me.hotspot.url.charAt(0)=='{') { // }\n\t\t\t\treturn me.hotspot.url.substr(1, me.hotspot.url.length - 2);\n\t\t\t} else {\n\t\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t\t} else {\n\t\t\t\t\treturn player.getCurrentNode();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_controll.onclick=function (e) {\n\t\t\tskin.hotspotProxyClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_controll.ondblclick=function (e) {\n\t\t\tskin.hotspotProxyDoubleClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_controll.onmouseover=function (e) {\n\t\t\tplayer.setActiveHotspot(me.hotspot);\n\t\t\tskin.hotspotProxyOver(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_controll.onmouseout=function (e) {\n\t\t\tplayer.setActiveHotspot(null);\n\t\t\tskin.hotspotProxyOut(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_controll.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._ht_controllc=document.createElement('div');\n\t\tel.ggId=\"ht_controllc\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_container \";\n\t\tel.ggType='container';\n\t\ths ='';\n\t\ths+='height : 64px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 75px;';\n\t\ths+='pointer-events:none;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_controllc.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_controllc.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=((this.ggDx * pw)/100.0 + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=((this.ggDy * ph)/100.0 + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t}\n\t\tel=me._rectangle_1=document.createElement('div');\n\t\tel.ggId=\"Rectangle 1\";\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_rectangle \";\n\t\tel.ggType='rectangle';\n\t\ths ='';\n\t\ths+='background : #ff8811;';\n\t\ths+='border : 1px solid #000000;';\n\t\ths+='cursor : default;';\n\t\ths+='height : 32px;';\n\t\ths+='left : 0%;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 32px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._rectangle_1.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._rectangle_1.onclick=function (e) {\n\t\t\t\tplayer.playSound(\"Karafe\",\"0\");\n\t\t\tplayer.setMediaVisibility(\"Cup\",\"0\",0);\n\t\t\tplayer.setMediaVisibility(\"Karafe\",\"1\",0);\n\t\t}\n\t\tme._rectangle_1.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=((this.ggDy * ph)/100.0 + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t}\n\t\tme._ht_controllc.appendChild(me._rectangle_1);\n\t\tel=me._rectangle_1_1=document.createElement('div');\n\t\tel.ggId=\"Rectangle 1_1\";\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_rectangle \";\n\t\tel.ggType='rectangle';\n\t\ths ='';\n\t\ths+='background : #0062ff;';\n\t\ths+='border : 1px solid #000000;';\n\t\ths+='cursor : default;';\n\t\ths+='height : 32px;';\n\t\ths+='position : absolute;';\n\t\ths+='right : 0%;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 32px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._rectangle_1_1.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._rectangle_1_1.onclick=function (e) {\n\t\t\tplayer.setMediaVisibility(\"Karafe\",\"0\",0);\n\t\t\tplayer.setMediaVisibility(\"Cup\",\"1\",0);\n\t\t\t\tplayer.playSound(\"Cup\",\"1\");\n\t\t}\n\t\tme._rectangle_1_1.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=((this.ggDy * ph)/100.0 + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t}\n\t\tme._ht_controllc.appendChild(me._rectangle_1_1);\n\t\tme._ht_controll.appendChild(me._ht_controllc);\n\t\tme.ggUse3d=true;\n\t\tme.gg3dDistance=500;\n\t\tme.__div = me._ht_controll;\n\t};\n\tfunction SkinHotspotClass_polykaraf(parentScope,hotspot) {\n\t\tvar me=this;\n\t\tvar flag=false;\n\t\tvar hs='';\n\t\tme.parentScope=parentScope;\n\t\tme.hotspot=hotspot;\n\t\tvar nodeId=String(hotspot.url);\n\t\tnodeId=(nodeId.charAt(0)=='{')?nodeId.substr(1, nodeId.length - 2):''; // }\n\t\tme.ggUserdata=skin.player.getNodeUserdata(nodeId);\n\t\tme.elementMouseDown=[];\n\t\tme.elementMouseOver=[];\n\t\tme.findElements=function(id,regex) {\n\t\t\treturn skin.findElements(id,regex);\n\t\t}\n\t\tel=me._polykaraf=document.createElement('div');\n\t\tel.ggId=\"PolyKaraf\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_hotspot \";\n\t\tel.ggType='hotspot';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 0px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 0px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._polykaraf.ggIsActive=function() {\n\t\t\treturn player.getCurrentNode()==this.ggElementNodeId();\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif (me.hotspot.url!='' && me.hotspot.url.charAt(0)=='{') { // }\n\t\t\t\treturn me.hotspot.url.substr(1, me.hotspot.url.length - 2);\n\t\t\t} else {\n\t\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t\t} else {\n\t\t\t\t\treturn player.getCurrentNode();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._polykaraf.onclick=function (e) {\n\t\t\tplayer.setMediaVisibility(\"Tass\",\"0\",0);\n\t\t\tplayer.setMediaVisibility(\"Karaf\",\"1\",0);\n\t\t\t\tplayer.playSound(\"Karaf\",\"1\");\n\t\t\tskin.hotspotProxyClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._polykaraf.ondblclick=function (e) {\n\t\t\tskin.hotspotProxyDoubleClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._polykaraf.onmouseover=function (e) {\n\t\t\tplayer.setActiveHotspot(me.hotspot);\n\t\t\tskin.hotspotProxyOver(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._polykaraf.onmouseout=function (e) {\n\t\t\tplayer.setActiveHotspot(null);\n\t\t\tskin.hotspotProxyOut(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._polykaraf.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._rectangle_2=document.createElement('div');\n\t\tel.ggId=\"Rectangle 2\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_rectangle \";\n\t\tel.ggType='rectangle';\n\t\ths ='';\n\t\ths+='background : rgba(0,0,0,0);';\n\t\ths+='border : 0px solid #000000;';\n\t\ths+='cursor : default;';\n\t\ths+='height : 120px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 120px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._rectangle_2.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._rectangle_2.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t}\n\t\tme._polykaraf.appendChild(me._rectangle_2);\n\t\tme.__div = me._polykaraf;\n\t};\n\tfunction SkinHotspotClass_polytass(parentScope,hotspot) {\n\t\tvar me=this;\n\t\tvar flag=false;\n\t\tvar hs='';\n\t\tme.parentScope=parentScope;\n\t\tme.hotspot=hotspot;\n\t\tvar nodeId=String(hotspot.url);\n\t\tnodeId=(nodeId.charAt(0)=='{')?nodeId.substr(1, nodeId.length - 2):''; // }\n\t\tme.ggUserdata=skin.player.getNodeUserdata(nodeId);\n\t\tme.elementMouseDown=[];\n\t\tme.elementMouseOver=[];\n\t\tme.findElements=function(id,regex) {\n\t\t\treturn skin.findElements(id,regex);\n\t\t}\n\t\tel=me._polytass=document.createElement('div');\n\t\tel.ggId=\"PolyTass\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_hotspot \";\n\t\tel.ggType='hotspot';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 0px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 0px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._polytass.ggIsActive=function() {\n\t\t\treturn player.getCurrentNode()==this.ggElementNodeId();\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif (me.hotspot.url!='' && me.hotspot.url.charAt(0)=='{') { // }\n\t\t\t\treturn me.hotspot.url.substr(1, me.hotspot.url.length - 2);\n\t\t\t} else {\n\t\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t\t} else {\n\t\t\t\t\treturn player.getCurrentNode();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._polytass.onclick=function (e) {\n\t\t\tplayer.setMediaVisibility(\"Karaf\",\"0\",0);\n\t\t\tplayer.setMediaVisibility(\"Tass\",\"1\",0);\n\t\t\t\tplayer.playSound(\"Tass\",\"1\");\n\t\t\tskin.hotspotProxyClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._polytass.ondblclick=function (e) {\n\t\t\tskin.hotspotProxyDoubleClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._polytass.onmouseover=function (e) {\n\t\t\tplayer.setActiveHotspot(me.hotspot);\n\t\t\tskin.hotspotProxyOver(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._polytass.onmouseout=function (e) {\n\t\t\tplayer.setActiveHotspot(null);\n\t\t\tskin.hotspotProxyOut(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._polytass.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._rectangle_3=document.createElement('div');\n\t\tel.ggId=\"Rectangle 3\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_rectangle \";\n\t\tel.ggType='rectangle';\n\t\ths ='';\n\t\ths+='background : rgba(255,226,61,0);';\n\t\ths+='border : 0px solid #000000;';\n\t\ths+='cursor : default;';\n\t\ths+='height : 120px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 120px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._rectangle_3.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._rectangle_3.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t}\n\t\tme._polytass.appendChild(me._rectangle_3);\n\t\tme.__div = me._polytass;\n\t};\n\tfunction SkinHotspotClass_ht_node_enter(parentScope,hotspot) {\n\t\tvar me=this;\n\t\tvar flag=false;\n\t\tvar hs='';\n\t\tme.parentScope=parentScope;\n\t\tme.hotspot=hotspot;\n\t\tvar nodeId=String(hotspot.url);\n\t\tnodeId=(nodeId.charAt(0)=='{')?nodeId.substr(1, nodeId.length - 2):''; // }\n\t\tme.ggUserdata=skin.player.getNodeUserdata(nodeId);\n\t\tme.elementMouseDown=[];\n\t\tme.elementMouseOver=[];\n\t\tme.findElements=function(id,regex) {\n\t\t\treturn skin.findElements(id,regex);\n\t\t}\n\t\tel=me._ht_node_enter=document.createElement('div');\n\t\tel.ggId=\"ht_node_enter\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_hotspot \";\n\t\tel.ggType='hotspot';\n\t\ths ='';\n\t\ths+='height : 0px;';\n\t\ths+='left : 78px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 39px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 0px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_node_enter.ggIsActive=function() {\n\t\t\treturn player.getCurrentNode()==this.ggElementNodeId();\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif (me.hotspot.url!='' && me.hotspot.url.charAt(0)=='{') { // }\n\t\t\t\treturn me.hotspot.url.substr(1, me.hotspot.url.length - 2);\n\t\t\t} else {\n\t\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t\t} else {\n\t\t\t\t\treturn player.getCurrentNode();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_node_enter.onclick=function (e) {\n\t\t\tplayer.openUrl(me.hotspot.url,me.hotspot.target);\n\t\t\tskin.hotspotProxyClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_enter.ondblclick=function (e) {\n\t\t\tskin.hotspotProxyDoubleClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_enter.onmouseover=function (e) {\n\t\t\tplayer.setActiveHotspot(me.hotspot);\n\t\t\tskin._tt_ht_node.style[domTransition]='none';\n\t\t\tskin._tt_ht_node.style.visibility=(Number(skin._tt_ht_node.style.opacity)>0||!skin._tt_ht_node.style.opacity)?'inherit':'hidden';\n\t\t\tskin._tt_ht_node.ggVisible=true;\n\t\t\tme.elementMouseOver['ht_node_enter']=true;\n\t\t\tme._tt_ht_node_1_1.logicBlock_visible();\n\t\t\tskin.hotspotProxyOver(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_enter.onmouseout=function (e) {\n\t\t\tplayer.setActiveHotspot(null);\n\t\t\tskin._tt_ht_node.style[domTransition]='none';\n\t\t\tskin._tt_ht_node.style.visibility='hidden';\n\t\t\tskin._tt_ht_node.ggVisible=false;\n\t\t\tme.elementMouseOver['ht_node_enter']=false;\n\t\t\tme._tt_ht_node_1_1.logicBlock_visible();\n\t\t\tskin.hotspotProxyOut(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_enter.ontouchend=function (e) {\n\t\t\tme.elementMouseOver['ht_node_enter']=false;\n\t\t\tme._tt_ht_node_1_1.logicBlock_visible();\n\t\t}\n\t\tme._ht_node_enter.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._tt_ht_node_1_1=document.createElement('div');\n\t\tels=me._tt_ht_node_1_1__text=document.createElement('div');\n\t\tel.className='ggskin ggskin_textdiv';\n\t\tel.ggTextDiv=els;\n\t\tel.ggId=\"tt_ht_node_1_1\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_text \";\n\t\tel.ggType='text';\n\t\ths ='';\n\t\ths+='z-index: 100;';\n\t\ths+='height : 20px;';\n\t\ths+='left : -50px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 21px;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 100px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\ths ='position:absolute;';\n\t\ths += 'box-sizing: border-box;';\n\t\ths+='cursor: default;';\n\t\ths+='left: 0px;';\n\t\ths+='top: 0px;';\n\t\ths+='width: auto;';\n\t\ths+='height: auto;';\n\t\ths+='background: #000000;';\n\t\ths+='background: rgba(0,0,0,0.666667);';\n\t\ths+='border: 0px solid #000000;';\n\t\ths+='color: rgba(255,255,255,1);';\n\t\ths+='text-align: center;';\n\t\ths+='white-space: nowrap;';\n\t\ths+='padding: 2px 5px 2px 5px;';\n\t\ths+='overflow: hidden;';\n\t\tels.setAttribute('style',hs);\n\t\tels.innerHTML=me.hotspot.title;\n\t\tel.appendChild(els);\n\t\tme._tt_ht_node_1_1.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._tt_ht_node_1_1.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.elementMouseOver['ht_node_enter'] == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._tt_ht_node_1_1.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._tt_ht_node_1_1.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._tt_ht_node_1_1.style[domTransition]='';\n\t\t\t\tif (me._tt_ht_node_1_1.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._tt_ht_node_1_1.style.visibility=(Number(me._tt_ht_node_1_1.style.opacity)>0||!me._tt_ht_node_1_1.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._tt_ht_node_1_1.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._tt_ht_node_1_1.style.visibility=\"hidden\";\n\t\t\t\t\tme._tt_ht_node_1_1.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._tt_ht_node_1_1.ggUpdatePosition=function (useTransition) {\n\t\t\tthis.style[domTransition]='left 0';\n\t\t\tthis.ggTextDiv.style.left=((98-this.ggTextDiv.offsetWidth)/2) + 'px';\n\t\t}\n\t\tme._ht_node_enter.appendChild(me._tt_ht_node_1_1);\n\t\tel=me._ht_node_image_1_1=document.createElement('div');\n\t\tels=me._ht_node_image_1_1__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI0LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA2NCA2NDsiIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDY0IDY0IiB4PSIwcHgiIHk9IjBweCIgeG1sOnNwYWNlPSJwcmVzZX'+\n\t\t\t'J2ZSI+CiA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPiYjeGQ7Cgkuc3Qwe2ZpbGw6I0ZGRkZGRjt9JiN4ZDsKPC9zdHlsZT4KIDxjaXJjbGUgY3k9IjMyIiByPSIzMSIgY3g9IjMyIi8+CiA8Zz4KICA8cGF0aCBkPSJNMzQuMywzMkwyMC4xLDE3LjljLTAuNS0wLjUtMS4zLTAuMS0xLjMsMC41djUuNGMwLDAuNC0wLjMsMC43LTAuNywwLjdIOWMtMC40LDAtMC43LDAuMy0wLjcsMC43djE0LjQmI3hkOyYjeGE7JiN4OTsmI3g5O2MwLDAuNCwwLjMsMC43LDAuNywwLjdoOS4xYzAuNCwwLDAuNywwLjMsMC43LDAuN3Y1LjRjMCwwLjcsMC44LDEsMS4zLDAuNUwzNC4zLDMzQzM0LjYsMzIuOCwzNC42LDMy'+\n\t\t\t'LjMsMzQuMywzMnoiIGNsYXNzPSJzdDAiLz4KICA8cGF0aCBkPSJNNDQuMSwxMS4zSDMyLjFjLTEuNSwwLTIuNywxLjItMi43LDIuN3MxLjIsMi43LDIuNywyLjdoMTEuOWMwLjcsMCwxLjMsMC42LDEuMywxLjN2MjkuMiYjeGQ7JiN4YTsmI3g5OyYjeDk7YzAsMC43LTAuNiwxLjMtMS4zLDEuM0gzMi4xYy0xLjUsMC0yLjcsMS4yLTIuNywyLjdjMCwxLjUsMS4yLDIuNywyLjcsMi43aDExLjljMy43LDAsNi42LTMsNi42LTYuNlYxNy45JiN4ZDsmI3hhOyYjeDk7JiN4OTtDNTAuNywxNC4zLDQ3LjcsMTEuMyw0NC4xLDExLjN6IiBjbGFzcz0ic3QwIi8+CiA8L2c+Cjwvc3ZnPgo=';\n\t\tme._ht_node_image_1_1__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\tel.ggId=\"ht_node_image_1_1\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 32px;';\n\t\ths+='left : -16px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -16px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 32px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_node_image_1_1.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_node_image_1_1.logicBlock_scaling = function() {\n\t\t\tvar newLogicStateScaling;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('ht_ani') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateScaling = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateScaling = -1;\n\t\t\t}\n\t\t\tif (me._ht_node_image_1_1.ggCurrentLogicStateScaling != newLogicStateScaling) {\n\t\t\t\tme._ht_node_image_1_1.ggCurrentLogicStateScaling = newLogicStateScaling;\n\t\t\t\tme._ht_node_image_1_1.style[domTransition]='' + cssPrefix + 'transform 500ms ease 0ms';\n\t\t\t\tif (me._ht_node_image_1_1.ggCurrentLogicStateScaling == 0) {\n\t\t\t\t\tme._ht_node_image_1_1.ggParameter.sx = 1.1;\n\t\t\t\t\tme._ht_node_image_1_1.ggParameter.sy = 1.1;\n\t\t\t\t\tme._ht_node_image_1_1.style[domTransform]=parameterToTransform(me._ht_node_image_1_1.ggParameter);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._ht_node_image_1_1.ggParameter.sx = 1;\n\t\t\t\t\tme._ht_node_image_1_1.ggParameter.sy = 1;\n\t\t\t\t\tme._ht_node_image_1_1.style[domTransform]=parameterToTransform(me._ht_node_image_1_1.ggParameter);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_node_image_1_1.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme._ht_node_enter.appendChild(me._ht_node_image_1_1);\n\t\tme.__div = me._ht_node_enter;\n\t};\n\tfunction SkinHotspotClass_ht_node_enter_recycle(parentScope,hotspot) {\n\t\tvar me=this;\n\t\tvar flag=false;\n\t\tvar hs='';\n\t\tme.parentScope=parentScope;\n\t\tme.hotspot=hotspot;\n\t\tvar nodeId=String(hotspot.url);\n\t\tnodeId=(nodeId.charAt(0)=='{')?nodeId.substr(1, nodeId.length - 2):''; // }\n\t\tme.ggUserdata=skin.player.getNodeUserdata(nodeId);\n\t\tme.elementMouseDown=[];\n\t\tme.elementMouseOver=[];\n\t\tme.findElements=function(id,regex) {\n\t\t\treturn skin.findElements(id,regex);\n\t\t}\n\t\tel=me._ht_node_enter_recycle=document.createElement('div');\n\t\tel.ggId=\"ht_node_enter_recycle\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_hotspot \";\n\t\tel.ggType='hotspot';\n\t\ths ='';\n\t\ths+='height : 0px;';\n\t\ths+='left : 78px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 39px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 0px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_node_enter_recycle.ggIsActive=function() {\n\t\t\treturn player.getCurrentNode()==this.ggElementNodeId();\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif (me.hotspot.url!='' && me.hotspot.url.charAt(0)=='{') { // }\n\t\t\t\treturn me.hotspot.url.substr(1, me.hotspot.url.length - 2);\n\t\t\t} else {\n\t\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t\t} else {\n\t\t\t\t\treturn player.getCurrentNode();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_node_enter_recycle.onclick=function (e) {\n\t\t\tplayer.openUrl(me.hotspot.url,me.hotspot.target);\n\t\t\tskin.hotspotProxyClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_enter_recycle.ondblclick=function (e) {\n\t\t\tskin.hotspotProxyDoubleClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_enter_recycle.onmouseover=function (e) {\n\t\t\tplayer.setActiveHotspot(me.hotspot);\n\t\t\tskin._tt_ht_node.style[domTransition]='none';\n\t\t\tskin._tt_ht_node.style.visibility=(Number(skin._tt_ht_node.style.opacity)>0||!skin._tt_ht_node.style.opacity)?'inherit':'hidden';\n\t\t\tskin._tt_ht_node.ggVisible=true;\n\t\t\tme.elementMouseOver['ht_node_enter_recycle']=true;\n\t\t\tme._tt_ht_node_1_2.logicBlock_visible();\n\t\t\tskin.hotspotProxyOver(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_enter_recycle.onmouseout=function (e) {\n\t\t\tplayer.setActiveHotspot(null);\n\t\t\tskin._tt_ht_node.style[domTransition]='none';\n\t\t\tskin._tt_ht_node.style.visibility='hidden';\n\t\t\tskin._tt_ht_node.ggVisible=false;\n\t\t\tme.elementMouseOver['ht_node_enter_recycle']=false;\n\t\t\tme._tt_ht_node_1_2.logicBlock_visible();\n\t\t\tskin.hotspotProxyOut(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_enter_recycle.ontouchend=function (e) {\n\t\t\tme.elementMouseOver['ht_node_enter_recycle']=false;\n\t\t\tme._tt_ht_node_1_2.logicBlock_visible();\n\t\t}\n\t\tme._ht_node_enter_recycle.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._tt_ht_node_1_2=document.createElement('div');\n\t\tels=me._tt_ht_node_1_2__text=document.createElement('div');\n\t\tel.className='ggskin ggskin_textdiv';\n\t\tel.ggTextDiv=els;\n\t\tel.ggId=\"tt_ht_node_1_2\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_text \";\n\t\tel.ggType='text';\n\t\ths ='';\n\t\ths+='z-index: 100;';\n\t\ths+='height : 20px;';\n\t\ths+='left : -50px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 21px;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 100px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\ths ='position:absolute;';\n\t\ths += 'box-sizing: border-box;';\n\t\ths+='cursor: default;';\n\t\ths+='left: 0px;';\n\t\ths+='top: 0px;';\n\t\ths+='width: auto;';\n\t\ths+='height: auto;';\n\t\ths+='background: #000000;';\n\t\ths+='background: rgba(0,0,0,0.666667);';\n\t\ths+='border: 0px solid #000000;';\n\t\ths+='color: rgba(255,255,255,1);';\n\t\ths+='text-align: center;';\n\t\ths+='white-space: nowrap;';\n\t\ths+='padding: 2px 5px 2px 5px;';\n\t\ths+='overflow: hidden;';\n\t\tels.setAttribute('style',hs);\n\t\tels.innerHTML=me.hotspot.title;\n\t\tel.appendChild(els);\n\t\tme._tt_ht_node_1_2.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._tt_ht_node_1_2.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.elementMouseOver['ht_node_enter_recycle'] == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._tt_ht_node_1_2.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._tt_ht_node_1_2.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._tt_ht_node_1_2.style[domTransition]='';\n\t\t\t\tif (me._tt_ht_node_1_2.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._tt_ht_node_1_2.style.visibility=(Number(me._tt_ht_node_1_2.style.opacity)>0||!me._tt_ht_node_1_2.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._tt_ht_node_1_2.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._tt_ht_node_1_2.style.visibility=\"hidden\";\n\t\t\t\t\tme._tt_ht_node_1_2.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._tt_ht_node_1_2.ggUpdatePosition=function (useTransition) {\n\t\t\tthis.style[domTransition]='left 0';\n\t\t\tthis.ggTextDiv.style.left=((98-this.ggTextDiv.offsetWidth)/2) + 'px';\n\t\t}\n\t\tme._ht_node_enter_recycle.appendChild(me._tt_ht_node_1_2);\n\t\tel=me._ht_node_image_1_2=document.createElement('div');\n\t\tels=me._ht_node_image_1_2__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI0LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA2NCA2NDsiIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDY0IDY0IiB4bWxuczpzZXJpZj0iaHR0cDovL3d3dy5zZXJpZi5jb2'+\n\t\t\t'0vIiB4PSIwcHgiIHk9IjBweCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPiYjeGQ7Cgkuc3Qwe2ZpbGw6I0ZGRkZGRjt9JiN4ZDsKPC9zdHlsZT4KIDxjaXJjbGUgY3k9IjMyIiByPSIzMSIgY3g9IjMyIi8+CiA8cGF0aCBkPSJNNDUuNSwyNS42bDUuMSw5LjJjMyw1LjYtMS4yLDEyLjktNy41LDEzLjFjLTAuMSwwLTcuNiwwLTcuNiwwbDAsMy4yTDMwLDQzLjhsNS41LTcuN2wwLDMuNiYjeGQ7JiN4YTsmI3g5O2MyLjUsMCw0LjksMCw3LjQtMC4xYzAuNCwwLDAuNy0wLjUsMC41LTAuOWMtMS42LTMtMy4zLTYuMS01LTkuMWw1LjEsMC40TDQ1LjUsMjUuNkw0'+\n\t\t\t'NS41LDI1LjZ6IE0yNS44LDM1LjRMMjMuMiwzNCYjeGQ7JiN4YTsmI3g5O2MtMC45LDEuNi0xLjcsMy4yLTIuNiw0LjdjLTAuMiwwLjQsMC4xLDAuOSwwLjUsMC45YzIuOCwwLDUuNywwLjEsOC41LDAuMWwtMi45LDQuMWwzLjEsNGgtOC43Yy02LjYtMC4xLTEwLjctNy4zLTcuOC0xMi45JiN4ZDsmI3hhOyYjeDk7YzAtMC4xLDIuNy00LjcsMi43LTQuN2wtMi44LTEuNWw5LjUtMS42TDI1LjgsMzUuNEwyNS44LDM1LjR6IE0xOC44LDI1LjJsNS41LTkuOGMwLjUtMC45LDAuOC0xLjEsMS4yLTEuNmMxLjctMS45LDQuMy0yLjksNi44LTIuOCYjeGQ7JiN4YTsmI3g5O2MxLjIsMC4xLDEuNiwwLjIsMi'+\n\t\t\t'4zLDAuNGMyLDAuNiwzLjcsMS45LDQuOCwzLjZjMC4xLDAuMiwzLjEsNS40LDMuMSw1LjRsMy0xLjhsLTEuNSwzLjdsLTIuMiw1bC05LjUtMC44bDMuMi0xLjkmI3hkOyYjeGE7JiN4OTtjLTEtMS43LTItMy40LTMtNS4xYy0wLjEtMC4yLTAuMy0wLjMtMC42LTAuM2MtMC4yLDAtMC40LDAuMS0wLjUsMC4zYy0xLjgsMy4xLTMuNiw2LjItNS40LDkuNGwtMS43LTQuNiYjeGQ7JiN4YTsmI3g5O0MyNC40LDI0LjIsMTguOCwyNS4yLDE4LjgsMjUuMnogTTEzLjIsMjguN0wxMy4yLDI4LjdMMTMuMiwyOC43QzEzLjEsMjguNywxMy4yLDI4LjcsMTMuMiwyOC43eiIgY2xhc3M9InN0MCIvPgo8L3N2Zz4K'+\n\t\t\t'';\n\t\tme._ht_node_image_1_2__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\tel.ggId=\"ht_node_image_1_2\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 32px;';\n\t\ths+='left : -16px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -16px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 32px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_node_image_1_2.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_node_image_1_2.logicBlock_scaling = function() {\n\t\t\tvar newLogicStateScaling;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('ht_ani') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateScaling = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateScaling = -1;\n\t\t\t}\n\t\t\tif (me._ht_node_image_1_2.ggCurrentLogicStateScaling != newLogicStateScaling) {\n\t\t\t\tme._ht_node_image_1_2.ggCurrentLogicStateScaling = newLogicStateScaling;\n\t\t\t\tme._ht_node_image_1_2.style[domTransition]='' + cssPrefix + 'transform 500ms ease 0ms';\n\t\t\t\tif (me._ht_node_image_1_2.ggCurrentLogicStateScaling == 0) {\n\t\t\t\t\tme._ht_node_image_1_2.ggParameter.sx = 1.1;\n\t\t\t\t\tme._ht_node_image_1_2.ggParameter.sy = 1.1;\n\t\t\t\t\tme._ht_node_image_1_2.style[domTransform]=parameterToTransform(me._ht_node_image_1_2.ggParameter);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._ht_node_image_1_2.ggParameter.sx = 1;\n\t\t\t\t\tme._ht_node_image_1_2.ggParameter.sy = 1;\n\t\t\t\t\tme._ht_node_image_1_2.style[domTransform]=parameterToTransform(me._ht_node_image_1_2.ggParameter);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_node_image_1_2.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme._ht_node_enter_recycle.appendChild(me._ht_node_image_1_2);\n\t\tme.__div = me._ht_node_enter_recycle;\n\t};\n\tfunction SkinHotspotClass_ht_node_b2b(parentScope,hotspot) {\n\t\tvar me=this;\n\t\tvar flag=false;\n\t\tvar hs='';\n\t\tme.parentScope=parentScope;\n\t\tme.hotspot=hotspot;\n\t\tvar nodeId=String(hotspot.url);\n\t\tnodeId=(nodeId.charAt(0)=='{')?nodeId.substr(1, nodeId.length - 2):''; // }\n\t\tme.ggUserdata=skin.player.getNodeUserdata(nodeId);\n\t\tme.elementMouseDown=[];\n\t\tme.elementMouseOver=[];\n\t\tme.findElements=function(id,regex) {\n\t\t\treturn skin.findElements(id,regex);\n\t\t}\n\t\tel=me._ht_node_b2b=document.createElement('div');\n\t\tel.ggId=\"ht_node_b2b\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_hotspot \";\n\t\tel.ggType='hotspot';\n\t\ths ='';\n\t\ths+='height : 0px;';\n\t\ths+='left : 78px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 39px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 0px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_node_b2b.ggIsActive=function() {\n\t\t\treturn player.getCurrentNode()==this.ggElementNodeId();\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif (me.hotspot.url!='' && me.hotspot.url.charAt(0)=='{') { // }\n\t\t\t\treturn me.hotspot.url.substr(1, me.hotspot.url.length - 2);\n\t\t\t} else {\n\t\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t\t} else {\n\t\t\t\t\treturn player.getCurrentNode();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_node_b2b.onclick=function (e) {\n\t\t\tplayer.openUrl(me.hotspot.url,me.hotspot.target);\n\t\t\tskin.hotspotProxyClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_b2b.ondblclick=function (e) {\n\t\t\tskin.hotspotProxyDoubleClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_b2b.onmouseover=function (e) {\n\t\t\tplayer.setActiveHotspot(me.hotspot);\n\t\t\tskin._tt_ht_node.style[domTransition]='none';\n\t\t\tskin._tt_ht_node.style.visibility=(Number(skin._tt_ht_node.style.opacity)>0||!skin._tt_ht_node.style.opacity)?'inherit':'hidden';\n\t\t\tskin._tt_ht_node.ggVisible=true;\n\t\t\tme.elementMouseOver['ht_node_b2b']=true;\n\t\t\tme._tt_ht_node_1.logicBlock_visible();\n\t\t\tskin.hotspotProxyOver(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_b2b.onmouseout=function (e) {\n\t\t\tplayer.setActiveHotspot(null);\n\t\t\tskin._tt_ht_node.style[domTransition]='none';\n\t\t\tskin._tt_ht_node.style.visibility='hidden';\n\t\t\tskin._tt_ht_node.ggVisible=false;\n\t\t\tme.elementMouseOver['ht_node_b2b']=false;\n\t\t\tme._tt_ht_node_1.logicBlock_visible();\n\t\t\tskin.hotspotProxyOut(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_b2b.ontouchend=function (e) {\n\t\t\tme.elementMouseOver['ht_node_b2b']=false;\n\t\t\tme._tt_ht_node_1.logicBlock_visible();\n\t\t}\n\t\tme._ht_node_b2b.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._tt_ht_node_1=document.createElement('div');\n\t\tels=me._tt_ht_node_1__text=document.createElement('div');\n\t\tel.className='ggskin ggskin_textdiv';\n\t\tel.ggTextDiv=els;\n\t\tel.ggId=\"tt_ht_node_1\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_text \";\n\t\tel.ggType='text';\n\t\ths ='';\n\t\ths+='z-index: 100;';\n\t\ths+='height : 20px;';\n\t\ths+='left : -50px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 21px;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 100px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\ths ='position:absolute;';\n\t\ths += 'box-sizing: border-box;';\n\t\ths+='cursor: default;';\n\t\ths+='left: 0px;';\n\t\ths+='top: 0px;';\n\t\ths+='width: auto;';\n\t\ths+='height: auto;';\n\t\ths+='background: #000000;';\n\t\ths+='background: rgba(0,0,0,0.666667);';\n\t\ths+='border: 0px solid #000000;';\n\t\ths+='color: rgba(255,255,255,1);';\n\t\ths+='text-align: center;';\n\t\ths+='white-space: nowrap;';\n\t\ths+='padding: 2px 5px 2px 5px;';\n\t\ths+='overflow: hidden;';\n\t\tels.setAttribute('style',hs);\n\t\tels.innerHTML=me.hotspot.title;\n\t\tel.appendChild(els);\n\t\tme._tt_ht_node_1.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._tt_ht_node_1.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.elementMouseOver['ht_node_b2b'] == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._tt_ht_node_1.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._tt_ht_node_1.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._tt_ht_node_1.style[domTransition]='';\n\t\t\t\tif (me._tt_ht_node_1.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._tt_ht_node_1.style.visibility=(Number(me._tt_ht_node_1.style.opacity)>0||!me._tt_ht_node_1.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._tt_ht_node_1.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._tt_ht_node_1.style.visibility=\"hidden\";\n\t\t\t\t\tme._tt_ht_node_1.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._tt_ht_node_1.ggUpdatePosition=function (useTransition) {\n\t\t\tthis.style[domTransition]='left 0';\n\t\t\tthis.ggTextDiv.style.left=((98-this.ggTextDiv.offsetWidth)/2) + 'px';\n\t\t}\n\t\tme._ht_node_b2b.appendChild(me._tt_ht_node_1);\n\t\tel=me._ht_node_image_1=document.createElement('div');\n\t\tels=me._ht_node_image_1__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI0LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA2NCA2NC43OyIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgNjQgNjQuNyIgeD0iMHB4IiB5PSIwcHgiIHhtbDpzcGFjZT0icH'+\n\t\t\t'Jlc2VydmUiPgogPHN0eWxlIHR5cGU9InRleHQvY3NzIj4mI3hkOwoJLnN0MHtmaWxsOiNGRkZGRkY7fSYjeGQ7Cjwvc3R5bGU+CiA8Y2lyY2xlIGN5PSIzMiIgcj0iMzEiIGN4PSIzMiIvPgogPGc+CiAgPHBhdGggZD0iTTMwLjEsNDIuNFY0M0gxOC40di0wLjZjMC0wLjQtMC4zLTAuNi0wLjYtMC42aDBjLTAuNCwwLTAuNiwwLjMtMC42LDAuNlY0M2gtMS4zdi0zLjloMTYuOVY0M2gtMS4zdi0wLjYmI3hkOyYjeGE7JiN4OTsmI3g5O2MwLTAuNC0wLjMtMC42LTAuNi0wLjZoMEMzMC4zLDQxLjcsMzAuMSw0MiwzMC4xLDQyLjR6IE0xOC40LDM1LjljMC0xLjEsMC45LTEuOSwxLjktMS45aDcuOGMx'+\n\t\t\t'LjEsMCwxLjksMC45LDEuOSwxLjl2MS4zJiN4ZDsmI3hhOyYjeDk7JiN4OTtjMCwwLjQtMC4zLDAuNi0wLjYsMC42bDAsMGMtMC40LDAtMC42LTAuMy0wLjYtMC42di0xLjNjMC0wLjQtMC4zLTAuNi0wLjYtMC42aC03LjhjLTAuNCwwLTAuNiwwLjMtMC42LDAuNnYxLjMmI3hkOyYjeGE7JiN4OTsmI3g5O2MwLDAuNC0wLjMsMC42LTAuNiwwLjZsMCwwYy0wLjQsMC0wLjYtMC4zLTAuNi0wLjZWMzUuOXogTTM1LjIsNDguNWMwLDEuMi0xLDIuMy0yLjMsMi4zSDE1LjVjLTEuMiwwLTIuMy0xLTIuMy0yLjN2LTguOCYjeGQ7JiN4YTsmI3g5OyYjeDk7YzAtMC40LDAuMy0wLjYsMC42LTAuNmgwLjZ2NC'+\n\t\t\t'41YzAsMC40LDAuMywwLjYsMC42LDAuNmgxLjlWNDVjMCwwLjQsMC4zLDAuNiwwLjYsMC42aDBjMC40LDAsMC42LTAuMywwLjYtMC42di0wLjZoMTEuN1Y0NSYjeGQ7JiN4YTsmI3g5OyYjeDk7YzAsMC40LDAuMywwLjYsMC42LDAuNmgwYzAuNCwwLDAuNi0wLjMsMC42LTAuNnYtMC42aDEuOWMwLjQsMCwwLjYtMC4zLDAuNi0wLjZ2LTQuNWgwLjZjMC40LDAsMC42LDAuMywwLjYsMC42VjQ4LjV6IiBjbGFzcz0ic3QwIi8+CiAgPHBhdGggZD0iTTQ2LjMsNDh2LTAuNGMwLTAuNC0wLjMtMC42LTAuNi0wLjZoLTYuM2MtMC40LDAtMC44LTAuNC0wLjgtMC44di0xYzAtMC40LDAuNC0wLjgsMC44LTAu'+\n\t\t\t'OGg2LjMmI3hkOyYjeGE7JiN4OTsmI3g5O2MwLjQsMCwwLjYtMC4zLDAuNi0wLjZ2LTAuNGMwLTAuNywwLjktMS4xLDEuNC0wLjZsMi40LDIuNGMwLjMsMC4zLDAuMywwLjgsMCwxLjFsLTIuNCwyLjRDNDcuMSw0OSw0Ni4zLDQ4LjcsNDYuMyw0OHoiIGNsYXNzPSJzdDAiLz4KICA8cGF0aCBkPSJNNDUuNiwyMS42djAuNkgzMy45di0wLjZjMC0wLjQtMC4zLTAuNi0wLjYtMC42bDAsMGMtMC40LDAtMC42LDAuMy0wLjYsMC42djAuNmgtMS4zdi0zLjloMTYuOXYzLjloLTEuM3YtMC42JiN4ZDsmI3hhOyYjeDk7JiN4OTtjMC0wLjQtMC4zLTAuNi0wLjYtMC42bDAsMEM0NS45LDIxLDQ1LjYsMjEuMy'+\n\t\t\t'w0NS42LDIxLjZ6IE0zMy45LDE1LjFjMC0xLjEsMC45LTEuOSwxLjktMS45aDcuOGMxLjEsMCwxLjksMC45LDEuOSwxLjl2MS4zJiN4ZDsmI3hhOyYjeDk7JiN4OTtjMCwwLjQtMC4zLDAuNi0wLjYsMC42aDBjLTAuNCwwLTAuNi0wLjMtMC42LTAuNnYtMS4zYzAtMC40LTAuMy0wLjYtMC42LTAuNmgtNy44Yy0wLjQsMC0wLjYsMC4zLTAuNiwwLjZ2MS4zJiN4ZDsmI3hhOyYjeDk7JiN4OTtjMCwwLjQtMC4zLDAuNi0wLjYsMC42aDBjLTAuNCwwLTAuNi0wLjMtMC42LTAuNlYxNS4xeiBNNTAuOCwyNy44YzAsMS4yLTEsMi4zLTIuMywyLjNIMzFjLTEuMiwwLTIuMy0xLTIuMy0yLjNWMTkmI3hkOyYj'+\n\t\t\t'eGE7JiN4OTsmI3g5O2MwLTAuNCwwLjMtMC42LDAuNi0wLjZoMC42djQuNWMwLDAuNCwwLjMsMC42LDAuNiwwLjZoMS45djAuNmMwLDAuNCwwLjMsMC42LDAuNiwwLjZsMCwwYzAuNCwwLDAuNi0wLjMsMC42LTAuNnYtMC42aDExLjd2MC42JiN4ZDsmI3hhOyYjeDk7JiN4OTtjMCwwLjQsMC4zLDAuNiwwLjYsMC42bDAsMGMwLjQsMCwwLjYtMC4zLDAuNi0wLjZ2LTAuNmgxLjljMC40LDAsMC42LTAuMywwLjYtMC42di00LjVoMC42YzAuNCwwLDAuNiwwLjMsMC42LDAuNlYyNy44eiIgY2xhc3M9InN0MCIvPgogIDxwYXRoIGQ9Ik0xNy43LDIyLjV2MC40YzAsMC40LDAuMywwLjYsMC42LDAuNmg2Lj'+\n\t\t\t'NjMC40LDAsMC44LDAuNCwwLjgsMC44djFjMCwwLjQtMC40LDAuOC0wLjgsMC44aC02LjMmI3hkOyYjeGE7JiN4OTsmI3g5O2MtMC40LDAtMC42LDAuMy0wLjYsMC42djAuNGMwLDAuNy0wLjksMS4xLTEuNCwwLjZMMTQsMjUuNGMtMC4zLTAuMy0wLjMtMC44LDAtMS4xbDIuNC0yLjRDMTYuOSwyMS41LDE3LjcsMjEuOCwxNy43LDIyLjV6IiBjbGFzcz0ic3QwIi8+CiA8L2c+Cjwvc3ZnPgo=';\n\t\tme._ht_node_image_1__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\tel.ggId=\"ht_node_image_1\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 32px;';\n\t\ths+='left : -16px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -16px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 32px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_node_image_1.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_node_image_1.logicBlock_scaling = function() {\n\t\t\tvar newLogicStateScaling;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('ht_ani') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateScaling = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateScaling = -1;\n\t\t\t}\n\t\t\tif (me._ht_node_image_1.ggCurrentLogicStateScaling != newLogicStateScaling) {\n\t\t\t\tme._ht_node_image_1.ggCurrentLogicStateScaling = newLogicStateScaling;\n\t\t\t\tme._ht_node_image_1.style[domTransition]='' + cssPrefix + 'transform 500ms ease 0ms';\n\t\t\t\tif (me._ht_node_image_1.ggCurrentLogicStateScaling == 0) {\n\t\t\t\t\tme._ht_node_image_1.ggParameter.sx = 1.1;\n\t\t\t\t\tme._ht_node_image_1.ggParameter.sy = 1.1;\n\t\t\t\t\tme._ht_node_image_1.style[domTransform]=parameterToTransform(me._ht_node_image_1.ggParameter);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._ht_node_image_1.ggParameter.sx = 1;\n\t\t\t\t\tme._ht_node_image_1.ggParameter.sy = 1;\n\t\t\t\t\tme._ht_node_image_1.style[domTransform]=parameterToTransform(me._ht_node_image_1.ggParameter);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_node_image_1.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme._ht_node_b2b.appendChild(me._ht_node_image_1);\n\t\tme.__div = me._ht_node_b2b;\n\t};\n\tfunction SkinHotspotClass_ht_node_exit(parentScope,hotspot) {\n\t\tvar me=this;\n\t\tvar flag=false;\n\t\tvar hs='';\n\t\tme.parentScope=parentScope;\n\t\tme.hotspot=hotspot;\n\t\tvar nodeId=String(hotspot.url);\n\t\tnodeId=(nodeId.charAt(0)=='{')?nodeId.substr(1, nodeId.length - 2):''; // }\n\t\tme.ggUserdata=skin.player.getNodeUserdata(nodeId);\n\t\tme.elementMouseDown=[];\n\t\tme.elementMouseOver=[];\n\t\tme.findElements=function(id,regex) {\n\t\t\treturn skin.findElements(id,regex);\n\t\t}\n\t\tel=me._ht_node_exit=document.createElement('div');\n\t\tel.ggId=\"ht_node_exit\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_hotspot \";\n\t\tel.ggType='hotspot';\n\t\ths ='';\n\t\ths+='height : 0px;';\n\t\ths+='left : 78px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 39px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 0px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_node_exit.ggIsActive=function() {\n\t\t\treturn player.getCurrentNode()==this.ggElementNodeId();\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif (me.hotspot.url!='' && me.hotspot.url.charAt(0)=='{') { // }\n\t\t\t\treturn me.hotspot.url.substr(1, me.hotspot.url.length - 2);\n\t\t\t} else {\n\t\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t\t} else {\n\t\t\t\t\treturn player.getCurrentNode();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_node_exit.onclick=function (e) {\n\t\t\tplayer.openUrl(me.hotspot.url,me.hotspot.target);\n\t\t\tskin.hotspotProxyClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_exit.ondblclick=function (e) {\n\t\t\tskin.hotspotProxyDoubleClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_exit.onmouseover=function (e) {\n\t\t\tplayer.setActiveHotspot(me.hotspot);\n\t\t\tskin._tt_ht_node.style[domTransition]='none';\n\t\t\tskin._tt_ht_node.style.visibility=(Number(skin._tt_ht_node.style.opacity)>0||!skin._tt_ht_node.style.opacity)?'inherit':'hidden';\n\t\t\tskin._tt_ht_node.ggVisible=true;\n\t\t\tme.elementMouseOver['ht_node_exit']=true;\n\t\t\tme._tt_ht_node_1_1_1.logicBlock_visible();\n\t\t\tskin.hotspotProxyOver(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_exit.onmouseout=function (e) {\n\t\t\tplayer.setActiveHotspot(null);\n\t\t\tskin._tt_ht_node.style[domTransition]='none';\n\t\t\tskin._tt_ht_node.style.visibility='hidden';\n\t\t\tskin._tt_ht_node.ggVisible=false;\n\t\t\tme.elementMouseOver['ht_node_exit']=false;\n\t\t\tme._tt_ht_node_1_1_1.logicBlock_visible();\n\t\t\tskin.hotspotProxyOut(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_exit.ontouchend=function (e) {\n\t\t\tme.elementMouseOver['ht_node_exit']=false;\n\t\t\tme._tt_ht_node_1_1_1.logicBlock_visible();\n\t\t}\n\t\tme._ht_node_exit.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._tt_ht_node_1_1_1=document.createElement('div');\n\t\tels=me._tt_ht_node_1_1_1__text=document.createElement('div');\n\t\tel.className='ggskin ggskin_textdiv';\n\t\tel.ggTextDiv=els;\n\t\tel.ggId=\"tt_ht_node_1_1_1\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_text \";\n\t\tel.ggType='text';\n\t\ths ='';\n\t\ths+='z-index: 100;';\n\t\ths+='height : 20px;';\n\t\ths+='left : -50px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 21px;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 100px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\ths ='position:absolute;';\n\t\ths += 'box-sizing: border-box;';\n\t\ths+='cursor: default;';\n\t\ths+='left: 0px;';\n\t\ths+='top: 0px;';\n\t\ths+='width: auto;';\n\t\ths+='height: auto;';\n\t\ths+='background: #000000;';\n\t\ths+='background: rgba(0,0,0,0.666667);';\n\t\ths+='border: 0px solid #000000;';\n\t\ths+='color: rgba(255,255,255,1);';\n\t\ths+='text-align: center;';\n\t\ths+='white-space: nowrap;';\n\t\ths+='padding: 2px 5px 2px 5px;';\n\t\ths+='overflow: hidden;';\n\t\tels.setAttribute('style',hs);\n\t\tels.innerHTML=me.hotspot.title;\n\t\tel.appendChild(els);\n\t\tme._tt_ht_node_1_1_1.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._tt_ht_node_1_1_1.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.elementMouseOver['ht_node_exit'] == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._tt_ht_node_1_1_1.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._tt_ht_node_1_1_1.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._tt_ht_node_1_1_1.style[domTransition]='';\n\t\t\t\tif (me._tt_ht_node_1_1_1.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._tt_ht_node_1_1_1.style.visibility=(Number(me._tt_ht_node_1_1_1.style.opacity)>0||!me._tt_ht_node_1_1_1.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._tt_ht_node_1_1_1.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._tt_ht_node_1_1_1.style.visibility=\"hidden\";\n\t\t\t\t\tme._tt_ht_node_1_1_1.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._tt_ht_node_1_1_1.ggUpdatePosition=function (useTransition) {\n\t\t\tthis.style[domTransition]='left 0';\n\t\t\tthis.ggTextDiv.style.left=((98-this.ggTextDiv.offsetWidth)/2) + 'px';\n\t\t}\n\t\tme._ht_node_exit.appendChild(me._tt_ht_node_1_1_1);\n\t\tel=me._ht_node_image_1_1_1=document.createElement('div');\n\t\tels=me._ht_node_image_1_1_1__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI0LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA2NCA2NDsiIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDY0IDY0IiB4PSIwcHgiIHk9IjBweCIgeG1sOnNwYWNlPSJwcmVzZX'+\n\t\t\t'J2ZSI+CiA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPiYjeGQ7Cgkuc3Qwe2ZpbGw6I0ZGRkZGRjt9JiN4ZDsKPC9zdHlsZT4KIDxjaXJjbGUgY3k9IjMyIiByPSIzMSIgY3g9IjMyIi8+CiA8cGF0aCBkPSJNOC41LDMzbDE0LjEsMTQuMWMwLjUsMC41LDEuMywwLjEsMS4zLTAuNXYtNS40YzAtMC40LDAuMy0wLjcsMC43LTAuN2g5LjFjMC40LDAsMC43LTAuMywwLjctMC43VjI1LjMmI3hkOyYjeGE7JiN4OTtjMC0wLjQtMC4zLTAuNy0wLjctMC43aC05LjFjLTAuNCwwLTAuNy0wLjMtMC43LTAuN3YtNS40YzAtMC43LTAuOC0xLTEuMy0wLjVMOC41LDMyQzguMiwzMi4zLDguMiwzMi44LDguNSwzM3oi'+\n\t\t\t'IGNsYXNzPSJzdDAiLz4KIDxwYXRoIGQ9Ik00NC4xLDExLjNIMzIuMWMtMS41LDAtMi43LDEuMi0yLjcsMi43czEuMiwyLjcsMi43LDIuN2gxMS45YzAuNywwLDEuMywwLjYsMS4zLDEuM3YyOS4yJiN4ZDsmI3hhOyYjeDk7YzAsMC43LTAuNiwxLjMtMS4zLDEuM0gzMi4xYy0xLjUsMC0yLjcsMS4yLTIuNywyLjdjMCwxLjUsMS4yLDIuNywyLjcsMi43aDExLjljMy43LDAsNi42LTMsNi42LTYuNlYxNy45JiN4ZDsmI3hhOyYjeDk7QzUwLjcsMTQuMyw0Ny43LDExLjMsNDQuMSwxMS4zeiIgY2xhc3M9InN0MCIvPgo8L3N2Zz4K';\n\t\tme._ht_node_image_1_1_1__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\tel.ggId=\"ht_node_image_1_1_1\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 32px;';\n\t\ths+='left : -16px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -16px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 32px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_node_image_1_1_1.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_node_image_1_1_1.logicBlock_scaling = function() {\n\t\t\tvar newLogicStateScaling;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('ht_ani') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateScaling = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateScaling = -1;\n\t\t\t}\n\t\t\tif (me._ht_node_image_1_1_1.ggCurrentLogicStateScaling != newLogicStateScaling) {\n\t\t\t\tme._ht_node_image_1_1_1.ggCurrentLogicStateScaling = newLogicStateScaling;\n\t\t\t\tme._ht_node_image_1_1_1.style[domTransition]='' + cssPrefix + 'transform 500ms ease 0ms';\n\t\t\t\tif (me._ht_node_image_1_1_1.ggCurrentLogicStateScaling == 0) {\n\t\t\t\t\tme._ht_node_image_1_1_1.ggParameter.sx = 1.1;\n\t\t\t\t\tme._ht_node_image_1_1_1.ggParameter.sy = 1.1;\n\t\t\t\t\tme._ht_node_image_1_1_1.style[domTransform]=parameterToTransform(me._ht_node_image_1_1_1.ggParameter);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._ht_node_image_1_1_1.ggParameter.sx = 1;\n\t\t\t\t\tme._ht_node_image_1_1_1.ggParameter.sy = 1;\n\t\t\t\t\tme._ht_node_image_1_1_1.style[domTransform]=parameterToTransform(me._ht_node_image_1_1_1.ggParameter);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_node_image_1_1_1.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme._ht_node_exit.appendChild(me._ht_node_image_1_1_1);\n\t\tme.__div = me._ht_node_exit;\n\t};\n\tfunction SkinHotspotClass_ht_node_link(parentScope,hotspot) {\n\t\tvar me=this;\n\t\tvar flag=false;\n\t\tvar hs='';\n\t\tme.parentScope=parentScope;\n\t\tme.hotspot=hotspot;\n\t\tvar nodeId=String(hotspot.url);\n\t\tnodeId=(nodeId.charAt(0)=='{')?nodeId.substr(1, nodeId.length - 2):''; // }\n\t\tme.ggUserdata=skin.player.getNodeUserdata(nodeId);\n\t\tme.elementMouseDown=[];\n\t\tme.elementMouseOver=[];\n\t\tme.findElements=function(id,regex) {\n\t\t\treturn skin.findElements(id,regex);\n\t\t}\n\t\tel=me._ht_node_link=document.createElement('div');\n\t\tel.ggId=\"ht_node_link\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_hotspot \";\n\t\tel.ggType='hotspot';\n\t\ths ='';\n\t\ths+='height : 0px;';\n\t\ths+='left : 78px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 39px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 0px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_node_link.ggIsActive=function() {\n\t\t\treturn player.getCurrentNode()==this.ggElementNodeId();\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif (me.hotspot.url!='' && me.hotspot.url.charAt(0)=='{') { // }\n\t\t\t\treturn me.hotspot.url.substr(1, me.hotspot.url.length - 2);\n\t\t\t} else {\n\t\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t\t} else {\n\t\t\t\t\treturn player.getCurrentNode();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_node_link.onclick=function (e) {\n\t\t\tplayer.openUrl(me.hotspot.url,me.hotspot.target);\n\t\t\tskin.hotspotProxyClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_link.ondblclick=function (e) {\n\t\t\tskin.hotspotProxyDoubleClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_link.onmouseover=function (e) {\n\t\t\tplayer.setActiveHotspot(me.hotspot);\n\t\t\tme._ht_info_d.style[domTransition]='none';\n\t\t\tme._ht_info_d.style.visibility=(Number(me._ht_info_d.style.opacity)>0||!me._ht_info_d.style.opacity)?'inherit':'hidden';\n\t\t\tme._ht_info_d.ggVisible=true;\n\t\t\tme.elementMouseOver['ht_node_link']=true;\n\t\t\tme._ht_info_d.logicBlock_visible();\n\t\t\tskin.hotspotProxyOver(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_link.onmouseout=function (e) {\n\t\t\tplayer.setActiveHotspot(null);\n\t\t\tme._ht_info_d.style[domTransition]='none';\n\t\t\tme._ht_info_d.style.visibility='hidden';\n\t\t\tme._ht_info_d.ggVisible=false;\n\t\t\tme.elementMouseOver['ht_node_link']=false;\n\t\t\tme._ht_info_d.logicBlock_visible();\n\t\t\tskin.hotspotProxyOut(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node_link.ontouchend=function (e) {\n\t\t\tme.elementMouseOver['ht_node_link']=false;\n\t\t\tme._ht_info_d.logicBlock_visible();\n\t\t}\n\t\tme._ht_node_link.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._ht_info_d=document.createElement('div');\n\t\tels=me._ht_info_d__text=document.createElement('div');\n\t\tel.className='ggskin ggskin_textdiv';\n\t\tel.ggTextDiv=els;\n\t\tel.ggId=\"ht_info_d\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_text \";\n\t\tel.ggType='text';\n\t\ths ='';\n\t\ths+='z-index: 100;';\n\t\ths+='height : 20px;';\n\t\ths+='left : -50px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 21px;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 100px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\ths ='position:absolute;';\n\t\ths += 'box-sizing: border-box;';\n\t\ths+='cursor: default;';\n\t\ths+='left: 0px;';\n\t\ths+='top: 0px;';\n\t\ths+='width: auto;';\n\t\ths+='height: auto;';\n\t\ths+='background: #000000;';\n\t\ths+='background: rgba(0,0,0,0.666667);';\n\t\ths+='border: 0px solid #000000;';\n\t\ths+='color: rgba(255,255,255,1);';\n\t\ths+='text-align: center;';\n\t\ths+='white-space: nowrap;';\n\t\ths+='padding: 2px 5px 2px 5px;';\n\t\ths+='overflow: hidden;';\n\t\tels.setAttribute('style',hs);\n\t\tels.innerHTML=me.hotspot.title;\n\t\tel.appendChild(els);\n\t\tme._ht_info_d.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_info_d.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.elementMouseOver['ht_node_link'] == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._ht_info_d.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._ht_info_d.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._ht_info_d.style[domTransition]='';\n\t\t\t\tif (me._ht_info_d.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._ht_info_d.style.visibility=(Number(me._ht_info_d.style.opacity)>0||!me._ht_info_d.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._ht_info_d.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._ht_info_d.style.visibility=\"hidden\";\n\t\t\t\t\tme._ht_info_d.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_info_d.ggUpdatePosition=function (useTransition) {\n\t\t\tthis.style[domTransition]='left 0';\n\t\t\tthis.ggTextDiv.style.left=((98-this.ggTextDiv.offsetWidth)/2) + 'px';\n\t\t}\n\t\tme._ht_node_link.appendChild(me._ht_info_d);\n\t\tel=me._ht_node_link_ico=document.createElement('div');\n\t\tels=me._ht_node_link_ico__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA2NCA2NC43OyIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgNjQgNjQuNyIgeD0iMHB4IiB5PSIwcHgiIHhtbDpzcGFjZT0icH'+\n\t\t\t'Jlc2VydmUiPgogPHN0eWxlIHR5cGU9InRleHQvY3NzIj4mI3hkOwoJLnN0MHtmaWxsOiNGRkZGRkY7fSYjeGQ7Cjwvc3R5bGU+CiA8Y2lyY2xlIGN5PSIzMiIgcj0iMzEiIGN4PSIzMiIvPgogPGc+CiAgPHBhdGggZD0iTTMyLDkuN2MtNC45LDAtOC45LDQtOC45LDguOXYxLjVoLTEuMmMtMi42LDAtNC43LDItNC45LDQuNmwtMS4yLDI0LjRjLTAuMSwyLjcsMiw1LDQuNiw1LjEmI3hkOyYjeGE7JiN4OTsmI3g5O2MwLjEsMCwwLjEsMCwwLjIsMGgyMi43YzIuNywwLDQuOS0yLjIsNC45LTQuOWMwLTAuMSwwLTAuMSwwLTAuMkw0NywyNC43Yy0wLjEtMi42LTIuMy00LjYtNC45LTQuNmgtMS4ydi0x'+\n\t\t\t'LjUmI3hkOyYjeGE7JiN4OTsmI3g5O0M0MC45LDEzLjcsMzYuOSw5LjcsMzIsOS43eiBNMjYuMSwxOC42YzAtMy4zLDIuNy01LjksNS45LTUuOXM1LjksMi43LDUuOSw1Ljl2MS41SDI2LjFWMTguNnogTTIzLjYsMjYuM2MwLTAuOCwwLjctMS41LDEuNS0xLjUmI3hkOyYjeGE7JiN4OTsmI3g5O3MxLjUsMC43LDEuNSwxLjVzLTAuNywxLjUtMS41LDEuNVMyMy42LDI3LjIsMjMuNiwyNi4zQzIzLjYsMjYuMywyMy42LDI2LjMsMjMuNiwyNi4zeiBNMzcuNCwyNi4zYzAtMC44LDAuNy0xLjUsMS41LTEuNSYjeGQ7JiN4YTsmI3g5OyYjeDk7czEuNSwwLjcsMS41LDEuNXMtMC43LDEuNS0xLjUsMS41Uz'+\n\t\t\t'M3LjQsMjcuMiwzNy40LDI2LjNDMzcuNCwyNi4zLDM3LjQsMjYuMywzNy40LDI2LjN6IiBjbGFzcz0ic3QwIi8+CiA8L2c+Cjwvc3ZnPgo=';\n\t\tme._ht_node_link_ico__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\tel.ggId=\"ht_node_link_ico\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 32px;';\n\t\ths+='left : -16px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -16px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 32px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_node_link_ico.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_node_link_ico.logicBlock_scaling = function() {\n\t\t\tvar newLogicStateScaling;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('ht_ani') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateScaling = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateScaling = -1;\n\t\t\t}\n\t\t\tif (me._ht_node_link_ico.ggCurrentLogicStateScaling != newLogicStateScaling) {\n\t\t\t\tme._ht_node_link_ico.ggCurrentLogicStateScaling = newLogicStateScaling;\n\t\t\t\tme._ht_node_link_ico.style[domTransition]='' + cssPrefix + 'transform 500ms ease 0ms';\n\t\t\t\tif (me._ht_node_link_ico.ggCurrentLogicStateScaling == 0) {\n\t\t\t\t\tme._ht_node_link_ico.ggParameter.sx = 1.1;\n\t\t\t\t\tme._ht_node_link_ico.ggParameter.sy = 1.1;\n\t\t\t\t\tme._ht_node_link_ico.style[domTransform]=parameterToTransform(me._ht_node_link_ico.ggParameter);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._ht_node_link_ico.ggParameter.sx = 1;\n\t\t\t\t\tme._ht_node_link_ico.ggParameter.sy = 1;\n\t\t\t\t\tme._ht_node_link_ico.style[domTransform]=parameterToTransform(me._ht_node_link_ico.ggParameter);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_node_link_ico.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme._ht_node_link.appendChild(me._ht_node_link_ico);\n\t\tme.__div = me._ht_node_link;\n\t};\n\tfunction SkinHotspotClass_ht_video_file(parentScope,hotspot) {\n\t\tvar me=this;\n\t\tvar flag=false;\n\t\tvar hs='';\n\t\tme.parentScope=parentScope;\n\t\tme.hotspot=hotspot;\n\t\tvar nodeId=String(hotspot.url);\n\t\tnodeId=(nodeId.charAt(0)=='{')?nodeId.substr(1, nodeId.length - 2):''; // }\n\t\tme.ggUserdata=skin.player.getNodeUserdata(nodeId);\n\t\tme.elementMouseDown=[];\n\t\tme.elementMouseOver=[];\n\t\tme.findElements=function(id,regex) {\n\t\t\treturn skin.findElements(id,regex);\n\t\t}\n\t\tel=me._ht_video_file=document.createElement('div');\n\t\tel.ggId=\"ht_video_file\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_hotspot \";\n\t\tel.ggType='hotspot';\n\t\ths ='';\n\t\ths+='height : 0px;';\n\t\ths+='left : 200px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 200px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 0px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_video_file.ggIsActive=function() {\n\t\t\treturn player.getCurrentNode()==this.ggElementNodeId();\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif (me.hotspot.url!='' && me.hotspot.url.charAt(0)=='{') { // }\n\t\t\t\treturn me.hotspot.url.substr(1, me.hotspot.url.length - 2);\n\t\t\t} else {\n\t\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t\t} else {\n\t\t\t\t\treturn player.getCurrentNode();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_video_file.onclick=function (e) {\n\t\t\tskin._popup_video_file.ggInitMedia(player.getBasePath()+\"\"+me.hotspot.url);\n\t\t\tplayer.setVariableValue('vis_video_file', true);\n\t\t\tif (skin._popup_video_file.ggApiPlayer) {\n\t\t\t\tif (skin._popup_video_file.ggApiPlayerType == 'youtube') {\n\t\t\t\t\tlet youtubeMediaFunction = function() {\n\t\t\t\t\t\tskin._popup_video_file.ggApiPlayer.playVideo();\n\t\t\t\t\t};\n\t\t\t\t\tif (skin._popup_video_file.ggApiPlayerReady) {\n\t\t\t\t\t\tyoutubeMediaFunction();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet youtubeApiInterval = setInterval(function() {\n\t\t\t\t\t\t\tif (skin._popup_video_file.ggApiPlayerReady) {\n\t\t\t\t\t\t\t\tclearInterval(youtubeApiInterval);\n\t\t\t\t\t\t\t\tyoutubeMediaFunction();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, 100);\n\t\t\t\t\t}\n\t\t\t\t} else if (skin._popup_video_file.ggApiPlayerType == 'vimeo') {\n\t\t\t\t\tskin._popup_video_file.ggApiPlayer.play();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tplayer.playSound(\"popup_video_file\",\"1\");\n\t\t\t}\n\t\t\tskin.hotspotProxyClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_video_file.ondblclick=function (e) {\n\t\t\tskin.hotspotProxyDoubleClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_video_file.onmouseover=function (e) {\n\t\t\tplayer.setActiveHotspot(me.hotspot);\n\t\t\tme.elementMouseOver['ht_video_file']=true;\n\t\t\tme._tt_ht_video_file.logicBlock_visible();\n\t\t\tskin.hotspotProxyOver(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_video_file.onmouseout=function (e) {\n\t\t\tplayer.setActiveHotspot(null);\n\t\t\tme.elementMouseOver['ht_video_file']=false;\n\t\t\tme._tt_ht_video_file.logicBlock_visible();\n\t\t\tskin.hotspotProxyOut(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_video_file.ontouchend=function (e) {\n\t\t\tme.elementMouseOver['ht_video_file']=false;\n\t\t\tme._tt_ht_video_file.logicBlock_visible();\n\t\t}\n\t\tme._ht_video_file.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._ht_video_video_file=document.createElement('div');\n\t\tels=me._ht_video_video_file__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yNDAgMzMyIDEzMCAxMzAiIGJhc2VQcm9maWxlPSJ0aW55IiB4PSIwcHgiIHk9IjBweCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiA8ZyBpZD0iTG'+\n\t\t\t'F5ZXJfMV8xXyI+CiAgPGc+CiAgIDxwYXRoIGZpbGw9IiMwMDAwMDAiIGQ9Ik0tMTc1LDM0MC45Yy0zMSwwLTU2LjEsMjUuMS01Ni4xLDU2LjFjMCwzMSwyNS4xLDU2LjEsNTYuMSw1Ni4xczU2LjEtMjUuMSw1Ni4xLTU2LjEmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7Qy0xMTguOSwzNjYtMTQ0LDM0MC45LTE3NSwzNDAuOXogTS0xMzkuNCw0MjEuN2MwLDEuMy0xLDIuMy0yLjMsMi4zaC02Ni43Yy0xLjMsMC0yLjMtMS0yLjMtMi4zdi00OS40YzAtMS4zLDEtMi4zLDIuMy0yLjNoNjYuNyYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTtjMS4zLDAsMi4zLDEsMi4zLDIuM1Y0MjEuN3oiLz4KICAgPHBh'+\n\t\t\t'dGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xNzguNCw0MDVsMTAuOC03LjVjMC43LTAuNSwwLjctMS4zLDAtMS44bC0xMC44LTcuNWMtMC43LTAuNS0xLjMtMC4yLTEuMywwLjd2MTUuNSYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTtDLTE3OS43LDQwNS4yLTE3OS4xLDQwNS41LTE3OC40LDQwNXoiLz4KICAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0yMDYuNSw0MTUuMWg2Mi40di0zNi4xaC02Mi40VjQxNS4xeiBNLTE3NSwzODIuMWM4LDAsMTQuNCw2LjUsMTQuNCwxNC40YzAsOC02LjUsMTQuNC0xNC40LDE0LjQmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7Yy04LDAtMTQuNC02LjUtMTQuNC0xNC'+\n\t\t\t'40Qy0xODkuNCwzODguNi0xODMsMzgyLjEtMTc1LDM4Mi4xeiIvPgogIDwvZz4KIDwvZz4KIDxnIGlkPSJMYXllcl8yIj4KICA8Zz4KICAgPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTS0xNDEuNywzNzBoLTY2LjdjLTEuMywwLTIuMywxLTIuMywyLjN2NDkuNGMwLDEuMywxLDIuMywyLjMsMi4zaDY2LjdjMS4zLDAsMi4zLTEsMi4zLTIuM3YtNDkuNCYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTtDLTEzOS40LDM3MS0xNDAuNCwzNzAtMTQxLjcsMzcweiBNLTE0NC4yLDQxNS4xaC02Mi40di0zNi4xaDYyLjRDLTE0NC4yLDM3OC45LTE0NC4yLDQxNS4xLTE0NC4yLDQxNS4xeiIvPgogICA8cGF0aCBm'+\n\t\t\t'aWxsPSIjRkZGRkZGIiBkPSJNLTE3NSw0MTFjOCwwLDE0LjQtNi41LDE0LjQtMTQuNGMwLTgtNi41LTE0LjQtMTQuNC0xNC40Yy04LDAtMTQuNCw2LjUtMTQuNCwxNC40JiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5O0MtMTg5LjQsNDA0LjUtMTgzLDQxMS0xNzUsNDExeiBNLTE3OS43LDM4OC44YzAtMC44LDAuNi0xLjEsMS4zLTAuN2wxMC44LDcuNWMwLjcsMC41LDAuNywxLjMsMCwxLjhsLTEwLjgsNy41JiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5O2MtMC43LDAuNS0xLjMsMC4yLTEuMy0wLjdWMzg4Ljh6Ii8+CiAgPC9nPgogPC9nPgo8L3N2Zz4K';\n\t\tme._ht_video_video_file__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\telo=me._ht_video_video_file__imgo=document.createElement('img');\n\t\telo.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yNDAgMzMyIDEzMCAxMzAiIGJhc2VQcm9maWxlPSJ0aW55IiB4PSIwcHgiIHk9IjBweCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiA8ZyBpZD0iTG'+\n\t\t\t'F5ZXJfMV8xXyI+CiAgPGc+CiAgIDxwYXRoIGZpbGw9IiMwMDAwMDAiIGQ9Ik0tMTc1LDMzNC42Yy0zNC40LDAtNjIuNCwyNy45LTYyLjQsNjIuNGMwLDM0LjQsMjcuOSw2Mi40LDYyLjQsNjIuNHM2Mi40LTI3LjksNjIuNC02Mi40JiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5O0MtMTEyLjYsMzYyLjYtMTQwLjYsMzM0LjYtMTc1LDMzNC42eiBNLTEzNS40LDQyNC40YzAsMS40LTEuMSwyLjYtMi42LDIuNkgtMjEyYy0xLjQsMC0yLjYtMS4xLTIuNi0yLjZ2LTU0LjkmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7YzAtMS40LDEuMS0yLjYsMi42LTIuNmg3NC4xYzEuNCwwLDIuNiwxLjEsMi42LDIuNlY0'+\n\t\t\t'MjQuNHoiLz4KICAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xNzguOCw0MDUuOWwxMi04LjRjMC44LTAuNSwwLjgtMS40LDAtMS45bC0xMi04LjRjLTAuOC0wLjUtMS40LTAuMi0xLjQsMC43djE3LjMmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7Qy0xODAuMiw0MDYuMS0xNzkuNiw0MDYuNC0xNzguOCw0MDUuOXoiLz4KICAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0yMTAsNDE3LjFoNjkuM3YtNDAuMkgtMjEwVjQxNy4xeiBNLTE3NSwzODAuNWM4LjksMCwxNiw3LjIsMTYsMTZjMCw4LjktNy4yLDE2LTE2LDE2JiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5O2MtOC45LDAtMTYtNy4yLTE2LT'+\n\t\t\t'E2Qy0xOTEsMzg3LjctMTgzLjksMzgwLjUtMTc1LDM4MC41eiIvPgogIDwvZz4KIDwvZz4KIDxnIGlkPSJMYXllcl8yIj4KICA8Zz4KICAgPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTS0xMzgsMzY3SC0yMTJjLTEuNCwwLTIuNiwxLjEtMi42LDIuNnY1NC45YzAsMS40LDEuMSwyLjYsMi42LDIuNmg3NC4xYzEuNCwwLDIuNi0xLjEsMi42LTIuNnYtNTQuOSYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTtDLTEzNS40LDM2OC4xLTEzNi42LDM2Ny0xMzgsMzY3eiBNLTE0MC43LDQxNy4xSC0yMTB2LTQwLjJoNjkuM0MtMTQwLjcsMzc2LjktMTQwLjcsNDE3LjEtMTQwLjcsNDE3LjF6Ii8+CiAgIDxwYXRo'+\n\t\t\t'IGZpbGw9IiNGRkZGRkYiIGQ9Ik0tMTc1LDQxMi42YzguOSwwLDE2LTcuMiwxNi0xNmMwLTguOS03LjItMTYtMTYtMTZjLTguOSwwLTE2LDcuMi0xNiwxNkMtMTkxLDQwNS40LTE4My45LDQxMi42LTE3NSw0MTIuNiYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTt6IE0tMTgwLjIsMzg3LjljMC0wLjksMC42LTEuMywxLjQtMC43bDEyLDguNGMwLjgsMC41LDAuOCwxLjQsMCwxLjlsLTEyLDguNGMtMC44LDAuNS0xLjQsMC4yLTEuNC0wLjdWMzg3Ljl6Ii8+CiAgPC9nPgogPC9nPgo8L3N2Zz4K';\n\t\tme._ht_video_video_file__imgo.setAttribute('src',hs);\n\t\telo.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;visibility:hidden;pointer-events:none;;');\n\t\telo['ondragstart']=function() { return false; };\n\t\tel.appendChild(elo);\n\t\tel.ggId=\"ht_video_video_file\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 32px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 32px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_video_video_file.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_video_video_file.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.hotspot.customimage != \"\"))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._ht_video_video_file.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._ht_video_video_file.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._ht_video_video_file.style[domTransition]='';\n\t\t\t\tif (me._ht_video_video_file.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._ht_video_video_file.style.visibility=\"hidden\";\n\t\t\t\t\tme._ht_video_video_file.ggVisible=false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._ht_video_video_file.style.visibility=(Number(me._ht_video_video_file.style.opacity)>0||!me._ht_video_video_file.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._ht_video_video_file.ggVisible=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_video_video_file.onmouseover=function (e) {\n\t\t\tme._ht_video_video_file__img.style.visibility='hidden';\n\t\t\tme._ht_video_video_file__imgo.style.visibility='inherit';\n\t\t}\n\t\tme._ht_video_video_file.onmouseout=function (e) {\n\t\t\tme._ht_video_video_file__img.style.visibility='inherit';\n\t\t\tme._ht_video_video_file__imgo.style.visibility='hidden';\n\t\t}\n\t\tme._ht_video_video_file.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t}\n\t\tme._ht_video_file.appendChild(me._ht_video_video_file);\n\t\tel=me._tt_ht_video_file=document.createElement('div');\n\t\tels=me._tt_ht_video_file__text=document.createElement('div');\n\t\tel.className='ggskin ggskin_textdiv';\n\t\tel.ggTextDiv=els;\n\t\tel.ggId=\"tt_ht_video_file\";\n\t\tel.ggDx=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_text \";\n\t\tel.ggType='text';\n\t\ths ='';\n\t\ths+='z-index: 100;';\n\t\ths+='height : 20px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 24px;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 100px;';\n\t\ths+='pointer-events:none;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\ths ='position:absolute;';\n\t\ths += 'box-sizing: border-box;';\n\t\ths+='cursor: default;';\n\t\ths+='left: 0px;';\n\t\ths+='top: 0px;';\n\t\ths+='width: auto;';\n\t\ths+='height: auto;';\n\t\ths+='pointer-events: none;';\n\t\ths+='background: #000000;';\n\t\ths+='background: rgba(0,0,0,0.666667);';\n\t\ths+='border: 0px solid #000000;';\n\t\ths+='color: rgba(255,255,255,1);';\n\t\ths+='text-align: center;';\n\t\ths+='white-space: nowrap;';\n\t\ths+='padding: 2px 5px 2px 5px;';\n\t\ths+='overflow: hidden;';\n\t\tels.setAttribute('style',hs);\n\t\tels.innerHTML=me.hotspot.title;\n\t\tel.appendChild(els);\n\t\tme._tt_ht_video_file.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._tt_ht_video_file.logicBlock_position = function() {\n\t\t\tvar newLogicStatePosition;\n\t\t\tif (\n\t\t\t\t((player.getHasTouch() == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStatePosition = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStatePosition = -1;\n\t\t\t}\n\t\t\tif (me._tt_ht_video_file.ggCurrentLogicStatePosition != newLogicStatePosition) {\n\t\t\t\tme._tt_ht_video_file.ggCurrentLogicStatePosition = newLogicStatePosition;\n\t\t\t\tme._tt_ht_video_file.style[domTransition]='left 0s, top 0s';\n\t\t\t\tif (me._tt_ht_video_file.ggCurrentLogicStatePosition == 0) {\n\t\t\t\t\tthis.ggDx = 0;\n\t\t\t\t\tme._tt_ht_video_file.style.top='-47px';\n\t\t\t\t\tme._tt_ht_video_file.ggUpdatePosition(true);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._tt_ht_video_file.ggDx=0;\n\t\t\t\t\tme._tt_ht_video_file.style.top='24px';\n\t\t\t\t\tme._tt_ht_video_file.ggUpdatePosition(true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._tt_ht_video_file.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.elementMouseOver['ht_video_file'] == true)) && \n\t\t\t\t((me.hotspot.title != \"\"))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._tt_ht_video_file.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._tt_ht_video_file.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._tt_ht_video_file.style[domTransition]='left 0s, top 0s';\n\t\t\t\tif (me._tt_ht_video_file.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._tt_ht_video_file.style.visibility=(Number(me._tt_ht_video_file.style.opacity)>0||!me._tt_ht_video_file.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._tt_ht_video_file.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._tt_ht_video_file.style.visibility=\"hidden\";\n\t\t\t\t\tme._tt_ht_video_file.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._tt_ht_video_file.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth + 0;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t}\n\t\t\tthis.style[domTransition]='left 0';\n\t\t\tthis.ggTextDiv.style.left=((98-this.ggTextDiv.offsetWidth)/2) + 'px';\n\t\t}\n\t\tme._ht_video_file.appendChild(me._tt_ht_video_file);\n\t\tel=me._ht_video_file_customimage=document.createElement('div');\n\t\tels=me._ht_video_file_customimage__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_external';\n\t\tels.setAttribute('style','position: absolute;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels.onload=function() {me._ht_video_file_customimage.ggUpdatePosition();}\n\t\tif ((hotspot) && (hotspot.customimage)) {\n\t\t\tel.ggText=hotspot.customimage;\n\t\t\tels.setAttribute('src', hotspot.customimage);\n\t\t\tels.style.width=hotspot.customimagewidth + 'px';\n\t\t\tels.style.height=hotspot.customimageheight + 'px';\n\t\t\tme.ggUse3d = hotspot.use3D;\n\t\t\tme.gg3dDistance = hotspot.distance3D;\n\t\t}\n\t\tels['ondragstart']=function() { return false; };\n\t\tplayer.checkLoaded.push(els);\n\t\ths ='';\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\tel.ggId=\"ht_video_file_CustomImage\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_external \";\n\t\tel.ggType='external';\n\t\ths ='';\n\t\ths+='border : 0px solid #000000;';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 50px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 50px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_video_file_customimage.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_video_file_customimage.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.hotspot.customimage == \"\"))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._ht_video_file_customimage.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._ht_video_file_customimage.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._ht_video_file_customimage.style[domTransition]='';\n\t\t\t\tif (me._ht_video_file_customimage.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._ht_video_file_customimage.style.visibility=\"hidden\";\n\t\t\t\t\tme._ht_video_file_customimage__img.src = '';\n\t\t\t\t\tme._ht_video_file_customimage.ggVisible=false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._ht_video_file_customimage.style.visibility=(Number(me._ht_video_file_customimage.style.opacity)>0||!me._ht_video_file_customimage.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._ht_video_file_customimage.ggSubElement.src=me._ht_video_file_customimage.ggText;\n\t\t\t\t\tme._ht_video_file_customimage.ggVisible=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_video_file_customimage.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t\tvar parentWidth = me._ht_video_file_customimage.clientWidth;\n\t\t\tvar parentHeight = me._ht_video_file_customimage.clientHeight;\n\t\t\tvar img = me._ht_video_file_customimage__img;\n\t\t\tvar aspectRatioDiv = me._ht_video_file_customimage.clientWidth / me._ht_video_file_customimage.clientHeight;\n\t\t\tvar aspectRatioImg = img.naturalWidth / img.naturalHeight;\n\t\t\tif (img.naturalWidth < parentWidth) parentWidth = img.naturalWidth;\n\t\t\tif (img.naturalHeight < parentHeight) parentHeight = img.naturalHeight;\n\t\t\tvar currentWidth,currentHeight;\n\t\t\tif ((hotspot) && (hotspot.customimage)) {\n\t\t\t\tcurrentWidth = hotspot.customimagewidth;\n\t\t\t\tcurrentHeight = hotspot.customimageheight;\n\t\t\t}\n\t\t\timg.style.left='50%';\n\t\t\timg.style.marginLeft='-' + currentWidth/2 + 'px';\n\t\t\timg.style.top='50%';\n\t\t\timg.style.marginTop='-' + currentHeight/2 + 'px';\n\t\t}\n\t\tme._ht_video_file.appendChild(me._ht_video_file_customimage);\n\t\tif ((hotspot) && (hotspot.customimage)) {\n\t\t\tel.style.width=hotspot.customimagewidth + 'px';\n\t\t\tel.style.height=hotspot.customimageheight + 'px';\n\t\t}\n\t\tme.__div = me._ht_video_file;\n\t};\n\tfunction SkinHotspotClass_ht_info0(parentScope,hotspot) {\n\t\tvar me=this;\n\t\tvar flag=false;\n\t\tvar hs='';\n\t\tme.parentScope=parentScope;\n\t\tme.hotspot=hotspot;\n\t\tvar nodeId=String(hotspot.url);\n\t\tnodeId=(nodeId.charAt(0)=='{')?nodeId.substr(1, nodeId.length - 2):''; // }\n\t\tme.ggUserdata=skin.player.getNodeUserdata(nodeId);\n\t\tme.elementMouseDown=[];\n\t\tme.elementMouseOver=[];\n\t\tme.findElements=function(id,regex) {\n\t\t\treturn skin.findElements(id,regex);\n\t\t}\n\t\tel=me._ht_info0=document.createElement('div');\n\t\tel.ggId=\"ht_info\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_hotspot \";\n\t\tel.ggType='hotspot';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 0px;';\n\t\ths+='left : 52px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 37px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 0px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_info0.ggIsActive=function() {\n\t\t\treturn player.getCurrentNode()==this.ggElementNodeId();\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif (me.hotspot.url!='' && me.hotspot.url.charAt(0)=='{') { // }\n\t\t\t\treturn me.hotspot.url.substr(1, me.hotspot.url.length - 2);\n\t\t\t} else {\n\t\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t\t} else {\n\t\t\t\t\treturn player.getCurrentNode();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_info0.onclick=function (e) {\n\t\t\tskin._info_title.ggText=me.hotspot.title;\n\t\t\tskin._info_title.ggTextDiv.innerHTML=skin._info_title.ggText;\n\t\t\tif (skin._info_title.ggUpdateText) {\n\t\t\t\tskin._info_title.ggUpdateText=function() {\n\t\t\t\t\tvar hs=me.hotspot.title;\n\t\t\t\t\tif (hs!=this.ggText) {\n\t\t\t\t\t\tthis.ggText=hs;\n\t\t\t\t\t\tthis.ggTextDiv.innerHTML=hs;\n\t\t\t\t\t\tif (this.ggUpdatePosition) this.ggUpdatePosition();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (skin._info_title.ggUpdatePosition) {\n\t\t\t\tskin._info_title.ggUpdatePosition();\n\t\t\t}\n\t\t\tskin._info_title.ggTextDiv.scrollTop = 0;\n\t\t\tskin._info_text_body.ggText=me.hotspot.description;\n\t\t\tskin._info_text_body.ggTextDiv.innerHTML=skin._info_text_body.ggText;\n\t\t\tif (skin._info_text_body.ggUpdateText) {\n\t\t\t\tskin._info_text_body.ggUpdateText=function() {\n\t\t\t\t\tvar hs=me.hotspot.description;\n\t\t\t\t\tif (hs!=this.ggText) {\n\t\t\t\t\t\tthis.ggText=hs;\n\t\t\t\t\t\tthis.ggTextDiv.innerHTML=hs;\n\t\t\t\t\t\tif (this.ggUpdatePosition) this.ggUpdatePosition();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (skin._info_text_body.ggUpdatePosition) {\n\t\t\t\tskin._info_text_body.ggUpdatePosition();\n\t\t\t}\n\t\t\tskin._info_text_body.ggTextDiv.scrollTop = 0;\n\t\t\tplayer.setVariableValue('vis_info_popup', true);\n\t\t\tskin.hotspotProxyClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_info0.ondblclick=function (e) {\n\t\t\tskin.hotspotProxyDoubleClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_info0.onmouseover=function (e) {\n\t\t\tplayer.setActiveHotspot(me.hotspot);\n\t\t\tme.elementMouseOver['ht_info0']=true;\n\t\t\tme._tt_information0.logicBlock_visible();\n\t\t\tskin.hotspotProxyOver(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_info0.onmouseout=function (e) {\n\t\t\tplayer.setActiveHotspot(null);\n\t\t\tme.elementMouseOver['ht_info0']=false;\n\t\t\tme._tt_information0.logicBlock_visible();\n\t\t\tskin.hotspotProxyOut(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_info0.ontouchend=function (e) {\n\t\t\tme.elementMouseOver['ht_info0']=false;\n\t\t\tme._tt_information0.logicBlock_visible();\n\t\t}\n\t\tme._ht_info0.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._ht_info_image0=document.createElement('div');\n\t\tels=me._ht_info_image0__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yNDAgMzMyIDEzMCAxMzAiIGJhc2VQcm9maWxlPSJ0aW55IiB4PSIwcHgiIHk9IjBweCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiA8ZyBpZD0iTG'+\n\t\t\t'F5ZXJfMV8xXyI+CiAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xNzUsMzQwLjljLTMxLDAtNTYuMSwyNS4xLTU2LjEsNTYuMXMyNS4xLDU2LjEsNTYuMSw1Ni4xYzMxLDAsNTYuMS0yNS4xLDU2LjEtNTYuMVMtMTQ0LDM0MC45LTE3NSwzNDAuOSYjeGQ7JiN4YTsmI3g5OyYjeDk7eiBNLTE3OC4xLDM2MS4xbDYuMiwwYzMuNSwwLDYuNCwyLjksNi40LDYuNHYyLjljMCwzLjUtMi45LDYuNC02LjQsNi40aC02LjJjLTMuNSwwLTYuNC0yLjktNi40LTYuNGwwLTIuOSYjeGQ7JiN4YTsmI3g5OyYjeDk7Qy0xODQuNSwzNjQtMTgxLjYsMzYxLjEtMTc4LjEsMzYxLjF6IE0tMTY3LDQzMC40SC0xODNj'+\n\t\t\t'LTAuOCwwLTEuNS0wLjctMS41LTEuNWwwLTM3LjdjMC0wLjgsMC43LTEuNSwxLjUtMS41bDE1LjksMCYjeGQ7JiN4YTsmI3g5OyYjeDk7YzAuOCwwLDEuNSwwLjcsMS41LDEuNWwwLDM3LjdDLTE2NS41LDQyOS43LTE2Ni4yLDQzMC40LTE2Nyw0MzAuNHoiLz4KIDwvZz4KIDxnIGlkPSJMYXllcl8yIj4KICA8Zz4KICAgPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTS0xNjUuNSwzOTEuMmMwLTAuOC0wLjctMS41LTEuNS0xLjVsLTE1LjksMGMtMC44LDAtMS41LDAuNy0xLjUsMS41bDAsMzcuN2MwLDAuOCwwLjcsMS41LDEuNSwxLjVoMTUuOSYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTtjMC44LDAsMS'+\n\t\t\t'41LTAuNywxLjUtMS41TC0xNjUuNSwzOTEuMnoiLz4KICAgPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTS0xNzguMSwzNzYuOGg2LjJjMy41LDAsNi40LTIuOSw2LjQtNi40di0yLjljMC0zLjUtMi45LTYuNC02LjQtNi40bC02LjIsMGMtMy41LDAtNi40LDIuOS02LjQsNi40bDAsMi45JiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5O0MtMTg0LjUsMzc0LTE4MS42LDM3Ni44LTE3OC4xLDM3Ni44eiIvPgogIDwvZz4KIDwvZz4KPC9zdmc+Cg==';\n\t\tme._ht_info_image0__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\telo=me._ht_info_image0__imgo=document.createElement('img');\n\t\telo.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yNDAgMzMyIDEzMCAxMzAiIGJhc2VQcm9maWxlPSJ0aW55IiB4PSIwcHgiIHk9IjBweCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiA8ZyBpZD0iTG'+\n\t\t\t'F5ZXJfMV8xXyI+CiAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xNzUsMzM0LjZjLTM0LjQsMC02Mi40LDI3LjktNjIuNCw2Mi40czI3LjksNjIuNCw2Mi40LDYyLjRjMzQuNCwwLDYyLjQtMjcuOSw2Mi40LTYyLjQmI3hkOyYjeGE7JiN4OTsmI3g5O1MtMTQwLjYsMzM0LjYtMTc1LDMzNC42eiBNLTE3OC41LDM1Ny4xbDYuOSwwYzMuOSwwLDcuMSwzLjIsNy4xLDcuMXYzLjNjMCwzLjktMy4yLDcuMS03LjEsNy4xaC02LjljLTMuOSwwLTcuMS0zLjItNy4xLTcuMWwwLTMuMyYjeGQ7JiN4YTsmI3g5OyYjeDk7Qy0xODUuNiwzNjAuMy0xODIuNCwzNTcuMS0xNzguNSwzNTcuMXogTS0xNjYuMSw0'+\n\t\t\t'MzQuMWgtMTcuN2MtMC45LDAtMS43LTAuOC0xLjctMS43bDAtNDEuOWMwLTAuOSwwLjgtMS43LDEuNy0xLjdsMTcuNywwJiN4ZDsmI3hhOyYjeDk7JiN4OTtjMC45LDAsMS43LDAuOCwxLjcsMS43bDAsNDEuOUMtMTY0LjQsNDMzLjMtMTY1LjIsNDM0LjEtMTY2LjEsNDM0LjF6Ii8+CiA8L2c+CiA8ZyBpZD0iTGF5ZXJfMiI+CiAgPGc+CiAgIDxwYXRoIGZpbGw9IiNGRkZGRkYiIGQ9Ik0tMTY0LjQsMzkwLjVjMC0wLjktMC44LTEuNy0xLjctMS43bC0xNy43LDBjLTAuOSwwLTEuNywwLjgtMS43LDEuN2wwLDQxLjljMCwwLjksMC44LDEuNywxLjcsMS43aDE3LjcmI3hkOyYjeGE7JiN4OTsmI3g5Oy'+\n\t\t\t'YjeDk7YzAuOSwwLDEuNy0wLjgsMS43LTEuN0wtMTY0LjQsMzkwLjV6Ii8+CiAgIDxwYXRoIGZpbGw9IiNGRkZGRkYiIGQ9Ik0tMTc4LjUsMzc0LjZoNi45YzMuOSwwLDcuMS0zLjIsNy4xLTcuMXYtMy4zYzAtMy45LTMuMi03LjEtNy4xLTcuMWwtNi45LDBjLTMuOSwwLTcuMSwzLjItNy4xLDcuMWwwLDMuMyYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTtDLTE4NS41LDM3MS40LTE4Mi40LDM3NC42LTE3OC41LDM3NC42eiIvPgogIDwvZz4KIDwvZz4KPC9zdmc+Cg==';\n\t\tme._ht_info_image0__imgo.setAttribute('src',hs);\n\t\telo.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;visibility:hidden;pointer-events:none;;');\n\t\telo['ondragstart']=function() { return false; };\n\t\tel.appendChild(elo);\n\t\tel.ggId=\"ht_info_image\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='height : 32px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 32px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_info_image0.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_info_image0.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.hotspot.customimage != \"\"))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._ht_info_image0.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._ht_info_image0.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._ht_info_image0.style[domTransition]='';\n\t\t\t\tif (me._ht_info_image0.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._ht_info_image0.style.visibility=\"hidden\";\n\t\t\t\t\tme._ht_info_image0.ggVisible=false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._ht_info_image0.style.visibility=(Number(me._ht_info_image0.style.opacity)>0||!me._ht_info_image0.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._ht_info_image0.ggVisible=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_info_image0.onmouseover=function (e) {\n\t\t\tme._ht_info_image0__img.style.visibility='hidden';\n\t\t\tme._ht_info_image0__imgo.style.visibility='inherit';\n\t\t}\n\t\tme._ht_info_image0.onmouseout=function (e) {\n\t\t\tme._ht_info_image0__img.style.visibility='inherit';\n\t\t\tme._ht_info_image0__imgo.style.visibility='hidden';\n\t\t}\n\t\tme._ht_info_image0.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t}\n\t\tme._ht_info0.appendChild(me._ht_info_image0);\n\t\tel=me._tt_information0=document.createElement('div');\n\t\tels=me._tt_information0__text=document.createElement('div');\n\t\tel.className='ggskin ggskin_textdiv';\n\t\tel.ggTextDiv=els;\n\t\tel.ggId=\"tt_information\";\n\t\tel.ggDx=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_text \";\n\t\tel.ggType='text';\n\t\ths ='';\n\t\ths+='z-index: 100;';\n\t\ths+='height : 20px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 24px;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 100px;';\n\t\ths+='pointer-events:none;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\ths ='position:absolute;';\n\t\ths += 'box-sizing: border-box;';\n\t\ths+='cursor: default;';\n\t\ths+='left: 0px;';\n\t\ths+='top: 0px;';\n\t\ths+='width: auto;';\n\t\ths+='height: auto;';\n\t\ths+='pointer-events: none;';\n\t\ths+='background: #000000;';\n\t\ths+='background: rgba(0,0,0,0.666667);';\n\t\ths+='border: 0px solid #000000;';\n\t\ths+='color: rgba(255,255,255,1);';\n\t\ths+='text-align: center;';\n\t\ths+='white-space: nowrap;';\n\t\ths+='padding: 2px 5px 2px 5px;';\n\t\ths+='overflow: hidden;';\n\t\tels.setAttribute('style',hs);\n\t\tels.innerHTML=me.hotspot.title;\n\t\tel.appendChild(els);\n\t\tme._tt_information0.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._tt_information0.logicBlock_position = function() {\n\t\t\tvar newLogicStatePosition;\n\t\t\tif (\n\t\t\t\t((player.getHasTouch() == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStatePosition = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStatePosition = -1;\n\t\t\t}\n\t\t\tif (me._tt_information0.ggCurrentLogicStatePosition != newLogicStatePosition) {\n\t\t\t\tme._tt_information0.ggCurrentLogicStatePosition = newLogicStatePosition;\n\t\t\t\tme._tt_information0.style[domTransition]='left 0s, top 0s';\n\t\t\t\tif (me._tt_information0.ggCurrentLogicStatePosition == 0) {\n\t\t\t\t\tthis.ggDx = 0;\n\t\t\t\t\tme._tt_information0.style.top='-47px';\n\t\t\t\t\tme._tt_information0.ggUpdatePosition(true);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._tt_information0.ggDx=0;\n\t\t\t\t\tme._tt_information0.style.top='24px';\n\t\t\t\t\tme._tt_information0.ggUpdatePosition(true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._tt_information0.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.elementMouseOver['ht_info0'] == true)) && \n\t\t\t\t((me.hotspot.title != \"\"))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._tt_information0.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._tt_information0.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._tt_information0.style[domTransition]='left 0s, top 0s';\n\t\t\t\tif (me._tt_information0.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._tt_information0.style.visibility=(Number(me._tt_information0.style.opacity)>0||!me._tt_information0.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._tt_information0.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._tt_information0.style.visibility=\"hidden\";\n\t\t\t\t\tme._tt_information0.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._tt_information0.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth + 0;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t}\n\t\t\tthis.style[domTransition]='left 0';\n\t\t\tthis.ggTextDiv.style.left=((98-this.ggTextDiv.offsetWidth)/2) + 'px';\n\t\t}\n\t\tme._ht_info0.appendChild(me._tt_information0);\n\t\tel=me._ht_info_customimage0=document.createElement('div');\n\t\tels=me._ht_info_customimage0__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_external';\n\t\tels.setAttribute('style','position: absolute;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels.onload=function() {me._ht_info_customimage0.ggUpdatePosition();}\n\t\tif ((hotspot) && (hotspot.customimage)) {\n\t\t\tel.ggText=hotspot.customimage;\n\t\t\tels.setAttribute('src', hotspot.customimage);\n\t\t\tels.style.width=hotspot.customimagewidth + 'px';\n\t\t\tels.style.height=hotspot.customimageheight + 'px';\n\t\t\tme.ggUse3d = hotspot.use3D;\n\t\t\tme.gg3dDistance = hotspot.distance3D;\n\t\t}\n\t\tels['ondragstart']=function() { return false; };\n\t\tplayer.checkLoaded.push(els);\n\t\ths ='';\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\tel.ggId=\"ht_info_CustomImage\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_external \";\n\t\tel.ggType='external';\n\t\ths ='';\n\t\ths+='border : 0px solid #000000;';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 50px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 50px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_info_customimage0.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_info_customimage0.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.hotspot.customimage == \"\"))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._ht_info_customimage0.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._ht_info_customimage0.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._ht_info_customimage0.style[domTransition]='';\n\t\t\t\tif (me._ht_info_customimage0.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._ht_info_customimage0.style.visibility=\"hidden\";\n\t\t\t\t\tme._ht_info_customimage0__img.src = '';\n\t\t\t\t\tme._ht_info_customimage0.ggVisible=false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._ht_info_customimage0.style.visibility=(Number(me._ht_info_customimage0.style.opacity)>0||!me._ht_info_customimage0.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._ht_info_customimage0.ggSubElement.src=me._ht_info_customimage0.ggText;\n\t\t\t\t\tme._ht_info_customimage0.ggVisible=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_info_customimage0.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t\tvar parentWidth = me._ht_info_customimage0.clientWidth;\n\t\t\tvar parentHeight = me._ht_info_customimage0.clientHeight;\n\t\t\tvar img = me._ht_info_customimage0__img;\n\t\t\tvar aspectRatioDiv = me._ht_info_customimage0.clientWidth / me._ht_info_customimage0.clientHeight;\n\t\t\tvar aspectRatioImg = img.naturalWidth / img.naturalHeight;\n\t\t\tif (img.naturalWidth < parentWidth) parentWidth = img.naturalWidth;\n\t\t\tif (img.naturalHeight < parentHeight) parentHeight = img.naturalHeight;\n\t\t\tvar currentWidth,currentHeight;\n\t\t\tif ((hotspot) && (hotspot.customimage)) {\n\t\t\t\tcurrentWidth = hotspot.customimagewidth;\n\t\t\t\tcurrentHeight = hotspot.customimageheight;\n\t\t\t}\n\t\t\timg.style.left='50%';\n\t\t\timg.style.marginLeft='-' + currentWidth/2 + 'px';\n\t\t\timg.style.top='50%';\n\t\t\timg.style.marginTop='-' + currentHeight/2 + 'px';\n\t\t}\n\t\tme._ht_info0.appendChild(me._ht_info_customimage0);\n\t\tif ((hotspot) && (hotspot.customimage)) {\n\t\t\tel.style.width=hotspot.customimagewidth + 'px';\n\t\t\tel.style.height=hotspot.customimageheight + 'px';\n\t\t}\n\t\tme.__div = me._ht_info0;\n\t};\n\tfunction SkinHotspotClass_ht_info(parentScope,hotspot) {\n\t\tvar me=this;\n\t\tvar flag=false;\n\t\tvar hs='';\n\t\tme.parentScope=parentScope;\n\t\tme.hotspot=hotspot;\n\t\tvar nodeId=String(hotspot.url);\n\t\tnodeId=(nodeId.charAt(0)=='{')?nodeId.substr(1, nodeId.length - 2):''; // }\n\t\tme.ggUserdata=skin.player.getNodeUserdata(nodeId);\n\t\tme.elementMouseDown=[];\n\t\tme.elementMouseOver=[];\n\t\tme.findElements=function(id,regex) {\n\t\t\treturn skin.findElements(id,regex);\n\t\t}\n\t\tel=me._ht_info=document.createElement('div');\n\t\tel.ggId=\"ht_info\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_hotspot \";\n\t\tel.ggType='hotspot';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 0px;';\n\t\ths+='left : 94px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 211px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 0px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_info.ggIsActive=function() {\n\t\t\treturn player.getCurrentNode()==this.ggElementNodeId();\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif (me.hotspot.url!='' && me.hotspot.url.charAt(0)=='{') { // }\n\t\t\t\treturn me.hotspot.url.substr(1, me.hotspot.url.length - 2);\n\t\t\t} else {\n\t\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t\t} else {\n\t\t\t\t\treturn player.getCurrentNode();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_info.onclick=function (e) {\n\t\t\tskin._info_title.ggText=me.hotspot.title;\n\t\t\tskin._info_title.ggTextDiv.innerHTML=skin._info_title.ggText;\n\t\t\tif (skin._info_title.ggUpdateText) {\n\t\t\t\tskin._info_title.ggUpdateText=function() {\n\t\t\t\t\tvar hs=me.hotspot.title;\n\t\t\t\t\tif (hs!=this.ggText) {\n\t\t\t\t\t\tthis.ggText=hs;\n\t\t\t\t\t\tthis.ggTextDiv.innerHTML=hs;\n\t\t\t\t\t\tif (this.ggUpdatePosition) this.ggUpdatePosition();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (skin._info_title.ggUpdatePosition) {\n\t\t\t\tskin._info_title.ggUpdatePosition();\n\t\t\t}\n\t\t\tskin._info_title.ggTextDiv.scrollTop = 0;\n\t\t\tskin._info_text_body.ggText=me.hotspot.description;\n\t\t\tskin._info_text_body.ggTextDiv.innerHTML=skin._info_text_body.ggText;\n\t\t\tif (skin._info_text_body.ggUpdateText) {\n\t\t\t\tskin._info_text_body.ggUpdateText=function() {\n\t\t\t\t\tvar hs=me.hotspot.description;\n\t\t\t\t\tif (hs!=this.ggText) {\n\t\t\t\t\t\tthis.ggText=hs;\n\t\t\t\t\t\tthis.ggTextDiv.innerHTML=hs;\n\t\t\t\t\t\tif (this.ggUpdatePosition) this.ggUpdatePosition();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (skin._info_text_body.ggUpdatePosition) {\n\t\t\t\tskin._info_text_body.ggUpdatePosition();\n\t\t\t}\n\t\t\tskin._info_text_body.ggTextDiv.scrollTop = 0;\n\t\t\tplayer.setVariableValue('vis_info_popup', true);\n\t\t\tskin.hotspotProxyClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_info.ondblclick=function (e) {\n\t\t\tskin.hotspotProxyDoubleClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_info.onmouseover=function (e) {\n\t\t\tplayer.setActiveHotspot(me.hotspot);\n\t\t\tme.elementMouseOver['ht_info']=true;\n\t\t\tme._tt_information.logicBlock_visible();\n\t\t\tskin.hotspotProxyOver(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_info.onmouseout=function (e) {\n\t\t\tplayer.setActiveHotspot(null);\n\t\t\tme.elementMouseOver['ht_info']=false;\n\t\t\tme._tt_information.logicBlock_visible();\n\t\t\tskin.hotspotProxyOut(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_info.ontouchend=function (e) {\n\t\t\tme.elementMouseOver['ht_info']=false;\n\t\t\tme._tt_information.logicBlock_visible();\n\t\t}\n\t\tme._ht_info.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._ht_info_image=document.createElement('div');\n\t\tels=me._ht_info_image__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgJy0vL1czQy8vRFREIFNWRyAxLjEgQmFzaWMvL0VOJyAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEtYmFzaWMuZHRkJz4KPCEtLSBHYXJkZW4gR25vbWUgU29mdHdhcmUgLSBTa2luIEJ1dHRvbnMgLS0+CjxzdmcgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjAgMCAzMiAzMi'+\n\t\t\t'IgaGVpZ2h0PSIzMnB4IiBiYXNlUHJvZmlsZT0iYmFzaWMiIHg9IjBweCIgeT0iMHB4IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KIDxnIHN0cm9rZT0iIzNDM0MzQyIgc3Ryb2tlLXdpZHRoPSIxLjUiIG9wYWNpdHk9IjAuNCI+CiAgPGc+CiAgIDxwYXRoIGQ9Ik0zLjUsMTZDMy41LDkuMDk2LDkuMDk2LDMuNSwxNiwzLjVsMCwwYzYuOTAzLDAsMTIuNDk5LDUuNTk2LDEyLjUsMTIuNWwwLDAmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7JiN4OTtjLTAuMDAxLDYuOTAzLTUuNTk3LDEyLjQ5OS0xMi41LDEyLjVsMCwwQzkuMDk2LDI4LjQ5OSwzLjUsMjIuOTAzLDMuNSwxNkwzLjUsMTZ6IE04Ljg1NCw4'+\n\t\t\t'Ljg1MyYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTsmI3g5O0M3LjAyMiwxMC42ODYsNS44OTQsMTMuMjA1LDUuODkzLDE2bDAsMGMwLjAwMSwyLjc5NSwxLjEyOSw1LjMxNCwyLjk2MSw3LjE0NmwwLDBjMS44MzIsMS44MzEsNC4zNTIsMi45Niw3LjE0NiwyLjk2bDAsMCYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTsmI3g5O2MyLjc5NSwwLDUuMzE0LTEuMTI5LDcuMTQ3LTIuOTZsMCwwYzEuODMxLTEuODMyLDIuOTU5LTQuMzUyLDIuOTYtNy4xNDZsMCwwYy0wLjAwMS0yLjc5NS0xLjEyOS01LjMxNC0yLjk2LTcuMTQ3bDAsMCYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTsmI3g5O0MyMS4zMTMsNy4wMj'+\n\t\t\t'IsMTguNzk1LDUuODkzLDE2LDUuODkybDAsMEMxMy4yMDUsNS44OTMsMTAuNjg2LDcuMDIyLDguODU0LDguODUzTDguODU0LDguODUzeiIvPgogIDwvZz4KICA8Zz4KICAgPHBhdGggZD0iTTE0Ljk2MywxMC4wNVY5LjUyMWMwLTAuNjYxLDAuNTM2LTEuMTk2LDEuMTk3LTEuMTk2bDAsMGMwLjY2LDAsMS4xOTYsMC41MzYsMS4xOTYsMS4xOTZsMCwwdjAuNTI5JiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5OyYjeDk7YzAsMC42NjEtMC41MzYsMS4xOTYtMS4xOTYsMS4xOTZsMCwwQzE1LjUsMTEuMjQ3LDE0Ljk2MywxMC43MTEsMTQuOTYzLDEwLjA1TDE0Ljk2MywxMC4wNXoiLz4KICAgPGc+CiAgICA8'+\n\t\t\t'cGF0aCBkPSJNMTguNTMyLDIwLjM5MWgtMS4xNzZ2LTYuNDczYzAtMC4wMjEtMC4wMDUtMC4wNDItMC4wMDYtMC4wNjNjMC0wLjAxNCwwLjAwNC0wLjAyNiwwLjAwNC0wLjA0JiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5OyYjeDk7JiN4OTtjMC0wLjY2MS0wLjUzNi0xLjE5Ni0xLjE5Ni0xLjE5NmgtMi4yMjZjLTAuNjYxLDAtMS4xOTcsMC41MzYtMS4xOTcsMS4xOTZjMCwwLjY2LDAuNTM2LDEuMTk2LDEuMTk3LDEuMTk2aDEuMDMxdjUuMzc5aC0xLjIwNyYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTsmI3g5OyYjeDk7Yy0wLjY2MSwwLTEuMTk3LDAuNTM1LTEuMTk3LDEuMTk2YzAsMC42NiwwLjUzNi'+\n\t\t\t'wxLjE5NiwxLjE5NywxLjE5Nmg0Ljc3NWMwLjY2LDAsMS4xOTctMC41MzYsMS4xOTctMS4xOTYmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7JiN4OTsmI3g5O0MxOS43MjksMjAuOTI2LDE5LjE5MiwyMC4zOTEsMTguNTMyLDIwLjM5MXoiLz4KICAgPC9nPgogIDwvZz4KIDwvZz4KIDxnIGZpbGw9IiNGRkZGRkYiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLXdpZHRoPSIwLjIiPgogIDxnPgogICA8cGF0aCBkPSJNMy41LDE2QzMuNSw5LjA5Niw5LjA5NiwzLjUsMTYsMy41bDAsMGM2LjkwMywwLDEyLjQ5OSw1LjU5NiwxMi41LDEyLjVsMCwwJiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5OyYjeDk7Yy0w'+\n\t\t\t'LjAwMSw2LjkwMy01LjU5NywxMi40OTktMTIuNSwxMi41bDAsMEM5LjA5NiwyOC40OTksMy41LDIyLjkwMywzLjUsMTZMMy41LDE2eiBNOC44NTQsOC44NTMmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7JiN4OTtDNy4wMjIsMTAuNjg2LDUuODk0LDEzLjIwNSw1Ljg5MywxNmwwLDBjMC4wMDEsMi43OTUsMS4xMjksNS4zMTQsMi45NjEsNy4xNDZsMCwwYzEuODMyLDEuODMxLDQuMzUyLDIuOTYsNy4xNDYsMi45NmwwLDAmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7JiN4OTtjMi43OTUsMCw1LjMxNC0xLjEyOSw3LjE0Ny0yLjk2bDAsMGMxLjgzMS0xLjgzMiwyLjk1OS00LjM1MiwyLjk2LTcuMTQ2bD'+\n\t\t\t'AsMGMtMC4wMDEtMi43OTUtMS4xMjktNS4zMTQtMi45Ni03LjE0N2wwLDAmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7JiN4OTtDMjEuMzEzLDcuMDIyLDE4Ljc5NSw1Ljg5MywxNiw1Ljg5MmwwLDBDMTMuMjA1LDUuODkzLDEwLjY4Niw3LjAyMiw4Ljg1NCw4Ljg1M0w4Ljg1NCw4Ljg1M3oiLz4KICA8L2c+CiAgPGc+CiAgIDxwYXRoIGQ9Ik0xNC45NjMsMTAuMDVWOS41MjFjMC0wLjY2MSwwLjUzNi0xLjE5NiwxLjE5Ny0xLjE5NmwwLDBjMC42NiwwLDEuMTk2LDAuNTM2LDEuMTk2LDEuMTk2bDAsMHYwLjUyOSYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTsmI3g5O2MwLDAuNjYxLTAuNTM2LDEuMTk2'+\n\t\t\t'LTEuMTk2LDEuMTk2bDAsMEMxNS41LDExLjI0NywxNC45NjMsMTAuNzExLDE0Ljk2MywxMC4wNUwxNC45NjMsMTAuMDV6Ii8+CiAgIDxnPgogICAgPHBhdGggZD0iTTE4LjUzMiwyMC4zOTFoLTEuMTc2di02LjQ3M2MwLTAuMDIxLTAuMDA1LTAuMDQyLTAuMDA2LTAuMDYzYzAtMC4wMTQsMC4wMDQtMC4wMjYsMC4wMDQtMC4wNCYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTsmI3g5OyYjeDk7YzAtMC42NjEtMC41MzYtMS4xOTYtMS4xOTYtMS4xOTZoLTIuMjI2Yy0wLjY2MSwwLTEuMTk3LDAuNTM2LTEuMTk3LDEuMTk2YzAsMC42NiwwLjUzNiwxLjE5NiwxLjE5NywxLjE5NmgxLjAzMXY1LjM3OWgtMS'+\n\t\t\t'4yMDcmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7JiN4OTsmI3g5O2MtMC42NjEsMC0xLjE5NywwLjUzNS0xLjE5NywxLjE5NmMwLDAuNjYsMC41MzYsMS4xOTYsMS4xOTcsMS4xOTZoNC43NzVjMC42NiwwLDEuMTk3LTAuNTM2LDEuMTk3LTEuMTk2JiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5OyYjeDk7JiN4OTtDMTkuNzI5LDIwLjkyNiwxOS4xOTIsMjAuMzkxLDE4LjUzMiwyMC4zOTF6Ii8+CiAgIDwvZz4KICA8L2c+CiA8L2c+Cjwvc3ZnPgo=';\n\t\tme._ht_info_image__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\telo=me._ht_info_image__imgo=document.createElement('img');\n\t\telo.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgJy0vL1czQy8vRFREIFNWRyAxLjEgQmFzaWMvL0VOJyAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEtYmFzaWMuZHRkJz4KPCEtLSBHYXJkZW4gR25vbWUgU29mdHdhcmUgLSBTa2luIEJ1dHRvbnMgLS0+CjxzdmcgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjAgMCAzMiAzMi'+\n\t\t\t'IgaGVpZ2h0PSIzMnB4IiBiYXNlUHJvZmlsZT0iYmFzaWMiIHg9IjBweCIgeT0iMHB4IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KIDxnIHN0cm9rZT0iIzNDM0MzQyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTYsMTYpIHNjYWxlKDEuMSkgdHJhbnNsYXRlKC0xNiwtMTYpIiBzdHJva2Utd2lkdGg9IjEuNSIgb3BhY2l0eT0iMC40Ij4KICA8Zz4KICAgPHBhdGggZD0iTTMuNSwxNkMzLjUsOS4wOTYsOS4wOTYsMy41LDE2LDMuNWwwLDBjNi45MDMsMCwxMi40OTksNS41OTYsMTIuNSwxMi41bDAsMCYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTsmI3g5O2MtMC4wMDEsNi45MDMtNS41OTcsMTIuNDk5LTEy'+\n\t\t\t'LjUsMTIuNWwwLDBDOS4wOTYsMjguNDk5LDMuNSwyMi45MDMsMy41LDE2TDMuNSwxNnogTTguODU0LDguODUzJiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5OyYjeDk7QzcuMDIyLDEwLjY4Niw1Ljg5NCwxMy4yMDUsNS44OTMsMTZsMCwwYzAuMDAxLDIuNzk1LDEuMTI5LDUuMzE0LDIuOTYxLDcuMTQ2bDAsMGMxLjgzMiwxLjgzMSw0LjM1MiwyLjk2LDcuMTQ2LDIuOTZsMCwwJiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5OyYjeDk7YzIuNzk1LDAsNS4zMTQtMS4xMjksNy4xNDctMi45NmwwLDBjMS44MzEtMS44MzIsMi45NTktNC4zNTIsMi45Ni03LjE0NmwwLDBjLTAuMDAxLTIuNzk1LTEuMTI5LTUuMz'+\n\t\t\t'E0LTIuOTYtNy4xNDdsMCwwJiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5OyYjeDk7QzIxLjMxMyw3LjAyMiwxOC43OTUsNS44OTMsMTYsNS44OTJsMCwwQzEzLjIwNSw1Ljg5MywxMC42ODYsNy4wMjIsOC44NTQsOC44NTNMOC44NTQsOC44NTN6Ii8+CiAgPC9nPgogIDxnPgogICA8cGF0aCBkPSJNMTQuOTYzLDEwLjA1VjkuNTIxYzAtMC42NjEsMC41MzYtMS4xOTYsMS4xOTctMS4xOTZsMCwwYzAuNjYsMCwxLjE5NiwwLjUzNiwxLjE5NiwxLjE5NmwwLDB2MC41MjkmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7JiN4OTtjMCwwLjY2MS0wLjUzNiwxLjE5Ni0xLjE5NiwxLjE5NmwwLDBDMTUuNSwxMS4y'+\n\t\t\t'NDcsMTQuOTYzLDEwLjcxMSwxNC45NjMsMTAuMDVMMTQuOTYzLDEwLjA1eiIvPgogICA8Zz4KICAgIDxwYXRoIGQ9Ik0xOC41MzIsMjAuMzkxaC0xLjE3NnYtNi40NzNjMC0wLjAyMS0wLjAwNS0wLjA0Mi0wLjAwNi0wLjA2M2MwLTAuMDE0LDAuMDA0LTAuMDI2LDAuMDA0LTAuMDQmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7JiN4OTsmI3g5O2MwLTAuNjYxLTAuNTM2LTEuMTk2LTEuMTk2LTEuMTk2aC0yLjIyNmMtMC42NjEsMC0xLjE5NywwLjUzNi0xLjE5NywxLjE5NmMwLDAuNjYsMC41MzYsMS4xOTYsMS4xOTcsMS4xOTZoMS4wMzF2NS4zNzloLTEuMjA3JiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3'+\n\t\t\t'g5OyYjeDk7JiN4OTtjLTAuNjYxLDAtMS4xOTcsMC41MzUtMS4xOTcsMS4xOTZjMCwwLjY2LDAuNTM2LDEuMTk2LDEuMTk3LDEuMTk2aDQuNzc1YzAuNjYsMCwxLjE5Ny0wLjUzNiwxLjE5Ny0xLjE5NiYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTsmI3g5OyYjeDk7QzE5LjcyOSwyMC45MjYsMTkuMTkyLDIwLjM5MSwxOC41MzIsMjAuMzkxeiIvPgogICA8L2c+CiAgPC9nPgogPC9nPgogPGcgZmlsbD0iI0ZGRkZGRiIgc3Ryb2tlPSIjMDAwMDAwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxNiwxNikgc2NhbGUoMS4xKSB0cmFuc2xhdGUoLTE2LC0xNikiIHN0cm9rZS13aWR0aD0iMC4yIj4KICA8Zz4K'+\n\t\t\t'ICAgPHBhdGggZD0iTTMuNSwxNkMzLjUsOS4wOTYsOS4wOTYsMy41LDE2LDMuNWwwLDBjNi45MDMsMCwxMi40OTksNS41OTYsMTIuNSwxMi41bDAsMCYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTsmI3g5O2MtMC4wMDEsNi45MDMtNS41OTcsMTIuNDk5LTEyLjUsMTIuNWwwLDBDOS4wOTYsMjguNDk5LDMuNSwyMi45MDMsMy41LDE2TDMuNSwxNnogTTguODU0LDguODUzJiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5OyYjeDk7QzcuMDIyLDEwLjY4Niw1Ljg5NCwxMy4yMDUsNS44OTMsMTZsMCwwYzAuMDAxLDIuNzk1LDEuMTI5LDUuMzE0LDIuOTYxLDcuMTQ2bDAsMGMxLjgzMiwxLjgzMSw0LjM1MiwyLj'+\n\t\t\t'k2LDcuMTQ2LDIuOTZsMCwwJiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5OyYjeDk7YzIuNzk1LDAsNS4zMTQtMS4xMjksNy4xNDctMi45NmwwLDBjMS44MzEtMS44MzIsMi45NTktNC4zNTIsMi45Ni03LjE0NmwwLDBjLTAuMDAxLTIuNzk1LTEuMTI5LTUuMzE0LTIuOTYtNy4xNDdsMCwwJiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5OyYjeDk7QzIxLjMxMyw3LjAyMiwxOC43OTUsNS44OTMsMTYsNS44OTJsMCwwQzEzLjIwNSw1Ljg5MywxMC42ODYsNy4wMjIsOC44NTQsOC44NTNMOC44NTQsOC44NTN6Ii8+CiAgPC9nPgogIDxnPgogICA8cGF0aCBkPSJNMTQuOTYzLDEwLjA1VjkuNTIxYzAtMC42NjEs'+\n\t\t\t'MC41MzYtMS4xOTYsMS4xOTctMS4xOTZsMCwwYzAuNjYsMCwxLjE5NiwwLjUzNiwxLjE5NiwxLjE5NmwwLDB2MC41MjkmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7JiN4OTtjMCwwLjY2MS0wLjUzNiwxLjE5Ni0xLjE5NiwxLjE5NmwwLDBDMTUuNSwxMS4yNDcsMTQuOTYzLDEwLjcxMSwxNC45NjMsMTAuMDVMMTQuOTYzLDEwLjA1eiIvPgogICA8Zz4KICAgIDxwYXRoIGQ9Ik0xOC41MzIsMjAuMzkxaC0xLjE3NnYtNi40NzNjMC0wLjAyMS0wLjAwNS0wLjA0Mi0wLjAwNi0wLjA2M2MwLTAuMDE0LDAuMDA0LTAuMDI2LDAuMDA0LTAuMDQmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7JiN4OTsmI3g5O2'+\n\t\t\t'MwLTAuNjYxLTAuNTM2LTEuMTk2LTEuMTk2LTEuMTk2aC0yLjIyNmMtMC42NjEsMC0xLjE5NywwLjUzNi0xLjE5NywxLjE5NmMwLDAuNjYsMC41MzYsMS4xOTYsMS4xOTcsMS4xOTZoMS4wMzF2NS4zNzloLTEuMjA3JiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5OyYjeDk7JiN4OTtjLTAuNjYxLDAtMS4xOTcsMC41MzUtMS4xOTcsMS4xOTZjMCwwLjY2LDAuNTM2LDEuMTk2LDEuMTk3LDEuMTk2aDQuNzc1YzAuNjYsMCwxLjE5Ny0wLjUzNiwxLjE5Ny0xLjE5NiYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTsmI3g5OyYjeDk7QzE5LjcyOSwyMC45MjYsMTkuMTkyLDIwLjM5MSwxOC41MzIsMjAuMzkxeiIv'+\n\t\t\t'PgogICA8L2c+CiAgPC9nPgogPC9nPgo8L3N2Zz4K';\n\t\tme._ht_info_image__imgo.setAttribute('src',hs);\n\t\telo.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;visibility:hidden;pointer-events:none;;');\n\t\telo['ondragstart']=function() { return false; };\n\t\tel.appendChild(elo);\n\t\tel.ggId=\"ht_info_image\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 32px;';\n\t\ths+='left : -15px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -15px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 32px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_info_image.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_info_image.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.hotspot.customimage != \"\"))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._ht_info_image.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._ht_info_image.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._ht_info_image.style[domTransition]='';\n\t\t\t\tif (me._ht_info_image.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._ht_info_image.style.visibility=\"hidden\";\n\t\t\t\t\tme._ht_info_image.ggVisible=false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._ht_info_image.style.visibility=(Number(me._ht_info_image.style.opacity)>0||!me._ht_info_image.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._ht_info_image.ggVisible=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_info_image.onmouseover=function (e) {\n\t\t\tme._ht_info_image__img.style.visibility='hidden';\n\t\t\tme._ht_info_image__imgo.style.visibility='inherit';\n\t\t}\n\t\tme._ht_info_image.onmouseout=function (e) {\n\t\t\tme._ht_info_image__img.style.visibility='inherit';\n\t\t\tme._ht_info_image__imgo.style.visibility='hidden';\n\t\t}\n\t\tme._ht_info_image.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme._ht_info.appendChild(me._ht_info_image);\n\t\tel=me._tt_information=document.createElement('div');\n\t\tels=me._tt_information__text=document.createElement('div');\n\t\tel.className='ggskin ggskin_textdiv';\n\t\tel.ggTextDiv=els;\n\t\tel.ggId=\"tt_information\";\n\t\tel.ggDx=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_text \";\n\t\tel.ggType='text';\n\t\ths ='';\n\t\ths+='z-index: 100;';\n\t\ths+='height : 20px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 24px;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 100px;';\n\t\ths+='pointer-events:none;';\n\t\ths+='text-shadow: 1px 1px 4px #000000;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\ths ='position:absolute;';\n\t\ths += 'box-sizing: border-box;';\n\t\ths+='cursor: default;';\n\t\ths+='left: 0px;';\n\t\ths+='top: 0px;';\n\t\ths+='width: auto;';\n\t\ths+='height: auto;';\n\t\ths+='pointer-events: none;';\n\t\ths+='border: 0px solid #000000;';\n\t\ths+='color: rgba(255,255,255,1);';\n\t\ths+='text-align: center;';\n\t\ths+='white-space: nowrap;';\n\t\ths+='padding: 0px 1px 0px 1px;';\n\t\ths+='overflow: hidden;';\n\t\tels.setAttribute('style',hs);\n\t\tels.innerHTML=me.hotspot.title;\n\t\tel.appendChild(els);\n\t\tme._tt_information.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._tt_information.logicBlock_position = function() {\n\t\t\tvar newLogicStatePosition;\n\t\t\tif (\n\t\t\t\t((player.getHasTouch() == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStatePosition = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStatePosition = -1;\n\t\t\t}\n\t\t\tif (me._tt_information.ggCurrentLogicStatePosition != newLogicStatePosition) {\n\t\t\t\tme._tt_information.ggCurrentLogicStatePosition = newLogicStatePosition;\n\t\t\t\tme._tt_information.style[domTransition]='left 0s, top 0s';\n\t\t\t\tif (me._tt_information.ggCurrentLogicStatePosition == 0) {\n\t\t\t\t\tthis.ggDx = 0;\n\t\t\t\t\tme._tt_information.style.top='-47px';\n\t\t\t\t\tme._tt_information.ggUpdatePosition(true);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._tt_information.ggDx=0;\n\t\t\t\t\tme._tt_information.style.top='24px';\n\t\t\t\t\tme._tt_information.ggUpdatePosition(true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._tt_information.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.elementMouseOver['ht_info'] == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._tt_information.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._tt_information.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._tt_information.style[domTransition]='left 0s, top 0s';\n\t\t\t\tif (me._tt_information.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._tt_information.style.visibility=(Number(me._tt_information.style.opacity)>0||!me._tt_information.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._tt_information.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._tt_information.style.visibility=\"hidden\";\n\t\t\t\t\tme._tt_information.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._tt_information.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth + 0;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t}\n\t\t\tthis.style[domTransition]='left 0';\n\t\t\tthis.ggTextDiv.style.left=((98-this.ggTextDiv.offsetWidth)/2) + 'px';\n\t\t}\n\t\tme._ht_info.appendChild(me._tt_information);\n\t\tel=me._ht_info_customimage=document.createElement('div');\n\t\tels=me._ht_info_customimage__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_external';\n\t\tels.setAttribute('style','position: absolute;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels.onload=function() {me._ht_info_customimage.ggUpdatePosition();}\n\t\tif ((hotspot) && (hotspot.customimage)) {\n\t\t\tel.ggText=hotspot.customimage;\n\t\t\tels.setAttribute('src', hotspot.customimage);\n\t\t\tels.style.width=hotspot.customimagewidth + 'px';\n\t\t\tels.style.height=hotspot.customimageheight + 'px';\n\t\t\tme.ggUse3d = hotspot.use3D;\n\t\t\tme.gg3dDistance = hotspot.distance3D;\n\t\t}\n\t\tels['ondragstart']=function() { return false; };\n\t\tplayer.checkLoaded.push(els);\n\t\ths ='';\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\tel.ggId=\"ht_info_CustomImage\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_external \";\n\t\tel.ggType='external';\n\t\ths ='';\n\t\ths+='border : 0px solid #000000;';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 50px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 50px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_info_customimage.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_info_customimage.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.hotspot.customimage == \"\"))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._ht_info_customimage.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._ht_info_customimage.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._ht_info_customimage.style[domTransition]='';\n\t\t\t\tif (me._ht_info_customimage.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._ht_info_customimage.style.visibility=\"hidden\";\n\t\t\t\t\tme._ht_info_customimage__img.src = '';\n\t\t\t\t\tme._ht_info_customimage.ggVisible=false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._ht_info_customimage.style.visibility=(Number(me._ht_info_customimage.style.opacity)>0||!me._ht_info_customimage.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._ht_info_customimage.ggSubElement.src=me._ht_info_customimage.ggText;\n\t\t\t\t\tme._ht_info_customimage.ggVisible=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_info_customimage.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t\tvar parentWidth = me._ht_info_customimage.clientWidth;\n\t\t\tvar parentHeight = me._ht_info_customimage.clientHeight;\n\t\t\tvar img = me._ht_info_customimage__img;\n\t\t\tvar aspectRatioDiv = me._ht_info_customimage.clientWidth / me._ht_info_customimage.clientHeight;\n\t\t\tvar aspectRatioImg = img.naturalWidth / img.naturalHeight;\n\t\t\tif (img.naturalWidth < parentWidth) parentWidth = img.naturalWidth;\n\t\t\tif (img.naturalHeight < parentHeight) parentHeight = img.naturalHeight;\n\t\t\tvar currentWidth,currentHeight;\n\t\t\tif ((hotspot) && (hotspot.customimage)) {\n\t\t\t\tcurrentWidth = hotspot.customimagewidth;\n\t\t\t\tcurrentHeight = hotspot.customimageheight;\n\t\t\t}\n\t\t\timg.style.left='50%';\n\t\t\timg.style.marginLeft='-' + currentWidth/2 + 'px';\n\t\t\timg.style.top='50%';\n\t\t\timg.style.marginTop='-' + currentHeight/2 + 'px';\n\t\t}\n\t\tme._ht_info.appendChild(me._ht_info_customimage);\n\t\tif ((hotspot) && (hotspot.customimage)) {\n\t\t\tel.style.width=hotspot.customimagewidth + 'px';\n\t\t\tel.style.height=hotspot.customimageheight + 'px';\n\t\t}\n\t\tme.__div = me._ht_info;\n\t};\n\tfunction SkinHotspotClass_ht_video_youtube(parentScope,hotspot) {\n\t\tvar me=this;\n\t\tvar flag=false;\n\t\tvar hs='';\n\t\tme.parentScope=parentScope;\n\t\tme.hotspot=hotspot;\n\t\tvar nodeId=String(hotspot.url);\n\t\tnodeId=(nodeId.charAt(0)=='{')?nodeId.substr(1, nodeId.length - 2):''; // }\n\t\tme.ggUserdata=skin.player.getNodeUserdata(nodeId);\n\t\tme.elementMouseDown=[];\n\t\tme.elementMouseOver=[];\n\t\tme.findElements=function(id,regex) {\n\t\t\treturn skin.findElements(id,regex);\n\t\t}\n\t\tel=me._ht_video_youtube=document.createElement('div');\n\t\tel.ggId=\"ht_video_youtube\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_hotspot \";\n\t\tel.ggType='hotspot';\n\t\ths ='';\n\t\ths+='height : 0px;';\n\t\ths+='left : 200px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 200px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 0px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_video_youtube.ggIsActive=function() {\n\t\t\treturn player.getCurrentNode()==this.ggElementNodeId();\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif (me.hotspot.url!='' && me.hotspot.url.charAt(0)=='{') { // }\n\t\t\t\treturn me.hotspot.url.substr(1, me.hotspot.url.length - 2);\n\t\t\t} else {\n\t\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t\t} else {\n\t\t\t\t\treturn player.getCurrentNode();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_video_youtube.onclick=function (e) {\n\t\t\tskin._popup_video_youtube.ggInitMedia(me.hotspot.url);\n\t\t\tplayer.setVariableValue('vis_video_youtube', true);\n\t\t\tskin.hotspotProxyClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_video_youtube.ondblclick=function (e) {\n\t\t\tskin.hotspotProxyDoubleClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_video_youtube.onmouseover=function (e) {\n\t\t\tplayer.setActiveHotspot(me.hotspot);\n\t\t\tme.elementMouseOver['ht_video_youtube']=true;\n\t\t\tme._tt_ht_video_youtube.logicBlock_visible();\n\t\t\tskin.hotspotProxyOver(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_video_youtube.onmouseout=function (e) {\n\t\t\tplayer.setActiveHotspot(null);\n\t\t\tme.elementMouseOver['ht_video_youtube']=false;\n\t\t\tme._tt_ht_video_youtube.logicBlock_visible();\n\t\t\tskin.hotspotProxyOut(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_video_youtube.ontouchend=function (e) {\n\t\t\tme.elementMouseOver['ht_video_youtube']=false;\n\t\t\tme._tt_ht_video_youtube.logicBlock_visible();\n\t\t}\n\t\tme._ht_video_youtube.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._ht_video_video_youtube=document.createElement('div');\n\t\tels=me._ht_video_video_youtube__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yNDAgMzMyIDEzMCAxMzAiIGJhc2VQcm9maWxlPSJ0aW55IiB4PSIwcHgiIHk9IjBweCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiA8ZyBpZD0iTG'+\n\t\t\t'F5ZXJfMV8xXyI+CiAgPGc+CiAgIDxwYXRoIGZpbGw9IiMwMDAwMDAiIGQ9Ik0tMTc1LDM0MC45Yy0zMSwwLTU2LjEsMjUuMS01Ni4xLDU2LjFjMCwzMSwyNS4xLDU2LjEsNTYuMSw1Ni4xczU2LjEtMjUuMSw1Ni4xLTU2LjEmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7Qy0xMTguOSwzNjYtMTQ0LDM0MC45LTE3NSwzNDAuOXogTS0xMzkuNCw0MjEuN2MwLDEuMy0xLDIuMy0yLjMsMi4zaC02Ni43Yy0xLjMsMC0yLjMtMS0yLjMtMi4zdi00OS40YzAtMS4zLDEtMi4zLDIuMy0yLjNoNjYuNyYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTtjMS4zLDAsMi4zLDEsMi4zLDIuM1Y0MjEuN3oiLz4KICAgPHBh'+\n\t\t\t'dGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xNzguNCw0MDVsMTAuOC03LjVjMC43LTAuNSwwLjctMS4zLDAtMS44bC0xMC44LTcuNWMtMC43LTAuNS0xLjMtMC4yLTEuMywwLjd2MTUuNSYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTtDLTE3OS43LDQwNS4yLTE3OS4xLDQwNS41LTE3OC40LDQwNXoiLz4KICAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0yMDYuNSw0MTUuMWg2Mi40di0zNi4xaC02Mi40VjQxNS4xeiBNLTE3NSwzODIuMWM4LDAsMTQuNCw2LjUsMTQuNCwxNC40YzAsOC02LjUsMTQuNC0xNC40LDE0LjQmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7Yy04LDAtMTQuNC02LjUtMTQuNC0xNC'+\n\t\t\t'40Qy0xODkuNCwzODguNi0xODMsMzgyLjEtMTc1LDM4Mi4xeiIvPgogIDwvZz4KIDwvZz4KIDxnIGlkPSJMYXllcl8yIj4KICA8Zz4KICAgPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTS0xNDEuNywzNzBoLTY2LjdjLTEuMywwLTIuMywxLTIuMywyLjN2NDkuNGMwLDEuMywxLDIuMywyLjMsMi4zaDY2LjdjMS4zLDAsMi4zLTEsMi4zLTIuM3YtNDkuNCYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTtDLTEzOS40LDM3MS0xNDAuNCwzNzAtMTQxLjcsMzcweiBNLTE0NC4yLDQxNS4xaC02Mi40di0zNi4xaDYyLjRDLTE0NC4yLDM3OC45LTE0NC4yLDQxNS4xLTE0NC4yLDQxNS4xeiIvPgogICA8cGF0aCBm'+\n\t\t\t'aWxsPSIjRkZGRkZGIiBkPSJNLTE3NSw0MTFjOCwwLDE0LjQtNi41LDE0LjQtMTQuNGMwLTgtNi41LTE0LjQtMTQuNC0xNC40Yy04LDAtMTQuNCw2LjUtMTQuNCwxNC40JiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5O0MtMTg5LjQsNDA0LjUtMTgzLDQxMS0xNzUsNDExeiBNLTE3OS43LDM4OC44YzAtMC44LDAuNi0xLjEsMS4zLTAuN2wxMC44LDcuNWMwLjcsMC41LDAuNywxLjMsMCwxLjhsLTEwLjgsNy41JiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5O2MtMC43LDAuNS0xLjMsMC4yLTEuMy0wLjdWMzg4Ljh6Ii8+CiAgPC9nPgogPC9nPgo8L3N2Zz4K';\n\t\tme._ht_video_video_youtube__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\telo=me._ht_video_video_youtube__imgo=document.createElement('img');\n\t\telo.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yNDAgMzMyIDEzMCAxMzAiIGJhc2VQcm9maWxlPSJ0aW55IiB4PSIwcHgiIHk9IjBweCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiA8ZyBpZD0iTG'+\n\t\t\t'F5ZXJfMV8xXyI+CiAgPGc+CiAgIDxwYXRoIGZpbGw9IiMwMDAwMDAiIGQ9Ik0tMTc1LDMzNC42Yy0zNC40LDAtNjIuNCwyNy45LTYyLjQsNjIuNGMwLDM0LjQsMjcuOSw2Mi40LDYyLjQsNjIuNHM2Mi40LTI3LjksNjIuNC02Mi40JiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5O0MtMTEyLjYsMzYyLjYtMTQwLjYsMzM0LjYtMTc1LDMzNC42eiBNLTEzNS40LDQyNC40YzAsMS40LTEuMSwyLjYtMi42LDIuNkgtMjEyYy0xLjQsMC0yLjYtMS4xLTIuNi0yLjZ2LTU0LjkmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7YzAtMS40LDEuMS0yLjYsMi42LTIuNmg3NC4xYzEuNCwwLDIuNiwxLjEsMi42LDIuNlY0'+\n\t\t\t'MjQuNHoiLz4KICAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xNzguOCw0MDUuOWwxMi04LjRjMC44LTAuNSwwLjgtMS40LDAtMS45bC0xMi04LjRjLTAuOC0wLjUtMS40LTAuMi0xLjQsMC43djE3LjMmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7Qy0xODAuMiw0MDYuMS0xNzkuNiw0MDYuNC0xNzguOCw0MDUuOXoiLz4KICAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0yMTAsNDE3LjFoNjkuM3YtNDAuMkgtMjEwVjQxNy4xeiBNLTE3NSwzODAuNWM4LjksMCwxNiw3LjIsMTYsMTZjMCw4LjktNy4yLDE2LTE2LDE2JiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5O2MtOC45LDAtMTYtNy4yLTE2LT'+\n\t\t\t'E2Qy0xOTEsMzg3LjctMTgzLjksMzgwLjUtMTc1LDM4MC41eiIvPgogIDwvZz4KIDwvZz4KIDxnIGlkPSJMYXllcl8yIj4KICA8Zz4KICAgPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTS0xMzgsMzY3SC0yMTJjLTEuNCwwLTIuNiwxLjEtMi42LDIuNnY1NC45YzAsMS40LDEuMSwyLjYsMi42LDIuNmg3NC4xYzEuNCwwLDIuNi0xLjEsMi42LTIuNnYtNTQuOSYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTtDLTEzNS40LDM2OC4xLTEzNi42LDM2Ny0xMzgsMzY3eiBNLTE0MC43LDQxNy4xSC0yMTB2LTQwLjJoNjkuM0MtMTQwLjcsMzc2LjktMTQwLjcsNDE3LjEtMTQwLjcsNDE3LjF6Ii8+CiAgIDxwYXRo'+\n\t\t\t'IGZpbGw9IiNGRkZGRkYiIGQ9Ik0tMTc1LDQxMi42YzguOSwwLDE2LTcuMiwxNi0xNmMwLTguOS03LjItMTYtMTYtMTZjLTguOSwwLTE2LDcuMi0xNiwxNkMtMTkxLDQwNS40LTE4My45LDQxMi42LTE3NSw0MTIuNiYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTt6IE0tMTgwLjIsMzg3LjljMC0wLjksMC42LTEuMywxLjQtMC43bDEyLDguNGMwLjgsMC41LDAuOCwxLjQsMCwxLjlsLTEyLDguNGMtMC44LDAuNS0xLjQsMC4yLTEuNC0wLjdWMzg3Ljl6Ii8+CiAgPC9nPgogPC9nPgo8L3N2Zz4K';\n\t\tme._ht_video_video_youtube__imgo.setAttribute('src',hs);\n\t\telo.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;visibility:hidden;pointer-events:none;;');\n\t\telo['ondragstart']=function() { return false; };\n\t\tel.appendChild(elo);\n\t\tel.ggId=\"ht_video_video_youtube\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 32px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 32px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_video_video_youtube.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_video_video_youtube.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.hotspot.customimage != \"\"))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._ht_video_video_youtube.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._ht_video_video_youtube.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._ht_video_video_youtube.style[domTransition]='';\n\t\t\t\tif (me._ht_video_video_youtube.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._ht_video_video_youtube.style.visibility=\"hidden\";\n\t\t\t\t\tme._ht_video_video_youtube.ggVisible=false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._ht_video_video_youtube.style.visibility=(Number(me._ht_video_video_youtube.style.opacity)>0||!me._ht_video_video_youtube.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._ht_video_video_youtube.ggVisible=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_video_video_youtube.onmouseover=function (e) {\n\t\t\tme._ht_video_video_youtube__img.style.visibility='hidden';\n\t\t\tme._ht_video_video_youtube__imgo.style.visibility='inherit';\n\t\t}\n\t\tme._ht_video_video_youtube.onmouseout=function (e) {\n\t\t\tme._ht_video_video_youtube__img.style.visibility='inherit';\n\t\t\tme._ht_video_video_youtube__imgo.style.visibility='hidden';\n\t\t}\n\t\tme._ht_video_video_youtube.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t}\n\t\tme._ht_video_youtube.appendChild(me._ht_video_video_youtube);\n\t\tel=me._tt_ht_video_youtube=document.createElement('div');\n\t\tels=me._tt_ht_video_youtube__text=document.createElement('div');\n\t\tel.className='ggskin ggskin_textdiv';\n\t\tel.ggTextDiv=els;\n\t\tel.ggId=\"tt_ht_video_youtube\";\n\t\tel.ggDx=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_text \";\n\t\tel.ggType='text';\n\t\ths ='';\n\t\ths+='z-index: 100;';\n\t\ths+='height : 20px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 24px;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 100px;';\n\t\ths+='pointer-events:none;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\ths ='position:absolute;';\n\t\ths += 'box-sizing: border-box;';\n\t\ths+='cursor: default;';\n\t\ths+='left: 0px;';\n\t\ths+='top: 0px;';\n\t\ths+='width: auto;';\n\t\ths+='height: auto;';\n\t\ths+='pointer-events: none;';\n\t\ths+='background: #000000;';\n\t\ths+='background: rgba(0,0,0,0.666667);';\n\t\ths+='border: 0px solid #000000;';\n\t\ths+='color: rgba(255,255,255,1);';\n\t\ths+='text-align: center;';\n\t\ths+='white-space: nowrap;';\n\t\ths+='padding: 2px 3px 2px 3px;';\n\t\ths+='overflow: hidden;';\n\t\tels.setAttribute('style',hs);\n\t\tels.innerHTML=me.hotspot.title;\n\t\tel.appendChild(els);\n\t\tme._tt_ht_video_youtube.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._tt_ht_video_youtube.logicBlock_position = function() {\n\t\t\tvar newLogicStatePosition;\n\t\t\tif (\n\t\t\t\t((player.getHasTouch() == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStatePosition = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStatePosition = -1;\n\t\t\t}\n\t\t\tif (me._tt_ht_video_youtube.ggCurrentLogicStatePosition != newLogicStatePosition) {\n\t\t\t\tme._tt_ht_video_youtube.ggCurrentLogicStatePosition = newLogicStatePosition;\n\t\t\t\tme._tt_ht_video_youtube.style[domTransition]='left 0s, top 0s';\n\t\t\t\tif (me._tt_ht_video_youtube.ggCurrentLogicStatePosition == 0) {\n\t\t\t\t\tthis.ggDx = 0;\n\t\t\t\t\tme._tt_ht_video_youtube.style.top='-47px';\n\t\t\t\t\tme._tt_ht_video_youtube.ggUpdatePosition(true);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._tt_ht_video_youtube.ggDx=0;\n\t\t\t\t\tme._tt_ht_video_youtube.style.top='24px';\n\t\t\t\t\tme._tt_ht_video_youtube.ggUpdatePosition(true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._tt_ht_video_youtube.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.elementMouseOver['ht_video_youtube'] == true)) && \n\t\t\t\t((me.hotspot.title != \"\"))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._tt_ht_video_youtube.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._tt_ht_video_youtube.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._tt_ht_video_youtube.style[domTransition]='left 0s, top 0s';\n\t\t\t\tif (me._tt_ht_video_youtube.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._tt_ht_video_youtube.style.visibility=(Number(me._tt_ht_video_youtube.style.opacity)>0||!me._tt_ht_video_youtube.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._tt_ht_video_youtube.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._tt_ht_video_youtube.style.visibility=\"hidden\";\n\t\t\t\t\tme._tt_ht_video_youtube.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._tt_ht_video_youtube.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth + 0;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t}\n\t\t\tthis.style[domTransition]='left 0';\n\t\t\tthis.ggTextDiv.style.left=((98-this.ggTextDiv.offsetWidth)/2) + 'px';\n\t\t}\n\t\tme._ht_video_youtube.appendChild(me._tt_ht_video_youtube);\n\t\tel=me._ht_video_youtube_customimage=document.createElement('div');\n\t\tels=me._ht_video_youtube_customimage__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_external';\n\t\tels.setAttribute('style','position: absolute;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels.onload=function() {me._ht_video_youtube_customimage.ggUpdatePosition();}\n\t\tif ((hotspot) && (hotspot.customimage)) {\n\t\t\tel.ggText=hotspot.customimage;\n\t\t\tels.setAttribute('src', hotspot.customimage);\n\t\t\tels.style.width=hotspot.customimagewidth + 'px';\n\t\t\tels.style.height=hotspot.customimageheight + 'px';\n\t\t\tme.ggUse3d = hotspot.use3D;\n\t\t\tme.gg3dDistance = hotspot.distance3D;\n\t\t}\n\t\tels['ondragstart']=function() { return false; };\n\t\tplayer.checkLoaded.push(els);\n\t\ths ='';\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\tel.ggId=\"ht_video_youtube_CustomImage\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_external \";\n\t\tel.ggType='external';\n\t\ths ='';\n\t\ths+='border : 0px solid #000000;';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 50px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 50px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_video_youtube_customimage.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_video_youtube_customimage.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.hotspot.customimage == \"\"))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._ht_video_youtube_customimage.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._ht_video_youtube_customimage.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._ht_video_youtube_customimage.style[domTransition]='';\n\t\t\t\tif (me._ht_video_youtube_customimage.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._ht_video_youtube_customimage.style.visibility=\"hidden\";\n\t\t\t\t\tme._ht_video_youtube_customimage__img.src = '';\n\t\t\t\t\tme._ht_video_youtube_customimage.ggVisible=false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._ht_video_youtube_customimage.style.visibility=(Number(me._ht_video_youtube_customimage.style.opacity)>0||!me._ht_video_youtube_customimage.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._ht_video_youtube_customimage.ggSubElement.src=me._ht_video_youtube_customimage.ggText;\n\t\t\t\t\tme._ht_video_youtube_customimage.ggVisible=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_video_youtube_customimage.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t\tvar parentWidth = me._ht_video_youtube_customimage.clientWidth;\n\t\t\tvar parentHeight = me._ht_video_youtube_customimage.clientHeight;\n\t\t\tvar img = me._ht_video_youtube_customimage__img;\n\t\t\tvar aspectRatioDiv = me._ht_video_youtube_customimage.clientWidth / me._ht_video_youtube_customimage.clientHeight;\n\t\t\tvar aspectRatioImg = img.naturalWidth / img.naturalHeight;\n\t\t\tif (img.naturalWidth < parentWidth) parentWidth = img.naturalWidth;\n\t\t\tif (img.naturalHeight < parentHeight) parentHeight = img.naturalHeight;\n\t\t\tvar currentWidth,currentHeight;\n\t\t\tif ((hotspot) && (hotspot.customimage)) {\n\t\t\t\tcurrentWidth = hotspot.customimagewidth;\n\t\t\t\tcurrentHeight = hotspot.customimageheight;\n\t\t\t}\n\t\t\timg.style.left='50%';\n\t\t\timg.style.marginLeft='-' + currentWidth/2 + 'px';\n\t\t\timg.style.top='50%';\n\t\t\timg.style.marginTop='-' + currentHeight/2 + 'px';\n\t\t}\n\t\tme._ht_video_youtube.appendChild(me._ht_video_youtube_customimage);\n\t\tif ((hotspot) && (hotspot.customimage)) {\n\t\t\tel.style.width=hotspot.customimagewidth + 'px';\n\t\t\tel.style.height=hotspot.customimageheight + 'px';\n\t\t}\n\t\tme.__div = me._ht_video_youtube;\n\t};\n\tfunction SkinHotspotClass_ht_url(parentScope,hotspot) {\n\t\tvar me=this;\n\t\tvar flag=false;\n\t\tvar hs='';\n\t\tme.parentScope=parentScope;\n\t\tme.hotspot=hotspot;\n\t\tvar nodeId=String(hotspot.url);\n\t\tnodeId=(nodeId.charAt(0)=='{')?nodeId.substr(1, nodeId.length - 2):''; // }\n\t\tme.ggUserdata=skin.player.getNodeUserdata(nodeId);\n\t\tme.elementMouseDown=[];\n\t\tme.elementMouseOver=[];\n\t\tme.findElements=function(id,regex) {\n\t\t\treturn skin.findElements(id,regex);\n\t\t}\n\t\tel=me._ht_url=document.createElement('div');\n\t\tel.ggId=\"ht_url\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_hotspot \";\n\t\tel.ggType='hotspot';\n\t\ths ='';\n\t\ths+='height : 0px;';\n\t\ths+='left : 250px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 50px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 0px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_url.ggIsActive=function() {\n\t\t\treturn player.getCurrentNode()==this.ggElementNodeId();\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif (me.hotspot.url!='' && me.hotspot.url.charAt(0)=='{') { // }\n\t\t\t\treturn me.hotspot.url.substr(1, me.hotspot.url.length - 2);\n\t\t\t} else {\n\t\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t\t} else {\n\t\t\t\t\treturn player.getCurrentNode();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_url.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('vis_userdata') == true)) || \n\t\t\t\t((player.getVariableValue('vis_image_popup') == true)) || \n\t\t\t\t((player.getVariableValue('vis_info_popup') == true)) || \n\t\t\t\t((player.getVariableValue('vis_video_popup_file') == true)) || \n\t\t\t\t((player.getVariableValue('vis_video_popup_url') == true)) || \n\t\t\t\t((player.getVariableValue('vis_video_popup_vimeo') == true)) || \n\t\t\t\t((player.getVariableValue('vis_video_popup_youtube') == true)) || \n\t\t\t\t((player.getVariableValue('vis_website') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._ht_url.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._ht_url.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._ht_url.style[domTransition]='';\n\t\t\t\tif (me._ht_url.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._ht_url.style.visibility=\"hidden\";\n\t\t\t\t\tme._ht_url.ggVisible=false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._ht_url.style.visibility=(Number(me._ht_url.style.opacity)>0||!me._ht_url.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._ht_url.ggVisible=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_url.onclick=function (e) {\n\t\t\tif (\n\t\t\t\t(\n\t\t\t\t\t((player.getVariableValue('opt_url') == true)) && \n\t\t\t\t\t((player.getHasTouch() == false))\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tskin._web_page.ggText=\"<iframe src=\\\"\"+me.hotspot.url+\"\\\" width=\\\"100%\\\" height=\\\"100%\\\" allowfullscreen=\\\"true\\\" mozallowfullscreen=\\\"true\\\" webkitallowfullscreen=\\\"true\\\" frameborder= \\\"0\\\"><\\/iframe>\";\n\t\t\t\tskin._web_page.ggTextDiv.innerHTML=skin._web_page.ggText;\n\t\t\t\tif (skin._web_page.ggUpdateText) {\n\t\t\t\t\tskin._web_page.ggUpdateText=function() {\n\t\t\t\t\t\tvar hs=\"<iframe src=\\\"\"+me.hotspot.url+\"\\\" width=\\\"100%\\\" height=\\\"100%\\\" allowfullscreen=\\\"true\\\" mozallowfullscreen=\\\"true\\\" webkitallowfullscreen=\\\"true\\\" frameborder= \\\"0\\\"><\\/iframe>\";\n\t\t\t\t\t\tif (hs!=this.ggText) {\n\t\t\t\t\t\t\tthis.ggText=hs;\n\t\t\t\t\t\t\tthis.ggTextDiv.innerHTML=hs;\n\t\t\t\t\t\t\tif (this.ggUpdatePosition) this.ggUpdatePosition();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (skin._web_page.ggUpdatePosition) {\n\t\t\t\t\tskin._web_page.ggUpdatePosition();\n\t\t\t\t}\n\t\t\t\tskin._web_page.ggTextDiv.scrollTop = 0;\n\t\t\t}\n\t\t\tif (\n\t\t\t\t(\n\t\t\t\t\t((player.getVariableValue('opt_url') == true)) && \n\t\t\t\t\t((player.getHasTouch() == false))\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tplayer.setVariableValue('vis_website', true);\n\t\t\t}\n\t\t\tif (\n\t\t\t\t(\n\t\t\t\t\t((player.getVariableValue('opt_url') == false)) || \n\t\t\t\t\t((player.getHasTouch() == true))\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tplayer.openUrl(me.hotspot.url,me.hotspot.target);\n\t\t\t}\n\t\t\tskin.hotspotProxyClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_url.ondblclick=function (e) {\n\t\t\tskin.hotspotProxyDoubleClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_url.onmouseover=function (e) {\n\t\t\tplayer.setActiveHotspot(me.hotspot);\n\t\t\tme.elementMouseOver['ht_url']=true;\n\t\t\tme._tt_ht_url.logicBlock_visible();\n\t\t\tskin.hotspotProxyOver(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_url.onmouseout=function (e) {\n\t\t\tplayer.setActiveHotspot(null);\n\t\t\tme.elementMouseOver['ht_url']=false;\n\t\t\tme._tt_ht_url.logicBlock_visible();\n\t\t\tskin.hotspotProxyOut(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_url.ontouchend=function (e) {\n\t\t\tme.elementMouseOver['ht_url']=false;\n\t\t\tme._tt_ht_url.logicBlock_visible();\n\t\t}\n\t\tme._ht_url.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._ht_url_image=document.createElement('div');\n\t\tels=me._ht_url_image__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yNDAgMzMyIDEzMCAxMzAiIGJhc2VQcm9maWxlPSJ0aW55IiB4PSIwcHgiIHk9IjBweCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiA8ZyBpZD0iTG'+\n\t\t\t'F5ZXJfMV8xXyI+CiAgPGc+CiAgIDxwYXRoIGZpbGw9IiMwMDAwMDAiIGQ9Ik0tMTkwLjgsNDE0LjNoMTMuN3YtMTVoLTE2LjNDLTE5My4zLDQwNC43LTE5Mi4zLDQwOS44LTE5MC44LDQxNC4zeiIvPgogICA8cGF0aCBmaWxsPSIjMDAwMDAwIiBkPSJNLTE5My41LDM5NC43aDE2LjN2LTE1aC0xMy43Qy0xOTIuMywzODQuMi0xOTMuMywzODkuMy0xOTMuNSwzOTQuN3oiLz4KICAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xODkuMSwzNzUuMmgxMS45di0xMS45Qy0xODEuOSwzNjQuNC0xODYuMSwzNjguOC0xODkuMSwzNzUuMnoiLz4KICAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xNzcu'+\n\t\t\t'Miw0MzAuN3YtMTEuOWgtMTEuOUMtMTg2LjEsNDI1LjItMTgxLjksNDI5LjYtMTc3LjIsNDMwLjd6Ii8+CiAgIDxwYXRoIGZpbGw9IiMwMDAwMDAiIGQ9Ik0tMTk1LjYsMzc5LjdoLTguNWMtMi42LDQuNS00LjMsOS42LTQuNiwxNWgxMC44Qy0xOTcuOCwzODkuMy0xOTcsMzg0LjMtMTk1LjYsMzc5Ljd6Ii8+CiAgIDxwYXRoIGZpbGw9IiMwMDAwMDAiIGQ9Ik0tMTQ4LjksMzc1LjJjLTMuMy00LTcuNi03LjItMTIuNC05LjNjMi4xLDIuNiwzLjksNS43LDUuNCw5LjNILTE0OC45eiIvPgogICA8cGF0aCBmaWxsPSIjMDAwMDAwIiBkPSJNLTIwMC45LDQxOC44YzMuMywzLjksNy40LDcuMSwxMi4xLD'+\n\t\t\t'kuMmMtMi4xLTIuNS0zLjgtNS42LTUuMy05LjJILTIwMC45eiIvPgogICA8cGF0aCBmaWxsPSIjMDAwMDAwIiBkPSJNLTE4OC44LDM2NmMtNC43LDIuMS04LjksNS4zLTEyLjIsOS4yaDYuOUMtMTkyLjYsMzcxLjctMTkwLjksMzY4LjYtMTg4LjgsMzY2eiIvPgogICA8cGF0aCBmaWxsPSIjMDAwMDAwIiBkPSJNLTE5OCwzOTkuMmgtMTAuOGMwLjQsNS41LDIsMTAuNiw0LjcsMTVoOC41Qy0xOTcsNDA5LjctMTk3LjgsNDA0LjctMTk4LDM5OS4yeiIvPgogICA8cGF0aCBmaWxsPSIjMDAwMDAwIiBkPSJNLTE3NSwzNDAuOWMtMzEsMC01Ni4xLDI1LjEtNTYuMSw1Ni4xczI1LjEsNTYuMSw1Ni4xLDU2'+\n\t\t\t'LjFzNTYuMS0yNS4xLDU2LjEtNTYuMVMtMTQ0LDM0MC45LTE3NSwzNDAuOXomI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7IE0tMTc0LjksNDM1LjRjMCwwLTAuMSwwLTAuMSwwYy0wLjEsMC0wLjIsMC0wLjQsMGMtMjEtMC4yLTM4LTE3LjQtMzgtMzguNGMwLTIxLjIsMTcuMi0zOC40LDM4LjQtMzguNCYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTtjMjEuMiwwLDM4LjQsMTcuMiwzOC40LDM4LjRDLTEzNi41LDQxOC4yLTE1My43LDQzNS40LTE3NC45LDQzNS40eiIvPgogICA8cGF0aCBmaWxsPSIjMDAwMDAwIiBkPSJNLTE2MS4zLDQyOC4xYzQuOC0yLjEsOS01LjMsMTIuNC05LjNoLTdDLTE1Ny40LD'+\n\t\t\t'QyMi40LTE1OS4yLDQyNS41LTE2MS4zLDQyOC4xeiIvPgogICA8cGF0aCBmaWxsPSIjMDAwMDAwIiBkPSJNLTE1NC40LDQxNC4zaDguNmMyLjctNC41LDQuMy05LjYsNC43LTE1aC0xMUMtMTUyLjIsNDA0LjctMTUzLDQwOS43LTE1NC40LDQxNC4zeiIvPgogICA8cGF0aCBmaWxsPSIjMDAwMDAwIiBkPSJNLTE3Mi43LDM2My4zdjExLjloMTEuN0MtMTYzLjksMzY4LjktMTY4LDM2NC41LTE3Mi43LDM2My4zeiIvPgogICA8cGF0aCBmaWxsPSIjMDAwMDAwIiBkPSJNLTE1MiwzOTQuN2gxMWMtMC40LTUuNS0yLTEwLjYtNC43LTE1aC04LjZDLTE1MywzODQuMy0xNTIuMiwzODkuMy0xNTIsMzk0Ljd6'+\n\t\t\t'Ii8+CiAgIDxwYXRoIGZpbGw9IiMwMDAwMDAiIGQ9Ik0tMTcyLjcsNDE4Ljh2MTEuOWM0LjYtMS4xLDguOC01LjUsMTEuNy0xMS45Qy0xNjAuOSw0MTguOC0xNzIuNyw0MTguOC0xNzIuNyw0MTguOHoiLz4KICAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xNTkuMiwzNzkuN2gtMTMuNXYxNWgxNi4xQy0xNTYuNywzODkuMy0xNTcuNywzODQuMi0xNTkuMiwzNzkuN3oiLz4KICAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xNTYuNSwzOTkuMmgtMTYuMXYxNWgxMy41Qy0xNTcuNyw0MDkuOC0xNTYuNyw0MDQuNy0xNTYuNSwzOTkuMnoiLz4KICA8L2c+CiA8L2c+CiA8ZyBpZD0iTGF5ZXJfMi'+\n\t\t\t'I+CiAgPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTS0xMzYuNSwzOTdjMC0yMS4yLTE3LjItMzguNC0zOC40LTM4LjRjLTIxLjIsMC0zOC40LDE3LjItMzguNCwzOC40YzAsMjEuMSwxNywzOC4yLDM4LDM4LjQmI3hkOyYjeGE7JiN4OTsmI3g5O2MwLjEsMCwwLjIsMCwwLjQsMGMwLDAsMC4xLDAsMC4xLDBDLTE1My43LDQzNS40LTEzNi41LDQxOC4yLTEzNi41LDM5N3ogTS0yMDguOCwzOTkuMmgxMC44YzAuMiw1LjQsMSwxMC41LDIuMywxNWgtOC41JiN4ZDsmI3hhOyYjeDk7JiN4OTtDLTIwNi44LDQwOS44LTIwOC40LDQwNC43LTIwOC44LDM5OS4yeiBNLTE0MS4xLDM5NC43aC0xMWMtMC4yLTUu'+\n\t\t\t'NC0xLTEwLjUtMi4zLTE1aDguNkMtMTQzLjEsMzg0LjItMTQxLjQsMzg5LjMtMTQxLjEsMzk0Ljd6JiN4ZDsmI3hhOyYjeDk7JiN4OTsgTS0xNTYuNSwzOTQuN2gtMTYuMXYtMTVoMTMuNUMtMTU3LjcsMzg0LjItMTU2LjcsMzg5LjMtMTU2LjUsMzk0Ljd6IE0tMTcyLjcsMzc1LjJ2LTExLjljNC42LDEuMSw4LjgsNS41LDExLjcsMTEuOUwtMTcyLjcsMzc1LjImI3hkOyYjeGE7JiN4OTsmI3g5O0wtMTcyLjcsMzc1LjJ6IE0tMTc3LjIsMzYzLjN2MTEuOWgtMTEuOUMtMTg2LjEsMzY4LjgtMTgxLjksMzY0LjQtMTc3LjIsMzYzLjN6IE0tMTc3LjIsMzc5Ljd2MTVoLTE2LjNjMC4yLTUuNCwxLjEtMT'+\n\t\t\t'AuNSwyLjYtMTUmI3hkOyYjeGE7JiN4OTsmI3g5O0wtMTc3LjIsMzc5LjdMLTE3Ny4yLDM3OS43eiBNLTE5OCwzOTQuN2gtMTAuOGMwLjQtNS41LDItMTAuNiw0LjYtMTVoOC41Qy0xOTcsMzg0LjMtMTk3LjgsMzg5LjMtMTk4LDM5NC43eiBNLTE5My41LDM5OS4yaDE2LjMmI3hkOyYjeGE7JiN4OTsmI3g5O3YxNWgtMTMuN0MtMTkyLjMsNDA5LjgtMTkzLjMsNDA0LjctMTkzLjUsMzk5LjJ6IE0tMTc3LjIsNDE4Ljh2MTEuOWMtNC43LTEuMS04LjktNS41LTExLjktMTEuOUgtMTc3LjJ6IE0tMTcyLjcsNDMwLjZ2LTExLjloMTEuNyYjeGQ7JiN4YTsmI3g5OyYjeDk7Qy0xNjMuOSw0MjUuMS0xNjgs'+\n\t\t\t'NDI5LjUtMTcyLjcsNDMwLjZ6IE0tMTcyLjcsNDE0LjN2LTE1aDE2LjFjLTAuMiw1LjQtMS4xLDEwLjYtMi42LDE1SC0xNzIuN3ogTS0xNTIsMzk5LjJoMTEmI3hkOyYjeGE7JiN4OTsmI3g5O2MtMC40LDUuNS0yLDEwLjYtNC43LDE1aC04LjZDLTE1Myw0MDkuNy0xNTIuMiw0MDQuNy0xNTIsMzk5LjJ6IE0tMTQ4LjksMzc1LjJoLTdjLTEuNS0zLjYtMy4zLTYuOC01LjQtOS4zJiN4ZDsmI3hhOyYjeDk7JiN4OTtDLTE1Ni41LDM2OC0xNTIuMiwzNzEuMi0xNDguOSwzNzUuMnogTS0xODguOCwzNjZjLTIuMSwyLjUtMy44LDUuNy01LjMsOS4yaC02LjlDLTE5Ny43LDM3MS4zLTE5My41LDM2OC4xLT'+\n\t\t\t'E4OC44LDM2NnomI3hkOyYjeGE7JiN4OTsmI3g5OyBNLTIwMC45LDQxOC44aDYuOWMxLjQsMy41LDMuMiw2LjYsNS4zLDkuMkMtMTkzLjUsNDI1LjgtMTk3LjYsNDIyLjctMjAwLjksNDE4Ljh6IE0tMTYxLjMsNDI4LjFjMi4xLTIuNiwzLjktNS43LDUuNC05LjNoNyYjeGQ7JiN4YTsmI3g5OyYjeDk7Qy0xNTIuMyw0MjIuNy0xNTYuNSw0MjUuOS0xNjEuMyw0MjguMXoiLz4KIDwvZz4KPC9zdmc+Cg==';\n\t\tme._ht_url_image__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\telo=me._ht_url_image__imgo=document.createElement('img');\n\t\telo.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yNDAgMzMyIDEzMCAxMzAiIGJhc2VQcm9maWxlPSJ0aW55IiB4PSIwcHgiIHk9IjBweCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiA8ZyBpZD0iTG'+\n\t\t\t'F5ZXJfMV8xXyI+CiAgPGc+CiAgIDxwYXRoIGZpbGw9IiMwMDAwMDAiIGQ9Ik0tMTkyLjYsNDE2LjJoMTUuMnYtMTYuN2gtMTguMUMtMTk1LjMsNDA1LjUtMTk0LjIsNDExLjItMTkyLjYsNDE2LjJ6Ii8+CiAgIDxwYXRoIGZpbGw9IiMwMDAwMDAiIGQ9Ik0tMTk1LjUsMzk0LjVoMTguMXYtMTYuN2gtMTUuMkMtMTk0LjMsMzgyLjgtMTk1LjMsMzg4LjUtMTk1LjUsMzk0LjV6Ii8+CiAgIDxwYXRoIGZpbGw9IiMwMDAwMDAiIGQ9Ik0tMTkwLjYsMzcyLjhoMTMuMnYtMTMuMkMtMTgyLjYsMzYwLjctMTg3LjMsMzY1LjctMTkwLjYsMzcyLjh6Ii8+CiAgIDxwYXRoIGZpbGw9IiMwMDAwMDAiIGQ9Ik0t'+\n\t\t\t'MTc3LjQsNDM0LjR2LTEzLjJoLTEzLjJDLTE4Ny4zLDQyOC4zLTE4Mi42LDQzMy4yLTE3Ny40LDQzNC40eiIvPgogICA8cGF0aCBmaWxsPSIjMDAwMDAwIiBkPSJNLTE5Ny45LDM3Ny44aC05LjRjLTIuOSw0LjktNC44LDEwLjYtNS4yLDE2LjdoMTJDLTIwMC4zLDM4OC41LTE5OS40LDM4Mi44LTE5Ny45LDM3Ny44eiIvPgogICA8cGF0aCBmaWxsPSIjMDAwMDAwIiBkPSJNLTE0NiwzNzIuOGMtMy43LTQuNC04LjQtOC0xMy44LTEwLjRjMi4zLDIuOCw0LjQsNi4zLDYsMTAuNEgtMTQ2eiIvPgogICA8cGF0aCBmaWxsPSIjMDAwMDAwIiBkPSJNLTIwMy44LDQyMS4yYzMuNiw0LjMsOC4yLDcuOCwxMy'+\n\t\t\t'41LDEwLjJjLTIuMy0yLjgtNC4zLTYuMy01LjgtMTAuMkgtMjAzLjh6Ii8+CiAgIDxwYXRoIGZpbGw9IiMwMDAwMDAiIGQ9Ik0tMTkwLjMsMzYyLjZjLTUuMiwyLjQtOS45LDUuOS0xMy41LDEwLjJoNy42Qy0xOTQuNiwzNjguOS0xOTIuNiwzNjUuNC0xOTAuMywzNjIuNnoiLz4KICAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0yMDAuNSwzOTkuNWgtMTJjMC40LDYuMSwyLjIsMTEuOCw1LjIsMTYuN2g5LjRDLTE5OS40LDQxMS4xLTIwMC4zLDQwNS41LTIwMC41LDM5OS41eiIvPgogICA8cGF0aCBmaWxsPSIjMDAwMDAwIiBkPSJNLTE3NSwzMzQuNmMtMzQuNCwwLTYyLjQsMjcuOS02Mi40LDYy'+\n\t\t\t'LjRzMjcuOSw2Mi40LDYyLjQsNjIuNHM2Mi40LTI3LjksNjIuNC02Mi40Uy0xNDAuNiwzMzQuNi0xNzUsMzM0LjYmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7eiBNLTE3NC45LDQzOS43YzAsMC0wLjEsMC0wLjEsMGMtMC4xLDAtMC4zLDAtMC40LDBjLTIzLjMtMC4zLTQyLjItMTkuMy00Mi4yLTQyLjdjMC0yMy42LDE5LjItNDIuNyw0Mi43LTQyLjcmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7YzIzLjYsMCw0Mi43LDE5LjIsNDIuNyw0Mi43Qy0xMzIuMiw0MjAuNS0xNTEuMyw0MzkuNy0xNzQuOSw0MzkuN3oiLz4KICAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xNTkuOCw0MzEuNWM1LjMtMi'+\n\t\t\t'40LDEwLTUuOSwxMy43LTEwLjNoLTcuOEMtMTU1LjQsNDI1LjItMTU3LjUsNDI4LjctMTU5LjgsNDMxLjV6Ii8+CiAgIDxwYXRoIGZpbGw9IiMwMDAwMDAiIGQ9Ik0tMTUyLjEsNDE2LjJoOS42YzMtNSw0LjgtMTAuNiw1LjItMTYuN2gtMTIuMkMtMTQ5LjcsNDA1LjUtMTUwLjYsNDExLjEtMTUyLjEsNDE2LjJ6Ii8+CiAgIDxwYXRoIGZpbGw9IiMwMDAwMDAiIGQ9Ik0tMTcyLjQsMzU5LjZ2MTMuMmgxM0MtMTYyLjYsMzY1LjctMTY3LjMsMzYwLjgtMTcyLjQsMzU5LjZ6Ii8+CiAgIDxwYXRoIGZpbGw9IiMwMDAwMDAiIGQ9Ik0tMTQ5LjUsMzk0LjVoMTIuMmMtMC40LTYuMS0yLjItMTEuNy01LjIt'+\n\t\t\t'MTYuN2gtOS42Qy0xNTAuNiwzODIuOC0xNDkuNywzODguNS0xNDkuNSwzOTQuNXoiLz4KICAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xNzIuNCw0MjEuMnYxMy4yYzUuMS0xLjIsOS44LTYuMSwxMy0xMy4yQy0xNTkuNCw0MjEuMi0xNzIuNCw0MjEuMi0xNzIuNCw0MjEuMnoiLz4KICAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xNTcuNCwzNzcuOGgtMTV2MTYuN2gxNy45Qy0xNTQuNywzODguNS0xNTUuOCwzODIuOC0xNTcuNCwzNzcuOHoiLz4KICAgPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTS0xNTQuNSwzOTkuNWgtMTcuOXYxNi43aDE1Qy0xNTUuOCw0MTEuMi0xNTQuNyw0MDUuNS'+\n\t\t\t'0xNTQuNSwzOTkuNXoiLz4KICA8L2c+CiA8L2c+CiA8ZyBpZD0iTGF5ZXJfMiI+CiAgPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTS0xMzIuMiwzOTdjMC0yMy42LTE5LjItNDIuNy00Mi43LTQyLjdjLTIzLjYsMC00Mi43LDE5LjItNDIuNyw0Mi43YzAsMjMuNCwxOC45LDQyLjQsNDIuMiw0Mi43JiN4ZDsmI3hhOyYjeDk7JiN4OTtjMC4xLDAsMC4zLDAsMC40LDBjMCwwLDAuMSwwLDAuMSwwQy0xNTEuMyw0MzkuNy0xMzIuMiw0MjAuNS0xMzIuMiwzOTd6IE0tMjEyLjUsMzk5LjVoMTJjMC4yLDYsMS4xLDExLjcsMi42LDE2LjdoLTkuNCYjeGQ7JiN4YTsmI3g5OyYjeDk7Qy0yMTAuMyw0MTEuMi0y'+\n\t\t\t'MTIuMSw0MDUuNi0yMTIuNSwzOTkuNXogTS0xMzcuMywzOTQuNWgtMTIuMmMtMC4yLTYtMS4xLTExLjYtMi42LTE2LjdoOS42Qy0xMzkuNSwzODIuOC0xMzcuNywzODguNC0xMzcuMywzOTQuNXomI3hkOyYjeGE7JiN4OTsmI3g5OyBNLTE1NC41LDM5NC41aC0xNy45di0xNi43aDE1Qy0xNTUuOCwzODIuOC0xNTQuNywzODguNS0xNTQuNSwzOTQuNXogTS0xNzIuNCwzNzIuOHYtMTMuMmM1LjIsMS4yLDkuOCw2LjIsMTMsMTMuMkwtMTcyLjQsMzcyLjgmI3hkOyYjeGE7JiN4OTsmI3g5O0wtMTcyLjQsMzcyLjh6IE0tMTc3LjQsMzU5LjZ2MTMuMmgtMTMuMkMtMTg3LjMsMzY1LjctMTgyLjYsMzYwLj'+\n\t\t\t'ctMTc3LjQsMzU5LjZ6IE0tMTc3LjQsMzc3Ljh2MTYuN2gtMTguMWMwLjItNiwxLjMtMTEuNywyLjktMTYuNyYjeGQ7JiN4YTsmI3g5OyYjeDk7TC0xNzcuNCwzNzcuOEwtMTc3LjQsMzc3Ljh6IE0tMjAwLjUsMzk0LjVoLTEyYzAuNC02LjEsMi4yLTExLjcsNS4yLTE2LjdoOS40Qy0xOTkuNCwzODIuOC0yMDAuMywzODguNS0yMDAuNSwzOTQuNXomI3hkOyYjeGE7JiN4OTsmI3g5OyBNLTE5NS41LDM5OS41aDE4LjF2MTYuN2gtMTUuMkMtMTk0LjIsNDExLjItMTk1LjMsNDA1LjUtMTk1LjUsMzk5LjV6IE0tMTc3LjQsNDIxLjJ2MTMuMmMtNS4yLTEuMi05LjktNi4xLTEzLjItMTMuMkgtMTc3LjR6'+\n\t\t\t'JiN4ZDsmI3hhOyYjeDk7JiN4OTsgTS0xNzIuNCw0MzQuNHYtMTMuMmgxM0MtMTYyLjcsNDI4LjItMTY3LjMsNDMzLjEtMTcyLjQsNDM0LjR6IE0tMTcyLjQsNDE2LjJ2LTE2LjdoMTcuOWMtMC4yLDYtMS4zLDExLjctMi45LDE2LjdILTE3Mi40eiYjeGQ7JiN4YTsmI3g5OyYjeDk7IE0tMTQ5LjUsMzk5LjVoMTIuMmMtMC40LDYuMS0yLjIsMTEuOC01LjIsMTYuN2gtOS42Qy0xNTAuNiw0MTEuMS0xNDkuNyw0MDUuNS0xNDkuNSwzOTkuNXogTS0xNDYsMzcyLjhoLTcuOCYjeGQ7JiN4YTsmI3g5OyYjeDk7Yy0xLjYtNC0zLjYtNy41LTYtMTAuNEMtMTU0LjQsMzY0LjgtMTQ5LjcsMzY4LjQtMTQ2LD'+\n\t\t\t'M3Mi44eiBNLTE5MC4zLDM2Mi42Yy0yLjMsMi44LTQuMyw2LjMtNS45LDEwLjJoLTcuNiYjeGQ7JiN4YTsmI3g5OyYjeDk7Qy0yMDAuMiwzNjguNC0xOTUuNiwzNjQuOS0xOTAuMywzNjIuNnogTS0yMDMuOCw0MjEuMmg3LjZjMS42LDMuOSwzLjYsNy40LDUuOSwxMC4yQy0xOTUuNiw0MjktMjAwLjIsNDI1LjUtMjAzLjgsNDIxLjJ6JiN4ZDsmI3hhOyYjeDk7JiN4OTsgTS0xNTkuOCw0MzEuNWMyLjMtMi44LDQuMy02LjMsNi0xMC4zaDcuOEMtMTQ5LjcsNDI1LjYtMTU0LjQsNDI5LjItMTU5LjgsNDMxLjV6Ii8+CiA8L2c+Cjwvc3ZnPgo=';\n\t\tme._ht_url_image__imgo.setAttribute('src',hs);\n\t\telo.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;visibility:hidden;pointer-events:none;;');\n\t\telo['ondragstart']=function() { return false; };\n\t\tel.appendChild(elo);\n\t\tel.ggId=\"ht_url_image\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 32px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 32px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_url_image.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_url_image.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.hotspot.customimage != \"\"))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._ht_url_image.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._ht_url_image.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._ht_url_image.style[domTransition]='';\n\t\t\t\tif (me._ht_url_image.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._ht_url_image.style.visibility=\"hidden\";\n\t\t\t\t\tme._ht_url_image.ggVisible=false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._ht_url_image.style.visibility=(Number(me._ht_url_image.style.opacity)>0||!me._ht_url_image.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._ht_url_image.ggVisible=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_url_image.onmouseover=function (e) {\n\t\t\tme._ht_url_image__img.style.visibility='hidden';\n\t\t\tme._ht_url_image__imgo.style.visibility='inherit';\n\t\t}\n\t\tme._ht_url_image.onmouseout=function (e) {\n\t\t\tme._ht_url_image__img.style.visibility='inherit';\n\t\t\tme._ht_url_image__imgo.style.visibility='hidden';\n\t\t}\n\t\tme._ht_url_image.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t}\n\t\tme._ht_url.appendChild(me._ht_url_image);\n\t\tel=me._tt_ht_url=document.createElement('div');\n\t\tels=me._tt_ht_url__text=document.createElement('div');\n\t\tel.className='ggskin ggskin_textdiv';\n\t\tel.ggTextDiv=els;\n\t\tel.ggId=\"tt_ht_url\";\n\t\tel.ggDx=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_text \";\n\t\tel.ggType='text';\n\t\ths ='';\n\t\ths+='z-index: 100;';\n\t\ths+='height : 20px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 24px;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 100px;';\n\t\ths+='pointer-events:none;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\ths ='position:absolute;';\n\t\ths += 'box-sizing: border-box;';\n\t\ths+='cursor: default;';\n\t\ths+='left: 0px;';\n\t\ths+='top: 0px;';\n\t\ths+='width: auto;';\n\t\ths+='height: auto;';\n\t\ths+='pointer-events: none;';\n\t\ths+='background: #000000;';\n\t\ths+='background: rgba(0,0,0,0.666667);';\n\t\ths+='border: 0px solid #000000;';\n\t\ths+='color: rgba(255,255,255,1);';\n\t\ths+='text-align: center;';\n\t\ths+='white-space: nowrap;';\n\t\ths+='padding: 2px 5px 2px 5px;';\n\t\ths+='overflow: hidden;';\n\t\tels.setAttribute('style',hs);\n\t\tels.innerHTML=me.hotspot.title;\n\t\tel.appendChild(els);\n\t\tme._tt_ht_url.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._tt_ht_url.logicBlock_position = function() {\n\t\t\tvar newLogicStatePosition;\n\t\t\tif (\n\t\t\t\t((player.getHasTouch() == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStatePosition = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStatePosition = -1;\n\t\t\t}\n\t\t\tif (me._tt_ht_url.ggCurrentLogicStatePosition != newLogicStatePosition) {\n\t\t\t\tme._tt_ht_url.ggCurrentLogicStatePosition = newLogicStatePosition;\n\t\t\t\tme._tt_ht_url.style[domTransition]='left 0s, top 0s';\n\t\t\t\tif (me._tt_ht_url.ggCurrentLogicStatePosition == 0) {\n\t\t\t\t\tthis.ggDx = 0;\n\t\t\t\t\tme._tt_ht_url.style.top='-47px';\n\t\t\t\t\tme._tt_ht_url.ggUpdatePosition(true);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._tt_ht_url.ggDx=0;\n\t\t\t\t\tme._tt_ht_url.style.top='24px';\n\t\t\t\t\tme._tt_ht_url.ggUpdatePosition(true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._tt_ht_url.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.elementMouseOver['ht_url'] == true)) && \n\t\t\t\t((me.hotspot.title != \"\"))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._tt_ht_url.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._tt_ht_url.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._tt_ht_url.style[domTransition]='left 0s, top 0s';\n\t\t\t\tif (me._tt_ht_url.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._tt_ht_url.style.visibility=(Number(me._tt_ht_url.style.opacity)>0||!me._tt_ht_url.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._tt_ht_url.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._tt_ht_url.style.visibility=\"hidden\";\n\t\t\t\t\tme._tt_ht_url.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._tt_ht_url.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth + 0;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t}\n\t\t\tthis.style[domTransition]='left 0';\n\t\t\tthis.ggTextDiv.style.left=((98-this.ggTextDiv.offsetWidth)/2) + 'px';\n\t\t}\n\t\tme._ht_url.appendChild(me._tt_ht_url);\n\t\tel=me._ht_url_customimage=document.createElement('div');\n\t\tels=me._ht_url_customimage__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_external';\n\t\tels.setAttribute('style','position: absolute;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels.onload=function() {me._ht_url_customimage.ggUpdatePosition();}\n\t\tif ((hotspot) && (hotspot.customimage)) {\n\t\t\tel.ggText=hotspot.customimage;\n\t\t\tels.setAttribute('src', hotspot.customimage);\n\t\t\tels.style.width=hotspot.customimagewidth + 'px';\n\t\t\tels.style.height=hotspot.customimageheight + 'px';\n\t\t\tme.ggUse3d = hotspot.use3D;\n\t\t\tme.gg3dDistance = hotspot.distance3D;\n\t\t}\n\t\tels['ondragstart']=function() { return false; };\n\t\tplayer.checkLoaded.push(els);\n\t\ths ='';\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\tel.ggId=\"ht_url_CustomImage\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_external \";\n\t\tel.ggType='external';\n\t\ths ='';\n\t\ths+='border : 0px solid #000000;';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 50px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 50px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_url_customimage.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_url_customimage.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.hotspot.customimage == \"\"))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._ht_url_customimage.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._ht_url_customimage.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._ht_url_customimage.style[domTransition]='';\n\t\t\t\tif (me._ht_url_customimage.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._ht_url_customimage.style.visibility=\"hidden\";\n\t\t\t\t\tme._ht_url_customimage__img.src = '';\n\t\t\t\t\tme._ht_url_customimage.ggVisible=false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._ht_url_customimage.style.visibility=(Number(me._ht_url_customimage.style.opacity)>0||!me._ht_url_customimage.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._ht_url_customimage.ggSubElement.src=me._ht_url_customimage.ggText;\n\t\t\t\t\tme._ht_url_customimage.ggVisible=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_url_customimage.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t\tvar parentWidth = me._ht_url_customimage.clientWidth;\n\t\t\tvar parentHeight = me._ht_url_customimage.clientHeight;\n\t\t\tvar img = me._ht_url_customimage__img;\n\t\t\tvar aspectRatioDiv = me._ht_url_customimage.clientWidth / me._ht_url_customimage.clientHeight;\n\t\t\tvar aspectRatioImg = img.naturalWidth / img.naturalHeight;\n\t\t\tif (img.naturalWidth < parentWidth) parentWidth = img.naturalWidth;\n\t\t\tif (img.naturalHeight < parentHeight) parentHeight = img.naturalHeight;\n\t\t\tvar currentWidth,currentHeight;\n\t\t\tif ((hotspot) && (hotspot.customimage)) {\n\t\t\t\tcurrentWidth = hotspot.customimagewidth;\n\t\t\t\tcurrentHeight = hotspot.customimageheight;\n\t\t\t}\n\t\t\timg.style.left='50%';\n\t\t\timg.style.marginLeft='-' + currentWidth/2 + 'px';\n\t\t\timg.style.top='50%';\n\t\t\timg.style.marginTop='-' + currentHeight/2 + 'px';\n\t\t}\n\t\tme._ht_url.appendChild(me._ht_url_customimage);\n\t\tif ((hotspot) && (hotspot.customimage)) {\n\t\t\tel.style.width=hotspot.customimagewidth + 'px';\n\t\t\tel.style.height=hotspot.customimageheight + 'px';\n\t\t}\n\t\tme.__div = me._ht_url;\n\t};\n\tfunction SkinHotspotClass_ht_form(parentScope,hotspot) {\n\t\tvar me=this;\n\t\tvar flag=false;\n\t\tvar hs='';\n\t\tme.parentScope=parentScope;\n\t\tme.hotspot=hotspot;\n\t\tvar nodeId=String(hotspot.url);\n\t\tnodeId=(nodeId.charAt(0)=='{')?nodeId.substr(1, nodeId.length - 2):''; // }\n\t\tme.ggUserdata=skin.player.getNodeUserdata(nodeId);\n\t\tme.elementMouseDown=[];\n\t\tme.elementMouseOver=[];\n\t\tme.findElements=function(id,regex) {\n\t\t\treturn skin.findElements(id,regex);\n\t\t}\n\t\tel=me._ht_form=document.createElement('div');\n\t\tel.ggId=\"ht_form\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_hotspot \";\n\t\tel.ggType='hotspot';\n\t\ths ='';\n\t\ths+='height : 0px;';\n\t\ths+='left : 250px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 50px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 0px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_form.ggIsActive=function() {\n\t\t\treturn player.getCurrentNode()==this.ggElementNodeId();\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif (me.hotspot.url!='' && me.hotspot.url.charAt(0)=='{') { // }\n\t\t\t\treturn me.hotspot.url.substr(1, me.hotspot.url.length - 2);\n\t\t\t} else {\n\t\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t\t} else {\n\t\t\t\t\treturn player.getCurrentNode();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_form.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('vis_userdata') == true)) || \n\t\t\t\t((player.getVariableValue('vis_image_popup') == true)) || \n\t\t\t\t((player.getVariableValue('vis_info_popup') == true)) || \n\t\t\t\t((player.getVariableValue('vis_video_popup_file') == true)) || \n\t\t\t\t((player.getVariableValue('vis_video_popup_url') == true)) || \n\t\t\t\t((player.getVariableValue('vis_video_popup_vimeo') == true)) || \n\t\t\t\t((player.getVariableValue('vis_video_popup_youtube') == true)) || \n\t\t\t\t((player.getVariableValue('vis_website') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._ht_form.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._ht_form.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._ht_form.style[domTransition]='';\n\t\t\t\tif (me._ht_form.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._ht_form.style.visibility=\"hidden\";\n\t\t\t\t\tme._ht_form.ggVisible=false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._ht_form.style.visibility=(Number(me._ht_form.style.opacity)>0||!me._ht_form.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._ht_form.ggVisible=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_form.onclick=function (e) {\n\t\t\tif (\n\t\t\t\t(\n\t\t\t\t\t((player.getVariableValue('opt_url') == true)) && \n\t\t\t\t\t((player.getHasTouch() == false))\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tskin._web_page.ggText=\"<iframe src=\\\"\"+me.hotspot.url+\"\\\" width=\\\"100%\\\" height=\\\"100%\\\" allowfullscreen=\\\"true\\\" mozallowfullscreen=\\\"true\\\" webkitallowfullscreen=\\\"true\\\" frameborder= \\\"0\\\"><\\/iframe>\";\n\t\t\t\tskin._web_page.ggTextDiv.innerHTML=skin._web_page.ggText;\n\t\t\t\tif (skin._web_page.ggUpdateText) {\n\t\t\t\t\tskin._web_page.ggUpdateText=function() {\n\t\t\t\t\t\tvar hs=\"<iframe src=\\\"\"+me.hotspot.url+\"\\\" width=\\\"100%\\\" height=\\\"100%\\\" allowfullscreen=\\\"true\\\" mozallowfullscreen=\\\"true\\\" webkitallowfullscreen=\\\"true\\\" frameborder= \\\"0\\\"><\\/iframe>\";\n\t\t\t\t\t\tif (hs!=this.ggText) {\n\t\t\t\t\t\t\tthis.ggText=hs;\n\t\t\t\t\t\t\tthis.ggTextDiv.innerHTML=hs;\n\t\t\t\t\t\t\tif (this.ggUpdatePosition) this.ggUpdatePosition();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (skin._web_page.ggUpdatePosition) {\n\t\t\t\t\tskin._web_page.ggUpdatePosition();\n\t\t\t\t}\n\t\t\t\tskin._web_page.ggTextDiv.scrollTop = 0;\n\t\t\t}\n\t\t\tif (\n\t\t\t\t(\n\t\t\t\t\t((player.getVariableValue('opt_url') == true)) && \n\t\t\t\t\t((player.getHasTouch() == false))\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tplayer.setVariableValue('vis_website', true);\n\t\t\t}\n\t\t\tif (\n\t\t\t\t(\n\t\t\t\t\t((player.getVariableValue('opt_url') == false)) || \n\t\t\t\t\t((player.getHasTouch() == true))\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tplayer.openUrl(me.hotspot.url,me.hotspot.target);\n\t\t\t}\n\t\t\tskin.hotspotProxyClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_form.ondblclick=function (e) {\n\t\t\tskin.hotspotProxyDoubleClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_form.onmouseover=function (e) {\n\t\t\tplayer.setActiveHotspot(me.hotspot);\n\t\t\tme.elementMouseOver['ht_form']=true;\n\t\t\tme._tt_ht_url_1.logicBlock_visible();\n\t\t\tskin.hotspotProxyOver(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_form.onmouseout=function (e) {\n\t\t\tplayer.setActiveHotspot(null);\n\t\t\tme.elementMouseOver['ht_form']=false;\n\t\t\tme._tt_ht_url_1.logicBlock_visible();\n\t\t\tskin.hotspotProxyOut(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_form.ontouchend=function (e) {\n\t\t\tme.elementMouseOver['ht_form']=false;\n\t\t\tme._tt_ht_url_1.logicBlock_visible();\n\t\t}\n\t\tme._ht_form.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._ht_url_image_1=document.createElement('div');\n\t\tels=me._ht_url_image_1__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA2NCA2NC43OyIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgNjQgNjQuNyIgeD0iMHB4IiB5PSIwcHgiIHhtbDpzcGFjZT0icH'+\n\t\t\t'Jlc2VydmUiPgogPHN0eWxlIHR5cGU9InRleHQvY3NzIj4mI3hkOwoJLnN0MHtmaWxsOiNGRkZGRkY7fSYjeGQ7Cjwvc3R5bGU+CiA8Y2lyY2xlIGN5PSIzMiIgcj0iMzEiIGN4PSIzMiIvPgogPGc+CiAgPHBhdGggZD0iTTQzLjQsNDYuOWwtMy4zLDFjLTAuMywwLjEtMC42LDAuMS0wLjksMC4xYy0wLjksMC0xLjctMC40LTIuMi0xYy0wLjYtMC43LTAuOC0xLjYtMC43LTIuNGwwLjMtMS43SDI0LjQmI3hkOyYjeGE7JiN4OTsmI3g5O2MtMC44LDAtMS40LTAuNi0xLjQtMS40YzAtMC43LDAuNi0xLjQsMS40LTEuNGgxMi44YzAuMS0wLjEsMC4yLTAuMywwLjMtMC40bDkuNy0xMS4xdi0xMmMwLTEu'+\n\t\t\t'My0xLTIuMy0yLjMtMi4zaC0zLjV2LTEuNiYjeGQ7JiN4YTsmI3g5OyYjeDk7YzAtMS4zLTEtMi4yLTIuMi0yLjJjLTEuMiwwLTIuMiwxLTIuMiwyLjJ2MS42aC0zLjV2LTEuNmMwLTEuMy0xLTIuMi0yLjItMi4ycy0yLjIsMS0yLjIsMi4ydjEuNmgtMy41di0xLjZjMC0xLjMtMS0yLjItMi4yLTIuMiYjeGQ7JiN4YTsmI3g5OyYjeDk7Yy0xLjIsMC0yLjIsMS0yLjIsMi4ydjEuNmgtMy41Yy0xLjMsMC0yLjMsMS0yLjMsMi4zdjMyLjRjMCwxLjMsMSwyLjMsMi4zLDIuM2gyNy4yYzEuMywwLDIuMy0xLDIuMy0yLjN2LTUuN0w0NC44LDQ2JiN4ZDsmI3hhOyYjeDk7JiN4OTtDNDQuNSw0Ni40LDQzLj'+\n\t\t\t'ksNDYuNyw0My40LDQ2Ljl6IE0yNC40LDIyLjNoMTMuOWMwLjgsMCwxLjQsMC42LDEuNCwxLjRjMCwwLjctMC42LDEuNC0xLjQsMS40SDI0LjRjLTAuOCwwLTEuNC0wLjYtMS40LTEuNCYjeGQ7JiN4YTsmI3g5OyYjeDk7QzIzLDIyLjksMjMuNiwyMi4zLDI0LjQsMjIuM3ogTTI0LjQsMzEuMmgxMy45YzAuOCwwLDEuNCwwLjYsMS40LDEuNGMwLDAuNy0wLjYsMS40LTEuNCwxLjRIMjQuNGMtMC44LDAtMS40LTAuNi0xLjQtMS40JiN4ZDsmI3hhOyYjeDk7JiN4OTtDMjMsMzEuOCwyMy42LDMxLjIsMjQuNCwzMS4yeiIgY2xhc3M9InN0MCIvPgogIDxwYXRoIGQ9Ik0zOC41LDQ0LjhjLTAuMSwwLjYs'+\n\t\t\t'MC40LDEsMSwwLjlsMy4zLTFjMC4xLDAsMC4zLTAuMSwwLjMtMC4ybDEtMS4xbC0zLjktMy41bC0xLDEuMWMtMC4xLDAuMS0wLjIsMC4zLTAuMiwwLjQmI3hkOyYjeGE7JiN4OTsmI3g5O0wzOC41LDQ0Ljh6IiBjbGFzcz0ic3QwIi8+CiAgPHBvbHlnb24gcG9pbnRzPSI0MS4zLDM4LjYgNDUuMyw0Mi4xIDUzLjQsMzIuOCA0OS41LDI5LjQgJiN4OTsiIGNsYXNzPSJzdDAiLz4KICA8cGF0aCBkPSJNNTYuMiwyOC41bC0yLjgtMi40Yy0wLjMtMC4zLTAuOC0wLjMtMS4xLDBMNTAuNiwyOGwzLjksMy41bDEuNi0xLjlDNTYuNSwyOS4zLDU2LjUsMjguOSw1Ni4yLDI4LjV6IiBjbGFzcz0ic3QwIi8+Ci'+\n\t\t\t'A8L2c+Cjwvc3ZnPgo=';\n\t\tme._ht_url_image_1__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\tel.ggId=\"ht_url_image_1\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 32px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 32px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_url_image_1.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_url_image_1.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.hotspot.customimage != \"\"))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._ht_url_image_1.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._ht_url_image_1.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._ht_url_image_1.style[domTransition]='';\n\t\t\t\tif (me._ht_url_image_1.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._ht_url_image_1.style.visibility=\"hidden\";\n\t\t\t\t\tme._ht_url_image_1.ggVisible=false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._ht_url_image_1.style.visibility=(Number(me._ht_url_image_1.style.opacity)>0||!me._ht_url_image_1.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._ht_url_image_1.ggVisible=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_url_image_1.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t}\n\t\tme._ht_form.appendChild(me._ht_url_image_1);\n\t\tel=me._tt_ht_url_1=document.createElement('div');\n\t\tels=me._tt_ht_url_1__text=document.createElement('div');\n\t\tel.className='ggskin ggskin_textdiv';\n\t\tel.ggTextDiv=els;\n\t\tel.ggId=\"tt_ht_url_1\";\n\t\tel.ggDx=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_text \";\n\t\tel.ggType='text';\n\t\ths ='';\n\t\ths+='z-index: 100;';\n\t\ths+='height : 20px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 24px;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 100px;';\n\t\ths+='pointer-events:none;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\ths ='position:absolute;';\n\t\ths += 'box-sizing: border-box;';\n\t\ths+='cursor: default;';\n\t\ths+='left: 0px;';\n\t\ths+='top: 0px;';\n\t\ths+='width: auto;';\n\t\ths+='height: auto;';\n\t\ths+='pointer-events: none;';\n\t\ths+='background: #000000;';\n\t\ths+='background: rgba(0,0,0,0.666667);';\n\t\ths+='border: 0px solid #000000;';\n\t\ths+='color: rgba(255,255,255,1);';\n\t\ths+='text-align: center;';\n\t\ths+='white-space: nowrap;';\n\t\ths+='padding: 2px 5px 2px 5px;';\n\t\ths+='overflow: hidden;';\n\t\tels.setAttribute('style',hs);\n\t\tels.innerHTML=me.hotspot.title;\n\t\tel.appendChild(els);\n\t\tme._tt_ht_url_1.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._tt_ht_url_1.logicBlock_position = function() {\n\t\t\tvar newLogicStatePosition;\n\t\t\tif (\n\t\t\t\t((player.getHasTouch() == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStatePosition = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStatePosition = -1;\n\t\t\t}\n\t\t\tif (me._tt_ht_url_1.ggCurrentLogicStatePosition != newLogicStatePosition) {\n\t\t\t\tme._tt_ht_url_1.ggCurrentLogicStatePosition = newLogicStatePosition;\n\t\t\t\tme._tt_ht_url_1.style[domTransition]='left 0s, top 0s';\n\t\t\t\tif (me._tt_ht_url_1.ggCurrentLogicStatePosition == 0) {\n\t\t\t\t\tthis.ggDx = 0;\n\t\t\t\t\tme._tt_ht_url_1.style.top='-47px';\n\t\t\t\t\tme._tt_ht_url_1.ggUpdatePosition(true);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._tt_ht_url_1.ggDx=0;\n\t\t\t\t\tme._tt_ht_url_1.style.top='24px';\n\t\t\t\t\tme._tt_ht_url_1.ggUpdatePosition(true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._tt_ht_url_1.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.elementMouseOver['ht_form'] == true)) && \n\t\t\t\t((me.hotspot.title != \"\"))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._tt_ht_url_1.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._tt_ht_url_1.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._tt_ht_url_1.style[domTransition]='left 0s, top 0s';\n\t\t\t\tif (me._tt_ht_url_1.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._tt_ht_url_1.style.visibility=(Number(me._tt_ht_url_1.style.opacity)>0||!me._tt_ht_url_1.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._tt_ht_url_1.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._tt_ht_url_1.style.visibility=\"hidden\";\n\t\t\t\t\tme._tt_ht_url_1.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._tt_ht_url_1.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth + 0;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t}\n\t\t\tthis.style[domTransition]='left 0';\n\t\t\tthis.ggTextDiv.style.left=((98-this.ggTextDiv.offsetWidth)/2) + 'px';\n\t\t}\n\t\tme._ht_form.appendChild(me._tt_ht_url_1);\n\t\tme.__div = me._ht_form;\n\t};\n\tfunction SkinHotspotClass_ht_pdf(parentScope,hotspot) {\n\t\tvar me=this;\n\t\tvar flag=false;\n\t\tvar hs='';\n\t\tme.parentScope=parentScope;\n\t\tme.hotspot=hotspot;\n\t\tvar nodeId=String(hotspot.url);\n\t\tnodeId=(nodeId.charAt(0)=='{')?nodeId.substr(1, nodeId.length - 2):''; // }\n\t\tme.ggUserdata=skin.player.getNodeUserdata(nodeId);\n\t\tme.elementMouseDown=[];\n\t\tme.elementMouseOver=[];\n\t\tme.findElements=function(id,regex) {\n\t\t\treturn skin.findElements(id,regex);\n\t\t}\n\t\tel=me._ht_pdf=document.createElement('div');\n\t\tel.ggId=\"ht_pdf\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_hotspot \";\n\t\tel.ggType='hotspot';\n\t\ths ='';\n\t\ths+='height : 0px;';\n\t\ths+='left : 250px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 50px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 0px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_pdf.ggIsActive=function() {\n\t\t\treturn player.getCurrentNode()==this.ggElementNodeId();\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif (me.hotspot.url!='' && me.hotspot.url.charAt(0)=='{') { // }\n\t\t\t\treturn me.hotspot.url.substr(1, me.hotspot.url.length - 2);\n\t\t\t} else {\n\t\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t\t} else {\n\t\t\t\t\treturn player.getCurrentNode();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_pdf.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('vis_userdata') == true)) || \n\t\t\t\t((player.getVariableValue('vis_image_popup') == true)) || \n\t\t\t\t((player.getVariableValue('vis_info_popup') == true)) || \n\t\t\t\t((player.getVariableValue('vis_video_popup_file') == true)) || \n\t\t\t\t((player.getVariableValue('vis_video_popup_url') == true)) || \n\t\t\t\t((player.getVariableValue('vis_video_popup_vimeo') == true)) || \n\t\t\t\t((player.getVariableValue('vis_video_popup_youtube') == true)) || \n\t\t\t\t((player.getVariableValue('vis_website') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._ht_pdf.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._ht_pdf.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._ht_pdf.style[domTransition]='';\n\t\t\t\tif (me._ht_pdf.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._ht_pdf.style.visibility=\"hidden\";\n\t\t\t\t\tme._ht_pdf.ggVisible=false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._ht_pdf.style.visibility=(Number(me._ht_pdf.style.opacity)>0||!me._ht_pdf.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._ht_pdf.ggVisible=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_pdf.onclick=function (e) {\n\t\t\tif (\n\t\t\t\t(\n\t\t\t\t\t((player.getVariableValue('opt_url') == true)) && \n\t\t\t\t\t((player.getHasTouch() == false))\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tskin._web_page.ggText=\"<iframe src=\\\"\"+me.hotspot.url+\"\\\" width=\\\"100%\\\" height=\\\"100%\\\" allowfullscreen=\\\"true\\\" mozallowfullscreen=\\\"true\\\" webkitallowfullscreen=\\\"true\\\" frameborder= \\\"0\\\"><\\/iframe>\";\n\t\t\t\tskin._web_page.ggTextDiv.innerHTML=skin._web_page.ggText;\n\t\t\t\tif (skin._web_page.ggUpdateText) {\n\t\t\t\t\tskin._web_page.ggUpdateText=function() {\n\t\t\t\t\t\tvar hs=\"<iframe src=\\\"\"+me.hotspot.url+\"\\\" width=\\\"100%\\\" height=\\\"100%\\\" allowfullscreen=\\\"true\\\" mozallowfullscreen=\\\"true\\\" webkitallowfullscreen=\\\"true\\\" frameborder= \\\"0\\\"><\\/iframe>\";\n\t\t\t\t\t\tif (hs!=this.ggText) {\n\t\t\t\t\t\t\tthis.ggText=hs;\n\t\t\t\t\t\t\tthis.ggTextDiv.innerHTML=hs;\n\t\t\t\t\t\t\tif (this.ggUpdatePosition) this.ggUpdatePosition();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (skin._web_page.ggUpdatePosition) {\n\t\t\t\t\tskin._web_page.ggUpdatePosition();\n\t\t\t\t}\n\t\t\t\tskin._web_page.ggTextDiv.scrollTop = 0;\n\t\t\t}\n\t\t\tif (\n\t\t\t\t(\n\t\t\t\t\t((player.getVariableValue('opt_url') == true)) && \n\t\t\t\t\t((player.getHasTouch() == false))\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tplayer.setVariableValue('vis_website', true);\n\t\t\t}\n\t\t\tif (\n\t\t\t\t(\n\t\t\t\t\t((player.getVariableValue('opt_url') == false)) || \n\t\t\t\t\t((player.getHasTouch() == true))\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tplayer.openUrl(me.hotspot.url,me.hotspot.target);\n\t\t\t}\n\t\t\tskin.hotspotProxyClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_pdf.ondblclick=function (e) {\n\t\t\tskin.hotspotProxyDoubleClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_pdf.onmouseover=function (e) {\n\t\t\tplayer.setActiveHotspot(me.hotspot);\n\t\t\tme.elementMouseOver['ht_pdf']=true;\n\t\t\tme._tt_ht_url_1_1.logicBlock_visible();\n\t\t\tskin.hotspotProxyOver(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_pdf.onmouseout=function (e) {\n\t\t\tplayer.setActiveHotspot(null);\n\t\t\tme.elementMouseOver['ht_pdf']=false;\n\t\t\tme._tt_ht_url_1_1.logicBlock_visible();\n\t\t\tskin.hotspotProxyOut(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_pdf.ontouchend=function (e) {\n\t\t\tme.elementMouseOver['ht_pdf']=false;\n\t\t\tme._tt_ht_url_1_1.logicBlock_visible();\n\t\t}\n\t\tme._ht_pdf.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._ht_url_image_1_1=document.createElement('div');\n\t\tels=me._ht_url_image_1_1__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA2NCA2NC43OyIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgNjQgNjQuNyIgeD0iMHB4IiB5PSIwcHgiIHhtbDpzcGFjZT0icH'+\n\t\t\t'Jlc2VydmUiPgogPHN0eWxlIHR5cGU9InRleHQvY3NzIj4mI3hkOwoJLnN0MHtmaWxsOiNGRkZGRkY7fSYjeGQ7Cjwvc3R5bGU+CiA8Y2lyY2xlIGN5PSIzMiIgcj0iMzEiIGN4PSIzMiIvPgogPGc+CiAgPHBhdGggZD0iTTIzLjksMjYuOWMxLjMsMCwyLjItMC4zLDIuOC0wLjhjMC42LTAuNSwwLjktMS40LDAuOS0yLjVjMC0xLjItMC4zLTItMC45LTIuNmMtMC42LTAuNS0xLjUtMC45LTIuOC0wLjloLTMmI3hkOyYjeGE7JiN4OTsmI3g5O3Y5LjRoMS45di0yLjZIMjMuOXogTTIyLjcsMjEuOWgxLjFjMC42LDAsMS4xLDAuMSwxLjQsMC40czAuNSwwLjYsMC41LDEuMmMwLDAuNS0wLjEsMC45LTAu'+\n\t\t\t'NCwxLjJzLTAuNywwLjQtMS4zLDAuNGgtMS4zVjIxLjl6IiBjbGFzcz0ic3QwIi8+CiAgPHBhdGggZD0iTTM1LDI4LjJjMC44LTAuOSwxLjItMiwxLjItMy41YzAtMS40LTAuNC0yLjYtMS4yLTMuNHMtMi0xLjItMy41LTEuMmgtM3Y5LjRoMi45QzMzLDI5LjUsMzQuMiwyOS4xLDM1LDI4LjJ6JiN4ZDsmI3hhOyYjeDk7JiN4OTsgTTMzLjYsMjYuOWMtMC41LDAuNS0xLjEsMC43LTIsMC43aC0xLjJ2LTUuN2gxLjFjMC45LDAsMS43LDAuMywyLjIsMC44YzAuNSwwLjUsMC43LDEuMiwwLjcsMi4xQzM0LjMsMjUuNywzNCwyNi40LDMzLjYsMjYuOXoiIGNsYXNzPSJzdDAiLz4KICA8cG9seWdvbiBwb2'+\n\t\t\t'ludHM9IjQzLjEsMjIgNDMuMSwyMC4xIDM3LjIsMjAuMSAzNy4yLDI5LjUgMzkuMSwyOS41IDM5LjEsMjUuOCA0Mi45LDI1LjggNDIuOSwyNCAzOS4xLDI0IDM5LjEsMjIgJiN4OTsiIGNsYXNzPSJzdDAiLz4KICA8cGF0aCBkPSJNNDUuNiwxMC4ySDE4LjNjLTEuNiwwLTIuOCwxLjMtMi44LDIuOHYzMy40YzAsMS42LDEuMywyLjgsMi44LDIuOGg2LjNsLTAuOS0wLjlsLTAuOS0wLjloLTQuNSYjeGQ7JiN4YTsmI3g5OyYjeDk7Yy0wLjYsMC0xLjEtMC41LTEuMS0xLjFWMTMuMWMwLTAuNiwwLjUtMS4xLDEuMS0xLjFoMjcuNGMwLjYsMCwxLjEsMC41LDEuMSwxLjF2MzMuNGMwLDAuNi0wLjUsMS4x'+\n\t\t\t'LTEuMSwxLjFoLTMuOUw0MSw0OC40bC0wLjksMC45JiN4ZDsmI3hhOyYjeDk7JiN4OTtoNS42YzEuNiwwLDIuOC0xLjMsMi44LTIuOFYxMy4xQzQ4LjUsMTEuNSw0Ny4yLDEwLjIsNDUuNiwxMC4yeiIgY2xhc3M9InN0MCIvPgogIDxwb2x5Z29uIHBvaW50cz0iNDEuOSw0My45IDM2LDQzLjkgMzYsMzQuMSAyNy45LDM0LjEgMjcuOSw0My44IDIyLDQzLjcgMzIuMSw1My44ICYjeDk7IiBjbGFzcz0ic3QwIi8+CiA8L2c+Cjwvc3ZnPgo=';\n\t\tme._ht_url_image_1_1__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\tel.ggId=\"ht_url_image_1_1\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 32px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 32px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_url_image_1_1.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_url_image_1_1.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.hotspot.customimage != \"\"))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._ht_url_image_1_1.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._ht_url_image_1_1.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._ht_url_image_1_1.style[domTransition]='';\n\t\t\t\tif (me._ht_url_image_1_1.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._ht_url_image_1_1.style.visibility=\"hidden\";\n\t\t\t\t\tme._ht_url_image_1_1.ggVisible=false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._ht_url_image_1_1.style.visibility=(Number(me._ht_url_image_1_1.style.opacity)>0||!me._ht_url_image_1_1.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._ht_url_image_1_1.ggVisible=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_url_image_1_1.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t}\n\t\tme._ht_pdf.appendChild(me._ht_url_image_1_1);\n\t\tel=me._tt_ht_url_1_1=document.createElement('div');\n\t\tels=me._tt_ht_url_1_1__text=document.createElement('div');\n\t\tel.className='ggskin ggskin_textdiv';\n\t\tel.ggTextDiv=els;\n\t\tel.ggId=\"tt_ht_url_1_1\";\n\t\tel.ggDx=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_text \";\n\t\tel.ggType='text';\n\t\ths ='';\n\t\ths+='z-index: 100;';\n\t\ths+='height : 20px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 24px;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 100px;';\n\t\ths+='pointer-events:none;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\ths ='position:absolute;';\n\t\ths += 'box-sizing: border-box;';\n\t\ths+='cursor: default;';\n\t\ths+='left: 0px;';\n\t\ths+='top: 0px;';\n\t\ths+='width: auto;';\n\t\ths+='height: auto;';\n\t\ths+='pointer-events: none;';\n\t\ths+='background: #000000;';\n\t\ths+='background: rgba(0,0,0,0.666667);';\n\t\ths+='border: 0px solid #000000;';\n\t\ths+='color: rgba(255,255,255,1);';\n\t\ths+='text-align: center;';\n\t\ths+='white-space: nowrap;';\n\t\ths+='padding: 2px 5px 2px 5px;';\n\t\ths+='overflow: hidden;';\n\t\tels.setAttribute('style',hs);\n\t\tels.innerHTML=me.hotspot.title;\n\t\tel.appendChild(els);\n\t\tme._tt_ht_url_1_1.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._tt_ht_url_1_1.logicBlock_position = function() {\n\t\t\tvar newLogicStatePosition;\n\t\t\tif (\n\t\t\t\t((player.getHasTouch() == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStatePosition = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStatePosition = -1;\n\t\t\t}\n\t\t\tif (me._tt_ht_url_1_1.ggCurrentLogicStatePosition != newLogicStatePosition) {\n\t\t\t\tme._tt_ht_url_1_1.ggCurrentLogicStatePosition = newLogicStatePosition;\n\t\t\t\tme._tt_ht_url_1_1.style[domTransition]='left 0s, top 0s';\n\t\t\t\tif (me._tt_ht_url_1_1.ggCurrentLogicStatePosition == 0) {\n\t\t\t\t\tthis.ggDx = 0;\n\t\t\t\t\tme._tt_ht_url_1_1.style.top='-47px';\n\t\t\t\t\tme._tt_ht_url_1_1.ggUpdatePosition(true);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._tt_ht_url_1_1.ggDx=0;\n\t\t\t\t\tme._tt_ht_url_1_1.style.top='24px';\n\t\t\t\t\tme._tt_ht_url_1_1.ggUpdatePosition(true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._tt_ht_url_1_1.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.elementMouseOver['ht_pdf'] == true)) && \n\t\t\t\t((me.hotspot.title != \"\"))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._tt_ht_url_1_1.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._tt_ht_url_1_1.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._tt_ht_url_1_1.style[domTransition]='left 0s, top 0s';\n\t\t\t\tif (me._tt_ht_url_1_1.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._tt_ht_url_1_1.style.visibility=(Number(me._tt_ht_url_1_1.style.opacity)>0||!me._tt_ht_url_1_1.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._tt_ht_url_1_1.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._tt_ht_url_1_1.style.visibility=\"hidden\";\n\t\t\t\t\tme._tt_ht_url_1_1.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._tt_ht_url_1_1.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth + 0;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t}\n\t\t\tthis.style[domTransition]='left 0';\n\t\t\tthis.ggTextDiv.style.left=((98-this.ggTextDiv.offsetWidth)/2) + 'px';\n\t\t}\n\t\tme._ht_pdf.appendChild(me._tt_ht_url_1_1);\n\t\tme.__div = me._ht_pdf;\n\t};\n\tme.addSkinHotspot=function(hotspot) {\n\t\tvar hsinst = null;\n\t\tif (hotspot.skinid=='ht_node_zoom') {\n\t\t\thotspot.skinid = 'ht_node_zoom';\n\t\t\thsinst = new SkinHotspotClass_ht_node_zoom(me, hotspot);\n\t\t\tif (!hotspotTemplates.hasOwnProperty(hotspot.skinid)) {\n\t\t\t\thotspotTemplates[hotspot.skinid] = [];\n\t\t\t}\n\t\t\thotspotTemplates[hotspot.skinid].push(hsinst);\n\t\t\tme.callChildLogicBlocksHotspot_ht_node_zoom_changenode();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_node_zoom_mouseover();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_node_zoom_varchanged_ht_ani();;\n\t\t} else\n\t\tif (hotspot.skinid=='ht_controll') {\n\t\t\thotspot.skinid = 'ht_controll';\n\t\t\thsinst = new SkinHotspotClass_ht_controll(me, hotspot);\n\t\t\tif (!hotspotTemplates.hasOwnProperty(hotspot.skinid)) {\n\t\t\t\thotspotTemplates[hotspot.skinid] = [];\n\t\t\t}\n\t\t\thotspotTemplates[hotspot.skinid].push(hsinst);\n\t\t} else\n\t\tif (hotspot.skinid=='PolyKaraf') {\n\t\t\thotspot.skinid = 'PolyKaraf';\n\t\t\thsinst = new SkinHotspotClass_polykaraf(me, hotspot);\n\t\t\tif (!hotspotTemplates.hasOwnProperty(hotspot.skinid)) {\n\t\t\t\thotspotTemplates[hotspot.skinid] = [];\n\t\t\t}\n\t\t\thotspotTemplates[hotspot.skinid].push(hsinst);\n\t\t} else\n\t\tif (hotspot.skinid=='PolyTass') {\n\t\t\thotspot.skinid = 'PolyTass';\n\t\t\thsinst = new SkinHotspotClass_polytass(me, hotspot);\n\t\t\tif (!hotspotTemplates.hasOwnProperty(hotspot.skinid)) {\n\t\t\t\thotspotTemplates[hotspot.skinid] = [];\n\t\t\t}\n\t\t\thotspotTemplates[hotspot.skinid].push(hsinst);\n\t\t} else\n\t\tif (hotspot.skinid=='ht_node_enter') {\n\t\t\thotspot.skinid = 'ht_node_enter';\n\t\t\thsinst = new SkinHotspotClass_ht_node_enter(me, hotspot);\n\t\t\tif (!hotspotTemplates.hasOwnProperty(hotspot.skinid)) {\n\t\t\t\thotspotTemplates[hotspot.skinid] = [];\n\t\t\t}\n\t\t\thotspotTemplates[hotspot.skinid].push(hsinst);\n\t\t\tme.callChildLogicBlocksHotspot_ht_node_enter_changenode();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_node_enter_mouseover();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_node_enter_varchanged_ht_ani();;\n\t\t} else\n\t\tif (hotspot.skinid=='ht_node_enter_recycle') {\n\t\t\thotspot.skinid = 'ht_node_enter_recycle';\n\t\t\thsinst = new SkinHotspotClass_ht_node_enter_recycle(me, hotspot);\n\t\t\tif (!hotspotTemplates.hasOwnProperty(hotspot.skinid)) {\n\t\t\t\thotspotTemplates[hotspot.skinid] = [];\n\t\t\t}\n\t\t\thotspotTemplates[hotspot.skinid].push(hsinst);\n\t\t\tme.callChildLogicBlocksHotspot_ht_node_enter_recycle_changenode();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_node_enter_recycle_mouseover();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_node_enter_recycle_varchanged_ht_ani();;\n\t\t} else\n\t\tif (hotspot.skinid=='ht_node_b2b') {\n\t\t\thotspot.skinid = 'ht_node_b2b';\n\t\t\thsinst = new SkinHotspotClass_ht_node_b2b(me, hotspot);\n\t\t\tif (!hotspotTemplates.hasOwnProperty(hotspot.skinid)) {\n\t\t\t\thotspotTemplates[hotspot.skinid] = [];\n\t\t\t}\n\t\t\thotspotTemplates[hotspot.skinid].push(hsinst);\n\t\t\tme.callChildLogicBlocksHotspot_ht_node_b2b_changenode();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_node_b2b_mouseover();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_node_b2b_varchanged_ht_ani();;\n\t\t} else\n\t\tif (hotspot.skinid=='ht_node_exit') {\n\t\t\thotspot.skinid = 'ht_node_exit';\n\t\t\thsinst = new SkinHotspotClass_ht_node_exit(me, hotspot);\n\t\t\tif (!hotspotTemplates.hasOwnProperty(hotspot.skinid)) {\n\t\t\t\thotspotTemplates[hotspot.skinid] = [];\n\t\t\t}\n\t\t\thotspotTemplates[hotspot.skinid].push(hsinst);\n\t\t\tme.callChildLogicBlocksHotspot_ht_node_exit_changenode();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_node_exit_mouseover();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_node_exit_varchanged_ht_ani();;\n\t\t} else\n\t\tif (hotspot.skinid=='ht_node_link') {\n\t\t\thotspot.skinid = 'ht_node_link';\n\t\t\thsinst = new SkinHotspotClass_ht_node_link(me, hotspot);\n\t\t\tif (!hotspotTemplates.hasOwnProperty(hotspot.skinid)) {\n\t\t\t\thotspotTemplates[hotspot.skinid] = [];\n\t\t\t}\n\t\t\thotspotTemplates[hotspot.skinid].push(hsinst);\n\t\t\tme.callChildLogicBlocksHotspot_ht_node_link_changenode();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_node_link_mouseover();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_node_link_varchanged_ht_ani();;\n\t\t} else\n\t\tif (hotspot.skinid=='ht_video_file') {\n\t\t\thotspot.skinid = 'ht_video_file';\n\t\t\thsinst = new SkinHotspotClass_ht_video_file(me, hotspot);\n\t\t\tif (!hotspotTemplates.hasOwnProperty(hotspot.skinid)) {\n\t\t\t\thotspotTemplates[hotspot.skinid] = [];\n\t\t\t}\n\t\t\thotspotTemplates[hotspot.skinid].push(hsinst);\n\t\t\tme.callChildLogicBlocksHotspot_ht_video_file_changenode();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_video_file_configloaded();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_video_file_mouseover();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_video_file_hastouch();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_video_file_activehotspotchanged();;\n\t\t} else\n\t\tif (hotspot.skinid=='ht_info') {\n\t\t\thotspot.skinid = 'ht_info';\n\t\t\thsinst = new SkinHotspotClass_ht_info0(me, hotspot);\n\t\t\tif (!hotspotTemplates.hasOwnProperty(hotspot.skinid)) {\n\t\t\t\thotspotTemplates[hotspot.skinid] = [];\n\t\t\t}\n\t\t\thotspotTemplates[hotspot.skinid].push(hsinst);\n\t\t\tme.callChildLogicBlocksHotspot_ht_info_changenode();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_info_configloaded();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_info_mouseover();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_info_hastouch();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_info_activehotspotchanged();;\n\t\t} else\n\t\tif (hotspot.skinid=='ht_info') {\n\t\t\thotspot.skinid = 'ht_info';\n\t\t\thsinst = new SkinHotspotClass_ht_info(me, hotspot);\n\t\t\tif (!hotspotTemplates.hasOwnProperty(hotspot.skinid)) {\n\t\t\t\thotspotTemplates[hotspot.skinid] = [];\n\t\t\t}\n\t\t\thotspotTemplates[hotspot.skinid].push(hsinst);\n\t\t\tme.callChildLogicBlocksHotspot_ht_info_changenode();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_info_configloaded();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_info_mouseover();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_info_hastouch();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_info_activehotspotchanged();;\n\t\t} else\n\t\tif (hotspot.skinid=='ht_video_youtube') {\n\t\t\thotspot.skinid = 'ht_video_youtube';\n\t\t\thsinst = new SkinHotspotClass_ht_video_youtube(me, hotspot);\n\t\t\tif (!hotspotTemplates.hasOwnProperty(hotspot.skinid)) {\n\t\t\t\thotspotTemplates[hotspot.skinid] = [];\n\t\t\t}\n\t\t\thotspotTemplates[hotspot.skinid].push(hsinst);\n\t\t\tme.callChildLogicBlocksHotspot_ht_video_youtube_changenode();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_video_youtube_configloaded();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_video_youtube_mouseover();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_video_youtube_hastouch();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_video_youtube_activehotspotchanged();;\n\t\t} else\n\t\tif (hotspot.skinid=='ht_url') {\n\t\t\thotspot.skinid = 'ht_url';\n\t\t\thsinst = new SkinHotspotClass_ht_url(me, hotspot);\n\t\t\tif (!hotspotTemplates.hasOwnProperty(hotspot.skinid)) {\n\t\t\t\thotspotTemplates[hotspot.skinid] = [];\n\t\t\t}\n\t\t\thotspotTemplates[hotspot.skinid].push(hsinst);\n\t\t\tme.callChildLogicBlocksHotspot_ht_url_sizechanged();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_url_changenode();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_url_configloaded();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_url_mouseover();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_url_hastouch();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_url_activehotspotchanged();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_url_varchanged_vis_info_popup();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_url_varchanged_vis_website();;\n\t\t} else\n\t\tif (hotspot.skinid=='ht_form') {\n\t\t\thotspot.skinid = 'ht_form';\n\t\t\thsinst = new SkinHotspotClass_ht_form(me, hotspot);\n\t\t\tif (!hotspotTemplates.hasOwnProperty(hotspot.skinid)) {\n\t\t\t\thotspotTemplates[hotspot.skinid] = [];\n\t\t\t}\n\t\t\thotspotTemplates[hotspot.skinid].push(hsinst);\n\t\t\tme.callChildLogicBlocksHotspot_ht_form_sizechanged();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_form_changenode();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_form_configloaded();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_form_mouseover();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_form_hastouch();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_form_activehotspotchanged();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_form_varchanged_vis_info_popup();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_form_varchanged_vis_website();;\n\t\t} else\n\t\t{\n\t\t\thotspot.skinid = 'ht_pdf';\n\t\t\thsinst = new SkinHotspotClass_ht_pdf(me, hotspot);\n\t\t\tif (!hotspotTemplates.hasOwnProperty(hotspot.skinid)) {\n\t\t\t\thotspotTemplates[hotspot.skinid] = [];\n\t\t\t}\n\t\t\thotspotTemplates[hotspot.skinid].push(hsinst);\n\t\t\tme.callChildLogicBlocksHotspot_ht_pdf_sizechanged();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_pdf_changenode();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_pdf_configloaded();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_pdf_mouseover();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_pdf_hastouch();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_pdf_activehotspotchanged();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_pdf_varchanged_vis_info_popup();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_pdf_varchanged_vis_website();;\n\t\t}\n\t\treturn hsinst;\n\t}\n\tme.removeSkinHotspots=function() {\n\t\tif(hotspotTemplates['ht_node_zoom']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_zoom'].length; i++) {\n\t\t\t\thotspotTemplates['ht_node_zoom'][i] = null;\n\t\t\t}\n\t\t}\n\t\tif(hotspotTemplates['ht_controll']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_controll'].length; i++) {\n\t\t\t\thotspotTemplates['ht_controll'][i] = null;\n\t\t\t}\n\t\t}\n\t\tif(hotspotTemplates['PolyKaraf']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['PolyKaraf'].length; i++) {\n\t\t\t\thotspotTemplates['PolyKaraf'][i] = null;\n\t\t\t}\n\t\t}\n\t\tif(hotspotTemplates['PolyTass']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['PolyTass'].length; i++) {\n\t\t\t\thotspotTemplates['PolyTass'][i] = null;\n\t\t\t}\n\t\t}\n\t\tif(hotspotTemplates['ht_node_enter']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_enter'].length; i++) {\n\t\t\t\thotspotTemplates['ht_node_enter'][i] = null;\n\t\t\t}\n\t\t}\n\t\tif(hotspotTemplates['ht_node_enter_recycle']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_enter_recycle'].length; i++) {\n\t\t\t\thotspotTemplates['ht_node_enter_recycle'][i] = null;\n\t\t\t}\n\t\t}\n\t\tif(hotspotTemplates['ht_node_b2b']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_b2b'].length; i++) {\n\t\t\t\thotspotTemplates['ht_node_b2b'][i] = null;\n\t\t\t}\n\t\t}\n\t\tif(hotspotTemplates['ht_node_exit']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_exit'].length; i++) {\n\t\t\t\thotspotTemplates['ht_node_exit'][i] = null;\n\t\t\t}\n\t\t}\n\t\tif(hotspotTemplates['ht_node_link']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node_link'].length; i++) {\n\t\t\t\thotspotTemplates['ht_node_link'][i] = null;\n\t\t\t}\n\t\t}\n\t\tif(hotspotTemplates['ht_video_file']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_video_file'].length; i++) {\n\t\t\t\thotspotTemplates['ht_video_file'][i] = null;\n\t\t\t}\n\t\t}\n\t\tif(hotspotTemplates['ht_info']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_info'].length; i++) {\n\t\t\t\thotspotTemplates['ht_info'][i] = null;\n\t\t\t}\n\t\t}\n\t\tif(hotspotTemplates['ht_info']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_info'].length; i++) {\n\t\t\t\thotspotTemplates['ht_info'][i] = null;\n\t\t\t}\n\t\t}\n\t\tif(hotspotTemplates['ht_video_youtube']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_video_youtube'].length; i++) {\n\t\t\t\thotspotTemplates['ht_video_youtube'][i] = null;\n\t\t\t}\n\t\t}\n\t\tif(hotspotTemplates['ht_url']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_url'].length; i++) {\n\t\t\t\thotspotTemplates['ht_url'][i] = null;\n\t\t\t}\n\t\t}\n\t\tif(hotspotTemplates['ht_form']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_form'].length; i++) {\n\t\t\t\thotspotTemplates['ht_form'][i] = null;\n\t\t\t}\n\t\t}\n\t\tif(hotspotTemplates['ht_pdf']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_pdf'].length; i++) {\n\t\t\t\thotspotTemplates['ht_pdf'][i] = null;\n\t\t\t}\n\t\t}\n\t\thotspotTemplates = [];\n\t}\n\tfunction SkinCloner_node_cloner_Class(nodeId, parentScope,ggParent,parameter) {\n\t\tvar me=this;\n\t\tvar hs='';\n\t\tme.parentScope=parentScope;\n\t\tme.ggParent=ggParent;\n\t\tme.findElements=skin.findElements;\n\t\tme.ggIndex=parameter.index;\n\t\tme.ggNodeId=nodeId;\n\t\tme.ggTitle=parameter.title;\n\t\tme.ggUserdata=skin.player.getNodeUserdata(me.ggNodeId);\n\t\tme.elementMouseDown={};\n\t\tme.elementMouseOver={};\n\t\tme.__div=document.createElement('div');\n\t\tme.__div.setAttribute('style','position: absolute;width: 140px; height: 100px; visibility: inherit; overflow: visible;');\n\t\tme.__div.style.left=parameter.left;\n\t\tme.__div.style.top=parameter.top;\n\t\tme.__div.style.width=parameter.width;\n\t\tme.__div.style.height=parameter.height;\n\t\tme.__div.ggIsActive = function() {\n\t\t\treturn player.getCurrentNode()==me.ggNodeId;\n\t\t}\n\t\tme.__div.ggElementNodeId=function() {\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tel=me._node_image_cloner=document.createElement('div');\n\t\tels=me._node_image_cloner__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_nodeimage';\n\t\tels.setAttribute('src',basePath + \"images/node_image_cloner_\" + nodeId + \".jpg\");\n\t\tel.ggNodeId=nodeId;\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels.className='ggskin ggskin_nodeimage';\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\tel.ggId=\"node_Image_cloner\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_nodeimage \";\n\t\tel.ggType='nodeimage';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 90px;';\n\t\ths+='left : 0px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 0px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 140px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._node_image_cloner.ggIsActive=function() {\n\t\t\treturn player.getCurrentNode()==this.ggElementNodeId();\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\treturn this.ggNodeId;\n\t\t}\n\t\tme._node_image_cloner.onclick=function (e) {\n\t\t\tif (\n\t\t\t\t(\n\t\t\t\t\t((me._node_image_cloner.ggIsActive() == false))\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tplayer.openNext(\"{\"+me.ggNodeId+\"}\",\"\");\n\t\t\t}\n\t\t}\n\t\tme._node_image_cloner.onmouseover=function (e) {\n\t\t\tme.elementMouseOver['node_image_cloner']=true;\n\t\t\tme._node_visited.logicBlock_bordercolor();\n\t\t}\n\t\tme._node_image_cloner.onmouseout=function (e) {\n\t\t\tme.elementMouseOver['node_image_cloner']=false;\n\t\t\tme._node_visited.logicBlock_bordercolor();\n\t\t}\n\t\tme._node_image_cloner.ontouchend=function (e) {\n\t\t\tme.elementMouseOver['node_image_cloner']=false;\n\t\t\tme._node_visited.logicBlock_bordercolor();\n\t\t}\n\t\tme._node_image_cloner.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._node_title=document.createElement('div');\n\t\tels=me._node_title__text=document.createElement('div');\n\t\tel.className='ggskin ggskin_textdiv';\n\t\tel.ggTextDiv=els;\n\t\tel.ggId=\"node_title\";\n\t\tel.ggDx=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_text \";\n\t\tel.ggType='text';\n\t\ths ='';\n\t\ths+='bottom : 1px;';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 20px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 136px;';\n\t\ths+='pointer-events:none;';\n\t\ths+='text-shadow: 1px 1px #000000;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 100%';\n\t\ths ='position:absolute;';\n\t\ths += 'box-sizing: border-box;';\n\t\ths+='left: 0px;';\n\t\ths+='bottom: 0px;';\n\t\ths+='width: 136px;';\n\t\ths+='height: auto;';\n\t\ths+='pointer-events: none;';\n\t\ths+='background: #000000;';\n\t\ths+='background: rgba(0,0,0,0.392157);';\n\t\ths+='border: 0px solid #000000;';\n\t\ths+='color: rgba(255,255,255,1);';\n\t\ths+='font-size: 12px;';\n\t\ths+='font-weight: normal;';\n\t\ths+='text-align: center;';\n\t\ths+='white-space: pre-wrap;';\n\t\ths+='padding: 2px 1px 2px 1px;';\n\t\ths+='overflow: hidden;';\n\t\tels.setAttribute('style',hs);\n\t\tels.innerHTML=me.ggUserdata.title;\n\t\tel.appendChild(els);\n\t\tme._node_title.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._node_title.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.ggUserdata.title == \"\")) || \n\t\t\t\t((player.getVariableValue('opt_thumbnail_menu_tooltip') == false))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._node_title.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._node_title.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._node_title.style[domTransition]='';\n\t\t\t\tif (me._node_title.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._node_title.style.visibility=\"hidden\";\n\t\t\t\t\tme._node_title.ggVisible=false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._node_title.style.visibility=(Number(me._node_title.style.opacity)>0||!me._node_title.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._node_title.ggVisible=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._node_title.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth + 0;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t}\n\t\t}\n\t\tme._node_image_cloner.appendChild(me._node_title);\n\t\tel=me._node_visited=document.createElement('div');\n\t\tel.ggId=\"node_visited\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_rectangle \";\n\t\tel.ggType='rectangle';\n\t\ths ='';\n\t\ths+='border : 3px solid #000000;';\n\t\ths+='cursor : default;';\n\t\ths+='height : 87px;';\n\t\ths+='left : -10000px;';\n\t\ths+='opacity : 0.8;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 135px;';\n\t\ths+='pointer-events:none;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._node_visited.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._node_visited.logicBlock_bordercolor = function() {\n\t\t\tvar newLogicStateBorderColor;\n\t\t\tif (\n\t\t\t\t((me.elementMouseOver['node_image_cloner'] == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateBorderColor = 0;\n\t\t\t}\n\t\t\telse if (\n\t\t\t\t((me._node_visited.ggIsActive() == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateBorderColor = 1;\n\t\t\t}\n\t\t\telse if (\n\t\t\t\t((player.nodeVisited(me._node_visited.ggElementNodeId()) == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateBorderColor = 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateBorderColor = -1;\n\t\t\t}\n\t\t\tif (me._node_visited.ggCurrentLogicStateBorderColor != newLogicStateBorderColor) {\n\t\t\t\tme._node_visited.ggCurrentLogicStateBorderColor = newLogicStateBorderColor;\n\t\t\t\tme._node_visited.style[domTransition]='border-color 0s';\n\t\t\t\tif (me._node_visited.ggCurrentLogicStateBorderColor == 0) {\n\t\t\t\t\tme._node_visited.style.borderColor=\"rgba(255,255,255,1)\";\n\t\t\t\t}\n\t\t\t\telse if (me._node_visited.ggCurrentLogicStateBorderColor == 1) {\n\t\t\t\t\tme._node_visited.style.borderColor=\"rgba(255,255,255,1)\";\n\t\t\t\t}\n\t\t\t\telse if (me._node_visited.ggCurrentLogicStateBorderColor == 2) {\n\t\t\t\t\tme._node_visited.style.borderColor=\"rgba(209,209,209,1)\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._node_visited.style.borderColor=\"rgba(0,0,0,1)\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._node_visited.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t}\n\t\tme._node_image_cloner.appendChild(me._node_visited);\n\t\tme.__div.appendChild(me._node_image_cloner);\n\t};\n\tme.addSkin();\n\tvar style = document.createElement('style');\n\tstyle.type = 'text/css';\n\tstyle.appendChild(document.createTextNode('.ggskin { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px;} /* unvisited link */ a:link { color: white; } /* visited link */ a:visited { color: white; } /* mouse over link */ a:hover { color: white; } /* selected link */ a:active { color: white; }'));\n\tdocument.head.appendChild(style);\n\tme._menu_background.logicBlock_alpha();\n\tme._menu_open.logicBlock_position();\n\tme._video_screentint_file.logicBlock_visible();\n\tme._video_popup_file.logicBlock_visible();\n\tme._popup_video_file.logicBlock_visible();\n\tme._video_popup_controls_file.logicBlock_visible();\n\tme._video_popup_close_file.logicBlock_visible();\n\tme._screentint_info0.logicBlock_visible();\n\tme._screentint_info.logicBlock_visible();\n\tme._information.logicBlock_visible();\n\tme._video_screentint_youtube.logicBlock_visible();\n\tme._video_popup_youtube.logicBlock_visible();\n\tme._popup_video_youtube.logicBlock_visible();\n\tme._video_popup_close_youtube.logicBlock_visible();\n\tme._screen_tint_url.logicBlock_visible();\n\tme._web_page.logicBlock_visible();\n\tme._close_url.logicBlock_visible();\n\tplayer.addListener('changenode', function(args) { me._menu_background.logicBlock_alpha();me._menu_open.logicBlock_position();me._video_screentint_file.logicBlock_visible();me._video_popup_file.logicBlock_visible();me._popup_video_file.logicBlock_visible();me._video_popup_controls_file.logicBlock_visible();me._video_popup_close_file.logicBlock_visible();me._screentint_info0.logicBlock_visible();me._screentint_info.logicBlock_visible();me._information.logicBlock_visible();me._video_screentint_youtube.logicBlock_visible();me._video_popup_youtube.logicBlock_visible();me._popup_video_youtube.logicBlock_visible();me._video_popup_close_youtube.logicBlock_visible();me._screen_tint_url.logicBlock_visible();me._web_page.logicBlock_visible();me._close_url.logicBlock_visible(); });\n\tplayer.addListener('varchanged_vis_thumbnail_menu', function(args) { me._menu_background.logicBlock_alpha();me._menu_open.logicBlock_position(); });\n\tplayer.addListener('varchanged_vis_video_file', function(args) { me._video_screentint_file.logicBlock_visible();me._video_popup_file.logicBlock_visible();me._popup_video_file.logicBlock_visible();me._video_popup_controls_file.logicBlock_visible();me._video_popup_close_file.logicBlock_visible(); });\n\tplayer.addListener('varchanged_vis_info_popup', function(args) { me._screentint_info0.logicBlock_visible();me._screentint_info.logicBlock_visible();me._information.logicBlock_visible(); });\n\tplayer.addListener('varchanged_vis_video_youtube', function(args) { me._video_screentint_youtube.logicBlock_visible();me._video_popup_youtube.logicBlock_visible();me._popup_video_youtube.logicBlock_visible();me._video_popup_close_youtube.logicBlock_visible(); });\n\tplayer.addListener('varchanged_vis_website', function(args) { me._screen_tint_url.logicBlock_visible();me._web_page.logicBlock_visible();me._close_url.logicBlock_visible(); });\n\tplayer.addListener('changenode', function(args) { me._node_cloner.callChildLogicBlocks_changenode(); });\n\tplayer.addListener('mouseover', function(args) { me._node_cloner.callChildLogicBlocks_mouseover(); });\n\tplayer.addListener('changenode', function(args) { me._node_cloner.callChildLogicBlocks_active(); });\n\tplayer.addListener('changevisitednodes', function(args) { me._node_cloner.callChildLogicBlocks_changevisitednodes(); });\n\tplayer.addListener('activehotspotchanged', function(args) { me._node_cloner.callChildLogicBlocks_activehotspotchanged(); });\n\tplayer.addListener('varchanged_opt_thumbnail_menu_tooltip', function(args) { me._node_cloner.callChildLogicBlocks_varchanged_opt_thumbnail_menu_tooltip(); });\n\tplayer.addListener('sizechanged', function(args) { me.callChildLogicBlocksHotspot_ht_url_sizechanged();me.callChildLogicBlocksHotspot_ht_form_sizechanged();me.callChildLogicBlocksHotspot_ht_pdf_sizechanged(); });\n\tplayer.addListener('changenode', function(args) { me.callChildLogicBlocksHotspot_ht_node_zoom_changenode();me.callChildLogicBlocksHotspot_ht_node_enter_changenode();me.callChildLogicBlocksHotspot_ht_node_enter_recycle_changenode();me.callChildLogicBlocksHotspot_ht_node_b2b_changenode();me.callChildLogicBlocksHotspot_ht_node_exit_changenode();me.callChildLogicBlocksHotspot_ht_node_link_changenode();me.callChildLogicBlocksHotspot_ht_video_file_changenode();me.callChildLogicBlocksHotspot_ht_info0_changenode();me.callChildLogicBlocksHotspot_ht_info_changenode();me.callChildLogicBlocksHotspot_ht_video_youtube_changenode();me.callChildLogicBlocksHotspot_ht_url_changenode();me.callChildLogicBlocksHotspot_ht_form_changenode();me.callChildLogicBlocksHotspot_ht_pdf_changenode(); });\n\tplayer.addListener('configloaded', function(args) { me.callChildLogicBlocksHotspot_ht_video_file_configloaded();me.callChildLogicBlocksHotspot_ht_info0_configloaded();me.callChildLogicBlocksHotspot_ht_info_configloaded();me.callChildLogicBlocksHotspot_ht_video_youtube_configloaded();me.callChildLogicBlocksHotspot_ht_url_configloaded();me.callChildLogicBlocksHotspot_ht_form_configloaded();me.callChildLogicBlocksHotspot_ht_pdf_configloaded(); });\n\tplayer.addListener('mouseover', function(args) { me.callChildLogicBlocksHotspot_ht_node_zoom_mouseover();me.callChildLogicBlocksHotspot_ht_node_enter_mouseover();me.callChildLogicBlocksHotspot_ht_node_enter_recycle_mouseover();me.callChildLogicBlocksHotspot_ht_node_b2b_mouseover();me.callChildLogicBlocksHotspot_ht_node_exit_mouseover();me.callChildLogicBlocksHotspot_ht_node_link_mouseover();me.callChildLogicBlocksHotspot_ht_video_file_mouseover();me.callChildLogicBlocksHotspot_ht_info0_mouseover();me.callChildLogicBlocksHotspot_ht_info_mouseover();me.callChildLogicBlocksHotspot_ht_video_youtube_mouseover();me.callChildLogicBlocksHotspot_ht_url_mouseover();me.callChildLogicBlocksHotspot_ht_form_mouseover();me.callChildLogicBlocksHotspot_ht_pdf_mouseover(); });\n\tplayer.addListener('hastouch', function(args) { me.callChildLogicBlocksHotspot_ht_video_file_hastouch();me.callChildLogicBlocksHotspot_ht_info0_hastouch();me.callChildLogicBlocksHotspot_ht_info_hastouch();me.callChildLogicBlocksHotspot_ht_video_youtube_hastouch();me.callChildLogicBlocksHotspot_ht_url_hastouch();me.callChildLogicBlocksHotspot_ht_form_hastouch();me.callChildLogicBlocksHotspot_ht_pdf_hastouch(); });\n\tplayer.addListener('activehotspotchanged', function(args) { me.callChildLogicBlocksHotspot_ht_video_file_activehotspotchanged();me.callChildLogicBlocksHotspot_ht_info0_activehotspotchanged();me.callChildLogicBlocksHotspot_ht_info_activehotspotchanged();me.callChildLogicBlocksHotspot_ht_video_youtube_activehotspotchanged();me.callChildLogicBlocksHotspot_ht_url_activehotspotchanged();me.callChildLogicBlocksHotspot_ht_form_activehotspotchanged();me.callChildLogicBlocksHotspot_ht_pdf_activehotspotchanged(); });\n\tplayer.addListener('varchanged_vis_info_popup', function(args) { me.callChildLogicBlocksHotspot_ht_url_varchanged_vis_info_popup();me.callChildLogicBlocksHotspot_ht_form_varchanged_vis_info_popup();me.callChildLogicBlocksHotspot_ht_pdf_varchanged_vis_info_popup(); });\n\tplayer.addListener('varchanged_vis_website', function(args) { me.callChildLogicBlocksHotspot_ht_url_varchanged_vis_website();me.callChildLogicBlocksHotspot_ht_form_varchanged_vis_website();me.callChildLogicBlocksHotspot_ht_pdf_varchanged_vis_website(); });\n\tplayer.addListener('varchanged_ht_ani', function(args) { me.callChildLogicBlocksHotspot_ht_node_zoom_varchanged_ht_ani();me.callChildLogicBlocksHotspot_ht_node_enter_varchanged_ht_ani();me.callChildLogicBlocksHotspot_ht_node_enter_recycle_varchanged_ht_ani();me.callChildLogicBlocksHotspot_ht_node_b2b_varchanged_ht_ani();me.callChildLogicBlocksHotspot_ht_node_exit_varchanged_ht_ani();me.callChildLogicBlocksHotspot_ht_node_link_varchanged_ht_ani(); });\n\tplayer.addListener('hotspotsremoved', function(args) { me.removeSkinHotspots(); });\n\tme.skinTimerEvent();\n}", "title": "" }, { "docid": "21601e6564dc64823146ffe3b9762fa3", "score": "0.5597738", "text": "function enableVidProps() {\r\n document.getElementById(\"cb_vid_shadowsOn\").disabled=false;\r\n document.getElementById(\"cb_vid_shadowsOn\").checked=false;\r\n document.querySelector(\"label[for='cb_vid_shadowsOn']\").style.color = \"#fff\";\r\n}", "title": "" }, { "docid": "34c78d16052cc39843ab24999a1faf0a", "score": "0.5595892", "text": "render() {\n return (\n <div>\n <div data-vjs-player> {/*这个带有属性的div目前没看到作用,可以去掉*/}\n <video ref={node => this.videoNode = node} className=\"video-js\"></video>\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "43bbaa9884d66ed9af96a259d11ecb6c", "score": "0.55921745", "text": "function onPlayerReady(event) {\nevent.target.playVideo();\n}", "title": "" }, { "docid": "027bbcda8c709e4562c9750991815822", "score": "0.55778235", "text": "function mouseOver1() {\n var video=document.getElementById(\"v001\");\n video.controls=true;\n}", "title": "" }, { "docid": "9164b97e102b24831ef18a9ac1a05e46", "score": "0.5565191", "text": "render() {\r\n return (\r\n <div data-vjs-player>\r\n <video ref={ node => this.videoNode = node } className=\"video-js\"></video>\r\n </div>\r\n )\r\n }", "title": "" }, { "docid": "89878b492a9f6e83b21eb4f9b8f127a5", "score": "0.55596733", "text": "onPlayerReady(event) {\n event.target.playVideo();\n }", "title": "" }, { "docid": "6483bb716d61301e54835818a12a9020", "score": "0.55478513", "text": "function onPlayerReady(event) {\n // event.target.playVideo();\n}", "title": "" }, { "docid": "998375522596c0b0b446430f1e37879a", "score": "0.5532959", "text": "play() {\r\n // console.log('play:', this.name)\r\n if (this.isVideo() && this._element) {\r\n this._element.play()\r\n }\r\n }", "title": "" }, { "docid": "d215ce7419e61990b9bb03678b4d2d03", "score": "0.55223113", "text": "function init() {\n const VP = document.getElementById('videoPlayer');\n const VPToggle = document.getElementById('toggleButton');\n\n VPToggle.addEventListener('click', function () {\n if (VP.paused)\n VP.play();\n else\n VP.pause();\n })\n}", "title": "" }, { "docid": "b71e6876984a82a4b4e3ff51564146a8", "score": "0.55041647", "text": "function onPlayerReady(event)\n{\n event.target.playVideo();\n}", "title": "" }, { "docid": "b71e6876984a82a4b4e3ff51564146a8", "score": "0.55041647", "text": "function onPlayerReady(event)\n{\n event.target.playVideo();\n}", "title": "" }, { "docid": "766d04f57b24f3d1f5a019412e8e132c", "score": "0.5474055", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n\n}", "title": "" }, { "docid": "46aa8a8b33db8ba7af3eb2260add4422", "score": "0.5474027", "text": "function invokeJWPlayer( pls_id, width, height, site_id, auto, pls ) {\n\tconf = {\n flashplayer: \"/scripts/Eurogamer/jwplayer/player.swf\",\n skin: \"/scripts/Eurogamer/jwplayer/skins/egskin/egskin.xml\",\n playlist: pls,\n width: width,\n height: height,\n autoStart: auto,\n stretching: 'bestfit',\n dock: true,\n plugins: {\n '../scripts/Eurogamer/jwplayer/sidemenu/sidemenu.js': {},\n '../scripts/Eurogamer/jwplayer/subtitles/subtitles.js': { margin: 10, site_id: site_id },\n '../scripts/Eurogamer/jwplayer/expand/expand.js': { site_id: site_id },\n 'hd-2': {},\n '/scripts/Eurogamer/ova-jw/swf/ova-jw.swf': {\n \"delayAdRequestUntilPlay\": true,\n \"canFireEventAPICalls\": false,\n \"ads\":{\n \"notice\": { \"textStyle\": \"smalltext\" },\n \"skipAd\": {\n \"enabled\": true,\n \"showAfterSeconds\": 5,\n \"html\": \"<p class=\\\"skipad\\\">SKIP AD</p>\",\n \"region\": {\n \"id\": \"my-new-skip-ad-button\",\n \"verticalAlign\": \"15\",\n \"horizontalAlign\": \"15\",\n \"backgroundColor\": \"#0069ff\",\n \"opacity\": 0.8,\n \"borderRadius\": 9,\n \"padding\": \"0 1 1 13\",\n \"width\": 80,\n \"height\": 20,\n \"style\": \".skipad { z-index: 30; color: #ffffff; font-weight: bold; font-size: 10px; }\"\n }\n },\n \"servers\":[\n {\n \"type\": \"OpenX\",\n \"apiAddress\": \"https://web.archive.org/web/20130607075521/http://ads.eurogamer.net/delivery/fc.php\"\n }\n ],\n \"schedule\":[\n {\n \"zone\": _ox_zones[ 'video-preroll-hd' ],\n \"position\": \"pre-roll\"\n }\n ]\n },\n \"debug\":{\n \"debugger\": \"firebug\",\n \"levels\": \"none\"\n }\n }\n }\n };\n //console.log( conf );\n\tjwplayer( \"video-\" + pls_id ).setup( conf );\n\t//setupEvents( Playlist, site_id );\n}", "title": "" }, { "docid": "7684877e6b6f1a891676f356e87f5377", "score": "0.5462393", "text": "function onPlayerReady(event) {\n\t//event.target.playVideo();\n}", "title": "" }, { "docid": "84ae760d319a8249528be413e083cfb8", "score": "0.545861", "text": "function addControls() {\n // see if we have clicktoplay\n if (vc.videoFile.videoClickToPlay) {\n // we do, show the big play button\n $(\".vjs-big-play-button\").show();\n\n } else {\n // we do not, hide the big play button\n $(\".vjs-big-play-button\").hide();\n\n // make sure we are really playing\n azurePlayer.play();\n }\n\n // see if we have captions\n if (captionsFile) {\n // we do, see if we should show captions\n if (vc.courseController.course.settings.ShowCaptions) {\n // we should, turn on the settings for video captions\n vc.courseController.course.settings.ShowVideoCaptions = true;\n\n // create the captions button\n var captionsButton = $('<button tabindex=\"0\" class=\"vjs-control apsCaptions outline-enabled-control\" role=\"button\" aria-live=\"polite\" style=\"display: inline-block;\" aria-label=\"' + launchPage.Resources.VideoPlayer_VideoCaptionsButton_Text + '\"></button>');\n var captionsText = $('<span class=\"vjs-control-text\">' + launchPage.Resources.VideoPlayer_VideoCaptionsButton_Text + '</span>');\n captionsButton.append(captionsText);\n $(\".amp-controlbaricons-right\").append(captionsButton);\n\n // add the click handler for the captions button\n captionsButton.on('click', function () {\n // toggle the caption settings\n vc.courseController.course.settings.ShowCaptions == !vc.courseController.course.settings.ShowCaptions;\n vc.courseController.course.settings.ShowVideoCaptions = !vc.courseController.course.settings.ShowVideoCaptions;\n\n if (vc.courseController.course.settings.ShowCaptions && vc.courseController.course.settings.ShowVideoCaptions) {\n launchPage.player.courseController.screenReaderAlert('Captions turned on.');\n } else {\n launchPage.player.courseController.screenReaderAlert('Captions turned off.');\n }\n\n // if captions are turned off, put an empty string in the captions box\n if (!vc.courseController.course.settings.ShowVideoCaptions) {\n launchPage.player.courseController.showCaptions(\"\");\n // $(\"#videoAlert\").text(\"captions are off\")\n // launchPage.player.courseController.screenReaderAlert('Captions turned off.');\n } else {\n // $(\"#videoAlert\").text(\"captions are on\")\n // launchPage.player.courseController.screenReaderAlert('Captions turned on.');\n }\n });\n }\n\n // we have captions so the transcript button will be enabled, remember this so we can show/hide it later with the full screen button\n vc.hasTranscriptButton = true;\n } else {\n // no captions, so we cannot auto generate a transcripe, see if we have a transcript file\n var useTranscript = vc.videoFile ? vc.videoFile.UseTranscript : false;\n\n // see if we want to use the video transcript\n if (useTranscript) {\n // we do, remember this so we can show/hide it later with the full screen button\n vc.hasTranscriptButton = true;\n } else {\n // no transcript button used, remember\n vc.hasTranscriptButton = false;\n }\n }\n\n // see if we want the transcript button\n if (vc.hasTranscriptButton) {\n // we do, create the transcript button\n var transcriptButton = $('<button tabindex=\"0\" class=\"vjs-control apsTranscript outline-enabled-control\" role=\"button\" aria-live=\"polite\" style=\"display: inline-block;\" aria-label=\"' + launchPage.Resources.VideoPlayer_TranscriptShow_Text + '\"></button>');\n var transcriptText = $('<span class=\"vjs-control-text\">' + launchPage.Resources.VideoPlayer_TranscriptShow_Text + '</span>');\n transcriptButton.append(transcriptText);\n $(\".amp-controlbaricons-right\").append(transcriptButton);\n\n // add the click handler for the transcript button\n transcriptButton.on('click', function () {\n // show video transcript dialog\n videoTranscript(true);\n //launchPage.player.courseController.screenReaderAlert('Transcript toggled');\n });\n }\n\n // create the download button\n var downloadButton = $('<button tabindex=\"0\" class=\"vjs-control apsDownload outline-enabled-control\" role=\"button\" aria-live=\"polite\" style=\"display: inline-block;\" aria-label=\"' + launchPage.Resources.VideoPlayer_Download_Text + '\"></button>');\n var downloadText = $('<span class=\"vjs-control-text\">' + launchPage.Resources.VideoPlayer_Download_Text + '</span>');\n downloadButton.append(downloadText);\n $(\".amp-controlbaricons-right\").append(downloadButton);\n\n // add the click handler for the download button\n downloadButton.on('click', function () {\n if (isMsitAzure) {\n // we do, get the rgmedia path\n if (!location.origin) { location.origin = location.protocol + \"//\" + location.hostname + (location.port ? ':' + location.port : '') }\n\n //dp - we have a to get path from courseDataService window.open(location.origin + \"/rgmedia/\" + vc.courseController.course.buildId + \"/\" + vc.videoFile.FileName);\n window.open(location.origin + vc.courseController.course.settings.AzureMediaLocation + \"/\" + vc.videoFile.FileName);\n } else\n window.open(vc.videoFile.getFilePath(vc.getDownloadableManifestItem()));\n });\n\n // hide the native volume button\n $(\".vjs-volume-menu-button\").addClass(\"vjs-hidden\").hide();\n\n \n\n //also hide the button to allow changing audio quality.\n $(\".amp-audiotracks-control\").addClass(\"vjs-hidden\").hide();\n\n //also hide the button to allow changing video quality.\n $(\".amp-quality-control\").addClass(\"vjs-hidden\").hide();\n\n\n // create the volume button\n // use aria-haspopup=\"true\" to get the screen reader to tell the user there is a popup menu\n var volumeButton = $('<button tabindex=\"0\" title=\"' + launchPage.Resources.AudioPlayer_VolumeButton_Text + '\" class=\"vjs-control apsVolume outline-enabled-control\" role=\"button\" aria-expanded=\"false\" aria-live=\"polite\" aria-haspopup=\"true\" onclick=\"handleVolumeClick()\"/>');\n\n // create the volume menu elements\n var volumeMenu = $('<div class=\"aps-volume-menu-container\"/>');\n var volumeContent = $('<div class=\"aps-volume-menu-container-content\"/>');\n var volumeSlider = $(\"<div id='volumeMenu' class='aps-volume-menu'></div>\")\n var volumeText = $('<span class=\"vjs-control-text\">' + launchPage.Resources.AudioPlayer_VolumeButton_Text + '</span>');\n volumeContent.append(volumeSlider);\n volumeContent.append(volumeText);\n volumeMenu.append(volumeContent);\n\n // create the jQuery volume slider\n volumeSlider.slider({\n orientation: \"vertical\",\n range: \"min\",\n min: 0,\n max: 100,\n value: vc.volume,\n step: 10,\n slide: function (event, ui) {\n // user is sliding the volume slider, set the volume\n //console.log(\"uivalue: \" + ui.value);\n //console.log(\"pmenuslider: \" + volumeSlider.slider(\"option\", \"value\"))\n azurePlayer.volume(ui.value / 100);\n\n // add the values to the slider handle to make the screen reader read the values\n $(this).find(\".ui-slider-handle\").attr(\"aria-valuenow\", ui.value)\n .attr(\"aria-value-min\", volumeSlider.slider(\"option\", \"min\"))\n .attr(\"aria-value-max\", volumeSlider.slider(\"option\", \"max\"))\n .attr(\"aria-valuetext\", ui.value + \" percent\")\n .attr(\"title\", launchPage.Resources.AudioPlayer_VolumeButton_Text);\n },\n create: function (event, ui) {\n // tell the screen reader that we have a slider\n // this also tells the screen reader to treat this as an application that can use arrow keys\n $(this).find(\".ui-slider-handle\").attr(\"role\", \"slider\");\n }\n });\n\n // attach the volue button to the play bar\n $(\".amp-controlbaricons-right\").append(volumeButton);\n\n // attach the volume menu to the play bar\n // the display is absolute so it will have no visual space on the playbar\n $(\".amp-controlbaricons-right\").append(volumeMenu);\n\n // called when the volume button is clicked (or user presses enter or space)\n window.handleVolumeClick = function () {\n // get the volume button\n var volumeButton = $(\".apsVolume\");\n\n // mark the volume button as an item with an expanded menu\n volumeButton.attr(\"aria-expanded\", true);\n\n // get the position of the volume button\n var position = volumeButton.position();\n\n // get the volume menu container\n var volumeMenu = $(\".aps-volume-menu-container\");\n\n // align the left side of the volume menu to the left side of the volume button\n volumeMenu.css(\"left\", position.left);\n\n // show the volume menu\n volumeMenu.show();\n\n // get the slider handle\n var sliderHandle = volumeMenu.find(\".ui-slider-handle\");\n\n // give the slider handle focus\n sliderHandle.focus();\n\n // when the slider loses focus, hide the menu\n sliderHandle.one(\"blur\", function () { hideVolumeMenu(); });\n\n // get the key up events for the slider handle\n sliderHandle.keydown(function (e) {\n // hide the menu if user hits escape key\n if (e.which == 27) {\n hideVolumeMenu();\n }\n });\n }\n\n function hideVolumeMenu() {\n //get the volume button\n var volumeButton = $(\".apsVolume\");\n\n // get the volume menu container\n var volumeMenu = $(\".aps-volume-menu-container\");\n\n // set the value of the volume button to volume NN percent\n volumeButton.attr(\"title\", launchPage.Resources.AudioPlayer_VolumeButton_Text + \" \" + volumeMenu.find(\".ui-slider-handle\").attr(\"aria-valuetext\"));\n\n // hide the volume menu\n volumeMenu.hide();\n\n // give the volume button focus\n volumeButton.focus();\n\n // mark the menu button as not expanded (popup menu closed)\n volumeButton.attr(\"aria-expanded\", false);\n }\n\n // hide the 'change quality' button since the button does not really change the quality\n $(\".amp-quality-control\").hide();\n\n //dp - fix the missing tabIndex for the speed control so that it appears in tab order\n $('.amp-playbackspeed-control').attr('tabindex', \"0\");\n //dp - change the role of playback speed button from menuitem to button so that it passes MAS - can have menuitem role and expanded=true\n $('.amp-playbackspeed-control-normal:first').attr('role', \"button\");\n\n //dp - put title's on the buttons to make the browser show a tooltip\n $(\".vjs-play-control\").attr(\"title\", $(\".vjs-control-text\", \".vjs-play-control\").text());\n // $(\".amp-playbackspeed-control\").attr(\"title\", $(\".vjs-control-text\", \".amp-playbackspeed-control\").text());\n $(\".vjs-playback-rate\").attr(\"title\", $(\".vjs-control-text\", \".vjs-playback-rate\").text());\n $(\".amp-apsdescriptions-control\").attr(\"title\", $(\".vjs-control-text\", \".amp-apsdescriptions-control\").text());\n $(\".amp-audiotracks-control\").attr(\"title\", $(\".vjs-control-text\", \".amp-audiotracks-control\").text());\n $(\".vjs-subtitles-button\").attr(\"title\", $(\".vjs-control-text\", \".vjs-subtitles-button\").text());\n $(\".apsCaptions\").attr(\"title\", $(\".vjs-control-text\", \".apsCaptions\").text());\n $(\".amp-quality-control\").attr(\"title\", $(\".vjs-control-text\", \".amp-quality-control\").text());\n $(\".amp-moreoptions-control\").attr(\"title\", $(\".vjs-control-text\", \".amp-moreoptions-control\").text());\n //$(\".vjs-volume-menu-button\").attr(\"title\", $(\".vjs-control-text\", \".vjs-volume-menu-button\").text());\n $(\".vjs-fullscreen-control\").attr(\"title\", $(\".vjs-control-text\", \".vjs-fullscreen-control\").text());\n $(\".apsTranscript\").attr(\"title\", \"Toggle between contents and transcript\"); //hard coding a custom string to toggle between contents and transcript\n $(\".apsDownload\").attr(\"title\", $(\".vjs-control-text\", \".apsDownload\").text());\n $(\".amp-apsdescriptions-control\").attr(\"title\", \"Toggle audio descriptions\")//$(\".vjs-control-text\", \".amp-apsdescriptions-control\").text()); //there seems to be no text for description controls\n $(\".amp-playbackspeed-control-normal:first\").attr(\"title\", $(\".amp-menu-header\", \".amp-playbackspeed-control-normal:first\").text());\n // chapter button already has the title set - do not change here\n\n //the amp player doesn't outline the play button first time, and also doesn't show the control bar when play gets focus. That's what these do.\n $(\"[title='Play']\").on('focus', function () { $(\"[title='Play']\").addClass('outline-enabled-control'); azurePlayer.userActive(true); })\n\n\n\n\n}", "title": "" }, { "docid": "a5f30443ca79f64079589f656e74dd67", "score": "0.5449765", "text": "mount() {\n const el = this.el();\n el.className = \"vjs-control vjs-button vjs-customer-button vjs-play\";\n ReactDOM.render(<Play vjsComponent={this} />, el);\n }", "title": "" }, { "docid": "1aede405b2d3b78e40f6274b71b81793", "score": "0.54441655", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n }", "title": "" }, { "docid": "cd1d493de7ef04ac1e43fa9dada12d00", "score": "0.5440775", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n}", "title": "" }, { "docid": "88d17019164c0506c201a745c319d640", "score": "0.5439166", "text": "enable(player) {\n this.enabled = player;\n }", "title": "" }, { "docid": "7e084a416518bd4f09bd5a8388eacf43", "score": "0.54368883", "text": "function onPlayerReady(event) {\r\n event.target.playVideo();\r\n}", "title": "" }, { "docid": "420c704aa02cc58cf96f4018560ce90b", "score": "0.5431496", "text": "function videoButtons(){\n if(videoPlaying == true){\n // Pause video\n video.pause();\n // Change play pause button to play icon\n play.setAttribute(\"class\", \"videoButtonsVisiabilityShow\");\n videoPlaying = false;\n }else{\n // Play video\n video.play();\n // Change play pause button to pause icon\n play.setAttribute(\"class\", \"videoButtonsVisabilityHidden\");\n videoPlaying = true;\n }\n}", "title": "" }, { "docid": "5dbb034e70450f937c24081537405109", "score": "0.54274535", "text": "function onPlayerReady(event) {\n //event.target.playVideo();\n }", "title": "" }, { "docid": "5dbb034e70450f937c24081537405109", "score": "0.54274535", "text": "function onPlayerReady(event) {\n //event.target.playVideo();\n }", "title": "" }, { "docid": "edc293234d0316e8816cb47c0fe517f5", "score": "0.54203856", "text": "function playPauseVideo(slick, control){\n let currentSlide, player;\n\n currentSlide = slick.find(\".slick-current\");\n player = currentSlide.find(\"iframe\").get(0);\n\n switch (control) {\n case \"play\":\n postMessageToPlayer(player, {\n \"event\": \"command\",\n \"func\": \"mute\"\n });\n postMessageToPlayer(player, {\n \"event\": \"command\",\n \"func\": \"playVideo\"\n });\n break;\n case \"pause\":\n postMessageToPlayer(player, {\n \"event\": \"command\",\n \"func\": \"pauseVideo\"\n });\n break;\n }\n }", "title": "" }, { "docid": "d125280f045f9e3e98147656ceb4ac4a", "score": "0.5418227", "text": "function videoDirectEmbed(){\n \tif(isMobile.any()) {\n \t\twindow.location.href = videoURL;\n \t}else {\n\t fullScreenVideoContainer2.fadeToggle();\n\t //alert(videoURL);\n\t var aspect;\n\t if(clicked.hasClass('241')) {\n\t \taspect = '2.4:1';\n\t }else {\n\t \taspect = '16:9';\n\t }\n\n\t jwplayer(\"jwvid\").setup({\n\t file: videoURL,\n\t aspectratio: aspect,\n\t width:'80%'\n\t });\n\n\t };\n\t }", "title": "" }, { "docid": "d1c44bbc00d592d8030af29fadcb9a96", "score": "0.54133725", "text": "setStopVideo() {\n const text = `<i class = \"fa fa-video\"></i>`\n document.getElementById('playPauseVideo').innerHTML = text;\n document.getElementById('playPauseVideo').setAttribute(\"title\", \"Pause Video\")\n }", "title": "" }, { "docid": "46d0714ad4ed9997467061dec0bcc7bf", "score": "0.53794104", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n }", "title": "" }, { "docid": "46d0714ad4ed9997467061dec0bcc7bf", "score": "0.53794104", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n }", "title": "" }, { "docid": "f9d784b4392dc9212a6f846eba47532c", "score": "0.53772235", "text": "function togglePlayback()\n{\n if(togglePlaybackBtn.innerHTML === \"pause\")\n {\n VPAID.pause();\n return;\n }\n VPAID.play();\n}", "title": "" }, { "docid": "d1c764c48816ec72a89f1b3003d994a6", "score": "0.5365258", "text": "function enablePlayer() {\n playerControlsDiv.style.display = 'block';\n}", "title": "" }, { "docid": "db4f8975ad01506e543e4ff9f45fb999", "score": "0.5359755", "text": "render() {\n return (\n <div data-vjs-player className=\"vjs-fluid video\">\n <video ref={ node => this.videoNode = node } className=\"video-js\"></video>\n </div>\n );\n }", "title": "" }, { "docid": "581864db0b6bbc7f1af2cfe7ea601ce6", "score": "0.535252", "text": "function enablePlay() {\n window.pauseState = \"play\"\n}", "title": "" }, { "docid": "95e6e5df693a29984056b0559440aa70", "score": "0.5352396", "text": "function onPlayerReady(event) {\r\n event.target.playVideo();\r\n}", "title": "" }, { "docid": "1eced9e7a756394d5ab761028faa6fe1", "score": "0.53499097", "text": "setupComponent() {\n this.initImagePlaceholder();\n this.domRefPlayButton.setAttribute('aria-label', `${this.videoPlay}: ${this.videoTitle}`);\n this.setAttribute('title', `${this.videoPlay}: ${this.videoTitle}`);\n if (this.autoLoad) {\n this.initIntersectionObserver();\n }\n }", "title": "" }, { "docid": "37df666025ba2328e759e82a53d45983", "score": "0.5347215", "text": "activate() {\n // this.title = this.$title;\n this.config = {\n preload: 'none',\n sources: [\n {src: this.$sce.trustAsResourceUrl(VideoLinks.actNow), type: 'video/mp4'},\n ],\n plugins: {\n poster: '/images/video-covers/v1.jpg',\n analytics: {\n category: 'WEb ACTs videos',\n label: 'Act Now',\n events: {\n ready: true,\n play: true,\n pause: true,\n stop: true,\n complete: true,\n progress: 10\n }\n }\n }\n };\n\n this.activated = true;\n }", "title": "" }, { "docid": "23d2262c0b5c1e6766fcadbc402087e6", "score": "0.5345077", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n}", "title": "" }, { "docid": "23d2262c0b5c1e6766fcadbc402087e6", "score": "0.5345077", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n}", "title": "" }, { "docid": "23d2262c0b5c1e6766fcadbc402087e6", "score": "0.5345077", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n}", "title": "" }, { "docid": "23d2262c0b5c1e6766fcadbc402087e6", "score": "0.5345077", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n}", "title": "" }, { "docid": "23d2262c0b5c1e6766fcadbc402087e6", "score": "0.5345077", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n}", "title": "" }, { "docid": "23d2262c0b5c1e6766fcadbc402087e6", "score": "0.5345077", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n}", "title": "" }, { "docid": "5a6571c822a4f3b6a46c0c862be0d51f", "score": "0.53399724", "text": "function changePlaybackRate()\n {\n mmuVideo.playbackRate = playbackSpeedControl.value;\n \n }", "title": "" }, { "docid": "d23ec3dc07749ed4f505b945182f3898", "score": "0.531991", "text": "function onPlayerReady(event) {\t// esto es para el autoplay (ahora desactivado)\r\n //event.target.playVideo();\r\n}", "title": "" }, { "docid": "c057b5486c91512ad321c83fa616634f", "score": "0.5319694", "text": "function onPlayerReady(event) {\nevent.target.playVideo();\nconsole.log(\"start!!\");\n}", "title": "" }, { "docid": "d690516060f2ef62e71b4c5a0c4c5c0c", "score": "0.5311205", "text": "function runvideoOnPokedex(){\nwindow.onload = function myFunction() {\n var vid = document.getElementById(\"back_video\");\n vid.autoplay = true;\n vid.load;\n // vid.controls = true;\n};\n}", "title": "" }, { "docid": "8ee8ebd6cc2274bde316c87017b74433", "score": "0.5309973", "text": "function addVideo() {\n myPresentation.getCurrentSlide().addVideo(inTxt.value);\n inTxt.value = \"\";\n}", "title": "" }, { "docid": "dfedc224e6b6a3dd2484fe97b665e881", "score": "0.53056043", "text": "togglePlayPause() {\r\n if (this.isVideo() && this._element) {\r\n if (this._element.paused) {\r\n this.play()\r\n } else {\r\n this.pause()\r\n }\r\n }\r\n }", "title": "" }, { "docid": "823d5c9d306cfea416d79366e2cba6db", "score": "0.529756", "text": "static get tag() {\n return \"a11y-media-player\";\n }", "title": "" }, { "docid": "823d5c9d306cfea416d79366e2cba6db", "score": "0.529756", "text": "static get tag() {\n return \"a11y-media-player\";\n }", "title": "" }, { "docid": "87833f4a7711e998207897f85facab7a", "score": "0.5288703", "text": "showControls() {\n this._media.controls = true;\n }", "title": "" }, { "docid": "d641ca0e7e2e3b9a26f366a308a93fdf", "score": "0.5284677", "text": "_renderPlayControl(){\n if (this.state.videoPaused){\n return (\n <ViroButton\n position={[0,-0.2,-2]}\n scale={[1, 1, 1]}\n width={buttonSize}\n animation={{name: \"animationButton\", run: true }}\n height={buttonSize}\n source={require(\"./res/play.png\")}\n hoverSource={require(\"./res/play_hover.png\")}\n clickSource={require(\"./res/play_hover.png\")}\n onClick={this._togglePauseVideo}/>\n );\n } else {\n return (\n <ViroButton\n position={[0,-0.2,-2]}\n scale={[1, 1, 1]}\n width={buttonSize}\n animation={{name: \"animationButton\", run: true }}\n height={buttonSize}\n source={require(\"./res/pause.png\")}\n hoverSource={require(\"./res/pause_hover.png\")}\n clickSource={require(\"./res/pause_hover.png\")}\n onClick={this._togglePauseVideo}/>\n );\n }\n }", "title": "" }, { "docid": "19a16223bcb290aa0baf4c950e5150a6", "score": "0.52780735", "text": "function togglePlay() {\r\n video.paused ? video.play() : video.pause();\r\n toggleIcon();\r\n }", "title": "" }, { "docid": "80cdcda999a7091e651424bc7ce9ec59", "score": "0.5269066", "text": "function changeVideo(index, string) {\n\n\n videoPlayer.src([\n { type: 'video/mp4', src: './assets/res/video/' + portfolioData[index].code + string + '.mp4' },\n { type: 'video/webm', src: './assets/res/video/' + portfolioData[index].code + string + '.webm' },\n { type: 'video/ogg', src: './assets/res/video/' + portfolioData[index].code + string + '.ogg' }\n ]);\n\n videoPlayer.play();\n videoPlayer.controls(true); //show controls manually since they are hidden on reset\n\n}", "title": "" }, { "docid": "9ad99f9c63ac07118f29a88d11dbbe42", "score": "0.5267475", "text": "function updateVisibility() {\n if (player.tech_ && player.tech_['featuresVolumeControl'] === false) {\n this.addClass('vjs-hidden');\n } else {\n this.removeClass('vjs-hidden');\n }\n }", "title": "" }, { "docid": "9ad99f9c63ac07118f29a88d11dbbe42", "score": "0.5267475", "text": "function updateVisibility() {\n if (player.tech_ && player.tech_['featuresVolumeControl'] === false) {\n this.addClass('vjs-hidden');\n } else {\n this.removeClass('vjs-hidden');\n }\n }", "title": "" }, { "docid": "419fec1020fc309ae658d149372dde94", "score": "0.5264255", "text": "function setStreaming(theCheck) {\n if ($(theCheck).attr('data-isActive') == 0) {\n $(theCheck).attr('title', 'Desactivar Streaming');\n isActiveStreaming = true;\n $(theCheck).attr('data-isActive', 1);\n sessionStorage.isActiveStreaming = isActiveStreaming;\n }\n else if ($(theCheck).attr('data-isActive') == 1) {\n $(theCheck).attr('title', 'Activar Streaming');\n $(theCheck).attr('data-isActive', 0);\n isActiveStreaming = false;\n sessionStorage.isActiveStreaming = isActiveStreaming;\n }\n\n var image;\n var video;\n\n if (initParams['uriImg'] == undefined || initParams['uriImg'] == '') image = noVideoImagePath;\n else image = initParams['uriImg'];\n\n if (initParams['uriVideo'] == undefined || initParams['uriVideo'] == '') video = noVideoPath;\n else video = initParams['uriVideo'];\n\n loadPlayer(\"divMediaSpace\", isActiveStreaming, video, image, 220, 300, 0);\n jwplayer(\"divMediaSpace\").play();\n}", "title": "" }, { "docid": "18eb1930ea7aaefe709f74fe1f6ed6c9", "score": "0.5255914", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n }", "title": "" }, { "docid": "2ed8b916d614bec1904733533232aa6a", "score": "0.5255634", "text": "updateVideoAttributes() {\n if (this.video.getAttribute('muted') === '1') {\n return;\n }\n this.video.setAttribute('muted', '1');\n this.video.setAttribute('playsinline', '1');\n if (this.autoplay()) {\n this.video.setAttribute('autoplay', '1');\n }\n }", "title": "" }, { "docid": "5d65311aa0b3244323ab988d59531de2", "score": "0.5254181", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n}", "title": "" }, { "docid": "5d65311aa0b3244323ab988d59531de2", "score": "0.5254181", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n}", "title": "" }, { "docid": "5d65311aa0b3244323ab988d59531de2", "score": "0.5254181", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n}", "title": "" }, { "docid": "5d65311aa0b3244323ab988d59531de2", "score": "0.5254181", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n}", "title": "" }, { "docid": "526c70af408b5b20f668783d0f838314", "score": "0.52521104", "text": "function onPlayerReady(event) {\n // event.target.playVideo();\n }", "title": "" }, { "docid": "d4a7709ae07ffc63cc1aae9f07cf6030", "score": "0.5250298", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n }", "title": "" }, { "docid": "d4a7709ae07ffc63cc1aae9f07cf6030", "score": "0.5250298", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n }", "title": "" }, { "docid": "c9aa6b0d1692e69825965fd55d73078d", "score": "0.5248257", "text": "function setPlayerUp(sourceUrl) {\n let options = {\n controls: true,\n autoplay: false,\n preload: 'auto',\n fluid: true,\n sources: [{\n src: sourceUrl,\n type: 'video/mp4'\n }]\n };\n let p = videojs('player', options);\n p.volume(0.2);\n return p;\n\n}", "title": "" }, { "docid": "c2669cd4421907c169e59c6b79ad513f", "score": "0.5233378", "text": "function onPlayerReady(event) {\n // event.target.playVideo();\n const urlParams = new URLSearchParams(window.location.search);\n const skim_value = urlParams.get(\"start_skim\");\n if (skim_value != null) {\n console.log(\"skim value\");\n console.log(skim_value);\n player.seekTo(skim_value, true);\n }\n }", "title": "" }, { "docid": "d76e3b116be98ee070559bab12908fba", "score": "0.52295405", "text": "function addCustomPlayer(baseUrl, videoUrl, type) {\n if (type == \"rtmp\") {\n $f(\"h4xx0r\", \"http://bubach.net/swf/flowplayer-3.2.18.swf\", {\n clip: { url: videoUrl, scaling: 'fit', provider: 'hddn' },\n plugins: { hddn: { url: \"http://bubach.net/swf/flowplayer.rtmp-3.2.13.swf\", netConnectionUrl: baseUrl } },\n canvas: {backgroundGradient: 'none'}\n });\n }\n if (type == \"hls\") {\n $f(\"h4xx0r\", \"http://bubach.net/swf/flowplayer-3.2.18.swf\", {\n plugins: { httpstreaming: { url: \"http://bubach.net/swf/flashlsFlowPlayer-0.4.0.7.swf\", hls_startfromlevel: 1}},\n clip: { url: videoUrl, scaling: 'fit', urlResolvers: [\"httpstreaming\",\"brselect\"], provider: \"httpstreaming\"},\n canvas: {backgroundGradient: 'none'}\n });\n }\n}", "title": "" }, { "docid": "20253650def906fe4a255fc2124a61aa", "score": "0.5227957", "text": "function showVideoHint(arr) {\n const song = arr[index];\n videoHint.innerHTML = `<video id=\"video-player\" controls width=\"250\" autoplay>\n<source src=${song.linktovideoclip}\n type=\"video/mp4\">\nSorry, your browser doesn't support embedded videos.\n</video>`;\n}", "title": "" }, { "docid": "a275fa3e03aa542585cec160cdfe9170", "score": "0.522713", "text": "function updateVisibility() {\n if (player.tech_ && player.tech_.featuresVolumeControl === false) {\n this.addClass('vjs-hidden');\n } else {\n this.removeClass('vjs-hidden');\n }\n }", "title": "" }, { "docid": "a275fa3e03aa542585cec160cdfe9170", "score": "0.522713", "text": "function updateVisibility() {\n if (player.tech_ && player.tech_.featuresVolumeControl === false) {\n this.addClass('vjs-hidden');\n } else {\n this.removeClass('vjs-hidden');\n }\n }", "title": "" }, { "docid": "a275fa3e03aa542585cec160cdfe9170", "score": "0.522713", "text": "function updateVisibility() {\n if (player.tech_ && player.tech_.featuresVolumeControl === false) {\n this.addClass('vjs-hidden');\n } else {\n this.removeClass('vjs-hidden');\n }\n }", "title": "" }, { "docid": "a275fa3e03aa542585cec160cdfe9170", "score": "0.522713", "text": "function updateVisibility() {\n if (player.tech_ && player.tech_.featuresVolumeControl === false) {\n this.addClass('vjs-hidden');\n } else {\n this.removeClass('vjs-hidden');\n }\n }", "title": "" }, { "docid": "6083086b1f7afc268e050ee249dfe739", "score": "0.5222109", "text": "function changeVolume(direction) {\n\tif (direction === '+') customVideoPlayer.volume += customVideoPlayer.volume == 1 ? 0 : 0.1;\n\telse customVideoPlayer.volume -= (customVideoPlayer.volume == 0 ? 0 : 0.1);\n\tcustomVideoPlayer.volume = parseFloat(customVideoPlayer.volume).toFixed(1);\n\tvolume.innerText = customVideoPlayer.volume * 10;\n\n}", "title": "" }, { "docid": "e10455b76a8e676e6d24d406dfbcbffd", "score": "0.52215624", "text": "function RunQuickView()\r\n{\r\n if(isQuickView)\r\n {\r\n isQuickView = false;\r\n Video.setAttribute(\"controls\",\"\");\r\n document.getElementById(\"BannerTop\").children[1].children[7].children[0].innerHTML = \"FALSE\";\r\n Video.pause();\r\n }\r\n else\r\n {\r\n isQuickView = true;\r\n document.getElementById(\"BannerTop\").children[1].children[7].children[0].innerHTML = \"TRUE\";\r\n Video.pause()\r\n }\r\n}", "title": "" }, { "docid": "3e9b905e24b78302cde4b878eb8ae85f", "score": "0.5216746", "text": "function playVideo() {\n var video = document.getElementById('pbVideo');\n \n if(video){\n video.play();\n }\n }", "title": "" }, { "docid": "afb9ba23e99aa5516525640d3ab84f7f", "score": "0.5210969", "text": "function WDVideoMediaPlayerWK(oChampVideo, oParamVideo)\n{\n\t// Si on est pas dans l'init d'un protoype\n\tif (oChampVideo)\n\t{\n\t\t// Appel le constructeur de la classe de base\n\t\tWDVideoMediaPlayerIE.prototype.constructor.apply(this, [oChampVideo, oParamVideo]);\n\n\t\t// Init specifique\n\t}\n}", "title": "" }, { "docid": "5a83476d60b287d4a6788c44a903a2f9", "score": "0.5203235", "text": "render() {\n const boxStyle = {\n width: '100%',\n height: '100%'\n }\n return (\n <div data-vjs-player style={boxStyle} ref={el => this.playerCtnr = el}>\n <video ref={ node => this.videoNode = node } className=\"video-js\"></video>\n </div>\n )\n }", "title": "" }, { "docid": "1ba1d4ae7cf1e58c5d612e28e8d58410", "score": "0.520149", "text": "function onPlayerReady (event) {\n\tevent.target.playVideo();\n}", "title": "" }, { "docid": "5863d902b18c702ebabc2cea81c136a2", "score": "0.51986796", "text": "function WN188924() {\n\n var wnWidgetId_673;\n if (wnWidgetId_673 == undefined) wnWidgetId_673 = \"188924\";\n\n var WNVideoCanvas673 = new WNVideoWidget(\"WNVideoCanvas\", \"divWNVideoCanvas673\");\n WNVideoCanvas673.SetStylePackage(\"dark\");\n WNVideoCanvas673.SetVariable(\"widgetId\", wnWidgetId_673);\n WNVideoCanvas673.SetVariable(\"addThisDivId\", \"divWNImageCanvas673_addThis\");\n WNVideoCanvas673.SetVariable(\"incanvasAdDivId\", \"divWNImageCanvas673_adDiv\");\n WNVideoCanvas673.SetVariable(\"helpPage\", \"http://www.rfdtv.com/story/4925699/player-help\");\n WNVideoCanvas673.SetVariable(\"isMute\", \"false\");\n WNVideoCanvas673.SetVariable(\"isAutoStart\", \"false\");\n WNVideoCanvas673.SetSkin(CANVAS_SKINS.flat.silver);\n WNVideoCanvas673.SetVariable(\"toolsShareButtons\", \"link,share\");\n WNVideoCanvas673.SetVariable(\"overlayShareButtons\", \"link,share\");\n WNVideoCanvas673.SetWidth(520);\n WNVideoCanvas673.SetHeight(290);\n WNVideoCanvas673.RenderWidget();\n\n var WNGallery673 = new WNVideoWidget(\"WNGallery\", \"divWNGallery673\");\n WNGallery673.SetStylePackage(\"dark\");\n WNGallery673.SetVariable(\"widgetId\", wnWidgetId_673);\n WNGallery673.SetVariable(\"addThisDivId\", \"divWNImageCanvas673_addThis\");\n WNGallery673.SetVariable(\"incanvasAdDivId\", \"divWNImageCanvas673_adDiv\");\n WNGallery673.SetVariable(\"isContinuousPlay\", \"false\");\n WNGallery673.SetVariable(\"hasSearch\", \"false\");\n WNGallery673.SetVariable(\"topVideoCatNo\", \"317627\");\n WNGallery673.SetWidth(1);\n WNGallery673.SetHeight(1);\n WNGallery673.RenderWidget();\n\n}", "title": "" }, { "docid": "48c4c96a92f012a3ff1474e5e9269478", "score": "0.5196211", "text": "switch_on() {\n // Get camera media stream and set on player <video>\n navigator.mediaDevices.getUserMedia({\n video: { width: this.width, height: this.height },\n audio: false\n }).then(stream => {\n this.video_node.srcObject = this.stream = stream\n })\n }", "title": "" }, { "docid": "5d9dbe1f19652c1e98d8cdc146f41397", "score": "0.5194734", "text": "function enableAutoPlay() {\n if(autoPlay) {\n allowSlideSwitch = true;\n startAutoPlay();\n }\n }", "title": "" }, { "docid": "31d3297b137a92a6f4e215a617e2df46", "score": "0.51908684", "text": "get enabled() {\n const { config, player } = this;\n return config.enabled && player.editor.enabled && player.isHTML5 && player.isVideo;\n }", "title": "" }, { "docid": "a7ceb8676857ba93dc42a6d6c986010f", "score": "0.51878315", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n \n }", "title": "" }, { "docid": "58fae438d2dd179af7a71109079ba3e1", "score": "0.51871777", "text": "function HalloweenSongEnabled(flag) {\n\tif (ready) {\n\t\tvar halloweenSongElement = document.getElementById('HalloweenTheme');\n\t\tif(flag == 'true'){\n\t\t\tconsole.log(\"Halloween Theme\")\n\t\t\thalloweenSongElement.play();\n\t\t}else{\n\t\t\thalloweenSongElement.pause();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d28bd21e7376f621b2c7b5d6bdabee61", "score": "0.5187072", "text": "function initialize () {\r\n player.playVideo(); \r\n}", "title": "" }, { "docid": "a23ab0903bf63af4828479964f51f026", "score": "0.5181529", "text": "function updateButtons() {\n for (let index in localStream.getVideoTracks()) {\n vidButton.innerText = localStream.getVideoTracks()[index].enabled\n ? \"Video Enabled\"\n : \"Video Disabled\";\n }\n for (let index in localStream.getAudioTracks()) {\n muteButton.innerText = localStream.getAudioTracks()[index].enabled\n ? \"Unmuted\"\n : \"Muted\";\n }\n}", "title": "" }, { "docid": "27c0fd37e5e96672917393f4815f5c43", "score": "0.51776856", "text": "function onPlayerReady(event) {\n player.playVideo();\n}", "title": "" } ]
8b3caffe3ba3bbebcd5405d0a3184d76
translate page to SVG coordinate
[ { "docid": "6ad05fed4c7f094a5486e9251cd70d1b", "score": "0.6320841", "text": "function svgPoint(element, x, y) {\n const svg = document.querySelector(\"svg\");\n const pt = svg.createSVGPoint();\n\n pt.x = x;\n pt.y = y;\n\n return pt.matrixTransform(element.getScreenCTM().inverse());\n}", "title": "" } ]
[ { "docid": "203e02400d95f5c9d75a3b9cf5c0ccd5", "score": "0.78892404", "text": "function convertToSVGCoordinateSpace(svgPage,x,y)\n{\n\tvar svgPointForConversion = svgPage.createSVGPoint();\n\tsvgPointForConversion.x = x;\n\tsvgPointForConversion.y = y;\n\tvar transformed = svgPointForConversion.matrixTransform(svgPage.getScreenCTM().inverse());\n\treturn transformed;\n}", "title": "" }, { "docid": "bd6e45e2ba507d41646f67832018671c", "score": "0.6932988", "text": "function translateScreen2SvgCoordinates(element, x, y) {\n const pt = element.createSVGPoint()\n pt.x = x\n pt.y = y\n return pt.matrixTransform(svg.getScreenCTM().inverse())\n}", "title": "" }, { "docid": "3b3cf7d8382ca052d3f14b46f73dd2f7", "score": "0.6738658", "text": "function oMousePosSVG(e) {\n let p = svg.createSVGPoint();\n p.x = e.clientX;\n p.y = e.clientY;\n let ctm = svg.getScreenCTM().inverse();\n p = p.matrixTransform(ctm);\n return p;\n }", "title": "" }, { "docid": "669bcf398816a36e32186ff08ece9d8f", "score": "0.6502417", "text": "function translateSVG() {\n var viewBoxLeft = document.querySelector(\"svg.leaflet-zoom-animated\").viewBox.animVal.x;\n var viewBoxTop = document.querySelector(\"svg.leaflet-zoom-animated\").viewBox.animVal.y;\n // Reszing width and height incase of window resize\n svg.attr(\"width\", window.innerWidth)\n svg.attr(\"height\", window.innerHeight)\n // Adding the ViewBox attribute to our SVG to contain it\n svg.attr(\"viewBox\", function() {\n return \"\" + viewBoxLeft + \" \" + viewBoxTop + \" \" + window.innerWidth + \" \" + window.innerHeight;\n });\n // Adding the style attribute to our SVG to translate it\n svg.attr(\"style\", function() {\n return \"transform: translate3d(\" + viewBoxLeft + \"px, \" + viewBoxTop + \"px, 0px);\";\n });\n}", "title": "" }, { "docid": "e3854910a20f55e3226b1fbeb6153576", "score": "0.6423224", "text": "getViewPoint(x, y) {\n const view = this.viewbox._groups[0][0];\n const svg = this.map;\n const pt = svg.nativeElement.createSVGPoint();\n pt.x = x, pt.y = y;\n return pt.matrixTransform(view.getScreenCTM().inverse());\n }", "title": "" }, { "docid": "a281417d87a41773beff33edc7fdaf9f", "score": "0.6358279", "text": "function translateScreenCoordinates(event) {\n const svgP = translateScreen2SvgCoordinates(svg, event.clientX, event.clientY)\n return {\n // svg coordinates\n svgX: Math.round(svgP.x),\n svgY: Math.round(svgP.y),\n // cartesian coordinates\n cartesianX: Math.round(svgP.x),\n cartesianY: -Math.round(svgP.y),\n }\n}", "title": "" }, { "docid": "62da5606dd96838ff8b53bf076ebcba8", "score": "0.63212186", "text": "getSVGTransform() {\n const { x, y, width, height } = this.playingField, projectedCenter = this.projection.forward(this.center), flipFactor = this.projection.hasCoordinates ? -1 : 1, scaleX = this.getScale(), scaleY = scaleX * flipFactor, translateX = x + width / 2 - projectedCenter[0] * scaleX, translateY = y + height / 2 - projectedCenter[1] * scaleY;\n return { scaleX, scaleY, translateX, translateY };\n }", "title": "" }, { "docid": "60749992311fc03fe0778cb822a92f9b", "score": "0.6317433", "text": "function setSvgFrame() {\r\n var param = getArgs();\r\n // normalise coordinates\r\n var dX = -mapInfo.Bounds[0];\r\n var dY = -mapInfo.Bounds[1];\r\n mapInfo.Bounds[2] += dX;\r\n mapInfo.Bounds[3] += dY;\r\n mapInfo.Bounds[0] = 0;\r\n mapInfo.Bounds[1] = 0;\r\n mapInfo.X=(param.x ? parseInt(param.x) + dX : (mapInfo.Bounds[2] - mapInfo.Bounds[0]) / 2);\r\n mapInfo.Y=(param.y ? parseInt(param.y) + dY : (mapInfo.Bounds[3] - mapInfo.Bounds[1]) / 2);\r\n mapInfo.Highlight = (param.highlight ? param.highlight==\"true\" : false);\r\n}", "title": "" }, { "docid": "67a5d214a809dd1678be88a83d80880c", "score": "0.6307706", "text": "function XY(x,y)\r\n{\r\n \tvar pnt = domSVG.createSVGPoint();\r\n\tpnt.x = x\r\n\tpnt.y = y\r\n\tvar sCTM = domSVG.getScreenCTM();\r\n\tvar PNT = pnt.matrixTransform(sCTM.inverse());\r\n \treturn {x:PNT.x,y:PNT.y}\r\n}", "title": "" }, { "docid": "ad9c26319baafe183210d9398fe322a5", "score": "0.6204767", "text": "function svgPointToDocument(point, svgContainer) {\n try {\n var bbox = svgContainer.getBoundingClientRect();\n return {\n \"x\": point.x + bbox.left,\n \"y\": point.y + bbox.top\n };\n } catch (e) {\n return point;\n }\n }", "title": "" }, { "docid": "1eb02663f86a5dc675126ae78698bc38", "score": "0.6126933", "text": "function graphingOnSVG() {\n document.getElementById(\"graphing-position\").setAttribute(\"cx\", box.x);\n const x = box.x - 299;\n\n document.getElementById(\"graphing-position\").setAttribute(\"cy\", 280 - ((physics.k / 2) * x * x) / 50 / 50);\n }", "title": "" }, { "docid": "62ddf9381fc84ea00f8d1c5e175e6e17", "score": "0.6087715", "text": "function documentPointToSvg(point, svgContainer, cssScale) {\n try {\n var bbox = svgContainer.getBoundingClientRect();\n\n if (!_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"isNumber\"](cssScale)) {\n cssScale = 1;\n }\n\n return {\n \"x\": (point.x - bbox.left) / cssScale,\n \"y\": (point.y - bbox.top) / cssScale\n };\n } catch (e) {\n return point;\n }\n }", "title": "" }, { "docid": "76833cc7db459c57c7462cc8f3b594b6", "score": "0.6048465", "text": "function pointFromUCS(obj, x, y) {\n var point = obj.ownerSVGElement.createSVGPoint();\n point.x = x;\n point.y = y;\n var utm = obj.getTransformToElement(obj.ownerSVGElement);\n var ipoint = point.matrixTransform(utm.inverse());\n return [ipoint.x, ipoint.y];\n}", "title": "" }, { "docid": "ff77c587316ee4c4d0692e54d2a82273", "score": "0.6038009", "text": "function getTranslateXY() {\n var style = window.getComputedStyle(mapMarker);\n var matrix = new WebKitCSSMatrix(style.webkitTransform);\n console.log(matrix);\n var translate = {\n x: +matrix.e,\n y: +matrix.f\n };\n return translate;\n }", "title": "" }, { "docid": "93cc979584e5c60a19d8f23f287c4e63", "score": "0.6030249", "text": "function svgPointToDocument(point, svgContainer) {\r\n try {\r\n var bbox = svgContainer.getBoundingClientRect();\r\n return {\r\n \"x\": point.x + bbox.left,\r\n \"y\": point.y + bbox.top\r\n };\r\n }\r\n catch (e) {\r\n return point;\r\n }\r\n}", "title": "" }, { "docid": "96ebda7bd0c2a2609c0d4324ca3caade", "score": "0.5987826", "text": "get svgOffset () {\n const left = this.svg.node().getBoundingClientRect().left - this._container.getBoundingClientRect().left\n const top = this.svg.node().getBoundingClientRect().top - this._container.getBoundingClientRect().top\n return {left, top}\n }", "title": "" }, { "docid": "6650fc64da0c2aaedb8ea1eb514b1425", "score": "0.59454244", "text": "function documentPointToSvg(point, svgContainer, cssScale) {\r\n try {\r\n var bbox = svgContainer.getBoundingClientRect();\r\n if (!_utils_Type__WEBPACK_IMPORTED_MODULE_3__.isNumber(cssScale)) {\r\n cssScale = 1;\r\n }\r\n return {\r\n \"x\": (point.x - bbox.left) / cssScale,\r\n \"y\": (point.y - bbox.top) / cssScale\r\n };\r\n }\r\n catch (e) {\r\n return point;\r\n }\r\n}", "title": "" }, { "docid": "557e81f8e5bf3c2e8f7e44eee5d8fdea", "score": "0.58892286", "text": "pointToNativePdf(page, point) {\n let bounds = this.getActualBounds(page, true);\n point.x += bounds.x;\n point.y = this.pageSettings.height - (point.y);\n return point;\n }", "title": "" }, { "docid": "557e81f8e5bf3c2e8f7e44eee5d8fdea", "score": "0.58892286", "text": "pointToNativePdf(page, point) {\n let bounds = this.getActualBounds(page, true);\n point.x += bounds.x;\n point.y = this.pageSettings.height - (point.y);\n return point;\n }", "title": "" }, { "docid": "879f8aa1ce09864a2bfc1e0960f5a7b9", "score": "0.58656114", "text": "set_svg_transform(parent, polygons) {\n let min_x = 99999;\n let max_x = -99999;\n let min_y = 99999;\n let max_y = -99999;\n\n // Return { x,y,cx,cy,w,h } for an html DOM element (for us often SVG)\n function get_box(element) {\n //console.log('box called with element', element);\n var bbox = element.getBBox();\n var cx = bbox.x + bbox.width / 2;\n var cy = bbox.y + bbox.height / 2;\n //console.log('box bbox=', bbox);\n return {\n x: bbox.x,\n y: bbox.y,\n cx: cx,\n cy: cy,\n w: bbox.width,\n h: bbox.height\n };\n }\n\n polygons.forEach(function (polygon) {\n // Get bounding box of floor polygon\n let box = get_box(polygon);\n // Update max width, height found so far\n if (box.x < min_x) min_x = box.x;\n if (box.x + box.w > max_x) max_x = box.x + box.w;\n if (box.y < min_y) min_y = box.y;\n if (box.y + box.h > max_y) max_y = box.y + box.h;\n // console.log(\"box\", box);\n });\n\n // calculate appropriate scale for svg\n let w = parent.page_floor_svg.clientWidth;\n let h = parent.page_floor_svg.clientHeight;\n\n let x_scale = w / (max_x - min_x);\n let y_scale = h / (max_y - min_y);\n // Set the svg scale to fit either x or y\n let svg_scale = x_scale < y_scale ? x_scale : y_scale;\n // parent.svg_scale = svg_scale;\n\n // x offset\n let svg_x = -min_x * svg_scale;\n let svg_y = -min_y * svg_scale;\n\n // parent.svg_transform = \"translate(\" + svg_x + \",\" + svg_y + \") \" +\n // \"scale(\" + svg_scale + \")\";\n this.base_scale = svg_scale;\n this.svg_xrange = (max_x - min_x);\n this.svg_yrange = (max_y - min_y);\n \n return {\n 'x': svg_x,\n 'y': svg_y,\n 'scale': svg_scale,\n 'transform': \"translate(\" + svg_x + \",\" + svg_y + \") \" +\n \"scale(\" + svg_scale + \")\"\n }\n }", "title": "" }, { "docid": "d450cf94d201672e70a9194a4d5f430b", "score": "0.5863414", "text": "function earthToSvg(_lon, _lat) {\n var lon = parseFloat(_lon);\n var lat = parseFloat(_lat);\n\n var tx = (lon + 180) / 360;\n var ty = 1 - (lat + 85) / 170; // Latitudes close to 90 are truncated\n\n return {\n x: tx,\n y: ty\n };\n}", "title": "" }, { "docid": "0484ea25d76249265de8f88b7d2bd9ce", "score": "0.58554804", "text": "scaleAnimaltion( ){\n let [x,y,Vwidth,Vheight] = this.svgPage.getAttribute('viewBox').split(' ').map(Number);\n const [width,height] = [this.svgPage.getAttribute('width'),this.svgPage.getAttribute('height')];\n return [x,y,Vwidth,Vheight, Math.round(width / height * 100 ) / 100, width,height];\n }", "title": "" }, { "docid": "638973812553c004aeb15e976440f047", "score": "0.58548164", "text": "static svgViewport(svg, xOffset,yOffset,width, height, scale) {\n\t\tsvg.setAttributeNS('', 'width', '' + width);\n\t\tsvg.setAttributeNS('', 'height', '' + height);\n\t\tsvg.setAttributeNS('', 'viewBox', ''+xOffset + ' ' + yOffset + ' ' + Math.round(width / scale) + ' ' +\n\t\t\tMath.round(height / scale));\n\t}", "title": "" }, { "docid": "950cec62330f16b3b0bb6a4f291ca6f3", "score": "0.5849075", "text": "function alert_coords(evt) {\n pt.x = evt.clientX;\n pt.y = evt.clientY;\n\n // The cursor point, translated into svg coordinates\n var cursorpt = pt.matrixTransform(svg.getScreenCTM().inverse());\n console.log(\"(\" + cursorpt.x + \", \" + cursorpt.y + \")\");\n}", "title": "" }, { "docid": "76d322c95f1d16a2bf83550c7f34e2ee", "score": "0.58401513", "text": "function computeCoordinates(x,y,rotatedDimension,pageIndex)\n{\n\tvar coordinatePoint = {\n\t\t\tx : x,\n\t\t\ty : y\n\t},\n\tobj = $(getElement('viewer-document-wrapper')).closest('div#viewerContainer'),\n\tchildPage = document.getElementById('udv_page_'+(pageIndex+1)),\n\tpageHeight = rotatedDimension.height,\n\tpageWidth = rotatedDimension.width,\n\tmargin = 10 * pageIndex,\n\toffsetTop = childPage.offsetTop - ((pageHeight*(scaleFactor)) + margin),\n\toffsetLeft = childPage.offsetLeft;\n\n\ty-= offsetTop - obj.scrollTop();\n\ty = y - ((pageHeight*(scaleFactor))) - ((10*pageIndex));\n\tx-= offsetLeft - obj.scrollLeft();\n\t// x = x - ((pageWidth*(scaleFactor))) - ((10*pageIndex));\n\tcoordinatePoint.x = x;\n\tcoordinatePoint.y = y;\n\treturn coordinatePoint;\n}", "title": "" }, { "docid": "b25f037ae4242ce04581c71fa1bfa6a7", "score": "0.5814376", "text": "function SVGMatrix() {\n}", "title": "" }, { "docid": "7031c554713924a95aebcbe1f1f7895a", "score": "0.5778713", "text": "function transformBBox(bbox){\n\tvar svg = document.querySelector('svg')\n\tvar transformed = {'top-left': 0, 'top-right': 0, 'bottom-left': 0, 'bottom-right': 0}\t\n\tvar pt = svg.createSVGPoint();\n\tObject.keys(transformed).forEach(function(corner, i){\n\t\tpt.y = bbox[corner.split('-')[0]];\n\t\tpt.x = bbox[corner.split('-')[1]];\n\t\ttransformed[corner] = pt.matrixTransform(svg.getScreenCTM().inverse());\n\t})\n\tvar out = {x: 0, y: 0, width: 0, height: 0}\n\tout.width = transformed['top-right']['x']-transformed['top-left']['x']\n\tout.height = transformed['bottom-left']['y']-transformed['top-left']['y']\n\tout.x = transformed['top-left']['x']\n\tout.y = transformed['top-left']['y']\n\treturn out\n}", "title": "" }, { "docid": "d54d47425e25b50867612364c7a666fb", "score": "0.5774335", "text": "function pointToUCS(obj, x, y) {\n var point = obj.ownerSVGElement.createSVGPoint();\n point.x = x;\n point.y = y;\n // We *don't* want the CTM because that includes the viewbox\n // transform of the viewport. Instead we want the transform only\n // as far as the *user* coordinate space of the owning element so\n // that our points are not affected by viewbox changes. We call\n // this the UTM: user transform matrix.\n var utm = obj.getTransformToElement(obj.ownerSVGElement);\n var npoint = point.matrixTransform(utm);\n return [npoint.x, npoint.y];\n}", "title": "" }, { "docid": "b154e840f0011c51aeab81a19a91a634", "score": "0.57370734", "text": "function updateSvgTransformAttr(window,element){if(!element.namespaceURI||-1==element.namespaceURI.indexOf(\"/svg\")){return!1}if(!(SVG_TRANSFORM_PROP in window)){window[SVG_TRANSFORM_PROP]=/Trident|MSIE|IEMobile|Edge|Android 4/i.test(window.navigator.userAgent)}return window[SVG_TRANSFORM_PROP]}", "title": "" }, { "docid": "6e353a6bad3c4cdc644efb03d9602a8c", "score": "0.5721277", "text": "function render() {\n\n console.log('Something happened')\n\n let screenWidth = svg.node().parentNode.parentNode.offsetWidth\n let screenHeight = window.innerHeight\n\n // console.log('height is', screenHeight)\n // console.log('width is', screenWidth)\n // console.log('------')\n\n // change width and height of the svg\n let newWidth = screenWidth - margin.left - margin.right\n let newHeight = screenHeight - margin.top - margin.bottom\n\n // Update your SVG\n let actualSvg = d3.select(svg.node().parentNode)\n actualSvg\n .attr('height', newHeight + margin.top + margin.bottom)\n .attr('width', newWidth + margin.left + margin.right)\n\n //xPositionScale.range([0, screenWidth])\n //yPositionScale.range([screenHeight, 0])\n\n xPositionScale.range([0, newWidth])\n yPositionScale.range([newHeight, 0])\n\n }", "title": "" }, { "docid": "2009dba60628be203d48e2a27fc9c681", "score": "0.5715081", "text": "function svgXYll(lat,lng)\r\n{\r\n\tvar latLng= new L.latLng(lat, lng)\r\n\tvar x=MyMap.latLngToLayerPoint(latLng).x\r\n\tvar y=MyMap.latLngToLayerPoint(latLng).y\r\n \treturn [x,y]\r\n\r\n}", "title": "" }, { "docid": "0856262305b8c06a880dc9160070c714", "score": "0.5697847", "text": "setMouseXY(e) {\n let pageX;\n let pageY;\n const svgRectElement = getElement$1(this.element.id + '_svg');\n if (svgRectElement && this.element) {\n const svgRect = svgRectElement.getBoundingClientRect();\n const rect = this.element.getBoundingClientRect();\n if (e.type.indexOf('touch') > -1) {\n this.isTouch = true;\n const touchArg = e;\n pageY = touchArg.changedTouches[0].clientY;\n pageX = touchArg.changedTouches[0].clientX;\n }\n else {\n this.isTouch = e.pointerType === 'touch' || e.pointerType === '2';\n pageX = e.clientX;\n pageY = e.clientY;\n }\n this.mouseY = (pageY - rect.top) - Math.max(svgRect.top - rect.top, 0);\n this.mouseX = (pageX - rect.left) - Math.max(svgRect.left - rect.left, 0);\n }\n }", "title": "" }, { "docid": "3fdb4f3af275a27b1c1ce5e2856a58be", "score": "0.56902254", "text": "function spritePointToSvg(point, sprite) {\r\n var x = point.x;\r\n var y = point.y;\r\n if (sprite) {\r\n while (_utils_Type__WEBPACK_IMPORTED_MODULE_3__.hasValue(sprite.parent)) {\r\n var angle = sprite.rotation;\r\n x += sprite.pixelPaddingLeft + sprite.ex;\r\n y += sprite.pixelPaddingTop + sprite.ey;\r\n var scale = sprite.scale;\r\n // this handles nonscaling\r\n if (sprite.group) {\r\n scale = sprite.group.scale;\r\n }\r\n var relativeX = sprite.pixelX + ((x * _utils_Math__WEBPACK_IMPORTED_MODULE_2__.cos(angle) - y * _utils_Math__WEBPACK_IMPORTED_MODULE_2__.sin(angle))) * scale;\r\n var relativeY = sprite.pixelY + ((x * _utils_Math__WEBPACK_IMPORTED_MODULE_2__.sin(angle) + y * _utils_Math__WEBPACK_IMPORTED_MODULE_2__.cos(angle))) * scale;\r\n if (sprite.dx) {\r\n relativeX += sprite.dx;\r\n }\r\n if (sprite.dy) {\r\n relativeY += sprite.dy;\r\n }\r\n x = relativeX;\r\n y = relativeY;\r\n sprite = sprite.parent;\r\n }\r\n }\r\n return { x: x, y: y };\r\n}", "title": "" }, { "docid": "0da9387f1f15f2da9f375eaf3544238d", "score": "0.5667638", "text": "function render() {\n\n console.log('Something happened')\n\n let screenWidth = svg.node().parentNode.parentNode.offsetWidth\n let screenHeight = window.innerHeight\n\n // console.log('height is', screenHeight)\n // console.log('width is', screenWidth)\n // console.log('------')\n\n // change width and height of the svg\n let newWidth = screenWidth - margin.left - margin.right\n let newHeight = screenHeight - margin.top - margin.bottom\n\n // Update your SVG\n let actualSvg = d3.select(svg.node().parentNode)\n actualSvg\n .attr('height', newHeight + margin.top + margin.bottom)\n .attr('width', newWidth + margin.left + margin.right)\n\n //xPositionScale.range([0, screenWidth])\n //yPositionScale.range([screenHeight, 0])\n\n xPositionScale.range([0, newWidth])\n yPositionScale.range([newHeight, 0])\n\n }", "title": "" }, { "docid": "4b8b60f3da74449f755dd0249c11d157", "score": "0.5667227", "text": "function getActualCoordinates(x, y){\n\t var x_percentage = -50; /*Default percentage in the translate object/element*/\n\t var y_percentage = 50;\n\t x_percentage = x_percentage + x/2; /*User inputed co-orinate percentage to put on the actual translate object/element, Ratio it down to half xy/2*/\n\t y_percentage = y_percentage + y/2;\n\t return '{\"transform\": \"translate('+x_percentage+'%, '+y_percentage+'%)\"}'; /*Returns the tranlsate css with acutual cooridnates*/\n }", "title": "" }, { "docid": "365383fcdfc85c22a0f76dfad8ce2046", "score": "0.5612282", "text": "setMouseXY(pageX, pageY) {\n if (getElement$1(this.svgId)) {\n const svgRect = getElement$1(this.svgId).getBoundingClientRect();\n const rect = this.element.getBoundingClientRect();\n this.mouseY = (pageY - rect.top) - Math.max(svgRect.top - rect.top, 0);\n this.mouseX = (pageX - rect.left) - Math.max(svgRect.left - rect.left, 0);\n }\n }", "title": "" }, { "docid": "e3d78983909282efa21e2df8c5fe7863", "score": "0.5597972", "text": "function moveSvg() {\n dx += d3.event.dx;\n dy += d3.event.dy;\n x = dx + (w /2 - w * zoomScale / 2);\n y = dy + (h /2 - h * zoomScale / 2);\n vis.attr(\"transform\", \"translate(\" + [x, y] +\") scale(\" + zoomScale + \")\");\n}", "title": "" }, { "docid": "36ef5c9170f5366b860c9bcbeb16cced", "score": "0.559327", "text": "function svg_x(node_y) {\n return (node_y - ymin) * scale;\n }", "title": "" }, { "docid": "f747cebc1b5b8d75c945b06fa93d7bb5", "score": "0.55785096", "text": "function cursorPoint(evt){\n var pt = svg.createSVGPoint();\n pt.x = evt.clientX; pt.y = evt.clientY;\n return pt.matrixTransform(svg.getScreenCTM().inverse());\n }", "title": "" }, { "docid": "cd7ae33c133ff1db4b9a99de6c7ff7bd", "score": "0.5574837", "text": "function spritePointToSvg(point, sprite) {\n var x = point.x;\n var y = point.y;\n\n if (sprite) {\n while (_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"hasValue\"](sprite.parent)) {\n var angle = sprite.rotation;\n x += sprite.pixelPaddingLeft + sprite.ex;\n y += sprite.pixelPaddingTop + sprite.ey;\n var scale = sprite.scale; // this handles nonscaling\n\n if (sprite.group) {\n scale = sprite.group.scale;\n }\n\n var relativeX = sprite.pixelX + (x * _utils_Math__WEBPACK_IMPORTED_MODULE_2__[\"cos\"](angle) - y * _utils_Math__WEBPACK_IMPORTED_MODULE_2__[\"sin\"](angle)) * scale;\n var relativeY = sprite.pixelY + (x * _utils_Math__WEBPACK_IMPORTED_MODULE_2__[\"sin\"](angle) + y * _utils_Math__WEBPACK_IMPORTED_MODULE_2__[\"cos\"](angle)) * scale;\n\n if (sprite.dx) {\n relativeX += sprite.dx;\n }\n\n if (sprite.dy) {\n relativeY += sprite.dy;\n }\n\n x = relativeX;\n y = relativeY;\n sprite = sprite.parent;\n }\n }\n\n return {\n x: x,\n y: y\n };\n }", "title": "" }, { "docid": "e6d846d5c2ca3442adad88c1c26ba6ab", "score": "0.5572229", "text": "function pageToCanvas(x, y){\n\tvar bbox = canvas.getBoundingClientRect();\n\tvar anw = new position(0,0);\n//\tanw.x = x - 20 - 7; //-7 IT WORKS----UNBELIEVABLE\n//\tanw.y = y - 20 - 7;\n\n\tanw.x = x - disPageToCancasDiv.x; //it also works\n\tanw.y = y - disPageToCancasDiv.y;\n\n\treturn anw;\n}", "title": "" }, { "docid": "cd46c4f6a892aab08fe2515ead7e6fc3", "score": "0.5549123", "text": "move(x, y) {\n this.svgBackground.move(x, y);\n this.svgText.attr({ x, y });\n }", "title": "" }, { "docid": "68a5e7e42909748f2c0294780547311f", "score": "0.5514107", "text": "function trackTransforms(ctx){\n var svg = document.createElementNS(\"http://www.w3.org/2000/svg\",'svg');\n var xform = svg.createSVGMatrix();\n ctx.getTransform = function(){\n return xform;\n };\n\n var savedTransforms = [];\n var save = ctx.save;\n ctx.save = function(){\n savedTransforms.push(xform.translate(0,0));\n return save.call(ctx);\n };\n var restore = ctx.restore;\n ctx.restore = function(){\n xform = savedTransforms.pop();\n return restore.call(ctx);\n };\n\n var scale = ctx.scale;\n ctx.scale = function(sx,sy){\n xform = xform.scaleNonUniform(sx,sy);\n return scale.call(ctx,sx,sy);\n };\n var rotate = ctx.rotate;\n ctx.rotate = function(radians){\n xform = xform.rotate(radians*180/Math.PI);\n return rotate.call(ctx,radians);\n };\n var translate = ctx.translate;\n ctx.translate = function(dx,dy){\n xform = xform.translate(dx,dy);\n return translate.call(ctx,dx,dy);\n };\n var transform = ctx.transform;\n ctx.transform = function(a,b,c,d,e,f){\n var m2 = svg.createSVGMatrix();\n m2.a=a;\n m2.b=b;\n m2.c=c;\n m2.d=d;\n m2.e=e;\n m2.f=f;\n xform = xform.multiply(m2);\n return transform.call(ctx,a,b,c,d,e,f);\n };\n var setTransform = ctx.setTransform;\n ctx.setTransform = function(a,b,c,d,e,f){\n xform.a = a;\n xform.b = b;\n xform.c = c;\n xform.d = d;\n xform.e = e;\n xform.f = f;\n return setTransform.call(ctx,a,b,c,d,e,f);\n };\n var pt = svg.createSVGPoint();\n ctx.transformedPoint = function(x,y){\n pt.x=x;\n pt.y=y;\n return pt.matrixTransform(xform.inverse());\n }\n}", "title": "" }, { "docid": "bdf6f82333b631cb31cef1d710e03c8d", "score": "0.5506564", "text": "initializeGraphics(page) {\n let oPage = page;\n let gr = new GetResourceEventHandler(this.page);\n this.pdfGraphics = new PdfGraphics(page.size, gr, this.content);\n this.pdfGraphics.mediaBoxUpperRightBound = 0;\n if (oPage != null) {\n let sc = oPage.section.parent;\n if (sc != null) {\n this.pdfGraphics.colorSpace = sc.document.colorSpace;\n this.colorSpace = sc.document.colorSpace;\n }\n }\n // Transform coordinates to the left/top and activate margins.\n let isSame = (this.sign(page.origin.y) === this.sign(page.origin.x));\n // if (page != null) {\n if (page.origin.x >= 0 && page.origin.y >= 0 || !(isSame)) {\n this.pdfGraphics.initializeCoordinates();\n }\n else {\n // this.m_graphics.InitializeCoordinates(page);\n }\n let clipRect = oPage.section.getActualBounds(oPage, true);\n let margins = oPage.section.pageSettings.margins;\n if (this.clipPageTemplates) {\n if (page.origin.x >= 0 && page.origin.y >= 0) {\n this.pdfGraphics.clipTranslateMargins(clipRect);\n }\n }\n else {\n this.graphics.clipTranslateMargins(clipRect.x, clipRect.y, margins.left, margins.top, margins.right, margins.bottom);\n }\n this.pdfGraphics.setLayer(this);\n // this.bSaved = false;\n }", "title": "" }, { "docid": "bdf6f82333b631cb31cef1d710e03c8d", "score": "0.5506564", "text": "initializeGraphics(page) {\n let oPage = page;\n let gr = new GetResourceEventHandler(this.page);\n this.pdfGraphics = new PdfGraphics(page.size, gr, this.content);\n this.pdfGraphics.mediaBoxUpperRightBound = 0;\n if (oPage != null) {\n let sc = oPage.section.parent;\n if (sc != null) {\n this.pdfGraphics.colorSpace = sc.document.colorSpace;\n this.colorSpace = sc.document.colorSpace;\n }\n }\n // Transform coordinates to the left/top and activate margins.\n let isSame = (this.sign(page.origin.y) === this.sign(page.origin.x));\n // if (page != null) {\n if (page.origin.x >= 0 && page.origin.y >= 0 || !(isSame)) {\n this.pdfGraphics.initializeCoordinates();\n }\n else {\n // this.m_graphics.InitializeCoordinates(page);\n }\n let clipRect = oPage.section.getActualBounds(oPage, true);\n let margins = oPage.section.pageSettings.margins;\n if (this.clipPageTemplates) {\n if (page.origin.x >= 0 && page.origin.y >= 0) {\n this.pdfGraphics.clipTranslateMargins(clipRect);\n }\n }\n else {\n this.graphics.clipTranslateMargins(clipRect.x, clipRect.y, margins.left, margins.top, margins.right, margins.bottom);\n }\n this.pdfGraphics.setLayer(this);\n // this.bSaved = false;\n }", "title": "" }, { "docid": "545a0d2af58729db46edf543123cd556", "score": "0.549754", "text": "function getElementPosition(element) {\n var svg = element.parentElement;\n var parentRect = svg.getBoundingClientRect();\n var elementRect = element.getBoundingClientRect();\n var x = elementRect.left - parentRect.left;\n var y = elementRect.top - parentRect.top;\n var p = {\n x: x,\n y: y\n };\n return p;\n }", "title": "" }, { "docid": "f594be0a075b973acd243cb3f9a730d5", "score": "0.5488509", "text": "function trackTransforms(ctx){\n var svg = document.createElementNS(\"http://www.w3.org/2000/svg\",'svg');\n var xform = svg.createSVGMatrix();\n ctx.getTransform = function(){ return xform; };\n\n var savedTransforms = [];\n var save = ctx.save;\n ctx.save = function(){\n savedTransforms.push(xform.translate(0,0));\n return save.call(ctx);\n };\n var restore = ctx.restore;\n ctx.restore = function(){\n xform = savedTransforms.pop();\n return restore.call(ctx);\n };\n\n var scale = ctx.scale;\n ctx.scale = function(sx,sy){\n xform = xform.scaleNonUniform(sx,sy);\n return scale.call(ctx,sx,sy);\n };\n var rotate = ctx.rotate;\n ctx.rotate = function(radians){\n xform = xform.rotate(radians*180/Math.PI);\n return rotate.call(ctx,radians);\n };\n var translate = ctx.translate;\n ctx.translate = function(dx,dy){\n xform = xform.translate(dx,dy);\n return translate.call(ctx,dx,dy);\n };\n var transform = ctx.transform;\n ctx.transform = function(a,b,c,d,e,f){\n var m2 = svg.createSVGMatrix();\n m2.a=a; m2.b=b; m2.c=c; m2.d=d; m2.e=e; m2.f=f;\n xform = xform.multiply(m2);\n return transform.call(ctx,a,b,c,d,e,f);\n };\n var setTransform = ctx.setTransform;\n ctx.setTransform = function(a,b,c,d,e,f){\n xform.a = a;\n xform.b = b;\n xform.c = c;\n xform.d = d;\n xform.e = e;\n xform.f = f;\n return setTransform.call(ctx,a,b,c,d,e,f);\n };\n var pt = svg.createSVGPoint();\n ctx.transformedPoint = function(x,y){\n pt.x=x; pt.y=y;\n return pt.matrixTransform(xform.inverse());\n }\n}", "title": "" }, { "docid": "64456e34132f29d8552d7eeb11d30b32", "score": "0.54755163", "text": "function trackTransforms(context){\n var svg = document.createElementNS(\"http://www.w3.org/2000/svg\",'svg');\n var xform = svg.createSVGMatrix();\n\n context.getTransform = function(){ return xform; };\n\n var savedTransforms = [];\n var save = context.save;\n\n context.save = function(){\n savedTransforms.push(xform.translate(0,0));\n return save.call(context);\n };\n\n var restore = context.restore;\n\n context.restore = function(){\n xform = savedTransforms.pop();\n return restore.call(context);\n };\n\n var scale = context.scale;\n\n context.scale = function(sx,sy){\n xform = xform.scaleNonUniform(sx,sy);\n return scale.call(context,sx,sy);\n };\n\n var rotate = context.rotate;\n\n context.rotate = function(radians){\n xform = xform.rotate(radians*180/Math.PI);\n return rotate.call(context,radians);\n };\n\n var translate = context.translate;\n\n context.translate = function(dx,dy){\n xform = xform.translate(dx,dy);\n return translate.call(context,dx,dy);\n };\n\n var transform = context.transform;\n\n context.transform = function(a,b,c,d,e,f){\n var m2 = svg.createSVGMatrix();\n m2.a=a; m2.b=b; m2.c=c; m2.d=d; m2.e=e; m2.f=f;\n xform = xform.multiply(m2);\n return transform.call(context,a,b,c,d,e,f);\n };\n\n var setTransform = context.setTransform;\n\n context.setTransform = function(a,b,c,d,e,f){\n xform.a = a;\n xform.b = b;\n xform.c = c;\n xform.d = d;\n xform.e = e;\n xform.f = f;\n return setTransform.call(context,a,b,c,d,e,f);\n };\n\n var pt = svg.createSVGPoint();\n\n context.transformedPoint = function(x,y){\n pt.x=x; pt.y=y;\n return pt.matrixTransform(xform.inverse());\n };\n\n\n }", "title": "" }, { "docid": "3c5212c5e44755c222c2ad1eb2d630aa", "score": "0.5471712", "text": "function viewboxOffset(svg, x, y) {\n let svgRect = svg.getBoundingClientRect();\n let [vbMinX, vbMinY, vbWidth, vbHeight]\n = svg.getAttribute(\"viewBox\").split(\" \");\n x -= svgRect.x;\n y -= svgRect.y;\n x = Math.round((x*vbWidth)/svg.clientWidth);\n y = Math.round((y*vbHeight)/svg.clientHeight);\n return [x,y];\n}", "title": "" }, { "docid": "64ad833fce0835dcddfb77f0e0f06c97", "score": "0.54706514", "text": "function _pos(bounding, window, site) {\n var pos = {};\n switch (site) {\n case \"left\":\n case \"left-top\":\n case \"left-bottom\":\n pos.x = bounding.left;\n break;\n case \"right\":\n case \"right-top\":\n case \"right-bottom\":\n pos.x = bounding.right;\n break;\n default:\n pos.x = bounding.left + (bounding.right - bounding.left) / 2;\n }\n switch (site) {\n case \"top\":\n case \"left-top\":\n case \"right-top\":\n pos.y = bounding.top;\n break;\n case \"bottom\":\n case \"left-bottom\":\n case \"left-bottom\":\n pos.y = bounding.bottom;\n break;\n default:\n pos.y = bounding.top + (bounding.bottom - bounding.top) / 2;\n }\n var devicePixelRatio = _getDevicePixelRatio(window);\n pos.x = Math.round(pos.x*devicePixelRatio);\n pos.y = Math.round(pos.y*devicePixelRatio);\n return pos;\n }", "title": "" }, { "docid": "7f52e7f02c826d72be0cc783ea7911c7", "score": "0.54594517", "text": "function getSvgOffset(el) {\n return {\n left: el.get(0).getBoundingClientRect().left|0,\n top: el.get(0).getBoundingClientRect().top|0\n };\n}", "title": "" }, { "docid": "fbf2fcac7886ab9624b88ae811d30339", "score": "0.54512155", "text": "function toObjectPos (pt, obj) {\n var p = panel.createSVGPoint();\n var ctm = obj.getCTM();\n p.x = pt.x-panelBounds.x;\n p.y = pt.y-panelBounds.y;\n p = p.matrixTransform(ctm.inverse());\n return p;\n}", "title": "" }, { "docid": "80773be1db054c5f79d8720eea8fb270", "score": "0.5444692", "text": "getPageCoords(x, y) {\n const { stageWidth, stageHeight } = this.props;\n // The renderers \"nativeSize\" is the [width, height] of the stage in scratch-units\n const nativeSize = vm.renderer.getNativeSize();\n return [\n ((stageWidth / nativeSize[0]) * x) + (stageWidth / 2),\n -((stageHeight / nativeSize[1]) * y) + (stageHeight / 2)\n ];\n }", "title": "" }, { "docid": "4d17356e8323a01e2b5859a3277f578b", "score": "0.54296947", "text": "function getTransInputCoords() {\n gMeme.txts.forEach((txt, inx) => {\n let line = document.querySelector(`#line${inx + 1}`)\n let mainImg = document.querySelector('.main-img')\n txt.height = line.offsetHeight\n txt.width = line.offsetWidth\n txt.x = line.offsetLeft - mainImg.offsetLeft\n txt.y = (line.offsetTop - mainImg.offsetTop) + (txt.height) - (txt.size / (txt.size / 10))\n txt.line = line.value\n })\n}", "title": "" }, { "docid": "7285ca5c076a2ce545782fe51bc94900", "score": "0.5408716", "text": "function svg() {\n return assign(xml(), {\n id: 'svg',\n name: 'SVG',\n alias: []\n });\n}", "title": "" }, { "docid": "6c5b009f8db91ca363c86b74bc096ee3", "score": "0.5384771", "text": "function toPanelPos (pos, obj) {\n var p = panel.createSVGPoint();\n var ctm = obj.getCTM();\n p = pos.matrixTransform(ctm);\n p.x = p.x+panelBounds.x;\n p.y = p.y+panelBounds.y;\n return p;\n}", "title": "" }, { "docid": "5597718a757188bb98f23460cb821d6a", "score": "0.53830314", "text": "function trackTransforms(ctx) {\n var svg = document.createElementNS(\"http://www.w3.org/2000/svg\", 'svg');\n var xform = svg.createSVGMatrix();\n ctx.getTransform = function () { return xform; };\n\n var savedTransforms = [];\n var save = ctx.save;\n ctx.save = function () {\n savedTransforms.push(xform.translate(0, 0));\n return save.call(ctx);\n };\n\n var restore = ctx.restore;\n ctx.restore = function () {\n xform = savedTransforms.pop();\n return restore.call(ctx);\n };\n\n var scale = ctx.scale;\n ctx.scale = function (sx, sy) {\n xform = xform.scaleNonUniform(sx, sy);\n return scale.call(ctx, sx, sy);\n };\n\n var rotate = ctx.rotate;\n ctx.rotate = function (radians) {\n xform = xform.rotate(radians * 180 / Math.PI);\n return rotate.call(ctx, radians);\n };\n\n var translate = ctx.translate;\n ctx.translate = function (dx, dy) {\n xform = xform.translate(dx, dy);\n return translate.call(ctx, dx, dy);\n };\n\n var transform = ctx.transform;\n ctx.transform = function (a, b, c, d, e, f) {\n var m2 = svg.createSVGMatrix();\n m2.a = a; m2.b = b; m2.c = c; m2.d = d; m2.e = e; m2.f = f;\n xform = xform.multiply(m2);\n return transform.call(ctx, a, b, c, d, e, f);\n };\n\n var setTransform = ctx.setTransform;\n ctx.setTransform = function (a, b, c, d, e, f) {\n xform.a = a;\n xform.b = b;\n xform.c = c;\n xform.d = d;\n xform.e = e;\n xform.f = f;\n return setTransform.call(ctx, a, b, c, d, e, f);\n };\n\n var pt = svg.createSVGPoint();\n ctx.transformedPoint = function (x, y) {\n pt.x = x; pt.y = y;\n return pt.matrixTransform(xform.inverse());\n }\n}", "title": "" }, { "docid": "559fdeb618df3a8d9b159d0b2d6e0d0b", "score": "0.53828114", "text": "function SVGRect() {}", "title": "" }, { "docid": "90e606a07fb1c3de884d8dacb3c93a9d", "score": "0.5374699", "text": "function lngX(lng) {\n return lng / 360 + 0.5;\n}", "title": "" }, { "docid": "90e606a07fb1c3de884d8dacb3c93a9d", "score": "0.5374699", "text": "function lngX(lng) {\n return lng / 360 + 0.5;\n}", "title": "" }, { "docid": "90e606a07fb1c3de884d8dacb3c93a9d", "score": "0.5374699", "text": "function lngX(lng) {\n return lng / 360 + 0.5;\n}", "title": "" }, { "docid": "2f2a82880f883494414be5b86224bcb8", "score": "0.5367528", "text": "pointToNativePdf(page, point) {\n let section = page.section;\n return section.pointToNativePdf(page, point);\n }", "title": "" }, { "docid": "2f2a82880f883494414be5b86224bcb8", "score": "0.5367528", "text": "pointToNativePdf(page, point) {\n let section = page.section;\n return section.pointToNativePdf(page, point);\n }", "title": "" }, { "docid": "e13faab44c7a5d03231e322caa3ae751", "score": "0.5358178", "text": "_calculateTransform() {\n if (this.props.focusedRegion !== null) {\n let bounds = this._bounds[this.props.focusedRegion];\n let dx = bounds[1][0] - bounds[0][0];\n let dy = bounds[1][1] - bounds[0][1];\n let x = (bounds[0][0] + bounds[1][0]) / 2;\n let y = (bounds[0][1] + bounds[1][1]) / 2;\n let scale = 1 / Math.max(dx / vbWidth, dy / vbHeight);\n let translate = [vbWidth / 2 - scale * x, vbHeight / 2 - scale * y];\n return `translate(${translate[0]}, ${translate[1]})scale(${scale})`;\n }\n return \"\";\n }", "title": "" }, { "docid": "06f351c1f6b246460021c5ee83ea547a", "score": "0.5357607", "text": "static logicalToClient(svg, point) {\n\t\tvar pt = svg.createSVGPoint();\n\t\tpt.x = point.x;\n\t\tpt.y = point.y;\n\t\tvar sp = pt.matrixTransform(svg.getScreenCTM());\n\t\tif (!point['width']) {\n\t\t\treturn {\n\t\t\t\tx: sp.x,\n\t\t\t\ty: sp.y\n\t\t\t};\n\t\t}\n\t\tvar endPt = svg.createSVGPoint();\n\t\tendPt.x = pt.x + point.width;\n\t\tendPt.y = pt.y + point.height;\n\t\tvar ep = endPt.matrixTransform(svg.getScreenCTM());\n\t\treturn {\n\t\t\tx: sp.x,\n\t\t\ty: sp.y,\n\t\t\twidth: ep.x - sp.x,\n\t\t\theight: ep.y - sp.y\n\t\t};\n\t}", "title": "" }, { "docid": "9eb36dc4c5fa3dde3a0bf80d7bbf836e", "score": "0.5354962", "text": "function computeLineCoordinates(forCalculation,svgPage,rotatedDimension,pageIndex)\n{\n\tvar doc = document,\n\tdocElem = doc.documentElement,\n\tbody = document.body,\n\twin = window,\n\tclientTop = docElem.clientTop || body.clientTop || 0,\n\tclientLeft = docElem.clientLeft || body.clientLeft || 0,\n\tscrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,\n\tscrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft;\n\n\tvar corners = {};\n\tvar pt = svgPage.createSVGPoint();\n\tvar matrix = forCalculation.getScreenCTM();\n\tpt.x = forCalculation.x1.animVal.value;\n\tpt.y = forCalculation.y1.animVal.value;\n\tcorners.nw = pt.matrixTransform(matrix);\n\tcorners.nw.x += (scrollLeft - clientLeft);\t\n\tcorners.nw.y += (scrollTop - clientTop);\n\tpt.x = forCalculation.x2.animVal.value;\n\tpt.y = forCalculation.y2.animVal.value;\n\tcorners.se = pt.matrixTransform(matrix);\n\tcorners.se.x += (scrollLeft - clientLeft);\n\tcorners.se.y += (scrollTop - clientTop);\n\treturn { pt1 : computeCoordinates(corners.nw.x,corners.nw.y,rotatedDimension,pageIndex),\n\t\tpt2 : computeCoordinates(corners.se.x,corners.se.y,rotatedDimension,pageIndex)};\n}", "title": "" }, { "docid": "8e485d863bb4c3c7f7324cfcfb4319a9", "score": "0.53536505", "text": "function formatSVGText( id, txt){\n var tbox = txt.getBBox();\n var ty = Math.floor( tbox.height/2);\n var tx = Math.floor( tbox.width/2);\n var tpos = { x:100-tx, y:100+(ty/2)};\n $( '#'+id).attr( tpos);\n }", "title": "" }, { "docid": "e326143a13ad30b3ccfdc5df34edf20a", "score": "0.5349021", "text": "cursorPoint(evt, pt, svg) {\n // Create an SVGPoint for future math\n pt.x = evt.clientX; pt.y = evt.clientY;\n return pt.matrixTransform(svg.getScreenCTM().inverse());\n }", "title": "" }, { "docid": "48c0a40a4ca3a5b6c07d0ad786ef5241", "score": "0.53488207", "text": "function getTransform(x, y) {\n // Round the transforms since some browsers will\n // blur the elements for sub-pixel transforms.\n return \"translate3d(\".concat(Math.round(x), \"px, \").concat(Math.round(y), \"px, 0)\");\n }", "title": "" }, { "docid": "a1a3d779502947b6f3ee59c6fcd01b69", "score": "0.5347981", "text": "function getDocumentCoords(elem) {\n let box = elem.getBoundingClientRect();\n return {\n top: box.top + pageYOffset,\n bottom: box.bottom + pageYOffset,\n left: box.left + pageXOffset,\n right: box.right + pageXOffset\n };\n}", "title": "" }, { "docid": "a4a95a6ab11e294c588ce85ccbe61367", "score": "0.5347945", "text": "function getViewBoxTransform(element) {\n var matrix = svgRoot.createSVGMatrix();\n var vr = getViewportViewRect(element);\n \n if (vr.attrX != 0 || vr.attrY != 0)\n matrix = matrix.translate(vr.attrX, vr.attrY);\n \n var x = vr.x;\n var y = vr.y;\n var w = vr.width;\n var h = vr.height;\n var attrWidth = vr.attrWidth;\n var attrHeight = vr.attrHeight;\n\n var xRatio = 1;\n var yRatio = 1;\n\n // No div by zero errors here...\n if (w != 0)\n xRatio = attrWidth / w;\n if (h != 0)\n yRatio = attrHeight / h;\n\n var parStr = element.getAttribute(\"preserveAspectRatio\");\n var parAlign = 0;\n var parMeetOrSlice = 1;\n \n // If there is an attribute value, check it out\n if (parStr != null && parStr != \"\") {\n var parArr = parRegExp.exec(parStr);\n if (parArr.length != 2 && parArr.length != 3) {\n // Something was there but I don't know what\n parAlign = -1;\n parMeetOrSlice = -1;\n } else {\n // Handle align\n if (parArr[1] == \"none\")\n parAlign = 0;\n else if (parArr[1] == \"xMinYMin\")\n parAlign = 1;\n else if (parArr[1] == \"xMidYMin\")\n parAlign = 2;\n else if (parArr[1] == \"xMaxYMin\")\n parAlign = 3;\n else if (parArr[1] == \"xMinYMid\")\n parAlign = 4;\n else if (parArr[1] == \"xMidYMid\")\n parAlign = 5;\n else if (parArr[1] == \"xMaxYMid\")\n parAlign = 6;\n else if (parArr[1] == \"xMinYMax\")\n parAlign = 7;\n else if (parArr[1] == \"xMidYMax\")\n parAlign = 8;\n else if (parArr[1] == \"xMaxYMax\")\n parAlign = 9;\n else\n parAlign = -1;\n\n // Handle meetOrSlice\n if (parArr.length == 3) {\n if (parArr[2] == \"meet\")\n parAlign = 1;\n else if (parArr[2] == \"slice\")\n parAlign = 2;\n else\n parAlign = -1;\n }\n }\n }\n\n if (parAlign == 0)\n {\n matrix = matrix.scaleNonUniform(xRatio, yRatio);\n }\n else\n {\n // uniform scaling\n if(parMeetOrSlice == 1)\n xRatio = Math.min(xRatio, yRatio);\n else\n xRatio = Math.max(xRatio, yRatio);\n\n var x_trans = 0;\n var x_diff = attrWidth - (xRatio * w);\n var y_trans = 0;\n var y_diff = attrHeight - (xRatio * h);\n\n if(parAlign == 8 || parAlign == 5 || parAlign == 2)\n {\n // align to the Middle X\n x_trans = x_diff / 2;\n }\n else if(parAlign == 9 || parAlign == 6 || parAlign == 3)\n {\n // align to the right X\n x_trans = x_diff;\n }\n\n if(parAlign == 6 || parAlign == 5 || parAlign == 4)\n {\n // align to the middle Y\n y_trans = y_diff / 2;\n }\n else if(parAlign == 9 || parAlign == 8 || parAlign == 7)\n {\n // align to the bottom Y\n y_trans = y_diff;\n }\n\n matrix = matrix.translate(x_trans, y_trans);\n matrix = matrix.scale(xRatio);\n }\n // Translate for min-x and min-y\n matrix = matrix.translate(x, y);\n\n // Handle currentSranslate and currentScale\n if (element == svgRoot)\n {\n matrix = matrix.translate(svgRoot.currentTranslate.x, svgRoot.currentTranslate.y);\n matrix = matrix.scale(svgRoot.currentScale);\n }\n\n return matrix;\n}", "title": "" }, { "docid": "52fab895a02622a775565935e4413e3d", "score": "0.5346394", "text": "setPointMouseXY(pageX, pageY) {\n const svgClientRect = getElement$1(this.svgObject.id).getBoundingClientRect();\n const elemntClientRect = this.element.getBoundingClientRect();\n this.mouseX = (pageX - elemntClientRect.left) - Math.max(svgClientRect.left - elemntClientRect.left, 0);\n this.mouseY = (pageY - elemntClientRect.top) - Math.max(svgClientRect.top - elemntClientRect.top, 0);\n }", "title": "" }, { "docid": "3f4692b66c0b1fbd67647b1963148e5c", "score": "0.5338428", "text": "function transform(d) {\n return \"translate(\" + _x(d.lon) + \",\" + _y(d.lat) + \")\";\n}", "title": "" }, { "docid": "10886f72c6c4eaa0afeb77dff6666d7a", "score": "0.53384167", "text": "function getTransform(x, y) {\n // Round the transforms since some browsers will\n // blur the elements for sub-pixel transforms.\n return \"translate3d(\".concat(Math.round(x), \"px, \").concat(Math.round(y), \"px, 0)\");\n}", "title": "" }, { "docid": "84865c42c4be0971126ba6884d8b3da4", "score": "0.53288543", "text": "function draw() {\n function drawP(text) {\n var elem = document.createElement(\"p\");\n elem.innerText = text;\n document.getElementById(\"root\").append(elem);\n }\n drawP(\"(0,0) Note: SVG origin is top left\");\n }", "title": "" }, { "docid": "790ac2b37e26cac5380badb58d191ed2", "score": "0.5325346", "text": "function getScreenCTM(doc){\r\n if(doc.getScreenCTM) { return doc.getScreenCTM(); }\r\n \r\n var root=doc\r\n var sCTM= root.createSVGMatrix()\r\n \r\n var tr= root.createSVGMatrix()\r\n var par=root.getAttribute(\"preserveAspectRatio\")\r\n if (par==null || par==\"\") par=\"xMidYMid meet\"//setting to default value\r\n parX=par.substring(0,4) //xMin;xMid;xMax\r\n parY=par.substring(4,8)//YMin;YMid;YMax;\r\n ma=par.split(\" \")\r\n mos=ma[1] //meet;slice\r\n \r\n //get dimensions of the viewport\r\n sCTM.a= 1\r\n sCTM.d=1\r\n sCTM.e= 0\r\n sCTM.f=0\r\n \r\n \r\n w=root.getAttribute(\"width\")\r\n if (w==null || w==\"\") w=innerWidth\r\n \r\n h=root.getAttribute(\"height\")\r\n if (h==null || h==\"\") h=innerHeight\r\n \r\n // Jeff Schiller: Modified to account for percentages - I'm not \r\n // absolutely certain this is correct but it works for 100%/100%\r\n if(w.substr(w.length-1, 1) == \"%\") {\r\n w = (parseFloat(w.substr(0,w.length-1)) / 100.0) * innerWidth;\r\n }\r\n if(h.substr(h.length-1, 1) == \"%\") {\r\n h = (parseFloat(h.substr(0,h.length-1)) / 100.0) * innerHeight;\r\n }\r\n \r\n // get the ViewBox\r\n vba=root.getAttribute(\"viewBox\")\r\n if(vba==null) vba=\"0 0 \"+w+\" \"+h\r\n var vb=vba.split(\" \")//get the viewBox into an array\r\n \r\n //--------------------------------------------------------------------------\r\n //create a matrix with current user transformation\r\n tr.a= root.currentScale\r\n tr.d=root.currentScale\r\n tr.e= root.currentTranslate.x\r\n tr.f=root.currentTranslate.y\r\n \r\n \r\n //scale factors\r\n sx=w/vb[2]\r\n sy=h/vb[3]\r\n \r\n \r\n //meetOrSlice\r\n if(mos==\"slice\"){\r\n s=(sx>sy ? sx:sy)\r\n }else{\r\n s=(sx<sy ? sx:sy)\r\n }\r\n \r\n //preserveAspectRatio=\"none\"\r\n if (par==\"none\"){\r\n sCTM.a=sx//scaleX\r\n sCTM.d=sy//scaleY\r\n sCTM.e=- vb[0]*sx //translateX\r\n sCTM.f=- vb[0]*sy //translateY\r\n sCTM=tr.multiply(sCTM)//taking user transformations into acount\r\n \r\n return sCTM\r\n }\r\n \r\n \r\n sCTM.a=s //scaleX\r\n sCTM.d=s//scaleY\r\n //-------------------------------------------------------\r\n switch(parX){\r\n case \"xMid\":\r\n sCTM.e=((w-vb[2]*s)/2) - vb[0]*s //translateX\r\n \r\n break;\r\n case \"xMin\":\r\n sCTM.e=- vb[0]*s//translateX\r\n break;\r\n case \"xMax\":\r\n sCTM.e=(w-vb[2]*s)- vb[0]*s //translateX\r\n break;\r\n }\r\n //------------------------------------------------------------\r\n switch(parY){\r\n case \"YMid\":\r\n sCTM.f=(h-vb[3]*s)/2 - vb[1]*s //translateY\r\n break;\r\n case \"YMin\":\r\n sCTM.f=- vb[1]*s//translateY\r\n break;\r\n case \"YMax\":\r\n sCTM.f=(h-vb[3]*s) - vb[1]*s //translateY\r\n break;\r\n }\r\n sCTM=tr.multiply(sCTM)//taking user transformations into acount\r\n \r\n return sCTM\r\n }", "title": "" }, { "docid": "b5f2b8be79102f64bf972dc9a58b81ba", "score": "0.53212416", "text": "function trackTransforms(ctx) {\n var svg = document.createElementNS(\"http://www.w3.org/2000/svg\", 'svg');\n var xform = svg.createSVGMatrix();\n ctx.getTransform = function() {\n return xform;\n };\n\n var savedTransforms = [];\n var save = ctx.save;\n ctx.save = function() {\n savedTransforms.push(xform.translate(0, 0));\n return save.call(ctx);\n };\n\n var restore = ctx.restore;\n ctx.restore = function() {\n xform = savedTransforms.pop();\n return restore.call(ctx);\n };\n\n var scale = ctx.scale;\n ctx.scale = function(sx, sy) {\n xform = xform.scaleNonUniform(sx, sy);\n return scale.call(ctx, sx, sy);\n };\n\n var rotate = ctx.rotate;\n ctx.rotate = function(radians) {\n xform = xform.rotate(radians * 180 / Math.PI);\n return rotate.call(ctx, radians);\n };\n\n var translate = ctx.translate;\n ctx.translate = function(dx, dy) {\n xform = xform.translate(dx, dy);\n return translate.call(ctx, dx, dy);\n };\n\n var transform = ctx.transform;\n ctx.transform = function(a, b, c, d, e, f) {\n var m2 = svg.createSVGMatrix();\n m2.a = a;\n m2.b = b;\n m2.c = c;\n m2.d = d;\n m2.e = e;\n m2.f = f;\n xform = xform.multiply(m2);\n return transform.call(ctx, a, b, c, d, e, f);\n };\n\n var setTransform = ctx.setTransform;\n ctx.setTransform = function(a, b, c, d, e, f) {\n xform.a = a;\n xform.b = b;\n xform.c = c;\n xform.d = d;\n xform.e = e;\n xform.f = f;\n return setTransform.call(ctx, a, b, c, d, e, f);\n };\n\n var pt = svg.createSVGPoint();\n ctx.transformedPoint = function(x, y) {\n pt.x = x;\n pt.y = y;\n return pt.matrixTransform(xform.inverse());\n }\n}", "title": "" }, { "docid": "80bd06f4e973091c3830ceeaad91d56f", "score": "0.5320965", "text": "function zoom() {\n svg_isoform.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n}", "title": "" }, { "docid": "ee8530841a0d23eab36f93258ebaa774", "score": "0.5318592", "text": "function GetPosition(object){\n var transformlist = object.transform.baseVal;\n var group = transformlist.getItem(0);\n var X = 0;\n var Y = 0;\n if (group.type == SVGTransform.SVG_TRANSFORM_TRANSLATE){\n X = group.matrix.e;\n Y = group.matrix.f;\n }\n return [X, Y];\n }", "title": "" }, { "docid": "46dc888a4f015fd22b3659d2c0b96719", "score": "0.5309846", "text": "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "title": "" }, { "docid": "46dc888a4f015fd22b3659d2c0b96719", "score": "0.5309846", "text": "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "title": "" }, { "docid": "46dc888a4f015fd22b3659d2c0b96719", "score": "0.5309846", "text": "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "title": "" }, { "docid": "46dc888a4f015fd22b3659d2c0b96719", "score": "0.5309846", "text": "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "title": "" }, { "docid": "46dc888a4f015fd22b3659d2c0b96719", "score": "0.5309846", "text": "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "title": "" }, { "docid": "46dc888a4f015fd22b3659d2c0b96719", "score": "0.5309846", "text": "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "title": "" }, { "docid": "46dc888a4f015fd22b3659d2c0b96719", "score": "0.5309846", "text": "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "title": "" }, { "docid": "46dc888a4f015fd22b3659d2c0b96719", "score": "0.5309846", "text": "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "title": "" }, { "docid": "46dc888a4f015fd22b3659d2c0b96719", "score": "0.5309846", "text": "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "title": "" }, { "docid": "46dc888a4f015fd22b3659d2c0b96719", "score": "0.5309846", "text": "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "title": "" }, { "docid": "46dc888a4f015fd22b3659d2c0b96719", "score": "0.5309846", "text": "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "title": "" }, { "docid": "46dc888a4f015fd22b3659d2c0b96719", "score": "0.5309846", "text": "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "title": "" }, { "docid": "46dc888a4f015fd22b3659d2c0b96719", "score": "0.5309846", "text": "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "title": "" }, { "docid": "14bb89887d8a41fa5c7300e6c4c148ad", "score": "0.52983403", "text": "function trackTransforms(ctx) {\n var svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n var xform = svg.createSVGMatrix();\n ctx.getTransform = function () {\n return xform;\n };\n\n var savedTransforms = [];\n var save = ctx.save;\n ctx.save = function () {\n savedTransforms.push(xform.translate(0, 0));\n return save.call(ctx);\n };\n\n var restore = ctx.restore;\n ctx.restore = function () {\n xform = savedTransforms.pop();\n return restore.call(ctx);\n };\n\n var scale = ctx.scale;\n ctx.scale = function (sx, sy) {\n xform = xform.scaleNonUniform(sx, sy);\n return scale.call(ctx, sx, sy);\n };\n\n var rotate = ctx.rotate;\n ctx.rotate = function (radians) {\n xform = xform.rotate((radians * 180) / Math.PI);\n return rotate.call(ctx, radians);\n };\n\n var translate = ctx.translate;\n ctx.translate = function (dx, dy) {\n xform = xform.translate(dx, dy);\n return translate.call(ctx, dx, dy);\n };\n\n var transform = ctx.transform;\n ctx.transform = function (a, b, c, d, e, f) {\n var m2 = svg.createSVGMatrix();\n m2.a = a;\n m2.b = b;\n m2.c = c;\n m2.d = d;\n m2.e = e;\n m2.f = f;\n xform = xform.multiply(m2);\n return transform.call(ctx, a, b, c, d, e, f);\n };\n\n var setTransform = ctx.setTransform;\n ctx.setTransform = function (a, b, c, d, e, f) {\n xform.a = a;\n xform.b = b;\n xform.c = c;\n xform.d = d;\n xform.e = e;\n xform.f = f;\n return setTransform.call(ctx, a, b, c, d, e, f);\n };\n\n var pt = svg.createSVGPoint();\n ctx.transformedPoint = function (x, y) {\n pt.x = x;\n pt.y = y;\n return pt.matrixTransform(xform.inverse());\n };\n}", "title": "" }, { "docid": "919f05ed0249c876d358d88d28f61969", "score": "0.52920663", "text": "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }", "title": "" }, { "docid": "919f05ed0249c876d358d88d28f61969", "score": "0.52920663", "text": "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }", "title": "" }, { "docid": "919f05ed0249c876d358d88d28f61969", "score": "0.52920663", "text": "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }", "title": "" }, { "docid": "919f05ed0249c876d358d88d28f61969", "score": "0.52920663", "text": "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }", "title": "" }, { "docid": "919f05ed0249c876d358d88d28f61969", "score": "0.52920663", "text": "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }", "title": "" }, { "docid": "9c2166022142a2f34aba0bf0d7a16832", "score": "0.5286954", "text": "function spriteRectToSvg(rect, sprite) {\n var p1 = spritePointToSvg(rect, sprite);\n var p2 = spritePointToSvg({\n x: rect.x + rect.width,\n y: rect.y + rect.height\n }, sprite);\n return {\n x: p1.x,\n y: p1.y,\n width: p2.x - p1.x,\n height: p2.y - p1.y\n };\n }", "title": "" }, { "docid": "66b60e8d5d1af38de673424f88fc2e2a", "score": "0.52846456", "text": "function spritePointToDocument(point, sprite) {\r\n if (sprite && sprite.htmlContainer) {\r\n var svgPoint = spritePointToSvg(point, sprite);\r\n return svgPointToDocument(svgPoint, _utils_Type__WEBPACK_IMPORTED_MODULE_3__.getValue(sprite.htmlContainer));\r\n }\r\n else {\r\n return point;\r\n }\r\n}", "title": "" } ]
6eceb702974f794b154cc3205b341c4f
Function: Mounts the controller's request handler.
[ { "docid": "c1702092c2e47e60427d62336564e1d0", "score": "0.0", "text": "mount() {\r\n return null;\r\n }", "title": "" } ]
[ { "docid": "196b32b737d29f6c37c22b961345a329", "score": "0.7365978", "text": "_mount() {\n\t\tthis._mergeMiddleware(this._parent);\n\n\t\tthis._requestHandler = new RequestHandler(this);\n\t\tthis._parent._router[this._method](this._path, util.WrapAsyncFunction((req, res) => this._requestHandler.handle(req, res)));\n\t}", "title": "" }, { "docid": "02854e44da8cf1ce6d9d2b8fe2ccbc98", "score": "0.63247985", "text": "static requestHandler() {\n\n var driver = config.Driver.make(this);\n\n driver.parseRoutes();\n return driver.requestHandler();\n }", "title": "" }, { "docid": "477437c4ae9ac6e4a8fe5512024be862", "score": "0.58965015", "text": "bindRouteHandler() {\n\t\tthis.app.singleton('router.handler', Handler);\n\t}", "title": "" }, { "docid": "b6d416a58329115cf7515aa70c88712a", "score": "0.5888243", "text": "bindRouteHandler() {\n this.app.singleton('router.handler', _Handler.default);\n }", "title": "" }, { "docid": "541f8432eabf1a72d65121a60ca94fef", "score": "0.5545414", "text": "function start(route, handle) {\n // function onRequest will handle all the requests to server\n function onRequest(request, response) {\n var postData = \"\";\n\n // if request url ends with .css\n if (request.url.indexOf('.css') != -1) {\n // then send styles.css file to user\n fs.readFile(\n __dirname + '/../view/styles.css',\n function (error, data) {\n if (error) throw error;\n response.writeHead(200, {'Content-Type': 'text/css'});\n response.write(data);\n response.end();\n }\n );\n }\n\n // if request url ends with .js\n if (request.url.indexOf('.js') != -1) {\n // then send javascript file to user\n fs.readFile(\n __dirname + '/../view/scripts.js',\n function (error, data) {\n if (error) throw error;\n response.writeHead(200, {'Content-Type': 'text/javascript'});\n response.write(data);\n response.end();\n }\n );\n }\n\n // get pathname part from request url\n var pathname = url.parse(request.url).pathname;\n\n // if request is an image file\n if (pathname.indexOf('.jpg') != -1 || pathname.indexOf('.png') != -1 || pathname.indexOf('.gif') != -1) {\n // send it to user\n fs.readFile(\n __dirname + '/../view' + pathname,\n function (error, data) {\n if (error) throw error;\n response.writeHead(200, {'Content-Type': 'text/image'});\n response.write(data);\n response.end();\n }\n );\n }\n\n // if we handle a POST request\n if (request.method == 'POST') {\n\n // assign event listener to get POST data\n request.addListener(\"data\", function (chunk) {\n postData += chunk;\n });\n\n // assign event listener to process received POST data\n request.addListener(\"end\", function () {\n // get POST data as query string\n var data = querystring.parse(postData);\n // get cookies of the current user\n var cookies = utils.parseCookies(request);\n\n // save session id to POST data\n data['sid'] = cookies['sessionid'];\n\n // invoke request handler for request path\n route(handle, pathname, response, request, data);\n });\n } else {\n // all other request are GET requests, so process them with\n // no additional tasks\n route(handle, pathname, response, request, null);\n }\n }\n\n // create http server\n http.createServer(onRequest).listen(8888, \"0.0.0.0\");\n}", "title": "" }, { "docid": "000b95150b99bf9e80669647bdcc1142", "score": "0.5388895", "text": "function registerHandler (handler) {\n app[handler.method]( handler.path, handler.func() );\n }", "title": "" }, { "docid": "f66694b6b884019895e65fc911beb8c3", "score": "0.532255", "text": "static registerLegacyRouteHandler() {}", "title": "" }, { "docid": "79a422fcadf59fd9703e1cda062cbbc9", "score": "0.5280381", "text": "serve() {\n return function (req, res, next) {\n next();\n };\n }", "title": "" }, { "docid": "8337fb8a619dd07e634c3dade1a7e49f", "score": "0.52666837", "text": "static middlewareHandler(closure) {\n\n config.middlewareHandler = closure;\n }", "title": "" }, { "docid": "3573b71fb72f0fda5a94ee92d9d7294c", "score": "0.5265078", "text": "function onRequest() {\n\n // sets the actually resolved action, as it is also set by notfound\n req.data.action = req.action;\n \n if (req.action != 'notfound') {\n // let soft-coded actions override\n var idempotentAction = req.action +'_'+ req.method.toLowerCase();\n var action = (this.actions[idempotentAction] || this.actions[req.action]);\n \n if (action) {\n action.call(this);\n res.stop();\n }\n }\n}", "title": "" }, { "docid": "7e87e71c2aa2ad6c0d9b306f28f85e05", "score": "0.52431977", "text": "dispatcher(req, res)\n {\n this.runPreDispatchHooks(req, res);\n\n // TODO: run middlewares arranged by priorities\n // TODO: instantiate request and response singletones\n // TODO: check what URL and other request information\n // TODO: find Bundle-Controller-Action situated for request\n // TODO: if not found Bundle-Controller-Action then show 404 page\n res.statusCode = 200;\n res.setHeader('Content-Type', 'text/plain');\n res.end('Hello World\\n');\n\n // TODO: post-dispatch hook\n }", "title": "" }, { "docid": "b4731b42cd427aca6b95ae6f4622f51c", "score": "0.52393264", "text": "async handleRequest (req, res) {\n try {\n // First run the handlers assigned with \"server.use\"\n await this.callHandlers(this.handlers, req, res)\n\n // Then run process the request for the provied route\n await this.handleRoute(req, res)\n } catch (err) {\n // Call the error listener if an error is thrown\n this.errorListener.call(this, err, req)\n\n // Return HTTP 500 if error is not caught within handlers\n res.error(err.message)\n }\n }", "title": "" }, { "docid": "18dc5cb0f25944d1d04c4355eafe11aa", "score": "0.5221296", "text": "function middleware(request, response, next) {}", "title": "" }, { "docid": "64e0db88a380ab17032708ec83a6bfee", "score": "0.5196891", "text": "constructor () {\n this._handleRequest = this._handleRequest.bind(this)\n }", "title": "" }, { "docid": "b4f8d7e53d269f76f0da5274109771d9", "score": "0.51929456", "text": "useMiddlewareStack () {\n if (!this.server) throw new Error('Create server first')\n this._setStack()\n const middlewares = this.stack.getMiddlewareFunctions(this.config, this)\n this.server.on('request', this._getRequestHandler(middlewares))\n }", "title": "" }, { "docid": "a91c85df76ce8bd7c6e6ded9fc240e22", "score": "0.51430154", "text": "serve() {\n\t // a no-op, these are absolute URLs\n\t return function (req, res, next) {\n\t next();\n\t };\n\t}", "title": "" }, { "docid": "23617cadf9423c9ef2029855170e15c5", "score": "0.50843227", "text": "function handler(request, response) {\n\t\tfileServer.serve(request, response);\n}", "title": "" }, { "docid": "e9513558a9e84b342c54e0d4c12ecc99", "score": "0.5063195", "text": "serve() {\n // a no-op, these are absolute URLs\n return function(req, res, next) {\n next();\n };\n }", "title": "" }, { "docid": "af89674b305decb960d20700305d4b3a", "score": "0.5043252", "text": "applyMiddleware() {\n //Allows the server to parse json\n this.expressApp.use(bodyParser.json())\n\n //Registers the routes used by the app\n new Routes(this.expressApp)\n }", "title": "" }, { "docid": "d73e1fffa257b336a0fb6c69a08c6de1", "score": "0.50276524", "text": "function middleware(req, res, next) {\n req.context = createNamespace('context');\n req.context.run(() => next());\n}", "title": "" }, { "docid": "074e5857d28581bc169db0702abc1e71", "score": "0.50164217", "text": "function Controller() {\n // route data members\n this.middlewares = [];\n this.userTypes = [];\n this.permissions = [];\n this.isPublic = false;\n this.accepts = {};\n this.config = {};\n}", "title": "" }, { "docid": "0959a30990cc32fcedf0b96aa477fba0", "score": "0.5010752", "text": "setupAppMiddleware() {\n\t\t// small security protections by adjusting request headers\n\t\tthis.app.use(helmet());\n\n\t\t// adding the request's client ip\n\t\tthis.app.use(requestIp.mw());\n\n\t\tif(Config.isDev) {\n\t\t\t// Log requests in the console in dev mode\n\t\t\tthis.app.use(morgan('dev'));\n\t\t}\n\t\telse {\n\t\t\t// Compress responses in prod mode\n\t\t\tthis.app.use(compression());\n\t\t}\n\n\t\t// decode json-body requests\n\t\tthis.app.use(bodyParser.json());\n\n\t\t// TODO: Move mongo sanitation to save actions\n\t\t// sanitizing request data for mongo-injection attacks\n\t\tthis.app.use(mongoSanitize());\n\n\t\t// any internal data that is needed to be attached to the request must be attached to the \"internalAppVars\" object\n\t\tthis.app.use((req, res, next) => {\n\t\t\treq.internalAppVars = {};\n\t\t\tnext();\n\t\t});\n\t}", "title": "" }, { "docid": "4c06f16d9adf50810f9f9aa6296e5eca", "score": "0.5001999", "text": "post(path, handler) {\n\t\tconst {routMap} = this;\n\t\tconst key = getHandlerKey('POST', path);\n\t\troutMap[key] = handler;\n\t\treturn this;\n\t}", "title": "" }, { "docid": "592ea719697c91035a355fada64786bc", "score": "0.49956542", "text": "function route(pathname,response,postData){\n if (typeof requestHandler.handle[pathname] === 'function') {\n\n requestHandler.handle[pathname](response,postData);\n response.end();\n }\n else {\n console.log(\"No request handler found for \" +pathname);\n response.writeHead(404, {\"Content-Type\": \"text/plain\"});\n response.write(\"404 Not found\");\n\n }\n}", "title": "" }, { "docid": "b4b5edddddd36a2287d4f16692261e10", "score": "0.49941534", "text": "function ForwardingHandler(target) {\n this.target = target;\n}", "title": "" }, { "docid": "b4b5edddddd36a2287d4f16692261e10", "score": "0.49941534", "text": "function ForwardingHandler(target) {\n this.target = target;\n}", "title": "" }, { "docid": "0aa91cb504964f9a8f9462c2708fa52c", "score": "0.49913606", "text": "function create_route(handler) {\n\t// Default values in case pre and post hooks were omitted\n\tvar pre = handler.pre || ['default'];\n\tvar post = handler.post || ['default'];\n\tvar fin = handler.finally || ['default'];\n\n\t// Map names to chains for hooks\n\tpre = pre.map(function(v, k) {\n\t\treturn get_chain(this.pre_hooks, v);\n\t}, this);\n\tpost = post.map(function(v, k) {\n\t\treturn get_chain(this.post_hooks, v);\n\t}, this);\n\tfin = fin.map(function(v, k) {\n\t\treturn get_chain(this.finally_hooks, v);\n\t}, this);\n\n\t// Create a single array with all of the appropriate hooks and handlers in place\n\tvar handlers = pre.concat([handler.fn], post);\n\tvar handler_chain = new fl.Chain(handlers);\n\thandler_chain.set_exception_handler(handle_global_error);\n\thandler_chain.name = 'Common Route Handler';\n\n\t// Create the finally chain, which could still have an exception thrown (...), so\n\t// defend against that and guarantee that we make it to finish\n\tvar finally_chain = new fl.Chain([handler_chain].concat(fin));\n\tfinally_chain.set_exception_handler(handle_global_error);\n\tfinally_chain.set_bind_after_env(true);\n\tfinally_chain.name = 'Route Safety Wrapper';\n\n\tvar finish = this.finish.bind(this);\n\tfinish.name = 'finish';\n\n\t// This function is suitable for passing to express's server/route definitions\n\tvar that = this;\n\treturn function(req, res) {\n\t\tvar env = prepare_env(req, res, that.options);\n\t\tfinally_chain.call(null, env, finish);\n\t};\n}", "title": "" }, { "docid": "e1914e059c344fa67e0c79a141c8ee40", "score": "0.4990062", "text": "handle(...args) {\n if (args.length < 3) {\n return new Response('internal server error', { status: 500 })\n }\n\n const method = args.shift();\n const pathRegexp = args.shift();\n let handler = args.pop();\n\n this.routes.push({\n method,\n pathRegexp,\n handler\n })\n\n return this\n }", "title": "" }, { "docid": "d4b2a4b452e4cfa042ae16836faf617c", "score": "0.49798945", "text": "handleRequest(req, res) {\n if (req.method == 'GET') {\n this.handleGet.bind(this)(req, res);\n } else if (req.method == 'POST') {\n this.handlePost.bind(this)(req, res);\n }\n }", "title": "" }, { "docid": "0abf09f3811c1a45eabf31c5fad58756", "score": "0.49734288", "text": "runPreDispatchHooks(req, res)\n {\n return this;\n }", "title": "" }, { "docid": "62d352ca1d012d10122ae1fe7c762291", "score": "0.4965937", "text": "getMiddleware() {\n const router = express.Router();\n router.options(this.path, (request, response, next) => {\n if (!this.handleAbuseProtectionRequests(request, response)) {\n next();\n }\n });\n router.post(this.path, (request, response, next) => __awaiter(this, void 0, void 0, function* () {\n try {\n if (!(yield this._cloudEventsHandler.processRequest(request, response))) {\n next();\n }\n }\n catch (err) {\n next(err);\n }\n }));\n return router;\n }", "title": "" }, { "docid": "0f203868c254ea23720f91c5baa0e1ef", "score": "0.4963532", "text": "__prepareServer () {\n\n\t\tthis.server.inject(`sharedLogger`, sharedLogger);\n\n\t\tthis.server.mount(`/health-check`, (req, res) => res.respond({ healthy: true, version: this.appVersion }));\n\t\tthis.server.mount(`/webview`, this.workflowManager.handleWebviewRequests.bind(this.workflowManager));\n\t\tthis.server.mount(`/track-link`, this.workflowManager.handleLinkTrackingRequests.bind(this.workflowManager));\n\t\tthis.server.mount(`/api/flow/reload-dynamic`, this.workflowManager.reloadDynamicFlows.bind(this.workflowManager));\n\n\t}", "title": "" }, { "docid": "29735921790953b9854ecb0452fb330f", "score": "0.49561706", "text": "boostrap() {\n\n const self = this;\n\n this.app.get(\"/\", (request, response) => {\n\n // code here\n\n });\n\n return this.app;\n }", "title": "" }, { "docid": "3ca5cbf5e32f0799920e6c1fa5975bca", "score": "0.49516207", "text": "selfAssignHandlerFunctions() {\n this.request = this.api.request.bind(this.api);\n this.addRateLimitService = this.api.addRateLimitService.bind(this.api);\n this.addRequestService = this.api.addRequestService.bind(this.api);\n }", "title": "" }, { "docid": "92438d947d32ee002449d008170ceb01", "score": "0.49311325", "text": "function RouteHandler(method = '*', path = '*', callback = (request, response) => {}) {\n this.route = new Route(method, path);\n this.requestHandler = new RequestHandler(callback);\n}", "title": "" }, { "docid": "e25206b3dd646e4dc3ebd30c96e89765", "score": "0.49226457", "text": "use(fn) {\n this._middleware.push(fn);\n }", "title": "" }, { "docid": "ad63289f9e56a36090475d2e2e62fad7", "score": "0.49150088", "text": "requestHandler(req, res) {\n // All requests are assumed to be \"Express-like\" and have the bodyParser run\n // before it. Express doesn't have a good way (that I'm aware of) to specify\n // \"run this middleware if it hasn't already been run\".\n this.emit('message', req.body)\n this.handler(req.body, this.responseHandler.bind(this, res))\n }", "title": "" }, { "docid": "a3da85d9b1ae2a4ef998c9f558a5503c", "score": "0.49077603", "text": "defineAction(middleware) {\n this.action = middleware;\n }", "title": "" }, { "docid": "66ff683507a0d6772fcde60120166614", "score": "0.49052644", "text": "function route(handle, pathname, response, request) {\n// console.log(\"About to route a request for \" + pathname);\n\n // urls with parameters - strip params for routing purposes\n var paramStart = pathname.indexOf(\"&\");\n if(paramStart>1){\n pathname = pathname.substring(0,paramStart);\n }\n if (typeof handle[pathname] === 'function') {\n handle[pathname](response, request);\n } else {\n // standard file handlers\n handle[\"*file*\"](response, request);\n }\n}", "title": "" }, { "docid": "c46768277b663df6ee29b4781f10bfe4", "score": "0.49050698", "text": "function onRequest(request, response) {\n\tif (request.method !== \"GET\") {\n\t\tconsole.log(\"!Not a GET!\");\n\t\thandleBadRequest(response, 404); // *could* do a 405 if we then sent the 'Allow' header. meh.\n\t\treturn;\n\t\t}\n\trouter(request, response);\n\tconsole.log(\"Request routed\");\n\t}", "title": "" }, { "docid": "348a435637f0d96dc66b4f4967e015cc", "score": "0.4899558", "text": "function Controler() {\n this.request = new XMLHttpRequest();\n }", "title": "" }, { "docid": "eb5dd4e1b7e82c215b350e6814094d6b", "score": "0.48824283", "text": "setHandler(handler) {\r\n this.handler = handler\r\n return this\r\n }", "title": "" }, { "docid": "ddee0ac4f0a0b7df204dbd30d1c0bf9b", "score": "0.48730472", "text": "static actionHandler(closure) {\n\n config.actionHandler = closure;\n }", "title": "" }, { "docid": "13c4c77390acfb4e932068cba72ce038", "score": "0.48703414", "text": "constructor(controller) {\n this.controller = controller;\n this.eventEmitter = new events.EventEmitter();\n this.stackMiddleware();\n }", "title": "" }, { "docid": "dd9388cde56d87793efe7de29c5c5a0f", "score": "0.4859071", "text": "function start(route, handle){\n // we could have passed an entire router object to use it's route method. we don't however need to do that.\n // we only need the route method of it. so we'll pass the function only.\n function onRequest(request, response){\n // request and response are objects. this function is called whenever a request\n // is received.\n console.log(\"Request received.\")\n var pathname = url.parse(request.url).pathname\n console.log(\"Request for \" + pathname + \"received\");\n var postData = \"\";\n // to handle post data in a non blocking fashin, we need to add listeners. for post data\n // we need to add listerners corresponding to \"data\" and end.\n request.setEncoding(\"utf8\");\n request.addListener(\"data\", function(postDataChunk){\n postData += postDataChunk;\n console.log(\"Recived POST data\" + postDataChunk);\n });\n request.addListener(\"end\", function(){\n route(handle, pathname, response, postData);\n });\n }\n http.createServer(onRequest).listen(8888)\n console.log(\"the server is running now...\") \n}", "title": "" }, { "docid": "a790a1b65ab8a5d5f8c1b9a45b3f5861", "score": "0.48569256", "text": "function create_handler (view, func) {\n return async function handler () {\n const { navigate } = await import('./router/router_client.js');\n const handler_props = func({ render, navigate });\n async function render(new_props = {}) {\n // console.log('called render for ', view.name, props);\n const updated_props = { ...props, ...new_props };\n const root_element = document.getElementById('root');\n root_element.replaceChild(view(updated_props), root_element.firstChild);\n props = updated_props;\n }\n return { props: handler_props, render };\n }\n }", "title": "" }, { "docid": "cd94bd1bc45ca34069dd48d501a22e98", "score": "0.48564714", "text": "function middleware(req, res, next) {\n\tns.run(() => next());\n}", "title": "" }, { "docid": "e25b2f030d38dc83b32057942a64ac32", "score": "0.48542145", "text": "middleware() {\n\t\treturn (handler, action) => {\n\t\t\tif (action.cache) {\n\t\t\t\treturn function cacherMiddleware(ctx) {\n\t\t\t\t\tconst cacheKey = this.getCacheKey(action.name, ctx.params, action.cache.keys);\n\t\t\t\t\treturn this.get(cacheKey).then(content => {\n\t\t\t\t\t\tif (content != null) {\n\t\t\t\t\t\t\t// Found in the cache! Don't call handler, return with the context\n\t\t\t\t\t\t\tctx.cachedResult = true;\n\t\t\t\t\t\t\treturn content;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Call the handler\n\t\t\t\t\t\treturn handler(ctx).then(result => {\n\t\t\t\t\t\t\t// Save the response to the cache\n\t\t\t\t\t\t\tthis.set(cacheKey, result);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\treturn result;\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}.bind(this);\n\t\t\t}\n\n\t\t\treturn handler;\n\t\t};\n\t}", "title": "" }, { "docid": "7148db73e614f89b9f27897adc96ff12", "score": "0.485136", "text": "constructor() {\n this.app = express();\n this.setupControllers();\n this.middleware();\n }", "title": "" }, { "docid": "17135ba841249604732954c231c38b0f", "score": "0.4846149", "text": "use (middleware) {\n this.app.use(middleware)\n }", "title": "" }, { "docid": "df94fcd161c2c224724596654888f37e", "score": "0.48452774", "text": "function handlerStart (request, response) {\n console.log(\"at handlerStart\");\n\n // define callback function for end of request data stream\n function handlerEnd() {\n\tconsole.log(\"at handlerEnd\");\n\t// use the static file server \n\tfile.serve(request, response);\n\t// notice it takes request and response from closure\n }\n // set up callback function for end of data stream\n request.addListener('end',handlerEnd); \n request.resume(); // paused by default; this actually means start \n}", "title": "" }, { "docid": "46a972bf4d433452780736cd9e3d6c1c", "score": "0.48347014", "text": "function rest() {\n var handlers; // Cached handlers\n\n return function restApiHandler(req, res, next) {\n var app = req.app;\n var registry = app.registry;\n\n if (!handlers) {\n handlers = [];\n var remotingOptions = app.get('remoting') || {};\n\n var contextOptions = remotingOptions.context;\n if (contextOptions !== undefined && contextOptions !== false) {\n throw new Error(g.f(\n '%s was removed in version 3.0. See %s for more details.',\n 'remoting.context option',\n 'https://docs.strongloop.com/display/APIC/Using%20current%20context'));\n }\n\n if (app.isAuthEnabled) {\n var AccessToken = registry.getModelByType('AccessToken');\n handlers.push(loopback.token({ model: AccessToken, app: app }));\n }\n\n handlers.push(function(req, res, next) {\n // Need to get an instance of the REST handler per request\n return app.handler('rest')(req, res, next);\n });\n }\n if (handlers.length === 1) {\n return handlers[0](req, res, next);\n }\n async.eachSeries(handlers, function(handler, done) {\n handler(req, res, done);\n }, next);\n };\n}", "title": "" }, { "docid": "03485c4a88d50fbf7fa9a5058432fbf7", "score": "0.48182833", "text": "function onRequest(request, response) {\n var postData = \"\";\n\n // if request url ends with .css\n if (request.url.indexOf('.css') != -1) {\n // then send styles.css file to user\n fs.readFile(\n __dirname + '/../view/styles.css',\n function (error, data) {\n if (error) throw error;\n response.writeHead(200, {'Content-Type': 'text/css'});\n response.write(data);\n response.end();\n }\n );\n }\n\n // if request url ends with .js\n if (request.url.indexOf('.js') != -1) {\n // then send javascript file to user\n fs.readFile(\n __dirname + '/../view/scripts.js',\n function (error, data) {\n if (error) throw error;\n response.writeHead(200, {'Content-Type': 'text/javascript'});\n response.write(data);\n response.end();\n }\n );\n }\n\n // get pathname part from request url\n var pathname = url.parse(request.url).pathname;\n\n // if request is an image file\n if (pathname.indexOf('.jpg') != -1 || pathname.indexOf('.png') != -1 || pathname.indexOf('.gif') != -1) {\n // send it to user\n fs.readFile(\n __dirname + '/../view' + pathname,\n function (error, data) {\n if (error) throw error;\n response.writeHead(200, {'Content-Type': 'text/image'});\n response.write(data);\n response.end();\n }\n );\n }\n\n // if we handle a POST request\n if (request.method == 'POST') {\n\n // assign event listener to get POST data\n request.addListener(\"data\", function (chunk) {\n postData += chunk;\n });\n\n // assign event listener to process received POST data\n request.addListener(\"end\", function () {\n // get POST data as query string\n var data = querystring.parse(postData);\n // get cookies of the current user\n var cookies = utils.parseCookies(request);\n\n // save session id to POST data\n data['sid'] = cookies['sessionid'];\n\n // invoke request handler for request path\n route(handle, pathname, response, request, data);\n });\n } else {\n // all other request are GET requests, so process them with\n // no additional tasks\n route(handle, pathname, response, request, null);\n }\n }", "title": "" }, { "docid": "5a1030fbad5a2f3ac7efb7a914e13db3", "score": "0.47955635", "text": "use (fn) {\n this.middleware.push(fn);\n return this;\n }", "title": "" }, { "docid": "fa4b26a4ad14bc1049aca3c77b88510e", "score": "0.47926924", "text": "function handleRequest(req, res) {\n var endpoints = {\n '/': handleAppHtml,\n '/appjs': handleAppJs,\n '/appcss': handleAppCss,\n '/clearDrawing': handleClearDrawing,\n '/connect': handleConnect,\n '/favicon.ico': handleFavicon,\n '/name': handleName,\n '/message': handleMessage,\n '/notifier': handleNotifier,\n '/point': handlePoint\n };\n\n // Determine the client's id, if it has one, and look up the 'client' object\n // which represents it.\n var id = req.headers['user-identity'];\n if (id) {\n var client = clients[id];\n if (!client) {\n client = makeClient(id);\n clients[id] = client;\n }\n client.requestCount++;\n }\n\n // Lookup and call a handler for this request.\n callHandler();\n\n\n function callHandler() {\n var handler = endpoints[req.url];\n if (handler) {\n debug('Handling ', req.url);\n\n if (req.method == 'POST') {\n parseIncomingJson(function(err, obj) {\n if (!err) {\n handler(obj);\n }\n else {\n emitJson({error: true, message: 'Server error handling request.'});\n }\n });\n }\n else {\n handler();\n } \n }\n else {\n handlerNotFound();\n } \n }\n\n function handlerNotFound() {\n debug('Handler not found for ', req.url);\n res.writeHead(404, {'content-type': 'text/plain'});\n res.end('These are not the droids you are looking for: ' + req.url);\n }\n\n // --- begin handlers ---\n\n function handleAppCss() {\n emitFile(appCssPath, 'text/css');\n }\n\n function handleAppHtml() {\n emitFile(appHtmlPath, 'text/html');\n }\n\n function handleAppJs() {\n emitFile(appJsPath, 'application/javascript');\n }\n\n function handleClearDrawing() {\n currentPoints = [];\n notifyAllClients({message: client.name + ' cleared the canvas.'});\n notifyAllClients({clearCanvas: true});\n emitJson({ok: true});\n }\n\n function handleConnect() {\n var msg = {ok: true, message: 'Connected to server as ' + client.name, presentation: 'log'};\n if (currentPoints.length) {\n msg.queue = [];\n currentPoints.forEach(function(point) {\n msg.queue.push({drawPoint: point});\n });\n }\n emitJson(msg);\n notifyAllClients({message: client.name + ' connected!'});\n }\n\n function handleFavicon() {\n // Just emit a simple 404 when the browser requests favicon.ico.\n res.writeHead(404);\n res.end();\n }\n\n function handleMessage(obj) {\n var notifyText = '<b>' + client.name + '</b>: ' + obj.text;\n emitJson({ok: true});\n notifyAllClients({message: notifyText});\n }\n\n function handleName(obj) {\n var oldName = client.name;\n client.name = obj.name;\n emitJson({ok: true});\n notifyAllClients({message: oldName + ' is now known as ' + client.name});\n }\n\n function handleNotifier() {\n client.response = res;\n processMessageQueue(client);\n }\n\n function handlePoint(obj) {\n emitJson({ok: true});\n currentPoints.push(obj.point);\n notifyAllClients({drawPoint: obj.point}, client);\n }\n\n // --- end handlers ---\n\n // --- begin output helpers ---\n\n function emitFile(filename, mimetype) {\n fs.readFile(filename, function(err, data) {\n res.writeHead(200, {'content-type': mimetype});\n res.end(data);\n });\n }\n\n function emitJson(obj) {\n res.writeHead(200, {'content-type': 'application/json'});\n res.end(JSON.stringify(obj));\n }\n\n function notifyAllClients(obj, except) {\n //debug('Notifying all clients: ', obj);\n\n for (var key in clients) {\n var cli = clients[key];\n if (cli === except) {\n cli.messageQueue.push('{}');\n }\n else {\n cli.messageQueue.push(obj);\n }\n processMessageQueue(cli);\n }\n }\n\n function processMessageQueue(cli) { \n if (cli.response && cli.messageQueue.length > 0) {\n if (cli.messageQueue.length == 1) {\n var msg = cli.messageQueue[0];\n cli.messageQueue = [];\n }\n else {\n var msg = {queue: cli.messageQueue};\n cli.messageQueue = [];\n }\n\n debug('Notifying ', cli.id, ' that ', msg);\n\n cli.response.writeHead({'content-type': 'application/json'});\n cli.response.end(JSON.stringify(msg));\n cli.response = null;\n }\n }\n\n // --- end output helpers ---\n\n // --- begin other helpers ---\n function parseIncomingJson(cb) {\n var data = '';\n\n req\n .on('data', function(chunk) {\n data += chunk;\n })\n .on('end', function() {\n debug('Data: ', data);\n try {\n cb(null, JSON.parse(data));\n }\n catch(e) { \n debug('Error parsing incoming JSON data: ', data);\n cb('Error parsing incoming JSON data');\n }\n });\n }\n}", "title": "" }, { "docid": "e24415505cdd6a77c8af5ffc23d0f299", "score": "0.47897908", "text": "function MiddleMan() {\n this._server = http.createServer(this._onRequest.bind(this));\n this._proxyServer = httpProxy.createProxyServer({});\n this._handlers = [];\n}", "title": "" }, { "docid": "c2594efca8d29cafcff4d5333e4b34ba", "score": "0.47683448", "text": "function onRequest(request, response) {\n var pathname = url.parse(request.url).pathname;\n console.log(\"Request for \" + pathname + \" received.\");\n\n // handle-funktion mappar URL mot rätt funktion i requestHandler,\n // som vidarbefordrar requsetn till mongoDB-kopplingen\n // vidarebefordra också response- och requestobjekten i kedjan\n route(handle, pathname, request, response, mongo);\n }", "title": "" }, { "docid": "f6e7fd62034f033b7aa3ae26086e8949", "score": "0.47644195", "text": "function start(route, handle) {\n function onRequest(request, response) {\n var pathname = url.parse(request.url).pathname;\n console.log(\"Request for \" + pathname + \" received.\");\n route(handle,pathname,response,request);\n }\n \n//creates server on load\n http.createServer(onRequest).listen(4000);\n console.log(\"Server has started.\");\n}", "title": "" }, { "docid": "6f31f45830f58e29ed4e85965f6a750f", "score": "0.47640216", "text": "middlewares() {\n this.server.use(cors());\n this.server.use(express.json());\n }", "title": "" }, { "docid": "f1aea50eed30fc5903e572385339dca9", "score": "0.47626504", "text": "function handler() {\n\t\treturn function () {\n\t\t\tself.handler.apply(self, arguments);\n\t\t};\n\t}", "title": "" }, { "docid": "29c25c1a53c6c57a620b00639def6f86", "score": "0.47615758", "text": "function start(route, handle){\n\n\tfunction onRequest(request, response) {\n\t\t var postData = \"\";\n\t\t var pathname = url.parse(request.url).pathname;\n\t\t console.log(\"Request for \" + pathname + \" received.\");\n\n\t\t route(handle, pathname, response, request);\n\t\t // request.setEncoding(\"utf8\"); REQUIRED for TEXT UPLOAD not file\n\n\t\t //REQUIRED for TEXT UPLOAD not file\n\t\t // request.addListener(\"data\", function(postDataChunk) {\n\t\t\t// postData += postDataChunk;\n\t\t\t// console.log(\"Received POST data chunk '\"+\n\t\t\t// postDataChunk + \"'.\");\n\t\t // });\n\n\t\t // REQUIRED for TEXT UPLOAD not file\n\t\t // request.addListener(\"end\", function() {\n\t\t // route(handle, pathname, response, postData);\n\t\t // });\n\t\t // route(handle, pathname, response); // To solve blocking and non-blocking problem\n\n\t\t // response.writeHead(200, {\"Content-Type\": \"text/plain\"})\n\t\t // response.write(\"Hello World\");\n\t\t // response.end();\n\t\t }\n\t\t http.createServer(onRequest).listen(3000);\n\n\t\t console.log(\"Server has started.\");\n\n}", "title": "" }, { "docid": "02a437d7b24771d3a21ffc951629437c", "score": "0.4753185", "text": "function initController(app) {\n app.use(\n router((_) => {\n _.get('/', indexController.actionIndex);\n _.get('/api/getBooksList', apiController.actionBooksList);\n _.get('/books/list', booksController.actionBooksList);\n _.get('/books/create', booksController.actionBooksCreate);\n // app.use(router.routes()).use(router.allowedMethods());\n })\n );\n}", "title": "" }, { "docid": "e39ce3278af230cbab7049a5ab35e824", "score": "0.47468618", "text": "function SocketController(namespace) {\n return function (object) {\n var metadata = {\n namespace: namespace,\n target: object\n };\n index_1.defaultMetadataArgsStorage().controllers.push(metadata);\n };\n}", "title": "" }, { "docid": "e15d985b89409ccf5ea455dd65bb6123", "score": "0.4744195", "text": "function Application() {\n var me = this;\n\n me.verbs = {};\n me.errorHandlers = {\n 403: function(req, res) {\n res.writeHead(403, {\n 'Content-type' : 'text/html'\n });\n res.end(html('Access denied', 'Access Denied'));\n },\n 404 : function(req, res) {\n res.writeHead(404, {\n 'Content-type' : 'text/html'\n });\n res.end(html('Not Found', 'Not found'));\n }\n\n };\n me.listeners = {};\n me.server = http.createServer(function(req, res) {\n var verb,\n verbs = me.verbs,\n errorHandlers = me.errorHandlers,\n config,\n status;\n\n try {\n req.args = req.uri.substr(1).split('/');\n verb = req.verb = req.args.shift();\n if (req.uri.endsWith('/')) {\n req.args.pop();\n }\n if (!verb.length) {\n req.verb = '/';\n }\n\n me.fire('beginRequest', req, res);\n // in case beginRequest handler changed it!\n verb = req.verb;\n config = verbs[verb] || verbs[404] || 404;\n if (config !== 404) {\n status = config.handler(config, req, res);\n }\n else {\n status = 404;\n }\n config = errorHandlers[status];\n if (config) {\n if (config.handler) {\n config.handler(config, req, res);\n }\n else {\n errorHandlers[status](req, res);\n }\n }\n }\n catch (e) {\n if (e === 'RES.STOP') {\n throw e;\n }\n else if (e === 'EOF') {\n throw e;\n }\n me.fire('exception', e, req, res);\n res.error = e;\n config = errorHandlers[500];\n if (config) {\n if (config.handler) {\n config.handler(config, req, res, internalServerError);\n }\n else {\n config(req, res, internalServerError);\n }\n }\n else {\n internalServerError(req, res);\n }\n }\n me.fire('endRequest', req, res);\n });\n}", "title": "" }, { "docid": "6b25b88464642f85bff571476af165d2", "score": "0.47435138", "text": "errorHandler(eh) {\n this.req.errorHandler(eh);\n return this;\n }", "title": "" }, { "docid": "ff6977db81a48aa7517d64b6380fa49a", "score": "0.4743054", "text": "initExpressMiddleWare() {\n\t\tthis.app.use(bodyParser.urlencoded({ extended: true }));\n\t\tthis.app.use(bodyParser.json());\n\t}", "title": "" }, { "docid": "b31244b9e5640fc9c0c9662853921171", "score": "0.4739589", "text": "middleware() {\n this.server.use(express.json());\n this.server.use(\n '/file',\n express.static(path.resolve(__dirname, '../', 'tmp', 'uploads'))\n );\n }", "title": "" }, { "docid": "fd552a6e1758cb94e81fbf33533412c0", "score": "0.4729461", "text": "function app(httpRequest, httpResponse) {\n\n // Wrap request and response\n var request = new Request(httpRequest);\n var response = new Response(httpResponse);\n\n // Route it, bitch!\n _router.route(request, response);\n }", "title": "" }, { "docid": "33a32f7700eccd93deecac2e10ecaa67", "score": "0.4725086", "text": "function handler(requestHandler, successHandler, errorHandler) {\n async function handleRequest(koaCtx) {\n try {\n const result = await requestHandler(koaCtx);\n successHandler(koaCtx, result);\n } catch (error) {\n errorHandler(koaCtx, error);\n }\n }\n\n return handleRequest;\n}", "title": "" }, { "docid": "45bd423704ad1585f9d7c702fada5c13", "score": "0.47154364", "text": "startServer() {\n let requestHandler = this.onRequest.bind(this);\n let port = this.port;\n http.createServer(requestHandler).listen(port);\n console.log(\"Server running at http://localhost:%d\", port);\n }", "title": "" }, { "docid": "9fa24f778d4babee9d4a7f9b3a651086", "score": "0.4709258", "text": "static handleRequest(virtualRequest, request, response, loggingFunction, fallbackResponder) {\n return __awaiter(this, void 0, void 0, function* () {\n const proxy = yield this.getProxy(virtualRequest, request, loggingFunction, fallbackResponder);\n if (!(proxy instanceof OutgoingRequestHandler)) {\n throw new Error('unable to handle request: no matching handler found');\n }\n return proxy.handleRequestConcrete(virtualRequest, request, response);\n });\n }", "title": "" }, { "docid": "0e79eba043748de790fdf02a3c983687", "score": "0.46915594", "text": "function initController(route){\n\tvar fn = route.to.split('.');\n\n\treturn function*(next){\n\t\tvar Controller = Risotto.controllers[fn[0]];\n\t\tthis._instance = new Controller();\n\t\tthis._instance.koaContext = this;\n\t\tyield next;\n\t}\n}", "title": "" }, { "docid": "d3fa727497acec57d826d67bdeb2f420", "score": "0.46877354", "text": "bindHttpServer() {\n this.app.singleton('server', _Server.default);\n }", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.46873826", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.46873826", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.46873826", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.46873826", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.46873826", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.46873826", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.46873826", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.46873826", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.46873826", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.46873826", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.46873826", "text": "function Handler() {}", "title": "" }, { "docid": "0eaafd9b92578820d5c5a0f6c81264e0", "score": "0.46853074", "text": "function serverController(hostname) {\n const server = http.createServer((request, response) => {\n \n // Creates space around .html requests so that they stand out more in the console\n if (path.extname(request.url) == '.html' || request.url == '/') {\n console.log(`\\nPage Requested: ${request.url}\\n`);\n } else {\n console.log(`Request came: ${request.url}`);\n }\n \n // Sends the requested resources to the response stream\n if (request.url == '/') {\n var file = path.join(__dirname, landing); // delivers index.html by default\n sendFile(file, landing, 'text/html', response);\n } else {\n var file = path.join(__dirname, request.url); // delivers requested resource\n sendFile(file, request.url, getContentType(request.url), response);\n };\n });\n \n // Gives server a port to listen to and gives an IP address to find it\n server.listen(port, hostname, () => {\n console.log(`Server running at ${hostname}:${port}\\n`);\n });\n}", "title": "" }, { "docid": "4c5f98fe30759cbb682d2a722090d525", "score": "0.46837324", "text": "_compile() {\n this._middlewares = this._handler.server.concat(this._handler.global)\n }", "title": "" }, { "docid": "069d229aaac8b6f3a207dc0565bedc55", "score": "0.4682849", "text": "function requestHandler(options) {\n var currentHub = core_1.getCurrentHub();\n var client = currentHub.getClient();\n // Initialise an instance of SessionFlusher on the client when `autoSessionTracking` is enabled and the\n // `requestHandler` middleware is used indicating that we are running in SessionAggregates mode\n if (client && sdk_1.isAutoSessionTrackingEnabled(client)) {\n client.initSessionFlusher();\n // If Scope contains a Single mode Session, it is removed in favor of using Session Aggregates mode\n var scope = currentHub.getScope();\n if (scope && scope.getSession()) {\n scope.setSession();\n }\n }\n return function sentryRequestMiddleware(req, res, next) {\n if (options && options.flushTimeout && options.flushTimeout > 0) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n var _end_1 = res.end;\n res.end = function (chunk, encoding, cb) {\n var _this = this;\n void sdk_1.flush(options.flushTimeout)\n .then(function () {\n _end_1.call(_this, chunk, encoding, cb);\n })\n .then(null, function (e) {\n utils_1.logger.error(e);\n });\n };\n }\n var local = domain.create();\n local.add(req);\n local.add(res);\n local.on('error', next);\n local.run(function () {\n var currentHub = core_1.getCurrentHub();\n currentHub.configureScope(function (scope) {\n scope.addEventProcessor(function (event) { return parseRequest(event, req, options); });\n var client = currentHub.getClient();\n if (sdk_1.isAutoSessionTrackingEnabled(client)) {\n var scope_1 = currentHub.getScope();\n if (scope_1) {\n // Set `status` of `RequestSession` to Ok, at the beginning of the request\n scope_1.setRequestSession({ status: types_1.RequestSessionStatus.Ok });\n }\n }\n });\n res.once('finish', function () {\n var client = currentHub.getClient();\n if (sdk_1.isAutoSessionTrackingEnabled(client)) {\n setImmediate(function () {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (client && client._captureRequestSession) {\n // Calling _captureRequestSession to capture request session at the end of the request by incrementing\n // the correct SessionAggregates bucket i.e. crashed, errored or exited\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n client._captureRequestSession();\n }\n });\n }\n });\n next();\n });\n };\n}", "title": "" }, { "docid": "2f8eceea165d945b44a57caa02c4c06d", "score": "0.46804023", "text": "controller(uri, controller_name, controller_options) {\n\n if (!config.controllerHandler) {\n\n throw new Error('No controller handler given.');\n }\n\n if (!controller_options) {\n controller_options = {};\n }\n\n var actions = config.controllerHandler(controller_name, this._options, controller_options);\n var route = this;\n\n _.forEach(Object.keys(actions), function(action) {\n\n _.forEach(route.constructor.verbs, function(verb) {\n\n if (_.startsWith(action, verb)) {\n\n var new_uri = uri;\n var subroute = _.kebabCase(action.replace(verb, ''));\n\n if (subroute == 'index') {\n subroute = '';\n }\n\n if (new_uri.indexOf('{}') === -1) {\n\n new_uri = path.join(new_uri, '{}');\n }\n\n new_uri = new_uri.replace('{}', subroute);\n\n var middleware = [];\n var name = null;\n\n if (controller_options[action]) {\n\n if (controller_options[action].middleware) {\n\n middleware = route.constructor.normalizeOptionsMiddleware(controller_options[action]);\n }\n\n if (controller_options[action].name) {\n\n name = controller_options[action].name;\n }\n }\n\n route[verb](new_uri, {\n uses: actions[action],\n middleware: middleware,\n name: name\n });\n }\n\n });\n\n });\n }", "title": "" }, { "docid": "a821961e5ac380027d234401c1f1f460", "score": "0.46793658", "text": "middlewares() {\n //directorio publico\n this.app.use(express.static('public'));\n\n //convertir los datos que llegan en json\n this.app.use(express.json());\n }", "title": "" }, { "docid": "222265410e26ecdfbb6848791d511e17", "score": "0.4679117", "text": "function handle(handler) {\n return (req, res, next) => {\n handler(req)\n .then(r => res.send(r))\n .catch(next)\n };\n}", "title": "" }, { "docid": "06a79761b845dad4bd49c0f895d711ad", "score": "0.4673944", "text": "directoryHandler(request, response) {\n if (!this.checkAuth(request, response)) {\n return;\n }\n\n if (request.method == \"OPTIONS\") {\n response.setStatusLine(\"1.1\", 204, \"No Content\");\n return;\n }\n\n let input = new DOMParser().parseFromString(\n CommonUtils.readBytesFromInputStream(request.bodyInputStream),\n \"text/xml\"\n );\n\n switch (input.documentElement.localName) {\n case \"calendar-query\":\n Assert.equal(request.method, \"REPORT\");\n Assert.equal(input.documentElement.namespaceURI, PREFIX_BINDINGS.c);\n this.calendarQuery(input, response);\n return;\n case \"calendar-multiget\":\n Assert.equal(request.method, \"REPORT\");\n Assert.equal(input.documentElement.namespaceURI, PREFIX_BINDINGS.c);\n this.calendarMultiGet(input, response);\n return;\n case \"propfind\":\n Assert.equal(request.method, \"PROPFIND\");\n Assert.equal(input.documentElement.namespaceURI, PREFIX_BINDINGS.d);\n this.propFind(input, request.hasHeader(\"Depth\") ? request.getHeader(\"Depth\") : 0, response);\n return;\n case \"sync-collection\":\n Assert.equal(request.method, \"REPORT\");\n Assert.equal(input.documentElement.namespaceURI, PREFIX_BINDINGS.d);\n this.syncCollection(input, response);\n return;\n }\n\n Assert.report(true, undefined, undefined, \"Should not have reached here\");\n response.setStatusLine(\"1.1\", 404, \"Not Found\");\n response.setHeader(\"Content-Type\", \"text/plain\");\n response.write(`No handler found for <${input.documentElement.localName}>`);\n }", "title": "" }, { "docid": "e1c8affb0e560492f8437d7b83bdffd2", "score": "0.46704367", "text": "constructor() {\n\t\tthis.app = express();\n\t\tthis.initExpress();\n\t\tthis.initExpressMiddleWare();\n\t\tthis.initControllers();\n\t\tthis.start();\n\t}", "title": "" }, { "docid": "e816b9abd04937a62c4805264bc35276", "score": "0.4667957", "text": "function ProcessController() {}", "title": "" }, { "docid": "b37322013682ab3c447a9beb7647f684", "score": "0.46639234", "text": "setupController() {\n // eslint-disable-next-line ember/no-controller-access-in-routes\n this.controllerFor('application').set('isEmberApplication', true);\n this.port.one('general:reset', this, this.reset);\n }", "title": "" }, { "docid": "6d7cca502c0fd45509e2799ca3cadc7c", "score": "0.4659158", "text": "start()\n {\n this.app.use(\n this.bp.json(\n {\n limit: '50mb'\n }\n )\n );\n\n this.app.use(\n this.bp.urlencoded(\n {\n limit: '50mb',\n extended: true\n }\n )\n );\n\n this.server.listen(Config.WebServer.Port, () =>\n {\n Logger.info(`Server started on port: ${this.server.address().port}`);\n }\n );\n\n this.app.all('*', (req, res) =>\n {\n res.header('Access-Control-Allow-Origin', '*');\n res.header('Access-Control-Allow-Headers', 'Content-type');\n this.handleReq(req, res);\n }\n );\n }", "title": "" }, { "docid": "60f97f51026b80566d0fec120b1f7bf5", "score": "0.46505034", "text": "function NodeFsHandler() {}", "title": "" }, { "docid": "60f97f51026b80566d0fec120b1f7bf5", "score": "0.46505034", "text": "function NodeFsHandler() {}", "title": "" }, { "docid": "ea9e64f1c8c35d2fda60fddc3f333b82", "score": "0.4646122", "text": "function handleRoot(req, res) {\n res.send(\"Hello World!\");\n}", "title": "" }, { "docid": "e9675034392c815c59f63a85180c9f36", "score": "0.46437556", "text": "function start(response, postData) {\n console.log(\"Request handler 'start' was called.\");\n var body = '<html>' + '<head>' + '<meta http-equiv=\"Content-Type\" content=\"text/html; ' + 'charset=UTF-8\" />' +\n '</head>' +\n '<body>' +\n '<form action=\"/upload\" method=\"post\">' +\n '<textarea name=\"text\" rows=\"20\" cols=\"60\"></textarea>' +\n '<input type=\"submit\" value=\"Submit text\" />' +\n '</form>' +\n '</body>' +\n '</html>';\n\n response.writeHead(200, {\n \"Content-Type\": \"text/html\"\n });\n response.write(body);\n response.end();\n}", "title": "" }, { "docid": "92dd6bcb305c38327880f3331e26fe7a", "score": "0.46418333", "text": "function importHandler(handler) {\n Object.keys(handler.prototype).forEach(function(method) {\n FSWatcher.prototype[method] = handler.prototype[method];\n });\n}", "title": "" }, { "docid": "e0860a0da418d7aed6375480c7d6d5fd", "score": "0.4633747", "text": "function Handler() {\n this.$handlers = {};\n return this;\n }", "title": "" } ]
c14645e21c7e33e7cca0a522300f2f47
LOGIC TO CHECK THE PASSWORD AND REPASSWORD ARE THE SAME (newuserpage) $()
[ { "docid": "72e14841c1bda4445d6c6f362f97a1b9", "score": "0.0", "text": "function initialize() {\n var mapOptions = {\n zoom: 11\n };\n map = new google.maps.Map(document.getElementById('map-canvas'),\n mapOptions);\n\n \n // Try HTML5 geolocation\n if(navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n\n myLat = position.coords.latitude;\n myLon = position.coords.longitude;\n var pos = new google.maps.LatLng(myLat, myLon);\n map.setCenter(pos);\n\n\n\n }, function() {\n handleNoGeolocation(true);\n }, {enableHighAccuracy: true });\n } else {\n // Browser doesn't support Geolocation\n handleNoGeolocation(false);\n }\n }", "title": "" } ]
[ { "docid": "885767be4d5fd355ed06290c5298608c", "score": "0.7766336", "text": "checkPwd() {\n if (document.getElementById('newPwd').value !== document.getElementById('repeatPwd').value) {\n alert(getLang('SAME_PWD'));\n return false;\n }\n }", "title": "" }, { "docid": "437fcf8b49c1fc2ca0b6a5b420ada264", "score": "0.7389474", "text": "function checkMatchNewAndRetype(){\n\t\tvar newPassword= $(\"#editPasswordDialog\").find(\"#newPassword\").val();\n\t\tvar retypePassword= $(\"#editPasswordDialog\").find(\"#retypePassword\").val();\n\t\tif(newPassword.localeCompare(retypePassword)==0)\n\t\t\treturn true;\n\t\treturn false;\n\t}", "title": "" }, { "docid": "ff2436b412fa09df72ad1c9fa8ff67b6", "score": "0.72522223", "text": "function refreshVerifyPassword()\n\t{\n\t\t// Can't do anything without something to check again!\n\t\tif (!verificationFields.pwmain)\n\t\t\treturn false;\n\n\t\t// Check and set valid status!\n\t\tvar isValid = verificationFields.pwmain[1].value == verificationFields.pwverify[1].value && refreshMainPassword(true);\n\n\t\tsetVerificationImage(verificationFields.pwverify[2], isValid, isValid ? $txt['registration_password_valid'] : $txt['registration_password_no_match']);\n\t\tverificationFields.pwverify[1].className = verificationFields.pwverify[4] + ' ' + (isValid ? 'valid' : 'invalid') + '_input';\n\n\t\treturn true;\n\t}", "title": "" }, { "docid": "28403d03b75f2b2ecaff26dbd088e344", "score": "0.7237271", "text": "function validateNewPassword(){\n return validatePassword(7) && validateBothPasswords(7);\n}", "title": "" }, { "docid": "ffe6f781c86752dbbfbd3ab5fbad4052", "score": "0.7230974", "text": "function passwordCheck() {\n // get the new password\n let password = document.querySelector('#newpassword');\n // get the reentered password\n let confirm = document.querySelector('#confirmpassword');\n // if they are the same, update the password. If not, let the user know the passwords dont match\n if(confirm.value == password.value) {\n confirm.setCustomValidity('');\n } else {\n confirm.setCustomValidity('New password does not match the re-entered value');\n }\n}", "title": "" }, { "docid": "fe68fa7b52e63c2df7f84bc562bec63c", "score": "0.72210354", "text": "function comparePass(newPass, reNewPass){\n\t\t\n\t\tif(newPass != reNewPass){ // If passwords not equal\n\t\t\t\n\t\t\t\talert(\"New Passwords Are Not The Same!!\");\n\t\t\t\treturn false;\n\t\t} \n\t\t\n\t\tif(newPass.length < 8){\n\t\t\t\n\t\t\talert(\"Bummers, password too short.\");\n\t\t\treturn false;\n\t\t}\n\t\t\t\n\t\treturn true;\t\n\t}", "title": "" }, { "docid": "dc984c28cafa2f309fe86a6bed593457", "score": "0.72188133", "text": "function matchPassword() {\n var pass = $('#UserPassword').val();\n var re_pass = $('#UserRepeatPassword').val();\n var visit = $('#UserPasswordVisit').val();\n if (pass == '' && re_pass == '') {\n //$('#UserPasswordVisit').val(true);\n\t$('#passwordError').html('');\n $('#UserPMatch').val('false');\n } else if (pass != '' && re_pass == '') {\n //$('#UserPasswordVisit').val(true);\n\t$('#passwordError').html('Type your password again to insure accuracy.');\n $('#UserPMatch').val('false');\n } else if (pass != re_pass) {\n\t$('#passwordError').html('The passwords don\\'t match.');\n $('#UserPMatch').val('false');\n } else {\n\t$('#passwordError').html('');\n $('#UserPMatch').val('true');\n }\n }", "title": "" }, { "docid": "343c63b1ae873c5f5b67284739c74d3e", "score": "0.7201649", "text": "function changePassword(){\r\n\t\tconsole.log(\"Changing Password\");\r\n \r\n // bunus1, task 6.b\r\n // password checking\r\n // when three input boxes are not empty\r\n //show the submit button\r\n //else, hide the submit button\r\n if($('#oldpwd').val()!=\"\" && $('#newpwd').val()!=\"\" && $('#verifypwd').val()!=\"\"){\r\n \t$('#submitNewPassword').show();\r\n //when three input password are not same\r\n //show warning information\r\n //just check the new password and the verify password is enough\r\n \tif($('#newpwd').val()!=$('#verifypwd').val()){\r\n $('.warningInfo').show();\r\n\t\t\t$('.wrongInfo').hide();\r\n \t} \r\n \telse {\r\n \t\t $('.warningInfo').hide();\r\n\t\t\t $('.wrongInfo').hide();\r\n \t}\r\n }\r\n else {\r\n \t$('#submitNewPassword').hide();\r\n }\r\n\r\n\t}", "title": "" }, { "docid": "f33784218318ddb0fe3014a81a44426f", "score": "0.7178344", "text": "function samePassword(field1, field2) {\n if (field1.value != field2.value) {\n setInvalid(field2, `Password not match`);\n return false;\n } else {\n setValid(field2);\n return true;\n }\n\n}", "title": "" }, { "docid": "6b25d29dc06353af7abee6539949b5f8", "score": "0.7141195", "text": "processPassRep() {\n if (this.password.value !== this.passwordRepeat.value) {\n this.passwordRepeat.err = true\n this.passwordRepeatErr.seen = true\n this.valid = false\n this.passwordRepeatErr.text = 'رمز عبور و تکرار آن یکسان نیستند'\n } else {\n this.passwordRepeat.err = false\n this.passwordRepeatErr.seen = false\n }\n }", "title": "" }, { "docid": "ac3f1f187fce4876a02dcbe38c1df745", "score": "0.7096431", "text": "function samePassword(p1, p2) {\n if (p1 !== p2) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "44e023fb94bf53e8c75969d9ceef4794", "score": "0.70913416", "text": "function newPW(){\n if(req.body.password === req.body.confirm) {\n user.setPassword(req.body.password, function(err) {\n if(err) {\n req.flash(\"error\", err.message);\n }\n user.save();\n });\n } else {\n req.flash(\"error\", \"Oops, passwords do not match.\");\n return res.redirect('back');\n }\n }", "title": "" }, { "docid": "d52eaf60b1b79f50eb95c7e179873b3a", "score": "0.7083734", "text": "function validatePassword1(page){\n\n if(page == \"inv_researcher\"){\n var error = document.getElementById('validation__inv_researcher_password1');\n var reenterPassword = document.getElementById('researcher_password2');\n \n } else {\n var error = document.getElementById('validation__researcher_password1');\n var reenterPassword = document.getElementById('new__researcher_password2');\n }\n \n // To make sure to update the message for Password2 if the user decides\n // to change Password 1\n if(reenterPassword.value != \"\") {\n if(page == \"inv_researcher\"){\n validatePassword2(\"inv_researcher\");\n\n } else {\n validatePassword2();\n }\n }\n\n // Check if password valid\n if(page == \"inv_researcher\"){\n if(simplePasswordCheck('inv_researcher')){\n error.innerHTML = \"No errors.\";\n error.classList.add(\"correct\");\n error.classList.remove(\"incorrect\");\n return true;\n }\n } else {\n // Check if the entered password is valid\n if(simplePasswordCheck()){\n error.innerHTML = \"No errors.\";\n error.classList.add(\"correct\");\n error.classList.remove(\"incorrect\");\n return true;\n }\n }\n \n // If not valid, error message\n error.classList.add(\"incorrect\");\n error.classList.remove(\"correct\");\n error.innerHTML = \"Password must contain at least 8 characters and include uppercase, lowercase and numbers.\"\n \n return false;\n \n}", "title": "" }, { "docid": "717649a0c8bcab44bd7d4b61d293d161", "score": "0.7070899", "text": "function checkUserRePass() {\r\n var userPassword = $(\"#userPassword\").val();\r\n var userRePass = $(\"#userRePass\").val();\r\n var flag = false;\r\n if (userPassword != userRePass) {\r\n flag = true;\r\n }\r\n if (flag) {\r\n $(\".btn-error-pass\").show();\r\n return true;\r\n } else {\r\n $(\".btn-error-pass\").hide();\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "3c7f34cee7bec20fa224ec22c69385b7", "score": "0.7054901", "text": "function checkValues(){\n checkCurrentPassword();\n checkPassword();\n checkPasswordConfirm();\n if(checkPassword() === true && checkPasswordConfirm() === true){\n changePassword();\n }\n}", "title": "" }, { "docid": "df7f4aef29950ad86e3a901c6e54bd78", "score": "0.7001471", "text": "function newPasswordCheck(password1, password2){\n\tif(password1 !== password2){\n\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "ac93360d6aa24f59d73b14f3a72a3cd7", "score": "0.6985188", "text": "function validatePassword2(page){\n \n if (page == \"inv_researcher\"){\n var inputPassword = document.getElementById('researcher_password1');\n var reenterPassword = document.getElementById('researcher_password2');\n var error = document.getElementById('validation__inv_researcher_password2');\n if(inputPassword.value == \"\" && reenterPassword.value==\"\"){\n return true;\n }\n } else {\n var inputPassword = document.getElementById('new__researcher_password1');\n var reenterPassword = document.getElementById('new__researcher_password2');\n var error = document.getElementById('validation__researcher_password2');\n }\n \n\n\n // Check if the a value has been entered into the first\n // password box\n if(inputPassword == \"\"){\n error.innerHTML = \"Please input password first.\"\n error.classList.add(\"incorrect\");\n error.classList.remove(\"correct\");\n return false;\n }\n\n if(page == \"inv_researcher\"){\n if(!simplePasswordCheck('inv_researcher')){\n error.innerHTML = \"Password is invalid. Please fix this.\"\n error.classList.add(\"incorrect\");\n error.classList.remove(\"correct\");\n return false;\n }\n } else {\n // Check if the entered password is valid\n if(!simplePasswordCheck()){\n error.innerHTML = \"Password is invalid. Please fix this.\"\n error.classList.add(\"incorrect\");\n error.classList.remove(\"correct\");\n return false;\n }\n }\n \n\n // Check if the passwords match\n if(inputPassword.value == reenterPassword.value){\n error.innerHTML = \"No errors.\"\n error.classList.add(\"correct\");\n error.classList.remove(\"incorrect\");\n return true;\n } \n \n // If not valid, error message\n error.innerHTML = \"Passwords must match.\"\n error.classList.add(\"incorrect\");\n error.classList.remove(\"correct\");\n\n return false;\n \n}", "title": "" }, { "docid": "5a84db1064422ac7c8fe688ce3935d5c", "score": "0.6965943", "text": "function isPasswordSame(pass1,pass2){\n\n\tif(pass1 !== pass2){\n\n\t\tdocument.getElementById(\"password_label\").style.color = \"red\";\n\t\tdocument.getElementById(\"password\").style.borderColor = \"red\";\n\t\tdocument.getElementById(\"cnfPassword_label\").style.color = \"red\";\n\t\tdocument.getElementById(\"cnfPassword\").style.borderColor = \"red\";\n\t\tdocument.getElementById(\"cnfPassword_text\").style.display = \"block\";\n\t\tdocument.getElementById(\"cnfPassword_text\").innerHTML = \"*NOTE: Two password didn't matched\";\n\t\treturn false;\n\n\t}else{\n\t\tdocument.getElementById(\"password_label\").style.color = \"#679FFF\";\n\t\tdocument.getElementById(\"cnfPassword\").style.borderColor = \"#679FFF\";\n\t\tdocument.getElementById(\"cnfPassword_label\").style.color = \"#679FFF\";\n\t\tdocument.getElementById(\"cnfPassword_text\").style.display = \"none\";\n\t\tdocument.getElementById(\"password_text\").style.display = \"none\";\n\t}\n\t\n\treturn true;\n\n}", "title": "" }, { "docid": "ca7bb3e7806285f6b1f3fe654c08b1ef", "score": "0.6955382", "text": "function checkPass(pass1, pass2) {\r\n if(page === 0){\r\n return false;\r\n }\r\n //We can do this validation through html's minimum character attribute\r\n if (pass1 !== pass2) {\r\n document.getElementById(\"password\").style.borderColor = \"red\";\r\n document.getElementById(\"passwordConf\").style.borderColor = \"red\";\r\n document.getElementById(\"errorSpace\").innerHTML = \"<p class='alert-warning'>Please ensure that the passwords entered are the same.</p>\";\r\n return false;\r\n }\r\n if (pass1 === pass2) {\r\n return true;\r\n }\r\n}", "title": "" }, { "docid": "fd27048cf30e419dab3aa3af431b677e", "score": "0.6908291", "text": "checkChangePassword() {\n if (this.state.oldPassword && this.state.password && this.state.confirmPassword) {\n if (this.state.password == this.state.oldPassword) {\n Toast.show({\n text: \"Le nouveau mot de passe ne peut être le même que l'ancien\",\n duration : 3000,\n buttonText: \"Okay !\",\n type: \"danger\"\n });\n }\n else if (this.state.password != this.state.confirmPassword) {\n Toast.show({\n text: \"La confirmation du mot de passe est incorrecte\",\n duration : 3000,\n buttonText: \"Okay !\",\n type: \"danger\"\n });\n }\n else if (!this._checkPassword()) {\n Toast.show({\n text: \"Le mot de passe doit faire entre 6 et 50 caractères et contenir au moins une minuscule, une majuscule et un chiffre\",\n duration : 3000,\n buttonText: \"Okay !\",\n type: \"danger\"\n });\n }\n else {\n this.changePassword();\n }\n }\n else {\n Toast.show({\n text: \"Veuillez remplir les champs\",\n duration : 3000,\n buttonText: \"Okay !\",\n type: \"danger\"\n });\n }\n }", "title": "" }, { "docid": "fe10a6319c3149d19fbfd0f9abbdd8fd", "score": "0.69025975", "text": "function checkPassword(form) {\n password1 = form.password1.value;\n password2 = form.password2.value;\n \n // If Not same return False. \n if (password1 != password2) {\n $(\"#passMismatch\").removeAttr(\"hidden\");\n return false;\n } else if (password2.length < 6){\n $(\"#toShortPass\").removeAttr(\"hidden\");\n return false;\n } else{\n $(\"#changedSuccess\").removeAttr(\"hidden\");\n\n alert (\"\\nPassword was succesfully updated!\")\n \n return true;\n\n \n }\n}", "title": "" }, { "docid": "1a871dac955b01c5666c82111e6ba8fa", "score": "0.68984926", "text": "function MatchPassword(vPassword){\n\nvar NPassword = document.getElementById('NPassword').value;\nvar Holder = document.getElementById('Holder').value;\nvar doesMatch = true;\n\n\tif (NPassword == vPassword){\n\t\tdoesMatch = true;\n\t} else if (NPassword != vPassword){\n\t\tdoesMatch = false;\n\t}\n\n\tif (doesMatch == true){\n\t\t\n\t} else {\n\t\t\n\t}\n}", "title": "" }, { "docid": "1fb4fe344a6234dd1e38e668c9a7e5fa", "score": "0.6872681", "text": "function confirmPwd() {\n if (form.password.value == form.confirmPass.value) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "414ff622a2ec1c3bc2092bfa7fdc7a28", "score": "0.6861009", "text": "function checkPasswordMatch($id, $id2)\n{\n\t\tif ($(\"form#wifi-ap input[name = 'wifipassword']\").val() != $(\"form#wifi-ap input[name = 'rwifipassword']\").val())\n\t\t{\n\t\t\t$(\"#\" + $id2 + \" > .errorMsg\").text(\"Password and re-entered password do not match\").show();\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$(\"#\" + $id2 + \" > .errorMsg\").empty();\n\t\t\treturn true;\n\t\t}\n}", "title": "" }, { "docid": "d069e0e84a8af8501ca43d226cb9d8c0", "score": "0.6855868", "text": "function validatePasswordEditForm(){\n\tif(isStringNullOrEmpty(passwordEditFieldOldPassword.value)){\n\t\talert(getLocalMessage(MSG_PWD_CHANGE_NO_PASSWORD));\n\t\treturn false;\n\t} else if(isStringNullOrEmpty(passwordEditFieldNewPassword.value)){\n\t\talert(getLocalMessage(MSG_PWD_CHANGE_NO_NEW_PASSWORD));\n\t\treturn false;\n\t}\n\t\n\t//Prepare the signup object\n\tpasswordObject.old_pass = passwordEditFieldOldPassword.value;\n\tpasswordObject.new_pass = passwordEditFieldNewPassword.value;\n\t\n\treturn true;\n}", "title": "" }, { "docid": "3037abeb324c03b0ff6bd2adc2f26736", "score": "0.68530244", "text": "function checkLogin() {\n console.log($(\"#passcode\").val());\n console.log(getPassword());\n if (localStorage.getItem(\"account\") == null) {\n window.location.replace(\"#page-password\");\n }\n else if ($(\"#passcode\").val() == getPassword() && localStorage.getItem(\"disclaimer\") == null) {\n window.location.replace(\"#disclaimer-page\");\n clearContents();\n } else if ($(\"#passcode\").val() == getPassword() && localStorage.getItem(\"user\") == null) {\n window.location.replace(\"#page-user-info\");\n } else if ($(\"#passcode\").val() == getPassword()) {\n window.location.replace(\"#page-menu\");\n }\n}", "title": "" }, { "docid": "6313d721ad2326ed784843029ce79676", "score": "0.684252", "text": "function checkNewUserValidity(username, pass, passRep){\r\n\t\t\r\n\t\tif( checkParamSize(username, \"Username\") < 0 || checkParamSize(pass, \"Password\") < 0){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(pass != passRep){\r\n\t\t\tlet logErrorDiv = document.getElementById(\"errorLog\");\r\n\t\t\tlogErrorDiv.innerHTML = \"passwords dont match.\";\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\treturn -1;\r\n\t\t\r\n\t}", "title": "" }, { "docid": "77237700270b5b82de10b2c457d7f22a", "score": "0.68308854", "text": "function matchPassword(form) { \r\n pw1 = form.pswd1.value;\r\n pw2 = form.pswd2.value;\r\n\r\n if(pw1 != pw2) \r\n { \r\n alert(\"Passwords did not match\"); \r\n return false;\r\n } else { \r\n alert(\"Account created successfully\"); \r\n return true;\r\n } \r\n }", "title": "" }, { "docid": "fa1053ced19b6fa1efed4a8969406044", "score": "0.682682", "text": "function mod_edit_password() {\n\t//var flag test\n\tflag1 = 0;\n\tflag2 = 0;\n\t\n\t//validate password\n\tif($('#password').val() == \"\")\n\t{\n\t\t$('#error_password').html('Mật khẩu không được để trống !');\t\n\t\tflag1 = 0;\n\t}\n\telse if(is_password($('#password').val())== false)\n\t{\n\t\t$('#error_password').html('Mật khẩu nhập sai quy tắc(tối thiểu 6 kí tự)!');\t\n\t\tflag1 = 0;\n\t}\n\telse\n\t{\n\t\t$('#error_password').html('');\t\n\t\tflag1 = 1;\n\t}\n\t\n\t//validate re-password\n\tif($('#password').val() != $('#re_password').val())\n\t{\n\t\t$('#error_re_password').html('Mật khẩu nhập lại không giống nhau!');\t\n\t\tflag2 = 0;\n\t}\n\telse\n\t{\n\t\t$('#error_re_password').html('');\t\n\t\tflag2 = 1;\n\t}\n\t\n\tif(flag1 == 0 || flag2 == 0)\n\t\treturn false;\n\telse\n\t\treturn true;\n\n}", "title": "" }, { "docid": "bf16369b441a23237b2ab51c0df5d9c8", "score": "0.6818209", "text": "function validateChangedUserPassword(){\r\n \r\n}", "title": "" }, { "docid": "3ea208ca79dfed5cb36364ca4a6fb9c5", "score": "0.6805674", "text": "function validateChangedUserPassword(){\r\n var password1 = document.querySelector('#oldPassword').value;\r\n var password2 = document.querySelector('#newPassword').value;\r\n var password3 = document.querySelector('#newPasswordRepeated').value;\r\n if (password1 && password2 && password3){\r\n userController.validateChangedUserPassword(password1, password2, password3);\r\n }\r\n else \r\n showChangePasswordError(\"Je nutné vyplnit všechny položky!\");\r\n}", "title": "" }, { "docid": "58830eb0a830315066ba90dad186dbe2", "score": "0.67797434", "text": "function comparePassword() {\r\n if (oldPassword.value === newPassword.value && newPassword.value.length && oldPassword.value.length) {\r\n button.disabled = true;\r\n document.querySelector('.errorBlock').style.display = 'block';\r\n } else {\r\n document.querySelector('.errorBlock').style.display = 'none';\r\n }\r\n }", "title": "" }, { "docid": "dd04dcaa6e8cb2b48e5ba837419cc540", "score": "0.67706484", "text": "function check_password_match(){\r\n if($('#Password').val() != $('#conPassword').val()){\r\n $('#passwordmatch').html(\"passwords do not match\");\r\n\r\n }\r\n else{\r\n $('#passwordmatch').html(\"passwords match\");\r\n }\r\n }", "title": "" }, { "docid": "0706cf64a03c35d2fd49575486ed30f7", "score": "0.6753135", "text": "function same_password() {\n\tvar temp_1 = document.getElementById(\"password\").value;\n\tvar temp_2 = document.getElementById(\"confirm_password\").value;\n\tvar password_prompt = document.getElementById(\"confirm_password_span\");\n\tif (temp_1 != null) {\n\t\tif (temp_1 == temp_2) {\n\t\t\tpassword_prompt.innerHTML = \"<img src=\\\"../material/ok.jpg\\\" alt=\\\"ok\\\" />\";\n\t\t} else {\n\t\t\tpassword_prompt.innerHTML = \"<img src=\\\"../material/warning.jpg\\\" alt=\\\"warning\\\" />\";\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5527b80b9107be8cca805fb5ba998c38", "score": "0.6749417", "text": "function refreshMainPassword(called_from_verify)\n\t{\n\t\tif (!verificationFields.pwmain)\n\t\t\treturn false;\n\n\t\tvar curPass = verificationFields.pwmain[1].value, result = '';\n\n\t\t// Is it a valid length?\n\t\tif ((curPass.length < 8 && passwordDifficultyLevel >= 1) || curPass.length < 4)\n\t\t\tresult = $txt['registration_password_short'];\n\n\t\t// More than basic?\n\t\tif (passwordDifficultyLevel >= 1)\n\t\t{\n\t\t\t// If there is a username, check it's not in the password!\n\t\t\tif (verificationFields.username && verificationFields.username[1].value && curPass.indexOf(verificationFields.username[1].value) != -1)\n\t\t\t\tresult = $txt['registration_password_reserved'];\n\n\t\t\t// Any reserved fields?\n\t\t\tfor (var i in verificationFields)\n\t\t\t\tif (verificationFields[i][3] == 'reserved' && verificationFields[i][1].value && curPass.indexOf(verificationFields[i][1].value) != -1)\n\t\t\t\t\tresult = $txt['registration_password_reserved'];\n\n\t\t\t// Finally - is it hard and, as such, requiring mixed cases and numbers?\n\t\t\tif ((passwordDifficultyLevel > 1) && ((curPass == curPass.toLowerCase()) || (!curPass.match(/(\\D\\d|\\d\\D)/))))\n\t\t\t\tresult = $txt['registration_password_numbercase'];\n\t\t}\n\n\t\tvar isValid = result == '';\n\n\t\t// Set the image.\n\t\tsetVerificationImage(verificationFields.pwmain[2], isValid, result || $txt['registration_password_valid']);\n\t\tverificationFields.pwmain[1].className = verificationFields.pwmain[4] + ' ' + (isValid ? 'valid' : 'invalid') + '_input';\n\n\t\t// As this has changed the verification one may have too!\n\t\tif (verificationFields.pwverify && !called_from_verify)\n\t\t\trefreshVerifyPassword();\n\n\t\treturn isValid;\n\t}", "title": "" }, { "docid": "89ba36974a9ed62588e982290bd39a4d", "score": "0.6737992", "text": "function matching() {\n if (passwordConfirmation.value.trim() === \"\" || passwordConfirmation.value.trim().length < 6 || passwordConfirmation.value.trim().length > 255) {\n notValidPasswordConfirmation();\n } else {\n if (passwordConfirmation.value.trim() === newPassword.value.trim()) {\n validPasswordConfirmation();\n } else {\n notValidPasswordConfirmation();\n }\n }\n}", "title": "" }, { "docid": "5164e1e2a6200a1d723f98b2cddaee1d", "score": "0.6737228", "text": "function CheckpasswordMatch(password,password2){\n if(password!==password2)\n {\n showError(password2,`Password Does not Match`)\n }\n}", "title": "" }, { "docid": "aa0c4fc68fd212b57cff890dc897f229", "score": "0.6735886", "text": "function ChangePassWordFormValidation(){\n var errmsg=document.getElementById(\"errmsg\");\n var lga= /^[a-z A-Z0-9,-_.]{4,35}$/;\n\n var opass=document.forms[\"form5\"][\"opass\"].value;\n var npass=document.forms[\"form5\"][\"npass\"].value;\n var vnpass=document.forms[\"form5\"][\"vnpass\"].value;\n \n if(opass.trim(opass)==\"\"){\n alert(\"Old Password is Empty\");\n errmsg.innerHTML=\"Please enter a value in the Old Password field.\".bold().fontsize(\"4\").fontcolor(\"red\");\n document.forms[\"form5\"][\"opass\"].focus();\n return false;\n\n }\n else if(!opass.trim(opass).match(lga)){\n alert(\"Make sure there are no numbers or special\\n characters(eg:1,;@,&,'',$) in the Old Password field and that the number of characters is atleast 4.\");\n errmsg.innerHTML=\"Make sure there are no numbers or special\\n characters(eg:1,;@,&,'',$) in the Old Password field and that the number of characters is atleast 4.\".bold().fontsize(\"4\").fontcolor(\"red\");\n document.forms[\"form5\"][\"opass\"].focus();\n return false;\n}\nelse if(npass.trim(npass)==\"\"){\n\n alert(\"New Password is Empty\");\n errmsg.innerHTML=\"Please enter a value in the New Password field.\".bold().fontsize(\"4\").fontcolor(\"red\");\n document.forms[\"form5\"][\"npass\"].focus();\n return false;\n}\n else if(!npass.trim(npass).match(lga)){\n alert(\"Make sure there are no numbers or special\\n characters(eg:1,;@,&,'',$) in the New Password field.\");\n errmsg.innerHTML=\"Make sure there are no numbers or special\\n characters(eg:1,;@,&,'',$) in the New Password field.\".bold().fontsize(\"4\").fontcolor(\"red\");\n document.forms[\"form5\"][\"npass\"].focus();\n return false;\n}\nelse if(vnpass.trim(vnpass)==\"\"){\n\n alert(\"Verify New Password is Empty\");\n errmsg.innerHTML=\"Please enter a value in the 'Verify New Password' field.\".bold().fontsize(\"4\").fontcolor(\"red\");\n document.forms[\"form5\"][\"vnpass\"].focus();\n return false;\n}\n else if(!vnpass.trim(vnpass).match(lga)){\n alert(\"Make sure there are no numbers or special\\n characters(eg:1,;@,&,'',$) in the 'Verify New Password'.\");\n errmsg.innerHTML=\"Make sure there are no numbers or special\\n characters(eg:1,;@,&,'',$) in the 'Verify New Password'.\".bold().fontsize(\"4\").fontcolor(\"red\");\n document.forms[\"form5\"][\"vnpass\"].focus();\n return false;\n}\nelse if(npass.trim(npass)!=vnpass.trim(vnpass))\n {\n alert(\"New Password and Verify New Password Field must be the same\");\n errmsg.innerHTML=\"<strong> 'New Password' and 'Verify New Password' Field must be the same</strong>\".bold().fontcolor(\"red\").fontsize(\"4\");\n document.forms[\"form5\"][\"vnpass\"].focus();\n return false;\n }\n\nelse{\n return true;\n\n}\n\n}", "title": "" }, { "docid": "3e48d1ffa5bf64e0d64d38e6d086238c", "score": "0.6735777", "text": "function CheckPassverifyRegister(strpass, strpassverify)\r\n{\r\n\tif ( strpassverify.length == 0 )\r\n\t{\r\n\t\tbolErrorPassword2 = true;\r\n\t\tstrErrorPassword2 = 'Xin vui lòng nhập chính xác Password ở trên';\r\n\t\treturn 41;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tif ( strpassverify.indexOf(\"<\")!= '-1' || strpassverify.indexOf(\">\") != '-1' )\r\n\t\t{\r\n\t\t\tbolErrorPassword2 = true;\r\n\t\t\tstrErrorPassword2 = 'Xin vui lòng nhập chính xác Password ở trên';\r\n\t\t\treturn 42;\r\n\t\t}\r\n\t\telse\r\n\t\t{\t\t\r\n\t\t\tif ( strpassverify.length < 3 || strpassverify.length > 30 )\r\n\t\t\t{\r\n\t\t\t\tbolErrorPassword2 = true;\r\n\t\t\t\tstrErrorPassword2 = 'Xin vui lòng nhập chính xác Password ở trên';\r\n\t\t\t\treturn 43;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\t\r\n\t\t\t\tif ( !Checkchar1( strpassverify ) )\r\n\t\t\t\t{\r\n\t\t\t\t\tbolErrorPassword2 = true;\r\n\t\t\t\t\tstrErrorPassword2 = 'Xin vui lòng nhập chính xác Password ở trên';\r\n\t\t\t\t\treturn 44;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\tif ( strpassverify != strpass )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tbolErrorPassword2 = true;\r\n\t\t\t\t\t\tstrErrorPassword2 = 'Xin vui lòng nhập chính xác Password ở trên';\t\t\r\n\t\t\t\t\t\treturn 45;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\t\r\n\t\t\t\t\t\tbolErrorPassword2 = false;\r\n\t\t\t\t\t\treturn 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn 1;\r\n}", "title": "" }, { "docid": "fc7d9d6548fd428c24729cd18e1cadca", "score": "0.6720711", "text": "function checkPass()\n{\n //Store the password field objects into variables\n var pass1 = document.getElementById('password');\n var pass2 = document.getElementById('passwordhashed');\n //Store the Confimation Message Object\n var message = document.getElementById('confirmpass');\n\t//Get next button for enabling/disabling\n\tvar nextBtn = document.getElementById('nextToPage2');\n // For change password form\n var passwordentered = false;\n //Colour red and green\n var greenColor = \"#85FF89\";\n var redColor = \"#FF6262\";\n //Compare the values in the password field\n //and the confirmation field when\n // 1. pass2's been changed to non-empty or\n // 2. the message's been changed (i.e., pass2's been\n // changed before)\n if(pass2.value != '' || passwordentered) {\n var passValidity = passValid(pass1.value);\n if(pass1.value == pass2.value && passValidity == 1) {\n // The passwords match and are valid.\n pass2.style.backgroundColor = greenColor;\n if(message != null) {\n message.style.color = greenColor;\n message.innerHTML = \"<strong>OK!</strong>\"\n if (nextBtn != null) {\n nextBtn.disabled = false;\n }\n }\n } else {\n if (pass1.value != pass2.value) {\n // The passwords do not match.\n pass2.style.backgroundColor = redColor;\n if(message != null) {\n message.style.color = redColor;\n message.innerHTML = \"<strong>Passwords do not match!</strong>\";\n if (nextBtn != null) {\n nextBtn.disabled = true;\n }\n }\n }\n else {\n // The passwords match but are invalid.\n pass2.style.backgroundColor = redColor;\n if(message != null) {\n message.style.color = redColor;\n }\n if (passValidity == -1) {\n if(message != null) {\n message.innerHTML = \"<strong>Password is too short!</strong>\";\n }\n }\n else {\n if(message != null) {\n message.innerHTML = \"<strong>Password must include at least 1 letter and 1 number.</strong>\";\n }\n }\n if (nextBtn != null) {\n nextBtn.disabled = true;\n }\n }\n }\n passwordentered = true;\n }\n}", "title": "" }, { "docid": "6d22c48fad1e5d97608481bdda7b3ace", "score": "0.6718171", "text": "function samePasswords()\n{\n if($(\"#user_password_confirmation\").val() != $(\"#user_password\").val())\n {\n $(\"#password_error\").removeClass(\"hidden\");\n $(\"#password_error\").show();\n return false;\n }\n else\n {\n $(\"#password_error\").hide();\n return true;\n }\n}", "title": "" }, { "docid": "f513c03286b4a244d722ef48a1f7eb32", "score": "0.67125875", "text": "function checkMatchingPasswords() {\n if ($confirmBox.val() != \"\" && $passwordBox.val != \"\") {\n if ($confirmBox.val() != $passwordBox.val()) {\n $confirmBox.removeClass(\"valid\");\n $confirmBox.addClass(\"invalid\");\n $errorMsg.insertAfter($confirmBox);\n }\n }\n }", "title": "" }, { "docid": "cb68e45be5e70d9fbc79b5465b11dd83", "score": "0.6710491", "text": "function checkPass() {\n return $(\"#rePass\").val() === $(\"#pass\").val();\n}", "title": "" }, { "docid": "5f4a287b64aa24f5af04a0fa80871ddd", "score": "0.6707532", "text": "function checkPassword() {\n var password = document.getElementById(\"password\").value;\n var rePassword = document.getElementById(\"rePassword\").value;\n if (password !== rePassword) {\n new PNotify({\n title: 'Password Error!',\n text: 'The Password must be match!'\n });\n }\n}", "title": "" }, { "docid": "27974ac191bc1b4cb3daea47d92d0aa6", "score": "0.67036116", "text": "function changePW() {\n password = $('#txt-settings-password').val();\n passwordConfirm = $('#txt-settings-password-confirm').val();\n\n if (password === '' || passwordConfirm === '') {\n popup('settings-popup', 'Fehlende Angaben', 'Bitte füllen Sie alle Felder aus.', 2000);\n return;\n }\n if (password !== passwordConfirm) {\n popup('settings-popup', 'Fehler', 'Die Beiden Passwörter stimmen nicht überein', 2000);\n return;\n }\n\n putData = {};\n putData.Password = password;\n put('users/' + userId, JSON.stringify(putData), function(data) {\n if (noError(data)) {\n popup('settings-popup', 'Erfolg', 'Passwort erfolgreich geändert', 2000);\n localPW = localStorage.getItem('password')\n if (localPW && localPW !== password) {\n localStorage.setItem('password', password);\n }\n } else {\n popup('settings-popup', data.type, data.message, 2000);\n }\n });\n}", "title": "" }, { "docid": "932a24c42ac71228fffd597bc20dae1b", "score": "0.66990703", "text": "function check() {\n var newName = document.getElementById('userName');\n var newPw = document.getElementById('userPw');\n console.log(newName.value + \" ! \" + newPw.value)\n\n // Tallennettu data rekiströnti-lomakkeesta\n let storedPw = localStorage.getItem(newName.value);\n let localData = (newName.value + storedPw);\n\n // Syötetty login data\n let userName = document.getElementById('userName');\n let inputData = (userName.value + newPw.value);\n console.log(localData + \" :) \" + inputData);\n\n // tarkistaa matchaako rekisteröinti ja kirjautuminen\n if (localData == inputData) {\n alert(`Teretulemast ${userName.value}!`);\n localStorage.setItem('currentUser', userName.value);\n activeUser()\n // currentUsername.innerHTML = `<p> Sisäänkirjautunut: ${currentUser}</p>`\n } else {\n alert('Vale kasutajanimi või salasõna!');\n }\n}", "title": "" }, { "docid": "db9e336a4c91091552fdf13e95f95423", "score": "0.6697404", "text": "async function change_pw(verification_pw, new_pw) {\n if (!check_login())\n return false;\n \n await sha256(verification_pw).then(hash => {\n if (users[current_user_index]['password'] != hash) \n return false;\n });\n \n await sha256(new_pw).then(new_hash => {\n users[current_user_index]['password'] = new_hash;\n _set_local_storage(\"users\", JSON.stringify(users));\n return true;\n });\n}", "title": "" }, { "docid": "861238ec0bfa6ae9cc5596cfec005b68", "score": "0.66970927", "text": "function checkPassword() {\n\t if (document.getElementById('pwd').value ==\n\t document.getElementById('pwd-repeat').value) {\n\t document.getElementById('message').style.color = 'green';\n\t document.getElementById('message').innerHTML = 'matching';\n\t } else {\n\t document.getElementById('message').style.color = 'red';\n\t document.getElementById('message').innerHTML = 'not matching';\n\t }\n\t}", "title": "" }, { "docid": "eaf311d713e5569cdd7474af76c35df6", "score": "0.66961914", "text": "newpasss() {\n const newUser = {\n email: this.state.chkmail,\n\n password: this.state.oldpassword\n }\n checkpassword(newUser).then(res => {\n if (res == \"Matched\") {\n $('#nwpassslbl').show();\n $('#nwpasss').show();\n }\n else {\n alert(\"Password Wrong\");\n \n }\n\n\n })\n\n\n }", "title": "" }, { "docid": "7147f5a2fead59b399395773a8dc4447", "score": "0.66946733", "text": "function NewPassword() {\n var newpass = document.getElementById(\"f5\").value,\n errorpass = document.getElementById(\"errorPassword\");\n var testing = false;\n if (!newpass) {\n errorpass.style.display = \"block\";\n errorpass.textContent = \"* This field can't be empty\";\n testing = true;\n }\n else if (validatePassword(newpass) == false) {\n errorpass.style.display = \"block\";\n errorpass.textContent = \"* Invalid Password,minimum length:8, include number and upper ,lower case character\";\n testing = true;\n\n } else {\n errorpass.style.display = \"none\";\n testing = false;\n }\n\n if (testing == true) {\n return 1;\n } else {\n return 0;\n }\n}", "title": "" }, { "docid": "66ff0541507c2870dbaf32458c186698", "score": "0.6691074", "text": "function validate_change_pwd()\r\n{\r\n\t var currentpwd = document.forms.frmChangePwd.currentpwd.value;\r\n var newpwd = document.forms.frmChangePwd.newpwd.value;\r\n var confirmpwd = document.forms.frmChangePwd.confirmnew.value;\r\n \r\n var currentpwdLen = currentpwd.length; \r\n var newpwdLen = newpwd.length; \r\n var confirmpwdLen = confirmpwd.length;\r\n\r\n if( currentpwdLen==0 || newpwdLen==0 || confirmpwdLen==0 )\r\n {\r\n alert(\"Error all fields must be completed.\");\r\n return false;\r\n }\r\n\r\n if( currentpwdLen < 7 )\r\n {\r\n alert(\"Invalid current password - minimum length is 7 characters \");\r\n return false;\r\n }\r\n\r\n if( newpwdLen < 7 )\r\n {\r\n alert(\"Invalid new password - minimum length is 7 characters \");\r\n return false;\r\n }\r\n\r\n if( newpwd != confirmpwd )\r\n {\r\n alert(\"New passwords entered do not match \");\r\n return false;\r\n }\r\n \r\n return true;\r\n}", "title": "" }, { "docid": "63c322edc3a329936e0ba8565e288b36", "score": "0.6672045", "text": "function validateEditPassword() {\n\tconst pass = document.getElementById(\"newpassword\").value;\n\tconst cpass = document.getElementById(\"cpassword\").value;\n\tif (pass == cpass) {\n\t\treturn true;\n\t} else {\n\t\talert(\"Passwords should be equal.\");\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "3585c9a2c4bc62ae8ca15881629f612c", "score": "0.6671694", "text": "function validateConfirmPassword() {\n //check if empty\n if (checkIfEmpty(cpwd)) return;\n //check password is same or not\n if (!samePassword(pwd, cpwd)) return\n return true;\n\n}", "title": "" }, { "docid": "a2b3a9257f9a374de0c91e8d12f44934", "score": "0.6656152", "text": "function validatePass() {\n var password = document.forms[\"resetPass\"][\"password\"].value;\n var cpassword = document.forms[\"resetPass\"][\"cpassword\"].value;\n\n if (cpassword != password) {\n alert(\"Type the same Password!\");\n return false;\n } else {\n alert(\"Successfully, the new password is created.\");\n return true;\n }\n}", "title": "" }, { "docid": "41120c1635e49da4b07684ac2455efc8", "score": "0.6647877", "text": "function checkPassword () {\n uiState = stateBuilder.run(uiState);\n advisorsOptics.updateFromState(uiState);\n console.log('uiState update: ', uiState);\n continueButtonOptic(uiState);\n}", "title": "" }, { "docid": "e57d7b23db95d9ff2c10a41dbab63ce0", "score": "0.6623905", "text": "function validatechangepwd(){ \n //validate old password\n if(document.forms[\"changepwd\"][\"password\"]){\n var password=document.forms[\"changepwd\"][\"password\"].value;\n password = $.trim(password);\n $(\"#password\").val(password);\n var password_max_length= 64;\n var password_min_length= 6;\n if (password==null || password==\"\"){\n //errorMessage(\"label_password\", \"(This field is required)\");\n $('input#password').addClass('required');\n invalid = true;\n }else if(password.length > password_max_length || password.length < password_min_length){\n $('input#password').addClass('required');\n errorMessage(\"label_password\", \"(Required minimum \"+ password_min_length +\" characters)\");\n invalid = true;\n }//else if(!password.match(/^.*(?=.{6,})(?=.*[a-zA-Z])(?=.*\\d)(?=.*[_.!@#$%^()+ \"]).*$/)){\n else if(!password.match(((/^\\S |^[a-zA-Z0-9~!@#$%^&*\\(\\)_+}{\\|\\\":?><`\\-=\\\\\\]\\[';\\/\\.\\,]{6,}$/)))){\n //errorMessage(\"label_newpwd\", \"Please enter valid password\");\n $('input#password').addClass('required');\n invalid = true;\n }else{\n errorMessage(\"label_password\", \"\");\n $('input#password').removeClass('required');\n }\n }\n //validate new password\n if(document.forms[\"changepwd\"][\"newpwd\"]){\n var newpwd=document.forms[\"changepwd\"][\"newpwd\"].value;\n var invalid = '';\n newpwd = $.trim(newpwd);\n $(\"#newpwd\").val(newpwd);\n var newpwd_max_length= 64;\n var newpwd_min_length= 6;\n if (newpwd==null || newpwd==\"\"){\n //errorMessage(\"label_newpwd\", \"(This field is required)\");\n $('input#newpwd').addClass('required');\n invalid = true;\n }else if(newpwd.length > newpwd_max_length || newpwd.length < newpwd_min_length){\n $('input#newpwd').addClass('required');\n errorMessage(\"label_newpwd\", \"(Required minimum \"+ newpwd_min_length +\" characters)\");\n invalid = true;\n \n }//else if(!newpwd.match(/^.*(?=.{6,})(?=.*[a-zA-Z])(?=.*\\d)(?=.*[_.!@#$%^()+ \"]).*$/)){\n else if(!newpwd.match(((/^\\S |^[a-zA-Z0-9~!@#$%^&*\\(\\)_+}{\\|\\\":?><`\\-=\\\\\\]\\[';\\/\\.\\,]{6,}$/)))){\n //errorMessage(\"label_newpwd\", \"Please enter valid password\");\n $('input#newpwd').addClass('required');\n invalid = true;\n }else{\n errorMessage(\"label_newpwd\", \"\");\n $('input#newpwd').removeClass('required');\n }\n }\n //special characters validation for password\n \n // for (var i = 0; i < document.changepwd.newpwd.value.length; i++) {\n // if (iChars.indexOf(document.changepwd.newpwd.value.charAt(i)) != -1) \n // {\n // errorMessage(\"label_newpwd\", \"(Special characters are not allowed)\");\n // return false;\n // }\n // }\n\n //confirm password validation (cnew)\n if(document.forms[\"changepwd\"][\"cnew\"]){\n\n var cnew=document.forms[\"changepwd\"][\"cnew\"].value;\n if (cnew != newpwd){\n //errorMessage(\"label_cnew\", \"(Password not matching)\");\n $('input#cnew').addClass('required');\n invalid = true;\n }else{\n //errorMessage(\"label_cnew\", \"\");\n $('input#cnew').removeClass('required');\n }\n }\n\n //reset button\n $(\"input[type='reset']\").click(function(){\n $(\"form[name='changepwd'] input\").each(function(){\n $(this).removeClass('required');\n errorMessage(\"label_newpwd\", \"\");\n errorMessage(\"label_password\", \"\"); \n });\n });\n\n if(invalid){\n return false;\n }\n }", "title": "" }, { "docid": "7f9ee7311355160a4a45fbb59c682b5d", "score": "0.66210103", "text": "function verifypass(input1,input2,label)\r\n{\r\n var pass=document.getElementById(input1).value;\r\n var repeat_pass=document.getElementById(input2).value;\r\n\r\n if (repeat_pass==0) \r\n {\r\n set_label(\"plz enter\",label,\"red\");\r\n count=false;return false;\r\n }\r\n\r\n if (pass!=repeat_pass)\r\n {\r\n set_label(\"password didnt match\",label,\"red\");\r\n count=false;return false;\r\n }\r\n else\r\n {\r\n set_label(\"matched\",label,\"green\");\r\n count=true;return true;\r\n }\r\n\r\n}", "title": "" }, { "docid": "070cb4905cb0e0d6383b2390b92aa44a", "score": "0.6608482", "text": "function checkPasswordMatch() {\n var password = \"\";\n var confirmPassword = \"\";\n\n if ($(\"#newPass\").length) {\n password = $(\"#newPass\")\n .val()\n .trim();\n }\n\n if ($(\"#rePass\").length) {\n confirmPassword = $(\"#rePass\")\n .val()\n .trim();\n }\n //Conditions to check if passwords that was typed in matches\n if (password != confirmPassword) {\n $(\"#CheckPasswordMatch\").text(\"Passwords do not match!\");\n } else {\n $(\"#CheckPasswordMatch\").text(\"Passwords match.\");\n }\n }", "title": "" }, { "docid": "084b222ec5f71114bf1e0b3100de4989", "score": "0.66005546", "text": "function changePassword(){\n\tx = 5;\n y = 50;\n\tvar oldPassword = document.getElementById('old-pwd').value;\n\tvar newPassword = document.getElementById('new-pwd').value;\n\tvar newPassword2 = document.getElementById('new-pwd2').value;\n\tvar formData = \"old_pwd=\" + oldPassword + \"&new_pwd=\" + newPassword + \"&token=\" + getToken();\n\tif(newPassword!=newPassword2){\n\t\tdisplayUserAlerts(\"Both new password fields must be the same\");\n\t}else if ((newPassword.length || newPassword2.length) < x){\n displayUserAlerts(\"The new password must contain at least \" + x + \" characters\");\n\t}else if((oldPassword.length || newPassword.length || newPassword2.length) > y){\n displayUserAlerts(\"The maximum number of characters is \" + y);\n }else{\n callbackPost(\"POST\", \"change_password\", \"Content-type\", \"application/x-www-form-urlencoded\", formData, function(){\n displayUserAlerts(this.message);\n });\n\t}\n\t//Erases the form content\n\tvar pwdForm = document.getElementById('change-password');\n\tpwdForm.reset();\n}", "title": "" }, { "docid": "2f5ef74887e1905e00f340a1f23117f3", "score": "0.659302", "text": "function saveUserPassword()\n{\n var passNewElem = document.getElementById('passwordNew');\n var passConfirmElem = document.getElementById('passwordConfirm');\n var password = document.getElementById('password');\n\n if (!passNewElem || !passConfirmElem) {\n return false;\n }\n\n var passNew = passNewElem.value;\n var passConfirm = passConfirmElem.value;\n\n if ((passNew == \"\") && (passConfirm == \"\"))\n return true;\n\n //Password which contains only space(s) symbols - don't save.\n if (passNew.match(/^(\\s)*$/))\n {\n var allSpacesErrorMessage = getResource(\"personalization.password.allspaceserror\");\n dijit.byId('messageBar').addMessage( {type:\"error\", summary:allSpacesErrorMessage});\n return false;\n }\n\n //Password which contains no symbols or not confirmed with confirm value - don't save.\n if (passNew == '' || passConfirm == '' || passNew != passConfirm ) {\n\n var confirmErrorMessage = getResource(\"personalization.password.confirmerror\");\n dijit.byId('messageBar').addMessage( {type:\"error\", summary:confirmErrorMessage });\n\n return false;\n }\n\n saveUserPasswordAction();\n return true;\n}", "title": "" }, { "docid": "2f5ef74887e1905e00f340a1f23117f3", "score": "0.659302", "text": "function saveUserPassword()\n{\n var passNewElem = document.getElementById('passwordNew');\n var passConfirmElem = document.getElementById('passwordConfirm');\n var password = document.getElementById('password');\n\n if (!passNewElem || !passConfirmElem) {\n return false;\n }\n\n var passNew = passNewElem.value;\n var passConfirm = passConfirmElem.value;\n\n if ((passNew == \"\") && (passConfirm == \"\"))\n return true;\n\n //Password which contains only space(s) symbols - don't save.\n if (passNew.match(/^(\\s)*$/))\n {\n var allSpacesErrorMessage = getResource(\"personalization.password.allspaceserror\");\n dijit.byId('messageBar').addMessage( {type:\"error\", summary:allSpacesErrorMessage});\n return false;\n }\n\n //Password which contains no symbols or not confirmed with confirm value - don't save.\n if (passNew == '' || passConfirm == '' || passNew != passConfirm ) {\n\n var confirmErrorMessage = getResource(\"personalization.password.confirmerror\");\n dijit.byId('messageBar').addMessage( {type:\"error\", summary:confirmErrorMessage });\n\n return false;\n }\n\n saveUserPasswordAction();\n return true;\n}", "title": "" }, { "docid": "6682c754d88ddbe333ecb8ab0408a359", "score": "0.6589956", "text": "function checkParams() {\r\n if (newPassword.value.length && oldPassword.value.length) {\r\n button.removeAttr('disabled');\r\n } else {\r\n button.attr('disabled', 'disabled');\r\n }\r\n }", "title": "" }, { "docid": "fccbeecbb5d36f70687be949669450be", "score": "0.6589645", "text": "function RTequalPasswords()\r\n{\r\n\tvar equal = document.getElementById('equal');\r\n\tvar pwd = document.getElementById(\"pwd\");\r\n\tvar pwd2 = document.getElementById(\"pwd2\");\r\n\t\r\n\tif(pwd2.value.length!=0)\r\n\t{\r\n\t\tif(pwd.value!=pwd2.value) equal.innerHTML = '<span style=\"color:red\">Οι κωδικοί που έχετε βάλει δεν ταιριάζουν!</span>';\r\n\t\telse equal.innerHTML = '<span style=\"color:green\">Oi κωδικοί ταιριάζουν!</span>';\r\n\t}\r\n\telse equal.innerHTML='';\r\n}", "title": "" }, { "docid": "77f489be6bcc70575b12acc95d77906f", "score": "0.65824014", "text": "validateRepeatPassword() {\n const repeatPassword = this.state.repeatPassword.value.trim();\n const password = this.state.password.value.trim();\n\n if (repeatPassword !== password) {\n return 'Passwords do not match';\n }\n }", "title": "" }, { "docid": "e14253ac2413355d714c170b9ee733d2", "score": "0.6575321", "text": "function ChangePassWordFormValidation(){\n //window.alert(\"Thank you\");\n var errmsg=document.getElementById(\"changePassmsg\");\n var lga= /^[a-z A-Z0-9,-_.]{4,35}$/;\nvar Isvalid=false;\n var opass=document.forms[\"ChangePassForm\"][\"opass\"].value;\n var npass=document.forms[\"ChangePassForm\"][\"npass\"].value;\n var vnpass=document.forms[\"ChangePassForm\"][\"vnpass\"].value;\n\n if(opass.trim(opass)==\"\"){\n alert(\"Old Password is Empty\");\n errmsg.innerHTML=\"Please enter a value in the Old Password field.\".bold().fontsize(\"3\").fontcolor(\"red\");\n document.forms[\"ChangePassForm\"][\"opass\"].focus();\n Isvalid= false;\n\n }\n else if(!opass.trim(opass).match(lga)){\n alert(\"Make sure there are no numbers or special\\n characters(eg:1,;@,&,'',$) in the Old Password field and that the number of characters is atleast 4.\");\n errmsg.innerHTML=\"Make sure there are no numbers or special\\n characters(eg:1,;@,&,'',$) in the Old Password field and that the number of characters is atleast 4.\".bold().fontsize(\"3\").fontcolor(\"red\");\n document.forms[\"ChangePassForm\"][\"opass\"].focus();\n Isvalid= false;\n}\nelse if(npass.trim(npass)==\"\"){\n\n alert(\"New Password is Empty\");\n errmsg.innerHTML=\"Please enter a value in the New Password field.\".bold().fontsize(\"3\").fontcolor(\"red\");\n document.forms[\"ChangePassForm\"][\"npass\"].focus();\n Isvalid= false;\n}\n else if(!npass.trim(npass).match(lga)){\n alert(\"Make sure there are no numbers or special\\n characters(eg:1,;@,&,'',$) in the New Password field.\");\n errmsg.innerHTML=\"Make sure there are no numbers or special\\n characters(eg:1,;@,&,'',$) in the New Password field.\".bold().fontsize(\"3\").fontcolor(\"red\");\n document.forms[\"ChangePassForm\"][\"npass\"].focus();\n Isvalid= false;\n}\nelse if(vnpass.trim(vnpass)==\"\"){\n\n alert(\"Verify New Password is Empty\");\n errmsg.innerHTML=\"Please enter a value in the 'Verify New Password' field.\".bold().fontsize(\"3\").fontcolor(\"red\");\n document.forms[\"ChangePassForm\"][\"vnpass\"].focus();\n Isvalid= false;\n}\n else if(!vnpass.trim(vnpass).match(lga)){\n alert(\"Make sure there are no numbers or special\\n characters(eg:1,;@,&,'',$) in the 'Verify New Password'.\");\n errmsg.innerHTML=\"Make sure there are no numbers or special\\n characters(eg:1,;@,&,'',$) in the 'Verify New Password'.\".bold().fontsize(\"3\").fontcolor(\"red\");\n document.forms[\"ChangePassForm\"][\"vnpass\"].focus();\n Isvalid= false;\n}\nelse if(npass.trim(npass)!=vnpass.trim(vnpass))\n {\n alert(\"New Password and Verify New Password Field must be the same\");\n errmsg.innerHTML=\"<strong> 'New Password' and 'Verify New Password' Field must be the same</strong>\".bold().fontcolor(\"red\").fontsize(\"3\");\n document.forms[\"ChangePassForm\"][\"vnpass\"].focus();\n Isvalid= false;\n }\n\nelse{\n Isvalid= true;\n\n}\nreturn Isvalid;\n\n}", "title": "" }, { "docid": "2db33e65ee197b8bb50856615599d380", "score": "0.6571382", "text": "function check(){\n var firstInput = document.getElementById(\"psw\").value;\n var secondInput = document.getElementById(\"psw-repeat\").value;\n console.log(firstInput);\n console.log(secondInput);\n\n if(firstInput != secondInput)\n {\n alert(\"Your passwords do not match!\");\n return false;\n }\n console.log(\"They match!!!!!!!!!!!!\")\n}", "title": "" }, { "docid": "5da8623a612535cddcf2d57d0de717bd", "score": "0.6570339", "text": "function samePassword() {\n let parent = this.parent;\n return parent.password === parent.confirm_password;\n}", "title": "" }, { "docid": "589459c89e0ba295231bb792b4cff783", "score": "0.65677655", "text": "function onCheckPW() {\r\n if ($(this).val() === $('#pw').val()) {\r\n this.setCustomValidity('');\r\n } else {\r\n this.setCustomValidity('Passwords must match.');\r\n }\r\n }", "title": "" }, { "docid": "e0b26f0fb205409891370a3c9a016b93", "score": "0.65673405", "text": "function validatePassword() {\n // TODO: Validate password\n\n window.open(`/portal/${getSlug()}`, '_self');\n }", "title": "" }, { "docid": "b59ec38dbf6600f32f4a7c0661fe0dfd", "score": "0.65652835", "text": "function mod_user() {\n\t//var flag test\n\tflag1 = 1;\n\tflag2 = 1;\n\tflag3 = 0;\n\tflag4 = 1;\n\tflag5 = 1;\n\tflag6 = 0;\n\tflag7 = 0;\n\tflag8 = 0;\n\t\n\tif($('#new_password').val() != \"\") \n\t{\n\t\n\t\tif($('#password').val() == \"\")\n\t\t{\n\t\t\t$('#error_password').html('Mật khẩu không được để trống !');\t\n\t\t\tflag1 = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$('#error_password').html('');\t\n\t\t\tflag1 = 1;\n\t\t}\n\t\t\n\t\tif(is_password($('#new_password').val()) == false)\n\t\t{\n\t\t\t$('#error_new_password').html('Mật khẩu thay đổi ít nhất 6 kí tự !');\t\n\t\t\tflag2 = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$('#error_new_password').html('');\t\n\t\t\tflag2 = 1;\n\t\t}\n\t\t\n\t\tif($('#new_password').val() != $('#re_password').val())\n\t\t{\n\t\t\t$('#error_re_password').html('Mật khẩu nhập lại không đúng !');\t\n\t\t\tflag4 = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$('#error_re_password').html('');\t\n\t\t\tflag4 = 1;\n\t\t}\n\t\t\n\t\n\t}\n\t\n\tif($('#email').val() == \"\")\n\t{\n\t\t$('#error_email').html('Email không được để trống !');\t\n\t\tflag3 = 0;\n\t}\n\telse if(is_Email($('#email').val())== false)\n\t{\n\t\t$('#error_email').html('Email nhập sai quy tắc (ShopHoaOnline@XXX.XX)!');\t\n\t\tflag3 = 0;\n\t}\n\telse\n\t{\n\t\t$('#error_email').html('');\t\n\t\tflag3 = 1;\n\t}\n\t\n\tif($('#re_email').val() != \"\") {\n\t\tif($('#email').val() != $('#re_email').val())\n\t\t{\n\t\t\t$('#error_re_email').html('Email không giống nhau !');\t\n\t\t\tflag5 = 0;\n\t\t}\t\n\t\telse\n\t\t{\n\t\t\t$('#error_re_email').html('');\t\n\t\t\tflag5 = 1;\n\t\t}\n\t}\n\t//name\n\tif($('#name').val() ==\"\")\n\t{\n\t\t$('#error_name').html('Tên không được để trống !');\t\n\t\tflag6 = 0;\n\t}\t\n\telse\n\t{\n\t\t$('#error_name').html('');\t\n\t\tflag6 = 1;\n\t}\n\t\n\t//phone\n\tif($('#phone').val() ==\"\")\n\t{\n\t\t$('#error_phone').html('Số điện thoại không được để trống !');\t\n\t\tflag7 = 0;\n\t}\t\n\telse\n\t{\n\t\t$('#error_phone').html('');\t\n\t\tflag7 = 1;\n\t}\n\t\n\t//address\n\tif($('#address').val() ==\"\")\n\t{\n\t\t$('#error_address').html('Số điện thoại không được để trống !');\t\n\t\tflag8 = 0;\n\t}\t\n\telse\n\t{\n\t\t$('#error_address').html('');\t\n\t\tflag8= 1;\n\t}\n\t\n\t\n\t\n\t\n\tif(flag1 == 0 || flag2 == 0 || flag3 == 0 || flag4 == 0 || flag5 == 0 || flag6 == 0 || flag7 == 0 || flag8 == 0 )\n\t\treturn false;\n\telse\n\t\treturn true;\n\n}", "title": "" }, { "docid": "563139d04dccecc2f5bc4f256ad82429", "score": "0.65592885", "text": "passwordNotMatch(){\n return (this.state.newPassword !== this.state.repeatPassword && this.state.repeatPassword !== '')\n }", "title": "" }, { "docid": "56b1f6dfe5e60c753c00b1bea7c25127", "score": "0.6556096", "text": "function verifyPW() {\n\tif (document.getElementById(\"pw\").value == document.getElementById(\"vpw\").value) {\n\t\treturn true;\n\t}\n\telse \n\t\talert(\"passwords do not match\");\n\t\treturn false;\n\t}", "title": "" }, { "docid": "5ed0e3f8e0cb778485a24aa93f252bc7", "score": "0.654904", "text": "function PasswordValidation(Controlname1,Controlname2,Fieldname1,Fieldname2)\n {\n var objfrm1=document.getElementById(Controlname1);\n var objfrm2=document.getElementById(Controlname2);\n \tvar objFieldname1=Fieldname1;\n\tvar objFieldname2=Fieldname2;\n\t\n\t\n\tvar flag;\n\tflag=false;\n\t\n\tvar objValidator = new InputValidator();\n\tvar objError \t = new ErrorAlert();\n if\n (\n objValidator.isPwdMatch(objfrm1,objfrm2,objValidator.Replace(objValidator.Replace(objValidator.Replace(objError.matchpwd,\"<Field2>\",objFieldname2),\"<Field2>\",objFieldname2),\"<Field1>\",objFieldname1)) \n )\n {\n\t \tobjError = null\n\t\tobjValidator = null\n\t\t//alert (\"Form has been validated successfully.\")\n\t\tflag=true\n }\n\n\tobjError = null\n\tobjValidator = null\n\treturn flag\n }", "title": "" }, { "docid": "52b8f0e7a792f8fcf57fe61d5559d06f", "score": "0.65471995", "text": "function passwordMatching(input1, input2) {\n if (input1.value !== input2.value) {\n showError(input2, 'Password does not match, try again');\n }\n}", "title": "" }, { "docid": "7a451c1e142856fe0889d42ca9ab51bb", "score": "0.6545086", "text": "function changePassword() {\n\tif ($(\"#changePass\").valid()) {\n\t\tevent.preventDefault();\n\t\tvar currPass = $('#cpCurrent').val();\n\t\tvar newPass = $('#cpNew').val();\n\t\tif (currPass != newPass) {\n\t\t\t$.ajax({\n\t\t\t\turl: 'core/handler/changePassword.php',\n\t\t\t\ttype: 'POST',\n\t\t\t\tdataType: 'text',\n\t\t\t\tasync: false,\n\t\t\t\tdata: {\n\t\t\t\t\t\"currPass\": currPass,\n\t\t\t\t\t\"newPass\": newPass,\n\t\t\t\t},\n\t\t\t\tsuccess: function(data) {\n\t\t\t\t\tif (data == 1) {\n\t\t\t\t\t\t$('#changeMessage').text('Your password has been succesfully changed');\n\t\t\t\t\t\t$('#changeMessage').css('color', '#27f368');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$('#changeMessage').text('Please make sure you have entered correct current password');\n\t\t\t\t\t\t$('#changeMessage').css('color', 'red');\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror: function(e, xhr) {\n\t\t\t\t\tconsole.log(e);\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\t$('#changeMessage').text('The password is the same, please choose a different one');\n\t\t\t$('#changeMessage').css('color', 'red');\n\t\t}\n\t}\n}", "title": "" }, { "docid": "421fa608e9e5db2a9d3202ab1698576e", "score": "0.6537312", "text": "function verify() {\n var LogUser = document.forms[\"loginForm\"][\"loginName\"].value;\n var LogEmail = document.forms[\"loginForm\"][\"emailId\"].value;\n var LogPass = document.forms[\"loginForm\"][\"loginPass\"].value;\n var ConfirmLogPass = document.forms[\"loginForm\"][\"confirmloginPass\"].value;\n if(LogUser == null || LogUser == \"\", LogEmail == null || LogEmail == \"\", LogPass == null || LogPass == \"\", ConfirmLogPass == null || ConfirmLogPass == \"\" ) {\n alert('Please Fill All Fileds');\n return false;\n }\n if((LogUser == 'test') && (LogPass == '123')) {\n //window.open('UserDetailPage.html');\n if(LogPass != ConfirmLogPass) {\n alert('Your password do not match. Please try again !');\n ConfirmLogPass.focus();\n return false;\n }\n else {\n window.location=\"userdetails.html\"; \n return false;\n }\n }\n}", "title": "" }, { "docid": "445533b823b24057b7539624f2c8bc2a", "score": "0.65332705", "text": "function match_registration_passwords() {\n var password = document.getElementsByName('security_newpass')[0];\n var password_confirm = document.getElementsByName('security_newpass_confirm')[0];\n\n if (password.value != password_confirm.value) {\n password_confirm.setCustomValidity(\"Passwords do not match!\");\n return false;\n } else {\n password_confirm.setCustomValidity(\"\");\n return true;\n }\n}", "title": "" }, { "docid": "17dd4a786f0ddb584633a9e5cf8aba0e", "score": "0.65215635", "text": "validateForm() {\n return this.state.oldpassword.length > 0 && this.state.password1.length > 0 && this.state.password1 === this.state.password2;\n }", "title": "" }, { "docid": "e0f7849bb113ddcee6e229629782d9d3", "score": "0.6520235", "text": "function passwordWatch() {\n if($scope.User.password == $scope.password2){\n //make form item valid\n $scope.UserEditForm.password.$setValidity(\"identical\", true);\n }else {\n $scope.UserEditForm.password.$setValidity(\"identical\", false);\n }\n }", "title": "" }, { "docid": "f5bdeb0f40fa7e24c0882e935d9f8b54", "score": "0.65198344", "text": "validPassword(password) {\n return password == this.password;\n }", "title": "" }, { "docid": "3160bcb8b806aab07f2b6e26cea44d56", "score": "0.65182596", "text": "function CheckPassRegister(strpass)\r\n{\r\n\tif ( strpass.length == 0 )\r\n\t{\r\n\t\tbolErrorPassword = true;\r\n\t\tstrErrorPassword = 'Password không được để trống, xin vui lòng nhập password';\r\n\t\treturn 31;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tif ( strpass.indexOf(\"<\") != '-1' || strpass.indexOf(\">\") != '-1' )\r\n\t\t{\r\n\t\t\tbolErrorPassword = true;\r\n\t\t\tstrErrorPassword = 'Password không được sử dụng ký tự Unicode, xin vui lòng kiểm tra lại';\r\n\t\t\treturn 32;\r\n\t\t}\r\n\t\telse\r\n\t\t{\t\t\r\n\t\t\tif ( strpass.length < 3 || strpass.length > 30 )\r\n\t\t\t{\r\n\t\t\t\tbolErrorPassword = true;\r\n\t\t\t\tstrErrorPassword = 'Password phải có độ dài lớn hơn 3 ký tự và nhỏ hơn 30 ký tự';\r\n\t\t\t\treturn 33;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\t\r\n\t\t\t\tif ( !Checkchar1( strpass ) )\r\n\t\t\t\t{\r\n\t\t\t\t\tbolErrorPassword = true;\r\n\t\t\t\t\tstrErrorPassword = 'Password không được sử dụng ký tự Unicode, xin vui lòng kiểm tra lại';\t\t\r\n\t\t\t\t\treturn 34;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\tbolErrorPassword = false;\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\r\n\t}\r\n\treturn 1;\r\n}", "title": "" }, { "docid": "5aac8b4bd11d26055140357d1c08aa28", "score": "0.65165067", "text": "function verify_password(password, repassword, error) {\n if(password.length < 5) {\n error.innerText = \"ERROR: Password must be 5+ characters long!\";\n console.log(\"Error! password too short\");\n return false;\n }\n else if(password != repassword) {\n error.innerText = \"ERROR: Passwords must match!\";\n console.log(\"Error! passwords don't match\");\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "97cce14b439308b077f4e48c4fc91594", "score": "0.651053", "text": "SamePasswords(password1, password2) {\n return password1 === password2;\n }", "title": "" }, { "docid": "4450ba7c9d022842c534b4b13db9416d", "score": "0.6505131", "text": "function validatePwd(pwdObj,useNameObj,formObj,phObj, pwdPage)\r\n\t{\r\n\t\tif(formObj.validationEngine('validate')){\r\n\t\t blockUI();\r\n\t\t}\r\n\t\t\r\n\t\tvar password=pwdObj.val();\r\n\t\tvar username=useNameObj.val();\r\n\t\r\n\t\tif(password.indexOf(username) != -1) {\r\n\t\t\tunblockUI();\r\n\t\t\t$.modal.alert(strings['script.user.passwordPartUsername']);\r\n\t\t} else {\r\n\t\t\t$.ajax({\r\n\t\t\t\ttype : \"POST\",\r\n\t\t\t\turl : 'validatePwd.do',\r\n\t\t\t\tdata : formObj.serialize(),\r\n\t\t\t\tdataType : 'html',\r\n\t\t\t\tcache:false,\r\n\t\t\t\tsuccess : function(data) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar obj = jQuery.parseJSON(data);\r\n\t\t\t\t\r\n\t\t\t\t\tif (obj.status == 'equalsUserName')\t{\r\n\t\t\t\t\t\t$.modal.alert(strings['script.user.passwordLikeUsername']);\r\n\t\t\t\t\t\tstepBack(2);\r\n\t\t\t\t\t\tif(pwdPage != null) stepBack(2);\r\n\t\t\t\t\t\tunblockUI();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(obj.status == 'invalidPwd'){\r\n\t\t\t\t\t\t$.modal.alert(strings['script.user.passwordPolicy']);\r\n\t\t\t\t\t\tstepBack(2);\r\n\t\t\t\t\t\tif(pwdPage != null) stepBack(2);\r\n\t\t\t\t\t\tunblockUI();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(obj.status == 'invalidPwdHistory') {\r\n\t\t\t\t\t\t$.modal.alert(strings['script.user.passwordPolicyHistory']);\r\n\t\t\t\t\t\tstepBack(2);\r\n\t\t\t\t\t\tif(pwdPage != null) stepBack(2);\r\n\t\t\t\t\t\tunblockUI();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(obj.status == 'LDAP_ERROR'){\r\n\t\t\t\t\t\t$.modal.alert(obj.message);\r\n\t\t\t\t\t\tstepBack(2);\r\n\t\t\t\t\t\tif(pwdPage != null) stepBack(2);\r\n\t\t\t\t\t\tunblockUI();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(obj.status == 'Success') {\r\n\t\t\t\t\t\tvalidatePh(phObj,formObj);\r\n\t\t\t\t\t /*\tif (validateSecurityQuestion()){\r\n\t\t\t\t\t\t\tformObj.submit();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$.modal.alert(strings['script.parent.question']);\r\n\t\t\t\t\t\t\tunblockUI();\r\n\t\t\t\t\t\t}*/\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$.modal.alert(strings['script.user.saveError']);\r\n\t\t\t\t\t\tstepBack(2);\r\n\t\t\t\t\t\tif(pwdPage != null) stepBack(2);\r\n\t\t\t\t\t\tunblockUI();\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\terror : function(data){\r\n\t\t\t\t\tunblockUI();\r\n\t\t\t\t\t$.modal.alert(strings['script.common.error1']);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\t\t\r\n}", "title": "" }, { "docid": "5dfeaa3df2f228962db3dcc3558019a9", "score": "0.65025634", "text": "function askPassword(ok, fail) {\n let password =\"rockstar\";\n if (password === \"rockstar\") return ok();\n else return fail();\n }", "title": "" }, { "docid": "f932e1e0b9bcf8ecaa104afdd9e21ac8", "score": "0.65016323", "text": "function loginPasswordFormCheck() {\n var key = $rootScope.currentUser.settings.email.email;\n var passcode = $scope.inputs.passcode || '';\n // We MAC the password with the user's email before verifying\n var params = { password: Utils.Crypto.sjclHmac(key, passcode) };\n return UserAPI.verifyPassword(params);\n }", "title": "" }, { "docid": "96ae7401181470d1bf5c44e59358b14b", "score": "0.6494922", "text": "function action_mismatch_register_password(){\n \t\n \t$(\"#error-confirm_password\").css(\"color\",\"red\");\n\t\t$(\"#error-confirm_password\").html(\"Password doesnt match\");\n }", "title": "" }, { "docid": "ea4a56b7b81c6895cf4deb79f8fea5da", "score": "0.6491818", "text": "changePassword(username, oldPwd, newPwd){\n if (this._accountManager.checkPassword(username, oldPwd) != null){\n this._accountManager.setPassword(newPwd, username);\n return true;\n }else {\n return false;\n }\n }", "title": "" }, { "docid": "a7f24a57afb1f1604a84e0dac31432fd", "score": "0.6470488", "text": "function checkPass(){\r\n\tvar pw = document.getElementById('pass1').value; //refer value of id under name pass1\r\n\tvar SC = [\"!\",\"@\",\"#\",\"$\",\"%\"]; //set special letter in Password\r\n\tvar check_SC = 0; // insert when special letter found number will 1, not found number will 0\r\n\tif(pw.length < 6 || pw.length>16){ //if statement for password length\r\n\twindow.alert('Password must be between 6 to 16');\r\n\tdocument.getElementById('pass1').value='';\r\n\t}\r\n\tfor(var i=0;i<SC.length;i++){ // compare all of SC letter with pass1 value\r\n\t\tif(pw.indexOf(SC[i]) != -1){\r\n\t\t\tcheck_SC = 1;\r\n\t\t}\r\n\t}\r\n\tif(check_SC == 0){ // not found so number is 0\r\n\t\twindow.alert('Password Must include !,@,#,$,% one of this')\r\n\t\tdocument.getElementById('pass1').value='';\r\n\t}\r\n\tif(document.getElementById('pass1').value !='' && document.getElementById('pass2').value!=''){\r\n\t\tif(document.getElementById('pass1').value==document.getElementById('pass2').value){\r\n\t\t\tdocument.getElementById('check').innerHTML='Password and Confirm Password are Same!'\r\n\t\t\tdocument.getElementById('check').style.color='blue';\r\n\t\t}\r\n\t\telse{\r\n\t\t\tdocument.getElementById('check').innerHTML='Password and Confirm Password are Different! Please insert Again!';\r\n\t\t\tdocument.getElementById('check').style.color='red';\r\n\t\t\tdocument.getElementById('pass1').value='';\r\n\t\t\tdocument.getElementById('pass2').value='';\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "89c1e43e8d963d583b79948bd9d987d6", "score": "0.64668274", "text": "function validatePasswordFields(firstPassword, secondPassword) {\n\tif (firstPassword != secondPassword) {\n\t\talert(\"The two entered passwords are not the same!\");\n\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "7a1f8d4bc536fce391b5da20e94ae386", "score": "0.6463726", "text": "function isvalid_password(){\n var password = document.getElementsByName(\"password\")[0].value;\n var repassword = document.getElementsByName(\"repassword\")[0].value;\n if(password.length < 3 || password.length > 30){\n alert(\"Password is too long or too short!\");\n return false;\n }\n if (password != repassword){\n alert(\"Your passwords are different!\");\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "679e57b276e2f0c8106bac06abf5ec10", "score": "0.6456965", "text": "function CheckPassword(){\n\nvar OldPassword = document.getElementById('OldPassword').value;\nvar NPassword = document.getElementById('NPassword').value;\nvar vPassword = document.getElementById('vPassword').value;\n\n\tif (OldPassword == null || OldPassword ==\"\"){\n\talert(\"You must confirm your OldPassword\");\n\treturn false;\n}\nelse if (NPassword == null || NPassword ==\"\"){\n\talert(\"You must enter a new password\");\n\treturn false;\n}\nelse if (vPassword == null || vPassword ==\"\"){\n\talert(\"You must verify your new password\");\n\treturn false;\n} else return true;\n}", "title": "" }, { "docid": "0035b5d8eb9fbe30c44a283351717178", "score": "0.6456408", "text": "function getPasswordFinal() {\n\n}", "title": "" }, { "docid": "7924e8a9a84656c067badca18d003170", "score": "0.6450186", "text": "function checkPassword() {\n\treturn {\n\t\ttype: \"PASSED\",\n\t};\n}", "title": "" }, { "docid": "c1710c189fb84dc7409bbf1ce5e7a328", "score": "0.64497536", "text": "function password() {\n var password;\n var pass1 = \"cool\";\n\n password = prompt(\"Please enter your password to view this page!\", \" \");\n\n if (password == pass1) {\n openTab(event, \"Manhours\");\n }\n}", "title": "" }, { "docid": "ace64971d85ed2bc95dfcdc1e446d6be", "score": "0.6448408", "text": "function checkPasswordsMatch(input1, input2) {\n if (input1.value !== input2.value) {\n showError(input2, \"Passwords do not match\");\n }\n}", "title": "" }, { "docid": "e64779cc72d3995bace4a891e093ed55", "score": "0.64475715", "text": "function simplePasswordCheck(page){\n var passwordRE = /(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9]){8,}/;\n var lengthRE = /^.{8,}$/\n\n if(page == \"inv_researcher\"){\n var inputPassword = document.getElementById('researcher_password1');\n if (inputPassword.value == \"\"){\n return true;\n }\n } else {\n var inputPassword = document.getElementById('new__researcher_password1');\n }\n if(passwordRE.test(inputPassword.value) && lengthRE.test(inputPassword.value)){\n return true;\n } \n}", "title": "" }, { "docid": "ff6bc0b53f7619fad64172975b87f4e3", "score": "0.6446394", "text": "function checkpassword(){\n\tif (document.getElementById(\"pwd\").value != document.getElementById(\"cnfrmpwd\").value) {\n\t\talert(\"password mismatch!\");\n\t\treturn false;\n\t}\n\telse{\n\t\talert(\"Success\");\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "08715b536075f1493806e3336999e0ef", "score": "0.6445869", "text": "function validChangePassword(){\n\tvar valide = true;\n\tvar msgErreurs = new Array();\n\tvar i = 0;\n\n\tif (document.formChangePassword.password.value.length < 6\n\t\t\t|| document.formChangePassword.password.value.length > 10) {\n\t\tvalide = false;\n\t\tmsgErreurs[i] = \"Le mot de passe doit comporter 6 à 10 caractères maximum.\";\n\t\ti++;\n\t\tdocument.formChangePassword.password.focus();\n\t}\n\n\tif (document.formChangePassword.password.value != document.formChangePassword.confirmPassword.value) {\n\t\tvalide = false;\n\t\tmsgErreurs[i] = \"Le mot de passe saisi n'est pas identique au premier !\";\n\t\ti++;\n\t\tdocument.formChangePassword.confirmPassword.focus();\n\t}\n\n\tvar regexPassword = /^[a-zA-Z0-9_@&]+$/;\n\tif (!document.formChangePassword.password.value.match(regexPassword)) {\n\t\tvalide = false;\n\t\tmsgErreurs[i] = \"Le mot de passe comporte des caractères spéciaux non autorisés !\";\n\t\ti++;\n\t\tdocument.formChangePassword.password.focus();\n\t}\n\n\t\n\t\n\t/*réinitialisation la zone erreur*/\n\tdocument.getElementById(\"erreurs\").innerHTML = \"\";\n\n\tif (!valide) {\n\t\tfor (var cpt = 0; cpt < msgErreurs.length; cpt++) {\n\t\t\tvar msg = msgErreurs[cpt];\n\t\t\t/*créer une balise div par erreur à afficher*/\n\t\t\tvar div = document.createElement(\"div\");\n\t\t\tdiv.innerHTML = msg.decode();\n\t\t\t/*insérer la balise div créée dans la div erreurs*/\n\t\t\tdocument.getElementById(\"erreurs\").appendChild(div);\n\t\t}\n\t}\n\n\treturn valide;\n}", "title": "" }, { "docid": "3ecf4b19236d0b754e495008e092fbf1", "score": "0.64452153", "text": "function changePassHandler(user){\n return function(){\n //ask for a new password\n var pass = prompt(\"Neues Passwort: \");\n if(pass == null) return;\n if(pass == \"\") {\n alert(\"Bitte gib ein Passwort ein!\");\n return;\n }\n //check if the password meets the following criteria:\n // At least 12 characters\n // At least one uppercase letter\n // At least one lowercase letter\n // At least one number\n // At least one of the following characters: _.*-+:#!?%{}|@[];=“&$\\/,()\n if (!(/^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.{8,})(?=.*[\\_\\*\\-\\+\\:\\!\\?\\%\\{\\}\\|\\@\\[\\]\\;\\=\\\"\\&\\$\\\\\\/\\,\\(\\)])/g).test(pass))\n //the user is warned that the password doesn't fullfill all of the criteria, however he is allowed to continue\n if(!confirm(\"Das Passwort sollte folgende Kriterien erfüllen:\\n Ein Kleinbuchtabe\\n Ein Großbuchstabe\\n Eine Zahl\\n Ein Sonderzeichen\\n Mindestens 8 Zeichen\\nTrotzdem fortfahren?\")) return;\n //if the user didn't cancel the new password is getting sent to the server\n $.post(\"./php_helper/updateUser.php\", {user: user, pass: \"\"});\n reloadLocation();\n }\n}", "title": "" }, { "docid": "c558517a8a1ec69752bf488296c09c02", "score": "0.64373285", "text": "function checkPassword(password) {\r\n return password === config.server.password;\r\n}", "title": "" } ]
70f4d53f29d928f126e36beb04394182
init(); Generate the random number
[ { "docid": "29ce52b44c915dd26132dfe7c2e2ead6", "score": "0.0", "text": "function btnClick() {\n console.log('Function called.');\n //Do something here!!\n\n //1. Random number\n var dice = Math.floor((Math.random() * 6) + 1);\n console.log(dice);\n //Display\n var diceDOM = document.querySelector('.dice');\n diceDOM.style.display = 'block';\n diceDOM.src = '/PigGame/Images/dice-' + dice + \".png\";\n //document.querySelector('#current-' + activePlayer).textContent = dice;\n if (dice !== 1) {\n // Add Scire\n RoundScore += dice;\n document.querySelector('#current-' + activePlayer).textContent = RoundScore;\n } else {\n //Give to next player\n NextPlayer();\n }\n}", "title": "" } ]
[ { "docid": "791b3a86f88300db918cfe43a330c036", "score": "0.7871363", "text": "function init() {\n self.randomNumber = 0;\n // WHAT IF this.randomNumber\n }", "title": "" }, { "docid": "9bfce9a693573704cef52f64299b1e2e", "score": "0.75061613", "text": "function rand() {\n return Math.random();\n} // ^ this is using javascript random, which is not seedable.", "title": "" }, { "docid": "3375a088cc1590ced2f2bda460542fb5", "score": "0.7503825", "text": "function randomGenerator() {}", "title": "" }, { "docid": "50e2599be3c8413c28e71d1870fbeaf8", "score": "0.7463242", "text": "_random() {\n this.used = true;\n const R = this.state;\n const seed = R.prngstate ? '' : R.seed;\n const rand = alea(seed, R.prngstate);\n const number = rand();\n this.state = { ...R,\n prngstate: rand.state()\n };\n return number;\n }", "title": "" }, { "docid": "18c05267bd83612defab11ed31e063f7", "score": "0.74010444", "text": "function rng() {\n return random();\n }", "title": "" }, { "docid": "18c05267bd83612defab11ed31e063f7", "score": "0.74010444", "text": "function rng() {\n return random();\n }", "title": "" }, { "docid": "18c05267bd83612defab11ed31e063f7", "score": "0.74010444", "text": "function rng() {\n return random();\n }", "title": "" }, { "docid": "b00312f9b6c05dd425dbbcdd587350f1", "score": "0.73937005", "text": "function rng() {\n return random();\n }", "title": "" }, { "docid": "438249bae26e84a8688d875b1b2edd3f", "score": "0.73498875", "text": "function rng() {\n\t return random();\n\t }", "title": "" }, { "docid": "bb11d9da8b68fddde9eee6322af05045", "score": "0.7344392", "text": "function generateRandomnumber(){\n return Math.random();\n }", "title": "" }, { "docid": "bdbe08a758850e06d011d48ae21f34ea", "score": "0.730358", "text": "function genNumber() {\n\treturn Math.random() * 10000000000;\n}", "title": "" }, { "docid": "d886bd46d0b1008561caaa6b510eb1aa", "score": "0.7270425", "text": "function rng () {\n return random()\n }", "title": "" }, { "docid": "de9a154878f535b991a3ccf31ac02aa7", "score": "0.7267236", "text": "function rng() {\n return random();\n }", "title": "" }, { "docid": "de9a154878f535b991a3ccf31ac02aa7", "score": "0.7267236", "text": "function rng() {\n return random();\n }", "title": "" }, { "docid": "de9a154878f535b991a3ccf31ac02aa7", "score": "0.7267236", "text": "function rng() {\n return random();\n }", "title": "" }, { "docid": "de9a154878f535b991a3ccf31ac02aa7", "score": "0.7267236", "text": "function rng() {\n return random();\n }", "title": "" }, { "docid": "0d02e2ccc0e704d9eed1f24c63e0fcd2", "score": "0.7266568", "text": "function numberRandom () {\n return Math.floor(Math.random() * 64);\n\n }", "title": "" }, { "docid": "83d403e6e0d1e74b8cd96332bd02aa3b", "score": "0.7260067", "text": "generateRandom()\n {\n for(var ct=0; ct< this.size; ct++)\n {\n var num = getRandomInt(-10, 10);\n this.entries[ct] = new RationalNumber(num, 1);\n }\n }", "title": "" }, { "docid": "53cde06a79e3fa7af96b7fc1c6072a58", "score": "0.72383755", "text": "function randomNumgen() {\n random_result = Math.floor(Math.random() * 101) + 19;\n $(\"#randomNumber\").text(\"Random Number:\" + random_result);\n }", "title": "" }, { "docid": "52485cba5f04e8929f03feba453c284e", "score": "0.7224951", "text": "function createRandNumber(data) {\n\n}", "title": "" }, { "docid": "903661898c5856b9518b7e9e05204f24", "score": "0.72160804", "text": "function randomnumber() {\r\n return Math.floor(Math.random() * 101) + 19; //value been used \r\n }", "title": "" }, { "docid": "6357f5df379bbc7f678960703d02395a", "score": "0.7214639", "text": "function rand() {\n return Math.floor(1 + Math.random() * 9);\n }", "title": "" }, { "docid": "b9a57f1d329e468b3560c7d656059343", "score": "0.71951586", "text": "function randomNumberGenerator() {\r\n $(\".random-number\").ready(function () {\r\n randomNumber = parseInt(randomNumber);\r\n for (var i = 19; i < 120; i++) {\r\n randomNumber = Math.floor(Math.random() * (120 - 19)) + 1\r\n };\r\n $(\".random-number\").html(randomNumber);\r\n \r\n });\r\n }// End random number generation for random number field.", "title": "" }, { "docid": "7326a112e8b7401612f22ee255a95173", "score": "0.71694857", "text": "function randomNumGen() {\n return Math.floor(Math.random() * 102) + 19;\n }", "title": "" }, { "docid": "3257fac85ba91f0461d6c21e272c489d", "score": "0.71649694", "text": "function randomNum() {\n return Math.random() * 11;\n }", "title": "" }, { "docid": "2aeb1eed0fafdc488887576b2c41c8b1", "score": "0.7163558", "text": "function randomGenerator() {\n return Math.floor((Math.random() * 1000) + 1);\n }", "title": "" }, { "docid": "6ad50dc084d08ae5285748adf24d3fed", "score": "0.7153057", "text": "function randomNumber () {\r\n return Math.random;\r\n}", "title": "" }, { "docid": "8b7d800ff9b952e6e2f237ced168fc2b", "score": "0.713331", "text": "function generateRandomNumber() {\n return Math.floor((Math.random()*100)+1)\n }", "title": "" }, { "docid": "ed312c7747e32d4e946f07df387d8fe3", "score": "0.7133154", "text": "function numGenerator(){\n\t\t\trandomNum = Math.floor((Math.random()*100)+1);\n\t\t\tconsole.log(\"random #: \" + randomNum);\n\t\t}", "title": "" }, { "docid": "0a0d4e5adcf268e4b2535f568f2f00c9", "score": "0.71272403", "text": "function randomNumber(){\r\n return Math.random\r\n}", "title": "" }, { "docid": "986411def1498ba7caed7466e5e94965", "score": "0.7107276", "text": "randNumGen () {\n return Math.floor(Math.random()*3);\n }", "title": "" }, { "docid": "2bd0d463926f68b870892777efff8008", "score": "0.7080929", "text": "function mainNum (){\r\n $('#randNum').html(getRandom(102)) \r\n }", "title": "" }, { "docid": "e862428835c5d17797fc6d55d90fe958", "score": "0.70553106", "text": "function newNumber() {\n \n // cpu picks random number (19 and 120)\n specialNumber = Math.floor((Math.random()*120)+19)\n // console.log (specialNumber);\n\n // setting random value for gems (between 1 - 12)\n blue = Math.floor(Math.random()*12+1);\n clear = Math.floor(Math.random()*12+1);\n green = Math.floor(Math.random()*12+1);\n red = Math.floor(Math.random()*12+1);\n\n // console.log(blue, clear, green, red);\n \n }", "title": "" }, { "docid": "5ce794c6d210c0905e71f052954c8281", "score": "0.7053085", "text": "function genAndDisplayNumWhenInitialize() {\n\t\t\t//gen 10 numbers\n\t\t\tfor (var i = 0; i < 6; i++) {\n\t\t\t\tvar randomDicimalToDecideDigits = Math.random();\n\t\t\t\tif (randomDicimalToDecideDigits < 0.1) { decidedDigits = 100 }\n\t\t\t\telse if (randomDicimalToDecideDigits >= 0.1 && randomDicimalToDecideDigits < 0.2) { decidedDigits = 1000 }\n\t\t\t\telse if (randomDicimalToDecideDigits >= 0.2 && randomDicimalToDecideDigits < 0.5) { decidedDigits = 10000 }\n\t\t\t\telse if (randomDicimalToDecideDigits >= 0.5 && randomDicimalToDecideDigits < 0.8) { decidedDigits = 100000 }\n\t\t\t\telse { decidedDigits = 1000000 }\n\n\t\t\t\t//gen 10 numbers: the gened number\n\t\t\t\tgeneratedNumber = Math.floor(Math.random() * decidedDigits);\n\t\t\t\t//gen 10 numbers: print the number (each number add new number & linebreak)\n\t\t\t\tdocument.getElementById(\"div_displayGeneratedNumber\").innerHTML += generatedNumber + \"<br>\";\n\t\t\t}\n\t\t\t//document.getElementById(\"div_displayGeneratedNumber\").innerHTML += \"ma zi yeung\";\n\t\t}", "title": "" }, { "docid": "acd8be596a4dfd181525ca84497ea64d", "score": "0.70508647", "text": "function random(){\n var seed = (new Date).getTime() / 1000;\n return Math.floor(Math.sin(seed) * 10000);\n}", "title": "" }, { "docid": "5499fd42bbc0b7fe1deae8fb9c7b711b", "score": "0.70378935", "text": "static randl(){\n\n }", "title": "" }, { "docid": "ef556cd34e30b153756f3b89cd51efb8", "score": "0.7015785", "text": "function randomNumber() {\n return Math.floor(Math.random() * 99999) + 11111;\n }", "title": "" }, { "docid": "81083de237127e196a81424230262b11", "score": "0.7012823", "text": "function random() {\n return Math.random() * 10\n }", "title": "" }, { "docid": "6a4ea6e5f19db617cf923706582435ae", "score": "0.6992447", "text": "function randomNumber() {\n randomNumberGenerator = Math.floor(Math.random() * 65 + 35);\n $(\"#random-number\").text(randomNumberGenerator);\n console.log(\"Random Number: \", randomNumberGenerator);\n }", "title": "" }, { "docid": "1514b4dbef04d461850e9b0ce3cae55c", "score": "0.69911414", "text": "_getRandomIncrement(){ \n\t\treturn Math.floor(Math.random() * 10. + 1); \n\t}", "title": "" }, { "docid": "3a4a1597f3116054292b6eaebafb360a", "score": "0.69889355", "text": "function rng_seed_time() {\n rng_seed_int(new Date().getTime());\n }", "title": "" }, { "docid": "baba5e52931b01f499b3943141dd8c1f", "score": "0.69836986", "text": "function randNumFunc() {\n randNum = Math.floor(Math.random() * 102) + 19;\n console.log(\"randNum :\" + randNum);\n $( \"#random-num\" ).html(randNum);\n }", "title": "" }, { "docid": "bdd73b0407b6a68708f335addf9d3ea3", "score": "0.69753706", "text": "function gen_number(){\n\tvar ran = Math.floor((Math.random()*4)+1);\n\treturn ran;\n}", "title": "" }, { "docid": "884f6e90768c6e3c760a61fd5a7bffb2", "score": "0.696729", "text": "function randomNumber () {\r\n return Math.floor((Math.random()*3)+1);\r\n }", "title": "" }, { "docid": "e03e219ae23e5b56e1d00efb9cee6aaf", "score": "0.69668776", "text": "function generateRandom( ) {\n return Math.random() ;\n}", "title": "" }, { "docid": "9151c6ab8775b9f890adf0a7f84ce965", "score": "0.69656134", "text": "randomNum() { return Math.random() * (this.max - this.min) + this.min }", "title": "" }, { "docid": "d9eba21be0ba11a105df6af359323290", "score": "0.6961324", "text": "function randoGen(){\n\t\trandoNumber = Math.floor((Math.random()*upperLimit) + lowerLimit);\n\t\tconsole.log(randoNumber);\n\t\t$(\"#random-number\").text(randoNumber);\n\t\t$(\"#wins .panel-body\").text(totalWins);\n\t\t$(\"#losses .panel-body\").text(totalLosses);\n\n\t}", "title": "" }, { "docid": "94696a380679c2c3ac0ec3a3a7266631", "score": "0.6955677", "text": "function random() {\n //var x = Math.sin(seed++) * 10000; // lol -syd\n //return x - Math.floor(x);\n return Math.random();\n}", "title": "" }, { "docid": "4019dbda91f6f172b532ef87d99c5f9d", "score": "0.6951496", "text": "function randomNumberGenerator() {\n\t\tvar randomNumber = Math.floor((Math.random() * 100) + 1);\n\t\tsecretNumber = randomNumber;\n\t\treturn randomNumber;\n\t}", "title": "" }, { "docid": "3f5e6665c30ece44f09c262b16d7cad8", "score": "0.69462806", "text": "function rand(){\n return Math.random()\n}", "title": "" }, { "docid": "90313e21e5fb49b8b60ea1ae6aef3b0c", "score": "0.69377476", "text": "init() {\n this._getRandomColor();\n }", "title": "" }, { "docid": "0e2ed83090c335a077c3de6dfbb51e44", "score": "0.69366556", "text": "function randomNum() {\n return Math.floor(Math.random() * 120) + 19;\n }", "title": "" }, { "docid": "a79c0a6e68fc30493ced3348edd87ef1", "score": "0.69360864", "text": "function getRandomDigit() {\n\n}", "title": "" }, { "docid": "16ab4d1f7b4641acedc2c45b401cf937", "score": "0.6932948", "text": "function randomNumGen() {\n return Math.floor(Math.random() * 102) + 19;\n}", "title": "" }, { "docid": "fc8df82d677f9302d12566257abc88d2", "score": "0.691618", "text": "function getRandomNumber() \n {\n return Math.floor(Math.random() * (2 - 1 + 1)) + 1\n }", "title": "" }, { "docid": "126711467d96c8ca1ee79d0ac51883d4", "score": "0.6910321", "text": "function crystalRandomNumber() { \n return Math.floor(Math.random() * 20+1)\n }", "title": "" }, { "docid": "24df2b884e30ea60d647713adbf6bcbd", "score": "0.6906528", "text": "function randa0(){\n\tseta0(Math.floor(Math.random() * 8) + 1);\n}", "title": "" }, { "docid": "f5f7c654da4d1ae348e3e2d84e8d84f5", "score": "0.6905829", "text": "function Rnd(){\n\t\t//see: http://indiegamr.com/generate-repeatable-random-numbers-in-js/ \n\t\tSEED = (SEED * 9301 + 49297) % 233280;\n\t\tlet random = SEED / 233280;\n \n\t\treturn random;\n\t}", "title": "" }, { "docid": "39105fe3544befab35567e3e29ae76e4", "score": "0.6901665", "text": "function rng_seed_time() {\n rng_seed_int(new Date().getTime());\n }", "title": "" }, { "docid": "39105fe3544befab35567e3e29ae76e4", "score": "0.6901665", "text": "function rng_seed_time() {\n rng_seed_int(new Date().getTime());\n }", "title": "" }, { "docid": "39105fe3544befab35567e3e29ae76e4", "score": "0.6901665", "text": "function rng_seed_time() {\n rng_seed_int(new Date().getTime());\n }", "title": "" }, { "docid": "39105fe3544befab35567e3e29ae76e4", "score": "0.6901665", "text": "function rng_seed_time() {\n rng_seed_int(new Date().getTime());\n }", "title": "" }, { "docid": "46f3e0d3dd833c93139d9bf471e8dec3", "score": "0.6881877", "text": "function rng_seed_time() {\n\t rng_seed_int(new Date().getTime());\n\t}", "title": "" }, { "docid": "46f3e0d3dd833c93139d9bf471e8dec3", "score": "0.6881877", "text": "function rng_seed_time() {\n\t rng_seed_int(new Date().getTime());\n\t}", "title": "" }, { "docid": "46f3e0d3dd833c93139d9bf471e8dec3", "score": "0.6881877", "text": "function rng_seed_time() {\n\t rng_seed_int(new Date().getTime());\n\t}", "title": "" }, { "docid": "46f3e0d3dd833c93139d9bf471e8dec3", "score": "0.6881877", "text": "function rng_seed_time() {\n\t rng_seed_int(new Date().getTime());\n\t}", "title": "" }, { "docid": "46f3e0d3dd833c93139d9bf471e8dec3", "score": "0.6881877", "text": "function rng_seed_time() {\n\t rng_seed_int(new Date().getTime());\n\t}", "title": "" }, { "docid": "46f3e0d3dd833c93139d9bf471e8dec3", "score": "0.6881877", "text": "function rng_seed_time() {\n\t rng_seed_int(new Date().getTime());\n\t}", "title": "" }, { "docid": "46f3e0d3dd833c93139d9bf471e8dec3", "score": "0.6881877", "text": "function rng_seed_time() {\n\t rng_seed_int(new Date().getTime());\n\t}", "title": "" }, { "docid": "46f3e0d3dd833c93139d9bf471e8dec3", "score": "0.6881877", "text": "function rng_seed_time() {\n\t rng_seed_int(new Date().getTime());\n\t}", "title": "" }, { "docid": "46f3e0d3dd833c93139d9bf471e8dec3", "score": "0.6881877", "text": "function rng_seed_time() {\n\t rng_seed_int(new Date().getTime());\n\t}", "title": "" }, { "docid": "46f3e0d3dd833c93139d9bf471e8dec3", "score": "0.6881877", "text": "function rng_seed_time() {\n\t rng_seed_int(new Date().getTime());\n\t}", "title": "" }, { "docid": "46f3e0d3dd833c93139d9bf471e8dec3", "score": "0.6881877", "text": "function rng_seed_time() {\n\t rng_seed_int(new Date().getTime());\n\t}", "title": "" }, { "docid": "46f3e0d3dd833c93139d9bf471e8dec3", "score": "0.6881877", "text": "function rng_seed_time() {\n\t rng_seed_int(new Date().getTime());\n\t}", "title": "" }, { "docid": "46f3e0d3dd833c93139d9bf471e8dec3", "score": "0.6881877", "text": "function rng_seed_time() {\n\t rng_seed_int(new Date().getTime());\n\t}", "title": "" }, { "docid": "46f3e0d3dd833c93139d9bf471e8dec3", "score": "0.6881877", "text": "function rng_seed_time() {\n\t rng_seed_int(new Date().getTime());\n\t}", "title": "" }, { "docid": "46f3e0d3dd833c93139d9bf471e8dec3", "score": "0.6881877", "text": "function rng_seed_time() {\n\t rng_seed_int(new Date().getTime());\n\t}", "title": "" }, { "docid": "46f3e0d3dd833c93139d9bf471e8dec3", "score": "0.6881877", "text": "function rng_seed_time() {\n\t rng_seed_int(new Date().getTime());\n\t}", "title": "" }, { "docid": "46f3e0d3dd833c93139d9bf471e8dec3", "score": "0.6881877", "text": "function rng_seed_time() {\n\t rng_seed_int(new Date().getTime());\n\t}", "title": "" }, { "docid": "46f3e0d3dd833c93139d9bf471e8dec3", "score": "0.6881877", "text": "function rng_seed_time() {\n\t rng_seed_int(new Date().getTime());\n\t}", "title": "" }, { "docid": "46f3e0d3dd833c93139d9bf471e8dec3", "score": "0.6881877", "text": "function rng_seed_time() {\n\t rng_seed_int(new Date().getTime());\n\t}", "title": "" }, { "docid": "b5188ed4b64e8cc48b2b331dda45f02f", "score": "0.68747264", "text": "function rng_seed_time() {\n\t\t rng_seed_int(new Date().getTime());\n\t\t}", "title": "" }, { "docid": "98fb44f2e7219e3dcc68e6291b1f89ec", "score": "0.6874122", "text": "function getRandomNum()\r\n {\r\n var randomNum = Math.floor(Math.random() * 10);\r\n return randomNum;\r\n }", "title": "" }, { "docid": "0bed1683a1e88b52e946b1bda51d416a", "score": "0.687206", "text": "function randNum() {\r\n\tvar x = Math.random();\r\n \treturn x;\r\n}", "title": "" }, { "docid": "43af089a1b894d4622c4cef545ae959e", "score": "0.6865125", "text": "function randomNumber() {\n return Math.floor((Math.random() * 10) + 1)\n }", "title": "" }, { "docid": "db9097baf3d09193c18fae909b6fd4d2", "score": "0.68636626", "text": "function rng_seed_time() {\n rng_seed_int(new Date().getTime());\n}", "title": "" }, { "docid": "67636487863ed3bd497c43292cae2bde", "score": "0.6858922", "text": "function rng_seed_time() {\n rng_seed_int(new Date().getTime());\n }", "title": "" }, { "docid": "67636487863ed3bd497c43292cae2bde", "score": "0.6858922", "text": "function rng_seed_time() {\n rng_seed_int(new Date().getTime());\n }", "title": "" }, { "docid": "d13ebf4c03fc4c5b22f1cc35719b29a1", "score": "0.6855007", "text": "function rando(){\n rand = Math.floor(Math.random() * 7);\n return rand;\n }", "title": "" }, { "docid": "a8eedb5cb0265a813db7f30342b1feea", "score": "0.6836716", "text": "function rand(n){ return Math.random() * n}", "title": "" }, { "docid": "6fce53a09805718f770941137bde1b82", "score": "0.6836223", "text": "function randomInt(){\nreturn (Math.floor(Math.random()*10)+ 1);\n}", "title": "" }, { "docid": "b56a19b78b2ab49c352c664b463fd60c", "score": "0.6834223", "text": "function generateRandomNumber() {\r\n return new Date().getTime() + Math.random().toString(36).substring(7);\r\n}", "title": "" }, { "docid": "a7c039997a5cb6821cfb2dc0bbfbc750", "score": "0.68340504", "text": "generateNewNumber()\n {\n return Math.random() < 0.9 ? 2 : 4;\n }", "title": "" }, { "docid": "43fe1578ad2597ac88ed4bd3700fb03a", "score": "0.68323594", "text": "function randomGenerator(){\n \treturn Math.floor( ( (Math.random() *10) + 1 ) % 5);\n }", "title": "" }, { "docid": "7e31c4ea1590dac325e1c82a1e1f71eb", "score": "0.6832085", "text": "function getRandomNumber() {\n return String.fromCharCode(Math.floor(Math.random() * 10) + 48);\n }", "title": "" }, { "docid": "6308b602f975a233f22fb5a562a5736f", "score": "0.6830143", "text": "function randomNumGen() {\n randomNum = Math.floor(Math.random() * (120 - 19) + 19);\n $(\"#randomNum\").text(randomNum);\n}", "title": "" }, { "docid": "176baad43a2d2018e0a62f835209d8e5", "score": "0.68290704", "text": "function randomNumber() {\n return Math.floor(Math.random() * 256);\n }", "title": "" }, { "docid": "c7d22365d5efd19e2c33ce5f4cabc617", "score": "0.6820719", "text": "function rng_seed_time() {\n rng_seed_int(new Date().getTime());\n}", "title": "" }, { "docid": "c7d22365d5efd19e2c33ce5f4cabc617", "score": "0.6820719", "text": "function rng_seed_time() {\n rng_seed_int(new Date().getTime());\n}", "title": "" }, { "docid": "c7d22365d5efd19e2c33ce5f4cabc617", "score": "0.6820719", "text": "function rng_seed_time() {\n rng_seed_int(new Date().getTime());\n}", "title": "" }, { "docid": "3c944282a3a30ba1948d9f4af3cbf0b4", "score": "0.68183935", "text": "function randinit() {\n var a, b, c, d, e, f, g, h;\n\n /* private mixing function */\n function mix () {\n a ^= b << 11; d = (d + a)|0; b = (b + c)|0;\n b ^= c >>> 2; e = (e + b)|0; c = (c + d)|0;\n c ^= d << 8; f = (f + c)|0; d = (d + e)|0;\n d ^= e >>> 16; g = (g + d)|0; e = (e + f)|0;\n e ^= f << 10; h = (h + e)|0; f = (f + g)|0;\n f ^= g >>> 4; a = (a + f)|0; g = (g + h)|0;\n g ^= h << 8; b = (b + g)|0; h = (h + a)|0;\n h ^= a >>> 9; c = (c + h)|0; a = (a + b)|0;\n }\n\n acc = brs = cnt = 0;\n\n // the golden ratio\n a = b = c = d = e = f = g = h = 0x9e3779b9;\n\n // scramble it\n for ( var i = 0; i < 4; i++ )\n mix();\n\n // mix it and combine with the internal state\n for ( var i = 0; i < 256; i += 8 ) {\n a = (a + r[i|0])|0; b = (b + r[i|1])|0;\n c = (c + r[i|2])|0; d = (d + r[i|3])|0;\n e = (e + r[i|4])|0; f = (f + r[i|5])|0;\n g = (g + r[i|6])|0; h = (h + r[i|7])|0;\n mix();\n m.set([a, b, c, d, e, f, g, h], i);\n }\n\n // mix it again\n for ( var i = 0; i < 256; i += 8 ) {\n a = (a + m[i|0])|0; b = (b + m[i|1])|0;\n c = (c + m[i|2])|0; d = (d + m[i|3])|0;\n e = (e + m[i|4])|0; f = (f + m[i|5])|0;\n g = (g + m[i|6])|0; h = (h + m[i|7])|0;\n mix();\n m.set([a, b, c, d, e, f, g, h], i);\n }\n\n // fill in the first set of results\n prng(1), gnt = 256;\n }", "title": "" } ]
64ec7b2e9a81a2d98ad3a9f6728a4aa2
What is a jQuery but a misunderstood object? > What Is A JQuery But A Misunderstood Object?
[ { "docid": "19c815a3dbae372a6e52fa2c75087e5d", "score": "0.0", "text": "function capitalize(words) {\n words = words.split(' ');\n for(var i = 0; i <words.length; i++) {\n words[i] = words[i].split('');\n words[i][0] = words[i][0].toUpperCase();\n words[i] = words[i].join('');\n }\nreturn words.join(' ');\n\n}", "title": "" } ]
[ { "docid": "1acb1766174a774cff4437a1a375686a", "score": "0.66325575", "text": "function isjQuery(obj) {\n\t\treturn (obj && (obj instanceof jQuery || obj.constructor.prototype.jquery));\n\t}", "title": "" }, { "docid": "ab7ee6f5971c549252a6c3f81e05ad79", "score": "0.6607967", "text": "function isJquery(a) {\n if (isNullOrUndefined(jQuery)) {\n return false;\n }\n else {\n return (a instanceof jQuery);\n }\n }", "title": "" }, { "docid": "55dc0a5484a2c9919448b94db6eb0ba3", "score": "0.64116704", "text": "function instance(object) {\n return object instanceof $ || ($.zepto && $.zepto.isZ(object));\n }", "title": "" }, { "docid": "0f459a181655bbdcf0fed1d5378cb5d0", "score": "0.6385771", "text": "constructor() {\n this.element = null; // store jQuery object in constructor\n // - note indicating this is not a dom object but a jQuery object dom element\n }", "title": "" }, { "docid": "4069adc6417939ddc5d95fd49f1c5ea0", "score": "0.6373166", "text": "function $(e,t){return\"function\"==typeof e&&(e=e.call(t)),null==e&&(e=new o(t.getQuery())),e}", "title": "" }, { "docid": "023d5d5ce59117034bef4ff57c81277e", "score": "0.6079188", "text": "function subJQuery() {\n var tQuery = function (selector, context, namespace) {\n return new tQuery.prototype.init(selector, context, namespace || (this && this.namespace));\n };\n _.merge(tQuery, jQuery);\n // Do not like\n // probably needed in some special unique cases\n tQuery.jQuery = jQuery;\n // expose events for doing special events as required.\n tQuery.event = (jQuery).event;\n tQuery.fn = tQuery.prototype = extend({\n }, jQuery.fn);\n tQuery.fn.constructor = tQuery;\n tQuery.fn.init = function init(selector, context, namespace) {\n var ioDom = context instanceof tQuery;\n if(context && context instanceof jQuery && !(ioDom)) {\n context = tQuery(context);\n }\n var result = jQuery.fn.init.call(this, selector, context, tQueryRoot);\n if(namespace) {\n result.namespace = namespace;\n } else if(ioDom) {\n result.namespace = context.namespace;\n }\n return result;\n };\n tQuery.fn.init.prototype = tQuery.fn;\n var tQueryRoot = tQuery(document);\n // remove all not applicable methods off of fn.\n each(jQueryFnMethodBlackList, function (x) {\n if(tQuery.fn[x]) {\n tQuery.fn[x] = null;\n delete tQuery.fn[x];\n }\n });\n _.each([\n 'on', \n 'one', \n 'off'\n ], function (x) {\n tQuery.fn[x] = _.wrap(tQuery.fn[x], function (f) {\n var args = [];\n for (var _i = 0; _i < (arguments.length - 1); _i++) {\n args[_i] = arguments[_i + 1];\n }\n false && log.debug(format('tQuery[{0}]: Binding ' + x + ' events...', this.namespace));\n args[0] = normalizeEvents(args[0], this.namespace);\n return f.apply(this, args);\n });\n });\n tQuery.fn.query = tQuery.fn.$ = tQuery.fn.find;\n return tQuery;\n }", "title": "" }, { "docid": "b83368775d8c903ef47ffbab911292d7", "score": "0.6043029", "text": "predicate(input) {\n return typeof jQuery !== 'undefined' && input instanceof jQuery;\n }", "title": "" }, { "docid": "bdc6cc006abc9b6f481e7d20c67054fe", "score": "0.59851784", "text": "function updateJQuery( $ ) {\r\n if ( !$ || ( $ && $.bridget ) ) {\r\n return;\r\n }\r\n $.bridget = jQueryBridget;\r\n}", "title": "" }, { "docid": "bdc6cc006abc9b6f481e7d20c67054fe", "score": "0.59851784", "text": "function updateJQuery( $ ) {\r\n if ( !$ || ( $ && $.bridget ) ) {\r\n return;\r\n }\r\n $.bridget = jQueryBridget;\r\n}", "title": "" }, { "docid": "36384e6954113c1928df8a05d27c442b", "score": "0.59662473", "text": "function canJQuery() {\n return !!window.jQuery\n }", "title": "" }, { "docid": "d065a8f08f897b125ff600069b0f9708", "score": "0.59034747", "text": "function updateJQuery( $ ) {\n if ( !$ || ( $ && $.bridget ) ) {\n return;\n }\n $.bridget = jQueryBridget;\n}", "title": "" }, { "docid": "d065a8f08f897b125ff600069b0f9708", "score": "0.59034747", "text": "function updateJQuery( $ ) {\n if ( !$ || ( $ && $.bridget ) ) {\n return;\n }\n $.bridget = jQueryBridget;\n}", "title": "" }, { "docid": "d065a8f08f897b125ff600069b0f9708", "score": "0.59034747", "text": "function updateJQuery( $ ) {\n if ( !$ || ( $ && $.bridget ) ) {\n return;\n }\n $.bridget = jQueryBridget;\n}", "title": "" }, { "docid": "d065a8f08f897b125ff600069b0f9708", "score": "0.59034747", "text": "function updateJQuery( $ ) {\n if ( !$ || ( $ && $.bridget ) ) {\n return;\n }\n $.bridget = jQueryBridget;\n}", "title": "" }, { "docid": "d065a8f08f897b125ff600069b0f9708", "score": "0.59034747", "text": "function updateJQuery( $ ) {\n if ( !$ || ( $ && $.bridget ) ) {\n return;\n }\n $.bridget = jQueryBridget;\n}", "title": "" }, { "docid": "d065a8f08f897b125ff600069b0f9708", "score": "0.59034747", "text": "function updateJQuery( $ ) {\n if ( !$ || ( $ && $.bridget ) ) {\n return;\n }\n $.bridget = jQueryBridget;\n}", "title": "" }, { "docid": "d065a8f08f897b125ff600069b0f9708", "score": "0.59034747", "text": "function updateJQuery( $ ) {\n if ( !$ || ( $ && $.bridget ) ) {\n return;\n }\n $.bridget = jQueryBridget;\n}", "title": "" }, { "docid": "48e1f8b6c242d92ff7e86a7186dc5860", "score": "0.58476216", "text": "function $(objId) {\r\n return document.getElementById(objId);\r\n}", "title": "" }, { "docid": "62007aa2f1eee4eed68e41b37a88d85e", "score": "0.58276373", "text": "function updateJQuery( $ ) {\n if ( !$ || ( $ && $.bridget ) ) {\n return;\n }\n $.bridget = jQueryBridget;\n }", "title": "" }, { "docid": "b9d9b978000bb944b91addbebd24a1c4", "score": "0.58239424", "text": "function updateJQuery($) {\n if (!$ || ($ && $.bridget)) {\n return;\n }\n $.bridget = jQueryBridget;\n }", "title": "" }, { "docid": "f0aebe76f8c7eb825eb6130f7cce26a7", "score": "0.5787073", "text": "function updateJQuery($) {\n if (!$ || $ && $.bridget) {\n return;\n }\n\n $.bridget = jQueryBridget;\n }", "title": "" }, { "docid": "954b8ad349839d17b0526f445fa154f3", "score": "0.5761401", "text": "function isInstance ( a ) {\n\t\treturn a instanceof $ || ( $.zepto && $.zepto.isZ(a) );\n\t}", "title": "" }, { "docid": "6ababe48162c2b5763c692a0009a5bce", "score": "0.5696021", "text": "function isSingleJQueryElement( node, msg ) {\n\tvar actual = {\n\t\ttype: typeof node.jquery,\n\t\tsize: node.length\n\t};\n\tvar expected = {\n\t\ttype: \"string\",\n\t\tsize: 1\n\t};\n\tQUnit.push( QUnit.equiv( actual, expected ), actual, expected, msg );\n}", "title": "" }, { "docid": "fdae1a9d06bff39533da96de86500ec4", "score": "0.56866276", "text": "function isjQuery ($) {\n return typeof $ === 'function' && $.fn && $.noConflict\n }", "title": "" }, { "docid": "3e5d03faeb3f3b75e83bd56d4e30db50", "score": "0.5652349", "text": "asJQuery() {\n\t\treturn jQuery(\"#\" + this.getId());\n\t}", "title": "" }, { "docid": "e090985b0179916e09dc07f0564ff907", "score": "0.5649987", "text": "function checkForJqueryPresents(){\n\t\t\tif(typeof jQuery == \"undefined\")\n\t\t\t\tthrow new Error(\"jQuery library not included\");\n\t\t}", "title": "" }, { "docid": "7ad385154d84351dbbe5686286deb0e8", "score": "0.56371653", "text": "function $(element) {\n var element = typeof(element) == 'string' ? document.getElementById(element) : element;\n return Browser.OLD ? Element.prepare(element) : element;\n}", "title": "" }, { "docid": "890c4eda8ef4cafc3931b316e322f976", "score": "0.5618973", "text": "function $(element) {\n return T5.$(element);\n }", "title": "" }, { "docid": "be538fd01278dfc76753e595baa635ec", "score": "0.55820036", "text": "function d$(id){ try{return document.getElementById(id);}catch(e){woas.crash(\"d$('\"+id+\"') invalid reference:\\n\\n\"+e);} }", "title": "" }, { "docid": "3c99f989bdff4378ea32ef01017d3c51", "score": "0.55778944", "text": "function jQueryCheck(jqCandidate) {\n if (!context.jQuery) {\n var $ = jqCandidate || (typeof jQuery !== \"undefined\" ? jQuery : null);\n if ($ && \"readyWait\" in $) {\n context.jQuery = $;\n\n //Manually create a \"jquery\" module entry if not one already\n //or in process.\n callDefMain([\"jquery\", [], function () {\n return jQuery;\n }]);\n\n //Increment jQuery readyWait if ncecessary.\n if (context.scriptCount) {\n $.readyWait += 1;\n context.jQueryIncremented = true;\n }\n }\n }\n }", "title": "" }, { "docid": "a374e6e6bdfe0a38e08a251656a69921", "score": "0.5537673", "text": "function enumerateJQuery(jqueryObj) {\n let array = $.makeArray(jqueryObj);\n return array.entries();\n}", "title": "" }, { "docid": "2cb1a20d2191e5219f8a7be51a18ec19", "score": "0.54773", "text": "function isSelector(v) {\n return (artoo.$ && v instanceof artoo.$) ||\n (jQuery && v instanceof jQuery) ||\n ($ && v instanceof $);\n }", "title": "" }, { "docid": "9a12010e64be283ccfb231b2acd2ddbd", "score": "0.5453348", "text": "function $(something) {\n if (typeof(something) == \"string\") {\n var elm = document.getElementById(something);\n } else {\n var elm = something;\n }\n if (something instanceof Array) {\n var elm = [];\n for (var i = 0; i < something.length; i++) {\n elm.push($(something[i]));\n }\n }\n if (!elm) return false;\n return elm;\n}", "title": "" }, { "docid": "66fd52313ab2755dff98343a72f04969", "score": "0.5431088", "text": "function $(selector){\n // Allow '#id' or 'id'\n var c = selector.charAt(0);\n if( c === '#' ){\n var element = document.getElementById(selector.slice(1,selector.length));\n }else{\n var element = document.getElementById(selector);\n }\n /*\n }else if( c === '.' ){\n var element = document.getElementsByClassName(selector.slice(1,selector.length))[0];\n }else{\n var element = document.getElementsByTagName(selector)[0];\n }\n */\n var self = {}\n var on = function(eventStr,callback){\n var events = eventStr.split(' ');\n var i, l = events.length;\n for( i=0; i<l; i+=1 ){\n if( element.attachEvent ){\n element.attachEvent('on'+events[i], callback);\n }else{\n element.addEventListener(events[i], callback, false);\n }\n }\n return self;\n };\n\n self.on = on;\n self.element = element;\n\n return self;\n }", "title": "" }, { "docid": "503eaa7d9902834901e53b9b3d38b8df", "score": "0.5414878", "text": "function isJQ(html,html2)\n{\n\treturn $(html).is(html2);\n}", "title": "" }, { "docid": "be185f71f933c1391c3e2ff039cc3f2f", "score": "0.5409152", "text": "function isWrapped (elements) {\n return elements && (elements.jquery || (window.Zepto && window.Zepto.zepto.isZ(elements)));\n }", "title": "" }, { "docid": "a52288db1c667f900232623deff5e754", "score": "0.5359689", "text": "function $() {\n this.a = {};\n }", "title": "" }, { "docid": "d5ec0de77647ab891132878cd1673cc1", "score": "0.5357599", "text": "function _cloneObject(object) {\n\t if (object == null || typeof (object) != 'object' || typeof (object.nodeType) != 'undefined') {\n\t return object;\n\t }\n\t var temp = {};\n\t for (var key in object) {\n\t if (typeof (jQuery) != 'undefined' && object[key] instanceof jQuery) {\n\t temp[key] = object[key];\n\t } else {\n\t temp[key] = _cloneObject(object[key]);\n\t }\n\t }\n\t return temp;\n\t }", "title": "" }, { "docid": "91c28e6caf6380e5388656bfa271903f", "score": "0.5354225", "text": "function REGISTERJQUERYFN(name, object){\n\t\t$.fn[name] = function(options) {\n\n if ( this.length ) {\n return this.each(function() {\n if ( ! $.data(this, name) ) {\n\n $.data( this, name, new object(this, options));\n\n }\n });\n }\n\n };\n\n $.fn[name].Constructor = object;\n\t}", "title": "" }, { "docid": "c1496acaa49bb7a31d241c5138a2c992", "score": "0.5344268", "text": "function letsJQuery() {\r\n $(\".blurredAnswer, .relatedSolutions, .allZonesMain, .qStats, .lightImage, .ontopBanner, .adSense, .startFreeTrial, div#pageRight, #relatedSolutions20X6\").remove();\r\n\r\n $(\".sectionTwo:first\").after('<h2><a style=\"color: #ee6600;\" href=\"#theanswer\">Skip To The Accepted Solution &gt;&gt;</a></h2><br />');\r\n $(\".acceptedHeader\").before('<a id=\"theanswer\" name=\"theanswer\"></a>');\r\n\r\n }", "title": "" }, { "docid": "226a9abf610f404b8e6dbe131ab09f1d", "score": "0.53417456", "text": "function JQueryDomService($) {\n var renderedGuides = {};\n\n // TODO add doc\n function attachGuideTo(cssIdRenderTarget, html, cssIdGuideContainer) {\n $('#' + cssIdRenderTarget).prepend(html);\n rememberGuide(cssIdGuideContainer);\n }\n\n // TODO add doc\n function domContainsGuide(guideCssId) {\n return renderedGuides[guideCssId];\n }\n\n // TODO add doc\n function rememberGuide(guideCssId) {\n renderedGuides[guideCssId] = 'dummy'; // TODO sth. better that dummy value?\n }\n\n // TODO add doc\n function showGuide(guideCssId) {\n $('#' + guideCssId).show();\n }\n\n function hideGuide(guideCssId) {\n $('#' + guideCssId).hide();\n }\n\n function fadeOutGuide(guideCssId, fadeOutMillis) {\n $('#' + guideCssId).fadeOut(fadeOutMillis);\n }\n\n // TODO add doc\n function attachEventTo(eventName, cssIdGuideContainer, fn) {\n $('#' + cssIdGuideContainer).on(eventName, fn);\n }\n\n this.attachGuideTo = attachGuideTo;\n this.showGuide = showGuide;\n this.hideGuide = hideGuide;\n this.fadeOutGuide = fadeOutGuide;\n this.attachEventTo = attachEventTo;\n this.domContainsGuide = domContainsGuide;\n }", "title": "" }, { "docid": "33d633e36e559286ad77c230088a2977", "score": "0.53344315", "text": "function _cloneObject(object) {\n if (object == null || typeof (object) != 'object' || typeof (object.nodeType) != 'undefined') {\n return object;\n }\n var temp = {};\n for (var key in object) {\n if (typeof (jQuery) != 'undefined' && object[key] instanceof jQuery) {\n temp[key] = object[key];\n } else {\n temp[key] = _cloneObject(object[key]);\n }\n }\n return temp;\n }", "title": "" }, { "docid": "33d633e36e559286ad77c230088a2977", "score": "0.53344315", "text": "function _cloneObject(object) {\n if (object == null || typeof (object) != 'object' || typeof (object.nodeType) != 'undefined') {\n return object;\n }\n var temp = {};\n for (var key in object) {\n if (typeof (jQuery) != 'undefined' && object[key] instanceof jQuery) {\n temp[key] = object[key];\n } else {\n temp[key] = _cloneObject(object[key]);\n }\n }\n return temp;\n }", "title": "" }, { "docid": "33d633e36e559286ad77c230088a2977", "score": "0.53344315", "text": "function _cloneObject(object) {\n if (object == null || typeof (object) != 'object' || typeof (object.nodeType) != 'undefined') {\n return object;\n }\n var temp = {};\n for (var key in object) {\n if (typeof (jQuery) != 'undefined' && object[key] instanceof jQuery) {\n temp[key] = object[key];\n } else {\n temp[key] = _cloneObject(object[key]);\n }\n }\n return temp;\n }", "title": "" }, { "docid": "33d633e36e559286ad77c230088a2977", "score": "0.53344315", "text": "function _cloneObject(object) {\n if (object == null || typeof (object) != 'object' || typeof (object.nodeType) != 'undefined') {\n return object;\n }\n var temp = {};\n for (var key in object) {\n if (typeof (jQuery) != 'undefined' && object[key] instanceof jQuery) {\n temp[key] = object[key];\n } else {\n temp[key] = _cloneObject(object[key]);\n }\n }\n return temp;\n }", "title": "" }, { "docid": "33d633e36e559286ad77c230088a2977", "score": "0.53344315", "text": "function _cloneObject(object) {\n if (object == null || typeof (object) != 'object' || typeof (object.nodeType) != 'undefined') {\n return object;\n }\n var temp = {};\n for (var key in object) {\n if (typeof (jQuery) != 'undefined' && object[key] instanceof jQuery) {\n temp[key] = object[key];\n } else {\n temp[key] = _cloneObject(object[key]);\n }\n }\n return temp;\n }", "title": "" }, { "docid": "bacc0a4cb802da2f96df52cb79c28fb2", "score": "0.5327986", "text": "function winnow(elements,qualifier,not){if(jQuery.isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not;});}// Single element\nif(qualifier.nodeType){return jQuery.grep(elements,function(elem){return elem===qualifier!==not;});}// Arraylike of elements (jQuery, arguments, Array)\nif(typeof qualifier!==\"string\"){return jQuery.grep(elements,function(elem){return indexOf.call(qualifier,elem)>-1!==not;});}// Simple selector that can be filtered directly, removing non-Elements\nif(risSimple.test(qualifier)){return jQuery.filter(qualifier,elements,not);}// Complex selector, compare the two sets, removing non-Elements\nqualifier=jQuery.filter(qualifier,elements);return jQuery.grep(elements,function(elem){return indexOf.call(qualifier,elem)>-1!==not&&elem.nodeType===1;});}", "title": "" }, { "docid": "6cf5c36e005c1bc72cabb11854d8a48a", "score": "0.53209096", "text": "function $( id ){\n return document.getElementById( id );\n}", "title": "" }, { "docid": "3667fbedde398228ff31fac627fd9dcf", "score": "0.53056717", "text": "function $(id)\n{\n return document.getElementById(id);\n}", "title": "" }, { "docid": "55fd1403127db45e9392daacc7b00c8e", "score": "0.5301416", "text": "function $(id) {\n 'use strict';\n if (typeof id != 'undefined') {\n return document.getElementById(id);\n }\n} // End of $ function.", "title": "" }, { "docid": "68a5f9f37111db4e1e5abc3e82252aa4", "score": "0.5299061", "text": "function $(x){ return document.getElementById(x)}", "title": "" }, { "docid": "d686d35e98388b68dcb09d3d50f6164b", "score": "0.5295341", "text": "function $(id) \n{\n return document.getElementById(id);\n}", "title": "" }, { "docid": "1c9fca1060c6a2a4a8c37a03bf130e71", "score": "0.5293056", "text": "function _cloneObject(object) {\n if (object == null || (typeof object === 'undefined' ? 'undefined' : _typeof(object)) != 'object' || typeof object.nodeType != 'undefined') {\n return object;\n }\n var temp = {};\n for (var key in object) {\n if (typeof jQuery != 'undefined' && object[key] instanceof jQuery) {\n temp[key] = object[key];\n } else {\n temp[key] = _cloneObject(object[key]);\n }\n }\n return temp;\n }", "title": "" }, { "docid": "2c6bcb07a065614fc600cf174f63e091", "score": "0.5281242", "text": "function jQuery2element ($el) {\n if (!$el) {\n return $el;\n }\n if (undefined === $el.length) {\n return $el;\n }\n return (\n $el.length\n ? $el[0]\n : null\n );\n}", "title": "" }, { "docid": "f421830af7ddaf6964b5cfb3a40a8a91", "score": "0.527597", "text": "function $(ID,root) {return (root||document).getElementById(ID);}", "title": "" }, { "docid": "f421830af7ddaf6964b5cfb3a40a8a91", "score": "0.527597", "text": "function $(ID,root) {return (root||document).getElementById(ID);}", "title": "" }, { "docid": "f421830af7ddaf6964b5cfb3a40a8a91", "score": "0.527597", "text": "function $(ID,root) {return (root||document).getElementById(ID);}", "title": "" }, { "docid": "ad98196142550686684c6fac3552f8ab", "score": "0.52717525", "text": "function $$(str) {\n\treturn $(\"#\" + str);\n}", "title": "" }, { "docid": "b8fa924f606a65feec46ce50b9eb5a4a", "score": "0.52674735", "text": "function DemoJQ() {\n this.$root = $(this.root);\n this.$heading = $(this.$root.find('.heading').get(0));\n this.$img = $(this.$root.find('img').get(0));\n\n this.$root.on('click', $.proxy(swapAssets, this));\n }", "title": "" }, { "docid": "6f7d7d6218b8a08b0e179f0599b5c268", "score": "0.5263885", "text": "function _cloneObject(object) {\n if (object == null || typeof (object) != 'object' || typeof (object.nodeType) != 'undefined') {\n return object;\n }\n var temp = {};\n for (var key in object) {\n if (typeof (jQuery) != 'undefined' && object[key] instanceof jQuery) {\n temp[key] = object[key];\n } else {\n temp[key] = _cloneObject(object[key]);\n }\n }\n return temp;\n }", "title": "" }, { "docid": "82cba2366de841c0057eed75a51d4f47", "score": "0.52602625", "text": "function $(id) {\r\n\treturn document.getElementById(id);\r\n}", "title": "" }, { "docid": "5b7f1979c99882bab60db081bc2609a1", "score": "0.5259475", "text": "function checkJQuery(){\n\tif (typeof(jQuery)==='undefined'){\n\t\tsetTimeout(checkJQuery,100);}\n\telse{\n\t\tget_nav();\n\t}\n}", "title": "" }, { "docid": "94001fe963191e2c787aec1c108bf9a1", "score": "0.5252741", "text": "function $(id){return document.getElementById(id);}", "title": "" }, { "docid": "3691798c673d6f598063b8da50d80040", "score": "0.52495277", "text": "function $(id)\r\n{\r\n return document.getElementById(id);\r\n}", "title": "" }, { "docid": "a29a7eec28c8480d450a96d712cc130d", "score": "0.52330154", "text": "function letsJQuery()\n{\n\n /*\n * jQuery plugin: fieldSelection - v0.1.0 - last change: 2006-12-16\n * (c) 2006 Alex Brem <alex@0xab.cd> - http://blog.0xab.cd\n */\n\n(function() {\n\n jQuery(\"tr.uploaded\").each( function(my_tr) {\n\n }\n );\n\n})();\n\n}", "title": "" }, { "docid": "c0ffda5bdbb65bb15815f5abf914b229", "score": "0.5229313", "text": "function $(id) {\n return document.getElementById(id);\n}", "title": "" }, { "docid": "c0ffda5bdbb65bb15815f5abf914b229", "score": "0.5229313", "text": "function $(id) {\n return document.getElementById(id);\n}", "title": "" }, { "docid": "4ce124ddb9a1f2103edaecefd3b44dab", "score": "0.52271086", "text": "function $(id) { return document.getElementById(id); }", "title": "" }, { "docid": "4ce124ddb9a1f2103edaecefd3b44dab", "score": "0.52271086", "text": "function $(id) { return document.getElementById(id); }", "title": "" }, { "docid": "4ce124ddb9a1f2103edaecefd3b44dab", "score": "0.52271086", "text": "function $(id) { return document.getElementById(id); }", "title": "" }, { "docid": "4ce124ddb9a1f2103edaecefd3b44dab", "score": "0.52271086", "text": "function $(id) { return document.getElementById(id); }", "title": "" }, { "docid": "4ce124ddb9a1f2103edaecefd3b44dab", "score": "0.52271086", "text": "function $(id) { return document.getElementById(id); }", "title": "" }, { "docid": "27421a6e0c45171e93ff21806bbe9c78", "score": "0.52266806", "text": "function beautyDecision(){\n if ( (options = arguments[ i ]) != null ) {\n //bara bara ....\n }\n \n memory = !flags.memory || [ context, args ];\n \n clone = src && jQuery.isPlainObject(src) ? src : {};\n \n isArray = Array.isArray || function( obj ) {\n return jQuery.type(obj) === \"array\";\n },\n \n //inv may not pass, so the value will be undefined\n grep = function(elems, callback, inv) {\n inv = !!inv;\n //....\n }\n \n // Unique for each copy of jQuery on the page\n expando = \"jQuery\" + ( jQuery.fn.jquery + Math.random() ).replace( /\\D/g, \"\" ),\n \n data = data === \"true\" ? true :\n data === \"false\" ? false :\n data === \"null\" ? null :\n jQuery.isNumeric( data ) ? parseFloat( data ) :\n rbrace.test( data ) ? jQuery.parseJSON( data ) :\n data;\n \n // Attach a bunch of functions\n jQuery.each( \"ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend\".split( \" \" ), function( i, o ){\n jQuery.fn[ o ] = function( f ){\n return this.bind( o, f );\n };\n });\n \n param = ['id=1234','limit=50'];\n url = \"/test.py\" + \"?\" + param.join(\"&\");\n \n //if hasData() is true, then return the value of jQuery._data();,\n //otherwise, return false\n var elemData = jQuery.hasData( elem ) && jQuery._data( elem );\n \n var ret = [].join(\"&\"); //value is \"\"\n \n // Allow instantiation without the 'new' keyword\n if ( !(this instanceof jQuery.Event) ) {\n return new jQuery.Event( src, props );\n }\n \n event = typeof event === \"object\" ?\n // jQuery.Event object\n event[ jQuery.expando ] ? event :\n // Object literal\n new jQuery.Event( type, event ) :\n // Just the event type (string)\n new jQuery.Event( type );\n\n Array.prototype.slice(\"hello\",0);//[h,e,l,l,o]\n Array.prototype.slice($(\".demo\"),0);//elems\n\n /**toggleClass source**/\n self = jQuery(this); \n state = isBool ? state : !self.hasClass( className );\n self[ state ? \"addClass\" : \"removeClass\" ]( className );\n \n hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n \n if ( hooks && \"get\" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {\n return ret;\n }\n \n /**\n * temp change value\n * \n * jQuery.swap( elem, { \"display\": \"inline-block\" },\n curCSS, [ elem, \"marginRight\" ] );\n */\n swap = function( elem, options, callback, args ) {\n var ret, name,\n old = {};\n\n // Remember the old values, and insert the new ones\n for ( name in options ) {\n old[ name ] = elem.style[ name ];\n elem.style[ name ] = options[ name ];\n }\n\n ret = callback.apply( elem, args || [] );\n\n // Revert the old values\n for ( name in options ) {\n elem.style[ name ] = old[ name ];\n }\n\n return ret;\n }\n}", "title": "" }, { "docid": "4bf8703532ba36912986efc5ad732d11", "score": "0.5223301", "text": "function jQueryJSON($) {\n var _escapeable = /[\"\\\\\\x00-\\x1f\\x7f-\\x9f]/g,\n _meta = {\n '\\b': '\\\\b',\n '\\t': '\\\\t',\n '\\n': '\\\\n',\n '\\f': '\\\\f',\n '\\r': '\\\\r',\n '\"' : '\\\\\"',\n '\\\\': '\\\\\\\\'\n },\n JSON = window.JSON; \n \n /** jQuery.toJSON( json-serializble )\n Converts the given argument into a JSON respresentation.\n\n If an object has a \"toJSON\" function, that will be used to get the representation.\n Non-integer/string keys are skipped in the object, as are keys that point to a function.\n\n json-serializble:\n The *thing* to be converted.\n **/\n $.toJSON = function(o)\n {\n var type;\n \n if (typeof(JSON) === 'object'){\n if (window.MooTools && JSON.encode){\n return JSON.encode(o);\n }\n else if (JSON.stringify){\n return JSON.stringify(o);\n }\n }\n\n type = typeof(o);\n\n if (o === null){\n return \"null\";\n }\n\n if (type === \"undefined\"){\n return undefined;\n }\n\n if (type === \"number\" || type === \"boolean\"){\n return o + \"\";\n }\n\n if (type === \"string\"){\n return $.quoteString(o);\n }\n\n if (type === 'object')\n {\n if (typeof o.toJSON === \"function\"){\n return $.toJSON( o.toJSON() );\n }\n\n if (o.constructor === Date)\n {\n var month = o.getUTCMonth() + 1;\n if (month < 10){\n month = '0' + month;\n }\n\n var day = o.getUTCDate();\n if (day < 10){\n day = '0' + day;\n }\n\n var year = o.getUTCFullYear();\n\n var hours = o.getUTCHours();\n if (hours < 10){\n hours = '0' + hours;\n }\n\n var minutes = o.getUTCMinutes();\n if (minutes < 10){\n minutes = '0' + minutes;\n }\n\n var seconds = o.getUTCSeconds();\n if (seconds < 10){\n seconds = '0' + seconds;\n }\n\n var milli = o.getUTCMilliseconds();\n if (milli < 100){\n milli = '0' + milli;\n }\n if (milli < 10){\n milli = '0' + milli;\n }\n\n return '\"' + year + '-' + month + '-' + day + 'T' +\n hours + ':' + minutes + ':' + seconds + \n '.' + milli + 'Z\"'; \n }\n\n if (o.constructor === Array) \n {\n var ret = [],\n len = o.length,\n i;\n for (i = 0; i < len; i++){\n ret.push( $.toJSON(o[i]) || \"null\" );\n }\n\n return \"[\" + ret.join(\",\") + \"]\";\n }\n\n var pairs = [];\n for (var k in o) {\n if (o.hasOwnProperty(k)){\n var name;\n type = typeof k;\n\n if (type === \"number\"){\n name = '\"' + k + '\"';\n }\n else if (type === \"string\"){\n name = $.quoteString(k);\n }\n else {\n continue; //skip non-string or number keys\n }\n\n if (typeof o[k] === \"function\"){\n continue; //skip pairs where the value is a function.\n }\n\n var val = $.toJSON(o[k]);\n\n pairs.push(name + \":\" + val);\n }\n }\n\n return \"{\" + pairs.join(\", \") + \"}\";\n }\n };\n\n /** jQuery.evalJSON(src)\n Evaluates a given piece of json source.\n **/\n /*\n $.evalJSON = function(src)\n {\n if (typeof(JSON) === 'object' && JSON.parse){\n return JSON.parse(src);\n }\n return eval(\"(\" + src + \")\");\n };\n */\n\n /** jQuery.secureEvalJSON(src)\n Evals JSON in a way that is *more* secure.\n **/\n $.secureEvalJSON = function(src)\n {\n if (typeof(JSON) === 'object' && JSON.parse){\n return JSON.parse(src);\n }\n\n var filtered = src;\n filtered = filtered.replace(/\\\\[\"\\\\\\/bfnrtu]/g, '@');\n filtered = filtered.replace(/\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g, ']');\n filtered = filtered.replace(/(?:^|:|,)(?:\\s*\\[)+/g, '');\n\n if (/^[\\],:{}\\s]*$/.test(filtered)){\n return eval(\"(\" + src + \")\");\n }\n else {\n throw new SyntaxError(\"Error parsing JSON, source is not valid.\");\n }\n };\n\n /** jQuery.quoteString(string)\n Returns a string-repr of a string, escaping quotes intelligently. \n Mostly a support function for toJSON.\n\n Examples:\n >>> jQuery.quoteString(\"apple\")\n \"apple\"\n\n >>> jQuery.quoteString('\"Where are we going?\", she asked.')\n \"\\\"Where are we going?\\\", she asked.\"\n **/\n $.quoteString = function(string)\n {\n if (string.match(_escapeable))\n {\n return '\"' + string.replace(_escapeable, function (a) \n {\n var c = _meta[a];\n if (typeof c === 'string'){\n return c;\n }\n c = a.charCodeAt();\n return '\\\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);\n }) + '\"';\n }\n return '\"' + string + '\"';\n };\n }", "title": "" }, { "docid": "763265e6d25a0989ffcab14d9dccf22a", "score": "0.5208907", "text": "function runjs(){\n var heading_jQuery = $(\"#head\");\n var heading_js = document.getElementById(\"head\");\n console.log(heading_js); //heading_js is an html element\n console.log(heading_jQuery); //heading_jQuery is a jQuery object\n\n //Pure JS can be written on the html element\n heading_js.addEventListener(\"click\", function(){\n console.log(\"clicked through JS\");\n })\n\n //JQuery functions can be written on the jQuery object\n heading_jQuery.click(function(){\n console.log(\"clicked through jQuery\");\n });\n}", "title": "" }, { "docid": "dfb942b33c95221754cc87866b9fe3e6", "score": "0.520031", "text": "function $(e){ return document.getElementById(e); }", "title": "" }, { "docid": "a9a4e045c6e1ce60fa5122a31bfb7210", "score": "0.5180319", "text": "function $(id){\r\n return document.getElementById(id);\r\n}", "title": "" }, { "docid": "cfa6e7c861fd56200afb9e6921def9b7", "score": "0.51787835", "text": "function letsJQuery() {\n\t//override Jeff's random bold fetish\n\t$(\"b, strong\").css('font-weight', 'normal');\n\n\t//replace all links to coding horror archives with links to random xkcd comics. :]\n\t$(\"a:regex(href, *codinghorror.com/blog/archives/*)\").each(function() {\n\t\tvar new_url = 'http://xkcd.com/';\n\t\tvar random_number = Math.ceil(Math.random()*586);\n\t\t$(this).attr('href', new_url + random_number);\n\t});\n}", "title": "" }, { "docid": "b4875bb817ae562f13aa1cff56f15106", "score": "0.51780665", "text": "function winnow(elements,qualifier,not){if(jQuery.isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not;});}if(qualifier.nodeType){return jQuery.grep(elements,function(elem){return elem===qualifier!==not;});}if(typeof qualifier===\"string\"){if(risSimple.test(qualifier)){return jQuery.filter(qualifier,elements,not);}qualifier=jQuery.filter(qualifier,elements);}return jQuery.grep(elements,function(elem){return indexOf.call(qualifier,elem)>-1!==not&&elem.nodeType===1;});}", "title": "" }, { "docid": "b4875bb817ae562f13aa1cff56f15106", "score": "0.51780665", "text": "function winnow(elements,qualifier,not){if(jQuery.isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not;});}if(qualifier.nodeType){return jQuery.grep(elements,function(elem){return elem===qualifier!==not;});}if(typeof qualifier===\"string\"){if(risSimple.test(qualifier)){return jQuery.filter(qualifier,elements,not);}qualifier=jQuery.filter(qualifier,elements);}return jQuery.grep(elements,function(elem){return indexOf.call(qualifier,elem)>-1!==not&&elem.nodeType===1;});}", "title": "" }, { "docid": "8a9001dedfad80732d89bc893333ed5c", "score": "0.51744574", "text": "function setupJQueryCodeImproved() {\n\n const div = $(\".jquery.improved\"); // we get the div element and then find elements inside of it\n const button = div.find(\"button\"); // we extract the button because we use it twice\n\n button.click(function () {\n div.find(\".result\").text(\"You searched for: \" + div.find(\"input\").val()); //div.find(\".result\")...\n button.hide();\n });\n}", "title": "" }, { "docid": "d44b42435b4a105d5f897da9e236be84", "score": "0.51727813", "text": "function $(id) {\n return document.getElementById(id);\n}", "title": "" }, { "docid": "d44b42435b4a105d5f897da9e236be84", "score": "0.51727813", "text": "function $(id) {\n return document.getElementById(id);\n}", "title": "" }, { "docid": "d44b42435b4a105d5f897da9e236be84", "score": "0.51727813", "text": "function $(id) {\n return document.getElementById(id);\n}", "title": "" }, { "docid": "d44b42435b4a105d5f897da9e236be84", "score": "0.51727813", "text": "function $(id) {\n return document.getElementById(id);\n}", "title": "" }, { "docid": "d44b42435b4a105d5f897da9e236be84", "score": "0.51727813", "text": "function $(id) {\n return document.getElementById(id);\n}", "title": "" }, { "docid": "d81711e7ff89b525a15055490ccfbd3a", "score": "0.51649684", "text": "function OurJquery(elems){\n\tthis.elems = elems;\n\n\t/*\n\t\tAvelacnum e DOM elementnerin konkret html-class\n\t\tparams:\n\t\t\tname (string) - html-class i anvanum@\n\t*/\n\tthis.addClass = function(name){\n\t\tfor(let i = 0; i < this.elems.length; i++){\n\t\t\tthis.elems[i].classList.add(name);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/*\n\t\tGngum e DOM elementneric konkret html-class\n\t\tparams:\n\t\t\tname (string) - html-class i anvanum@\n\t*/\n\tthis.removeClass = function(name){\n\t\tfor(let i = 0; i < this.elems.length; i++){\n\t\t\tthis.elems[i].classList.remove(name);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/*\n\t\tStugum e ka ardyoq dom elementneric aragini vra konkret html-class,\n\t\tparams:\n\t\t\tname (string) - html-class i anvanum@\n\t*/\n\tthis.hasClass = function(name){\n\t\t// Petq e stugel goyutyun uni ardyoq this.elems[0]\n\t\treturn this.elems[0].classList.contains(name);\n\t}\n\n\t/*\n\t\tAdd event Listener\n\t\tparams:\n\t\t\tname (string) - event name\n\t\t\thandler (function) - handler\n\t*/\n\tthis.on = function(name, handler){\n\t\tfor(let i = 0; i < this.elems.length; i++){\n\t\t\tthis.elems[i].addEventListener(name, handler);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/*\n\t\tPetq e hashvi arnel vor functian - @\n\t\tkarox e ashxatel 2 rejimov \n\n\t\t1.\tparams:\n\t\t\t\tname (string) - attribute - i anun@\n\t\t\tReturn:\n\t\t\t\tVeradarcnum e dom elementneric aragini tvyal anunov(name) atrribute - i arjeq@\n\n\t\tparams:\n\t\t\tname (string) - attribute - i anun@ (name)\n\t\t\tvalue (string) - attribute - i arjeq@ (value)\n\t\tNodeList - i bolor elementnerin avelacnum e tvyal attribute - @ (name) ev veragrum e arjeq (value)\n\t*/\n\tthis.attr = function(name, value){\n\t\tif(value === undefined){\n\t\t\treturn this.elems[0].getAttribute(name);\n\t\t}\n\t\t\n\t\tfor(let i = 0; i < this.elems.length; i++){\n\t\t\tthis.elems[i].setAttribute(name, value);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/*\n\t\tPetq e hashvi arnel vor functian - @\n\t\tkarox e ashxatel 2 rejimov\n\n\t\tparams:\n\t\t\tname (string) - property - i anun@ (orinak disabled)\n\n\t\treturn:\n\t\t\tVeradarcnum e dom elementneric aragini tvyal anunov(name) atrribute - i arjeq@\n\n\t\tparams:\n\t\t\tname (string) - property - i anun@\n\t\t\tvalue (string) - property - i arjeq@\n\t\tNodeList - i bolor elementnerin avelacnum e tvyal property - in (name) ev veragrum e arjeq (value)\n\t*/\n\tthis.prop = function(name, value){\n\t\tif(value === undefined){\n\t\t\treturn this.elems[0].getAttribute(name);\n\t\t}\n\t\tfor(let i = 0; i < this.elems.length; i++){\n\t\t\tthis.elems[i].setAttribute(name, value);\n\t\t}\n\t\treturn this;\n\t}\n\n\t/*\n\t\tPetq e hashvi arnel vor functian - @\n\t\tkarox e ashxatel 3 rejimov\n\n\t\tparam1 - str, param2 - chi poxancvac\n\t\t.css('color'); => return NodeList - i aragin elementi style.color-@\n\n\t\tparam1 - str, param2 - str\n\t\t.css('color', 'red'); => NodeList - i bolor elementneri style.color - in \n\t\tveragrel \"red\" (style.color = 'red')\n\n\t\tparam1 - object, param2 - chi poxancvac\n\t\t\t.css({\n\t\t\t\tcolor: '#fff',\n\t\t\t\tbackground: '#f90',\n\t\t\t\tcursor: 'pointer'\n\t\t\t}); => Bolor elementnerin tal\n\t\t\tstyle.color = '#fff'\n\t\t\tstyle.background = '#f90'\n\t\t\tstyle.cursor = 'pointer'\n\t*/\n\n\tthis.css = function(param1, param2){\n\t\tif(param2 === undefined){\n\t\t\treturn this.elems[0].getAttribute(param1);\n\t\t}\n\t\tfor(let i = 0; i < this.elems.length; i++){\n\t\t\tthis.elems[i].setAttribute(param1, param2);\n\t\t}\n\t\tfor(person in param1){\n\t\t\tconsole.log(person, \"=>\", param1[person]);\n\t\t}\n\t\treturn this;\n\t}\n}", "title": "" }, { "docid": "090401da61058eaed86fc79b3aaa5a1a", "score": "0.5158454", "text": "function winnow(elements,qualifier,not){if(jQuery.isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return !!qualifier.call(elem,i,elem)!==not;});}if(qualifier.nodeType){return jQuery.grep(elements,function(elem){return elem===qualifier!==not;});}if(typeof qualifier===\"string\"){if(risSimple.test(qualifier)){return jQuery.filter(qualifier,elements,not);}qualifier=jQuery.filter(qualifier,elements);}return jQuery.grep(elements,function(elem){return indexOf.call(qualifier,elem)>-1!==not&&elem.nodeType===1;});}", "title": "" }, { "docid": "db60da257b374bde6adf7013aac67de7", "score": "0.51542133", "text": "function $(id) { return document.getElementById(id) }", "title": "" }, { "docid": "dabc5410ba23575d69c2a8a72bb91b9a", "score": "0.51486653", "text": "function ugCheckForMinJQueryVersion(){\n\t\t\n\t\tvar isMinJQuery = g_ugFunctions.checkMinJqueryVersion(\"1.8.0\");\n\t\t\n\t\tif(isMinJQuery == false)\n\t\t\tthrow new Error(\"The gallery can run from jquery 1.8 You have jQuery \"+jQuery.fn.jquery+\" Please update your jQuery library.\");\n\t}", "title": "" }, { "docid": "d300d4eda3515a7c2432d0551205ea26", "score": "0.5139885", "text": "function $(a){document.write(a);}", "title": "" }, { "docid": "91f37beda660b7f45eab4a0d0ec51df7", "score": "0.51396096", "text": "function checkJQuery () {\n if (!validJQueryVersion()) {\n var errorMsg = 'Chessboard Error 1005: Unable to find a valid version of jQuery. ' +\n 'Please include jQuery ' + MINIMUM_JQUERY_VERSION + ' or higher on the page' +\n '\\n\\n' +\n 'Exiting' + ELLIPSIS\n window.alert(errorMsg)\n return false\n }\n\n return true\n }", "title": "" }, { "docid": "71d04a371e9369359e36613e874c4d65", "score": "0.5131356", "text": "function $(v){return document.getElementById(v);}", "title": "" }, { "docid": "245c05ea0cdd7dc01f80fa0c83731875", "score": "0.51179945", "text": "function jqElt(element) {\n\t\tif(_.isString(element) || !element.val) {\n\t\t\treturn $(element);\n\t\t}\n\t\treturn element;\n\t}", "title": "" }, { "docid": "b690a2d5138b8144d22f0eca80303a73", "score": "0.51002586", "text": "function $(selector) {\n\t\tif (isNull(selector))\n\t\t\treturn null;\n\t\tif (selector instanceof chikuwa)\n\t\t\treturn selector;\n\t\telse\n\t\t\treturn new chikuwa(selector,doc);\n\t}", "title": "" }, { "docid": "09eb908e6c30559741501fd820f64554", "score": "0.50913435", "text": "function $( elementId ) {\n return document.getElementById(elementId);\n}", "title": "" }, { "docid": "2fd9274e329048b6791e601323d22549", "score": "0.50846726", "text": "function $(selector,father){\r\n obj=father||document;\r\n if(typeof(selector)==\"string\"){//判断selector是否是字符串\r\n selector=selector.replace(/^\\s*|\\s*$/g,\"\")//找出字符串前后的空格并用空字符串替换,\r\n //替换以后的结果覆盖原来的selector;\r\n if(selector.charAt(0)==\".\"){//类名\r\n return getClass(selector.slice(1),obj)\r\n }else if(selector.charAt(0)==\"#\"){//ID\r\n return obj.getElementById(selector.slice(1));\r\n }else if(/^[a-z|1-10]{1-10}$g.test(selector)/){//标签\r\n return obj.getElementsByTagName(selector);\r\n }\r\n }else if(typeof selector==\"function\"){\r\n window.onload=function(){\r\n selector();\r\n }\r\n }\r\n}", "title": "" }, { "docid": "9be7ff7711dcd828ad3d53bf6cfce4d8", "score": "0.5081155", "text": "function $(t){var e=t[O];if(e&&null!=e.$__.populated){var n,r=o(Object.keys(e.$__.populated).filter((function(e){return e.startsWith(t[S]+\".\")})));try{var i=function(){var r=n.value,o=r.slice((t[S]+\".\").length);if(!Array.isArray(e.$__.populated[r].value))return\"continue\";e.$__.populated[r].value=t.map((function(t){return t.populated(o)}))};for(r.s();!(n=r.n()).done;)i()}catch(t){r.e(t)}finally{r.f()}}}", "title": "" }, { "docid": "6e7be96cbbfe2606944f335186555c27", "score": "0.5077761", "text": "$(selector){\n\t\t\treturn this.$el.find(selector)\n\t\t}", "title": "" }, { "docid": "0d043ff2ad95f915f14bdd9f627cc1ac", "score": "0.5075316", "text": "function winnow(elements,qualifier,not){if(isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not;});}// Single element\nif(qualifier.nodeType){return jQuery.grep(elements,function(elem){return elem===qualifier!==not;});}// Arraylike of elements (jQuery, arguments, Array)\nif(typeof qualifier!==\"string\"){return jQuery.grep(elements,function(elem){return indexOf.call(qualifier,elem)>-1!==not;});}// Filtered directly for both simple and complex selectors\nreturn jQuery.filter(qualifier,elements,not);}", "title": "" }, { "docid": "0d043ff2ad95f915f14bdd9f627cc1ac", "score": "0.5075316", "text": "function winnow(elements,qualifier,not){if(isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not;});}// Single element\nif(qualifier.nodeType){return jQuery.grep(elements,function(elem){return elem===qualifier!==not;});}// Arraylike of elements (jQuery, arguments, Array)\nif(typeof qualifier!==\"string\"){return jQuery.grep(elements,function(elem){return indexOf.call(qualifier,elem)>-1!==not;});}// Filtered directly for both simple and complex selectors\nreturn jQuery.filter(qualifier,elements,not);}", "title": "" } ]
2439680a46d13dbfb9364428ea31a2f0
genVerts helper : Duplicate and Rotate a set of vertices,
[ { "docid": "b95f5a97ebd94104d3bd57413bb2da56", "score": "0.55866027", "text": "static repeatPoints(buf, offset, cnt, scl, verts, norm) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n const fn = [() => { }, VRot90.yn, VRot90.y2, VRot90.yp];\n const len = cnt - 1; // Skip the last Point\n const rng = len * 4; // Repeat the Points 4 times, Skipping the last Point\n const v = new Vec3();\n let bi; // Buffer Index\n let fi; // Rot Fn Idx\n for (let i = 0; i < rng; i++) {\n fi = Math.floor(i / len); // Function Index, 4 Groups, each one has a Rotation Applied\n bi = ((i % len) + offset) * 3; // Buffer Index, repeat the verts\n v.fromBuf(buf, bi);\n fn[fi](v, v);\n v.norm()\n .mul(scl)\n .pushTo(verts);\n }\n }", "title": "" } ]
[ { "docid": "fbf241a5b26bf82c490cd1c8e67b71c4", "score": "0.6157152", "text": "function insertDuplicateVertices(vertices) {\n for (var i = vertices.length - 1; i > 0; i -= 2) \n vertices.splice(i, 0, vertices[i], vertices[i]);\n return vertices;\n}", "title": "" }, { "docid": "f9381758ca7c2cc72ab7ed40eeaf9d69", "score": "0.6010085", "text": "generateCubeVertices() {\n /*\n 7- - -6\n /| /|\n 3- - -2 |\n | | | |\n | 4- -|-5\n |/ |/\n 0- - -1\n */\n\n this.vertices = [\n //back\n -1.0, -1.0, -1.0, //4\n 1.0, 1.0, -1.0, //6\n 1.0, -1.0, -1.0, //5\n\n 1.0, 1.0, -1.0, //6\n -1.0, -1.0, -1.0, //4\n -1.0, 1.0, -1.0, //7\n\n //front\n -1.0, -1.0, 1.0, //0\n 1.0, -1.0, 1.0, //1\n 1.0, 1.0, 1.0, //2\n\n 1.0, 1.0, 1.0, //2\n -1.0, 1.0, 1.0, //3\n -1.0, -1.0, 1.0, //0\n\n //left\n -1.0, 1.0, 1.0, //3\n -1.0, 1.0, -1.0, //7\n -1.0, -1.0, -1.0, //4\n\n -1.0, -1.0, -1.0, //4\n -1.0, -1.0, 1.0, //0\n -1.0, 1.0, 1.0, //3\n\n //right\n 1.0, 1.0, 1.0, //2\n 1.0, -1.0, -1.0, //5\n 1.0, 1.0, -1.0, //6\n\n 1.0, -1.0, -1.0, //5\n 1.0, 1.0, 1.0, //2\n 1.0, -1.0, 1.0, //1\n\n //bottom\n -1.0, -1.0, -1.0, //4\n 1.0, -1.0, -1.0, //5\n 1.0, -1.0, 1.0, //1\n\n 1.0, -1.0, 1.0, //1\n -1.0, -1.0, 1.0, //0\n -1.0, -1.0, -1.0, //4\n\n //top\n -1.0, 1.0, -1.0, //7\n 1.0, 1.0, 1.0, //2\n 1.0, 1.0, -1.0, //6\n\n 1.0, 1.0, 1.0, //2\n -1.0, 1.0, -1.0, //7\n -1.0, 1.0, 1.0 //3\n\n ];\n this.UVs = [\n //back\n 0.0, 0.0, //4\n 1.0, 1.0, //6\n 1.0, 0.0, //5\n\n 1.0, 1.0, //6\n 0.0, 0.0, //4\n 0.0, 1.0, //7\n\n //front\n 0.0, 0.0, //0\n 1.0, 0.0, //1\n 1.0, 1.0, //2\n\n 1.0, 1.0, //2\n 0.0, 1.0, //3\n 0.0, 0.0, //0\n\n //left\n 1.0, 0.0, //3\n 1.0, 1.0, //7\n 0.0, 1.0, //4\n\n 0.0, 1.0, //4\n 0.0, 0.0, //0\n 1.0, 0.0, //3\n\n //right\n 1.0, 0.0, //2\n 0.0, 1.0, //5\n 1.0, 1.0, //6\n\n 0.0, 1.0, //5\n 1.0, 0.0, //2\n 0.0, 0.0, //1\n\n //bottom\n 0.0, 1.0, //4\n 1.0, 1.0, //5\n 1.0, 0.0, //1\n\n 1.0, 0.0, //1\n 0.0, 0.0, //0\n 0.0, 1.0, //4\n\n //top\n 0.0, 1.0, //7\n 1.0, 0.0, //2\n 1.0, 1.0, //6\n\n 1.0, 0.0, //2\n 0.0, 1.0, //7\n 0.0, 0.0 //3\n ];\n this.normals = [\n //back\n 0.0, 0.0, -1.0,\n 0.0, 0.0, -1.0,\n 0.0, 0.0, -1.0,\n 0.0, 0.0, -1.0,\n 0.0, 0.0, -1.0,\n 0.0, 0.0, -1.0,\n\n //front\n 0.0, 0.0, 1.0,\n 0.0, 0.0, 1.0,\n 0.0, 0.0, 1.0,\n 0.0, 0.0, 1.0,\n 0.0, 0.0, 1.0,\n 0.0, 0.0, 1.0,\n\n //left\n -1.0, 0.0, 0.0,\n -1.0, 0.0, 0.0,\n -1.0, 0.0, 0.0,\n -1.0, 0.0, 0.0,\n -1.0, 0.0, 0.0,\n -1.0, 0.0, 0.0,\n\n //right\n 1.0, 0.0, 0.0,\n 1.0, 0.0, 0.0,\n 1.0, 0.0, 0.0,\n 1.0, 0.0, 0.0,\n 1.0, 0.0, 0.0,\n 1.0, 0.0, 0.0,\n\n //bottom\n 0.0, -1.0, 0.0,\n 0.0, -1.0, 0.0,\n 0.0, -1.0, 0.0,\n 0.0, -1.0, 0.0,\n 0.0, -1.0, 0.0,\n 0.0, -1.0, 0.0,\n\n //top\n 0.0, 1.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 1.0, 0.0\n ];\n }", "title": "" }, { "docid": "678ff40fa999e1ea063c9542aabcfa27", "score": "0.5989872", "text": "function rotate(vtxs,center,matrix){\n var vtx = new vec3.fromValues(vtxs[0], vtxs[1], vtxs[2]);\n vec3.subtract(vtx,vtx,center);\n vec3.transformMat4(vtx, vtx, matrix);\n vec3.add(vtx,vtx,center);\n return vtx;\n}", "title": "" }, { "docid": "2ef35550e2e616eb84a79b0caf1d4e2d", "score": "0.59104306", "text": "generateUVCoordinates() {\n var UV = [\n [0, 0], [0, 0.5], [1, 0.5], [0, 0], [1, 0.5], [1, 0],\n [0, 0], [0, 1], [1, 1], [0, 0], [1, 1], [1, 0],\n [0, 0], [0, 3], [3, 3], [0, 0], [3, 3], [3, 0],\n [0, 0], [0, 1], [2, 1], [0, 0], [2, 1], [2, 0],\n [0, 0], [0, 2], [1, 2], [0, 0], [1, 2], [1, 0],\n [0, 0], [0, 0.5], [1, 0.5], [0, 0], [1, 0.5], [1, 0] ]\n\n this.vertices.forEach((v, i) => {\n v.uv = UV[i]\n })\n }", "title": "" }, { "docid": "8515c747c8447a7f4fbdd58e01dcea3c", "score": "0.5908746", "text": "function handleLoadedOvire(){\n \n var vertexCount=0;\n var vertexPositions=[];\n var vertexTextureCoords=[];\n var minX=-6.50,\n maxX=3.50;\n \n\n for(var i = 0; i < velikostMape/5-1 ; i++)\n { \n var randomX = Math.random()*(maxX-minX)+minX;\n var sirina = randomX + 3.0;\n //console.log(\"x1: \" + sirina);\n x1LokacijaOvir.push(sirina);\n //console.log(\"x2: \"+ randomX);\n x2LokacijaOvir.push(randomX);\n \n \n //console.log(\"z: \"+ovirePozicijaZ);\n zLokacijaOvir.push(ovirePozicijaZ);\n ovirePozicijaZ += 5.0;\n\n vertexPositions.push(randomX);\n vertexPositions.push(0.00);\n vertexPositions.push(ovirePozicijaZ);\n\n vertexTextureCoords.push(3.0);\n vertexTextureCoords.push(3.0);\n\n vertexPositions.push(randomX);\n vertexPositions.push(1.00);\n vertexPositions.push(ovirePozicijaZ);\n\n vertexTextureCoords.push(0.0);\n vertexTextureCoords.push(3.0);\n\n vertexPositions.push(sirina);\n vertexPositions.push(0.00);\n vertexPositions.push(ovirePozicijaZ);\n\n vertexTextureCoords.push(0.0);\n vertexTextureCoords.push(0.0);\n vertexCount += 3;\n\n//2 trikotnik\n vertexPositions.push(randomX);\n vertexPositions.push(1.00);\n vertexPositions.push(ovirePozicijaZ);\n\n vertexTextureCoords.push(0.0);\n vertexTextureCoords.push(3.0);\n\n vertexPositions.push(sirina);\n vertexPositions.push(1.00);\n vertexPositions.push(ovirePozicijaZ);\n\n vertexTextureCoords.push(0.0);\n vertexTextureCoords.push(0.0);\n\n vertexPositions.push(sirina);\n vertexPositions.push(0.00);\n vertexPositions.push(ovirePozicijaZ);\n\n vertexTextureCoords.push(3.0);\n vertexTextureCoords.push(0.0);\n\n vertexCount += 3;\n \n }\n\n ovireVertexPositionBuffer=gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, ovireVertexPositionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertexPositions), gl.STATIC_DRAW);\n ovireVertexPositionBuffer.itemSize=3;\n ovireVertexPositionBuffer.numItems=vertexCount;\n\n ovireVertexTextureCoordBuffer=gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, ovireVertexTextureCoordBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertexTextureCoords), gl.STATIC_DRAW);\n ovireVertexTextureCoordBuffer.itemSize = 2;\n ovireVertexTextureCoordBuffer.numItems = vertexCount;\n}", "title": "" }, { "docid": "b82596f18ad3f978073b9bc5f815dab5", "score": "0.58663696", "text": "buildVertices() {\n let v, ii;\n const cnt = this.vertices.length;\n const buf = new Float32Array(cnt * 3);\n for (let i = 0; i < cnt; i++) {\n v = this.vertices[i];\n v.idx = i; // Verts can be deleted/Removed, so IDX needs to be set before doing indices to link faces correctly.\n ii = i * 3; // Translate \n buf[ii] = v.pos[0];\n buf[++ii] = v.pos[1];\n buf[++ii] = v.pos[2];\n }\n return buf;\n }", "title": "" }, { "docid": "f154ce8794bdffbd9c6258939d582216", "score": "0.58453923", "text": "shiftVertices() {\n\t\tthis.isFlipped = !this.isFlipped;\n\t\tthis.mapVertices( this.targetGeometry );\n\n\t\tlet speed = this.speed;\n\t\tlet delay = this.delay * this.normal;\n\t\tlet proxy = { value: 0 }\n\n\t\tthis.shiftTween = new TWEEN.Tween( proxy )\n\t\t\t.to( { value: 1 }, speed )\n\t\t\t.delay( delay )\n\t\t\t.easing( TWEEN.Easing.Exponential.InOut )\n\t\t\t.onUpdate( () => {\n\t\t\t\tif( ! this.isFrameReady ) return;\n\n\t\t\t\tthis.updateVertices( proxy.value );\n\t\t\t\tthis.isFrameReady = false;\n\t\t\t})\n\t\t\t.onComplete( () => {\n\t\t\t\tthis.el.emit( 'step-complete' );\n\t\t\t})\n\t\t\t.start();\n\t}", "title": "" }, { "docid": "f97086c2d48ba0026833725d972575aa", "score": "0.5808663", "text": "function initVertices() {\n\tif (primitive == \"triangle\") {\n\t\tvertices = [\n\t\t\tvec2(-0.5, -0.5),\n\t\t\tvec2(0, 0.5),\n\t\t\tvec2(0.5, -0.5)\n\t\t];\n\t}\n\t// Compose square from 4 triangles\n\telse if (primitive == \"square\") {\n\t\tv1 = [\n\t\t\tvec2(-0.5, -0.5),\n\t\t\tvec2(0.5, -0.5),\n\t\t\tvec2(0.0, 0.0)\n\t\t];\n\t\tv2 = [\n\t\t\tvec2(-0.5, 0.5),\n\t\t\tvec2(0.5, 0.5),\n\t\t\tvec2(0.0, 0.0)\n\t\t];\n\t\tv3 = [\n\t\t\tvec2(-0.5, -0.5),\n\t\t\tvec2(-0.5, 0.5),\n\t\t\tvec2(0.0, 0.0)\n\t\t];\n\t\tv4 = [\n\t\t\tvec2(0.5, 0.5),\n\t\t\tvec2(0.5, -0.5),\n\t\t\tvec2(0.0, 0.0)\n\t\t];\n\n\t}\n\telse if (primitive == \"pentagon\") {\n\t\t\n\t\t\n\t\tv1 = [\n\t\t\tvec2(0.0, 0.0),\n\t\t\tvec2(0.0, 0.5),\n\t\t\tvec2(s1*0.5, c1*0.5)\n\t\t];\n\t\tv2 = [\n\t\t\tvec2(0.0, 0.0),\n\t\t\tvec2(s1*0.5, c1*0.5),\n\t\t\tvec2(s2*0.5, -c2*0.5)\n\t\t];\n\t\tv3 = [\n\t\t\tvec2(0.0, 0.0),\n\t\t\tvec2(s2*0.5, -c2*0.5),\n\t\t\tvec2(-s2*0.5, -c2*0.5)\n\t\t];\n\t\tv4 = [\n\t\t\tvec2(0.0, 0.0),\n\t\t\tvec2(-s2*0.5, -c2*0.5),\n\t\t\tvec2(-s1*0.5, c1*0.5)\n\t\t];\n\t\tv5 = [\n\t\t\tvec2(0.0, 0.0),\n\t\t\tvec2(-s1*0.5, c1*0.5),\n\t\t\tvec2(0.0, 0.5)\n\t\t];\n\t}\n}", "title": "" }, { "docid": "73019ece45f3b3f4714fe14a15ada389", "score": "0.5698569", "text": "constructor( num_blades )\n { super( \"position\", \"normal\", \"texture_coord\" );\n // A for loop to automatically generate the triangles:\n for( let i = 0; i < num_blades; i++ )\n { // Rotate around a few degrees in the XZ plane to place each new point:\n const spin = Mat4.rotation( i * 2*Math.PI/num_blades, Vec.of( 0,1,0 ) );\n // Apply that XZ rotation matrix to point (1,0,0) of the base triangle.\n const newPoint = spin.times( Vec.of( 1,0,0,1 ) ).to3();\n const triangle = [ newPoint, // Store that XZ position as point 1.\n newPoint.plus( [ 0,1,0 ] ), // Store it again but with higher y coord as point 2.\n Vec.of( 0,0,0 ) ]; // All triangles touch this location -- point 3.\n\n this.arrays.position.push( ...triangle );\n // Rotate our base triangle's normal (0,0,1) to get the new one. Careful! Normal vectors are not\n // points; their perpendicularity constraint gives them a mathematical quirk that when applying \n // matrices you have to apply the transposed inverse of that matrix instead. But right now we've\n // got a pure rotation matrix, where the inverse and transpose operations cancel out, so it's ok.\n var newNormal = spin.times( Vec.of( 0,0,1 ).to4(0) ).to3();\n // Propagate the same normal to all three vertices:\n this.arrays.normal.push( newNormal, newNormal, newNormal );\n this.arrays.texture_coord.push( ...Vec.cast( [ 0,0 ], [ 0,1 ], [ 1,0 ] ) );\n // Procedurally connect the 3 new vertices into triangles:\n this.indices.push( 3*i, 3*i + 1, 3*i + 2 );\n }\n }", "title": "" }, { "docid": "59b71d3a806cfc0ea960a27ea8ca42bf", "score": "0.56742316", "text": "function translate(vertices, t){\n\n\tfor( var i = 0; i < vertices.length; i +=3 ){\n\t\t//console.log(\"i\", i);\n\t\tvertices[i] += t[0];\n\t\tvertices[i+1] += t[1];\n\t\tvertices[i+2] += t[2];\n\t}\n\n\treturn vertices;\n}", "title": "" }, { "docid": "32c8e13d2feaa62b203a41ab3ac654b7", "score": "0.56726503", "text": "function reorderVertices(vertices, direction){ //direction can be \"counterclockwise\" or \"clockwise\"\n\tif(vertices.length < 3){throw new Error(\"reorderVertices(): Need at least 3 vertices in a polygon\")}\n\t\n\t//determine the current direction\n\tlet currentDirection;\n\tfor(let v=0; v<vertices.length && !currentDirection; v++){ //run until currentDirection is defined; may need multiple iterations if there are colinear vertices\n\t\tlet orient = orientation(vertices[v], vertices[(v+1)%vertices.length], vertices[(v+2)%vertices.length]);\n\t\tif(orient === \"counterclockwise\" || orient === \"clockwise\"){\n\t\t\tcurrentDirection = orient;\n\t\t}\n\t}\n\t\n\tif(currentDirection !== direction){ //then flip it\n\t\tlet newVertices = [];\n\t\tfor(let v=vertices.length-1; v>=0; v--){\n\t\t\tnewVertices.push(vertices[v]);\n\t\t}\n\t\tvertices = newVertices;\n\t}\n\t\n\treturn vertices;\n}", "title": "" }, { "docid": "3c10e737dbd294b807ec231c9c63c8da", "score": "0.5658695", "text": "function generate_from_quads(verts) {\n\n\n var len = verts.length;\n if (len % 4)\n throw \"Wrong array\";\n\n var indices = [];\n var positions = [];\n\n for (var i = 0; i < len; i+=4) {\n var v1 = verts[i];\n var v2 = verts[i+1];\n var v3 = verts[i+2];\n var v4 = verts[i+3];\n\n add_vec3_to_array(v1, positions);\n add_vec3_to_array(v2, positions);\n add_vec3_to_array(v3, positions);\n add_vec3_to_array(v4, positions);\n\n indices.push(i, i+1, i+2);\n indices.push(i, i+2, i+3);\n }\n\n // construct submesh\n\n var va_frame = m_util.create_empty_va_frame();\n\n va_frame[\"a_position\"] = new Float32Array(positions);\n\n var submesh = m_util.create_empty_submesh(\"FROM_QUADS\");\n\n submesh.va_frames[0] = va_frame;\n submesh.indices = new Uint32Array(indices);\n submesh.base_length = positions.length/3;\n\n return submesh;\n}", "title": "" }, { "docid": "3a22df884f4731ae42dc39f14fed9621", "score": "0.56218624", "text": "function dupAndRotate(meshToDup, totalRads, numMesh)\n{\n var degreeRotatedMeshPoints = 0;\n var radiansBetweenSpokes = totalRads / numMesh;\n var allMeshReferences = []\n do\n {\n allMeshReferences.push(meshToDup);\n meshToDup = meshToDup.clone();\n meshToDup.rotateOnWorldAxis(z, radiansBetweenSpokes);\n degreeRotatedMeshPoints += radiansBetweenSpokes;\n } while(degreeRotatedMeshPoints < totalRads)\n\n return allMeshReferences;\n}", "title": "" }, { "docid": "cf1e8ea82c61125e39c00c9c6b6317fb", "score": "0.5595908", "text": "function gen_vertices(){\n var limit = 2 * Math.PI;\n var theta = 0;\n var length = 0;\n let scp1 = 64;\n let scp2 = 6;\n var r = ((Math.abs(Math.cos(theta * scp1)) + (0.25 - (Math.cos((theta * scp1) + (Math.PI/2))) * 6))/(2 + (Math.abs(Math.cos((theta * scp2) + (Math.PI / 2)))) * 1.2));\n vertices.push(0.0, 0.0);\n\n for(theta; theta <= limit; theta = theta + 0.001) {\n let x = (((Math.abs(Math.cos(theta * scp1)) + (0.25 - (Math.cos((theta * scp1) + (Math.PI/2))) * 6))/(2 + (Math.abs(Math.cos((theta * scp2) + (Math.PI / 2)))) * 1.2))) * Math.cos(theta);\n vertices.push(x / 10);\n let y = (((Math.abs(Math.cos(theta * scp1)) + (0.25 - (Math.cos((theta * scp1) + (Math.PI/2))) * 6))/(2 + (Math.abs(Math.cos((theta * scp2) + (Math.PI / 2)))) * 1.2))) * Math.sin(theta)\n vertices.push(y / 10);\n length = length + 1;\n }\n\n return length+1;\n}", "title": "" }, { "docid": "8541add021bc025845998f92c31759db", "score": "0.5593673", "text": "function transformed_cylinder_vertices(){\n //// console.log(\"n: \" +n);\n //coordinates for point A and B\n vertices = [];\n \n var P1 = calculate_cylinder_template_vertices();\n \n var Ls = calculateLScale();\n var avgThetas = calculateAllAverageThetas();\n \n for(var i = 0; i < index / 2; i++){\n calculateOneCrossSectionVertices(Ls[i], avgThetas[i], xy_points[i * 2], xy_points[(i*2) + 1], P1);\n } \n}", "title": "" }, { "docid": "1d57f743840fc592db7a827b8b369a9f", "score": "0.55781114", "text": "function applyRotationToVertices( vertices ) {\n\n var quaternionX, quaternionY, quaternionZ;\n var angle = rotationDegree * THREE.Math.DEG2RAD;\n\n if (params.rotateX) {\n quaternionX = new THREE.Quaternion();\n quaternionX.setFromAxisAngle( new THREE.Vector3( 1, 0, 0 ), angle);\n }\n\n if (params.rotateY) {\n quaternionY = new THREE.Quaternion();\n quaternionY.setFromAxisAngle( new THREE.Vector3( 0, 1, 0 ), angle);\n }\n\n if (params.rotateZ) {\n quaternionZ = new THREE.Quaternion();\n quaternionZ.setFromAxisAngle( new THREE.Vector3( 0, 0, 1 ), angle);\n }\n\n vertices.forEach( function( vertex ) {\n params.rotateX && vertex.applyQuaternion( quaternionX );\n params.rotateY && vertex.applyQuaternion( quaternionY );\n params.rotateZ && vertex.applyQuaternion( quaternionZ );\n vertex.add( new THREE.Vector3( 0, 0, 1 ) );\n } );\n\n return vertices;\n}", "title": "" }, { "docid": "56b352508fe9696e8ca3a8a63d59096a", "score": "0.55508304", "text": "generateTextureMatrix(){\n for (let i=0; i < this.vertices.length / 3; i++) {\n this.textureCoords.push([0.0, 0.0]);\n }\n }", "title": "" }, { "docid": "ab893c3efe21320d457e06ef10e11f66", "score": "0.5530817", "text": "static genVerts(subdiv, radius, vrows, verts, norm) {\n const irow = []; // Starting Index of Each Row Of Points\n const buf = this.genCorner(subdiv, irow); // Base vertices\n const s_up = new Vec3(1, 1, 1).scale(radius);\n const s_dn = new Vec3(1, -1, 1).scale(radius);\n const row_cnt = irow.length - 1;\n let i, cnt;\n //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n // Create the Equator\n vrows.push(verts.length / 3);\n this.repeatPoints(buf, irow[0], irow[1] - irow[0], s_up, verts, norm);\n //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n // Create the sphere 2 rows at a time, Moving toward the poles\n for (i = 1; i < row_cnt; i++) {\n cnt = irow[i + 1] - irow[i]; // How Many Points in One Row\n vrows.push(verts.length / 3);\n this.repeatPoints(buf, irow[i], cnt, s_up, verts, norm); // Upper Row\n vrows.push(verts.length / 3);\n this.repeatPoints(buf, irow[i], cnt, s_dn, verts, norm); // Lower Row\n }\n //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n // Create Pole Points\n const v = new Vec3();\n i = irow[row_cnt] * 3;\n vrows.push(verts.length / 3);\n v.fromBuf(buf, i).pushTo(verts); //.norm().pushTo( norm );\n vrows.push(verts.length / 3);\n v.fromBuf(buf, i).mul(s_dn).pushTo(verts); //.norm().pushTo( norm );\n }", "title": "" }, { "docid": "7b2374be94b246e3a99f359effdce254", "score": "0.5496806", "text": "function handleLoadedKovanci()\n{\n var numberOfSides = 100;\n var numberOfVertices=numberOfSides*3;\n\n var minX= -4.50,\n maxX= 4.50;\n var y = 0.30;\n var radius = 0.15;\n \n\n var doublePi=2.00*parseFloat(Math.PI);\n var vertexPositions=[];\n var vertexTextureCoords=[];\n var vertexCount=0;\n \n for(var k = 0; k < 50 ; k++){\n var x=Math.random()*(maxX-minX)+minX;\n \n x2LokacijaKovancev.push(x);\n //console.log(\"x pozicija kovanc: \" + x+( radius * Math.cos( 0* doublePi / numberOfSides )));\n \n \n kovanciPozicijaZ += 18;\n zLokacijaKovancev.push(kovanciPozicijaZ);\n //console.log(\"kovanci z: \" + kovanciPozicijaZ);\n for(var i=0;i<numberOfVertices;i++){\n \n var rob1x=x+( radius * Math.cos( i* doublePi / numberOfSides ));\n \n\n //console.log(rob1x)\n var rob1y=y+( radius * Math.sin( i* doublePi / numberOfSides ) );\n\n var rob2x=x+( radius * Math.cos( (i+1)* doublePi / numberOfSides ) );\n \n //console.log(rob2x)\n var rob2y=y+( radius * Math.sin( (i+1)* doublePi / numberOfSides ) );\n\n\n //računanje enega trikotnika v krogu\n vertexPositions.push(x);\n vertexPositions.push(y);\n vertexPositions.push(kovanciPozicijaZ);\n \n vertexTextureCoords.push(0.0);\n vertexTextureCoords.push(3.0);\n\n vertexPositions.push(x+( radius * Math.cos( i* doublePi / numberOfSides ) ));\n vertexPositions.push((y)+( radius * Math.sin( i* doublePi / numberOfSides ) ));\n vertexPositions.push(kovanciPozicijaZ);\n \n vertexTextureCoords.push(3.0);\n vertexTextureCoords.push(0.0);\n\n vertexPositions.push(x+( radius * Math.cos( (i+1)* doublePi / numberOfSides ) ) );\n vertexPositions.push((y)+( radius * Math.sin( (i+1)* doublePi / numberOfSides ) ) );\n vertexPositions.push(kovanciPozicijaZ);\n\n vertexTextureCoords.push(3.0);\n vertexTextureCoords.push(3.0);\n\n vertexCount+=3;\n //robovi za kovanec 1 trikotnik\n\n vertexPositions.push(parseFloat(rob1x));\n vertexPositions.push(parseFloat(rob1y));\n vertexPositions.push(kovanciPozicijaZ);\n\n vertexTextureCoords.push(3.0);\n vertexTextureCoords.push(0.0);\n\n vertexPositions.push(parseFloat(rob1x));\n vertexPositions.push(parseFloat(rob1y));\n vertexPositions.push(kovanciPozicijaZ+0.06);\n\n vertexTextureCoords.push(0.0);\n vertexTextureCoords.push(3.0);\n\n vertexPositions.push(parseFloat(rob2x));\n vertexPositions.push(parseFloat(rob2y));\n vertexPositions.push(kovanciPozicijaZ);\n\n vertexTextureCoords.push(3.0);\n vertexTextureCoords.push(3.0);\n\n vertexCount+=3;\n //drugi del roba\n\n vertexPositions.push(parseFloat(rob1x));\n vertexPositions.push(parseFloat(rob1y));\n vertexPositions.push(kovanciPozicijaZ+0.06);\n\n vertexTextureCoords.push(3.0);\n vertexTextureCoords.push(3.0);\n\n vertexPositions.push(parseFloat(rob2x));\n vertexPositions.push(parseFloat(rob2y));\n vertexPositions.push(kovanciPozicijaZ);\n\n vertexTextureCoords.push(3.0);\n vertexTextureCoords.push(3.0);\n\n vertexPositions.push(parseFloat(rob2x));\n vertexPositions.push(parseFloat(rob2y));\n vertexPositions.push(kovanciPozicijaZ+0.06);\n\n vertexTextureCoords.push(3.0);\n vertexTextureCoords.push(3.0);\n\n vertexCount+=3;\n\n //zadnja stran kovanca\n\n vertexPositions.push(x);\n vertexPositions.push(y);\n vertexPositions.push(kovanciPozicijaZ+0.06);\n \n vertexTextureCoords.push(3.0);\n vertexTextureCoords.push(0.0);\n\n vertexPositions.push(x+( radius * Math.cos( i* doublePi / numberOfSides ) ));\n vertexPositions.push((y)+( radius * Math.sin( i* doublePi / numberOfSides ) ));\n vertexPositions.push(kovanciPozicijaZ+0.06);\n \n vertexTextureCoords.push(0.0);\n vertexTextureCoords.push(3.0);\n\n vertexPositions.push(x+( radius * Math.cos( (i+1)* doublePi / numberOfSides ) ) );\n vertexPositions.push((y)+( radius * Math.sin( (i+1)* doublePi / numberOfSides ) ) );\n vertexPositions.push(kovanciPozicijaZ+0.06);\n\n vertexTextureCoords.push(3.0);\n vertexTextureCoords.push(3.0);\n\n vertexCount+=3;\n\n }\n \n}\n CoinVertexPositionBuffer=gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, CoinVertexPositionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertexPositions), gl.STATIC_DRAW);\n CoinVertexPositionBuffer.itemSize=3;\n CoinVertexPositionBuffer.numItems=vertexCount;\n\n CoinVertexTextureCoordBuffer=gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, CoinVertexTextureCoordBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertexTextureCoords), gl.STATIC_DRAW);\n CoinVertexTextureCoordBuffer.itemSize = 2;\n CoinVertexTextureCoordBuffer.numItems = vertexCount;\n}", "title": "" }, { "docid": "2ab1fc9c8c0db74bbe2b15ed2342dda4", "score": "0.54926723", "text": "function saveSOR(){\n vertices = [];\n indexes = []; \n for(var i = 0; i < verticesList.length; i ++){\n // var size = verticesList[i].length;\n // for(var j = 0; j < size; j ++){\n var transformationMatrix = new Matrix4();\n transformationMatrix.setIdentity();\n transformationMatrix.multiply(translationMatrixList[i]);\n transformationMatrix.multiply(rotationMatrixList[i]);\n transformationMatrix.multiply(scalingMatrixList[i]);\n\n nonTransformedVertices = verticesList[i];\n \n //for each vertex, multiply by transformation x, y, z, 1, transformation by matrix4\n \n \n for(var j = 0; j < nonTransformedVertices.length; j +=3){\n var oneVector = new Vector4([nonTransformedVertices[j], nonTransformedVertices[j+1], nonTransformedVertices[j+2], 1]);\n oneVector = transformationMatrix.multiplyVector4(oneVector);\n vertices.push(oneVector.elements[0]);\n vertices.push(oneVector.elements[1]);\n vertices.push(oneVector.elements[2]);\n } \n \n // vertices.push(verticesList[i][j]);\n // }\n }\n \n var shift = 0;\n for(var i = 0; i < indexesList.length; i++){\n var size = indexesList[i].length;\n for(var j = 0; j < size; j++){\n indexes.push(indexesList[i][j] + shift);\n }\n shift += verticesList[i].length / 3;\n }\n \n \n \n \n var name = prompt(\"Please enter your file name\");\n saveFile(new SOR(name, vertices, indexes));\n}", "title": "" }, { "docid": "743abcd490bbd1beab7e1aba38bf8b40", "score": "0.54352194", "text": "AddVertex(vertex, triangles) {\n var edges = [];\n // Remove triangles with circumcircles containing the vertex\n for (var i in triangles) {\n var triangle = triangles[i];\n if (triangle.inCircumcircle(vertex)) {\n edges.push(new Edge(triangle.a, triangle.b));\n edges.push(new Edge(triangle.b, triangle.c));\n edges.push(new Edge(triangle.c, triangle.a));\n delete triangles[i];\n }\n }\n edges = this.mkUniqueEdges(edges);\n // Create new triangles from the unique edges and new vertex\n for (var i in edges) {\n // console.log( 'adding triangle' );\n var edge = edges[i];\n triangles.push(new Triangle(edge.a, edge.b, vertex));\n }\n }", "title": "" }, { "docid": "192da6a0306354c8542fad9052e5edf2", "score": "0.5435202", "text": "function addXyzCross(vertices /*:Num3[]*/, xyz /*:Num3*/, r /*:number*/) {\n vertices.push([xyz[0]-r, xyz[1], xyz[2]], [xyz[0]+r, xyz[1], xyz[2]]);\n vertices.push([xyz[0], xyz[1]-r, xyz[2]], [xyz[0], xyz[1]+r, xyz[2]]);\n vertices.push([xyz[0], xyz[1], xyz[2]-r], [xyz[0], xyz[1], xyz[2]+r]);\n}", "title": "" }, { "docid": "0c61160d15ab0c1e4881bd41865d875b", "score": "0.5432801", "text": "expandsVertices(iVerts, nRing) {\n var tagFlag = ++Utils.TAG_FLAG;\n var nbVerts = iVerts.length;\n var vrvStartCount = this.getVerticesRingVertStartCount();\n var vertRingVert = this.getVerticesRingVert();\n var ringVerts = vertRingVert instanceof Array ? vertRingVert : null;\n var vertTagFlags = this.getVerticesTagFlags();\n var acc = nbVerts;\n var nbVertices = this.getNbVertices();\n var iVertsExpanded = new Uint32Array(Utils.getMemory(4 * nbVertices), 0, nbVertices);\n iVertsExpanded.set(iVerts);\n\n var i = 0;\n for (i = 0; i < nbVerts; ++i)\n vertTagFlags[iVertsExpanded[i]] = tagFlag;\n\n var iBegin = 0;\n while (nRing) {\n --nRing;\n for (i = iBegin; i < nbVerts; ++i) {\n var idVert = iVertsExpanded[i];\n var start, end;\n if (ringVerts) {\n vertRingVert = ringVerts[idVert];\n start = 0;\n end = vertRingVert.length;\n } else {\n start = vrvStartCount[idVert * 2];\n end = start + vrvStartCount[idVert * 2 + 1];\n }\n\n for (var j = start; j < end; ++j) {\n var id = vertRingVert[j];\n if (vertTagFlags[id] === tagFlag)\n continue;\n\n vertTagFlags[id] = tagFlag;\n iVertsExpanded[acc++] = id;\n }\n }\n iBegin = nbVerts;\n nbVerts = acc;\n }\n\n return new Uint32Array(iVertsExpanded.subarray(0, acc));\n }", "title": "" }, { "docid": "4ac8f60988509473808505e16f02072c", "score": "0.54074234", "text": "computeVerticesUVs() {\n // geometry vertices and UVs\n this.attributes.vertexPosition.array = [];\n this.attributes.textureCoord.array = [];\n\n const vertices = this.attributes.vertexPosition.array;\n const uvs = this.attributes.textureCoord.array;\n\n for(let y = 0; y < this.definition.height; y++) {\n const v = y / this.definition.height;\n\n for(let x = 0; x < this.definition.width; x++) {\n const u = x / this.definition.width;\n\n // uvs and vertices\n // our uvs are ranging from 0 to 1, our vertices range from -1 to 1\n\n // first triangle\n uvs.push(u);\n uvs.push(v);\n uvs.push(0);\n\n vertices.push((u - 0.5) * 2);\n vertices.push((v - 0.5) * 2);\n vertices.push(0);\n\n uvs.push(u + (1 / this.definition.width));\n uvs.push(v);\n uvs.push(0);\n\n vertices.push(((u + (1 / this.definition.width)) - 0.5) * 2);\n vertices.push((v - 0.5) * 2);\n vertices.push(0);\n\n uvs.push(u);\n uvs.push(v + (1 / this.definition.height));\n uvs.push(0);\n\n vertices.push((u - 0.5) * 2);\n vertices.push(((v + (1 / this.definition.height)) - 0.5) * 2);\n vertices.push(0);\n\n // second triangle\n uvs.push(u);\n uvs.push(v + (1 / this.definition.height));\n uvs.push(0);\n\n vertices.push((u - 0.5) * 2);\n vertices.push(((v + (1 / this.definition.height)) - 0.5) * 2);\n vertices.push(0);\n\n uvs.push(u + (1 / this.definition.width));\n uvs.push(v);\n uvs.push(0);\n\n vertices.push(((u + (1 / this.definition.width)) - 0.5) * 2);\n vertices.push((v - 0.5) * 2);\n vertices.push(0);\n\n uvs.push(u + (1 / this.definition.width));\n uvs.push(v + (1 / this.definition.height));\n uvs.push(0);\n\n vertices.push(((u + (1 / this.definition.width)) - 0.5) * 2);\n vertices.push(((v + (1 / this.definition.height)) - 0.5) * 2);\n vertices.push(0);\n }\n }\n }", "title": "" }, { "docid": "5a69b4b9f19ee83f1f1c242bde0f44af", "score": "0.5406576", "text": "function setVertices() {\n /* vertices and indices for cube taken from \"WebGL Programming Guide\" by\n * Kouichi Matsuda and Rodger Lee, copyright Pearson Education 2013\n */\n\n // for an equilateral triangle with sides of length 1, height is about 0.8661\n // naming convention: \"t_b_h\" == tetrahedron_base_height\n const t_b_h = 0.8661;\n const t_h = 1.5;\n const t_b_w = 1.0;\n\n const VERTICES = new Float32Array([\n // cube vertices\n 1.0, 1.0, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0, 1.0, 1.0, -1.0, 1.0, // v0-v1-v1-v3 front\n 1.0, 1.0, 1.0, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0, 1.0, 1.0, -1.0, // v0-v3-v4-v5 right\n 1.0, 1.0, 1.0, 1.0, 1.0, -1.0, -1.0, 1.0, -1.0, -1.0, 1.0, 1.0, // v0-v5-v6-v1 up\n -1.0, 1.0, 1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 1.0, // v1-v6-v7-v1 left\n -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, 1.0, -1.0, 1.0, -1.0, -1.0, 1.0, // v7-v4-v3-v1 down\n 1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, // v4-v7-v6-v5 back\n\n // tetrahedron vertices\n -t_b_w / 2, -t_h / 2, -t_b_h / 2, // base: bottom left point\n t_b_w / 2, -t_h / 2, -t_b_h / 2, // base: bottom right point\n 0, -t_h / 2, t_b_h / 2, // base: top point\n 0, t_h / 2, 0, // pointy \"nose\" of the tetrahedron\n ]);\n\n const INDICES_CUBE = new Uint8Array([\n 0, 1, 2, 0, 2, 3, // front\n 4, 5, 6, 4, 6, 7, // right\n 8, 9, 10, 8, 10, 11, // up\n 12, 13, 14, 12, 14, 15, // left\n 16, 17, 18, 16, 18, 19, // down\n 20, 21, 22, 20, 22, 23 // back\n ]);\n\n const INDICES_WIREFRAME_CUBE = new Uint8Array([\n // front face\n 0, 1,\n 1, 2,\n 2, 3,\n 3, 0,\n\n // back face\n 20, 21,\n 21, 22,\n 22, 23,\n 23, 20,\n\n // 4 lines connecting faces\n 0, 23,\n 1, 22,\n 2, 21,\n 3, 20,\n ]);\n\n const INDICES_TETRAHEDRON = new Uint8Array([\n 24, 25, 26, // rear face (base)\n 24, 26, 27, // left side face\n 26, 25, 27, // right side face\n 25, 24, 27, // bottom side face\n ]);\n\n // copy vertex info to gpu\n gl.bindBuffer(gl.ARRAY_BUFFER, vBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, VERTICES, gl.STATIC_DRAW);\n let vPosition = gl.getAttribLocation(program, \"vPosition\");\n gl.vertexAttribPointer(vPosition, 3, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(vPosition);\n\n // create all the index buffers and populate them\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, iBufferCube);\n // this call to bufferData is how webGL knows that this is the index buffer\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, INDICES_CUBE, gl.STATIC_DRAW);\n\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, iBufferWireframeCube);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, INDICES_WIREFRAME_CUBE, gl.STATIC_DRAW);\n\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, iBufferTetrahedron);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, INDICES_TETRAHEDRON, gl.STATIC_DRAW);\n\n}", "title": "" }, { "docid": "6fce4602507517b0fccdb097e2d812a9", "score": "0.5390828", "text": "pushVertices( vSolid, vTrans, x, y, z )\n\t{\n\t\tlet world = this;\n\t\tvar blocks = world.blocks;\n\t\tvar lightMap = world.lightMap;\n\t\tvar block = blocks[x][y][z];\n\t\tlet lightMax = 1.0;\n\t\tlet lightFull = [lightMax,lightMax,lightMax];\n\n\t\tlet hasTranslucentTextures = block.hasTranslucentTextures;\n\t\tlet id = block.id;\n\n\t\tvar bH = block.isFluid && ( z == world.sz - 1 || !blocks[x][y][z+1].isFluid ) ? 0.8 : 1.0;\n\t\tlet zLo = z+block.indent[0];\t// Down\n\t\tlet zHi = z+block.indent[1]*bH;\t// Up\n\t\tlet xLo = x+block.indent[2];\t// Left\n\t\tlet xHi = x+block.indent[3];\t// Right\n\t\tlet yLo = y+block.indent[4];\t// Front\n\t\tlet yHi = y+block.indent[5];\t// Back\n\n\t\t// Up\n\t\tif ( z == world.sz - 1 || (block.isIndented || (world.blocks[x][y][z+1].transparent && world.blocks[x][y][z+1].id!=id)) )\n\t\t{\n\t\t\tlet c = block.getTx( world, x, y, z, BlockDir.UP );\n\n\t\t\tlet m = block.isSelfLit || z>=world.sz-1 ? lightFull : lightMap[x][y][z+1];\n\t\t\tlet r = m[0];\n\t\t\tlet g = m[1];\n\t\t\tlet b = m[2];\n\n\t\t\tlet c0 = c[0]+(c[2]-c[0])*block.indent[4];\t// c[0]/c[2] is x, so low is front(4)\n\t\t\tlet c2 = c[0]+(c[2]-c[0])*block.indent[5];\t// c[0]/c[2] is x, so high is back(5)\n\t\t\tlet c1 = c[1]+(c[3]-c[1])*block.indent[2];\t// c[1]/c[3] is y so low is left(2)\n\t\t\tlet c3 = c[1]+(c[3]-c[1])*block.indent[3];\t// c[1]/c[3] is y so high is right(3)\n\n\t\t\tif( onMac ) {\n\t\t\t\tc2 *= 0.999;\n\t\t\t\tc3 *= 0.999;\n\t\t\t}\n\n\t\t\tpushQuad(\n\t\t\t\thasTranslucentTextures ? vTrans : vSolid,\n\t\t\t\t[ xLo, yLo, zHi,\t\tc0, c1, r, g, b, 1.0 ],\n\t\t\t\t[ xHi, yLo, zHi,\t\tc2, c1, r, g, b, 1.0 ],\n\t\t\t\t[ xHi, yHi, zHi, \t\tc2, c3, r, g, b, 1.0 ],\n\t\t\t\t[ xLo, yHi, zHi,\t\tc0, c3, r, g, b, 1.0 ]\n\t\t\t);\n\t\t}\n\t\t\n\t\t// Down\n\t\tif ( z == 0 || (block.isIndented || (world.blocks[x][y][z-1].transparent && world.blocks[x][y][z-1].id!=id)) )\n\t\t{\n\t\t\tlet c = block.getTx( world, x, y, z, BlockDir.DOWN );\n\t\t\t\n\t\t\tlet m = block.isSelfLit || z<=0 ? lightFull : lightMap[x][y][z-1];\n\t\t\tlet r = m[0];\n\t\t\tlet g = m[1];\n\t\t\tlet b = m[2];\n\n\t\t\tlet c0 = c[0]+(c[2]-c[0])*block.indent[4];\t// c[0]/c[2] is x, so low is front(4)\n\t\t\tlet c2 = c[0]+(c[2]-c[0])*block.indent[5];\t// c[0]/c[2] is x, so high is back(5)\n\t\t\tlet c1 = c[1]+(c[3]-c[1])*block.indent[2];\t// c[1]/c[3] is y so low is left(2)\n\t\t\tlet c3 = c[1]+(c[3]-c[1])*block.indent[3];\t// c[1]/c[3] is y so high is right(3)\n\n\t\t\tif( onMac ) {\n\t\t\t\tc2 *= 0.999;\n\t\t\t\tc3 *= 0.999;\n\t\t\t}\n\t\t\t\n\t\t\tpushQuad(\n\t\t\t\thasTranslucentTextures ? vTrans : vSolid,\n\t\t\t\t[ xLo, yHi, zLo,\t\tc0, c3, r, g, b, 1.0 ],\n\t\t\t\t[ xHi, yHi, zLo,\t\tc2, c3, r, g, b, 1.0 ],\n\t\t\t\t[ xHi, yLo, zLo,\t\tc2, c1, r, g, b, 1.0 ],\n\t\t\t\t[ xLo, yLo, zLo,\t\tc0, c1, r, g, b, 1.0 ]\n\t\t\t);\n\t\t}\n\t\t\n\t\t// Front\n\t\tif ( y == 0 || (block.isIndented || (world.blocks[x][y-1][z].transparent && world.blocks[x][y-1][z].id!=id)) )\n\t\t{\n\t\t\t// c is in this order: [ xPixel/this.width, yPixel/this.height, (xPixel+width)/this.width, (yPixel+height)/this.height ]\n\t\t\tlet c = block.getTx( world, x, y, z, BlockDir.FRONT );\n\t\t\t\n\t\t\tlet m = block.isSelfLit || y<=0 ? lightFull : lightMap[x][y-1][z];\n\t\t\tlet r = m[0];\n\t\t\tlet g = m[1];\n\t\t\tlet b = m[2];\n\t\t\t\n\n\t\t\tlet c0 = c[0]+(c[2]-c[0])*block.indent[2];\t// c[0]/c[2] is x, so low is left(2)\n\t\t\tlet c2 = c[0]+(c[2]-c[0])*block.indent[3];\t// and high is right(3)\n\t\t\tlet c1 = c[1]+(c[3]-c[1])*(1-block.indent[1]);\t// c[1]/c[3] is y, which is inverse, so use up(1) at bottom, AND use 1-indent\n\t\t\tlet c3 = c[1]+(c[3]-c[1])*(1-block.indent[0]);\t// c[1]/c[3] is y, which is inverse, so use down(0) at top, AND use 1-indent\n\n\t\t\tif( onMac && c2!=1.0 ) {\n\t\t\t\t//debugger;\n\t\t\t}\n\n\t\t\tif( onMac ) {\n\t\t\t\tc2 *= 0.999;\n\t\t\t\tc3 *= 0.999;\n\t\t\t}\n\n\t\t\tpushQuad(\n\t\t\t\thasTranslucentTextures ? vTrans : vSolid,\n\t\t\t\t[ xLo, yLo, zLo,\tc0, c3, r, g, b, 1.0 ],\n\t\t\t\t[ xHi, yLo, zLo,\tc2, c3, r, g, b, 1.0 ],\n\t\t\t\t[ xHi, yLo, zHi,\tc2, c1, r, g, b, 1.0 ],\n\t\t\t\t[ xLo, yLo, zHi,\tc0, c1, r, g, b, 1.0 ]\n\t\t\t);\n\t\t}\n\t\t\n\t\t// Back\n\t\tif ( y == world.sy - 1 || (block.isIndented || (world.blocks[x][y+1][z].transparent && world.blocks[x][y+1][z].id!=id)) )\n\t\t{\n\t\t\tlet c = block.getTx( world, x, y, z, BlockDir.BACK );\n\t\t\t\n\t\t\tlet m = block.isSelfLit || y>=world.sy-1 ? lightFull : lightMap[x][y+1][z];\n\t\t\tlet r = m[0];\n\t\t\tlet g = m[1];\n\t\t\tlet b = m[2];\n\n\t\t\tlet c0 = c[0]+(c[2]-c[0])*block.indent[2];\t// c[0]/c[2] is x, so low is left(2)\n\t\t\tlet c2 = c[0]+(c[2]-c[0])*block.indent[3];\t// and high is right(3)\n\t\t\tlet c1 = c[1]+(c[3]-c[1])*(1-block.indent[1]);\t// c[1]/c[3] is y, which is inverse, so use up(1) at bottom, AND use 1-indent\n\t\t\tlet c3 = c[1]+(c[3]-c[1])*(1-block.indent[0]);\t// c[1]/c[3] is y, which is inverse, so use down(0) at top, AND use 1-indent\n\t\t\t\n\t\t\tif( onMac ) {\n\t\t\t\tc2 *= 0.999;\n\t\t\t\tc3 *= 0.999;\n\t\t\t}\n\n\t\t\tpushQuad(\n\t\t\t\thasTranslucentTextures ? vTrans : vSolid,\n\t\t\t\t[ xLo, yHi, zHi,\tc2, c1, r, g, b, 1.0 ],\n\t\t\t\t[ xHi, yHi, zHi,\tc0, c1, r, g, b, 1.0 ],\n\t\t\t\t[ xHi, yHi, zLo,\tc0, c3, r, g, b, 1.0 ],\n\t\t\t\t[ xLo, yHi, zLo,\tc2, c3, r, g, b, 1.0 ]\n\t\t\t);\n\t\t}\n\t\t\n\t\t// Left\n\t\tif ( x == 0 || (block.isIndented || (world.blocks[x-1][y][z].transparent && world.blocks[x-1][y][z].id!=id)) )\n\t\t{\n\t\t\tlet c = block.getTx( world, x, y, z, BlockDir.LEFT );\n\t\t\t\n\t\t\tlet m = block.isSelfLit || x<=0 ? lightFull : lightMap[x-1][y][z];\n\t\t\tlet r = m[0];\n\t\t\tlet g = m[1];\n\t\t\tlet b = m[2];\n\n\t\t\tlet c0 = c[0]+(c[2]-c[0])*block.indent[4];\t// c[0]/c[2] is x, so low is front(4)\n\t\t\tlet c2 = c[0]+(c[2]-c[0])*block.indent[5];\t// c[0]/c[2] is x, so high is back(5)\n\t\t\tlet c1 = c[1]+(c[3]-c[1])*(1-block.indent[1]);\t// c[1]/c[3] is y, which is inverse, so use up(1) at bottom, AND use 1-indent\n\t\t\tlet c3 = c[1]+(c[3]-c[1])*(1-block.indent[0]);\t// c[1]/c[3] is y, which is inverse, so use down(0) at top, AND use 1-indent\n\n\t\t\tif( onMac ) {\n\t\t\t\tc2 *= 0.999;\n\t\t\t\tc3 *= 0.999;\n\t\t\t}\n\t\t\t\n\t\t\tpushQuad(\n\t\t\t\thasTranslucentTextures ? vTrans : vSolid,\n\t\t\t\t[ xLo, yLo, zHi,\tc2, c1, r, g, b, 1.0 ],\n\t\t\t\t[ xLo, yHi, zHi,\tc0, c1, r, g, b, 1.0 ],\n\t\t\t\t[ xLo, yHi, zLo,\tc0, c3, r, g, b, 1.0 ],\n\t\t\t\t[ xLo, yLo, zLo,\tc2, c3, r, g, b, 1.0 ]\n\t\t\t);\n\t\t}\n\t\t\n\t\t// Right\n\t\tif ( x == world.sx - 1 || (block.isIndented || (world.blocks[x+1][y][z].transparent && world.blocks[x+1][y][z].id!=id)) )\n\t\t{\n\t\t\tlet c = block.getTx( world, x, y, z, BlockDir.RIGHT );\n\t\t\t\n\t\t\tlet m = block.isSelfLit || x>=world.sx-1 ? lightFull : lightMap[x+1][y][z];\n\t\t\tlet r = m[0];\n\t\t\tlet g = m[1];\n\t\t\tlet b = m[2];\n\n\t\t\tlet c0 = c[0]+(c[2]-c[0])*block.indent[4];\t// c[0]/c[2] is x, so low is front(4)\n\t\t\tlet c2 = c[0]+(c[2]-c[0])*block.indent[5];\t// c[0]/c[2] is x, so high is back(5)\n\t\t\tlet c1 = c[1]+(c[3]-c[1])*(1-block.indent[1]);\t// c[1]/c[3] is y, which is inverse, so use up(1) at bottom, AND use 1-indent\n\t\t\tlet c3 = c[1]+(c[3]-c[1])*(1-block.indent[0]);\t// c[1]/c[3] is y, which is inverse, so use down(0) at top, AND use 1-indent\n\n\t\t\tif( onMac ) {\n\t\t\t\tc2 *= 0.999;\n\t\t\t\tc3 *= 0.999;\n\t\t\t}\n\t\t\t\n\t\t\tpushQuad(\n\t\t\t\thasTranslucentTextures ? vTrans : vSolid,\n\t\t\t\t[ xHi, yLo, zLo,\tc0, c3, r, g, b, 1.0 ],\n\t\t\t\t[ xHi, yHi, zLo,\tc2, c3, r, g, b, 1.0 ],\n\t\t\t\t[ xHi, yHi, zHi,\tc2, c1, r, g, b, 1.0 ],\n\t\t\t\t[ xHi, yLo, zHi,\tc0, c1, r, g, b, 1.0 ]\n\t\t\t);\n\t\t}\n\t}", "title": "" }, { "docid": "8e520758a9c3efb20d55f1d48f3951dd", "score": "0.5366593", "text": "function mkstrip(){\n\tvar x, h, n, i; // best practice in JS to declare our variables up front\n\tvar points = []; // to hold the individual coordinate triples\n\tvar vertices = []; // to hold the vertices to be drawn as tri-strips\n\t\n\t// generate a thin 2x10 grid of points with random heights\n\tx = -1.0;\n\tfor(i = 0; i < 11; i++) {\n\t\th = Math.random();\n\t\tpoints.push( vec3(-1.0+i*0.2, 0.2, h));\n\t}\n\tfor(i = 0; i < 11; i++) {\n\t\th = Math.random();\n\t\tpoints.push( vec3(-1.0+i*0.2, -0.2, h));\n\t}\n\t// fill up the vertices array with the necessary points\n\tfor(i = 0; i < 11; i++) {\n\t\tvertices.push(points[i], points[i+11]);\n\t}\n\treturn vertices;\n}", "title": "" }, { "docid": "e40fc25782c9de5a90da49d962a6ff34", "score": "0.534231", "text": "addVertices(vertexArray) {\n for (let vertex of vertexArray) {\n this.addVertex(vertex);\n }\n }", "title": "" }, { "docid": "794f15441664f0ebd788b4fbd27ed30e", "score": "0.53414744", "text": "function prepareSkates() {\r\n //QUADS\r\n for( var i=0; i < quads.length; i+=12 ){\r\n //first triangle\r\n addTriangleVertexForIndices(quads[i]-1, quads[i+1]-1,quads[i+2]-1);\r\n addTriangleVertexForIndices(quads[i+3]-1, quads[i+4]-1,quads[i+5]-1);\r\n addTriangleVertexForIndices(quads[i+6]-1, quads[i+7]-1,quads[i+8]-1);\r\n //second triangle\r\n addTriangleVertexForIndices(quads[i]-1, quads[i+1]-1,quads[i+2]-1);\r\n addTriangleVertexForIndices(quads[i+6]-1, quads[i+7]-1,quads[i+8]-1);\r\n addTriangleVertexForIndices(quads[i+9]-1, quads[i+10]-1,quads[i+11]-1);\r\n \r\n }\r\n\r\n}", "title": "" }, { "docid": "912645f6eda06057de087bab3e5a1f67", "score": "0.53339326", "text": "generateCubeVertices(size, centerX, centerY) {\n cubeVertices = new Float32Array([\n // Vertex coordinates and color\n centerX-size, centerY+size, size, centerX-size, centerY-size, size, centerX+size, centerY-size, size, //t0\n centerX-size, centerY+size, size, centerX+size, centerY+size, size, centerX+size, centerY-size, size, //t1\n\n centerX+size, centerY+size, size, centerX+size, centerY-size, size, centerX+size, centerY-size, -size, //t2\n centerX+size, centerY+size, size, centerX+size, centerY-size, -size, centerX+size, centerY+size, -size, //t3\n\n centerX+size, centerY+size, -size, centerX+size, centerY-size, -size, centerX-size, centerY-size, -size, //t4\n centerX+size, centerY+size, -size, centerX-size, centerY-size, -size, centerX-size, centerY+size, -size, //t5\n \n centerX-size, centerY+size, -size, centerX-size, centerY-size, -size, centerX-size, centerY-size, size, //t6\n centerX-size, centerY+size, -size, centerX-size, centerY-size, size, centerX-size, centerY+size, size, //t7\n \n centerX-size, centerY+size, -size, centerX-size, centerY+size, size, centerX+size, centerY+size, size, //t8\n centerX-size, centerY+size, -size, centerX+size, centerY+size, size, centerX+size, centerY+size, -size, //t9\n\n centerX-size, centerY-size, size, centerX-size, centerY-size, -size, centerX+size, centerY-size, -size, //t10\n centerX-size, centerY-size, size, centerX+size, centerY-size, -size, centerX+size, centerY-size, size //t11\n ]);\n\n // Recommendations: Might want to generate your cube vertices so that their\n // x-y-z values are combinations of 1.0 and -1.0. Allows you to scale the\n // the cube to your liking better.\n }", "title": "" }, { "docid": "616f4adc2360473ddf792a9178c7e2a2", "score": "0.53297096", "text": "constructor(vertex, center) {\r\n this.dist = dist(vertex.x, vertex.y, center.x, center.y);\r\n this.length = this.dist * sqrt(2);\r\n this.rotationAngle = atan((vertex.y - center.y) / (vertex.x - center.x)) * 180 / PI - 45;\r\n if (this.rotationAngle < 0) {\r\n this.rotationAngle += 180;\r\n }\r\n\r\n this.alpha = this.length;\r\n\r\n this.verticalDist = vertex.y - center.y;\r\n this.horizontalDist = vertex.x - center.x;\r\n\r\n this.colorHue = map(this.rotationAngle, 0, 90, 0, 360);\r\n\r\n this.vertex1 = createVector(vertex.x, vertex.y);\r\n this.vertex2 = createVector(center.x - this.verticalDist, center.y + this.horizontalDist);\r\n this.vertex3 = createVector(center.x - this.horizontalDist, center.y - this.verticalDist);\r\n this.vertex4 = createVector(center.x + this.verticalDist, center.y - this.horizontalDist);\r\n }", "title": "" }, { "docid": "6f75d5652fe80ac30ffc36daefd8ef05", "score": "0.5328054", "text": "constructor() // etc) smaller and more cache friendly.\r\n { super( \"positions\", \"normals\", \"tangents\", \"bitangents\", \"texture_coords\" ); // Name the values we'll define per each vertex.\r\n this.positions .push( ...Vec.cast( [-1,-1,0], [1,-1,0], [-1,1,0], [1,1,0] ) ); // Specify the 4 square corner locations.\r\n this.normals .push( ...Vec.cast( [0,0,1], [0,0,1], [0,0,1], [0,0,1] ) ); // Match those up with normal vectors.\r\n this.tangents .push( ...Vec.cast( [1,0,0], [1,0,0], [1,0,0], [1,0,0] ) );\r\n this.bitangents .push( ...Vec.cast( [0,1,0], [0,1,0], [0,1,0], [0,1,0] ) );\r\n this.texture_coords.push( ...Vec.cast( [0,0], [1,0], [0,1], [1,1] ) ); // Draw a square in texture coordinates too.\r\n this.indices .push( 0, 1, 2, 1, 3, 2 ); // Two triangles this time, indexing into four distinct vertices.\r\n }", "title": "" }, { "docid": "e83753991595e9b40181c2dde6de9e85", "score": "0.5327026", "text": "pushPickingVertices( vertices, x, y, z )\n\t{\n\t\tvar color = { r: x/255, g: y/255, b: z/255 };\n\t\t\n\t\t// Top\n\t\tpushQuad(\n\t\t\tvertices,\n\t\t\t[ x, y, z + 1, 0, 0, color.r, color.g, color.b, 1/255 ],\n\t\t\t[ x + 1, y, z + 1, 1, 0, color.r, color.g, color.b, 1/255 ],\n\t\t\t[ x + 1, y + 1, z + 1, 1, 1, color.r, color.g, color.b, 1/255 ],\n\t\t\t[ x, y + 1, z + 1, 0, 0, color.r, color.g, color.b, 1/255 ]\n\t\t);\n\t\t\n\t\t// Bottom\n\t\tpushQuad(\n\t\t\tvertices,\n\t\t\t[ x, y + 1, z, 0, 0, color.r, color.g, color.b, 2/255 ],\n\t\t\t[ x + 1, y + 1, z, 1, 0, color.r, color.g, color.b, 2/255 ],\n\t\t\t[ x + 1, y, z, 1, 1, color.r, color.g, color.b, 2/255 ],\n\t\t\t[ x, y, z, 0, 0, color.r, color.g, color.b, 2/255 ]\n\t\t);\n\t\t\n\t\t// Front\n\t\tpushQuad(\n\t\t\tvertices,\n\t\t\t[ x, y, z, 0, 0, color.r, color.g, color.b, 3/255 ],\n\t\t\t[ x + 1, y, z, 1, 0, color.r, color.g, color.b, 3/255 ],\n\t\t\t[ x + 1, y, z + 1, 1, 1, color.r, color.g, color.b, 3/255 ],\n\t\t\t[ x, y, z + 1, 0, 0, color.r, color.g, color.b, 3/255 ]\n\t\t);\n\t\t\n\t\t// Back\n\t\tpushQuad(\n\t\t\tvertices,\n\t\t\t[ x, y + 1, z + 1, 0, 0, color.r, color.g, color.b, 4/255 ],\n\t\t\t[ x + 1, y + 1, z + 1, 1, 0, color.r, color.g, color.b, 4/255 ],\n\t\t\t[ x + 1, y + 1, z, 1, 1, color.r, color.g, color.b, 4/255 ],\n\t\t\t[ x, y + 1, z, 0, 0, color.r, color.g, color.b, 4/255 ]\n\t\t);\n\t\t\n\t\t// Left\n\t\tpushQuad(\n\t\t\tvertices,\n\t\t\t[ x, y, z + 1, 0, 0, color.r, color.g, color.b, 5/255 ],\n\t\t\t[ x, y + 1, z + 1, 1, 0, color.r, color.g, color.b, 5/255 ],\n\t\t\t[ x, y + 1, z, 1, 1, color.r, color.g, color.b, 5/255 ],\n\t\t\t[ x, y, z, 0, 0, color.r, color.g, color.b, 5/255 ]\n\t\t);\n\t\t\n\t\t// Right\n\t\tpushQuad(\n\t\t\tvertices,\n\t\t\t[ x + 1, y, z, 0, 0, color.r, color.g, color.b, 6/255 ],\n\t\t\t[ x + 1, y + 1, z, 1, 0, color.r, color.g, color.b, 6/255 ],\n\t\t\t[ x + 1, y + 1, z + 1, 1, 1, color.r, color.g, color.b, 6/255 ],\n\t\t\t[ x + 1, y, z + 1, 0, 0, color.r, color.g, color.b, 6/255 ]\n\t\t);\n\t}", "title": "" }, { "docid": "df3e7d8638fa741ed1620fbfc4487290", "score": "0.5314234", "text": "function loadTriangles() {\n var inputTriangles = getJSONFile(INPUT_TRIANGLES_URL,\"triangles\");\n\n if (inputTriangles != String.null) { \n var whichSetVert; // index of vertex in current triangle set\n var whichSetTri; // index of triangle in current triangle set\n var vtxToAdd = []; // vtx coords to add to the coord array\n var vtxColorToAdd = [];\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 trilNum = inputTriangles.length;\n\n \n for (var whichSet=0; whichSet<inputTriangles.length; whichSet++) {\n\n vec3.set(indexOffset,vtxBufferSize,vtxBufferSize,vtxBufferSize); // update vertex offset\n \n var ka = inputTriangles[whichSet].material.ambient;\n var kd = inputTriangles[whichSet].material.diffuse;\n var ks = inputTriangles[whichSet].material.specular;\n var n = inputTriangles[whichSet].material.n;\n\n ka[0] = (ka[0] + aAdd) % 1;\n ka[1] = (ka[1] + aAdd) % 1;\n ka[2] = (ka[2] + aAdd) % 1;\n kd[0] = (kd[0] + dAdd) % 1;\n kd[1] = (kd[1] + dAdd) % 1;\n kd[2] = (kd[2] + dAdd) % 1;\n ks[0] = (ks[0] + sAdd) % 1;\n ks[1] = (ks[1] + sAdd) % 1;\n ks[2] = (ks[2] + sAdd) % 1;\n n[0] = (n[0] + nAdd) % 20;\n n[1] = (n[1] + nAdd) % 20;\n n[2] = (n[2] + nAdd) % 20;\n\n var verLength = inputTriangles[whichSet].vertices.length;\n var center = [0, 0, 0];\n\n for (whichSetVert=0; whichSetVert<verLength; whichSetVert++) {\n var coord = inputTriangles[whichSet].vertices[whichSetVert];\n center[0] += coord[0]/verLength;\n center[1] += coord[1]/verLength;\n center[2] += coord[2]/verLength;\n }\n\n // set up the vertex coord array\n for (whichSetVert=0; whichSetVert<verLength; whichSetVert++) {\n // vtxToAdd = transform(inputTriangles[whichSet].vertices[whichSetVert]);\n vtxToAdd = inputTriangles[whichSet].vertices[whichSetVert];\n\n\n // select triangle\n if(whichSet === selectTriID) {\n vtxToAdd[0] += triTranslation[0];\n vtxToAdd[1] += triTranslation[1];\n vtxToAdd[2] += triTranslation[2];\n\n vtxToAdd = scale(vtxToAdd,center,1.2);\n }\n\n coordArray.push(vtxToAdd[0], vtxToAdd[1], vtxToAdd[2]);\n\n var normal = inputTriangles[whichSet].normals[whichSetVert];\n vtxColorToAdd = lighting(normal,inputTriangles[whichSet].vertices[whichSetVert],ka,kd,ks,n);\n colorArray.push(vtxColorToAdd[0],vtxColorToAdd[1],vtxColorToAdd[2]);\n vtxBufferSize +=1;\n vtxColorBufferSize += 1;\n\n } // end for vertices in set\n \n // set up the triangle index array, adjusting indices across sets\n for (whichSetTri=0; whichSetTri<inputTriangles[whichSet].triangles.length; whichSetTri++) {\n vec3.add(triToAdd,indexOffset,inputTriangles[whichSet].triangles[whichSetTri]);\n indexArray.push(triToAdd[0], triToAdd[1], triToAdd[2]);\n triBufferSize += 3;\n } // end for triangles in set\n\n } // end for each triangle set \n\n } // end if triangles found\n} // end load triangles", "title": "" }, { "docid": "e6fbe10f22df26cfa0627368c3ce237d", "score": "0.52989274", "text": "function drawObject(vertarr, pgons, scale_factor, rotation_angle, x_amt, y_amt, z_amt,\n color_id=255, color_mode=0) {\n\n //console.log(pgons);\n\n var triarr = [];\n var trinorms = [];\n var which_poly = 0;\n\n var transform_mat = new Matrix4();\n var view_mat = new Matrix4();\n var normal_rotation_mat = new Matrix4();\n\n\n\n // set our scaling limits\n scale_factor = Math.max(scale_factor, .1);\n scale_factor = Math.min(scale_factor, 2.0);\n\n // build up triarr (break up the polygons into triangles)\n for (var pgon = 1; pgon < pgons.length; pgon++) {\n // my algorithm for making polygons into triangles\n for (var vert = pgons[pgon].length - 2; vert >= 1; vert--) {\n triarr.push(vertarr[pgons[pgon][vert]][0]);\n triarr.push(vertarr[pgons[pgon][vert]][1]);\n triarr.push(vertarr[pgons[pgon][vert]][2]);\n\n triarr.push(vertarr[pgons[pgon][vert + 1]][0]);\n triarr.push(vertarr[pgons[pgon][vert + 1]][1]);\n triarr.push(vertarr[pgons[pgon][vert + 1]][2]);\n\n triarr.push(vertarr[pgons[pgon][0]][0]);\n triarr.push(vertarr[pgons[pgon][0]][1]);\n triarr.push(vertarr[pgons[pgon][0]][2]);\n\n triarr.push(which_poly); // keep track of which polygon the tri belongs\n // so that we know what normal to use for flat shading\n };\n which_poly++;\n };\n //console.log(triarr);\n //console.log(triarr.length);\n\n //console.log(pgons);\n\n\n // get an array of polygon normals for flat shading\n var polynorms = getpolynorms(vertarr, pgons);\n // console.log(polynorms);\n\n // get a normal of vertex normals for smooth shading\n var vertnorms = getvertnorms(vertarr, pgons);\n\n // get an array of trianle norms for flat shading\n var trinorms = get_trinorms(pgons, vertnorms);\n\n //console.log(\"pnorms\", polynorms);\n //console.log(\"vnorms\", vertnorms);\n //console.log(\"trinorms\", trinorms);\n\n\n //get_trinorms();\n\n // get the centroid of the object so that we can translate object to origin\n var cent = get_centroid(vertarr);\n //console.log(\"cent\", cent);\n\n // set our bounding box to around the +-1 around the origin\n transform_mat.setOrtho(-1, 1, -1, 1, -1, 1);\n\n\n // get our camera set up\n view_mat.setPerspective(FOV, 1, 1, 200);\n\n view_mat.lookAt(cam_x_amt, cam_y_amt, cam_z_amt, // LookFrom\n cam_x_amt + yaw, cam_y_amt - pitch, cam_z_amt - 3, // LookAt\n 0, 1, 0); // Up Vector\n\n\n var maxdiff = get_maxdiff(vertarr);\n //console.log(maxdiff);\n\n // store all of our object transformations into a matrix\n\n transform_mat.setScale(scale_factor / maxdiff, scale_factor / maxdiff, scale_factor /maxdiff);\n\n transform_mat.rotate(rotation_angle, 0, 1, 0);\n\n // try putting this before scale\n transform_mat.translate(-cent[0]*scale_factor, -cent[1]*scale_factor, -cent[2]*scale_factor);\n\n transform_mat.translate(x_amt, -y_amt, z_amt);\n\n\n // rotate our normals along with our vertices\n normal_rotation_mat.setInverseOf(transform_mat).transpose();\n\n // send everything to the shaders\n\n // send transformation matrix to shaders\n var matloc = gl.getUniformLocation(gl.program, \"mymatrix\");\n gl.uniformMatrix4fv(matloc, gl.FALSE, transform_mat.elements);\n\n var transnormloc = gl.getUniformLocation(gl.program, \"trans_norm\");\n gl.uniformMatrix4fv(transnormloc, gl.FALSE, normal_rotation_mat.elements);\n\n // send normal rotation matrix to shaders\n var mat_norm_loc = gl.getUniformLocation(gl.program, \"norm_matrix\");\n gl.uniformMatrix4fv(mat_norm_loc, gl.FALSE, normal_rotation_mat.elements);\n\n //send perspective view matrix to shaders\n var view_loc = gl.getUniformLocation(gl.program, 'view_matrix');\n gl.uniformMatrix4fv(view_loc, gl.false, view_mat.elements);\n\n // are we flat shading or smooth shading?\n var boolloc = gl.getUniformLocation(gl.program, \"flat_shade\");\n gl.uniform1i(boolloc, flatshade);\n\n var isShinyLoc = gl.getUniformLocation(gl.program, \"is_shiny\");\n gl.uniform1i(isShinyLoc, isShiny);\n\n var isShinyVertLoc = gl.getUniformLocation(gl.program, \"is_vert_shiny\");\n gl.uniform1i(isShinyVertLoc, isShiny);\n\n // is this ortho or perspective?\n var isOrtho_loc = gl.getUniformLocation(gl.program, \"is_ortho\");\n gl.uniform1i(isOrtho_loc, isOrtho);\n\n // what is the color of our object?\n var isBlue_loc = gl.getUniformLocation(gl.program, \"is_blue\");\n gl.uniform1i(isBlue_loc, /*isBlue*/ 1);\n\n var color_mode_loc = gl.getUniformLocation(gl.program, \"color_mode\");\n gl.uniform1i(color_mode_loc, color_mode);\n\n var isTextured_loc = gl.getUniformLocation(gl.program, \"is_textured\");\n gl.uniform1i(isTextured_loc, isTextured);\n\n var u_isTextured_loc = gl.getUniformLocation(gl.program, \"u_is_textured\");\n gl.uniform1i(u_isTextured_loc, isTextured);\n\n var colorloc = gl.getUniformLocation(gl.program, \"mycolor\");\n gl.uniform3fv(colorloc, [0, 0, color_id / 255]);\n\n //console.log([listOfObjs[0][\"x_amt\"], -listOfObjs[0][\"y_amt\"], 0, 1]);\n var light_pos_loc = gl.getUniformLocation(gl.program, \"light_pos\");\n gl.uniform4fv(light_pos_loc, [listOfObjs[0][\"x_amt\"], -listOfObjs[0][\"y_amt\"], 0, 1]);\n\n var cam_pos = [0, 0, -1];\n if (!isOrtho) {\n cam_pos = [cam_x_amt / 50, cam_y_amt / 50, cam_z_amt];\n };\n\n var cam_pos_loc = gl.getUniformLocation(gl.program, \"cam_pos\");\n gl.uniform3fv(cam_pos_loc, cam_pos);\n\n var v_cam_pos_loc = gl.getUniformLocation(gl.program, \"cam_position\");\n gl.uniform4fv(v_cam_pos_loc, [cam_pos[0], cam_pos[1], cam_pos[2], 1]);\n\n var light_position_loc = gl.getUniformLocation(gl.program, \"light_position\");\n gl.uniform4fv(light_position_loc, [listOfObjs[0][\"x_amt\"], -listOfObjs[0][\"y_amt\"], 0, 1]);\n\n var gloss_loc = gl.getUniformLocation(gl.program, \"gloss\");\n gl.uniform1f(gloss_loc, shininess);\n\n var glossiness_loc = gl.getUniformLocation(gl.program, \"glossiness\");\n gl.uniform1f(glossiness_loc, shininess);\n\n /*if (isTextured == 1) {\n gl.uniform1i(gl.getUniformLocation(gl.program, \"u_sampler\"), 0);\n };*/\n\n if (shouldClear) {\n //clear drawings each time we render\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n // pass one triangle at a time to shaders\n // AKA pass 9 vertices, and 3 normals\n //console.log(triarr);\n for (var i = 0; i < triarr.length; i += 10 /*10 bcs polygon identifier*/) {\n\n //console.log(i);\n // [x, y, z, n1x, n1y, n1z...]\n var stridedarr = new Float32Array([\n triarr[i], triarr[i+1], triarr[i+2], // vert 1\n\n trinorms[i], trinorms[i+1], trinorms[i+2], // vertnorm 1\n\n triarr[i+3], triarr[i+4], triarr[i+5], // vert 2\n\n trinorms[i+3], trinorms[i+4], trinorms[i+5], // vertnorm 2\n\n triarr[i+6], triarr[i+7], triarr[i+8],\n\n trinorms[i+6], trinorms[i+7], trinorms[i+8]\n ]);\n\n var vertexBuffer = gl.createBuffer();\n\n // Bind the buffer object to target\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\n // Write data into the buffer object\n gl.bufferData(gl.ARRAY_BUFFER, stridedarr, gl.DYNAMIC_DRAW);\n\n //pass uniforms and attributes to shaders\n\n //send polygon normal for flat shading\n var normloc = gl.getUniformLocation(gl.program, \"norm\");\n gl.uniform3fv(normloc, [polynorms[triarr[i+9]][0], polynorms[triarr[i+9]][1], polynorms[triarr[i+9]][2]]);\n\n var a_Position = gl.getAttribLocation(gl.program, 'a_Position');\n\n // Assign the buffer object to a_Position variable\n gl.vertexAttribPointer(a_Position, 3, gl.FLOAT, false, 24, 0);\n\n // Enable the assignment to a_Position variable\n gl.enableVertexAttribArray(a_Position);\n\n var a_normal = gl.getAttribLocation(gl.program, 'a_normal');\n\n // Assign the buffer object to a_normal variable\n gl.vertexAttribPointer(a_normal, 3, gl.FLOAT, false, 24, 12);\n\n // Enable the assignment to a_normal variable\n gl.enableVertexAttribArray(a_normal);\n\n // draw the triangle!\n gl.drawArrays(gl.TRIANGLES, 0, 3);\n };\n\n}", "title": "" }, { "docid": "3badaaf7f146c4fe6b5d7775f3a36308", "score": "0.5290187", "text": "function reloadVertices(){\n plane.geometry.colorsNeedUpdate =true;\n plane.geometry.verticesNeedUpdate = true;\n}", "title": "" }, { "docid": "d0d213e28d1fdc0a25c21367661c3495", "score": "0.5280344", "text": "function newIndices(i){if(i<start){return i;}else if(i<mid){return i+end-mid;}else if(i<end){return i+start-mid;}else {return i;}}///std::rotate(m_flagsBuffer.data + start, m_flagsBuffer.data + mid, m_flagsBuffer.data + end);", "title": "" }, { "docid": "a547b82f3768945644e547d016aaad7f", "score": "0.52792937", "text": "function twistVertices(vertices, twistAmount) {\n for(var i = 0; i < vertices.length; i++) {\n vertices[i] = twistVertex(vertices[i], twistAmount);\n }\n}", "title": "" }, { "docid": "b789a3ab4a67b7c11324c320f7d69d2c", "score": "0.5271992", "text": "generateSquareVertices(center_x,center_y,size) {\n var vertices = [];\n var vertex1 = new Vertex(center_x-size/100, center_y+size/100, 0.0);\n var vertex2 = new Vertex( center_x-size/100, center_y-size/100, 0.0);\n var vertex3 = new Vertex( center_x+size/100, center_y-size/100, 0.0); \n var vertex4 = new Vertex(center_x+size/100, center_y-size/100, 0.0);\n var vertex5 = new Vertex( center_x+size/100, center_y+size/100, 0.0);\n var vertex6 = new Vertex( center_x-size/100, center_y+size/100, 0.0);\n vertices.push(vertex1);\n vertices.push(vertex2);\n vertices.push(vertex3);\n vertices.push(vertex4);\n vertices.push(vertex5);\n vertices.push(vertex6);\n return vertices;\n }", "title": "" }, { "docid": "7567222224825bbda7eea70eda00ad6b", "score": "0.52609307", "text": "function makeVertices(points) {\n var i;\n var pts = [];\n for (i=0; i<points.length; i++) {\n var p = new THREE.Vector3();\n p.x = points[i][0];\n p.y = points[i][1];\n p.z = 0;\n pts.push(p);\n }\n return pts;\n }", "title": "" }, { "docid": "9ceddda38b8691b44a7cf63df95df178", "score": "0.5245065", "text": "computeOutputVertices(vertices) {\n // Collect some statistics about these vertices.\n let minx = 1e9\n let miny = 1e9\n let maxx = -1e9\n let maxy = -1e9\n this.vertices = vertices.map(vertex => {\n const x = vertex.x + this.offsetX\n const y = vertex.y + this.offsetY\n minx = Math.min(x, minx)\n miny = Math.min(y, miny)\n maxx = Math.max(x, maxx)\n maxy = Math.max(y, maxy)\n\n return {\n ...vertex,\n x: x,\n y: y,\n }\n })\n let startx = this.vertices[0].x\n let starty = this.vertices[0].y\n let endx = this.vertices[this.vertices.length-1].x\n let endy = this.vertices[this.vertices.length-1].y\n\n // Replace pre/post placeholder variables\n this.pre = this.pre.replace(/{startx}/gi, startx.toFixed(3))\n this.pre = this.pre.replace(/{starty}/gi, starty.toFixed(3))\n this.pre = this.pre.replace(/{endx}/gi, endx.toFixed(3))\n this.pre = this.pre.replace(/{endy}/gi, endy.toFixed(3))\n this.pre = this.pre.replace(/{minx}/gi, minx.toFixed(3))\n this.pre = this.pre.replace(/{miny}/gi, miny.toFixed(3))\n this.pre = this.pre.replace(/{maxx}/gi, maxx.toFixed(3))\n this.pre = this.pre.replace(/{maxy}/gi, maxy.toFixed(3))\n this.post = this.post.replace(/{startx}/gi, startx.toFixed(3))\n this.post = this.post.replace(/{starty}/gi, starty.toFixed(3))\n this.post = this.post.replace(/{endx}/gi, endx.toFixed(3))\n this.post = this.post.replace(/{endy}/gi, endy.toFixed(3))\n this.post = this.post.replace(/{minx}/gi, minx.toFixed(3))\n this.post = this.post.replace(/{miny}/gi, miny.toFixed(3))\n this.post = this.post.replace(/{maxx}/gi, maxx.toFixed(3))\n this.post = this.post.replace(/{maxy}/gi, maxy.toFixed(3))\n }", "title": "" }, { "docid": "bdc7ba080879aaab415bc482d4fd944f", "score": "0.5244249", "text": "setVerticesUVs() {\n // we need to create our geometry and material objects\n const cachedGeometry = this.renderer.cache.getGeometryFromID(this.definition.id);\n\n if(cachedGeometry) {\n this.attributes.vertexPosition.array = cachedGeometry.vertices;\n this.attributes.textureCoord.array = cachedGeometry.uvs;\n }\n else {\n this.computeVerticesUVs();\n // TODO better caching? We could pass all attributes to cache and handle arrays in there\n this.renderer.cache.addGeometry(this.definition.id, this.attributes.vertexPosition.array, this.attributes.textureCoord.array);\n }\n }", "title": "" }, { "docid": "c57fa4b8753594e024a85c2c3f2bf9c0", "score": "0.5238332", "text": "function generate() {\n var out = [];\n out[0] = inputTriangles.meshes;\n\n var center = vec3.fromValues(0.0,0.0,0.0);\n var dist = 0.0;\n\n out[0].numTris = 0;\n\n for (var t = 0; t < inputTriangles.meshes.length; t++) {\n vec3.add(center, center, inputTriangles.meshes[t].center);\n var x = inputTriangles.meshes[t].dist;\n dist = Math.max(dist,x);\n out[0][t].vbo = vertexBuffers[t];\n out[0][t].nbo = normalBuffers[t];\n out[0][t].uvbo = uvBuffers[t];\n out[0][t].tbo = triangleBuffers[t];\n out[0][t].texture = textures[t];\n out[0].numTris += out[0][t].glTriangles.length/3;\n }\n vec3.scale(center, center, 1/inputTriangles.meshes.length);\n var size = dist*2.0;\n out[0].size = size;\n //console.log(size);\n\n for (var n = 1; n < 3; n++) {\n var res = 32.0/n; // 32 by 32 voxel resolution\n var lod = n; // voxel detail level\n\n var d = size/2.0;\n var eye;\n var up;\n /*var texture = gl.createTexture();\n var renderbuffer = gl.createRenderbuffer();\n var framebuffer = gl.createFramebuffer();*/\n createBuffer(res);\n //createBuffer(512);\n var vMap = [];\n\n //don't forget to handle material, texture, etc!!!!!!!!!!\n out[lod] = [];\n out[lod][0] = [];\n out[lod][0].glTriangles = [];\n out[lod][0].glVertices = [];\n out[lod][0].glNormals = [];\n out[lod][0].glUvs = [];\n out[lod][0].material = out[0][0].material;\n out[lod][0].xAxis = out[0][0].xAxis;\n out[lod][0].yAxis = out[0][0].yAxis;\n out[lod][0].translation = out[0][0].translation;\n out[lod][0].center = center;\n out[lod][0].on = out[0][0].on;\n out[lod][0].texture = out[0][0].texture;\n out[lod].size = out[0].size;\n\n\n //Note: coor system fixed\n\n // side: (cx+d)\n eye = vec3.fromValues(center[0]+d,center[1],center[2]);\n up = vec3.fromValues(0,1,0);\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n gl.viewport(0, 0, res, res);\n renderOffscreen(eye, center, up, res, size); // should size be a parameter?\n for (var j = 0; j < res; j++) {\n for (var i = 0; i < res; i++) {\n //read one pixel\n var readout = new Uint8Array(1 * 1 * 4);\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n //gl.bindTexture(gl.TEXTURE_2D, texture);\n //gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n \n //renderOffscreen(eye, center, up, res, size);\n //gl.bindTexture(gl.TEXTURE_2D, texture);\n //gl.viewport(0, 0, res, res);\n gl.readPixels(i,j,1,1,gl.RGBA,gl.UNSIGNED_BYTE,readout);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, 512, 512);\n //console.log(readout);\n\n var k = readout[0];\n //console.log(k);\n if (k != 0.0) {\n k = (k/255)*(res-1.0) // scale back up to (0..res-1)\n k = Math.floor(k+0.5);\n //console.log(k);\n\n // find coor of voxel\n var x = (res-1)-k;\n var y = j;\n var z = i;\n\n makeVoxel(out[lod][0],x,y,z,res,size,center,vMap);}\n }\n }\n\n // side: (cx-d)\n eye = vec3.fromValues(center[0]-d,center[1],center[2]);\n up = vec3.fromValues(0,1,0);\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n gl.viewport(0, 0, res, res);\n renderOffscreen(eye, center, up, res, size); // should size be a parameter?\n for (var j = 0; j < res; j++) {\n for (var i = 0; i < res; i++) {\n //read one pixel\n var readout = new Uint8Array(1 * 1 * 4);\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n //gl.bindTexture(gl.TEXTURE_2D, texture);\n //gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n \n //renderOffscreen(eye, center, up, res, size);\n //gl.bindTexture(gl.TEXTURE_2D, texture);\n //gl.viewport(0, 0, res, res);\n gl.readPixels(i,j,1,1,gl.RGBA,gl.UNSIGNED_BYTE,readout);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, 512, 512);\n\n var k = readout[0];\n //console.log(k);\n if (k != 0.0) {\n k = (k/255)*(res-1.0) // scale back up to (0..res-1)\n k = Math.floor(k+0.5);\n\n // find coor of voxel\n var x = k;\n var y = j;\n var z = (res-1)-i;\n\n makeVoxel(out[lod][0],x,y,z,res,size,center,vMap);}\n }\n }\n\n // side: (cy+d)\n eye = vec3.fromValues(center[0],center[1]+d,center[2]);\n up = vec3.fromValues(0,0,1);\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n gl.viewport(0, 0, res, res);\n renderOffscreen(eye, center, up, res, size); // should size be a parameter?\n for (var j = 0; j < res; j++) {\n for (var i = 0; i < res; i++) {\n //read one pixel\n var readout = new Uint8Array(1 * 1 * 4);\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n //gl.bindTexture(gl.TEXTURE_2D, texture);\n //gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n \n //renderOffscreen(eye, center, up, res, size);\n //gl.bindTexture(gl.TEXTURE_2D, texture);\n //gl.viewport(0, 0, res, res);\n gl.readPixels(i,j,1,1,gl.RGBA,gl.UNSIGNED_BYTE,readout);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, 512, 512);\n\n var k = readout[0];\n //console.log(k);\n if (k != 0.0) {\n k = (k/255)*(res-1.0) // scale back up to (0..res-1)\n k = Math.floor(k+0.5);\n\n // find coor of voxel\n var x = i;\n var y = (res-1)-k;\n var z = j;\n\n makeVoxel(out[lod][0],x,y,z,res,size,center,vMap);}\n }\n }\n\n // side: (cy-d)\n eye = vec3.fromValues(center[0],center[1]-d,center[2]);\n up = vec3.fromValues(0,0,1);\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n gl.viewport(0, 0, res, res);\n renderOffscreen(eye, center, up, res, size); // should size be a parameter?\n for (var j = 0; j < res; j++) {\n for (var i = 0; i < res; i++) {\n //read one pixel\n var readout = new Uint8Array(1 * 1 * 4);\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n //gl.bindTexture(gl.TEXTURE_2D, texture);\n //gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n \n //renderOffscreen(eye, center, up, res, size);\n //gl.bindTexture(gl.TEXTURE_2D, texture);\n //gl.viewport(0, 0, res, res);\n gl.readPixels(i,j,1,1,gl.RGBA,gl.UNSIGNED_BYTE,readout);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, 512, 512);\n\n var k = readout[0];\n //console.log(k);\n if (k != 0.0) {\n k = (k/255)*(res-1.0) // scale back up to (0..res-1)\n k = Math.floor(k+0.5);\n\n // find coor of voxel\n var x = (res-1)-i;\n var y = k;\n var z = j;\n\n makeVoxel(out[lod][0],x,y,z,res,size,center,vMap);}\n }\n }\n\n // side: (cz+d)\n eye = vec3.fromValues(center[0],center[1],center[2]+d);\n up = vec3.fromValues(0,1,0);\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n gl.viewport(0, 0, res, res);\n renderOffscreen(eye, center, up, res, size); // should size be a parameter?\n for (var j = 0; j < res; j++) {\n for (var i = 0; i < res; i++) {\n //read one pixel\n var readout = new Uint8Array(1 * 1 * 4);\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n //gl.bindTexture(gl.TEXTURE_2D, texture);\n //gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n \n //renderOffscreen(eye, center, up, res, size);\n //gl.bindTexture(gl.TEXTURE_2D, texture);\n //gl.viewport(0, 0, res, res);\n gl.readPixels(i,j,1,1,gl.RGBA,gl.UNSIGNED_BYTE,readout);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, 512, 512);\n\n var k = readout[0];\n //console.log(k);\n if (k != 0.0) {\n k = (k/255)*(res-1.0) // scale back up to (0..res-1)\n k = Math.floor(k+0.5);\n\n // find coor of voxel\n var x = (res-1)-i;\n var y = j;\n var z = (res-1)-k;\n\n makeVoxel(out[lod][0],x,y,z,res,size,center,vMap);}\n }\n }\n\n // side: (cz-d)\n eye = vec3.fromValues(center[0],center[1],center[2]-d);\n up = vec3.fromValues(0,1,0);\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n gl.viewport(0, 0, res, res);\n renderOffscreen(eye, center, up, res, size); // should size be a parameter?\n for (var j = 0; j < res; j++) {\n for (var i = 0; i < res; i++) {\n //read one pixel\n var readout = new Uint8Array(1 * 1 * 4);\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n //gl.bindTexture(gl.TEXTURE_2D, texture);\n //gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n \n //renderOffscreen(eye, center, up, res, size);\n //gl.bindTexture(gl.TEXTURE_2D, texture);\n //gl.viewport(0, 0, res, res);\n gl.readPixels(i,j,1,1,gl.RGBA,gl.UNSIGNED_BYTE,readout);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, 512, 512);\n\n var k = readout[0];\n //console.log(k);\n if (k != 0.0) {\n k = (k/255)*(res-1.0) // scale back up to (0..res-1)\n k = Math.floor(k+0.5);\n\n // find coor of voxel\n var x = i;\n var y = j;\n var z = k;\n\n makeVoxel(out[lod][0],x,y,z,res,size,center,vMap);}\n }\n }\n\n // send the vertex coords, normals and uvs to webGL; load texture\n out[lod][0].vbo = gl.createBuffer(); // init empty webgl set vertex coord buffer\n gl.bindBuffer(gl.ARRAY_BUFFER,out[lod][0].vbo); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(out[lod][0].glVertices),gl.STATIC_DRAW); // data in\n out[lod][0].nbo = gl.createBuffer(); // init empty webgl set normal component buffer\n gl.bindBuffer(gl.ARRAY_BUFFER,out[lod][0].nbo); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(out[lod][0].glNormals),gl.STATIC_DRAW); // data in\n out[lod][0].uvbo = gl.createBuffer(); // init empty webgl set uv coord buffer\n gl.bindBuffer(gl.ARRAY_BUFFER,out[lod][0].uvbo); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(out[lod][0].glUvs),gl.STATIC_DRAW); // data in\n\n // send the triangle indices to webGL\n out[lod][0].tbo = gl.createBuffer(); // init empty triangle index buffer\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,out[lod][0].tbo); // activate that buffer\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,new Uint16Array(out[lod][0].glTriangles),gl.STATIC_DRAW); // data in\n\n out[lod].numTris = out[lod][0].glTriangles.length/3;\n }\n\n tris = out;\n}", "title": "" }, { "docid": "88175761d8b84a23158e374df370f611", "score": "0.52369463", "text": "placeVertexAndNormals(z,base,height){\r\n this.vertices.push(base,0,z);\r\n this.normals.push(Math.cos(30*Math.PI/180),Math.sin(30*Math.PI/180),0);\r\n this.texCoords.push(0,z);\r\n\r\n let ang = 30;\r\n\r\n for(let i=0; i<2; i++){\r\n this.vertices.push(0,height,z);\r\n this.normals.push(Math.cos(ang*Math.PI/180),Math.sin(ang*Math.PI/180),0);\r\n this.texCoords.push(1/3,z);\r\n ang +=150;\r\n }\r\n\r\n for(let i=0; i<2; i++){\r\n this.vertices.push(0,0,z);\r\n this.normals.push(Math.cos(ang*Math.PI/180),Math.sin(ang*Math.PI/180),0);\r\n this.texCoords.push(2/3,z);\r\n ang +=90;\r\n }\r\n \r\n this.vertices.push(base,0,z);\r\n this.normals.push(Math.cos(270*Math.PI/180),Math.sin(270*Math.PI/180),0);\r\n this.texCoords.push(1,z);\r\n }", "title": "" }, { "docid": "aeeb28336b6d2c672b18e2d495a87489", "score": "0.52344453", "text": "unrolled() {\n let out = [];\n let vertices = this.vertices;\n for (let face of this.faces) {\n out.push(vertices[face]);\n out.push(vertices[face+1]);\n out.push(vertices[face+2]);\n }\n return out;\n }", "title": "" }, { "docid": "2ce7429c713227502196b45e3f50bfbb", "score": "0.5229149", "text": "loadFromVerts() {\r\n if (this._verts.length == 0) {\r\n return;\r\n }\r\n\r\n let min = new Vector2$6([1e17, 1e17]);\r\n let max = new Vector2$6([-1e17, -1e17]);\r\n\r\n for (let v of this._verts) {\r\n min.min(v);\r\n max.max(v);\r\n }\r\n\r\n this.pos[0] = min[0];\r\n this.pos[1] = min[1];\r\n\r\n this.size[0] = max[0] - min[0];\r\n this.size[1] = max[1] - min[1];\r\n\r\n this.setCSS();\r\n return this;\r\n }", "title": "" }, { "docid": "b8b97286a78e258fd8be4c91486315e3", "score": "0.5211486", "text": "constructor({ vertices = null }) {\n Object.assign(this, { vertices, originalVertices: vertices })\n this.wireframe = this.getWireframeVertices()\n this.solid = this.getTriangleVertices()\n }", "title": "" }, { "docid": "f39d2d3e5c996ad3a8cc8efd9a4ed366", "score": "0.52069205", "text": "constructor() // etc) smaller and more cache friendly.\r\n { super( \"positions\", \"normals\", \"texture_coords\" ); // Name the values we'll define per each vertex.\r\n this.positions .push( ...Vec.cast( [-1,-1,0], [1,-1,0], [-1,1,0], [1,1,0] ) ); // Specify the 4 square corner locations.\r\n this.normals .push( ...Vec.cast( [0,0,1], [0,0,1], [0,0,1], [0,0,1] ) ); // Match those up with normal vectors.\r\n this.texture_coords.push( ...Vec.cast( [0,0], [1,0], [0,1], [1,1] ) ); // Draw a square in texture coordinates too.\r\n this.indices .push( 0, 1, 2, 1, 3, 2 ); // Two triangles this time, indexing into four distinct vertices.\r\n }", "title": "" }, { "docid": "f6e3ad584d28ce329864838e915eee5d", "score": "0.51963353", "text": "prepareVertices(mesh) {\n let geo = new THREE.Geometry();\n let curId = 0;\n\n let vertices = [];\n for (let x = 0; x <= this.metadata.wSIZE; x++) {\n if (!mesh[x]) mesh[x] = [];\n\n vertices[x] = [];\n for (let y = 0; y <= this.metadata.wSIZE; y++) {\n if (!mesh[x][y]) mesh[x][y] = { color: {r:255, g:255,b:255} };\n\n let tile = mesh[x][y];\n\n // Defaulting\n if (!tile.draw) tile.draw = 'blend';\n if (!tile.orientation) tile.orientation = 'diagb';\n\n if (tile.color) {\n tile.threeColor = new THREE.Color(tile.color.r / 255, tile.color.g / 255, tile.color.b / 255);\n tile.threeShadowColor = \n new THREE.Color(\n 0.7 * tile.color.r / 255, \n 0.7 * tile.color.g / 255,\n 0.7 * tile.color.b / 255);\n } else {\n tile.threeColor = new THREE.Color(1.0,1.0,1.0);\n tile.threeShadowColor = new THREE.Color(1.0,1.0,1.0);\n }\n\n if (tile.water) {\n let w = tile.water;\n let flowX = w.flowX || 0.0;\n let flowY = w.flowY || 0.0;\n \n // normalize vector.\n let len = Math.sqrt(flowX * flowX + flowY * flowY);\n flowX /= len;\n flowY /= len;\n \n let speed = w.flowSpeed || 0.0;\n flowX *= speed;\n flowY *= speed;\n\n tile.waterFlow = [flowX, flowY];\n \n let depth = w.depth || 0;\n \n let r = 128 + Math.floor(127 * flowX / WATER_ENCODE_RANGE);\n let g = 128 + Math.floor(127 * flowY / WATER_ENCODE_RANGE);\n let b = Math.floor(255 * depth / 3.0);\n\n tile.threeWaterColor = new THREE.Color(r / 255.0, g / 255.0, b / 255.0, 1.0);\n } else {\n tile.threeWaterColor = new THREE.Color(1.0,1.0,1.0)\n }\n\n if (!tile.color && !tile.texture1 && !tile.texture2) tile.draw = 'none';\n\n let pos = new THREE.Vector3(x, tile.elevation || 0.0, y);\n\n vertices[x][y] = { \n vector: pos,\n index: curId++\n };\n geo.vertices.push(pos);\n }\n }\n return { geometry: geo, vertices: vertices };\n }", "title": "" }, { "docid": "44d64983085004116d2ad4c49a129bc0", "score": "0.5194048", "text": "function generarSuperficie(superficie,filas,columnas){\r\n \r\n positionBuffer = [];\r\n normalBuffer = [];\r\n //uvBuffer = [];\r\n\r\n for (var i=0; i <= filas; i++) {\r\n for (var j=0; j <= columnas; j++) {\r\n\r\n var u=j/columnas;\r\n var v=i/filas;\r\n\r\n var pos=superficie.getPosicion(u,v);\r\n\r\n positionBuffer.push(pos[0]);\r\n positionBuffer.push(pos[1]);\r\n positionBuffer.push(pos[2]);\r\n\r\n var nrm=superficie.getNormal(u,v);\r\n\r\n normalBuffer.push(nrm[0]);\r\n normalBuffer.push(nrm[1]);\r\n normalBuffer.push(nrm[2]);\r\n\r\n //var uvs=superficie.getCoordenadasTextura(u,v);\r\n\r\n //uvBuffer.push(uvs[0]);\r\n //uvBuffer.push(uvs[1]);\r\n\r\n }\r\n }\r\n\r\n // Buffer de indices de los triángulos\r\n\r\n var filasReales = filas+1;\r\n var columnasReales = columnas + 1;\r\n \r\n indexBuffer=[];\r\n \r\n for (var i=0; i < filas; i++) {\r\n for (var j=0; j < columnas; j++) {\r\n indexBuffer.push(i*columnasReales + j);\r\n indexBuffer.push((i+1)*columnasReales + j);\r\n }\r\n \r\n // agrego los ultimos dos vertices de la ultima columna\r\n indexBuffer.push(i*columnasReales + (columnasReales - 1));\r\n indexBuffer.push((i+1)*columnasReales + (columnasReales - 1));\r\n \r\n // agrego el ultimo vertice y el siguiente para generar el triangulo degenerado\r\n // solo si no llegue al ultimo quad\r\n if (i != filas - 1) {\r\n indexBuffer.push((i+1)*columnasReales + (columnasReales - 1));\r\n indexBuffer.push((i+1)*columnasReales);\r\n }\r\n }\r\n\r\n // Creación e Inicialización de los buffers\r\n\r\n webgl_position_buffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, webgl_position_buffer);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positionBuffer), gl.STATIC_DRAW);\r\n webgl_position_buffer.itemSize = 3;\r\n webgl_position_buffer.numItems = positionBuffer.length / 3;\r\n\r\n webgl_normal_buffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, webgl_normal_buffer);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(normalBuffer), gl.STATIC_DRAW);\r\n webgl_normal_buffer.itemSize = 3;\r\n webgl_normal_buffer.numItems = normalBuffer.length / 3;\r\n\r\n /*webgl_uvs_buffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, webgl_uvs_buffer);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(uvBuffer), gl.STATIC_DRAW);\r\n webgl_uvs_buffer.itemSize = 2;\r\n webgl_uvs_buffer.numItems = uvBuffer.length / 2;*/\r\n\r\n\r\n webgl_index_buffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webgl_index_buffer);\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indexBuffer), gl.STATIC_DRAW);\r\n webgl_index_buffer.itemSize = 1;\r\n webgl_index_buffer.numItems = indexBuffer.length;\r\n\r\n return {\r\n webgl_position_buffer,\r\n webgl_normal_buffer,\r\n //webgl_uvs_buffer,\r\n webgl_index_buffer\r\n }\r\n}", "title": "" }, { "docid": "b95e51eacafbda408f213155d7e42875", "score": "0.5184965", "text": "addVertex(v) {\n this.adjList.set(v, []);\n }", "title": "" }, { "docid": "dbbdb78fd87382264052b3d3c16c9af5", "score": "0.51842886", "text": "function drawAllVertices(item, index){\n let graphics = new PIXI.Graphics();\n let node1 = findNode(item.from);\n let node2 = findNode(item.to);\n graphics = drawLine(graphics, node1.position.x, node1.position.y, node2.position.x, node2.position.y, item.color);\n item.graphics = graphics;\n vertices[item.id] = item;\n\n arrowhead = new PIXI.Sprite.from(\"../images/arrowhead3-01.png\");\n arrowhead.x = node1.position.x + (node2.position.x - node1.position.x) * 0.67;\n arrowhead.y = node1.position.y + (node2.position.y - node1.position.y) * 0.67;\n arrowhead.height = 20;\n arrowhead.width = 20;\n arrowhead.anchor.set(0.5);\n if (node2.position.y == node1.position.y){\n if (node2.position.x < node1.position.x){\n arrowhead.rotation = Math.PI;\n }\n } else if (node2.position.x == node1.position.x){\n if (node2.position.y > node1.position.y){\n arrowhead.rotation = 0.5 * Math.PI;\n } else {\n arrowhead.rotation = 1.5 * Math.PI;\n }\n } else {\n if (node2.position.x > node1.position.x && node2.position.y > node1.position.y){\n arrowhead.rotation = Math.atan((node2.position.y - node1.position.y)/(node2.position.x - node1.position.x));\n }else if (node2.position.x > node1.position.x && node2.position.y < node1.position.y){\n arrowhead.rotation = Math.atan((node2.position.y - node1.position.y)/(node2.position.x - node1.position.x));\n }else{\n arrowhead.rotation = Math.PI + Math.atan((node2.position.y - node1.position.y)/(node2.position.x - node1.position.x));\n }\n }\n //interaction\n arrowhead.interactive = true;\n arrowhead.on('pointerover', (event) => onPointerOver(arrowhead, item.id));\n arrowhead.on('pointerout', (event) => onPointerOut(arrowhead, item.id));\n\n item.arrowhead = arrowhead;\n vertices[item.id] = item;\n}", "title": "" }, { "docid": "47a334cf47c918ea54a07b53397eb7dc", "score": "0.5182494", "text": "function generateTerrain(vertices) {\n // Initialize corner values\n\n square(vertices,\n 0, 0, // top\n TERRAIN_SIDE_VERTICES - 1, TERRAIN_SIDE_VERTICES - 1, // bottom\n TERRAIN_INITIAL_ELEVATION);\n\n}", "title": "" }, { "docid": "1bf99ce5563f15ae7a6483ca40ef5e67", "score": "0.51809466", "text": "function identify_vertices(verts)\n{\n\tif (verts.length == 0)\n\t\treturn;\n\tvar v2identified = [], nbr2edges = [];\n\tv2identified.length = nbr2edges.length = nodes.length;\n\tfor (var i = 0; i < nodes.length; i++)\n\t\tv2identified[i] = false, nbr2edges[i] = [];\n\tfor (var v of verts)\n\t\tv2identified[v] = true;\n\tvar newvindex = verts.reduce(function (a,b) {return Math.min(a,b);});\n\tvar newv = nodes[newvindex];\n\t// update edges\n\tfor (var i = links.length-1; i>=0; i--)\n\t{\n\t\tvar l = links[i], otherEnd = null;\n\t\tif (v2identified[l.source.index] && v2identified[l.target.index])\n\t\t{\n\t\t\tl.source = l.target = newv;\n\t\t}\n\t\tif (v2identified[l.source.index])\n\t\t{\n\t\t\totherEnd = l.target.index;\n\t\t}\n\t\telse if (v2identified[l.target.index])\n\t\t{\n\t\t\totherEnd = l.source.index;\n\t\t}\n\t\tif (otherEnd != null)\n\t\t{\n\t\t\tif ((otherEnd != newvindex && nbr2edges[otherEnd].length==0) || multigraph.classed(\"selected\"))\n\t\t\t{\n\t\t\t\tl.copy = nbr2edges[otherEnd].length;\n\t\t\t\tnbr2edges[otherEnd].push(l);\n\t\t\t\tif (newvindex < otherEnd)\n\t\t\t\t\t{ l.source = newv; l.target = nodes[otherEnd]; }\n\t\t\t\telse (newvindex < otherEnd)\n\t\t\t\t\t{ l.target = newv; l.source = nodes[otherEnd]; }\n\t\t\t}\n\t\t\telse\n\t\t\t\tdelete_edge(l);\n\t\t}\n\t}\n\tfor (var edgelist of nbr2edges)\n\t{\n\t\tfor (var l of edgelist)\n\t\t{\n\t\t\tdelete l.controlx; delete l.controly; // float the edges\n\t\t\tl.copies = edgelist.length-1;\n\t\t}\n\t}\n\t\n\tvar numContract = verts.length, sumx=0, sumy=0;\n\tfor (var v of verts)\n\t{\n\t\tsumx += nodes[v].x;\n\t\tsumy += nodes[v].y;\n\t}\n\tnodes[newvindex].px = sumx/numContract;\n\tnodes[newvindex].py = sumy/numContract;\n\tnodes[newvindex].x = sumx/numContract;\n\tnodes[newvindex].y = sumy/numContract;\n\t\n\tverts.sort(function (a,b) {return a-b;}); // sort the list\n\tfor (var i = verts.length-1; i > 0; i--) // go backwards, to avoid changing the indices as we delete the vertices, and skip the first one, which should be the resulting vertex\n\t\tdelete_vertex(nodes[verts[i]]);\n\treturn newv;\n}", "title": "" }, { "docid": "28bde38afef5aecb131f3a56124c3447", "score": "0.5177072", "text": "function loadTriangles(lights) {\n var inputTriangles = getJSONFile(INPUT_TRIANGLES_URL,\"triangles\");\n\n if (inputTriangles != String.null) { \n var whichSetVert; // index of vertex in current triangle set\n var whichSetTri; // index of triangle in current triangle set\n 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 for (var whichSet=0; whichSet<inputTriangles.length; whichSet++) {\n vec3.set(indexOffset,vtxBufferSize,vtxBufferSize,vtxBufferSize); // update vertex offset\n \n var curobject = inputTriangles[whichSet].material;\n // set up the vertex coord array\n for (whichSetVert=0; whichSetVert<inputTriangles[whichSet].vertices.length; whichSetVert++) {\n var coord = inputTriangles[whichSet].vertices[whichSetVert];\n coord = chageView(coord,lookAt,viewMatrix); //rotate view when press key\n vtxToAdd = transform(coord,Eye); //\n var normal = inputTriangles[whichSet].normals[whichSetVert];\n\n for(vtxIndex=0; vtxIndex<vtxToAdd.length; vtxIndex++){\n coordArray.push(vtxToAdd[vtxIndex]); //push vertices to buffer\n }\n var color = lighting(Eye,lights,normal,coord,curobject);\n coordArray.push(color[0],color[1],color[2]);//push color to buffer\n vtxBufferSize +=1;\n } // end for vertices in set\n \n // set up the triangle index array, adjusting indices across sets\n for (whichSetTri=0; whichSetTri<inputTriangles[whichSet].triangles.length; whichSetTri++) {\n vec3.add(triToAdd,indexOffset,inputTriangles[whichSet].triangles[whichSetTri]);\n for(triIndex=0; triIndex<vtxToAdd.length; triIndex++){\n indexArray.push(triToAdd[triIndex]);\n triBufferSize += 1; \n }\n } // end for triangles in set\n\n\n } // end for each triangle set \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\n\n } // end if triangles found\n} // end load triangles", "title": "" }, { "docid": "abac155b71d241028dda3ab5e8a471ef", "score": "0.5176742", "text": "generateNormals() {\n // Create an object, where the key is the vertex index, and the value is normals of all triangle meshes this vertex belongs to\n var meshNormals = {};\n for (var vertexIndex = 0; vertexIndex < this.numVertices; vertexIndex++) {\n meshNormals[vertexIndex] = [];\n }\n for (var i=0; i < this.numFaces; i++) {\n var vertexNormal = vec3.create();\n var edge1 = vec3.create();\n var edge2 = vec3.create();\n\n var vertexIndex1 = this.fBuffer[3*i];\n var vertexIndex2 = this.fBuffer[3*i+1];\n var vertexIndex3 = this.fBuffer[3*i+2];\n var vertex1 = vec3.fromValues(this.vBuffer[3*vertexIndex1], this.vBuffer[vertexIndex1+1], this.vBuffer[vertexIndex1+2]);\n var vertex2 = vec3.fromValues(this.vBuffer[3*vertexIndex2], this.vBuffer[3*vertexIndex2+1], this.vBuffer[3*vertexIndex2+2]);\n var vertex3 = vec3.fromValues(this.vBuffer[3*vertexIndex3 ], this.vBuffer[3*vertexIndex3 +1], this.vBuffer[3*vertexIndex3+2]);\n console.log(\"vertex1:\", vertex1);\n console.log(\"vertex2:\", vertex2);\n console.log(\"vertex3:\", vertex3);\n\n \n vec3.subtract(edge1, vertex2, vertex1);\n vec3.subtract(edge2, vertex3, vertex1);\n vec3.cross(vertexNormal, edge1, edge2);\n vec3.normalize(vertexNormal, vertexNormal);\n if (vertexNormal[2] < 0) {\n vertexNormal[0] = -vertexNormal[0];\n vertexNormal[1] = -vertexNormal[1];\n vertexNormal[2] = -vertexNormal[2];\n }\n //console.log(\"vertexNormal\", vertexNormal);\n meshNormals[vertexIndex1].push(vertexNormal);\n meshNormals[vertexIndex2].push(vertexNormal);\n meshNormals[vertexIndex3].push(vertexNormal);\n }\n //console.log(\"meshNormalsMap\", meshNormals[0][0]);\n \n // Calculate vertex normals\n for (var vertexIndex in meshNormals) {\n console.log(\"vertexIndex: \", vertexIndex)\n var normalSum = vec3.fromValues(0.0, 0.0, 0.0)\n for (var i = 0; i < meshNormals[vertexIndex].length;i++) {\n var normal = meshNormals[vertexIndex][i];\n console.log(\"normal: \", normal);\n vec3.add(normalSum, normalSum, normal);\n }\n console.log(\"normalSum: \", normalSum);\n vec3.normalize(normalSum, normalSum);\n this.nBuffer[3*vertexIndex] = normalSum[0];\n this.nBuffer[3*vertexIndex+1] = normalSum[1];\n this.nBuffer[3*vertexIndex+2] = normalSum[2];\n }\n console.log(\"nBuffer: \", this.nBuffer);\n \n }", "title": "" }, { "docid": "cf47ec27f3c329897dfea42db8f6da27", "score": "0.5174341", "text": "function fill_normal_vertex_colors(){\n normalVerticesColors = [];\n for (var i = 0; i < normalVertices.length; i+=3) {\n normalVerticesColors.push(normal_color[0]);\n normalVerticesColors.push(normal_color[1]);\n normalVerticesColors.push(normal_color[2]);\n }\n}", "title": "" }, { "docid": "39672a990b2d3fca6893e03394c56b59", "score": "0.51664865", "text": "addVertex(vertex) {\n if (!this.adjacentList[vertex]) {\n this.adjacentList[vertex] = [];\n }\n }", "title": "" }, { "docid": "ad6b5218037af26b7436d47c8c90e6fa", "score": "0.51597124", "text": "colorAllVertices() {\n this.vertices\n .sort((l, r) => {\n return r.adjacentVertexIds.size - l.adjacentVertexIds.size;\n })\n .forEach((v) => {\n if (v.adjacentVertexIds.size <= 0) {\n v.color = 0;\n } else {\n var adjs = this.getAdjacentVertices(v);\n var existingColors = adjs\n .filter((vert) => {\n return vert.color !== undefined;\n })\n .map((vert) => {\n return vert.color;\n });\n v.color = this.lowestColor(existingColors);\n }\n });\n }", "title": "" }, { "docid": "346c87de13f2215fa16ff7bb90187eb9", "score": "0.5158751", "text": "function generateSuperTriangles(width, height) {\n var v00 = new Vertex(-1, -1); //\n var v01 = new Vertex(-1, height);\n var v10 = new Vertex(width, -1);\n var v11 = new Vertex(width, height);\n var st1 = new Triangle(v00, v01, v11);\n var st2 = new Triangle(v00, v10, v11);\n return [st1, st2];\n }", "title": "" }, { "docid": "d457e0b201e846b22dcf721422613be7", "score": "0.5156868", "text": "Triangulate(vertices) {\n const triangles = [];\n // First, create a \"supertriangle\" that bounds all vertices \n var st = this.createBoundingTriangle(vertices);\n triangles.push(st);\n // begin the triangulation one vertex at a time\n for (var i in vertices) {\n // NOTE: This is O(n^2) - can be optimized by sorting vertices\n // along the x-axis and only considering triangles that have \n // potentially overlapping circumcircles\n this.AddVertex(vertices[i], triangles);\n }\n // Remove triangles that shared edges with \"supertriangle\"\n for (var i in triangles) {\n var triangle = triangles[i];\n if (triangle.a == st.a || triangle.a == st.b || triangle.a == st.c ||\n triangle.b == st.a || triangle.b == st.b || triangle.b == st.c ||\n triangle.c == st.a || triangle.c == st.b || triangle.c == st.c) {\n delete triangles[i];\n }\n }\n return triangles;\n }", "title": "" }, { "docid": "00a9795686ad84a5f646fb49afe05c9c", "score": "0.51457685", "text": "function reuseVertexStartIdx(startIdx, vertices) {\n return startIdx;\n }", "title": "" }, { "docid": "ee2b4c725bef5128c431bb8acd638ef8", "score": "0.51361823", "text": "createEdges(newVertex) {\n this.vertices.forEach(vertex => {\n let edge = new Edge(newVertex, vertex);\n edge.id = this.edges.length;\n vertex.edges.push(edge);\n newVertex.edges.push(edge);\n this.edges.push(edge);\n });\n }", "title": "" }, { "docid": "8a11f570f71994003ff77d723041b872", "score": "0.5136107", "text": "_updateTriangleNormals(){\n for(let i=0; i<this._indices.length; i++){\n let vId1 = this._indices[i]\n let vId2 = this._indices[i+1]\n let vId3 = this._indices[i+2]\n\n if(this._isTriangle(vId1, vId2, vId3)) {\n // calculate normal for every triangle in triangle strip \n let v1 = [this._vertices[vId1*3], this._vertices[vId1*3+1], this._vertices[vId1*3+2]]\n let v2 = [this._vertices[vId2*3], this._vertices[vId2*3+1], this._vertices[vId2*3+2]]\n let v3 = [this._vertices[vId3*3], this._vertices[vId3*3+1], this._vertices[vId3*3+2]]\n \n let v21 = Vec3.subtract(v2, v1)\n let v31 = Vec3.subtract(v3, v1)\n let n = Vec3.cross(v21, v31)\n \n // in triangle strip the triangles are not equally arranged in termes of clockwise/counterclockwise \n // every second triangle need to get flipped\n // not sure if my implementation is conventional correct but its uniform and working\n if(i%2==1) Vec3.mulScalar(n, -1, n)\n\n Vec3.normalize(n, n)\n Vec3.copy(n, this._triangleNormals[i]) \n }\n } \n }", "title": "" }, { "docid": "d070824cbba7fda6de1ee4a97d2c4c38", "score": "0.51306355", "text": "function copyVertices() {\n const time = Date.now();\n const source = points.geometry.attributes.position.array;\n const target = points2.geometry.attributes.position.array;\n const offset = copyIndex * ELEMENTS_PER_FRAME;\n\n for (let i = 0; i < ELEMENTS_PER_FRAME; i++) {\n target[offset + i] = source[i];\n }\n\n copyIndex = (copyIndex + 1) % FRAMES_TO_SAVE;\n\n const ms = Date.now() - time;\n console.log(`copied in ${ms} ms (index: ${copyIndex})`);\n bufferGeometry.attributes.position.needsUpdate = true;\n}", "title": "" }, { "docid": "bde801a43585f0bbb9498b0bd580774a", "score": "0.512143", "text": "regenerate(cubeIds=null) {\n console.log(\"Regenerating geometry for \" + this);\n this._regenerateTerrain(cubeIds);\n }", "title": "" }, { "docid": "c806dc8f7e9611fcd267d20ab8d12b50", "score": "0.5120309", "text": "function start_vertex_mode(){\n\tdocument.addEventListener( 'mousedown', on_mouse_down_vertex, false );\n\tvar allVertices = [];\n\tvar vector;\n\tvar position;\n\tfor (var i = objects.length - 1; i >= 0; i--) {\n\t\tposition = objects[i].position;\n\t\tfor (var j = objects[i].geometry.vertices.length -1; j >= 0; j--) {\n\t\t\tvector = new THREE.Vector3;\n\t\t\tvector.x = objects[i].geometry.vertices[j].x + position.x;\n\t\t\tvector.y = objects[i].geometry.vertices[j].y + position.y;\n\t\t\tvector.z = objects[i].geometry.vertices[j].z + position.z;\n\t\t\tallVertices.push(vector);\n\t\t}\n\t}\n\tfor (var i = allVertices.length - 1; i >= 0; i--) {\n\t\tcreate_sphere_vertex(allVertices[i]);\n\t}\n\tcreate_vertex_menu();\n}", "title": "" }, { "docid": "cbe0f0649cd716f0f937a8a515914187", "score": "0.51147497", "text": "initVertexRings() {\n var vrvStartCount = this.getVerticesRingVertStartCount();\n var vertRingVert = this._meshData._vertRingVert = new Uint32Array(this.getNbEdges() * 2);\n var vrfStartCount = this.getVerticesRingFaceStartCount();\n var vertRingFace = this.getVerticesRingFace();\n var vertTagFlags = this.getVerticesTagFlags();\n var vertOnEdge = this.getVerticesOnEdge();\n var fAr = this.getFaces();\n var vrvStart = 0;\n\n for (var i = 0, l = this.getNbVertices(); i < l; ++i) {\n var tagFlag = ++Utils.TAG_FLAG;\n var vrfStart = vrfStartCount[i * 2];\n var vrfEnd = vrfStart + vrfStartCount[i * 2 + 1];\n var vrvCount = 0;\n\n for (var j = vrfStart; j < vrfEnd; ++j) {\n var ind = vertRingFace[j] * 4;\n var iVer1 = fAr[ind];\n var iVer2 = fAr[ind + 1];\n var iVer3 = fAr[ind + 2];\n var iVer4 = fAr[ind + 3];\n\n if (iVer1 === i) iVer1 = iVer4 !== Utils.TRI_INDEX ? iVer4 : iVer3;\n else if (iVer2 === i || iVer4 === i) iVer2 = iVer3;\n else if (iVer3 === i && iVer4 !== Utils.TRI_INDEX) iVer1 = iVer4;\n\n if (vertTagFlags[iVer1] !== tagFlag) {\n vertRingVert[vrvStart + (vrvCount++)] = iVer1;\n vertTagFlags[iVer1] = tagFlag;\n }\n\n if (vertTagFlags[iVer2] !== tagFlag) {\n vertRingVert[vrvStart + (vrvCount++)] = iVer2;\n vertTagFlags[iVer2] = tagFlag;\n }\n }\n\n vrvStartCount[i * 2] = vrvStart;\n vrvStartCount[i * 2 + 1] = vrvCount;\n vrvStart += vrvCount;\n if ((vrfEnd - vrfStart) !== vrvCount)\n vertOnEdge[i] = 1;\n }\n }", "title": "" }, { "docid": "f5010a5b407b1397eb7895042381a368", "score": "0.51022565", "text": "mapVertices( geometry ) {\n\t\tlet proxyGeometry = this.system.proxyEl.getObject3D( 'obj' ).geometry\n\t\tlet proxyVertices = proxyGeometry.vertices;\n\n\t\tconst firstProxyVertex = 0;\n\t\tconst lastProxyVertex = proxyVertices.length-1;\n\t\tconst doubled = this.system.total * 2;\n\n\t\tlet vertices = geometry.vertices;\n\t\tlet stepOrder = this.getStepOrder();\n\n\t\tvertices.forEach( ( vertex, id ) => {\n\t\t\tlet tick = parseInt( id / this.system.ticks );\n\t\t\tlet seed = 1; \t\t\t\t\t\t\t\t\t\t\t// offset for first sphere vertice\n\t\t\tseed += id % this.system.ticks;\t\t\t\t\t\t\t// actual tick position\n\t\t\tseed += this.system.ticks * ( stepOrder[ tick ] - 1 ); \t// ticks step order\n\n\t\t\t// account for innermost vertices\n\t\t\tseed = ( stepOrder[ tick ] === 0 ) ? firstProxyVertex : seed; // center vertice\n\t\t\tseed = ( stepOrder[ tick ] === doubled ) ? lastProxyVertex : seed;\n\n\t\t\tvertex.copy( proxyVertices[ seed ] );\n\t\t});\n\t\tgeometry.verticesNeedUpdate = true;\n\n\t}", "title": "" }, { "docid": "83bf03cec28c002eda094dd01739f1df", "score": "0.51012695", "text": "verticesInit() {\n for (var i = 0; i < this.numVertices; i++) {\n this.vertices[i] = []\n }\n }", "title": "" }, { "docid": "1d37ed7fde0ab0525d14d088290f281e", "score": "0.5097925", "text": "function splitLeft (modPoint, i1, i2, i3, v1, v2, v3, vertices, indices, dim, axis, modulo) {\n // first case is a standalone triangle\n let i12 = createVertex(modPoint, i1, i2, v1, v2, vertices, dim, axis)\n let i13 = createVertex(modPoint, i1, i3, v1, v3, vertices, dim, axis)\n indices.push(i1, i12, i13)\n modPoint -= modulo\n if (v2 > v3) {\n // create lines up to i2\n while (modPoint > v2) {\n // next triangles are i13->i12->nexti13 and nexti13->i12->nexti12 so store in necessary order\n indices.push(i13, i12)\n i13 = createVertex(modPoint, i1, i3, v1, v3, vertices, dim, axis)\n indices.push(i13, i13, i12)\n i12 = createVertex(modPoint, i1, i2, v1, v2, vertices, dim, axis)\n indices.push(i12)\n // increment\n modPoint -= modulo\n }\n // add v2 triangle if necessary\n indices.push(i13, i12, i2)\n // return the remaining triangle\n return [i13, i2, i3]\n } else {\n // create lines up to i2\n while (modPoint > v3) {\n // next triangles are i13->i12->nexti13 and nexti13->i12->nexti12 so store in necessary order\n indices.push(i13, i12)\n i13 = createVertex(modPoint, i1, i3, v1, v3, vertices, dim, axis)\n indices.push(i13, i13, i12)\n i12 = createVertex(modPoint, i1, i2, v1, v2, vertices, dim, axis)\n indices.push(i12)\n // increment\n modPoint -= modulo\n }\n // add v3 triangle if necessary\n indices.push(i13, i12, i3)\n // return the remaining triangle\n return [i3, i12, i2]\n }\n}", "title": "" }, { "docid": "631de1dd3e411e68af52f6cdd9f36f32", "score": "0.50886196", "text": "function loadTriangles(lights,eye) {\n var inputTriangles = getJSONFile(INPUT_TRIANGLES_URL,\"triangles\");\n // var inputTriangles = triangleJson();\n if (inputTriangles != String.null) { \n var whichSetVert; // index of vertex in current triangle set\n var whichSetTri; // index of triangle in current triangle set\n var vtxToAdd = []; // vtx coords to add to the coord array\n var indexOffset = vec3.create(); // the index offset for the current set\n var triToAdd = vec3.create(); // tri indices to add to the index array\n var clrToAdd = vec3.create();\n\n triNum = inputTriangles.length;\n\n for (var whichSet=0; whichSet<inputTriangles.length; whichSet++) {\n vec3.set(indexOffset,vtxBufferSize,vtxBufferSize,vtxBufferSize); // update vertex offset\n //get vertices,material\n var ka = inputTriangles[whichSet].material.ambient;\n var kd = inputTriangles[whichSet].material.diffuse;\n var ks = inputTriangles[whichSet].material.specular;\n var n = inputTriangles[whichSet].material.n;\n var center =[0,0,0];\n verLength = inputTriangles[whichSet].vertices.length;\n\n\n //compute triangle center\n for (whichSetVert=0; whichSetVert<verLength; whichSetVert++) {\n var coord = inputTriangles[whichSet].vertices[whichSetVert];\n center[0] += coord[0]/verLength;\n center[1] += coord[1]/verLength;\n center[2] += coord[2]/verLength;\n }\n\n //change selected color\n if(whichSet == selectTri){\n n+=selectN;\n n%=21;\n ka = addColor(ka,selectA);\n kd = addColor(kd,selectD);\n ks = addColor(ks,selectS);\n // center[0] += tranX;\n // center[1] += tranY;\n // center[2] += tranZ;\n }\n // center = translate(center,tranX,tranY,tranZ);//move selected model when press key\n for (whichSetVert=0; whichSetVert<verLength; whichSetVert++) {\n\n var coord = inputTriangles[whichSet].vertices[whichSetVert];\n if(whichSet == selectTri){ \n coord = scale(coord,center,1.2);//highlight selected triangle\n coord = rotate(coord,center,rotMatrix);//rotate selected triangle when press key\n coord = translate(coord,-tranX,-tranY,-tranZ);\n }\n\n coord = rotate(coord,lookAt,viewMatrix); //rotate view when press key\n vtxToAdd = transform(coord,eye); //\n var normal = inputTriangles[whichSet].normals[whichSetVert];\n\n for(vtxIndex=0; vtxIndex<vtxToAdd.length; vtxIndex++){\n coordArray.push(vtxToAdd[vtxIndex]); //push vertices to buffer\n }\n var color = lighting(eye,lights,normal,coord,ka,kd,ks,n,blinn);\n coordArray.push(color[0],color[1],color[2]);//push color to buffer\n vtxBufferSize +=1;\n\n } // end for vertices in set\n \n // set up the triangle index array, adjusting indices across sets\n for (whichSetTri=0; whichSetTri<inputTriangles[whichSet].triangles.length; whichSetTri++) {\n vec3.add(triToAdd,indexOffset,inputTriangles[whichSet].triangles[whichSetTri]);\n for(triIndex=0; triIndex<vtxToAdd.length; triIndex++){\n indexArray.push(triToAdd[triIndex]);\n triBufferSize += 1; //the triangle index buffer may duplicate(different triangle use the same vertex)\n }\n } // end for triangles in set\n\n } // end for each triangle set \n\n } // end if triangles found\n} // end load triangles", "title": "" }, { "docid": "d7fe7ad2005921504b472df34018fc2d", "score": "0.5087655", "text": "function rotate() {\n\n var length = thePlayer.block.shape.length;\n var transpose = new Array(length);\n var rotated = new Array(length);\n\n for (var i = 0; i < length; i++) {\n transpose[i] = new Array(length);\n rotated[i] = new Array(length);\n }\n\n for (var i = 0; i < length; i++) {\n for (var j = 0; j < length; j++) \n transpose[j][i] = thePlayer.block.shape[i][j];\n }\n\n for (var i = 0; i < length; i++) {\n for (var j = 0; j < length; j++) \n rotated[i][j] = transpose[i][length-j-1];\n }\n\n if (thePlayer.block.id == 5 || thePlayer.block.id == 6) {\n if (rotated[0][0] == 0 && rotated[0][1] == 0 && rotated[0][2] == 0) {\n rotated[0] = rotated[1];\n rotated[1] = rotated[2];\n rotated[2] = [0,0,0];\n }\n }\n\n if (thePlayer.block.id == 7 && rotated[0][2] == 1 && rotated[1][2] == 1 &&\n rotated[2][2] == 1 && rotated[3][2] == 1) {\n\n rotated = [\n [0, 1, 0, 0],\n [0, 1, 0, 0],\n [0, 1, 0, 0],\n [0, 1, 0, 0],\n ]\n }\n\n return rotated;\n\n}", "title": "" }, { "docid": "f9ddd96cd637983114631c886d6fa1e0", "score": "0.50873905", "text": "function makePlane(u, v, w, su, sv, nu, nv, pw, flipu, flipv) {\n var vertShift = vertices.length;\n for(var j=0; j<=nv; ++j) {\n for(var i=0; i<=nu; ++i) {\n var vert = new Vec3();\n vert[u] = (-su/2 + i*su/nu) * flipu;\n vert[v] = (-sv/2 + j*sv/nv) * flipv;\n vert[w] = pw;\n vertices.push(vert);\n\n var texCoord = new Vec2(i/nu, j/nv);\n texCoords.push(texCoord);\n\n var normal = new Vec3();\n normal[u] = 0;\n normal[v] = 0;\n normal[w] = pw/Math.abs(pw);\n normals.push(normal);\n }\n }\n for(var j=0; j<nv; ++j) {\n for(var i=0; i<nu; ++i) {\n var n = vertShift + j * (nu + 1) + i;\n var face = new Face4(n, n + nu + 1, n + nu + 2, n + 1);\n faces.push(face);\n }\n }\n }", "title": "" }, { "docid": "9672b06dd7fc23cbce0a40f530516b47", "score": "0.50686085", "text": "addVertex(v)\n{\n this.AdjList.set(v, []);\n}", "title": "" }, { "docid": "865b865b61676f538f4cfe41d56ec994", "score": "0.5061794", "text": "function createCubeMesh_V1() {\n\n // Repeated Vertices --- No indices !!\n // 6 vertices per cube face\n // 2 triangles per cube face\n\n // For each vertex: coordinates and normal vector\n\n const vertices = [\n // front\n { pos: [-1, -1, 1], norm: [0, 0, 1] },\n { pos: [1, -1, 1], norm: [0, 0, 1] },\n { pos: [-1, 1, 1], norm: [0, 0, 1] },\n\n { pos: [-1, 1, 1], norm: [0, 0, 1] },\n { pos: [1, -1, 1], norm: [0, 0, 1] },\n { pos: [1, 1, 1], norm: [0, 0, 1] },\n // right\n { pos: [1, -1, 1], norm: [1, 0, 0] },\n { pos: [1, -1, -1], norm: [1, 0, 0] },\n { pos: [1, 1, 1], norm: [1, 0, 0] },\n\n { pos: [1, 1, 1], norm: [1, 0, 0] },\n { pos: [1, -1, -1], norm: [1, 0, 0] },\n { pos: [1, 1, -1], norm: [1, 0, 0] },\n // back\n { pos: [1, -1, -1], norm: [0, 0, -1] },\n { pos: [-1, -1, -1], norm: [0, 0, -1] },\n { pos: [1, 1, -1], norm: [0, 0, -1] },\n\n { pos: [1, 1, -1], norm: [0, 0, -1] },\n { pos: [-1, -1, -1], norm: [0, 0, -1] },\n { pos: [-1, 1, -1], norm: [0, 0, -1] },\n // left\n { pos: [-1, -1, -1], norm: [-1, 0, 0] },\n { pos: [-1, -1, 1], norm: [-1, 0, 0] },\n { pos: [-1, 1, -1], norm: [-1, 0, 0] },\n\n { pos: [-1, 1, -1], norm: [-1, 0, 0] },\n { pos: [-1, -1, 1], norm: [-1, 0, 0] },\n { pos: [-1, 1, 1], norm: [-1, 0, 0] },\n // top\n { pos: [1, 1, -1], norm: [0, 1, 0] },\n { pos: [-1, 1, -1], norm: [0, 1, 0] },\n { pos: [1, 1, 1], norm: [0, 1, 0] },\n\n { pos: [1, 1, 1], norm: [0, 1, 0] },\n { pos: [-1, 1, -1], norm: [0, 1, 0] },\n { pos: [-1, 1, 1], norm: [0, 1, 0] },\n // bottom\n { pos: [1, -1, 1], norm: [0, -1, 0] },\n { pos: [-1, -1, 1], norm: [0, -1, 0] },\n { pos: [1, -1, -1], norm: [0, -1, 0] },\n\n { pos: [1, -1, -1], norm: [0, -1, 0] },\n { pos: [-1, -1, 1], norm: [0, -1, 0] },\n { pos: [-1, -1, -1], norm: [0, -1, 0] },\n ];\n\n const positions = [];\n const normals = [];\n\n for (const vertex of vertices) {\n positions.push(...vertex.pos);\n normals.push(...vertex.norm);\n }\n\n // BufferGeometry\n const geometry = new THREE.BufferGeometry();\n const positionNumComponents = 3;\n const normalNumComponents = 3;\n geometry.setAttribute(\n 'position',\n new THREE.BufferAttribute(new Float32Array(positions), positionNumComponents));\n geometry.setAttribute(\n 'normal',\n new THREE.BufferAttribute(new Float32Array(normals), normalNumComponents));\n\n const material = new THREE.MeshPhongMaterial({ color: 'rgb(200, 0, 0)' });\n\n const mesh = new THREE.Mesh(geometry, material);\n return mesh;\n}", "title": "" }, { "docid": "4ddabb1323a09bca73f41e82905dd71a", "score": "0.50540835", "text": "function addTriangleVertexForIndices(vIndex, tIndex, nIndex){\r\n //add x,y, and z coordinates\r\n meshVertices.push(vertices[3*vIndex], vertices[3*vIndex+1], vertices[3*vIndex+2]);\r\n //add s and t texture coordinates\r\n meshTexCoords.push(textureCoords[3*tIndex],textureCoords[3*tIndex+1]);\r\n //add x,y and z components of normal\r\n meshNormals.push(normals[3*nIndex], normals[3*nIndex+1], normals[3*nIndex+2]);\r\n}", "title": "" }, { "docid": "d3a98939481b26762ad20e85beb08ce4", "score": "0.50413555", "text": "function makePlane(u, v, w, su, sv, nu, nv, pw, flipu, flipv) {\n var vertShift = vertexIndex;\n for (var j=0; j<=nv; j++) {\n for (var i=0; i<=nu; i++) {\n vert = vertices[vertexIndex] = Vec3.create();\n vert[u] = (-su / 2 + i * su / nu) * flipu;\n vert[v] = (-sv / 2 + j * sv / nv) * flipv;\n vert[w] = pw;\n normal = normals[vertexIndex] = Vec3.create();\n normal[u] = 0;\n normal[v] = 0;\n normal[w] = pw / Math.abs(pw);\n texCoord = texCoords[vertexIndex] = Vec2.create();\n texCoord.x = i / nu;\n texCoord.y = 1.0 - j / nv;\n ++vertexIndex;\n }\n }\n for (var j=0; j<=nv-1; j++) {\n for (var i=0; i<=nu-1; i++) {\n var n = vertShift + j * (nu + 1) + i;\n faces.push([n, n + nu + 1, n + nu + 2, n + 1]);\n }\n }\n }", "title": "" }, { "docid": "800f0cd40b581ad850a36479aa7b92ba", "score": "0.5035169", "text": "function rotateVertex(vertex, theta) {\n var x = vertex[0];\n var y = vertex[1];\n sintheta = Math.sin(theta);\n costheta = Math.cos(theta);\n return vec2(x * costheta - y * sintheta, x * sintheta + y * costheta);\n}", "title": "" }, { "docid": "cee422718c97eb3fa83051d81ca266df", "score": "0.50350946", "text": "function loadTriangles() {\n inputTriangles = getJSONFile(INPUT_TRIANGLES_URL,\"triangles\");\n\n if (inputTriangles != String.null) { \n var whichSetVert; // index of vertex in current triangle set\n var whichSetTri; // index of triangle in current triangle set\n 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 numTriangleSets = inputTriangles.length;\n for (var whichSet=0; whichSet<numTriangleSets; whichSet++) {\n vec3.set(indexOffset,vtxBufferSize,vtxBufferSize,vtxBufferSize); // update vertex offset\n inputTriangles[whichSet].transforms = [];\n \n // set up the vertex coord array\n inputTriangles[whichSet].coordArray = [];\n inputTriangles[whichSet].colorArray = [];\n inputTriangles[whichSet].normalArray = [];\n var vertexTotalX = 0;\n var vertexTotalY = 0;\n var vertexTotalZ = 0;\n var numVertex = 0;\n for (whichSetVert=0; whichSetVert<inputTriangles[whichSet].vertices.length; whichSetVert++) {\n vtxToAdd = inputTriangles[whichSet].vertices[whichSetVert];\n inputTriangles[whichSet].coordArray.push(vtxToAdd[0],vtxToAdd[1],vtxToAdd[2]);\n\n vertexTotalX += vtxToAdd[0];\n vertexTotalY += vtxToAdd[1];\n vertexTotalZ += vtxToAdd[2];\n numVertex++;\n\n //determine the color of this vertex\n var c = getColorTri( inputTriangles[whichSet] );\n inputTriangles[whichSet].colorArray.push( c[0], c[1], c[2], c[3] );\n\n //normal\n inputTriangles[whichSet].normalArray.push( inputTriangles[whichSet].normals[whichSetVert][0], inputTriangles[whichSet].normals[whichSetVert][1], inputTriangles[whichSet].normals[whichSetVert][2] );\n\n inputTriangles[whichSet].ambient = vec3.fromValues( inputTriangles[whichSet].material.ambient[0], inputTriangles[whichSet].material.ambient[1], inputTriangles[whichSet].material.ambient[2] );\n inputTriangles[whichSet].specular = vec3.fromValues( inputTriangles[whichSet].material.specular[0], inputTriangles[whichSet].material.specular[1], inputTriangles[whichSet].material.specular[2] );\n inputTriangles[whichSet].diffuse = vec3.fromValues( inputTriangles[whichSet].material.diffuse[0], inputTriangles[whichSet].material.diffuse[1], inputTriangles[whichSet].material.diffuse[2] );\n inputTriangles[whichSet].highlight = vec3.fromValues( inputTriangles[whichSet].material.n, inputTriangles[whichSet].material.n, inputTriangles[whichSet].material.n );\n } // end for vertices in set\n\n /*//example on using the built in transformation list thing i made:\n var bob = mat4.create();\n mat4.fromZRotation( bob, 45 );\n inputTriangles[whichSet].transforms.push( bob );\n */\n\n //save the center location of this set\n inputTriangles[whichSet].center = vec3.fromValues( vertexTotalX / numVertex, vertexTotalY / numVertex, vertexTotalZ / numVertex );\n\n // send the vertex coords to webGL\n vertexBuffers[whichSet] = gl.createBuffer(); // init empty vertex coord buffer for current set\n gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffers[whichSet]); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(inputTriangles[whichSet].coordArray),gl.STATIC_DRAW); // coords to that buffer\n\n // send the vertex normals to webGL\n normalBuffers[whichSet] = gl.createBuffer(); // init empty vertex coord buffer for current set\n gl.bindBuffer(gl.ARRAY_BUFFER,normalBuffers[whichSet]); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(inputTriangles[whichSet].normalArray),gl.STATIC_DRAW); // coords to that buffer\n\n // send the colors to webgl\n colorBuffers[whichSet] = gl.createBuffer(); // init empty vertex coord buffer for current set\n gl.bindBuffer(gl.ARRAY_BUFFER,colorBuffers[whichSet]); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(inputTriangles[whichSet].colorArray),gl.STATIC_DRAW); // coords to that buffer\n \n // set up the triangle index array, adjusting indices across sets\n inputTriangles[whichSet].indexArray = []; // create a list of tri indices for this tri set\n triSetSizes[whichSet] = inputTriangles[whichSet].triangles.length;\n for (whichSetTri=0; whichSetTri<triSetSizes[whichSet]; whichSetTri++) {\n triToAdd = inputTriangles[whichSet].triangles[whichSetTri];\n inputTriangles[whichSet].indexArray.push(triToAdd[0],triToAdd[1],triToAdd[2]);\n } // end for triangles in set\n\n // send the triangle indices to webGL\n triangleBuffers[whichSet] = gl.createBuffer(); // init empty triangle index buffer for current tri set\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triangleBuffers[whichSet]); // activate that buffer\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,new Uint16Array(inputTriangles[whichSet].indexArray),gl.STATIC_DRAW); // indices to that buffer\n\n vtxBufferSize += inputTriangles[whichSet].vertices.length; // total number of vertices\n triBufferSize += inputTriangles[whichSet].triangles.length; // total number of tris\n } // end for each triangle set \n triBufferSize *= 3; // now total number of indices\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 /*\n // send the vertex coords to webGL\n vertexBuffer = gl.createBuffer(); // init empty vertex coord buffer\n gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(coordArray),gl.STATIC_DRAW); // coords to that buffer\n\n //send the colors to webgl\n colorBuffer = gl.createBuffer(); // init empty vertex coord buffer\n gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array( colorArray ), gl.STATIC_DRAW); // coords to that buffer\n \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 } // end if triangles found\n\n //now for the fun of ellipsoids\n inputEllipsoids = getJSONFile(INPUT_SPHERES_URL,\"ellipsoids\");\n if (inputEllipsoids != String.null) {\n numEllipsoidSets = inputEllipsoids.length;\n\n for (var whichSet=numTriangleSets; whichSet<numEllipsoidSets+numTriangleSets; whichSet++) {\n //this is a dirty trick so that the position in inputTriangles i'm messing with actually exists\n inputTriangles.push( {\n \"material\": {\"ambient\": [0.1,0.1,0.1], \"diffuse\": [0.1,0.1,0.1], \"specular\": [0.1,0.1,0.1], \"n\":1}, \n \"vertices\": [[0.0, 0.0, 0.0],[0.1, 0.0, 0.0],[0.0,0.1,0.0]],\n \"normals\": [[0, 0, -1],[0, 0, -1],[0, 0, -1]],\n \"triangles\": [[0,1,2]] } );\n\n //anyway now for the other stuff\n inputTriangles[whichSet].transforms = [];\n\n var e = new Ellipsoid( inputEllipsoids[whichSet-numTriangleSets] );\n\n // set up the vertex coord array\n inputTriangles[whichSet].coordArray = e.getVertexData();\n inputTriangles[whichSet].colorArray = e.getColorData();\n inputTriangles[whichSet].normalArray = e.getNormalData();\n inputTriangles[whichSet].center = vec3.fromValues( 0, 0, 0 );\n vec3.copy( inputTriangles[whichSet].center, e.getPosition() );\n\n inputTriangles[whichSet].ambient = vec3.fromValues( inputEllipsoids[whichSet-numTriangleSets].ambient[0], inputEllipsoids[whichSet-numTriangleSets].ambient[1], inputEllipsoids[whichSet-numTriangleSets].ambient[2] );\n inputTriangles[whichSet].specular = vec3.fromValues( inputEllipsoids[whichSet-numTriangleSets].specular[0], inputEllipsoids[whichSet-numTriangleSets].specular[1],inputEllipsoids[whichSet-numTriangleSets].specular[2] );\n inputTriangles[whichSet].diffuse = vec3.fromValues( inputEllipsoids[whichSet-numTriangleSets].diffuse[0], inputEllipsoids[whichSet-numTriangleSets].diffuse[1], inputEllipsoids[whichSet-numTriangleSets].diffuse[2] );\n inputTriangles[whichSet].highlight = vec3.fromValues( inputEllipsoids[whichSet-numTriangleSets].n, inputEllipsoids[whichSet-numTriangleSets].n, inputEllipsoids[whichSet-numTriangleSets].n );\n\n // send the vertex coords to webGL\n vertexBuffers[whichSet] = gl.createBuffer(); // init empty vertex coord buffer for current set\n gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffers[whichSet]); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(inputTriangles[whichSet].coordArray),gl.STATIC_DRAW); // coords to that buffer\n\n // send the vertex normals to webGL\n normalBuffers[whichSet] = gl.createBuffer(); // init empty vertex coord buffer for current set\n gl.bindBuffer(gl.ARRAY_BUFFER,normalBuffers[whichSet]); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(inputTriangles[whichSet].normalArray),gl.STATIC_DRAW); // coords to that buffer\n\n // send the colors to webgl\n colorBuffers[whichSet] = gl.createBuffer(); // init empty vertex coord buffer for current set\n gl.bindBuffer(gl.ARRAY_BUFFER,colorBuffers[whichSet]); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(inputTriangles[whichSet].colorArray),gl.STATIC_DRAW); // coords to that buffer\n \n // set up the triangle index array?\n inputTriangles[whichSet].indexArray = e.getIndexData(); // create a list of tri indices for this tri set\n triSetSizes[whichSet] = inputTriangles[whichSet].indexArray.length/3;\n\n // send the triangle indices to webGL\n triangleBuffers[whichSet] = gl.createBuffer(); // init empty triangle index buffer for current tri set\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triangleBuffers[whichSet]); // activate that buffer\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,new Uint16Array(inputTriangles[whichSet].indexArray),gl.STATIC_DRAW); // indices to that buffer\n \n }\n } //end if ellipsoids found\n\n} // end load triangles", "title": "" }, { "docid": "f5c7acf9c008127156e4bcd198508ec3", "score": "0.50336444", "text": "setVertexNormals(){\n\n // Loop through each 'square' of the terrain grid\n for(var i=0; i<this.div; i++){\n for(var j=0; j<this.div; j++){\n\n // vars used to get each traingles vertices\n var v1 = [0,0,0];\n var v2 = [0,0,0];\n var v3 = [0,0,0];\n\n // var used to compute the cross product\n var prod=[0,0,0];\n\n // get uppper triangles vertices\n this.getVertex(v1, i, j);\n this.getVertex(v2, i+1, j+1);\n this.getVertex(v3, i+1, j);\n\n //Get the cross product of (v2-v1)x(v3-v1)\n cross_prod(prod, [v2[0]-v1[0], v2[1]-v1[1], v2[2]-v1[2]], [v3[0]-v1[0], v3[1]-v1[1], v3[2]-v1[2]]);\n\n // get index of each vertex in nBuffer\n var idx1 = 3*(i*(this.div+1)+j);\n var idx2 = 3*((i+1)*(this.div+1)+(j+1));\n var idx3 = 3*((i+1)*(this.div+1)+j);\n\n // add N to the nbuffer for each vertex\n this.nBuffer[idx1]+=prod[0]; //v1.x\n this.nBuffer[idx1+1]+=prod[1]; //v1.y\n this.nBuffer[idx1+2]+=prod[2]; //v1.z\n this.nBuffer[idx2]+=prod[0]; //v2.x\n this.nBuffer[idx2+1]+=prod[1]; //v2.y\n this.nBuffer[idx2+2]+=prod[2]; //v2.z\n this.nBuffer[idx3]+=prod[0]; //v3.x\n this.nBuffer[idx3+1]+=prod[1]; //v3.y\n this.nBuffer[idx3+2]+=prod[2]; //v3.z\n\n // get the lower triangles vertices\n this.getVertex(v1, i, j);\n this.getVertex(v2, i, j+1);\n this.getVertex(v3, i+1, j+1);\n\n //Get the cross product of (v2-v1)x(v3-v1)\n cross_prod(prod, [v2[0]-v1[0], v2[1]-v1[1], v2[2]-v1[2]], [v3[0]-v1[0], v3[1]-v1[1], v3[2]-v1[2]]);\n\n // get index of each vertex in nBuffer\n var idx1 = 3*(i*(this.div+1)+j);\n var idx2 = 3*(i*(this.div+1)+(j+1));\n var idx3 = 3*((i+1)*(this.div+1)+j+1);\n\n // add N to the nbuffer for each vertex\n this.nBuffer[idx1]+=prod[0]; //v1.x\n this.nBuffer[idx1+1]+=prod[1]; //v1.y\n this.nBuffer[idx1+2]+=prod[2]; //v1.z\n this.nBuffer[idx2]+=prod[0]; //v2.x\n this.nBuffer[idx2+1]+=prod[1]; //v2.y\n this.nBuffer[idx2+2]+=prod[2]; //v2.z\n this.nBuffer[idx3]+=prod[0]; //v3.x\n this.nBuffer[idx3+1]+=prod[1]; //v3.y\n this.nBuffer[idx3+2]+=prod[2]; //v3.z\n }\n }\n\n // Then normalize each normal vector in the nBuffer\n for(var x=0; x<=this.div; x++){\n for(var y=0; y<=this.div; y++){\n // get the curren idx\n var idx = 3*(x*(this.div+1)+y);\n //calculate magnitude\n var magnitude = Math.sqrt(this.nBuffer[idx]*this.nBuffer[idx]+this.nBuffer[idx+1]*this.nBuffer[idx+1]+this.nBuffer[idx+2]*this.nBuffer[idx+2]);\n //normalize x,y,x components\n this.nBuffer[idx]=this.nBuffer[idx]/magnitude;\n this.nBuffer[idx+1]=this.nBuffer[idx+1]/magnitude;\n this.nBuffer[idx+2]=this.nBuffer[idx+2]/magnitude;\n }\n }\n}", "title": "" }, { "docid": "ba72ed5a667855b419fd958b5fa06fdd", "score": "0.50334924", "text": "generateTriangles() {\r\n var deltaX = (this.maxX - this.minX) / this.div;\r\n var deltaY = (this.maxY - this.minY) / this.div;\r\n \r\n for (var i = 0; i <= this.div; i++) {\r\n for (var j = 0; j <= this.div; j++) {\r\n this.vBuffer.push(this.minX + deltaX * j);\r\n this.vBuffer.push(this.minY + deltaY * i);\r\n this.vBuffer.push(0);\r\n \r\n this.nBuffer.push(0);\r\n this.nBuffer.push(0);\r\n this.nBuffer.push(1);\r\n }\r\n }\r\n \r\n for (var i = 0; i < this.div; i++) {\r\n for (var j = 0; j < this.div; j++) {\r\n var vid = i * (this.div + 1) + j;\r\n this.fBuffer.push(vid);\r\n this.fBuffer.push(vid + 1);\r\n this.fBuffer.push(vid + this.div + 1);\r\n \r\n this.fBuffer.push(vid + 1);\r\n this.fBuffer.push(vid + 1 + this.div + 1);\r\n this.fBuffer.push(vid + this.div + 1);\r\n }\r\n }\r\n \r\n this.numVertices = this.vBuffer.length/3;\r\n this.numFaces = this.fBuffer.length/3;\r\n }", "title": "" }, { "docid": "54daf9b2eac434f8254b5a400fac3141", "score": "0.50306576", "text": "function addPlaneShape( polytope ) {\n\n var polytopeVertexes = polytope.vertexes();\n\n function addVertexes() {\n var shapeMaterial, shapeGeometry, shape;\n\n scene.remove( scene.getObjectByName( 'plane-vertexes' ) );\n\n shapeGeometry = new THREE.Geometry();\n polytopeVertexes = sphericalizeVertices( polytopeVertexes );\n polytopeVertexes = applyRotationToVertices( polytopeVertexes );\n polytopeVertexes = applyStereographicProjection( polytopeVertexes );\n // shapeGeometry.vertices = applyStereographicProjection( polytopeVertexes );\n shapeGeometry.vertices = polytopeVertexes;\n\n planeMaterial = new THREE.PointsMaterial( {\n size: 0.15,\n map: blue_vertex,\n alphaTest: 0.1,\n transparent: true,\n sizeAttenuation: true,\n } );\n\n shape = new THREE.Points( shapeGeometry, planeMaterial );\n shape.name = 'plane-vertexes';\n\n scene.add( shape );\n\n }\n\n function drawLines() {\n\n var vertexPairs = [];\n // TOP 4\n vertexPairs.push( [polytopeVertexes[0], polytopeVertexes[1]] );\n vertexPairs.push( [polytopeVertexes[1], polytopeVertexes[2]] );\n vertexPairs.push( [polytopeVertexes[2], polytopeVertexes[3]] );\n vertexPairs.push( [polytopeVertexes[0], polytopeVertexes[3]] );\n\n // VERTICAL 4\n vertexPairs.push( [polytopeVertexes[0], polytopeVertexes[4]] );\n vertexPairs.push( [polytopeVertexes[1], polytopeVertexes[5]] );\n vertexPairs.push( [polytopeVertexes[2], polytopeVertexes[6]] );\n vertexPairs.push( [polytopeVertexes[3], polytopeVertexes[7]] );\n\n // BOTTOM 4\n vertexPairs.push( [polytopeVertexes[4], polytopeVertexes[5]] );\n vertexPairs.push( [polytopeVertexes[5], polytopeVertexes[6]] );\n vertexPairs.push( [polytopeVertexes[6], polytopeVertexes[7]] );\n vertexPairs.push( [polytopeVertexes[4], polytopeVertexes[7]] );\n\n for (var i=0; i<vertexPairs.length; i++) {\n createLine( vertexPairs[i], i, true );\n }\n }\n\n drawLines();\n addVertexes();\n}", "title": "" }, { "docid": "fb2b77ab6c132e438c144a1d71af2f51", "score": "0.50265205", "text": "function triangulate(vertices) {\n\t\tif (vertices.length < 3) {return;}\n\t\tconsole.log (\"triangulate\")\n\t\t/*for (var it in mainController.triangles) {\n\t\t\tcachedTriangles[mainController.triangles[it].pointsString] = mainController.triangles[it]\n\t\t}*/\n\n\t\tvar triangles = []; // mainController.triangles ? mainController.triangles : []; //\n\n\t\tvertices.sort(function(a, b) {\n\t\t\tif (a.y > b.y) {\n\t\t\t\treturn 1\n\t\t\t} else {\n\t\t\t\treturn -1\n\t\t\t}\n\t\t});\n\n\t\tvar miny = vertices[0].y;\n\t\tvar maxy = vertices[vertices.length-1].y;\n\n\t\tvertices.sort(function(a, b) {\n\t\t\tif (a.x > b.x) {\n\t\t\t\treturn 1\n\t\t\t} else {\n\t\t\t\treturn -1\n\t\t\t}\n\t\t});\n\n\t\tvar minx = vertices[0].x;\n\t\tvar maxx = vertices[vertices.length-1].x;\n\n\t\t//\n\t\t// First, create a \"supertriangle\" that bounds all vertices\n\t\t//\n\t\tvar st = createBoundingTriangle(vertices, minx, miny, maxx, maxy);\n\n\t\ttriangles.push(st);\n\n\n\t\tvar x1 = minx + (maxx - minx)/3\n\t\tvar x2 = 2 * (maxx - minx)/3\n\n\t\t//\n\t\t// Next, begin the triangulation one vertex at a time\n\t\t//\n\n\t\tfor (var i in vertices) {\n\t\t\t// NOTE: This is O(n^2) - can be optimized by sorting vertices\n\t\t\t// along the x-axis and only considering triangles that have\n\t\t\t// potentially overlapping circumcircles\n\n\t\t\taddVertex(vertices[i], triangles);\n\t\t\t\n\t\t\t/*triangles.sort(function(a, b) {\n\t\t\t\treturn (a.center.x - b.center.x)\n\t\t\t});*/\n\t\t}\n\n\t\t//\n\t\t// Remove triangles that shared edges with \"supertriangle\"\n\t\t//\n\t\tvar tempArray = [];\n\t\tfor (var i in triangles) {\n\t\t\tvar triangle = triangles[i];\n\t\t\t\n\t\t\tif (triangles[i]) {\n\t\t\t\tif(!triangle.OnEdge(st)) {\n\t\t\t\t\ttempArray.push(triangles[i]); //Get a clean array of non-null triangles\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn tempArray;\n\n\t}", "title": "" }, { "docid": "c641e31a3481afb824c95bd8afb68f4f", "score": "0.502565", "text": "constructor() // etc) smaller and more cache friendly.\r\n {\r\n super(\"positions\", \"normals\"); \r\n // Name the values we'll define per each vertex.\r\n //order of corners: bottm left,right and upper left, right\r\n this.positions.push(...Vec.cast([-0.05, 0, 1.5], [0.05, 0, 1.5], [-0.01, 2, 1.5], [0.01, 2, 1.5])); // Specify the 4 square corner locations.\r\n this.normals.push(...Vec.cast([0, 0, 1], [0, 0, 1], [0, 0, 1], [0, 0, 1])); // Match those up with normal vectors.\r\n //this.texture_coords.push(...Vec.cast([0, 0], [1, 0], [0, 1], [1, 1])); // Draw a square in texture coordinates too.\r\n this.indices.push(0, 1, 2, 1, 3, 2); // Two triangles this time, indexing into four distinct vertices.\r\n }", "title": "" }, { "docid": "bf5511035fa56d2a256977546268eedb", "score": "0.5022913", "text": "function vertexCallback(data, polyVertArray) {\n // console.log(data[0], data[1]);\n polyVertArray[polyVertArray.length] = data[0];\n polyVertArray[polyVertArray.length] = data[1];\n }", "title": "" }, { "docid": "0cd1387017a10b04389d9492cc5c463d", "score": "0.5017072", "text": "function generateCube()\n{\n // RHR traversal from vertex 1 to 0 to 3 to 2, only colors one side\n quad( 1, 0, 3, 2 );\n quad( 2, 3, 7, 6 );\n quad( 3, 0, 4, 7 );\n quad( 4, 5, 6, 7 );\n quad( 5, 4, 0, 1 );\n\n quad( 6, 5, 1, 2 );\n}", "title": "" }, { "docid": "c50f4fa197cca1723d5af158de8c760e", "score": "0.501692", "text": "_generate() {\n\n\t\tthis.faces.length = 0;\n\n\t\tthis._computeInitialHull();\n\n\t\tlet vertex;\n\n\t\twhile ( vertex = this._nextVertexToAdd() ) {\n\n\t\t\tthis._addVertexToHull( vertex );\n\n\t\t}\n\n\t\tthis._updateFaces();\n\n\t\tthis._postprocessHull();\n\n\t\tthis._reset();\n\n\t\treturn this;\n\n\t}", "title": "" }, { "docid": "93c1d8d6038621e09790dfd19ff74872", "score": "0.5015082", "text": "function makeCube(save){\r\n // Create a cube\r\n // v6----- v5\r\n // /| /|\r\n // v1------v0|\r\n // | | | |\r\n // | |v7---|-|v4\r\n // |/ |/\r\n // v2------v3\r\n\r\n var tempCubeVerts = new Float32Array([\r\n // Vertex coordinates and color\r\n //--POSITION--------------NORMAL----------//\r\n // front\r\n 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, // v0 White\r\n -1.0, 1.0, 1.0, 0.0, 0.0, 1.0, // v1 Magenta\r\n -1.0, -1.0, 1.0, 0.0, 0.0, 1.0, // v2 Red\r\n 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, // v0 White\r\n -1.0, -1.0, 1.0, 0.0, 0.0, 1.0, // v2 Red\r\n 1.0, -1.0, 1.0, 0.0, 0.0, 1.0, // v3 Yellow\r\n\r\n // right\r\n 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, // v0 White\r\n 1.0, -1.0, 1.0, 1.0, 0.0, 0.0, // v3 Yellow\r\n 1.0, -1.0, -1.0, 1.0, 0.0, 0.0, // v4 Green\r\n 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, // v0 White\r\n 1.0, -1.0, -1.0, 1.0, 0.0, 0.0, // v4 Green\r\n 1.0, 1.0, -1.0, 1.0, 0.0, 0.0, // v5 Cyan\r\n\r\n // up\r\n 1.0, 1.0, 1.0, 0.0, 1.0, 0.0, // v0 White\r\n 1.0, 1.0, -1.0, 0.0, 1.0, 0.0, // v5 Cyan\r\n -1.0, 1.0, -1.0, 0.0, 1.0, 0.0, // v6 Blue\r\n 1.0, 1.0, 1.0, 0.0, 1.0, 0.0, // v0 White\r\n -1.0, 1.0, -1.0, 0.0, 1.0, 0.0, // v6 Blue\r\n -1.0, 1.0, 1.0, 0.0, 1.0, 0.0, // v1 Magenta\r\n\r\n // left\r\n -1.0, 1.0, 1.0, -1.0, 0.0, 0.0, // v1 Magenta\r\n -1.0, 1.0, -1.0, -1.0, 0.0, 0.0, // v6 Blue\r\n -1.0, -1.0, -1.0, -1.0, 0.0, 0.0, // v7 Black\r\n -1.0, 1.0, 1.0, -1.0, 0.0, 0.0, // v1 Magenta\r\n -1.0, -1.0, -1.0, -1.0, 0.0, 0.0, // v7 Black\r\n -1.0, -1.0, 1.0, -1.0, 0.0, 0.0, // v2 Red\r\n\r\n // down\r\n -1.0, -1.0, -1.0, 0.0,-1.0, 0.0, // v7 Black\r\n 1.0, -1.0, -1.0, 0.0,-1.0, 0.0, // v4 Green\r\n 1.0, -1.0, 1.0, 0.0,-1.0, 0.0, // v3 Yellow\r\n -1.0, -1.0, -1.0, 0.0,-1.0, 0.0, // v7 Black\r\n 1.0, -1.0, 1.0, 0.0,-1.0, 0.0, // v3 Yellow\r\n -1.0, -1.0, 1.0, 0.0,-1.0, 0.0, // v2 Red\r\n\r\n // back\r\n 1.0, -1.0, -1.0, 0.0, 0.0,-1.0, // v4 Green\r\n -1.0, -1.0, -1.0, 0.0, 0.0,-1.0, // v7 Black\r\n -1.0, 1.0, -1.0, 0.0, 0.0,-1.0, // v6 Blue\r\n 1.0, -1.0, -1.0, 0.0, 0.0,-1.0, // v4 Green\r\n -1.0, 1.0, -1.0, 0.0, 0.0,-1.0, // v6 Blue\r\n 1.0, 1.0, -1.0, 0.0, 0.0,-1.0 // v5 Cyan\r\n ]);\r\n\r\ncubeVerts = Float32Concat(cubeVerts,tempCubeVerts);\r\ncubeVertsToDraw = cubeVerts.length/numCubes;\r\n\r\nreturn tempCubeVerts;\r\n}", "title": "" }, { "docid": "798571847513b1f166e01136d82579b9", "score": "0.50099653", "text": "makeVertexTemplate(style) {\n let i = 0;\n\n // position - x & y coords will be filled in per-vertex below\n this.vertex_template[i++] = 0;\n this.vertex_template[i++] = 0;\n this.vertex_template[i++] = style.z || 0;\n\n // layer order - w coord of 'position' attribute (for packing efficiency)\n this.vertex_template[i++] = this.scaleOrder(style.order);\n\n // normal\n this.vertex_template[i++] = 0;\n this.vertex_template[i++] = 0;\n this.vertex_template[i++] = 1 * 127;\n\n // color\n this.vertex_template[i++] = style.color[0] * 255;\n this.vertex_template[i++] = style.color[1] * 255;\n this.vertex_template[i++] = style.color[2] * 255;\n this.vertex_template[i++] = style.color[3] * 255;\n\n // selection color\n if (this.selection) {\n this.vertex_template[i++] = style.selection_color[0] * 255;\n this.vertex_template[i++] = style.selection_color[1] * 255;\n this.vertex_template[i++] = style.selection_color[2] * 255;\n this.vertex_template[i++] = style.selection_color[3] * 255;\n }\n\n // Add texture UVs to template only if needed\n if (this.texcoords) {\n this.vertex_template[i++] = 0;\n this.vertex_template[i++] = 0;\n }\n\n return this.vertex_template;\n }", "title": "" }, { "docid": "0c7779118b66070be326d3757c9b02bb", "score": "0.5009394", "text": "loadFromVerts() {\r\n let old = [0, 0];\r\n for (let sarea of this.sareas) {\r\n old[0] = sarea.size[0];\r\n old[1] = sarea.size[1];\r\n\r\n sarea.loadFromVerts();\r\n sarea.on_resize(old);\r\n sarea.setCSS();\r\n }\r\n\r\n this.setCSS();\r\n }", "title": "" }, { "docid": "998d394a669f07aa26989303743f09c5", "score": "0.5008626", "text": "init(){\n this.vertex.a = this.data.begin.copy();\n this.vertex.b = this.data.begin.copy();\n this.vertex.c = this.data.end.copy();\n this.vertex.d = this.data.end.copy();\n this.vertex.e = this.data.begin.copy();\n this.vertex.f = this.data.begin.copy();\n this.vertex.g = this.data.end.copy();\n this.vertex.h = this.data.end.copy();\n\n this.vertex.a.x += this.const.add;\n this.vertex.b.x -= this.const.add;\n this.vertex.c.x += this.const.add;\n this.vertex.d.x -= this.const.add;\n this.vertex.e.y += this.const.add;\n this.vertex.f.y -= this.const.add;\n this.vertex.g.y += this.const.add;\n this.vertex.h.y -= this.const.add;\n\n this.initHue();\n }", "title": "" }, { "docid": "746069e33ecee3500f53c024106fa73a", "score": "0.5005757", "text": "function loadTriangles() {\n var inputTriangles = getJSONFile(INPUT_TRIANGLES_URL,\"triangles\");\n if (inputTriangles != String.null) { \n var whichSetVert; // index of vertex in current triangle set\n var whichSetTri; // index of triangle in current triangle set\n var coordArray = []; // 1D array of vertex coords for WebGL\n var diffuseArray = [];\n var ambientArray = [];\n var specularArray = [];\n var normalsArray = [];\n var nArray = []\n var triangles = [];\n var prev = 0;\n var counter = 0;\n \n for (var whichSet=0; whichSet<inputTriangles.length; whichSet++) {\n for (whichSetVert=0; whichSetVert<inputTriangles[whichSet].vertices.length; whichSetVert++){\n coordArray = coordArray.concat(inputTriangles[whichSet].vertices[whichSetVert]);\n diffuseArray = diffuseArray.concat(inputTriangles[whichSet].material.diffuse);\n ambientArray = ambientArray.concat(inputTriangles[whichSet].material.ambient);\n specularArray = specularArray.concat(inputTriangles[whichSet].material.specular);\n normalsArray = normalsArray.concat(inputTriangles[whichSet].normals[whichSetVert]);\n nArray = nArray.concat(inputTriangles[whichSet].n);\n }\n } \n\n for (var whichSet=0; whichSet<inputTriangles.length; whichSet++) {\n for (whichSetTri=0; whichSetTri<inputTriangles[whichSet].triangles.length; whichSetTri++){\n for(var i = 0; i<inputTriangles[whichSet].triangles[whichSetTri].length;i++){\n indices = indices.concat(inputTriangles[whichSet].triangles[whichSetTri][i] + prev);\n }\n }\n prev = prev + inputTriangles[whichSet].vertices.length;\n }\n\n for (var whichSet=0; whichSet<inputTriangles.length; whichSet++){\n var tmp = vec3.create();\n for (whichSetVert=0; whichSetVert<inputTriangles[whichSet].vertices.length; whichSetVert++){\n vec3.add(tmp, tmp, inputTriangles[whichSet].vertices[whichSetVert]);\n modelMapper.push(counter);\n }\n vec3.scale(tmp, tmp, (1/inputTriangles[whichSet].vertices.length));\n modelCenters[counter] = tmp;\n counter++;\n }\n\n n_figures = counter;\n console.log(modelCenters);\n console.log(modelMapper);\n // send the vertex coords to webGL\n vertexBuffer = gl.createBuffer(); // init empty vertex coord buffer\n gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(coordArray),gl.STATIC_DRAW); // coords to that buffer\n\n Index_Buffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, Index_Buffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STATIC_DRAW);\n\n diffuse_Buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, diffuse_Buffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(diffuseArray), gl.STATIC_DRAW);\n\n ambient_Buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, ambient_Buffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(ambientArray), gl.STATIC_DRAW);\n\n specular_Buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, specular_Buffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(specularArray), gl.STATIC_DRAW);\n\n normals_Buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, normals_Buffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(normalsArray), gl.STATIC_DRAW);\n\n n_Buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, n_Buffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(nArray), gl.STATIC_DRAW);\n\n modelMapper_Buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, modelMapper_Buffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(modelMapper), gl.STATIC_DRAW);\n \n } // end if triangles found\n} // end load triangles", "title": "" }, { "docid": "e501438f3f88a4704e122d0c726c315a", "score": "0.5004114", "text": "drawVertexTraversals() {\n let drawer = this.drawer;\n if (this.vertTest.showResult) {\n let v = this.mesh.vertices[this.vertTest.vertexIndex];\n let p1 = glMatrix.vec3.create();\n let p1_2 = glMatrix.vec3.create();\n glMatrix.vec3.scale(p1, v.pos, DRAW_OFFSET);\n glMatrix.vec3.scale(p1_2, v.pos, 1.0/DRAW_OFFSET);\n drawer.drawPoint(p1, [1, 0, 0]);\n if (this.vertTest.type == 'getVertexNeighbors' || this.vertTest.type == 'getAttachedFaces') {\n let vs = v.getVertexNeighbors();\n for (let i = 0; i < vs.length; i++) {\n let p2 = glMatrix.vec3.create();\n let p2_2 = glMatrix.vec3.create();\n glMatrix.vec3.scale(p2, vs[i].pos, DRAW_OFFSET);\n glMatrix.vec3.scale(p2_2, vs[i].pos, 1.0/DRAW_OFFSET);\n drawer.drawLine(p1, p2, [0, 1, 1]);\n drawer.drawPoint(p2, [0, 1, 1]);\n drawer.drawLine(p1_2, p2_2, [0, 1, 1]);\n drawer.drawPoint(p2_2, [0, 1, 1]);\n }\n }\n if (this.vertTest.type == 'getAttachedFaces') {\n // Draw all attached faces in red\n let faces = v.getAttachedFaces();\n this.faceDrawer.clear();\n let idx2V = {}; // Convert from mesh index to new vertex in face drawer\n for (let i = 0; i < faces.length; i++) {\n const f = faces[i];\n const vs = f.getVertices();\n let face = [];\n let face_2 = [];\n for (let j = 0; j < vs.length; j++) {\n const v = vs[j];\n if (!(v.ID in idx2V)) {\n let p = glMatrix.vec3.create();\n let p_2 = glMatrix.vec3.create();\n glMatrix.vec3.scale(p, v.pos, DRAW_OFFSET);\n glMatrix.vec3.scale(p_2, v.pos, 1.0/DRAW_OFFSET);\n const vnew = this.faceDrawer.addVertex(p);\n const vnew_2 = this.faceDrawer.addVertex(p_2);\n idx2V[v.ID] = [vnew, vnew_2];\n }\n face.push(idx2V[v.ID][0]);\n face_2.push(idx2V[v.ID][1])\n }\n this.faceDrawer.addFace(face);\n this.faceDrawer.addFace(face_2);\n }\n let materialBefore = this.material;\n this.material = {'ka':[1, 1, 0], 'kd':[1, 1, 0]};\n this.faceDrawer.render(this);\n this.material = materialBefore;\n }\n }\n }", "title": "" }, { "docid": "ca9dbfdbb9859d24373e2f52e3a2cdda", "score": "0.5003205", "text": "function Sphere_Helper(vertex, triangles) {\n this.verValue = vertex;\n this.triangles = triangles;\n this.getMid = function(v1, v2) {\n var p = [];\n for (var i = 0; i < 3; i++) {\n p.push((v1[i] + v2[i])/2);\n }\n var r = Math.sqrt(p[1] * p[1] + p[2] * p[2] + p[0]*p[0]);\n for (var i = 0; i < 3; i++) {\n p[i] /= r;\n }\n return p;\n }\n this.calPoints = function(offset, p) {\n for (var i = 0; i < p.length; i++) {\n p[i] += offset;\n }\n return p;\n }\n this.nextIteration = function() {\n // find each triangle\n var newTriangles = [];\n var newVerValue = [];\n var splitVerValues = [];\n var offset = 0;\n var triOffset = 0;\n for (var triIndex = 0; triIndex < this.triangles.length / 3; triIndex++) {\n var triPoints = this.triangles.slice(triOffset, triOffset + 3);//[0, 1, 2]\n triOffset+= 3;\n for(var i = 0; i < 3; i++) {\n var pIndex = triPoints[i];\n var pValue = this.verValue.slice(pIndex * 3, pIndex * 3 + 3);\n splitVerValues.push(pValue); //[[p0],[p1],[p2]]\n }\n var mid1 = this.getMid(splitVerValues[offset + 0], splitVerValues[offset + 1]);\n var mid2 = this.getMid(splitVerValues[offset + 2], splitVerValues[offset + 1]);\n var mid3 = this.getMid(splitVerValues[offset + 0], splitVerValues[offset + 2]);\n splitVerValues.push(mid1, mid2, mid3);\n offset += 6;\n }\n\n for(var i = 0; i < splitVerValues.length; i++) {\n //newVerValue = newVerValue.concat(splitVerValues[i]);\n newVerValue.push.apply(newVerValue, splitVerValues[i]);\n }\n var oldTriNum = this.triangles.length / 3;\n offset = 0;\n for (var i = 0; i < oldTriNum; i++) {\n newTriangles.push(offset + 0);\n newTriangles.push(offset + 3);\n newTriangles.push(offset+ 5);\n\n newTriangles.push(offset + 1);\n newTriangles.push(offset + 3);\n newTriangles.push(offset + 4);\n\n newTriangles.push(offset + 2);\n newTriangles.push(offset + 4);\n newTriangles.push(offset + 5);\n\n newTriangles.push(offset + 4);\n newTriangles.push(offset + 3);\n newTriangles.push(offset + 5);\n offset += 6;\n }\n\n this.verValue = newVerValue;\n this.triangles = newTriangles;\n }\n\n}", "title": "" }, { "docid": "7eff7e5901fe344835fb72dbba8b76ca", "score": "0.5001869", "text": "function rotate(){\n\tfor(i in points.points){\n\t\t// points.points[i].x \n\t\t// points.points[i].y \n\t\t// points.points[i].z \n\t\t// points.points[i].radius\n\t\tvar angle = 0.1;\n\t\tvar xOld = points.points[i].x;\n\t\tvar zOld = points.points[i].z;\n\t\tvar xNew = xOld*Math.cos(angle) - zOld*Math.sin(angle) \n\t\tvar zNew = xOld*Math.sin(angle) + zOld*Math.cos(angle) \n\t\tpoints.points[i].x = xNew;\n\t\tpoints.points[i].z = zNew;\n\t}\n\trender();\n\trender1();\n\treOrderByDistance();\n\tsetTimeout(rotate, 100);\t\n}", "title": "" }, { "docid": "9b32e67aceb2c38aca457ff8eeb97c01", "score": "0.49960026", "text": "function Cylinder() {\n\n this.name = \"cylinder\";\n\n this.numTriangles = 128; \n this.numVertices = this.numTriangles * 3;\n var discTriangles = this.numTriangles/4;\n \n\n this.vertices = [this.numVertices];\n this.colors = [this.numVertices];\n \n\n\n\n\n var vert_colors = [\n vec4(0.0, 0.0, 0.0, 1.0), // black - v0\n vec4(1.0, 0.0, 0.0, 1.0), // red - v1\n vec4(1.0, 1.0, 0.0, 1.0), // yellow - v2\n vec4(0.0, 1.0, 0.0, 1.0), // green - v3\n vec4(0.0, 0.0, 1.0, 1.0), // blue - v4\n vec4(1.0, 0.0, 1.0, 1.0), // magenta - v5\n vec4(1.0, 1.0, 1.0, 1.0), // white - v6\n vec4(0.0, 1.0, 1.0, 1.0) // cyan - v7\n ];\n\n \n for (var i = 0; i < discTriangles; i++){\n \n this.vertices[i*12] = vec4(0, 0, 0, 1.0);\n var angle1 = (2 * Math.PI * i)/discTriangles;\n\n this.vertices[i*12+1] = vec4(Math.cos(angle1), Math.sin(angle1), 0, 1.0); \n var angle2 = angle1 + 2 * Math.PI/discTriangles;\n this.vertices[i*12+2] = vec4(Math.cos(angle2), Math.sin(angle2), 0, 1.0); \n\n \n\n this.vertices[i*12 + 6] = vec4(Math.cos(angle2), Math.sin(angle2), 1.0, 1.0);\n this.vertices[i*12+7] = vec4(Math.cos(angle1), Math.sin(angle1), 0, 1.0); \n this.vertices[i*12+8] = vec4(Math.cos(angle2), Math.sin(angle2), 0, 1.0); \n\n \n\n this.vertices[i*12+9] = vec4(Math.cos(angle1), Math.sin(angle1), 0, 1.0);\n this.vertices[i*12+10] = vec4(Math.cos(angle1), Math.sin(angle1), 1.0, 1.0); \n this.vertices[i*12+11] = vec4(Math.cos(angle2), Math.sin(angle2), 1.0, 1.0); \n\n this.vertices[i*12 + 3] = vec4(0, 0, 1.0, 1.0);\n this.vertices[i*12+4] = vec4(Math.cos(angle1), Math.sin(angle1), 1.0, 1.0); \n this.vertices[i*12+5] = vec4(Math.cos(angle2), Math.sin(angle2), 1.0, 1.0); \n }\n \n\n for (var i = 0; i < this.numVertices; i++){\n //this.vertices[i] = unique_vertices[i];\n this.colors[i] = vert_colors[Math.floor((i/12))%4+2];\n }\n\n \n}", "title": "" }, { "docid": "fb2500b9331c31544045f6b04ccf475d", "score": "0.4986387", "text": "mergeVertices(precisionPoints = 4) {\n const verticesMap = {};\n const unique = [], changes = [];\n const precision = Math.pow(10, precisionPoints);\n for (let i4 = 0, il = this.vertices.length; i4 < il; i4++) {\n const v4 = this.vertices[i4];\n const key = `${Math.round(v4.x * precision)}_${Math.round(v4.y * precision)}_${Math.round(v4.z * precision)}`;\n if (verticesMap[key] === void 0) {\n verticesMap[key] = i4;\n unique.push(this.vertices[i4]);\n changes[i4] = unique.length - 1;\n } else {\n changes[i4] = changes[verticesMap[key]];\n }\n }\n const faceIndicesToRemove = [];\n for (let i4 = 0, il = this.faces.length; i4 < il; i4++) {\n const face = this.faces[i4];\n face.a = changes[face.a];\n face.b = changes[face.b];\n face.c = changes[face.c];\n const indices = [face.a, face.b, face.c];\n for (let n2 = 0; n2 < 3; n2++) {\n if (indices[n2] === indices[(n2 + 1) % 3]) {\n faceIndicesToRemove.push(i4);\n break;\n }\n }\n }\n for (let i4 = faceIndicesToRemove.length - 1; i4 >= 0; i4--) {\n const idx = faceIndicesToRemove[i4];\n this.faces.splice(idx, 1);\n for (let j2 = 0, jl2 = this.faceVertexUvs.length; j2 < jl2; j2++) {\n this.faceVertexUvs[j2].splice(idx, 1);\n }\n }\n const diff = this.vertices.length - unique.length;\n this.vertices = unique;\n return diff;\n }", "title": "" }, { "docid": "39a8bea1b36e5ce2e757f79227651050", "score": "0.4984764", "text": "function genDraw(type, vertices) {\n var n = initBuffers(vertices);\n if (n < 0) {\n console.log('Failed to set the positions of the vertices');\n return;\n }\n gl.drawArrays(type, 0, n);\n }", "title": "" }, { "docid": "8b5d045820c3233acc2c0ffff7f43ff4", "score": "0.49787274", "text": "calculate() {\n var input = this.inputVertices;\n var num_loops = this.loops;\n var outputVertices = []\n for (var i=0; i<num_loops; i++) {\n for (var j=0; j<input.length; j++) {\n outputVertices.push(this.transform(input[j], i))\n }\n }\n this.setState({outputVertices: outputVertices});\n this.props.setVertices(outputVertices);\n }", "title": "" } ]
2f44a40eaefa37699abec62f8b417092
Use as little precision as is needed to generate a completely uniform distribution from the PRNG to the target range. Can be very slow to execute. If max is not specified, assume 2^53.
[ { "docid": "e5bc0de0facace7f927fbac8dfe353b8", "score": "0.74500555", "text": "function _randIntUniform (max) {\n if (typeof max === 'undefined')\n return _randInt53();\n if (max == 0)\n return 0;\n var log2 = 0;\n var mult = 1;\n while (mult < max) {\n log2 += 1;\n mult *= 2;\n }\n for (var r = max; r >= max; r = getRandBits(log2));\n return r;\n }", "title": "" } ]
[ { "docid": "296c1008f7d5a0c81d9900cc18d268b0", "score": "0.7735634", "text": "function rng(max) {\n return Math.floor(Math.random() * max)\n}", "title": "" }, { "docid": "e76e4aa7c9a03adb82434e8ebacde9e6", "score": "0.7482255", "text": "function r(max){ return Math.floor(Math.random()*max) }", "title": "" }, { "docid": "3145b68b90bb2c994225a1281a962067", "score": "0.73816836", "text": "function rand(max) {\n return Math.round(Math.random() * (max + 1))\n}", "title": "" }, { "docid": "9eca7e2ef4b2c06ff3d2adf8cc19988b", "score": "0.73333496", "text": "function GenerateRandomNumber(max) {\n return Math.trunc(Math.random() * max) + 1;\n}", "title": "" }, { "docid": "1ebd857dc78f04cd6c8e4feaa3903707", "score": "0.7331971", "text": "function randgp(max) { return Math.floor(Math.random()*max); }", "title": "" }, { "docid": "5145be309b40a592a9cb70e30eec6cf1", "score": "0.7266125", "text": "static getRandomNum(maxValue) {\r\n return Math.round(Math.random() * maxValue);\r\n }", "title": "" }, { "docid": "2787a01e7e25098b8a385d44fe754443", "score": "0.7226181", "text": "function _rngValue(min, max) {\n return Math.floor(Math.random() * max + min);\n}", "title": "" }, { "docid": "1d02b2d2b672004dbc4011ca44c70fde", "score": "0.7222777", "text": "function getRandomNumber(max) {\n return Math.ceil(Math.random() * max);\n}", "title": "" }, { "docid": "18d42b69038cec9df7a742a2a3523cc8", "score": "0.72070384", "text": "function generateRandomNumber(max) {\r\n return Math.floor(Math.random() * Math.floor(max));\r\n}", "title": "" }, { "docid": "315a8837542a443b85420582041144d9", "score": "0.7203915", "text": "rand(min = 100000000, max = 999999999) {\n //metodo para gerar numeros aleatorios, gera 9 digitos aleatorios, a partir desses 9 digitos gera o primeiro e o segundo digito do cpf podemos ter valores de cpf entre o min e o max\n\n return Math.floor(Math.random() * (max - min) + min);\n }", "title": "" }, { "docid": "8887553012e98f94000c366c09b010fc", "score": "0.7199542", "text": "function rr(max) {\n return Math.floor(Math.random()*max);\n}", "title": "" }, { "docid": "7457c3a1d0a3d95f58bc1ed01f223205", "score": "0.7198877", "text": "seededRandom(max, min) {\n max = max || 1000;\n min = min || 0;\n\n this._seed = (this._seed * 9301 + 49297) % 233280;\n var rnd = this._seed / 233280;\n\n return Math.floor( min + rnd * (max - min));\n }", "title": "" }, { "docid": "6438d235f9e20e0af39cfbd22fb38dd3", "score": "0.7179807", "text": "function uniformRand(min, max) {\n return Math.random() * (max - min) + min;\n }", "title": "" }, { "docid": "6438d235f9e20e0af39cfbd22fb38dd3", "score": "0.7179807", "text": "function uniformRand(min, max) {\n return Math.random() * (max - min) + min;\n }", "title": "" }, { "docid": "cd55781ed154e98dc5adbb83d3099be8", "score": "0.7151196", "text": "function genRanWithRange( min, max)\n{\n return Math.floor(Math.random() * (max-min+ 1)) + min;\n}", "title": "" }, { "docid": "f3791ae0d3c692067b01c835673416a8", "score": "0.71288735", "text": "function randomUpTo(max)\n{\n return Math.floor(Math.random() * (max+1));\n}", "title": "" }, { "docid": "f3791ae0d3c692067b01c835673416a8", "score": "0.71288735", "text": "function randomUpTo(max)\n{\n return Math.floor(Math.random() * (max+1));\n}", "title": "" }, { "docid": "f3791ae0d3c692067b01c835673416a8", "score": "0.71288735", "text": "function randomUpTo(max)\n{\n return Math.floor(Math.random() * (max+1));\n}", "title": "" }, { "docid": "ae75b47f8b7a08d2ac835419de994060", "score": "0.7120539", "text": "function rand(max) {\n return Math.floor(Math.random() * max);\n}", "title": "" }, { "docid": "846edf74fc196a4970b20a601b57d0df", "score": "0.71187305", "text": "function rand(max) {\r\n return Math.floor(Math.random() * max);\r\n}", "title": "" }, { "docid": "f81d53d5a668a97efbc7b47a8f2bb1ec", "score": "0.7108498", "text": "function produce_random_number(max) {\n return Math.floor(Math.random() * max);\n}", "title": "" }, { "docid": "ec2bc425632dedc2cb91b020bef13cc0", "score": "0.7104489", "text": "function genNextValue(prevValue, min, max) {\n var value = prevValue + ((max - min) * (Math.random() - 0.5)) * 0.03;\n value = Math.max(min, Math.min(max, value));\n return Math.round(value * 10) / 10;\n}", "title": "" }, { "docid": "77509cada1da609fd12cb7f613211507", "score": "0.7102885", "text": "function getRandom(max){\r\n return Math.floor(Math.random() * Math.floor(max));\r\n}", "title": "" }, { "docid": "fa7de501a86041240abc41d1c880e1a0", "score": "0.7071195", "text": "function generateRandomNumber(max) {\n return Math.random() * max;\n}", "title": "" }, { "docid": "0ed1c467adc93a7e2bca560cbe671172", "score": "0.70612216", "text": "function getRandom(max) {\n return Math.floor(Math.random() * max);\n}", "title": "" }, { "docid": "7d933bb139abf4026dcef3f995ac2be0", "score": "0.7057654", "text": "_random(max) {\n return Math.floor(Math.random()*max)\n }", "title": "" }, { "docid": "e2a4a4bc288b9ea5839cb8674eaae99a", "score": "0.7055882", "text": "function getRandomNumber(max) {\n return Math.floor(Math.random() * Math.floor(max));\n}", "title": "" }, { "docid": "c12b3084d3a9d2a3d487bbe5f259756b", "score": "0.7055011", "text": "function rand(max) {\n\treturn Math.floor(Math.random() * max)\n}", "title": "" }, { "docid": "f542570ba998a60d2ed5b0d87c626210", "score": "0.7045002", "text": "function getRandomNum(max) {\n return Math.floor(Math.random() * max);\n }", "title": "" }, { "docid": "ebec1c4ffbf3d35ae0f9bb8abf0c2039", "score": "0.70420074", "text": "function seededRandom (max, min) {\n max = max || 1;\n min = min || 0;\n\n seed = (seed * 9301 + 49297) % 233280;\n const rnd = seed / 233280;\n\n return min + rnd * (max - min);\n}", "title": "" }, { "docid": "85ee68934956c1e0f65779956761f1e5", "score": "0.7030695", "text": "function randomRNG(min, max) {\n return Math.round(Math.random() * (max - min) + min)\n}", "title": "" }, { "docid": "c5e34e7625095564d89a50034976f3a6", "score": "0.7030684", "text": "function rand(max) {\n return Math.floor(Math.random() * max);\n }", "title": "" }, { "docid": "560b7d67e97dcafefe7b55b0d64f1574", "score": "0.7020191", "text": "function randNumb(max) {\n return Math.floor(Math.random() * max);\n}", "title": "" }, { "docid": "ab5e46e00f1d23959999fd9ad6c793d7", "score": "0.70093167", "text": "function GenerateNumber(max) {\n return Math.floor(Math.random()*max) + 1;\n }", "title": "" }, { "docid": "eb9ead868aee3fc0120edbeef71edeae", "score": "0.7004365", "text": "function rand(max = 100) {\n return Math.floor(Math.random() * Math.floor(max));\n}", "title": "" }, { "docid": "ea28d65f48384cc006622fd0f154bc7a", "score": "0.7002214", "text": "function FRandom(min, max) { return Math.random()*(max+1 -min)+min }", "title": "" }, { "docid": "e176adf5678719abefdbc3103cf7d1bf", "score": "0.70020676", "text": "function generaNumeriCasuali(rangeMax) {\r\n var valore = Math.floor(Math.random() * rangeMax + 1);\r\n return valore;\r\n}", "title": "" }, { "docid": "73321e62e9f74e13183feaf22f0fe249", "score": "0.69970554", "text": "function getRandomInt(max) {\n\treturn Math.ceil(Math.random() * max);\n}", "title": "" }, { "docid": "7927b8c8537b284788f41d97d65d28cb", "score": "0.69931865", "text": "function getRandomNumber(max){\n return Math.floor(Math.random() * Math.floor(max));\n}", "title": "" }, { "docid": "965c8d4e1c7ff898f1ead40e19390991", "score": "0.6988361", "text": "function generateRandomNumber(min, max) {\n return Math.round(Math.random() * (max - min) + min);\n}", "title": "" }, { "docid": "dbf374f40d7e172defefbe88e06a5966", "score": "0.69815326", "text": "function rnd(min, max) {\n var generator = rnd.generator || (rnd.generator = SEEDRANDOM(SEED)),\n result;\n\n switch (true) {\n case min !== undefined && max !== undefined:\n result = min + Math.floor((max - min) * generator());\n break;\n case min !== undefined:\n result = Math.floor(min * generator());\n break;\n default:\n result = generator();\n }\n\n return result;\n}", "title": "" }, { "docid": "c8fe850894a141bb4ea43e73b7aebc62", "score": "0.6980073", "text": "function randInt(max){\n\treturn Math.round(Math.random() * (max-1));\n}", "title": "" }, { "docid": "7597fb16fe79c50eab0f90ab5e79975c", "score": "0.6958816", "text": "function generateValues(min, max) {\n return Math.random() * (max - min) + min; //returns float\n}", "title": "" }, { "docid": "0da9901485af58a5a4fdbfd2cbfef594", "score": "0.695809", "text": "function rand(min,max) {}", "title": "" }, { "docid": "fde33b68de4ccf894b9442e5f6b28148", "score": "0.69554156", "text": "function random(max) {\n return Math.floor(Math.random() * Math.floor(max));\n}", "title": "" }, { "docid": "233907898bbf4ef0ffdaa35aba216ffa", "score": "0.6941766", "text": "function uniform (min, max) {\n if (typeof min == 'undefined')\n min = 0;\n if (typeof max == 'undefined') {\n max = min;\n min = 0;\n }\n return min + (random() * (max - min));\n }", "title": "" }, { "docid": "966df09afee75e862a24d4a7df3c7863", "score": "0.6931553", "text": "function rand(min, max) {\n\treturn (Math.floor(Math.random() * (max*1000 - min*1000 + 1)) + min*1000)/1000;\n}", "title": "" }, { "docid": "05f521a7d44fc5b4fd64cc21f6c1ba39", "score": "0.6922884", "text": "function randomGenorator(max, min) {\n max -= min;\n random = Math.floor(Math.random() * max) + min;\n return random;\n}", "title": "" }, { "docid": "cbb6da606ec6a35b92a9e003cac30330", "score": "0.6905186", "text": "static _getRandomInt(min, max) {\n \t\treturn parseFloat((Math.floor(Math.random() * (max - min + 1)) + min).toFixed(0));\n\t}", "title": "" }, { "docid": "6243d247aa5416abbfe0ddfe0167fc36", "score": "0.6905026", "text": "function randGen(min, max) {\n var randNum = Math.floor((Math.random() * (max - min)) + min);\n if (randNum < 0) {\n randNum += 0.5;\n } else {\n randNum -= 0.5;\n }\n return randNum;\n}", "title": "" }, { "docid": "bb4b134d33dc631c9b24c06df8f88626", "score": "0.6896669", "text": "function getRandomNumber(max){\n return Math.floor(Math.random() * max);\n}", "title": "" }, { "docid": "5d7c62ddebbac908f47ef07b20fbc823", "score": "0.68958044", "text": "function getRandomNumber(max){\n return Math.floor(Math.random()*max);\n}", "title": "" }, { "docid": "274c21f6ecf98636f1ad6d17c5a144f7", "score": "0.689536", "text": "function getRandomArbitrary(min, max){\n return Math.round(Math.random() * (max - min) + min);\n}", "title": "" }, { "docid": "252b292b7d6c9fc00ac88d6709504f06", "score": "0.68890196", "text": "function _randInt53 (max) {\n var r = getUInt32() + (getUInt32() >>> 11) * 0x100000000;\n if (typeof max === 'undefined')\n return r;\n return r % max;\n }", "title": "" }, { "docid": "71cd6e02722f715daf3155cf68f75f0b", "score": "0.68853456", "text": "function _getRandomInt(max) {\n\treturn Math.floor(Math.random() * Math.floor(max));\n}", "title": "" }, { "docid": "5c8b6ba41eb13b0ffacb13f90f43ca61", "score": "0.68851197", "text": "function generateRandomNumber(max){\n return Math.floor(Math.random()*Math.floor(max)+1)\n}", "title": "" }, { "docid": "e22c90b4b3f304a73f633c338fc035f3", "score": "0.6884393", "text": "function getRnd(max) {\n\t\t\tmin = 0\n\t\t\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n\t\t}", "title": "" }, { "docid": "3f37c576e9e21173ab0718b5df779c32", "score": "0.687107", "text": "getRandomNumb (min, max) {\n return Math.floor(Math.random() * (max - min) + min)\n }", "title": "" }, { "docid": "2ab327c4554bf733668a026a8305cfd2", "score": "0.68690634", "text": "function genNumeriCasuali(min, max) {\r\n return Math.floor(Math.random() * (max - min)) + min;\r\n}", "title": "" }, { "docid": "439f7772e8e7fd3ce2f27b666210cf62", "score": "0.6862886", "text": "function myRandom(max)\n{\n\treturn Math.floor((Math.random() * max));\n}", "title": "" }, { "docid": "578ba121e358abe9fdf80299be745a30", "score": "0.68601173", "text": "function randomInRange(max) {\n return Math.floor(Math.random() * max);\n}", "title": "" }, { "docid": "171c3933dfab765bd9d0644649383aac", "score": "0.6855643", "text": "function rng(min, max) {\n\treturn min + Math.floor(Math.random() * ((max - min) + 1));\n}", "title": "" }, { "docid": "e8a7d39a5e971444b0be1ee3b5d34c37", "score": "0.68554926", "text": "function rndNumb(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n }", "title": "" }, { "docid": "53ee376f465d8a515078bdc74e9b8980", "score": "0.68371654", "text": "function genRandom(min, max) {\n return Math.floor(Math.random() * max - min) + min;\n}", "title": "" }, { "docid": "440392f137a8f656dbd41de8df143c29", "score": "0.6831695", "text": "function random(max) {\r\n\treturn Math.floor(Math.random() * max);\r\n}", "title": "" }, { "docid": "d20ce1417b22bc238d2f881cfdbecda8", "score": "0.6830029", "text": "function getRandomInt(max) \n{\n return Math.floor(Math.random() * Math.floor(max));\n}", "title": "" }, { "docid": "69d8789d7761639dc0ae9ce9ce4e39c7", "score": "0.6829656", "text": "function randomUpTo(randomMax) {\n return ((Math.floor(Math.random() * (randomMax + 1))))\n}", "title": "" }, { "docid": "bc1beb720ea87906baf33ab051308f2d", "score": "0.68278354", "text": "function random(max) {\n\treturn parseInt(Math.random() * max);\n}", "title": "" }, { "docid": "06166a8c31081232993ca025c87e9ed9", "score": "0.6824758", "text": "function getRandomInt(max) {\n return Math.floor(Math.random() * Math.floor(max));\n }", "title": "" }, { "docid": "5ba6bd5dec2ed1d3cc018311fbcd45b6", "score": "0.68243533", "text": "function rnd(min, max)\n\t{\n\t\treturn Math.random() * (max - min) + min;\n\t}", "title": "" }, { "docid": "252ee66ce0781576b7554758d68c09dd", "score": "0.68230486", "text": "function genRand(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "d31de6f13eb49ec03bbbf954728fa566", "score": "0.682082", "text": "function randomUpTo(randomMax) {\n return ((Math.floor(Math.random() * (randomMax + 1))))\n}", "title": "" }, { "docid": "3adee70b621af9eb5a5063376572c204", "score": "0.68202734", "text": "function numGenerator (min, max) {\r\n return Math.floor(Math.random() * (max - min) + min);\r\n}", "title": "" }, { "docid": "3474d7d1e50d84e94d4a672430baf49e", "score": "0.6817008", "text": "function getRandomInt(max) {\n return Math.floor(Math.random() * Math.floor(max));\n }", "title": "" }, { "docid": "8029d0097ad6957d31864fd823d9ebca", "score": "0.6813011", "text": "function randInt(max) {\n return Math.floor(Math.random()*max);\n}", "title": "" }, { "docid": "670a88506f91e06e5305038fbae9a954", "score": "0.6809398", "text": "function getRandomNum(max) {\n return Math.floor(Math.random() * (max)) + 1 ;\n}", "title": "" }, { "docid": "7cb9d4d761c56f564a12597bd23c173a", "score": "0.6808429", "text": "function randomizer(max) {\n return Math.floor(Math.random() * max);\n}", "title": "" }, { "docid": "ada1d5042829c90a31cc89966de6f8c2", "score": "0.68082005", "text": "function randReal(min, max) {\n\treturn (Math.random() * (max - min)) + min;\n}", "title": "" }, { "docid": "91bc675cb88d31fbb1865f4933a6463d", "score": "0.68063134", "text": "function getRandomInt(max) {\r\n return Math.floor(Math.random() * Math.floor(max));\r\n }", "title": "" }, { "docid": "c88dc5e48a5503b7962dd1868d118c8e", "score": "0.6802628", "text": "function randomNum(min, max) {\n return Math.floor(Math.random() * 1000) + 1;\n}", "title": "" }, { "docid": "756f408962af1202ea65fa6008c506b1", "score": "0.68018633", "text": "function getRandomInt(max) {\n return Math.floor(Math.random() * Math.floor(max));\n }", "title": "" }, { "docid": "756f408962af1202ea65fa6008c506b1", "score": "0.68018633", "text": "function getRandomInt(max) {\n return Math.floor(Math.random() * Math.floor(max));\n }", "title": "" }, { "docid": "756f408962af1202ea65fa6008c506b1", "score": "0.68018633", "text": "function getRandomInt(max) {\n return Math.floor(Math.random() * Math.floor(max));\n }", "title": "" }, { "docid": "756f408962af1202ea65fa6008c506b1", "score": "0.68018633", "text": "function getRandomInt(max) {\n return Math.floor(Math.random() * Math.floor(max));\n }", "title": "" }, { "docid": "756f408962af1202ea65fa6008c506b1", "score": "0.68018633", "text": "function getRandomInt(max) {\n return Math.floor(Math.random() * Math.floor(max));\n }", "title": "" }, { "docid": "921e89077c754c9979f0ea840f3fda82", "score": "0.6800506", "text": "function getRandomInt(max) {\n return Math.floor(Math.random() * Math.floor(max))\n }", "title": "" }, { "docid": "5fc1c071845835535fd39f5b5795286e", "score": "0.6797669", "text": "getRandomInt(max) {\n return Math.floor(Math.random() * Math.floor(max));\n }", "title": "" }, { "docid": "5fc1c071845835535fd39f5b5795286e", "score": "0.6797669", "text": "getRandomInt(max) {\n return Math.floor(Math.random() * Math.floor(max));\n }", "title": "" }, { "docid": "aa11f6f1f13f9440a7e9414f7065d501", "score": "0.67968214", "text": "function randInt(max) {\n return Math.floor(Math.random()*max);\n}", "title": "" }, { "docid": "5440d305b1c47a518ca2bcfc2cbd1803", "score": "0.6794234", "text": "function randInt(max) {\n return Math.floor(Math.random() * max);\n }", "title": "" }, { "docid": "decc2ab9e9211f098697112322f142e4", "score": "0.6793361", "text": "function randomNumber(max) {\n return Math.floor(Math.random() * max);\n}", "title": "" }, { "docid": "89123a66c4e42fb81097c57a2b19ea76", "score": "0.67909795", "text": "function getRndInteger(max) {\n return Math.floor(Math.random() * (max)) + 1;\n}", "title": "" }, { "docid": "7f782e26435edb955c098302c4c8c69a", "score": "0.67902493", "text": "function getRandomInt(max) {\n\t return Math.floor(Math.random() * Math.floor(max));\n\t}", "title": "" }, { "docid": "38de7772b884bfd7c0fa242a8cbf4a2d", "score": "0.6789054", "text": "function generateRandomNum(upperBound) {\n\tvar randomFloat = 0;\n\twhile (randomFloat == 0) {\n\t\trandomFloat = Math.random();\n\t}\n\n\treturn Math.ceil(randomFloat * upperBound);\n}", "title": "" }, { "docid": "fc5da8560524d8d4f00e5562e43d1527", "score": "0.678874", "text": "function generateRandomNumber (min, max) {\r\n return Math.floor(Math.random () * max - min + min)\r\n}", "title": "" }, { "docid": "2fb239e85815fde786625bf87048dc61", "score": "0.67874765", "text": "function genRandom(min, max){\n\treturn Math.floor((Math.random()) * (max - min)) + min; \n}", "title": "" }, { "docid": "caef65feeefd4afec85eb86657f9c005", "score": "0.67813027", "text": "function getRandomInt(max) {\n return Math.floor(Math.random() * max);\n}", "title": "" }, { "docid": "2e87bd252e3c386bde37b02d4e9144a5", "score": "0.6777062", "text": "function rifi(min,max)\n{\n return Math.floor(Math.random()*(max-min+1)+min);\n}", "title": "" }, { "docid": "b1d4b2d9e109dcb720fbcec3803fc237", "score": "0.6775202", "text": "function getRandomInt(max) {\n return Math.floor(Math.random() * max);\n }", "title": "" }, { "docid": "b1d4b2d9e109dcb720fbcec3803fc237", "score": "0.6775202", "text": "function getRandomInt(max) {\n return Math.floor(Math.random() * max);\n }", "title": "" } ]
c6ccd9669c91bb1fc3c5f6b62f619228
Expects: DNI number Returns: Letter of DNI number
[ { "docid": "99472617af811dc0d8e8f0694cda4466", "score": "0.74684435", "text": "function getDNILetterByParameter (dni) { \r\n dniLetter =\"TRWAGMYFPDXBNJZSQVHLCKET\"; \r\n position = dni % 23; \r\n return dniLetter.substring(position, position+1); \r\n}", "title": "" } ]
[ { "docid": "06ede784af491b7a2f86ebef2a4a0823", "score": "0.7212819", "text": "function getDNILetter () { \r\n dniLetter =\"TRWAGMYFPDXBNJZSQVHLCKET\"; \r\n position = $(\"#dniNumber\").val() % 23; \r\n return dniLetter.substring(position, position+1); \r\n}", "title": "" }, { "docid": "ad3f52e2566f9c64a247d14d802b9a1c", "score": "0.7074358", "text": "function letraDni(dni) {\n return \"TRWAGMYFPDXBNJZSQVHLCKE\".charAt(dni % 23); //------> nos muestra la posicion del string, tomando el resto del numero de DNI\n}", "title": "" }, { "docid": "b8ae9d60b44a15224ac7004afb6fc069", "score": "0.6551006", "text": "function isValidDNI(dni) {\r\n var numero, let, letra;\r\n var expresion_regular_dni = /^[XYZ]?\\d{5,8}[A-Z]$/;\r\n\r\n dni = dni.toUpperCase();\r\n\r\n if (expresion_regular_dni.test(dni) === true){\r\n numero = dni.substr(0,dni.length-1);\r\n numero = numero.replace('X', 0);\r\n numero = numero.replace('Y', 1);\r\n numero = numero.replace('Z', 2);\r\n let = dni.substr(dni.length-1, 1);\r\n numero = numero % 23;\r\n letra = 'TRWAGMYFPDXBNJZSQVHLCKET';\r\n letra = letra.substring(numero, numero+1);\r\n if (letra != let) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n } else {\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "e0a0e23663d72a524ed9313a8e809247", "score": "0.6459137", "text": "function numberToLetter(nr) {\n var digits = [];\n do {\n var v = nr % base58Length;\n digits.push(v);\n nr = Math.floor(nr / base58Length);\n } while (nr-- > 0);\n return digits\n .reverse()\n .map(function (d) { return base58Chars[d]; })\n .join('');\n}", "title": "" }, { "docid": "312bbd94dc458ce1f9cd4bd7aa7b241d", "score": "0.635522", "text": "function validate_dni(dni){\n if (dni.length > 0){\n var regexp=/(\\d{8})([a-zA-Z]{1})/;\n return regexp.test(dni);\n }\n \n return false;\n \n }", "title": "" }, { "docid": "5ab138acec9b25597e81c26eb7637d58", "score": "0.6345193", "text": "function dig(n, d){\n var res = n.toString();\n while(res.length < d)\n res = \"0\" + res;\n return res;\n}", "title": "" }, { "docid": "6e982debcdbb1d58908398ddf55201fa", "score": "0.621303", "text": "function encode_digit(d, flag) {\n return d + 22 + 75 * (d < 26) - ((flag !== 0) << 5);\n // 0..25 map to ASCII a..z or A..Z \n // 26..35 map to ASCII 0..9\n }", "title": "" }, { "docid": "fdc753eb9e1efbf97ae5d84ac2626c97", "score": "0.6174084", "text": "function afficherNCar(str){\n \tvar result4 = str.substring(0,9);\n \treturn result4;\n }", "title": "" }, { "docid": "affe44caf5d5b9db66739401acacd0ef", "score": "0.61660546", "text": "function assignLetter(myArray, dni, letter) {\n // Llamamos a la funcion isNumberOk y le pasamos el numero de DNI. \n // Si devuelve true, continuamos. Si devuelve false, se muestra un msj de error \n if (isNumberOk(dni)) {\n let rest = dni % 23;\n // Comparo la letra pasada por parametros vs la letra resultante del resto de la division\n // Si son iguales, retorna un mensaje de validacion, sino, uno de error\n if (letter == myArray[rest]) {\n return \"El número y la letra del DNI indicados son correctos.\";\n }\n return \"La letra indicada es incorrecta.\";\n }\n return \"El numero proporcionado no es válido.\";\n}", "title": "" }, { "docid": "bcf06604a213d1016d4e2b2078382b70", "score": "0.60822123", "text": "function encode_digit(d, flag) {\n\t\treturn d + 22 + 75 * (d < 26) - ((flag != 0) << 5);\n\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t// 26..35 map to ASCII 0..9\n\t}", "title": "" }, { "docid": "72b9a26487acfad5c44d5ecb9e739caa", "score": "0.6079501", "text": "function DQNumberId(n) {\n\t// convert to string\n\tn = \"\" + n;\n\n\t// replace non-word characters with _\n\tn = n.replace(/\\W/g, \"_\");\n\t\n\t// PW: was starting with a word char, but turns out that's not necessary and\n\t// is problematic for backwards-compatibility\n\t// n = \"dq_\" + n;\n\t\n\treturn n;\n}", "title": "" }, { "docid": "ef7ba1dd6b65b626acb744db5fa00005", "score": "0.6050547", "text": "function findLetter(note){\n\n letter = '';\n\n if(note.substring(0,2) == 'C5'){\n letter = 'h';\n } else if(note.substring(0,1) == 'C'){\n letter = 'a';\n } else if(note.substring(0,1) == 'D'){\n letter = 'b';\n } else if(note.substring(0,1) == 'E'){\n letter = 'c';\n } else if(note.substring(0,1) == 'F'){\n letter = 'd';\n } else if(note.substring(0,1) == 'G'){\n letter = 'e';\n } else if(note.substring(0,1) == 'A'){\n letter = 'f';\n } else if(note.substring(0,1) == 'B'){\n letter = 'g';\n }\n\n return letter;\n\n}", "title": "" }, { "docid": "9eee0b62d670d89bd5e5134fdf7cb5bc", "score": "0.60451627", "text": "function fN2C(n) {\n if (n < 10) {return n.toString();}\n else if (n < 36) {return String.fromCharCode(0x41 + n - 10);}\n else if (n < 60) {return String.fromCharCode(0x61 + n - 36);}\n else if (n < 100) {return \"z\"+ fN2C(n - 60);}\n\n return \"_\";\n}", "title": "" }, { "docid": "67eb5dcaf21087aa9bd2a3f3ffde28d8", "score": "0.60275465", "text": "function makeid() {\n const {possible, n} = makeid\n let alphaHex = n.toString(26).split(''), c, r = ''\n while(c = alphaHex.shift()) r += possible[parseInt(c, 26)]\n makeid.n++\n return r\n}", "title": "" }, { "docid": "87d85cfabb69b18a33aa344c0c83e698", "score": "0.6007396", "text": "function DNAStrand(dna){\n\t// create an object with key/value pairs\n\tlet lookup = {\n\t\"A\":\"T\",\n\t\"T\":\"A\",\n\t\"C\":\"G\",\n\t\"G\":\"C\"\n\t}\n\t// create a variable to store the result\n\tlet result = \"\"\n\t// loop through the input (dna)\n\tfor (var i = 0; i < dna.length; i++){\n\t\t// add the value (lookup[key]) to the result variable\n\t\tresult+= lookup[dna[i]]\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "aeaaf211a74441f296b5d9e0a1b5d3d5", "score": "0.5995288", "text": "function sc_integer2char(n)\n { return new sc_Char(String.fromCharCode(n)); }", "title": "" }, { "docid": "3556067211f143178d64141230891e6a", "score": "0.5979", "text": "function valida_nif_cif_nie(a) \n{\n\tvar temp=a.toUpperCase();\n\tvar temp=temp.replace(/\\s/g, \"\");\n\tvar temp=temp.replace(/-/g, \"\");\n\t\t\n\n\tvar cadenadni=\"TRWAGMYFPDXBNJZSQVHLCKE\";\n \t\n\tif (temp!==''){\n\t\t//si no tiene un formato valido devuelve error\n\t\tif (!/^[A-Z]{1}[0-9]{8}$/.test(temp) \n\t\t&& !/^[T]{1}[A-Z0-9]{8}$/.test(temp) \n\t\t&& !/^[XYZ]{1}[0-9]{8}[A-Z]{1}$/.test(temp) \n\t\t&& !/^[XYZ]{1}[0-9]{7}[A-Z]{1}$/.test(temp) \n\t\t&& !/^[0-9]{8}[A-Z]{1}$/.test(temp))\n\t\t{\n\t\t\treturn 0;\n\t\t}\n \n\t\t//comprobacion de NIFs estandar\n\t\tif (/^[0-9]{8}[A-Z]{1}$/.test(temp))\n\t\t{\n\t\t\tposicion = a.substring(8,0) % 23;\n\t\t\tletra = cadenadni.charAt(posicion);\n\t\t\tvar letradni=temp.charAt(8);\n\t\t\tif (letra == letradni)\n\t\t\t{\n\t\t\t \t\n\t\t\t\treturn 1; \n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//comprobacion de NIEs \n \n\t\telse if (/^[XYZ]{1}[0-9]{8}[A-Z]{1}$/.test(temp)){\n\t\t\t\n\t\t\tletraD=temp.charAt(9);\n\t\t\tvar numeros=temp.substring(0,9);\n\t\t\tnumeros = numeros.replace('X', '0');\n\t\t\tnumeros = numeros.replace('Y', '1');\n\t\t\tnumeros = numeros.replace('Z', '2');\n\t\n\t\t\tresto=numeros%23;\n\t\t\tcor=cadenadni.charAt(resto);\n\t\t\tif(letraD==cor)\n\t\t\t{\n\t\t\treturn 3;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\treturn -3;\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\telse if (/^[XYZ]{1}[0-9]{7}[A-Z]{1}$/.test(temp)){\n\t\t\t\t\t\n\t\t\t\t\tletraD=temp.charAt(8);\n\t\t\t\t\tvar numeros=temp.substring(0,8);\n\t\t\t\t\tnumeros = numeros.replace('X', '0');\n\t\t\t\t\tnumeros = numeros.replace('Y', '1');\n\t\t\t\t\tnumeros = numeros.replace('Z', '2');\n\t\t\t\n\t\t\t\t\tresto=numeros%23;\n\t\t\t\t\tcor=cadenadni.charAt(resto);\n\t\t\t\t\tif(letraD==cor)\n\t\t\t\t\t{\n\t\t\t\t\treturn 3;\n\t\t\t\t\t}\n\t\t\t\t\telse \n\t\t\t\t\t{\n\t\t\t\t\treturn -3;\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\n\t\t//T\n\t\telse if (/^[T]{1}[A-Z0-9]{8}$/.test(temp))\n\t\t {\t\t\t\n\t\t\t\treturn 3;\n\t\t\t}\n\t\t\t\n\t//algoritmo para comprobacion de codigos tipo CIF\n\t\tsuma = parseInt(a[2])+parseInt(a[4])+parseInt(a[6]);\n\t\tfor (i = 1; i < 8; i += 2)\n\t\t{\n\t\t\ttemp1 = 2 * parseInt(a[i]);\n\t\t\ttemp1 += '';\n\t\t\ttemp1 = temp1.substring(0,1);\n\t\t\ttemp2 = 2 * parseInt(a[i]);\n\t\t\ttemp2 += '';\n\t\t\ttemp2 = temp2.substring(1,2);\n\t\t\tif (temp2 == '')\n\t\t\t{\n\t\t\t\ttemp2 = '0';\n\t\t\t}\n \n\t\t\tsuma += (parseInt(temp1) + parseInt(temp2));\n\t\t}\n\t\tsuma += '';\n\t\tn = 10 - parseInt(suma.substring(suma.length-1, suma.length));\n \n\t\t//comprobacion de NIFs especiales (se calculan como CIFs)\n\t\tif (/^[KLM]{1}/.test(temp))\n\t\t{\n\t\t\tif (a[8] == String.fromCharCode(64 + n))\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//comprobacion de CIFs\n\t\tif (/^[ABCDEFGHJNPQRSUVW]{1}/.test(temp))\n\t\t{\n\t\t\ttemp = n + '';\n\t\t\tif (a[8] == String.fromCharCode(64 + n) || a[8] == parseInt(temp.substring(temp.length-1, temp.length)))\n\t\t\t{\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn -2;\n\t\t\t}\n\t\t}\n \n\n\t}\n \n\treturn 0;\n}", "title": "" }, { "docid": "5b2bb25d7f52ba88da9d479370756aa3", "score": "0.5953729", "text": "function numberLetters (str) {\n var newStr = '';\n for(var i = 0 ; i < str.length ; i++){\n if(str[i] === '1'){\n newStr = newStr + 'i';\n }else if(str[i] === '4'){\n newStr = newStr + 'a'\n }else if(str[i] === '3'){\n newStr = newStr + 'e'\n }else if(str[i] === '7'){\n newStr = newStr + 'u'\n }else if(str[i] === '0'){\n newStr = newStr + 'o'\n }else{\n newStr = newStr + str[i]\n }\n }\n return newStr\n}", "title": "" }, { "docid": "c863e8d95cf47a7b60dbc8759e809af3", "score": "0.5922885", "text": "function valida_nif_cif_nie( a )\n{\n\tvar temp = a.toUpperCase();\n\tvar cadenadni = \"TRWAGMYFPDXBNJZSQVHLCKE\";\n\n\tif( temp!= '' )\n\t{\n\t\tif (temp.length == 10 && patron_nie_long_10.test(temp)) {\n\t\t\ttemp = temp.substring( 0, 1) + temp.substring(2);\n\t\t\ta = a.substring( 0, 1) + a.substring(2);\n\t\t}\n\t\tif( ( !/^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$/.test( temp ) && !/^[T]{1}[A-Z0-9]{8}$/.test( temp ) ) && !/^[0-9]{8}[A-Z]{1}$/.test( temp ) )\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\n\t\tif( /^[0-9]{8}[A-Z]{1}$/.test( temp ) )\n\t\t{\n\t\t\tposicion = a.substring( 8,0 ) % 23;\n\t\t\tletra = cadenadni.charAt( posicion );\n\t\t\tvar letradni = temp.charAt( 8 );\n\t\t\tif( letra == letradni )\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\n\n\t\tsuma = parseInt(a.charAt(2))+parseInt(a.charAt(4))+parseInt(a.charAt(6));\n\n\t\tfor( var i = 1; i < 8; i += 2 )\n\t\t{\n\t\t\ttemp1 = 2 * parseInt( a.charAt( i ) );\n\t\t\ttemp1 += '';\n\t\t\ttemp1 = temp1.substring(0,1);\n\t\t\ttemp2 = 2 * parseInt( a.charAt( i ) );\n\t\t\ttemp2 += '';\n\t\t\ttemp2 = temp2.substring( 1,2 );\n\t\t\tif( temp2 == '' )\n\t\t\t{\n\t\t\t\ttemp2 = '0';\n\t\t\t}\n\n\t\t\tsuma += ( parseInt( temp1 ) + parseInt( temp2 ) );\n\t\t}\n\t\tsuma += '';\n\t\tn = 10 - parseInt( suma.substring( suma.length-1, suma.length ) );\n\n\t\tif( /^[KLM]{1}/.test( temp ) )\n\t\t{\n\t\t\tif( a.charAt( 8 ) == String.fromCharCode( 64 + n ) )\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\n\t\tif( /^[ABCDEFGHJNPQRSUVW]{1}/.test( temp ) )\n\t\t{\n\t\t\ttemp = n + '';\n\t\t\tif( a.charAt( 8 ) == String.fromCharCode( 64 + n ) || a.charAt( 8 ) == parseInt( temp.substring( temp.length-1, temp.length ) ) )\n\t\t\t{\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn -2;\n\t\t\t}\n\t\t}\n\n\t\tif( /^[T]{1}[A-Z0-9]{8}$/.test( temp ) )\n\t\t{\n\t\t\tif( a.charAt( 8 ) == /^[T]{1}[A-Z0-9]{8}$/.test( temp ) )\n\t\t\t{\n\t\t\t\treturn 3;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn -3;\n\t\t\t}\n\t\t}\n\n\t\tif( /^[XYZ]{1}/.test( temp ) )\n\t\t{\n\t\t\ttemp = temp.replace( 'X','0' );\n\t\t\ttemp = temp.replace( 'Y','1' );\n\t\t\ttemp = temp.replace( 'Z','2' );\n\t\t\tpos = str_replace(['X', 'Y', 'Z'], 0, ['0','1','2'], temp).substring(0, 8) % 23;\n\n\t\t\tif( a.toUpperCase().charAt( 8 ) == cadenadni.substring( pos, pos + 1 ) )\n\t\t\t{\n\t\t\t\treturn 3;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn -3;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn 0;\n}", "title": "" }, { "docid": "120fe9b5382dd10394fa8d41d4f5f5e0", "score": "0.5912039", "text": "function getLetter(index) {\n return String.fromCharCode(64 + index);\n}", "title": "" }, { "docid": "04baf0aa44e76864354d3f8364e4dfe5", "score": "0.5841876", "text": "function get_dec_name()\n{\n\treturn \"NMEA 0183\";\n}", "title": "" }, { "docid": "a4a9aab6628e76e170d5ebf3b4fe9c9b", "score": "0.58377254", "text": "function getNumFromLetter(letter) {\n return letter.charCodeAt();\n}", "title": "" }, { "docid": "c26b53f17b8e082be23e7f1dfd9397e1", "score": "0.58338326", "text": "_2digit(n) {\n return ('00' + n).slice(-2);\n }", "title": "" }, { "docid": "c26b53f17b8e082be23e7f1dfd9397e1", "score": "0.58338326", "text": "_2digit(n) {\n return ('00' + n).slice(-2);\n }", "title": "" }, { "docid": "c26b53f17b8e082be23e7f1dfd9397e1", "score": "0.58338326", "text": "_2digit(n) {\n return ('00' + n).slice(-2);\n }", "title": "" }, { "docid": "485d09e41dd745bbb3b9e06f0abb1966", "score": "0.5833589", "text": "function DNAStrand(dna){\n var newDNA = \"\";\n for (var i = 0;i<dna.length;i++){ \n if (dna.charAt(i) == \"T\"){\n newDNA = newDNA + \"A\";\n }\n else if (dna.charAt(i) == \"A\"){\n newDNA = newDNA + \"T\";\n }\n else if (dna.charAt(i) == \"C\"){\n newDNA = newDNA + \"G\";\n }\n else if (dna.charAt(i) == \"G\"){\n newDNA = newDNA + \"C\";\n }\n }\n return newDNA;\n }", "title": "" }, { "docid": "c505c0d011afd906e6d0037f7b8b25ce", "score": "0.5829859", "text": "function DNAStrand(dna){\n let ans = '';\n for (let i = 0; i < dna.length; i++){\n ans += dna[i] === 'A' ? 'T' : dna[i] === 'T' ? 'A' : dna[i] === 'C' ? 'G' : 'C';\n }\n return ans;\n }", "title": "" }, { "docid": "ab661ce50d4c22f2039ef268b27ba5d6", "score": "0.58263105", "text": "function letterToNumberDataProvider(char){\n const index = JSON.parse('{\"A\": \"1\", \"B\": \"2\", \"C\": \"3\", \"D\": \"4\", \"E\": \"5\", \"F\": \"6\", \"G\": \"7\", \"H\": \"8\", \"I\": \"9\", \"J\": \"10\"}');\n return index[char];\n}", "title": "" }, { "docid": "1a74922a60b08456cf664719de1d5e7a", "score": "0.5820093", "text": "function letterToNumber(letter) {\n let alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',\n 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];\n let position = alphabet.indexOf(letter) + 1;\n let uni = letter.charCodeAt(0);\n console.log(uni);\n\n\n return 'Alphabet position: ' + position + ' Unicode value: ' + uni;\n}", "title": "" }, { "docid": "901d49def1e9a9cb212fdd1ada3f2e70", "score": "0.58096045", "text": "function numToChar(i){\n\t\tvar c;\n\t\tif(i>25){\n\t\t\tc = undefined;\n\t\t}\n\t\telse{\n\t\t\tc = 'ABCDEFGHIJKLMNOPQRSTUFWXYZ'[i]\n\t\t}\n\t\treturn c;\n\t}", "title": "" }, { "docid": "33cdb34f12573ef1fc0d69d590cff539", "score": "0.57990605", "text": "function checa_cnpj(s) {\r\n\tvar mensagem = \"informe corretamente o número do CNPJ\"\r\n\tvar msg = \"\";\r\n\tvar y;\r\n\tvar c = s.substr(0, 12);\r\n\tvar dv = s.substr(12, 2);\r\n\tvar d1 = 0;\r\n\tfor (y = 0; y < 12; y++) {\r\n\t\td1 += c.charAt(11 - y) * (2 + (y % 8));\r\n\t}\r\n\tif (d1 == 0) msg = mensagem;\r\n\td1 = 11 - (d1 % 11);\r\n\tif (d1 > 9) d1 = 0;\r\n\tif (dv.charAt(0) != d1) msg = mensagem;\r\n\td1 *= 2;\r\n\tfor (y = 0; y < 12; y++) {\r\n\t\td1 += c.charAt(11 - y) * (2 + ((y + 1) % 8));\r\n\t}\r\n\td1 = 11 - (d1 % 11);\r\n\tif (d1 > 9) d1 = 0;\r\n\tif (dv.charAt(1) != d1) msg = mensagem;\r\n\treturn msg;\r\n}", "title": "" }, { "docid": "187516ed7804bbe24440d1f323793dd5", "score": "0.57781166", "text": "function midi_note_number_to_name(input) {\n var n = parseInt(input);\n var quotient = Math.floor(n / 12);\n var remainder = n % 12;\n var name = [\"C\", \"C#\", \"D\", \"D#\", \"E\", \"F\", \"F#\", \"G\", \"G#\", \"A\", \"A#\", \"B\"];\n return name[remainder] + quotient;\n}", "title": "" }, { "docid": "5d3e718836ae9d96c94ad8cfb9962ead", "score": "0.57605684", "text": "function verificar(dni) {\n var valido = false;\n var comprovacion = dni.toString().length;\n \n if (comprovacion < 8 | comprovacion > 8) {\n document.write('Numero de dni no válido, por favor vuelva a introducir su DNI');\n } else if (comprovacion === 8) {\n valido = true;\n }\n \n return valido;\n }", "title": "" }, { "docid": "404d44e64b979e3c47218c9c15874118", "score": "0.5758057", "text": "function numberToLetterDataProvider(num){\n const index = JSON.parse('{\"1\": \"A\", \"2\": \"B\", \"3\": \"C\", \"4\": \"D\", \"5\": \"E\", \"6\": \"F\", \"7\": \"G\", \"8\": \"H\", \"9\": \"I\", \"10\": \"J\"}');\n return index[num];\n}", "title": "" }, { "docid": "af0cd44d47e9a032df42d71dec180c5d", "score": "0.5752745", "text": "function getGivenName(n){\r\n return(n)\r\n}", "title": "" }, { "docid": "28e96aa147ffb7801647a9d963ab693c", "score": "0.5729136", "text": "function N(n) {\n if(n === undefined) return NaN;\n if(n == '') return NaN;\n\n if(typeof n == 'number') return n;\n\n n = n.toUpperCase();\n // lookup a constant in loaded IDE Chip of present\n if( (IDEInstance) && (IDEInstance.Chip) && (IDEInstance.Chip.Const) ) {\n var c = IDEInstance.Chip.Const.get(n);\n if(c != undefined) return c;\n }\n\n // lookup a define in loaded IDE source\n if( (IDEInstance) && (IDEInstance.Source) && (IDEInstance.Source.Const) ) {\n var c = IDEInstance.Source.Const.get(n);\n if(c != undefined) return c;\n }\n \n var m;\n // try .123 style decimal\n m = /^\\.([0-9]+)$/i.exec(n);\n if(m) return parseInt(m[1]);\n\n // try d'123' style decimal\n m = /^d'([0-9]+)'$/i.exec(n);\n if(m) return parseInt(m[1]);\n\n // try h'2fe2' style hex\n m = /^h'([a-f0-9]+)'$/i.exec(n);\n if(m) return parseInt('0x'+m[1]);\n\n // try b'01010101' style binary\n m = /^b'([0-1]+)'$/i.exec(n);\n if(m) return B(m[1]);\n\n // try single character representation\n m = /^'(.)'$/i.exec(n);\n if(m) return ord(m[1]);\n\n // fall back to parsing the string as a stright binary or 0xFF stlye hex string\n return parseInt(n);\n}", "title": "" }, { "docid": "7323940d947d8083a1be7f7dd5bc5dc4", "score": "0.57196516", "text": "function CodeDTMFtoNumber(cod)\r\n{\r\n let aReturn = 0;\r\n try\r\n {\r\n switch (cod)\r\n {\r\n case '00': aReturn = '0'; break;\r\n case '01': aReturn = '1'; break;\r\n case '02': aReturn = '2'; break;\r\n case '03': aReturn = '3'; break;\r\n case '04': aReturn = '4'; break;\r\n case '05': aReturn = '5'; break;\r\n case '06': aReturn = '6'; break;\r\n case '07': aReturn = '7'; break;\r\n case '08': aReturn = '8'; break;\r\n case '09': aReturn = '9'; break;\r\n case '11': aReturn = '*'; break; //+\r\n case '12': aReturn = '#'; break; //-\r\n case '13': aReturn = 'A'; break; //>>\r\n case '14': aReturn = 'B'; break; //<<\r\n case '15': aReturn = 'C'; break; //> \r\n case '10': aReturn = 'D'; break;\r\n default: aReturn = '0';\r\n }\r\n }\r\n catch(err)\r\n {\r\n DebugLog(err.message.toString());\r\n } \r\n return (aReturn);\r\n}", "title": "" }, { "docid": "fce9a0f9ec200c0a6ee16c3c074358d1", "score": "0.5719517", "text": "lexi(n) {\n let ln = (\"0000\" + n).substr(-4,4);\n return ln;\n }", "title": "" }, { "docid": "143eeb97bd604226fc101a494cbd5568", "score": "0.5713949", "text": "function convertToDigits(lan) {\r\n\tvar move = new Array();\r\n\tif(lan=='O-O' || lan=='O-O+' || lan=='O-O#') {\r\n\t\tmove[0] = 95;\r\n\t\tmove[1] = 97;\r\n\t\treturn move;\r\n\t}\r\n\tif(lan=='O-O-O' || lan=='O-O-O+' || lan=='O-O-O#') {\r\n\t\tmove[0] = 95;\r\n\t\tmove[1] = 93;\r\n\t\treturn move;\r\n\t}\r\n\r\n\tvar letters = {'a':1, 'b':2, 'c':3, 'd':4, 'e':5, 'f':6, 'g':7, 'h':8};\r\n\tmove[0] = (parseInt(lan[1])+1)+''+letters[lan[0]];\r\n\tmove[1] = (parseInt(lan[3])+1)+''+letters[lan[2]];\r\n\treturn move;\r\n}", "title": "" }, { "docid": "5463597f910e30a6cf8bca980fcf542e", "score": "0.5711786", "text": "function DNAStrand(dna) {\n return dna.replace(/./g, function(c) {\n return DNAStrand.pairs[c]\n })\n }", "title": "" }, { "docid": "5463597f910e30a6cf8bca980fcf542e", "score": "0.5711786", "text": "function DNAStrand(dna) {\n return dna.replace(/./g, function(c) {\n return DNAStrand.pairs[c]\n })\n }", "title": "" }, { "docid": "6ba066cbc104c62e977991f802863dfb", "score": "0.5703714", "text": "function DNAStrand(dna) {\n dna.split('');\n let s=''\n for(let i=0; i<dna.length; i++){\n if(dna[i]==='A') s= s+ 'T';\n if(dna[i]==='T') s= s+ 'A';\n if(dna[i]==='G') s= s+ 'C';\n if(dna[i]==='C') s= s+ 'G';\n }\n return s;\n}", "title": "" }, { "docid": "ea3c7372c8789deb96032e1fff3a707f", "score": "0.57009965", "text": "function uniCharCode(a, b, c, d) {\n\t return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n\t}", "title": "" }, { "docid": "ea3c7372c8789deb96032e1fff3a707f", "score": "0.57009965", "text": "function uniCharCode(a, b, c, d) {\n\t return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n\t}", "title": "" }, { "docid": "ea3c7372c8789deb96032e1fff3a707f", "score": "0.57009965", "text": "function uniCharCode(a, b, c, d) {\n\t return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n\t}", "title": "" }, { "docid": "b7f7f584bba9b96aace33835646ea5c9", "score": "0.5690043", "text": "function get_didx(deviceName){\n var didx = \"\";\n var last_ = deviceName.lastIndexOf('_');\n if(last_ >= 0){\n didx = deviceName.substr(last_+1);\n }\n return didx; \n}", "title": "" }, { "docid": "9cfc6b2630119ed087c31abbfe1546d4", "score": "0.5680951", "text": "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n }", "title": "" }, { "docid": "e4c207df8fe59eb5b63666302cbbc62b", "score": "0.5678448", "text": "function DNAStrand(dna){\n let match = {\n A: 'T',\n T: 'A',\n G: 'C',\n C: 'G'\n }\n let answerArray = [];\n dna.split('').map(function(letter){answerArray.push(match[letter])})\n return answerArray.join('')\n}", "title": "" }, { "docid": "bc9db829dfc5c0c76641fa386063e513", "score": "0.56702816", "text": "function DNAStrand(dna) {\n let compDNA = \"\";\n\n for(let i = 0; i < dna.length; i++) {\n if(dna.charAt(i) === \"A\")\n compDNA += \"T\";\n else if(dna.charAt(i) === \"T\")\n compDNA += \"A\";\n else if(dna.charAt(i) === \"G\")\n compDNA += \"C\";\n else if(dna.charAt(i) === \"C\")\n compDNA += \"G\";\n }\n\n return compDNA;\n}", "title": "" }, { "docid": "d9bebc57264d119787ea694ab92baceb", "score": "0.566974", "text": "function getDna(dna) {\n let complements = ''\n for (let i = 0; i <dna.length; i++){\n switch (dna[i]){\n case \"A\":\n complements += \"T\"\n break;\n case \"T\":\n complements += \"A\"\n break;\n case \"C\":\n complements += \"G\"\n break;\n case \"G\":\n complements += \"C\"\n break\n }\n }\n return complements\n}", "title": "" }, { "docid": "7c0956aa302f22cf5b205bc9c6f74993", "score": "0.5661634", "text": "serialNumber() {\n return `${this.getSNString()}${(this.increament++).toString().padStart(this.padCount, '0')}`;\n }", "title": "" }, { "docid": "6f9608790e540664f61e62673730da4b", "score": "0.5657111", "text": "function getNumberName(numberString) {\r\n let digitName10 = \"\";\r\n let digitName1 = \"\";\r\n\r\n if (numberString[0] === \"1\") {\r\n //Define tenth digit place if tenth digit place is \"1\"\r\n switch (numberString[1]) {\r\n case \"0\":\r\n digitName10 = \"TEN\";\r\n break;\r\n case \"1\":\r\n digitName10 = \"ELEVEN\";\r\n break;\r\n case \"2\":\r\n digitName10 = \"TWELVE\";\r\n break;\r\n case \"3\":\r\n digitName10 = \"THIRTEEN\";\r\n break;\r\n case \"4\":\r\n digitName10 = \"FOURTEEN\";\r\n break;\r\n case \"5\":\r\n digitName10 = \"FIFTEEN\";\r\n break;\r\n case \"6\":\r\n digitName10 = \"SIXTEEN\";\r\n break;\r\n case \"7\":\r\n digitName10 = \"SEVENTEEN\";\r\n break;\r\n case \"8\":\r\n digitName10 = \"EIGHTEEN\";\r\n break;\r\n case \"9\":\r\n digitName10 = \"NINETEEN\";\r\n break;\r\n }\r\n } else {\r\n //Define tenth digit place if tenth digit place is not \"1\"\r\n switch (numberString[0]) {\r\n case \"0\":\r\n digitName10 = \"\";\r\n break;\r\n case \"2\":\r\n digitName10 = \"TWENTY\";\r\n break;\r\n case \"3\":\r\n digitName10 = \"THIRTY\";\r\n break;\r\n case \"4\":\r\n digitName10 = \"FORTY\";\r\n break;\r\n case \"5\":\r\n digitName10 = \"FIFTY\";\r\n break;\r\n case \"6\":\r\n digitName10 = \"SIXTY\";\r\n break;\r\n case \"7\":\r\n digitName10 = \"SEVENTY\";\r\n break;\r\n case \"8\":\r\n digitName10 = \"EIGHTY\";\r\n break;\r\n case \"9\":\r\n digitName10 = \"NINETY\";\r\n break;\r\n }\r\n //Define first digit place if tenth digit place is not \"1\"\r\n switch (numberString[1]) {\r\n case \"0\":\r\n digitName1 = \"\";\r\n break;\r\n case \"1\":\r\n digitName1 = \"ONE\";\r\n break;\r\n case \"2\":\r\n digitName1 = \"TWO\";\r\n break;\r\n case \"3\":\r\n digitName1 = \"THREE\";\r\n break;\r\n case \"4\":\r\n digitName1 = \"FOUR\";\r\n break;\r\n case \"5\":\r\n digitName1 = \"FIVE\";\r\n break;\r\n case \"6\":\r\n digitName1 = \"SIX\";\r\n break;\r\n case \"7\":\r\n digitName1 = \"SEVEN\";\r\n break;\r\n case \"8\":\r\n digitName1 = \"EIGHT\";\r\n break;\r\n case \"9\":\r\n digitName1 = \"NINE\";\r\n break;\r\n }\r\n }\r\n\r\n return digitName10 + digitName1;\r\n}", "title": "" }, { "docid": "cf530dd78c291f2404e84ff77bf4450f", "score": "0.5648456", "text": "_getNoteNumber(str) {\n const letter = str[0];\n const octave = parseInt(str[str.length - 1]);\n const sharpOrFlatOffset = (str[1] === '#' ? 1 : 0) + (str[1] === 'b' ? -1 : 0);\n const letterToOffsetTable = { 'C': 0, 'D': 2, 'E': 4, 'F': 5, 'G': 7, 'A': 9, 'B': 11 };\n return (octave + 1) * 12 + letterToOffsetTable[letter] + sharpOrFlatOffset;\n }", "title": "" }, { "docid": "4ea849d5c766125431534bb5f30251cc", "score": "0.5628842", "text": "function hiddenCardNumber(argument) {\n\treturn argument.slice(0, 7) + ' **** ' + argument.slice(-4);\n}", "title": "" }, { "docid": "4f9390b90c42e0d56eb3c6dc967c96a8", "score": "0.5622771", "text": "function subChar(number) {\n if (number === 4) {\n console.log(\"IV\");\n }\n else if (number === 5) {\n console.log(\"V\");\n }\n\n else if (number === 6) {\n console.log(\"VI\");\n }\n\n \n}", "title": "" }, { "docid": "1bcfd0baadf009fe127f27dfe7cb5a67", "score": "0.5608299", "text": "function randomDig() {\n var number = randomNum(0, 1);\n //format hex in \"numLetter\" format\n if (number === 0) {\n return `${randomNum(0, 9)}${randomLett()}`;\n }\n // format hex digit in 'letterNumber' format\n else if (number === 1) {\n return `${randomLett()}${randomNum(0, 9)}`;\n }\n}", "title": "" }, { "docid": "db009ec3322f87a8c1011a59a7b04aeb", "score": "0.560432", "text": "function translateDigit(d) {\n\tif (d >= CP_0 && d <= CP_9) {\n\t\t/* '0' to '9' -> 0 to 9 */\n\t\treturn d - PI_CONV_DEC;\n\t} else if (d >= CP_A && d <= CP_Z) {\n\t\t/* 'A' - 'Z' -> 10 to 35 */\n\t\treturn d - PI_CONV_UC;\n\t} else if (d >= CP_a && d <= CP_z) {\n\t\t/* 'a' - 'z' -> 10 to 35 */\n\t\treturn d - PI_CONV_LC;\n\t} else {\n\t\t/* Invalid character code */\n\t\treturn -1;\n\t}\n}", "title": "" }, { "docid": "b2229e0fc4775a0d99ac3f975d3b6595", "score": "0.56010264", "text": "function binaryNibbleToAsciiHexDigit(nibble) {\r\n var charCode;\r\n var str = \"\";\r\n\r\n if ((nibble >= 0) && (nibble <= 9)) {\r\n charCode = (\"0\".charCodeAt(0)) + nibble;\r\n str += String.fromCharCode(charCode);\r\n }\r\n else if ((nibble >= 10) && (nibble <= 15)) {\r\n charCode = (\"A\".charCodeAt(0)) + (nibble - 10);\r\n str += String.fromCharCode(charCode);\r\n }\r\n \r\n return str;\r\n}", "title": "" }, { "docid": "9fca45ea9d39b0f99cbfc970068f8233", "score": "0.55951", "text": "la(n) {\n return this.input.charCodeAt(this.pos + n);\n }", "title": "" }, { "docid": "7adb6e85945e9cdc004a4e6099fe704d", "score": "0.5580839", "text": "function isRightDNILetter(dni) {\n\tconst combinationNumber = 23;\n\n\tconst numbersDNI = dni.slice(0, 8);\n\n\tconst rest = numbersDNI % combinationNumber;\n\n\tconst lastChar = dni.slice(8);\n\n\tconst codigoLetters = 'TRWAGMYFPDXBNJZSQVHLCKET';\n\n\treturn codigoLetters[rest] === lastChar;\n}", "title": "" }, { "docid": "3ca3cb8400617829cf2b6d826e205cb3", "score": "0.55808026", "text": "function digit(d){\n d = '0' + d\n return d.substr(d.length-2,d.length);\n }", "title": "" }, { "docid": "c0d368f87e8cd4b4a25a70ec2e866627", "score": "0.5579931", "text": "function numberLetters(str) {\n var angka = '14370';\n var huruf = 'iaeuo';\n var result = '';\n\n for (var i = 0; i < str.length; i++) {\n var isAngka = false;\n for (var j = 0; j < angka.length; j++) {\n if (str[i] === angka[j]) {\n isAngka = true;\n result += huruf[j];\n }\n }\n if (!isAngka) {\n result += str[i];\n }\n }\n return result;\n}", "title": "" }, { "docid": "fc97796d5d75f5d4c8ad484d250ffc09", "score": "0.55768347", "text": "function oneCharNumberToTwoChar(n){\n return n > 9 ? \"\" + n: \"0\" + n;\n}", "title": "" }, { "docid": "99cb969787d0616ab4b2897ed3e06823", "score": "0.5560774", "text": "function toNum(letter) {\n var left_digit_val = 0;\n if(letter.length == 2) {\n left_digit_val = ((letter[0].toLowerCase()).charCodeAt(0) - 96) * 26;\n }\n return (letter.slice(-1).toLowerCase()).charCodeAt(0) - 96 + left_digit_val;\n}", "title": "" }, { "docid": "5c434c14861cb4a7ea7fa43febcad94f", "score": "0.5560416", "text": "letterToNumber(str) {\r\n var out = 0,\r\n len = str.length;\r\n for (var pos = 0; pos < len; pos++) {\r\n out += (str.charCodeAt(pos) - 64) * Math.pow(26, len - pos - 1);\r\n }\r\n return out;\r\n }", "title": "" }, { "docid": "b10d4d7092a0fd299aac1a1f5317b322", "score": "0.5559641", "text": "function fC2N(c) {\n if (0x30 <= c.charCodeAt(0) && c.charCodeAt(0) < 0x3a) {return c.charCodeAt(0) - 0x30;}\n else if (0x41 <= c.charCodeAt(0) && c.charCodeAt(0) <= 0x5a) {return c.charCodeAt(0) - 0x41 + 10;}\n else if (0x61 <= c.charCodeAt(0) && c.charCodeAt(0) <= 0x78) {return c.charCodeAt(0) - 0x61 + 36;}\n\n return -1000;\n}", "title": "" }, { "docid": "b7fa0c62be13dbea57dc44621b97ba41", "score": "0.55490875", "text": "function validaDni(dni){\n\t\n\tvar patronDNI=/^[0-9]{8}[A-Za-z]$/;\n\tvar letras = ['T', 'R', 'W', 'A', 'G', 'M', 'Y', 'F', 'P', 'D', 'X', 'B', 'N', 'J', 'Z', 'S', 'Q', 'V', 'H', 'L', 'C', 'K', 'E', 'T'];\n\tvar letrasMin = ['t', 'r', 'w', 'a', 'g', 'm', 'y', 'f', 'p', 'd', 'x', 'b', 'n', 'j', 'z', 's', 'q', 'v', 'h', 'l', 'c', 'k', 'e', 't'];\n\tif(patronDNI.test(dni)==false){\t\n\t\treturn false;\n\t}else{\n\t\tvar letraDNI = dni.substring(8, 9).toUpperCase();\n\t\tvar numDNI = parseInt(dni.substring(0, 8));\n\t\tvar letraCorrecta = letras[numDNI % 23];\n\t\tvar letraCorrectaM = letrasMin[numDNI % 23];\n\t\t\tif(letraDNI!= letraCorrecta && letraDNI!= letraCorrectaM ){\n\t\t\t\treturn \"no es valido\";\t\n\t\t\t} else{\n\t\t\t\treturn true;\n\t\t\t}\n\t}\n}", "title": "" }, { "docid": "c6cb3312e635640f547650f39d33d6dc", "score": "0.5541274", "text": "function CharBase64To2DTMF(car)\r\n{\r\n let aReturn = '';\r\n try\r\n {\r\n switch(car)\r\n { \r\n case 'A': aReturn='00'; break;\r\n case 'B': aReturn='01'; break;\r\n case 'C': aReturn='02'; break;\r\n case 'D': aReturn='03'; break;\r\n case 'E': aReturn='04'; break;\r\n case 'F': aReturn='05'; break;\r\n case 'G': aReturn='06'; break;\r\n case 'H': aReturn='07'; break;\r\n case 'I': aReturn='08'; break;\r\n case 'J': aReturn='09'; break;\r\n case 'K': aReturn='10'; break;\r\n case 'L': aReturn='11'; break;\r\n case 'M': aReturn='12'; break;\r\n case 'N': aReturn='13'; break;\r\n case 'O': aReturn='14'; break;\r\n case 'P': aReturn='15'; break;\r\n case 'Q': aReturn='16'; break;\r\n case 'R': aReturn='17'; break;\r\n case 'S': aReturn='18'; break;\r\n case 'T': aReturn='19'; break;\r\n case 'U': aReturn='20'; break;\r\n case 'V': aReturn='21'; break;\r\n case 'W': aReturn='22'; break;\r\n case 'X': aReturn='23'; break;\r\n case 'Y': aReturn='24'; break;\r\n case 'Z': aReturn='25'; break;\r\n case 'a': aReturn='26'; break;\r\n case 'b': aReturn='27'; break;\r\n case 'c': aReturn='28'; break;\r\n case 'd': aReturn='29'; break;\r\n case 'e': aReturn='30'; break;\r\n case 'f': aReturn='31'; break;\r\n case 'g': aReturn='32'; break;\r\n case 'h': aReturn='33'; break;\r\n case 'i': aReturn='34'; break;\r\n case 'j': aReturn='35'; break;\r\n case 'k': aReturn='36'; break;\r\n case 'l': aReturn='37'; break;\r\n case 'm': aReturn='38'; break;\r\n case 'n': aReturn='39'; break;\r\n case 'o': aReturn='40'; break;\r\n case 'p': aReturn='41'; break;\r\n case 'q': aReturn='42'; break;\r\n case 'r': aReturn='43'; break;\r\n case 's': aReturn='44'; break;\r\n case 't': aReturn='45'; break;\r\n case 'u': aReturn='46'; break;\r\n case 'v': aReturn='47'; break;\r\n case 'w': aReturn='48'; break;\r\n case 'x': aReturn='49'; break;\r\n case 'y': aReturn='50'; break;\r\n case 'z': aReturn='51'; break;\r\n case '0': aReturn='52'; break;\r\n case '1': aReturn='53'; break;\r\n case '2': aReturn='54'; break;\r\n case '3': aReturn='55'; break;\r\n case '4': aReturn='56'; break;\r\n case '5': aReturn='57'; break;\r\n case '6': aReturn='58'; break;\r\n case '7': aReturn='59'; break;\r\n case '8': aReturn='60'; break;\r\n case '9': aReturn='61'; break;\r\n case '+': aReturn='62'; break;\r\n case '/': aReturn='63'; break;\r\n default: aReturn=''; break;\r\n }\r\n }\r\n catch(err)\r\n {\r\n DebugLog(err.message.toString());\r\n }\r\n return aReturn;\r\n}", "title": "" }, { "docid": "ea517c8f4d6dc6b57f7f6dbd80da7564", "score": "0.55387485", "text": "function convertNumber2Letter(num) {\n var letter = String.fromCharCode(num);\n return letter;\n}", "title": "" }, { "docid": "7061441ce53e9aad4197c8e986101f47", "score": "0.55382246", "text": "function IDfromAbbrev(abbrev)\n{\n\tif(abbrev == 0){ return \"AL\";}\n\tif(abbrev == 1){ return \"AK\";}\n if(abbrev == 2){ return \"AZ\";}\n if(abbrev == 3){ return \"AR\";}\n if(abbrev == 4){ return \"CA\";}\n if(abbrev == 5){ return \"CO\";}\n if(abbrev == 6){ return \"CT\";}\n if(abbrev == 7){ return \"DE\";}\n if(abbrev == 8){ return \"DC\";}\n if(abbrev == 9){ return \"FL\";}\n\tif(abbrev == 10){ return \"GA\";}\n\tif(abbrev == 11){ return \"HI\";}\n\tif(abbrev == 12){ return \"ID\";}\n\tif(abbrev == 13){ return \"IL\";}\n\tif(abbrev == 14){ return \"IN\";}\n\tif(abbrev == 15){ return \"IA\";}\n\tif(abbrev == 16){ return \"KS\";}\n\tif(abbrev == 17){ return \"KY\";}\n\tif(abbrev == 18){ return \"LA\";}\n if(abbrev == 19){ return \"ME\";}\n if(abbrev == 20){ return \"MD\";}\n\tif(abbrev == 21){ return \"MA\";}\t\n\tif(abbrev == 22){ return \"MI\";}\t\t\n\tif(abbrev == 23){ return \"MN\";}\t\t\n\tif(abbrev == 24){ return \"MS\";}\t\n\tif(abbrev == 25){ return \"MT\";}\n\tif(abbrev == 26){ return \"MO\";}\n\tif(abbrev == 27){ return \"NE\";}\n if(abbrev == 28){ return \"NV\";}\n if(abbrev == 29){ return \"NH\";}\n if(abbrev == 30){ return \"NJ\";}\n if(abbrev == 31){ return \"NM\";}\n if(abbrev == 32){ return \"NY\";}\n if(abbrev == 33){ return \"NC\";}\n if(abbrev == 34){ return \"ND\";}\n\tif(abbrev == 35){ return \"OH\";}\n\tif(abbrev == 36){ return \"OK\";}\n\tif(abbrev == 37){ return \"OR\";}\n\tif(abbrev == 38){ return \"PA\";}\n\tif(abbrev == 39){ return \"RI\";}\n if(abbrev == 40){ return \"SC\";}\n if(abbrev == 41){ return \"SD\";}\n if(abbrev == 42){ return \"TN\";}\n if(abbrev == 43){ return \"TX\";}\n if(abbrev == 44){ return \"UT\";}\n if(abbrev == 45){ return \"VT\";}\n if(abbrev == 46){ return \"VA\";}\n\tif(abbrev == 47){ return \"WA\";}\n\tif(abbrev == 48){ return \"WV\";}\n\tif(abbrev == 49){ return \"WI\";}\n\tif(abbrev == 50){ return \"WY\";}\n\tif(abbrev == 51){ return \"WM\";}\n}", "title": "" }, { "docid": "15c855839a3a0c7c9dcf4c9d3dfc000c", "score": "0.55361295", "text": "function translateDigit(d)\n{\n\tif (d >= CP_0 && d <= CP_9) {\n\t\t/* '0' to '9' -> 0 to 9 */\n\t\treturn (d - PI_CONV_DEC);\n\t} else if (d >= CP_A && d <= CP_Z) {\n\t\t/* 'A' - 'Z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_UC);\n\t} else if (d >= CP_a && d <= CP_z) {\n\t\t/* 'a' - 'z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_LC);\n\t} else {\n\t\t/* Invalid character code */\n\t\treturn (-1);\n\t}\n}", "title": "" }, { "docid": "15c855839a3a0c7c9dcf4c9d3dfc000c", "score": "0.55361295", "text": "function translateDigit(d)\n{\n\tif (d >= CP_0 && d <= CP_9) {\n\t\t/* '0' to '9' -> 0 to 9 */\n\t\treturn (d - PI_CONV_DEC);\n\t} else if (d >= CP_A && d <= CP_Z) {\n\t\t/* 'A' - 'Z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_UC);\n\t} else if (d >= CP_a && d <= CP_z) {\n\t\t/* 'a' - 'z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_LC);\n\t} else {\n\t\t/* Invalid character code */\n\t\treturn (-1);\n\t}\n}", "title": "" }, { "docid": "15c855839a3a0c7c9dcf4c9d3dfc000c", "score": "0.55361295", "text": "function translateDigit(d)\n{\n\tif (d >= CP_0 && d <= CP_9) {\n\t\t/* '0' to '9' -> 0 to 9 */\n\t\treturn (d - PI_CONV_DEC);\n\t} else if (d >= CP_A && d <= CP_Z) {\n\t\t/* 'A' - 'Z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_UC);\n\t} else if (d >= CP_a && d <= CP_z) {\n\t\t/* 'a' - 'z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_LC);\n\t} else {\n\t\t/* Invalid character code */\n\t\treturn (-1);\n\t}\n}", "title": "" }, { "docid": "15c855839a3a0c7c9dcf4c9d3dfc000c", "score": "0.55361295", "text": "function translateDigit(d)\n{\n\tif (d >= CP_0 && d <= CP_9) {\n\t\t/* '0' to '9' -> 0 to 9 */\n\t\treturn (d - PI_CONV_DEC);\n\t} else if (d >= CP_A && d <= CP_Z) {\n\t\t/* 'A' - 'Z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_UC);\n\t} else if (d >= CP_a && d <= CP_z) {\n\t\t/* 'a' - 'z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_LC);\n\t} else {\n\t\t/* Invalid character code */\n\t\treturn (-1);\n\t}\n}", "title": "" }, { "docid": "15c855839a3a0c7c9dcf4c9d3dfc000c", "score": "0.55361295", "text": "function translateDigit(d)\n{\n\tif (d >= CP_0 && d <= CP_9) {\n\t\t/* '0' to '9' -> 0 to 9 */\n\t\treturn (d - PI_CONV_DEC);\n\t} else if (d >= CP_A && d <= CP_Z) {\n\t\t/* 'A' - 'Z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_UC);\n\t} else if (d >= CP_a && d <= CP_z) {\n\t\t/* 'a' - 'z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_LC);\n\t} else {\n\t\t/* Invalid character code */\n\t\treturn (-1);\n\t}\n}", "title": "" }, { "docid": "15c855839a3a0c7c9dcf4c9d3dfc000c", "score": "0.55361295", "text": "function translateDigit(d)\n{\n\tif (d >= CP_0 && d <= CP_9) {\n\t\t/* '0' to '9' -> 0 to 9 */\n\t\treturn (d - PI_CONV_DEC);\n\t} else if (d >= CP_A && d <= CP_Z) {\n\t\t/* 'A' - 'Z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_UC);\n\t} else if (d >= CP_a && d <= CP_z) {\n\t\t/* 'a' - 'z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_LC);\n\t} else {\n\t\t/* Invalid character code */\n\t\treturn (-1);\n\t}\n}", "title": "" }, { "docid": "15c855839a3a0c7c9dcf4c9d3dfc000c", "score": "0.55361295", "text": "function translateDigit(d)\n{\n\tif (d >= CP_0 && d <= CP_9) {\n\t\t/* '0' to '9' -> 0 to 9 */\n\t\treturn (d - PI_CONV_DEC);\n\t} else if (d >= CP_A && d <= CP_Z) {\n\t\t/* 'A' - 'Z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_UC);\n\t} else if (d >= CP_a && d <= CP_z) {\n\t\t/* 'a' - 'z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_LC);\n\t} else {\n\t\t/* Invalid character code */\n\t\treturn (-1);\n\t}\n}", "title": "" }, { "docid": "15c855839a3a0c7c9dcf4c9d3dfc000c", "score": "0.55361295", "text": "function translateDigit(d)\n{\n\tif (d >= CP_0 && d <= CP_9) {\n\t\t/* '0' to '9' -> 0 to 9 */\n\t\treturn (d - PI_CONV_DEC);\n\t} else if (d >= CP_A && d <= CP_Z) {\n\t\t/* 'A' - 'Z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_UC);\n\t} else if (d >= CP_a && d <= CP_z) {\n\t\t/* 'a' - 'z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_LC);\n\t} else {\n\t\t/* Invalid character code */\n\t\treturn (-1);\n\t}\n}", "title": "" }, { "docid": "15c855839a3a0c7c9dcf4c9d3dfc000c", "score": "0.55361295", "text": "function translateDigit(d)\n{\n\tif (d >= CP_0 && d <= CP_9) {\n\t\t/* '0' to '9' -> 0 to 9 */\n\t\treturn (d - PI_CONV_DEC);\n\t} else if (d >= CP_A && d <= CP_Z) {\n\t\t/* 'A' - 'Z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_UC);\n\t} else if (d >= CP_a && d <= CP_z) {\n\t\t/* 'a' - 'z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_LC);\n\t} else {\n\t\t/* Invalid character code */\n\t\treturn (-1);\n\t}\n}", "title": "" }, { "docid": "15c855839a3a0c7c9dcf4c9d3dfc000c", "score": "0.55361295", "text": "function translateDigit(d)\n{\n\tif (d >= CP_0 && d <= CP_9) {\n\t\t/* '0' to '9' -> 0 to 9 */\n\t\treturn (d - PI_CONV_DEC);\n\t} else if (d >= CP_A && d <= CP_Z) {\n\t\t/* 'A' - 'Z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_UC);\n\t} else if (d >= CP_a && d <= CP_z) {\n\t\t/* 'a' - 'z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_LC);\n\t} else {\n\t\t/* Invalid character code */\n\t\treturn (-1);\n\t}\n}", "title": "" }, { "docid": "15c855839a3a0c7c9dcf4c9d3dfc000c", "score": "0.55361295", "text": "function translateDigit(d)\n{\n\tif (d >= CP_0 && d <= CP_9) {\n\t\t/* '0' to '9' -> 0 to 9 */\n\t\treturn (d - PI_CONV_DEC);\n\t} else if (d >= CP_A && d <= CP_Z) {\n\t\t/* 'A' - 'Z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_UC);\n\t} else if (d >= CP_a && d <= CP_z) {\n\t\t/* 'a' - 'z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_LC);\n\t} else {\n\t\t/* Invalid character code */\n\t\treturn (-1);\n\t}\n}", "title": "" }, { "docid": "454b05c9e3d3715e411648b44e27a3ad", "score": "0.55245495", "text": "function getDCCAddrAndMotorSubAddr(objID)\n{\n\tvar position = objID.search(\"[0-9]\");\n\tvar positionOfDot = objID.search(\"[.]\");\n \n\tif((position != -1) && (positionOfDot == -1))\n {\n var lastChar = objID.substring(objID.length-1);\n if((lastChar == 'R') || (lastChar == 'r') || (lastChar == 'N') || (lastChar == 'n'))\n return objID.substring(position, objID.length-1);\n \n\t\treturn objID.substring(position);\n }\n \n\tif((position != -1) && (positionOfDot != -1))\n return objID.substring(position, positionOfDot);\n\t\n\treturn null;\n}", "title": "" }, { "docid": "03c86a5fb8abada12cf8b6a28046290c", "score": "0.55214673", "text": "function DNAtoRNA(dna) {\n return dna.replace(/T/g, 'u').toUpperCase();\n}", "title": "" }, { "docid": "6d5e54bc026272970933eec3406f8181", "score": "0.55174214", "text": "function mapEpisodeNumber(epno) {\r\n\tvar firstChar = String(epno);\r\n\tvar result = 0;\r\n\tswitch (firstChar[0]) {\r\n\t\tcase 'S': result = '1' + epno.substring(1,epno.length); break;\r\n\t\tcase 'C': result = '2' + epno.substring(1,epno.length); break;\r\n\t\tcase 'T': result = '3' + epno.substring(1,epno.length); break;\r\n\t\tcase 'P': result = '4' + epno.substring(1,epno.length); break;\r\n\t\tcase 'O': result = '10' + epno.substring(1,epno.length); break;\r\n\t\tdefault: result = epno;\r\n\t}\r\n\treturn (!isNaN(Number(result)) ? Number(result) : 0);\r\n}", "title": "" }, { "docid": "2802516f1424bfb070cfe780407e1721", "score": "0.55152345", "text": "getInternational() {\r\n return this.phoneNumber.replace(/^(0)(\\d{8,9})$/, '972$2');\r\n }", "title": "" }, { "docid": "02832209e880080313a2361dadd976cc", "score": "0.55150855", "text": "function characterId(name) {\n return name + \"-character\";\n}", "title": "" }, { "docid": "faa57fe8659c93e69b7a7c579684c4c8", "score": "0.5514854", "text": "function DTMFtoCharBase64(dtmf)\r\n{\r\n let aReturn = '';\r\n try\r\n {\r\n switch(dtmf)\r\n { \r\n case '00': aReturn='A'; break;\r\n case '01': aReturn='B'; break;\r\n case '02': aReturn='C'; break;\r\n case '03': aReturn='D'; break;\r\n case '04': aReturn='E'; break;\r\n case '05': aReturn='F'; break;\r\n case '06': aReturn='G'; break;\r\n case '07': aReturn='H'; break;\r\n case '08': aReturn='I'; break;\r\n case '09': aReturn='J'; break;\r\n case '10': aReturn='K'; break;\r\n case '11': aReturn='L'; break;\r\n case '12': aReturn='M'; break;\r\n case '13': aReturn='N'; break;\r\n case '14': aReturn='O'; break;\r\n case '15': aReturn='P'; break;\r\n case '16': aReturn='Q'; break;\r\n case '17': aReturn='R'; break;\r\n case '18': aReturn='S'; break;\r\n case '19': aReturn='T'; break;\r\n case '20': aReturn='U'; break;\r\n case '21': aReturn='V'; break;\r\n case '22': aReturn='W'; break;\r\n case '23': aReturn='X'; break;\r\n case '24': aReturn='Y'; break;\r\n case '25': aReturn='Z'; break;\r\n case '26': aReturn='a'; break;\r\n case '27': aReturn='b'; break;\r\n case '28': aReturn='c'; break;\r\n case '29': aReturn='d'; break;\r\n case '30': aReturn='e'; break;\r\n case '31': aReturn='f'; break;\r\n case '32': aReturn='g'; break;\r\n case '33': aReturn='h'; break;\r\n case '34': aReturn='i'; break;\r\n case '35': aReturn='j'; break;\r\n case '36': aReturn='k'; break;\r\n case '37': aReturn='l'; break;\r\n case '38': aReturn='m'; break;\r\n case '39': aReturn='n'; break;\r\n case '40': aReturn='o'; break;\r\n case '41': aReturn='p'; break;\r\n case '42': aReturn='q'; break;\r\n case '43': aReturn='r'; break;\r\n case '44': aReturn='s'; break;\r\n case '45': aReturn='t'; break;\r\n case '46': aReturn='u'; break;\r\n case '47': aReturn='v'; break;\r\n case '48': aReturn='w'; break;\r\n case '49': aReturn='x'; break;\r\n case '50': aReturn='y'; break;\r\n case '51': aReturn='z'; break;\r\n case '52': aReturn='0'; break;\r\n case '53': aReturn='1'; break;\r\n case '54': aReturn='2'; break;\r\n case '55': aReturn='3'; break;\r\n case '56': aReturn='4'; break;\r\n case '57': aReturn='5'; break;\r\n case '58': aReturn='6'; break;\r\n case '59': aReturn='7'; break;\r\n case '60': aReturn='8'; break;\r\n case '61': aReturn='9'; break;\r\n case '62': aReturn='+'; break;\r\n case '63': aReturn='/'; break;\r\n default: aReturn=''; break;\r\n }\r\n }\r\n catch(err)\r\n {\r\n DebugLog(err.message.toString());\r\n }\r\n return aReturn;\r\n}", "title": "" }, { "docid": "cfd034a8343df6f98daa51f6678dde79", "score": "0.55103445", "text": "function n(x)\n{\n\treturn x.replace(/[^a-z0-9]/ig,'-');\n}", "title": "" }, { "docid": "f7fe960e71d4433f0ebc0c4c9fe557c9", "score": "0.55073506", "text": "function CharTo2KeyDTMF(valor)\r\n{\r\n let aReturn='';\r\n try\r\n {\r\n switch(valor)\r\n {\r\n case 'A': aReturn= '2A';break;\r\n case 'B': aReturn= '2B';break;\r\n case 'C': aReturn= '2C';break;\r\n case 'D': aReturn= '3A';break;\r\n case 'E': aReturn= '3B';break;\r\n case 'F': aReturn= '3C';break;\r\n case 'G': aReturn= '4A';break;\r\n case 'H': aReturn= '4B';break;\r\n case 'I': aReturn= '4C';break;\r\n case 'J': aReturn= '5A';break;\r\n case 'K': aReturn= '5B';break;\r\n case 'L': aReturn= '5C';break;\r\n case 'M': aReturn= '6A';break;\r\n case 'N': aReturn= '6B';break;\r\n case 'O': aReturn= '6C';break;\r\n case 'P': aReturn= '7A';break;\r\n case 'Q': aReturn= '7B';break;\r\n case 'R': aReturn= '7C';break;\r\n case 'S': aReturn= '7D';break;\r\n case 'T': aReturn= '8A';break;\r\n case 'U': aReturn= '8B';break;\r\n case 'V': aReturn= '8C';break; \r\n case 'W': aReturn= '9A';break;\r\n case 'X': aReturn= '9B';break;\r\n case 'Y': aReturn= '9C';break;\r\n case 'Z': aReturn= '9D';break;\r\n case ' ': aReturn= '1A';break;\r\n case ',': aReturn= '1B';break;\r\n case '.': aReturn= '1C';break;\r\n case '?': aReturn= '1D';break;\r\n default: aReturn = ''; break;\r\n }\r\n }\r\n catch(err)\r\n {\r\n DebugLog(err.message.toString());\r\n } \r\n return (aReturn);\r\n}", "title": "" }, { "docid": "b7e6229289614de0cb744a761aa2d263", "score": "0.5507108", "text": "function getDistrictCode(prefix) {\n let districtCode;\n switch(prefix.toUpperCase()) {\n case 'S':\n districtCode = 0;\n break;\n case 'A':\n districtCode = 1;\n break;\n case 'B':\n districtCode = 2;\n break;\n case 'C':\n districtCode = 3;\n break;\n case 'D':\n districtCode = 41;\n break;\n case 'E':\n districtCode = 42;\n break;\n case 'F':\n districtCode = 43;\n break;\n case 'F':\n districtCode = 5;\n break;\n case 'G':\n districtCode = 6;\n break;\n default:\n districtCode = -1;\n }\n\n return districtCode;\n }", "title": "" }, { "docid": "2006e76194643514c7191857f2256bb9", "score": "0.5505413", "text": "static getDimensionLabel(n) {\n\t\tlet alphabet = Array(26).fill('').map((n, i) => String.fromCharCode(97 + i)),\n\t\t\tdimSingle = alphabet.slice(-3).concat(alphabet.slice(0, -3));\n\t\treturn n <= 25 ? dimSingle[n] : alphabet[Math.floor(n / 25) - 1] + alphabet[n % 25];\n\t}", "title": "" }, { "docid": "acf9eeb34c09a8545236cd6094ccb6f6", "score": "0.5499382", "text": "function DNAStrand(dna){\n let new_arr = dna.split('');\n return new_arr.map(char => {\n if(char == 'A') {\n return 'T';\n }\n if(char == 'T') {\n return 'A';\n }\n if(char == 'G') {\n return 'C';\n }\n if(char == 'C') {\n return 'G';\n }\n }).join('')\n}", "title": "" }, { "docid": "e7847b62e22cc986bebffcc9de80ecfd", "score": "0.5490303", "text": "function get_dec_name()\n{\n\treturn \"CAN\";\n}", "title": "" }, { "docid": "f4ffda6f69508ed1b6b6d189594ccb16", "score": "0.54880667", "text": "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "title": "" }, { "docid": "f4ffda6f69508ed1b6b6d189594ccb16", "score": "0.54880667", "text": "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "title": "" }, { "docid": "f4ffda6f69508ed1b6b6d189594ccb16", "score": "0.54880667", "text": "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "title": "" }, { "docid": "f4ffda6f69508ed1b6b6d189594ccb16", "score": "0.54880667", "text": "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "title": "" }, { "docid": "f4ffda6f69508ed1b6b6d189594ccb16", "score": "0.54880667", "text": "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "title": "" }, { "docid": "f4ffda6f69508ed1b6b6d189594ccb16", "score": "0.54880667", "text": "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "title": "" }, { "docid": "f4ffda6f69508ed1b6b6d189594ccb16", "score": "0.54880667", "text": "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "title": "" } ]
cf7c4f5d4fb5b23d515c4ff8cc664bdc
Get the data destination type.
[ { "docid": "8019875d090026dc341c980116546efa", "score": "0.714835", "text": "function getDataDestinationType(dataDestination) {\n if (typeof dataDestination === 'string') {\n return '';\n }\n return 'remove' in dataDestination ? 'rdfjsStore' : dataDestination.type;\n}", "title": "" } ]
[ { "docid": "98725d825dc18ebedaaea980ffb8b92d", "score": "0.6582534", "text": "get destinationTypeInput() {\n return this._destinationType;\n }", "title": "" }, { "docid": "be6f85d7d17c59d0875850eb61696aae", "score": "0.65191704", "text": "function getDataDestinationValue(dataDestination) {\n return isDataDestinationRawType(dataDestination) ? dataDestination : dataDestination.value;\n}", "title": "" }, { "docid": "f7df49aecea1c66375570c1c4849be0f", "score": "0.6008869", "text": "get dataType() {\n return this.__dataType.get();\n }", "title": "" }, { "docid": "de695c234f2b3f90bf0f642c4060b98b", "score": "0.6003954", "text": "getDataType() {\n if (this.__fieldNode._spec) {\n if (this.__fieldNode._spec.type === 'google.protobuf.Any') {\n // check in @type field\n return this.__fieldNode['@type']._value.replace(/.*\\//, '');\n }\n return this.__fieldNode._spec.type;\n }\n return undefined;\n }", "title": "" }, { "docid": "bac4a3a570c97e83f35a3b23a85bab6c", "score": "0.58739877", "text": "get type() {\n return this._data.type;\n }", "title": "" }, { "docid": "5714689fdb193c7e1bbc3bcb81550a65", "score": "0.5790771", "text": "get streamType() {\n return this._data.type;\n }", "title": "" }, { "docid": "f3cf678a7bac186c00d770f2025473fa", "score": "0.55725014", "text": "function DataType(data){\n const x = typeof data\n return console.log(x)\n}", "title": "" }, { "docid": "6890e7959d2cbbe0ffdabccb6ca097c6", "score": "0.5550942", "text": "function dataType(value) {\n return typeof value\n}", "title": "" }, { "docid": "8d1701361698f7b32e6786e1bebff7ee", "score": "0.5514924", "text": "function PHPColumnValueNode_getDBColumnTypeAsString()\n{\n var retVal = \"\";\n\n // TODO - DHULSE - support for \"defined\" type for GetSQLValueString()...\n\n if (dwscripts.isStringDBColumnType(this.columnType)){\n retVal = \"text\";\n }\n else if (dwscripts.isIntegerDBColumnType(this.columnType)){\n retVal = \"int\";\n }\n else if (dwscripts.isDoubleDBColumnType(this.columnType)){\n retVal = \"double\";\n }\n else if (dwscripts.isDateDBColumnType(this.columnType)){\n retVal = \"date\";\n }\n return retVal;\n}", "title": "" }, { "docid": "758a8990166425fa64e3b1bcb1f3f535", "score": "0.5462573", "text": "function printoutDataType (argument) {\n return typeof argument;\n}", "title": "" }, { "docid": "9588275ee4e70f588deb28d2ea7869ff", "score": "0.541205", "text": "function convertType(current) {\n switch (current.dataType) {\n case 'boolean':\n return Boolean(current.value);\n case 'number':\n return +current.value;\n case 'null':\n return null;\n case 'undefined':\n return undefined;\n case 'string':\n return current.value;\n default:\n return 'Data type block failed';\n }\n}", "title": "" }, { "docid": "bc88429e217e874bfd94bb89fb772b05", "score": "0.53919095", "text": "function isDataDestinationRawType(dataDestination) {\n return typeof dataDestination === 'string' || 'remove' in dataDestination;\n}", "title": "" }, { "docid": "a89ed909607f0e65b994fe9d52fbe70d", "score": "0.5387263", "text": "function getDataType(val) {\r\n return Object.prototype.toString.call(val);\r\n}", "title": "" }, { "docid": "69c3cced902653a9bd162ad9f306521a", "score": "0.5369886", "text": "getType() {\n return this.m_type;\n }", "title": "" }, { "docid": "69c3cced902653a9bd162ad9f306521a", "score": "0.5369886", "text": "getType() {\n return this.m_type;\n }", "title": "" }, { "docid": "d50d81c79b5e183a779f652d9ca9d418", "score": "0.5358923", "text": "get JSON_DATA_TYPE() {\n this._JSON_DATA_TYPE = this._JSON_DATA_TYPE || (() => {\n\t switch (true) {\n case this.NATIVE_JSON_TYPE:\n // What ever the user specified, the default is JSON, IS JSON will be specified for CLOB, BLOB or VARCHAR2\n return this.DATA_TYPES.storageOptions.JSON_TYPE;\n case this.JSON_PARSING_SUPPORTED:\n\t\t return this.DATA_TYPES.storageOptions.JSON_TYPE === 'JSON' ? this.JSON_DB_STORAGE_MODEL : this.DATA_TYPES.storageOptions.JSON_TYPE \n default:\n return this.JSON_DB_STORAGE_MODEL\n }\n })()\n return this._JSON_DATA_TYPE\n }", "title": "" }, { "docid": "4362ddd3d5396f40e3e52edd0b448f24", "score": "0.53404677", "text": "function findType(data){\n return typeof data;\n }", "title": "" }, { "docid": "087d0b09de8f3f7d767e5368e4c652f1", "score": "0.5294703", "text": "function detectType(data1) {\n dataType = typeof data1\n console.log(`${data1} is a ${dataType} type!`)\n}", "title": "" }, { "docid": "e7a3896ac556bdec8882599afb238070", "score": "0.52814984", "text": "getType() {\n return this._type;\n }", "title": "" }, { "docid": "1c94ec2fdf120e1714561d0524a9bbdb", "score": "0.52510077", "text": "getType() {\n return this.getJavaClass().getTypeSync();\n }", "title": "" }, { "docid": "88e81d9e84c733749f65679ff6041e37", "score": "0.5149034", "text": "type() {\n return this._type;\n }", "title": "" }, { "docid": "b00e5aa5a0a17c833b1ab1fd6861ffd3", "score": "0.5137585", "text": "function getMimeType() {\n\t\treturn \"application/octet-stream\";\n\t}", "title": "" }, { "docid": "f477d2b9a63121e6b4cb499f2c1ea4e1", "score": "0.5104396", "text": "function DataType() {\r\n\r\n\t}", "title": "" }, { "docid": "09a027f146ef8560a803cd5c512e77c4", "score": "0.5101469", "text": "getDestination():String {\n }", "title": "" }, { "docid": "85cc9afd6e00f7fc85137ca744c374c7", "score": "0.50691473", "text": "get type() {}", "title": "" }, { "docid": "c9f81dc75a62ab24deb86b11007cc2b6", "score": "0.50625944", "text": "function determineType(data) {\n\tlet type;\n\tif (data.pressure !== undefined) {\n\t\ttype = 'THB';\n\t} else if (data.humidity !== undefined) {\n\t\ttype = 'TH';\n\t} else if (data.currentspeed !== undefined || data.averagespeed !== undefined) {\n\t\ttype = 'W';\n\t} else if (data.raintotal !== undefined || data.rainrate !== undefined) {\n\t\ttype = 'R';\n\t} else if (data.uvindex !== undefined) {\n\t\ttype = 'UV';\n\t} else if (data.brightness !== undefined) {\n\t\ttype = 'L';\n\t} else if (data.temperature !== undefined) {\n\t\ttype = 'T';\n\t}\n\treturn type;\n}", "title": "" }, { "docid": "2054e298d08d9744d19aaade73ea25bd", "score": "0.50462216", "text": "function prepareDataType(type) {\n if (!type) {\n return 'void';\n }\n\n if(Array.isArray(type)) {\n return 'array';\n }\n\n // TODO(schoon) - Add support for complex dataTypes, \"models\", etc.\n switch (type) {\n case 'buffer':\n return 'byte';\n case 'date':\n return 'Date';\n case 'number':\n return 'double';\n }\n\n return type;\n}", "title": "" }, { "docid": "39849204ea39d3335c7e8e09e77df07c", "score": "0.50448495", "text": "function getDataType(str)\r\n\t{\r\n\t\tvar params= str.split(\":\");\r\n\t\treturn params[4];\r\n\t}", "title": "" }, { "docid": "a225bc65735ae0a7866989b49c80b024", "score": "0.50345117", "text": "_type() {\n if (Utils.isObject(val)) {\n return 'object';\n } else if (Utils.isArray(val)) {\n return 'array';\n } else {\n return 'other';\n }\n }", "title": "" }, { "docid": "6b040b1ec70845db1caabc2deed0d255", "score": "0.50073814", "text": "get type() {\n return this.__type.get();\n }", "title": "" }, { "docid": "bb0272f28c48881bacdd4c0536b83e31", "score": "0.5002081", "text": "destination() { //string\n return this.dest;\n }", "title": "" }, { "docid": "8dc6933900609863ce8fde8931c6fc57", "score": "0.4999197", "text": "get type() {\n return this._opts.type;\n }", "title": "" }, { "docid": "2b14bd44553d64b8ce93bd03d12a1479", "score": "0.49925968", "text": "getType() {\n return this.type;\n }", "title": "" }, { "docid": "7e42d80c97ff0b468582885dd1802eea", "score": "0.4990758", "text": "type() {\n return this.file instanceof Blob ? this.file.type : this.file.mime;\n }", "title": "" }, { "docid": "6574dda400f2c35623bf25aae739406d", "score": "0.498811", "text": "get types() {\n return this._data.type;\n }", "title": "" }, { "docid": "3287eefb084c11096767c8f6cb8c4b6d", "score": "0.49844968", "text": "getMeasurementType() {\n var target = 'interface';\n if (typeof this.templateSrv.variables !== 'undefined') {\n var adhocVariables = this.templateSrv.variables.filter(filter => filter.type === 'adhoc');\n target = adhocVariables[0].name;\n }\n return target;\n }", "title": "" }, { "docid": "7a5cd0a2937c3eb0fd01d8ac1e8a2b98", "score": "0.4982351", "text": "get type() {\n\t\treturn this.__type;\n\t}", "title": "" }, { "docid": "7a5cd0a2937c3eb0fd01d8ac1e8a2b98", "score": "0.4982351", "text": "get type() {\n\t\treturn this.__type;\n\t}", "title": "" }, { "docid": "7a5cd0a2937c3eb0fd01d8ac1e8a2b98", "score": "0.4982351", "text": "get type() {\n\t\treturn this.__type;\n\t}", "title": "" }, { "docid": "7a5cd0a2937c3eb0fd01d8ac1e8a2b98", "score": "0.4982351", "text": "get type() {\n\t\treturn this.__type;\n\t}", "title": "" }, { "docid": "7a5cd0a2937c3eb0fd01d8ac1e8a2b98", "score": "0.4982351", "text": "get type() {\n\t\treturn this.__type;\n\t}", "title": "" }, { "docid": "7a5cd0a2937c3eb0fd01d8ac1e8a2b98", "score": "0.4982351", "text": "get type() {\n\t\treturn this.__type;\n\t}", "title": "" }, { "docid": "7a5cd0a2937c3eb0fd01d8ac1e8a2b98", "score": "0.4982351", "text": "get type() {\n\t\treturn this.__type;\n\t}", "title": "" }, { "docid": "7a5cd0a2937c3eb0fd01d8ac1e8a2b98", "score": "0.4982351", "text": "get type() {\n\t\treturn this.__type;\n\t}", "title": "" }, { "docid": "7a5cd0a2937c3eb0fd01d8ac1e8a2b98", "score": "0.4982351", "text": "get type() {\n\t\treturn this.__type;\n\t}", "title": "" }, { "docid": "7a5cd0a2937c3eb0fd01d8ac1e8a2b98", "score": "0.4982351", "text": "get type() {\n\t\treturn this.__type;\n\t}", "title": "" }, { "docid": "7a5cd0a2937c3eb0fd01d8ac1e8a2b98", "score": "0.4982351", "text": "get type() {\n\t\treturn this.__type;\n\t}", "title": "" }, { "docid": "8389999145eb01f3687bab7fb72593b5", "score": "0.49762356", "text": "get destination() {\n this.initialize();\n return this._destination;\n }", "title": "" }, { "docid": "60c93799066959493eb9cf0cdc647b2c", "score": "0.49714246", "text": "function getType( obj ) {\n var dataType = toClass.call( obj );\n dataType = dataType.split( ' ' )[ 1 ];\n dataType = dataType.substring( 0, dataType.length - 1 );\n\n return dataType;\n}", "title": "" }, { "docid": "080b91afd307fe599f2e8afcfe9028a3", "score": "0.4957517", "text": "static toType(value,typeName,options){const schema=TcHmi.System.Services.typeManager.getSchema(typeName);return null===schema?null:ValueConverter.toSchemaType(value,schema,options)}", "title": "" }, { "docid": "1e02ec1ae9bb4047ba4a6e075597e35d", "score": "0.495113", "text": "function getPropType(data: Object): string | null {\n if (!data) {\n return null;\n }\n var type = typeof data;\n\n if (type === 'object') {\n if (data._reactFragment) {\n return 'react_fragment';\n }\n if (Array.isArray(data)) {\n return 'array';\n }\n if (ArrayBuffer.isView(data)) {\n if (data instanceof DataView) {\n return 'data_view';\n }\n return 'typed_array';\n }\n if (data instanceof ArrayBuffer) {\n return 'array_buffer';\n }\n if (typeof data[Symbol.iterator] === 'function') {\n return 'iterator';\n }\n if (Object.prototype.toString.call(data) === '[object Date]') {\n return 'date';\n }\n }\n\n return type;\n}", "title": "" }, { "docid": "cd84474f46ec3b62ccf38590f3a50f64", "score": "0.4948908", "text": "function dataType(text) {\n var type = typeof text;\n return type;\n}", "title": "" }, { "docid": "277c098b91d53b38a4b57a8988ad4c60", "score": "0.49328622", "text": "getType() {\n if (this.type) {\n return util_1.util.tokenToBscType(this.type);\n }\n else if (reflection_1.isLiteralExpression(this.initialValue)) {\n return this.initialValue.type;\n }\n else {\n return new DynamicType_1.DynamicType();\n }\n }", "title": "" }, { "docid": "a7d534e88d068c064d079e80b76058ad", "score": "0.4920897", "text": "get sourceType() {\n return this._sourceType;\n }", "title": "" }, { "docid": "a7d534e88d068c064d079e80b76058ad", "score": "0.4920897", "text": "get sourceType() {\n return this._sourceType;\n }", "title": "" }, { "docid": "ff80a72bbc7c8f1a19765876020f8fb8", "score": "0.49195987", "text": "function dataType(value) {\n if (!(value instanceof Date) && !Array.isArray(value) && !(typeof value === 'null')) {\n return typeof value\n } else if ((value instanceof Date) || (Array.isArray(value))) {\n if (value instanceof Date) {\n return 'date'\n } else if (Array.isArray(value)) {\n return 'array'\n }\n } else if (typeof value === 'null') {\n return null\n }\n}", "title": "" }, { "docid": "357e9002e8fb30a0669234fbb6a351b1", "score": "0.49035466", "text": "getTypeExpression() {\r\n return this._getNodeFromCompilerNodeIfExists(this.compilerNode.typeExpression);\r\n }", "title": "" }, { "docid": "1f837da52f5ca9841f53f090bc5a76db", "score": "0.49015826", "text": "function getDataTypeString(gO, e) {\r\n\r\n // Where to search for dataType (if global, search in position 0)\r\n var typeDim;\r\n if (gO.typesInDim == -1) {\r\n\r\n typeDim = 0;\r\n\r\n } else {\r\n\r\n if (e != null) {\r\n\r\n // Which index's value should we get the value from (e.g., d3Tab2):\r\n var indx = expr2FortranString(e.exprArr[gO.typesInDim]);\r\n \r\n\t // Find what integer value this corresponds to (by looking at \r\n\t // TitleDefs_decl, where the values for each title are defined).\r\n // First, return assignment (e.g., d3Tab2=2) in numberString:\r\n var regex = new RegExp(indx + \"=[0-9]*\");\r\n var numberString = TitleDefs_decl.match(regex);\r\n // Then get the part of string after the = (i.e., the number):\r\n var numberss = (numberString.toString()).substring(\r\n numberString.toString().indexOf(\"=\") + 1);\r\n\r\n // Make integer number from string:\r\n typeDim = parseInt(numberss);\r\n\r\n } else { \r\n\t\t\r\n\t // In this case typesInDim != -1 and e == null (numDims > 1 will\r\n\t // be in the only valid cases).\r\n // And only occurs when a TYPE grid is passed to a function (using\r\n\t // only its name).\r\n\r\n //alert(\"Passing a TYPE grid\");\r\n\r\n return findTypeVarType(gO);\r\n\r\n }\r\n }\r\n\r\n if (gO.dataTypes[typeDim] === undefined) {\r\n\r\n alert(\"THIS SHOULDN'T OCCUR\");\r\n\r\n } else {\r\n\r\n switch (gO.dataTypes[typeDim]) {\r\n\r\n case 0:\r\n return \"INTEGER\";\r\n break;\r\n case 1:\r\n return \"REAL*8\";\r\n break;\r\n case 2:\r\n return \"STRING\"; \r\n\t\t//TODO: CAUTION: No such type in Fortran. Use \r\n //alternative. [STRING]\r\n break;\r\n case 3:\r\n return \"LOGICAL\";\r\n break;\r\n case 4:\r\n return \"CHARACTER\";\r\n break;\r\n case 5:\r\n //alert(\"Data type: real4 not supported in Fortran\"); //TODO:\r\n return \"REAL\";\r\n\t\tbreak;\r\n case 6:\r\n //alert(\"Data type: const not supported in Fortran\"); //TODO:\r\n\t return \"UNIQUEIND\"; //TT\t\r\n break;\r\n case 7:\r\n alert(\"Data type: func not supported in Fortran\"); //TODO: \r\n break;\r\n default:\r\n alert(\"Invalid input as data type\");\r\n\r\n }\r\n\r\n }\r\n\r\n}", "title": "" }, { "docid": "7f6541ee2852eac43fe66d8fbb691c11", "score": "0.4896773", "text": "get destination() {\n\t\treturn this.__destination;\n\t}", "title": "" }, { "docid": "7f6541ee2852eac43fe66d8fbb691c11", "score": "0.4896773", "text": "get destination() {\n\t\treturn this.__destination;\n\t}", "title": "" }, { "docid": "7f6541ee2852eac43fe66d8fbb691c11", "score": "0.4896773", "text": "get destination() {\n\t\treturn this.__destination;\n\t}", "title": "" }, { "docid": "384468f1d49e55a25b06e30f58115783", "score": "0.48913318", "text": "function type(obj) {\n return COMPATIBILITY.type(obj);\n }", "title": "" }, { "docid": "fc0fa0bfa1238d395f52cd427d87d107", "score": "0.48909223", "text": "function getType() {\n\t\t\tvar ans = null;\n\t\t\tif (_this.user.id) {\n\t\t\t\tans = _this.user.tipo;\n\t\t\t}\n\t\t\treturn ans;\n\t\t}", "title": "" }, { "docid": "7163e6ebe820dc5c6adcfd82f3ccf170", "score": "0.4880866", "text": "function getItemType(mimeType) {\n\t if (dndState.isDragging) return dndState.itemType || undefined;\n\t if (mimeType == MSIE_MIME_TYPE || mimeType == EDGE_MIME_TYPE) return null;\n\t return (mimeType && mimeType.substr(MIME_TYPE.length + 1)) || undefined;\n\t }", "title": "" }, { "docid": "36b3d5b1f2b8c86c4516ca253939dde0", "score": "0.4866423", "text": "function getDataType(data) {\n if (data === null) {\n return 'null';\n } else if (data === undefined) {\n return 'undefined';\n }\n\n if (Object(react_is[\"isElement\"])(data)) {\n return 'react_element';\n }\n\n if (typeof HTMLElement !== 'undefined' && data instanceof HTMLElement) {\n return 'html_element';\n }\n\n const type = typeof data;\n\n switch (type) {\n case 'bigint':\n return 'bigint';\n\n case 'boolean':\n return 'boolean';\n\n case 'function':\n return 'function';\n\n case 'number':\n if (Number.isNaN(data)) {\n return 'nan';\n } else if (!Number.isFinite(data)) {\n return 'infinity';\n } else {\n return 'number';\n }\n\n case 'object':\n if (Object(isArray[\"a\" /* default */])(data)) {\n return 'array';\n } else if (ArrayBuffer.isView(data)) {\n return utils_hasOwnProperty.call(data.constructor, 'BYTES_PER_ELEMENT') ? 'typed_array' : 'data_view';\n } else if (data.constructor && data.constructor.name === 'ArrayBuffer') {\n // HACK This ArrayBuffer check is gross; is there a better way?\n // We could try to create a new DataView with the value.\n // If it doesn't error, we know it's an ArrayBuffer,\n // but this seems kind of awkward and expensive.\n return 'array_buffer';\n } else if (typeof data[Symbol.iterator] === 'function') {\n const iterator = data[Symbol.iterator]();\n\n if (!iterator) {// Proxies might break assumptoins about iterators.\n // See github.com/facebook/react/issues/21654\n } else {\n return iterator === data ? 'opaque_iterator' : 'iterator';\n }\n } else if (data.constructor && data.constructor.name === 'RegExp') {\n return 'regexp';\n } else {\n // $FlowFixMe[method-unbinding]\n const toStringValue = Object.prototype.toString.call(data);\n\n if (toStringValue === '[object Date]') {\n return 'date';\n } else if (toStringValue === '[object HTMLAllCollection]') {\n return 'html_all_collection';\n }\n }\n\n return 'object';\n\n case 'string':\n return 'string';\n\n case 'symbol':\n return 'symbol';\n\n case 'undefined':\n if ( // $FlowFixMe[method-unbinding]\n Object.prototype.toString.call(data) === '[object HTMLAllCollection]') {\n return 'html_all_collection';\n }\n\n return 'undefined';\n\n default:\n return 'unknown';\n }\n}", "title": "" }, { "docid": "596e2c383522cfd5d2e10083bb330184", "score": "0.48619542", "text": "function getDataType(provider) {\n return DATATYPE_PREFIX + provider.datatype_identifier;\n }", "title": "" }, { "docid": "ea9eb525b64fc3fb20a156a4abfc4ea9", "score": "0.48469925", "text": "get type () { return this._type }", "title": "" }, { "docid": "5b3846d35093b7ba0a32dbe3dfc2c7aa", "score": "0.4845717", "text": "get datatype() {\n return new NamedNode(this.datatypeString);\n }", "title": "" }, { "docid": "e4874818f8502541f88f7bce50a9d179", "score": "0.48423415", "text": "function getColumnType(id) {\n\t\tvar column = $('#' + id);\n\t\tvar type = column.find('.column-type').val();\n\n\t\tif (type == 'ref') {\n\t\t\tvar referenced = column.find('.column-list').val();\n\n\t\t\tif (referenced) return getColumnType(referenced);\n\t\t} \n\t\telse if (type == 'text') {\n\t\t\tvar taille = column.find('.size').val();\n\t\t\tif (taille == '0') {\n\t\t\t\treturn 'TEXT';\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn 'VARCHAR(' + taille + ')';\n\t\t\t}\n\t\t}\n\t\telse if (type == 'seq') {\n\t\t\tvar prefixe = column.find('.prefix').val() || '';\n\t\t\tvar suffixe = column.find('.suffix').val() || '';\n\t\t\tif (prefixe == '' && suffixe == '') {\n\t\t\t\treturn 'INT';\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn 'VARCHAR(' + (11 + prefixe.length + suffixe.length) + ')';\n\t\t\t}\n\t\t}\n\t\telse if (type == 'decimal') {\n\t\t\treturn 'REAL';\n\t\t}\n\t\telse if (type == 'integer') {\n\t\t\treturn 'INT';\n\t\t}\n\t\telse if (type == 'date') {\n\t\t\treturn 'DATE';\n\t\t}\n\t\telse if (type == 'datetime') {\n\t\t\treturn 'DATETIME';\n\t\t}\n\n\t\treturn '<UNDEFINED>';\n\t}", "title": "" }, { "docid": "53924f8c5a187c75c7ca0555ba2e9adc", "score": "0.4841695", "text": "getType() {\n\t\t\treturn this.areaAndtype >> 6;\n\t\t}", "title": "" }, { "docid": "a558ab7822300becd6965e35b3f4e81f", "score": "0.48291945", "text": "function getTernType(propertyDataType, isMultiValued){\r\n if(propertyDataType===\"d:text\"){\r\n if(isMultiValued){\r\n type=\"[string]\";\r\n }else{\r\n type=\"string\";\r\n }\r\n }else if(propertyDataType ===\"d:noderef\"){\r\n if(isMultiValued){\r\n type =\"[ScriptNode]\";\r\n }else{\r\n type =\"ScriptNode\";\r\n }\r\n }else if(propertyDataType ===\"d:category\"){\r\n if(isMultiValued){\r\n type =\"[CategoryNode]\";\r\n }else{\r\n type =\"CategoryNode\";\r\n }\r\n }else if (propertyDataType === \"d:boolean\"){\r\n if(isMultiValued){\r\n type =\"[bool]\";\r\n }else{\r\n type =\"bool\";\r\n }\r\n }else if (propertyDataType === \"d:date\"||propertyDataType === \"d:datetime\"){\r\n if(isMultiValued){\r\n type =\"[Date.prototype]\";\r\n }else{\r\n type =\"Date.prototype\";\r\n }\r\n }else if (propertyDataType === \"d:int\"||propertyDataType === \"d:float\"||propertyDataType === \"d:double\"||propertyDataType === \"d:long\"){\r\n if(isMultiValued){\r\n type =\"[number]\";\r\n }else{\r\n type =\"number\";\r\n }\r\n }else if (propertyDataType === \"d:content\"){\r\n if(isMultiValued){\r\n type =\"[ScriptContent]\";\r\n }else{\r\n type =\"ScriptContent\";\r\n }\r\n }else{\r\n if(isMultiValued){\r\n type=\"[?]\";\r\n }else{\r\n type=\"?\";\r\n }\r\n }\r\n return type;\r\n }", "title": "" }, { "docid": "45ae14366101f83266e087dcd4e7534d", "score": "0.4825665", "text": "get type() {\n return this._carrier.type;\n }", "title": "" }, { "docid": "1dd8b9a271eb4c32e02f8731de2a7135", "score": "0.4822763", "text": "get sourceType() {\n return this._sourceType;\n }", "title": "" }, { "docid": "ba823b621efcee7d134b95d076909f8f", "score": "0.48050368", "text": "get type () {\n\t\treturn this._type;\n\t}", "title": "" }, { "docid": "ba823b621efcee7d134b95d076909f8f", "score": "0.48050368", "text": "get type () {\n\t\treturn this._type;\n\t}", "title": "" }, { "docid": "ba823b621efcee7d134b95d076909f8f", "score": "0.48050368", "text": "get type () {\n\t\treturn this._type;\n\t}", "title": "" }, { "docid": "ba823b621efcee7d134b95d076909f8f", "score": "0.48050368", "text": "get type () {\n\t\treturn this._type;\n\t}", "title": "" }, { "docid": "ba823b621efcee7d134b95d076909f8f", "score": "0.48050368", "text": "get type () {\n\t\treturn this._type;\n\t}", "title": "" }, { "docid": "ba823b621efcee7d134b95d076909f8f", "score": "0.48050368", "text": "get type () {\n\t\treturn this._type;\n\t}", "title": "" }, { "docid": "ba823b621efcee7d134b95d076909f8f", "score": "0.48050368", "text": "get type () {\n\t\treturn this._type;\n\t}", "title": "" }, { "docid": "ba823b621efcee7d134b95d076909f8f", "score": "0.48050368", "text": "get type () {\n\t\treturn this._type;\n\t}", "title": "" }, { "docid": "ba823b621efcee7d134b95d076909f8f", "score": "0.48050368", "text": "get type () {\n\t\treturn this._type;\n\t}", "title": "" }, { "docid": "ba823b621efcee7d134b95d076909f8f", "score": "0.48050368", "text": "get type () {\n\t\treturn this._type;\n\t}", "title": "" }, { "docid": "9b0d6e0d76350ff5d3b5e62990ec4b6d", "score": "0.48032308", "text": "get type() {\n return this._type;\n }", "title": "" }, { "docid": "9b0d6e0d76350ff5d3b5e62990ec4b6d", "score": "0.48032308", "text": "get type() {\n return this._type;\n }", "title": "" }, { "docid": "9b0d6e0d76350ff5d3b5e62990ec4b6d", "score": "0.48032308", "text": "get type() {\n return this._type;\n }", "title": "" }, { "docid": "9b0d6e0d76350ff5d3b5e62990ec4b6d", "score": "0.48032308", "text": "get type() {\n return this._type;\n }", "title": "" }, { "docid": "9b0d6e0d76350ff5d3b5e62990ec4b6d", "score": "0.48032308", "text": "get type() {\n return this._type;\n }", "title": "" }, { "docid": "9b0d6e0d76350ff5d3b5e62990ec4b6d", "score": "0.48032308", "text": "get type() {\n return this._type;\n }", "title": "" }, { "docid": "9b0d6e0d76350ff5d3b5e62990ec4b6d", "score": "0.48032308", "text": "get type() {\n return this._type;\n }", "title": "" }, { "docid": "9b0d6e0d76350ff5d3b5e62990ec4b6d", "score": "0.48032308", "text": "get type() {\n return this._type;\n }", "title": "" }, { "docid": "9b0d6e0d76350ff5d3b5e62990ec4b6d", "score": "0.48032308", "text": "get type() {\n return this._type;\n }", "title": "" }, { "docid": "9b0d6e0d76350ff5d3b5e62990ec4b6d", "score": "0.48032308", "text": "get type() {\n return this._type;\n }", "title": "" }, { "docid": "9b0d6e0d76350ff5d3b5e62990ec4b6d", "score": "0.48032308", "text": "get type() {\n return this._type;\n }", "title": "" }, { "docid": "9b0d6e0d76350ff5d3b5e62990ec4b6d", "score": "0.48032308", "text": "get type() {\n return this._type;\n }", "title": "" }, { "docid": "5e027e0f4b4762ad3cb7958f0353853b", "score": "0.47971776", "text": "getSqlServerNativeDataType(coldef) {\n switch(coldef.DATA_TYPE) {\n case 'varchar':\n if(coldef.CHARACTER_MAXIMUM_LENGTH == -1) {\n return this.mssql.VarChar(this.mssql.MAX);\n }\n return this.mssql.VarChar(parseInt(coldef.CHARACTER_MAXIMUM_LENGTH));\n case 'nvarchar':\n if(coldef.CHARACTER_MAXIMUM_LENGTH == -1) {\n return this.mssql.NVarChar(this.mssql.MAX);\n }\n return this.mssql.NVarChar(parseInt(coldef.CHARACTER_MAXIMUM_LENGTH));\n case 'char':\n return this.mssql.Char(parseInt(coldef.CHARACTER_MAXIMUM_LENGTH));\n case 'bigint':\n return this.mssql.BigInt;\n case 'int':\n return this.mssql.Int;\n case 'tinyint':\n return this.mssql.TinyInt;\n case 'bit':\n return this.mssql.Bit;\n case 'real':\n return this.mssql.Real;\n case 'image':\n return this.mssql.Image;\n case 'smallmoney':\n return this.mssql.SmallMoney;\n case 'money':\n return this.mssql.Money;\n case 'decimal':\n return this.mssql.Decimal(parseInt(coldef.NUMERIC_PRECISION), parseInt(coldef.NUMERIC_SCALE));\n case 'varbinary':\n if(coldef.CHARACTER_MAXIMUM_LENGTH == -1) {\n return this.mssql.VarBinary(this.mssql.MAX);\n }\n return this.mssql.VarBinary(parseInt(coldef.CHARACTER_OCTET_LENGTH));\n case 'smallint':\n return this.mssql.SmallInt;\n case 'smalldatetime':\n return this.mssql.NVarChar(30);\n case 'datetime':\n return this.mssql.NVarChar(30);\n case 'datetime2':\n return this.mssql.NVarChar(30);\n case 'time':\n return this.mssql.Time(parseInt(coldef.NUMERIC_SCALE));\n case 'datetimeoffset':\n return this.mssql.DateTimeOffset(parseInt(coldef.NUMERIC_SCALE));\n case 'numeric':\n return this.mssql.Numeric(parseInt(coldef.NUMERIC_PRECISION), parseInt(coldef.NUMERIC_SCALE));\n case 'uniqueidentifier':\n return this.mssql.UniqueIdentifier;\n case 'nchar':\n return this.mssql.NChar(parseInt(coldef.CHARACTER_MAXIMUM_LENGTH));\n case 'float':\n return this.mssql.Float;\n case 'date':\n return this.mssql.NVarChar(30);\n case 'text':\n return this.mssql.Text;\n case 'ntext':\n return this.mssql.NText;\n case 'xml':\n return this.mssql.Xml;\n case 'udt':\n return this.mssql.UDT;\n case 'geography':\n return this.mssql.Geography;\n case 'geometry':\n return this.mssql.Geometry;\n default:\n return \"Unrecognized data type \" + coldef.DATA_TYPE;\n }\n }", "title": "" }, { "docid": "f2215f60307c9a1077696622da89ef7a", "score": "0.4779938", "text": "get dataType() {\n const { url } = this.options;\n if (url.match(/\\.rss$/)) return 'rss';\n return 'html';\n }", "title": "" }, { "docid": "30e76a83157b7caa3e217f8ac1b5ee1b", "score": "0.4777887", "text": "static kindOfInput (fileOrUrlOrData) {\n // If this is not a string,\n // it is probably already the raw data.\n if (typeof fileOrUrlOrData !== 'string') {\n return 'data'\n }\n if (fileOrUrlOrData.match(/^https?:\\/\\//)) {\n return 'url'\n }\n return 'file'\n }", "title": "" }, { "docid": "7f29c2532782c49c6f0287883169d8c5", "score": "0.47776037", "text": "get type() {\r\n return this._type;\r\n }", "title": "" }, { "docid": "0f60b0b1caf43a4ca7b5b6717c55f2d1", "score": "0.4776335", "text": "function whatIsTheDataType(date) {\n return Object.prototype.toString.call(date);\n}", "title": "" } ]
88eaf74e22e6c2e85199be3e84f4fff6
408 409 Retrieves a jQuery element's computed CSS value as a floatingpoint number. // 410 If the queried value is nonnumeric (ex: IE can return "medium" for border width), will just return zero. // 411
[ { "docid": "9d2380522aae60ff587687b0ad0ebe72", "score": "0.7516368", "text": "function getCssFloat(el, prop) { // 412\n\treturn parseFloat(el.css(prop)) || 0; // 413\n} // 414", "title": "" } ]
[ { "docid": "546397ec2f8a80b5d474eb983359c072", "score": "0.7193292", "text": "function num(elem, prop) {\r\n\treturn elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;\r\n}", "title": "" }, { "docid": "546397ec2f8a80b5d474eb983359c072", "score": "0.7193292", "text": "function num(elem, prop) {\r\n\treturn elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;\r\n}", "title": "" }, { "docid": "7b9b8e55bd4aa39ba07bfe099bfb29c3", "score": "0.7152295", "text": "function getCssFloat(el, prop) {\n return parseFloat(el.css(prop)) || 0;\n}", "title": "" }, { "docid": "7b9b8e55bd4aa39ba07bfe099bfb29c3", "score": "0.7152295", "text": "function getCssFloat(el, prop) {\n return parseFloat(el.css(prop)) || 0;\n}", "title": "" }, { "docid": "7b9b8e55bd4aa39ba07bfe099bfb29c3", "score": "0.7152295", "text": "function getCssFloat(el, prop) {\n return parseFloat(el.css(prop)) || 0;\n}", "title": "" }, { "docid": "7b9b8e55bd4aa39ba07bfe099bfb29c3", "score": "0.7152295", "text": "function getCssFloat(el, prop) {\n return parseFloat(el.css(prop)) || 0;\n}", "title": "" }, { "docid": "7b9b8e55bd4aa39ba07bfe099bfb29c3", "score": "0.7152295", "text": "function getCssFloat(el, prop) {\n return parseFloat(el.css(prop)) || 0;\n}", "title": "" }, { "docid": "7b9b8e55bd4aa39ba07bfe099bfb29c3", "score": "0.7152295", "text": "function getCssFloat(el, prop) {\n return parseFloat(el.css(prop)) || 0;\n}", "title": "" }, { "docid": "7b9b8e55bd4aa39ba07bfe099bfb29c3", "score": "0.7152295", "text": "function getCssFloat(el, prop) {\n return parseFloat(el.css(prop)) || 0;\n}", "title": "" }, { "docid": "7b9b8e55bd4aa39ba07bfe099bfb29c3", "score": "0.7152295", "text": "function getCssFloat(el, prop) {\n return parseFloat(el.css(prop)) || 0;\n}", "title": "" }, { "docid": "7b9b8e55bd4aa39ba07bfe099bfb29c3", "score": "0.7152295", "text": "function getCssFloat(el, prop) {\n return parseFloat(el.css(prop)) || 0;\n}", "title": "" }, { "docid": "1f5a7df7de1c036983ff9eb178349e5e", "score": "0.7118717", "text": "function getCssFloat(el, prop) {\n\treturn parseFloat(el.css(prop)) || 0;\n}", "title": "" }, { "docid": "1f5a7df7de1c036983ff9eb178349e5e", "score": "0.7118717", "text": "function getCssFloat(el, prop) {\n\treturn parseFloat(el.css(prop)) || 0;\n}", "title": "" }, { "docid": "1f5a7df7de1c036983ff9eb178349e5e", "score": "0.7118717", "text": "function getCssFloat(el, prop) {\n\treturn parseFloat(el.css(prop)) || 0;\n}", "title": "" }, { "docid": "1f5a7df7de1c036983ff9eb178349e5e", "score": "0.7118717", "text": "function getCssFloat(el, prop) {\n\treturn parseFloat(el.css(prop)) || 0;\n}", "title": "" }, { "docid": "1f5a7df7de1c036983ff9eb178349e5e", "score": "0.7118717", "text": "function getCssFloat(el, prop) {\n\treturn parseFloat(el.css(prop)) || 0;\n}", "title": "" }, { "docid": "1f5a7df7de1c036983ff9eb178349e5e", "score": "0.7118717", "text": "function getCssFloat(el, prop) {\n\treturn parseFloat(el.css(prop)) || 0;\n}", "title": "" }, { "docid": "1f5a7df7de1c036983ff9eb178349e5e", "score": "0.7118717", "text": "function getCssFloat(el, prop) {\n\treturn parseFloat(el.css(prop)) || 0;\n}", "title": "" }, { "docid": "1f5a7df7de1c036983ff9eb178349e5e", "score": "0.7118717", "text": "function getCssFloat(el, prop) {\n\treturn parseFloat(el.css(prop)) || 0;\n}", "title": "" }, { "docid": "1f5a7df7de1c036983ff9eb178349e5e", "score": "0.7118717", "text": "function getCssFloat(el, prop) {\n\treturn parseFloat(el.css(prop)) || 0;\n}", "title": "" }, { "docid": "1f5a7df7de1c036983ff9eb178349e5e", "score": "0.7118717", "text": "function getCssFloat(el, prop) {\n\treturn parseFloat(el.css(prop)) || 0;\n}", "title": "" }, { "docid": "1f5a7df7de1c036983ff9eb178349e5e", "score": "0.7118717", "text": "function getCssFloat(el, prop) {\n\treturn parseFloat(el.css(prop)) || 0;\n}", "title": "" }, { "docid": "1f5a7df7de1c036983ff9eb178349e5e", "score": "0.7118717", "text": "function getCssFloat(el, prop) {\n\treturn parseFloat(el.css(prop)) || 0;\n}", "title": "" }, { "docid": "1f5a7df7de1c036983ff9eb178349e5e", "score": "0.7118717", "text": "function getCssFloat(el, prop) {\n\treturn parseFloat(el.css(prop)) || 0;\n}", "title": "" }, { "docid": "a52f1cfd9daaa1efcc6f570c9282d5aa", "score": "0.7084672", "text": "function intCss(elem, prop) {\n\treturn Math.ceil(parseFloat(vendorCss(elem, prop)));\n}", "title": "" }, { "docid": "a52f1cfd9daaa1efcc6f570c9282d5aa", "score": "0.7084672", "text": "function intCss(elem, prop) {\n\treturn Math.ceil(parseFloat(vendorCss(elem, prop)));\n}", "title": "" }, { "docid": "88a52df3e4aa1b5bd4683599d7d1e6d6", "score": "0.70713055", "text": "function num(elem, prop) {\n\treturn elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;\n}", "title": "" }, { "docid": "88a52df3e4aa1b5bd4683599d7d1e6d6", "score": "0.70713055", "text": "function num(elem, prop) {\n\treturn elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;\n}", "title": "" }, { "docid": "3f32d0728d7281625224e12f164d9827", "score": "0.7064568", "text": "function t(a,b){return parseFloat(a.css(b))||0}", "title": "" }, { "docid": "405bd83924a858bd5a75d6244b972cb3", "score": "0.7015878", "text": "function getCssFloat(el, prop) {\n\t\treturn parseFloat(el.css(prop)) || 0;\n\t}", "title": "" }, { "docid": "1048dc7e03b8690b500d6cc2bf177b6b", "score": "0.6950692", "text": "function num(elem, attr)\n\t\t{\n\t\t\treturn parseFloat($.curCSS( elem, attr, true)) || 0;\n\t\t}", "title": "" }, { "docid": "5f7ca57bd979bfa05bf6cd84b5e4aea6", "score": "0.67897016", "text": "function getPropValue(style, value) {\r\n return parseFloat(style.getPropertyValue(value)) || 0;\r\n}", "title": "" }, { "docid": "05be6e1c6d60cd88b21bf3693c67a59a", "score": "0.6781551", "text": "function getValue(css, parent, delta) {\n var value;\n var percentage;\n\n if (css.indexOf('px') !== -1) {\n value = parseFloat(css);\n } else if (css.indexOf('%') !== -1) {\n value = parseFloat(css);\n percentage = value / 100;\n value = percentage * parent;\n\n if (delta) {\n value -= delta * percentage;\n }\n } else {\n value = parent;\n }\n\n return value;\n }", "title": "" }, { "docid": "facb1491c8a57b8846eacc6783a2fa68", "score": "0.66373825", "text": "getCss(target, attr) {\n let val = null;\n let reg = null;\n let curEle = target;\n if (\"getComputedStyle\" in window) {\n val = window.getComputedStyle(curEle)[attr];//\n } else {\n if (attr === \"opacity\") {\n val = curEle.currentStyle[\"filter\"];//alpha(opacity=50)\n reg = /^alpha\\(opacity=((?:\\d|(?:[1-9]\\d+))(?:\\.\\d+)?)\\)$/;\n let temp = reg.exec(val)[1];\n val = temp ? temp / 100 : 1;\n val = parseFloat(val);\n } else {\n val = curEle.currentStyle[attr];\n }\n }\n //val = isNaN(parseFloat(val)) ? val : parseFloat(val);\n let reg1 = /^([+-]?(\\d|[1-9]\\d+)(\\.\\d+)?)(px|pt|rem|em|vh|vw|%)?$/;\n val = reg1.test(val) ? parseFloat(val) : val;// parseFloat trim unit\n return val;\n }", "title": "" }, { "docid": "0f43043030a4db728903dc92e9cf4fb2", "score": "0.6612128", "text": "function extractVal(styleHeight)\r\n { \r\n if ( styleHeight == null )\r\n {\r\n return 0;\r\n }\r\n \r\n //try\r\n {\r\n var px = styleHeight.indexOf(\"px\",0);\r\n var h = 0;\r\n if ( px >= 0 )\r\n {\r\n h = styleHeight.substr(0,px );\r\n }\r\n \r\n return h * 1;\r\n }\r\n //catch(ex){return 0;}\r\n }", "title": "" }, { "docid": "bec1522a4cbebb9662f0879cfaf61e7c", "score": "0.6591899", "text": "function sz(el, p) {\n return parseInt($.css(el,p),10)||0;\n }", "title": "" }, { "docid": "ea52f783a1b13d18c5dd88ce591f3274", "score": "0.6535796", "text": "function xGetComputedStyle(oEle, sProp)\r\n{\r\n var p = 0;\r\n if(document.defaultView && document.defaultView.getComputedStyle){\r\n p = document.defaultView.getComputedStyle(oEle,'').getPropertyValue(sProp)\r\n }\r\n else if(oEle.currentStyle) {\r\n // convert css property name to object property name for IE (can this be done with RE?)\r\n var a = sProp.split('-');\r\n sProp = a[0];\r\n for (var i=1; i<a.length; ++i) {\r\n c = a[i].charAt(0);\r\n sProp += a[i].replace(c, c.toUpperCase());\r\n } \r\n p = oEle.currentStyle[sProp];\r\n }\r\n return parseInt(p) || 0;\r\n}", "title": "" }, { "docid": "b112586a97e6fab426c602cac3e54cbc", "score": "0.65115815", "text": "function ki(t){return getComputedStyle(t)}", "title": "" }, { "docid": "715203f1d1c8a1f433bbcb393783fc11", "score": "0.65092057", "text": "function __getCurrentComputedStyle(el,attr){\n var attrValue = undefined;\n if(attr=='height' && __isIE){\n return el.offsetHeight;\n }\n if(attr=='width' && __isIE){\n return el.offsetWidth;\n }\n if (window.getComputedStyle && !__isIE)\n { // class A browsers\n\n if(el==document)el=document.body;\n var styledeclaration = document.defaultView.getComputedStyle(el, null);\n if(!styledeclaration) return ;\n attrValue = styledeclaration.getPropertyValue(attr);\n } else if (el.currentStyle) { // IE\n attrValue = el.currentStyle[attr];\n }\n// if(!isNumber(attrValue))attrValue=0;\n return attrValue?attrValue:0;\n}", "title": "" }, { "docid": "4da28a82162a507729d321559481a6e2", "score": "0.64753395", "text": "function d(e){return getComputedStyle(e)}", "title": "" }, { "docid": "fa06c992b00f7a87339836937f3f4a31", "score": "0.6473176", "text": "function getStyle(el, styleProp) {\n\tvar styleValue;\n\tif(el.currentStyle) styleValue = el.currentStyle[styleProp];\n\telse if(window.getComputedStyle) styleValue = document.defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);\n\tvar px = new RegExp('px');\n styleValue = styleValue.replace(px, '');\n\ttry { styleValue = styleValue - 0; } catch(e) { alert(e); }\n\treturn styleValue;\n}", "title": "" }, { "docid": "0f8a4bc4109903487de05bbc6759141d", "score": "0.6453997", "text": "function pixelValue(value)\n{\n return value + 'px';\n}", "title": "" }, { "docid": "d30aebe8d8f4e4f187086710d1037daa", "score": "0.6431393", "text": "function v(e){return getComputedStyle(e)}", "title": "" }, { "docid": "6880a29c51a2e9754cec92b95ee4bb16", "score": "0.64305735", "text": "function getCSSNum(name, style) {\r\n return parseFloat(style[getPrefixedName(name)]) || 0;\r\n }", "title": "" }, { "docid": "d6c712d42d2e9d96666c0cda9499f3fc", "score": "0.64147234", "text": "function d(t){return getComputedStyle(t)}", "title": "" }, { "docid": "54be8b7fe45a5328e556c345ec84193f", "score": "0.64128864", "text": "function getCSSPropertyValue(element, property) {\n\t\t\t\treturn parseInt(window.getComputedStyle(element, null).getPropertyValue(property), 10);\n\t\t\t}", "title": "" }, { "docid": "63d2fde5b97f7a8a9165ce432c45bbb1", "score": "0.6407302", "text": "function pixelValue(value)\r\n{\r\n return value + 'px';\r\n}", "title": "" }, { "docid": "596bf964eea06ed00d21962e3782a925", "score": "0.6392549", "text": "function r(e){return getComputedStyle(e)}", "title": "" }, { "docid": "596bf964eea06ed00d21962e3782a925", "score": "0.6392549", "text": "function r(e){return getComputedStyle(e)}", "title": "" }, { "docid": "596bf964eea06ed00d21962e3782a925", "score": "0.6392549", "text": "function r(e){return getComputedStyle(e)}", "title": "" }, { "docid": "596bf964eea06ed00d21962e3782a925", "score": "0.6392549", "text": "function r(e){return getComputedStyle(e)}", "title": "" }, { "docid": "596bf964eea06ed00d21962e3782a925", "score": "0.6392549", "text": "function r(e){return getComputedStyle(e)}", "title": "" }, { "docid": "596bf964eea06ed00d21962e3782a925", "score": "0.6392549", "text": "function r(e){return getComputedStyle(e)}", "title": "" }, { "docid": "596bf964eea06ed00d21962e3782a925", "score": "0.6392549", "text": "function r(e){return getComputedStyle(e)}", "title": "" }, { "docid": "596bf964eea06ed00d21962e3782a925", "score": "0.6392549", "text": "function r(e){return getComputedStyle(e)}", "title": "" }, { "docid": "f7bb97b5793ba1cd163128ebd1d42118", "score": "0.63880116", "text": "function getCss(curEle, attr) {\r\n var val;\r\n if (\"getComputedStyle\" in window) {\r\n val = getComputedStyle(curEle)[attr];\r\n } else {\r\n if (attr === \"opacity\") {\r\n var cur = curEle.currentStyle[\"filter\"];\r\n // alpha(opacity=30)\r\n var reg = /alpha\\(opacity=(\\d+(\\.\\d+)?)\\)/;\r\n val = reg.exec(cur)[1] / 100;\r\n } else {\r\n // 不是透明度执行此处代码\r\n val = curEle.currentStyle[attr];\r\n }\r\n }\r\n\r\n if (!isNaN(parseFloat(val))) {\r\n val = parseFloat(val);\r\n }\r\n return val;\r\n }", "title": "" }, { "docid": "d8cc56fc05fc75256b5e9bbd97c45c5e", "score": "0.6386645", "text": "function r(t){return getComputedStyle(t)}", "title": "" }, { "docid": "d8cc56fc05fc75256b5e9bbd97c45c5e", "score": "0.6386645", "text": "function r(t){return getComputedStyle(t)}", "title": "" }, { "docid": "d8cc56fc05fc75256b5e9bbd97c45c5e", "score": "0.6386645", "text": "function r(t){return getComputedStyle(t)}", "title": "" }, { "docid": "d8cc56fc05fc75256b5e9bbd97c45c5e", "score": "0.6386645", "text": "function r(t){return getComputedStyle(t)}", "title": "" }, { "docid": "d8cc56fc05fc75256b5e9bbd97c45c5e", "score": "0.6386645", "text": "function r(t){return getComputedStyle(t)}", "title": "" }, { "docid": "d8cc56fc05fc75256b5e9bbd97c45c5e", "score": "0.6386645", "text": "function r(t){return getComputedStyle(t)}", "title": "" }, { "docid": "d8cc56fc05fc75256b5e9bbd97c45c5e", "score": "0.6386645", "text": "function r(t){return getComputedStyle(t)}", "title": "" }, { "docid": "15a3ebf7eb5c38b7f4b2561936d2fea6", "score": "0.6375792", "text": "function n(e){return getComputedStyle(e)}", "title": "" }, { "docid": "15a3ebf7eb5c38b7f4b2561936d2fea6", "score": "0.6375792", "text": "function n(e){return getComputedStyle(e)}", "title": "" }, { "docid": "15a3ebf7eb5c38b7f4b2561936d2fea6", "score": "0.6375792", "text": "function n(e){return getComputedStyle(e)}", "title": "" }, { "docid": "15a3ebf7eb5c38b7f4b2561936d2fea6", "score": "0.6375792", "text": "function n(e){return getComputedStyle(e)}", "title": "" }, { "docid": "d2da89452d3463cdd0ede08a495a92ca", "score": "0.6366299", "text": "function getCSSprop(elementID, cssvalue){\n var returnvalue=\"\";\n returnvalue=document.defaultView.getComputedStyle(elementID, null).getPropertyValue(cssvalue);\n return returnvalue;\n}", "title": "" }, { "docid": "7b7b5c0f1638932280be11a27d06edc7", "score": "0.6363021", "text": "function i(t){return getComputedStyle(t)}", "title": "" }, { "docid": "7c9b34f69cd6f51e5bdc29ffbc057be3", "score": "0.63381124", "text": "function computePropertyValue (element, property) {\n\t /* When box-sizing isn't set to border-box, height and width style values are incorrectly computed when an element's scrollbars are visible (which expands the element's dimensions). Thus, we defer\n\t to the more accurate offsetHeight/Width property, which includes the total dimensions for interior, border, padding, and scrollbar. We subtract border and padding to get the sum of interior + scrollbar. */\n\t\n\t var computedValue = 0;\n\t\n\t /* IE<=8 doesn't support window.getComputedStyle, thus we defer to jQuery, which has an extensive array of hacks to accurately retrieve IE8 property values.\n\t Re-implementing that logic here is not worth bloating the codebase for a dying browser. The performance repercussions of using jQuery here are minimal since\n\t Velocity is optimized to rarely (and sometimes never) query the DOM. Further, the $.css() codepath isn't that slow. */\n\t if (IE <= 8) {\n\t computedValue = $.css(element, property); /* GET */\n\t /* All other browsers support getComputedStyle. The returned live object reference is cached onto its associated element so that it does not need to be refetched upon every GET. */\n\t } else {\n\t if (!forceStyleLookup) {\n\t if (property === \"height\" && CSS.getPropertyValue(element, \"boxSizing\").toString().toLowerCase() !== \"border-box\") {\n\t return element.offsetHeight - (parseFloat(CSS.getPropertyValue(element, \"borderTopWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"borderBottomWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingTop\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingBottom\")) || 0);\n\t } else if (property === \"width\" && CSS.getPropertyValue(element, \"boxSizing\").toString().toLowerCase() !== \"border-box\") {\n\t return element.offsetWidth - (parseFloat(CSS.getPropertyValue(element, \"borderLeftWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"borderRightWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingLeft\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingRight\")) || 0);\n\t }\n\t }\n\t\n\t var computedStyle;\n\t\n\t /* For elements that Velocity hasn't been called on directly (e.g. when Velocity queries the DOM on behalf of a parent of an element its animating), perform a direct getComputedStyle lookup since the object isn't cached. */\n\t if ($.data(element, NAME) === undefined) {\n\t computedStyle = window.getComputedStyle(element, null); /* GET */\n\t /* If the computedStyle object has yet to be cached, do so now. */\n\t } else if (!$.data(element, NAME).computedStyle) {\n\t computedStyle = $.data(element, NAME).computedStyle = window.getComputedStyle(element, null); /* GET */\n\t /* If computedStyle is cached, use it. */\n\t } else {\n\t computedStyle = $.data(element, NAME).computedStyle;\n\t }\n\t\n\t /* IE doesn't return a value for borderColor -- it only returns individual values for each border side's color. As a polyfill, default to querying for just the top border's color. */\n\t if (IE && property === \"borderColor\") {\n\t property = \"borderTopColor\";\n\t }\n\t\n\t /* IE9 has a bug in which the \"filter\" property must be accessed from computedStyle using the getPropertyValue method instead of a direct property lookup.\n\t The getPropertyValue method is slower than a direct lookup, which is why we avoid it by default. */\n\t if (IE === 9 && property === \"filter\") {\n\t computedValue = computedStyle.getPropertyValue(property); /* GET */\n\t } else {\n\t computedValue = computedStyle[property];\n\t }\n\t\n\t /* Fall back to the property's style value (if defined) when computedValue returns nothing, which can happen when the element hasn't been painted. */\n\t if (computedValue === \"\" || computedValue === null) {\n\t computedValue = element.style[property];\n\t }\n\t }\n\t\n\t /* For top, right, bottom, and left (TRBL) values that are set to \"auto\" on elements of \"fixed\" or \"absolute\" position, defer to jQuery for converting \"auto\" to a numeric value.\n\t (For elements with a \"static\" or \"relative\" position, \"auto\" has the same effect as being set to 0, so no conversion is necessary.) */\n\t /* An example of why numeric conversion is necessary: When an element with \"position:absolute\" has an untouched \"left\" property, which reverts to \"auto\", left's value is 0 relative to its parent element,\n\t but is often non-zero relative to its *containing* (not parent) element, which is the nearest \"position:relative\" ancestor or the viewport (and always the viewport in the case of \"position:fixed\"). */\n\t if (computedValue === \"auto\" && /^(top|right|bottom|left)$/i.test(property)) {\n\t var position = computePropertyValue(element, \"position\"); /* GET */\n\t\n\t /* For absolute positioning, jQuery's $.position() only returns values for top and left; right and bottom will have their \"auto\" value reverted to 0. */\n\t /* Note: A jQuery object must be created here since jQuery doesn't have a low-level alias for $.position(). Not a big deal since we're currently in a GET batch anyway. */\n\t if (position === \"fixed\" || (position === \"absolute\" && /top|left/i.test(property))) {\n\t /* Note: jQuery strips the pixel unit from its returned values; we re-add it here to conform with computePropertyValue's behavior. */\n\t computedValue = $(element).position()[property] + \"px\"; /* GET */\n\t }\n\t }\n\t\n\t return computedValue;\n\t }", "title": "" }, { "docid": "cb4d8f98608aa550628c4b288b189613", "score": "0.63373035", "text": "function l(e){return getComputedStyle(e)}", "title": "" }, { "docid": "e75435d72467e6874e452463c83591ef", "score": "0.6294814", "text": "function i(e){return getComputedStyle(e)}", "title": "" }, { "docid": "b4f029ce1aa2c38d0d355741921430d4", "score": "0.62935543", "text": "function getStyleSize( value ) {\n\t var num = parseFloat( value );\n\t // not a percent like '100%', and a number\n\t var isValid = value.indexOf('%') == -1 && !isNaN( num );\n\t return isValid && num;\n\t}", "title": "" }, { "docid": "b4f029ce1aa2c38d0d355741921430d4", "score": "0.62935543", "text": "function getStyleSize( value ) {\n\t var num = parseFloat( value );\n\t // not a percent like '100%', and a number\n\t var isValid = value.indexOf('%') == -1 && !isNaN( num );\n\t return isValid && num;\n\t}", "title": "" }, { "docid": "b4f029ce1aa2c38d0d355741921430d4", "score": "0.62935543", "text": "function getStyleSize( value ) {\n\t var num = parseFloat( value );\n\t // not a percent like '100%', and a number\n\t var isValid = value.indexOf('%') == -1 && !isNaN( num );\n\t return isValid && num;\n\t}", "title": "" }, { "docid": "b4f029ce1aa2c38d0d355741921430d4", "score": "0.62935543", "text": "function getStyleSize( value ) {\n\t var num = parseFloat( value );\n\t // not a percent like '100%', and a number\n\t var isValid = value.indexOf('%') == -1 && !isNaN( num );\n\t return isValid && num;\n\t}", "title": "" }, { "docid": "b4f029ce1aa2c38d0d355741921430d4", "score": "0.62935543", "text": "function getStyleSize( value ) {\n\t var num = parseFloat( value );\n\t // not a percent like '100%', and a number\n\t var isValid = value.indexOf('%') == -1 && !isNaN( num );\n\t return isValid && num;\n\t}", "title": "" }, { "docid": "b4f029ce1aa2c38d0d355741921430d4", "score": "0.62935543", "text": "function getStyleSize( value ) {\n\t var num = parseFloat( value );\n\t // not a percent like '100%', and a number\n\t var isValid = value.indexOf('%') == -1 && !isNaN( num );\n\t return isValid && num;\n\t}", "title": "" }, { "docid": "8cbea1f5c7a521fe7e54c425789e2167", "score": "0.6292872", "text": "function n(t){return getComputedStyle(t)}", "title": "" }, { "docid": "8cbea1f5c7a521fe7e54c425789e2167", "score": "0.6292872", "text": "function n(t){return getComputedStyle(t)}", "title": "" }, { "docid": "8cbea1f5c7a521fe7e54c425789e2167", "score": "0.6292872", "text": "function n(t){return getComputedStyle(t)}", "title": "" }, { "docid": "8cbea1f5c7a521fe7e54c425789e2167", "score": "0.6292872", "text": "function n(t){return getComputedStyle(t)}", "title": "" }, { "docid": "56782b9d00a0fe70167bf3b3816df308", "score": "0.62867355", "text": "function getStyleSize( value ) {\n\t var num = parseFloat( value );\n\t // not a percent like '100%', and a number\n\t var isValid = value.indexOf('%') === -1 && !isNaN( num );\n\t return isValid && num;\n\t}", "title": "" }, { "docid": "1c4e60e0f597a7d78090874a07cf0904", "score": "0.6281589", "text": "function getStyleSize( value ) {\r\n\t\t var num = parseFloat( value );\r\n\t\t // not a percent like '100%', and a number\r\n\t\t var isValid = value.indexOf('%') === -1 && !isNaN( num );\r\n\t\t return isValid && num;\r\n\t\t}", "title": "" }, { "docid": "39a8a586c5ae857c4db499d0908a3184", "score": "0.6279195", "text": "function t(e){return getComputedStyle(e)}", "title": "" }, { "docid": "72d4f3bb79bd20e07a066f1a77b80290", "score": "0.6277063", "text": "function Z(e){return getComputedStyle(e)}", "title": "" }, { "docid": "2642849751d286b3ff3af80332cc7f11", "score": "0.62722266", "text": "function pixelValue(value) {\n return value + 'px';\n}", "title": "" }, { "docid": "24720d589a5094dc447f11916598b092", "score": "0.62719667", "text": "function c(t){return getComputedStyle(t)}", "title": "" }, { "docid": "b05603eea9601616124a9debbec4f883", "score": "0.62570935", "text": "function getComputedStyle(prop,el) {\n\t\t/* istanbul ignore next */ //Not testable in PhantomJS\n\t\tfunction convertUnitsToPxForIE8(value) {\n\t\t\tvar PIXEL = /^\\d+(px)?$/i;\n\n\t\t\tif (PIXEL.test(value)) {\n\t\t\t\treturn parseInt(value,base);\n\t\t\t}\n\n\t\t\tvar\n\t\t\t\tstyle = el.style.left,\n\t\t\t\truntimeStyle = el.runtimeStyle.left;\n\n\t\t\tel.runtimeStyle.left = el.currentStyle.left;\n\t\t\tel.style.left = value || 0;\n\t\t\tvalue = el.style.pixelLeft;\n\t\t\tel.style.left = style;\n\t\t\tel.runtimeStyle.left = runtimeStyle;\n\n\t\t\treturn value;\n\t\t}\n\n\t\tvar retVal = 0;\n\t\tel = el || document.body;\n\n\t\t/* istanbul ignore else */ // Not testable in phantonJS\n\t\tif (('defaultView' in document) && ('getComputedStyle' in document.defaultView)) {\n\t\t\tretVal = document.defaultView.getComputedStyle(el, null);\n\t\t\tretVal = (null !== retVal) ? retVal[prop] : 0;\n\t\t} else {//IE8\n\t\t\tretVal = convertUnitsToPxForIE8(el.currentStyle[prop]);\n\t\t}\n\n\t\treturn parseInt(retVal,base);\n\t}", "title": "" }, { "docid": "6989394405e95d192c8deef1e35dc553", "score": "0.62514913", "text": "function calcPixel(node, // @param Node:\n prop, // @param String: property, \"left\", \"width\", ...\n value) { // @param CSSUnitString: \"10em\", \"10pt\", \"10px\", \"auto\"\n // @return Number: pixel value\n var style = node.style, mem = [style.left, 0, 0], // [left, position, display]\n position = \"position\",\n important = \"important\",\n setProperty = \"setProperty\",\n removeProperty = \"removeProperty\",\n getPropertyValue = \"getPropertyValue\";\n\n//{@mb\n if (_webkit) {\n//}@mb\n mem[1] = style[getPropertyValue](position);\n mem[2] = style[getPropertyValue](_display);\n style[setProperty](position, \"absolute\", important);\n style[setProperty](_display, \"block\", important);\n//{@mb\n }\n//}@mb\n style[setProperty](prop, value, important);\n // get pixel\n value = parseInt(getComputedStyle(node, 0).left);\n // restore\n style[removeProperty](prop);\n style[setProperty](prop, mem[0], \"\");\n//{@mb\n if (_webkit) {\n//}@mb\n style[removeProperty](position);\n style[removeProperty](_display);\n style[setProperty](position, mem[1], \"\");\n style[setProperty](_display, mem[2], \"\");\n//{@mb\n }\n//}@mb\n return value || 0;\n}", "title": "" }, { "docid": "0478b0d70b20b26839eee928b51143d4", "score": "0.6247936", "text": "function computePropertyValue(element, property) {\r\n /* When box-sizing isn't set to border-box, height and width style values are incorrectly computed when an\r\n element's scrollbars are visible (which expands the element's dimensions). Thus, we defer to the more accurate\r\n offsetHeight/Width property, which includes the total dimensions for interior, border, padding, and scrollbar.\r\n We subtract border and padding to get the sum of interior + scrollbar. */\r\n var computedValue = 0;\r\n\r\n /* IE<=8 doesn't support window.getComputedStyle, thus we defer to jQuery, which has an extensive array\r\n of hacks to accurately retrieve IE8 property values. Re-implementing that logic here is not worth bloating the\r\n codebase for a dying browser. The performance repercussions of using jQuery here are minimal since\r\n Velocity is optimized to rarely (and sometimes never) query the DOM. Further, the $.css() codepath isn't that slow. */\r\n if (IE <= 8) {\r\n computedValue = $.css(element, property); /* GET */\r\n /* All other browsers support getComputedStyle. The returned live object reference is cached onto its\r\n associated element so that it does not need to be refetched upon every GET. */\r\n } else {\r\n /* Browsers do not return height and width values for elements that are set to display:\"none\". Thus, we temporarily\r\n toggle display to the element type's default value. */\r\n var toggleDisplay = false;\r\n\r\n if (/^(width|height)$/.test(property) && CSS.getPropertyValue(element, \"display\") === 0) {\r\n toggleDisplay = true;\r\n CSS.setPropertyValue(element, \"display\", CSS.Values.getDisplayType(element));\r\n }\r\n\r\n function revertDisplay() {\r\n if (toggleDisplay) {\r\n CSS.setPropertyValue(element, \"display\", \"none\");\r\n }\r\n }\r\n\r\n if (!forceStyleLookup) {\r\n if (property === \"height\" && CSS.getPropertyValue(element, \"boxSizing\").toString().toLowerCase() !== \"border-box\") {\r\n var contentBoxHeight = element.offsetHeight - (parseFloat(CSS.getPropertyValue(element, \"borderTopWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"borderBottomWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingTop\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingBottom\")) || 0);\r\n revertDisplay();\r\n\r\n return contentBoxHeight;\r\n } else if (property === \"width\" && CSS.getPropertyValue(element, \"boxSizing\").toString().toLowerCase() !== \"border-box\") {\r\n var contentBoxWidth = element.offsetWidth - (parseFloat(CSS.getPropertyValue(element, \"borderLeftWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"borderRightWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingLeft\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingRight\")) || 0);\r\n revertDisplay();\r\n\r\n return contentBoxWidth;\r\n }\r\n }\r\n\r\n var computedStyle;\r\n\r\n /* For elements that Velocity hasn't been called on directly (e.g. when Velocity queries the DOM on behalf\r\n of a parent of an element its animating), perform a direct getComputedStyle lookup since the object isn't cached. */\r\n if (Data(element) === undefined) {\r\n computedStyle = window.getComputedStyle(element, null); /* GET */\r\n /* If the computedStyle object has yet to be cached, do so now. */\r\n } else if (!Data(element).computedStyle) {\r\n computedStyle = Data(element).computedStyle = window.getComputedStyle(element, null); /* GET */\r\n /* If computedStyle is cached, use it. */\r\n } else {\r\n computedStyle = Data(element).computedStyle;\r\n }\r\n\r\n /* IE and Firefox do not return a value for the generic borderColor -- they only return individual values for each border side's color.\r\n Also, in all browsers, when border colors aren't all the same, a compound value is returned that Velocity isn't setup to parse.\r\n So, as a polyfill for querying individual border side colors, we just return the top border's color and animate all borders from that value. */\r\n if (property === \"borderColor\") {\r\n property = \"borderTopColor\";\r\n }\r\n\r\n /* IE9 has a bug in which the \"filter\" property must be accessed from computedStyle using the getPropertyValue method\r\n instead of a direct property lookup. The getPropertyValue method is slower than a direct lookup, which is why we avoid it by default. */\r\n if (IE === 9 && property === \"filter\") {\r\n computedValue = computedStyle.getPropertyValue(property); /* GET */\r\n } else {\r\n computedValue = computedStyle[property];\r\n }\r\n\r\n /* Fall back to the property's style value (if defined) when computedValue returns nothing,\r\n which can happen when the element hasn't been painted. */\r\n if (computedValue === \"\" || computedValue === null) {\r\n computedValue = element.style[property];\r\n }\r\n\r\n revertDisplay();\r\n }\r\n\r\n /* For top, right, bottom, and left (TRBL) values that are set to \"auto\" on elements of \"fixed\" or \"absolute\" position,\r\n defer to jQuery for converting \"auto\" to a numeric value. (For elements with a \"static\" or \"relative\" position, \"auto\" has the same\r\n effect as being set to 0, so no conversion is necessary.) */\r\n /* An example of why numeric conversion is necessary: When an element with \"position:absolute\" has an untouched \"left\"\r\n property, which reverts to \"auto\", left's value is 0 relative to its parent element, but is often non-zero relative\r\n to its *containing* (not parent) element, which is the nearest \"position:relative\" ancestor or the viewport (and always the viewport in the case of \"position:fixed\"). */\r\n if (computedValue === \"auto\" && /^(top|right|bottom|left)$/i.test(property)) {\r\n var position = computePropertyValue(element, \"position\"); /* GET */\r\n\r\n /* For absolute positioning, jQuery's $.position() only returns values for top and left;\r\n right and bottom will have their \"auto\" value reverted to 0. */\r\n /* Note: A jQuery object must be created here since jQuery doesn't have a low-level alias for $.position().\r\n Not a big deal since we're currently in a GET batch anyway. */\r\n if (position === \"fixed\" || (position === \"absolute\" && /top|left/i.test(property))) {\r\n /* Note: jQuery strips the pixel unit from its returned values; we re-add it here to conform with computePropertyValue's behavior. */\r\n computedValue = $(element).position()[property] + \"px\"; /* GET */\r\n }\r\n }\r\n\r\n return computedValue;\r\n }", "title": "" }, { "docid": "2bf976e51eb332a6d1b1bef8b64126a6", "score": "0.6243132", "text": "function computePropertyValue (element, property) {\n\t /* When box-sizing isn't set to border-box, height and width style values are incorrectly computed when an\n\t element's scrollbars are visible (which expands the element's dimensions). Thus, we defer to the more accurate\n\t offsetHeight/Width property, which includes the total dimensions for interior, border, padding, and scrollbar.\n\t We subtract border and padding to get the sum of interior + scrollbar. */\n\t var computedValue = 0;\n\n\t /* IE<=8 doesn't support window.getComputedStyle, thus we defer to jQuery, which has an extensive array\n\t of hacks to accurately retrieve IE8 property values. Re-implementing that logic here is not worth bloating the\n\t codebase for a dying browser. The performance repercussions of using jQuery here are minimal since\n\t Velocity is optimized to rarely (and sometimes never) query the DOM. Further, the $.css() codepath isn't that slow. */\n\t if (IE <= 8) {\n\t computedValue = $.css(element, property); /* GET */\n\t /* All other browsers support getComputedStyle. The returned live object reference is cached onto its\n\t associated element so that it does not need to be refetched upon every GET. */\n\t } else {\n\t /* Browsers do not return height and width values for elements that are set to display:\"none\". Thus, we temporarily\n\t toggle display to the element type's default value. */\n\t var toggleDisplay = false;\n\n\t if (/^(width|height)$/.test(property) && CSS.getPropertyValue(element, \"display\") === 0) {\n\t toggleDisplay = true;\n\t CSS.setPropertyValue(element, \"display\", CSS.Values.getDisplayType(element));\n\t }\n\n\t function revertDisplay () {\n\t if (toggleDisplay) {\n\t CSS.setPropertyValue(element, \"display\", \"none\");\n\t }\n\t }\n\n\t if (!forceStyleLookup) {\n\t if (property === \"height\" && CSS.getPropertyValue(element, \"boxSizing\").toString().toLowerCase() !== \"border-box\") {\n\t var contentBoxHeight = element.offsetHeight - (parseFloat(CSS.getPropertyValue(element, \"borderTopWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"borderBottomWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingTop\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingBottom\")) || 0);\n\t revertDisplay();\n\n\t return contentBoxHeight;\n\t } else if (property === \"width\" && CSS.getPropertyValue(element, \"boxSizing\").toString().toLowerCase() !== \"border-box\") {\n\t var contentBoxWidth = element.offsetWidth - (parseFloat(CSS.getPropertyValue(element, \"borderLeftWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"borderRightWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingLeft\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingRight\")) || 0);\n\t revertDisplay();\n\n\t return contentBoxWidth;\n\t }\n\t }\n\n\t var computedStyle;\n\n\t /* For elements that Velocity hasn't been called on directly (e.g. when Velocity queries the DOM on behalf\n\t of a parent of an element its animating), perform a direct getComputedStyle lookup since the object isn't cached. */\n\t if (Data(element) === undefined) {\n\t computedStyle = window.getComputedStyle(element, null); /* GET */\n\t /* If the computedStyle object has yet to be cached, do so now. */\n\t } else if (!Data(element).computedStyle) {\n\t computedStyle = Data(element).computedStyle = window.getComputedStyle(element, null); /* GET */\n\t /* If computedStyle is cached, use it. */\n\t } else {\n\t computedStyle = Data(element).computedStyle;\n\t }\n\n\t /* IE and Firefox do not return a value for the generic borderColor -- they only return individual values for each border side's color.\n\t Also, in all browsers, when border colors aren't all the same, a compound value is returned that Velocity isn't setup to parse.\n\t So, as a polyfill for querying individual border side colors, we just return the top border's color and animate all borders from that value. */\n\t if (property === \"borderColor\") {\n\t property = \"borderTopColor\";\n\t }\n\n\t /* IE9 has a bug in which the \"filter\" property must be accessed from computedStyle using the getPropertyValue method\n\t instead of a direct property lookup. The getPropertyValue method is slower than a direct lookup, which is why we avoid it by default. */\n\t if (IE === 9 && property === \"filter\") {\n\t computedValue = computedStyle.getPropertyValue(property); /* GET */\n\t } else {\n\t computedValue = computedStyle[property];\n\t }\n\n\t /* Fall back to the property's style value (if defined) when computedValue returns nothing,\n\t which can happen when the element hasn't been painted. */\n\t if (computedValue === \"\" || computedValue === null) {\n\t computedValue = element.style[property];\n\t }\n\n\t revertDisplay();\n\t }\n\n\t /* For top, right, bottom, and left (TRBL) values that are set to \"auto\" on elements of \"fixed\" or \"absolute\" position,\n\t defer to jQuery for converting \"auto\" to a numeric value. (For elements with a \"static\" or \"relative\" position, \"auto\" has the same\n\t effect as being set to 0, so no conversion is necessary.) */\n\t /* An example of why numeric conversion is necessary: When an element with \"position:absolute\" has an untouched \"left\"\n\t property, which reverts to \"auto\", left's value is 0 relative to its parent element, but is often non-zero relative\n\t to its *containing* (not parent) element, which is the nearest \"position:relative\" ancestor or the viewport (and always the viewport in the case of \"position:fixed\"). */\n\t if (computedValue === \"auto\" && /^(top|right|bottom|left)$/i.test(property)) {\n\t var position = computePropertyValue(element, \"position\"); /* GET */\n\n\t /* For absolute positioning, jQuery's $.position() only returns values for top and left;\n\t right and bottom will have their \"auto\" value reverted to 0. */\n\t /* Note: A jQuery object must be created here since jQuery doesn't have a low-level alias for $.position().\n\t Not a big deal since we're currently in a GET batch anyway. */\n\t if (position === \"fixed\" || (position === \"absolute\" && /top|left/i.test(property))) {\n\t /* Note: jQuery strips the pixel unit from its returned values; we re-add it here to conform with computePropertyValue's behavior. */\n\t computedValue = $(element).position()[property] + \"px\"; /* GET */\n\t }\n\t }\n\n\t return computedValue;\n\t }", "title": "" }, { "docid": "2bf976e51eb332a6d1b1bef8b64126a6", "score": "0.6243132", "text": "function computePropertyValue (element, property) {\n\t /* When box-sizing isn't set to border-box, height and width style values are incorrectly computed when an\n\t element's scrollbars are visible (which expands the element's dimensions). Thus, we defer to the more accurate\n\t offsetHeight/Width property, which includes the total dimensions for interior, border, padding, and scrollbar.\n\t We subtract border and padding to get the sum of interior + scrollbar. */\n\t var computedValue = 0;\n\n\t /* IE<=8 doesn't support window.getComputedStyle, thus we defer to jQuery, which has an extensive array\n\t of hacks to accurately retrieve IE8 property values. Re-implementing that logic here is not worth bloating the\n\t codebase for a dying browser. The performance repercussions of using jQuery here are minimal since\n\t Velocity is optimized to rarely (and sometimes never) query the DOM. Further, the $.css() codepath isn't that slow. */\n\t if (IE <= 8) {\n\t computedValue = $.css(element, property); /* GET */\n\t /* All other browsers support getComputedStyle. The returned live object reference is cached onto its\n\t associated element so that it does not need to be refetched upon every GET. */\n\t } else {\n\t /* Browsers do not return height and width values for elements that are set to display:\"none\". Thus, we temporarily\n\t toggle display to the element type's default value. */\n\t var toggleDisplay = false;\n\n\t if (/^(width|height)$/.test(property) && CSS.getPropertyValue(element, \"display\") === 0) {\n\t toggleDisplay = true;\n\t CSS.setPropertyValue(element, \"display\", CSS.Values.getDisplayType(element));\n\t }\n\n\t function revertDisplay () {\n\t if (toggleDisplay) {\n\t CSS.setPropertyValue(element, \"display\", \"none\");\n\t }\n\t }\n\n\t if (!forceStyleLookup) {\n\t if (property === \"height\" && CSS.getPropertyValue(element, \"boxSizing\").toString().toLowerCase() !== \"border-box\") {\n\t var contentBoxHeight = element.offsetHeight - (parseFloat(CSS.getPropertyValue(element, \"borderTopWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"borderBottomWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingTop\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingBottom\")) || 0);\n\t revertDisplay();\n\n\t return contentBoxHeight;\n\t } else if (property === \"width\" && CSS.getPropertyValue(element, \"boxSizing\").toString().toLowerCase() !== \"border-box\") {\n\t var contentBoxWidth = element.offsetWidth - (parseFloat(CSS.getPropertyValue(element, \"borderLeftWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"borderRightWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingLeft\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingRight\")) || 0);\n\t revertDisplay();\n\n\t return contentBoxWidth;\n\t }\n\t }\n\n\t var computedStyle;\n\n\t /* For elements that Velocity hasn't been called on directly (e.g. when Velocity queries the DOM on behalf\n\t of a parent of an element its animating), perform a direct getComputedStyle lookup since the object isn't cached. */\n\t if (Data(element) === undefined) {\n\t computedStyle = window.getComputedStyle(element, null); /* GET */\n\t /* If the computedStyle object has yet to be cached, do so now. */\n\t } else if (!Data(element).computedStyle) {\n\t computedStyle = Data(element).computedStyle = window.getComputedStyle(element, null); /* GET */\n\t /* If computedStyle is cached, use it. */\n\t } else {\n\t computedStyle = Data(element).computedStyle;\n\t }\n\n\t /* IE and Firefox do not return a value for the generic borderColor -- they only return individual values for each border side's color.\n\t Also, in all browsers, when border colors aren't all the same, a compound value is returned that Velocity isn't setup to parse.\n\t So, as a polyfill for querying individual border side colors, we just return the top border's color and animate all borders from that value. */\n\t if (property === \"borderColor\") {\n\t property = \"borderTopColor\";\n\t }\n\n\t /* IE9 has a bug in which the \"filter\" property must be accessed from computedStyle using the getPropertyValue method\n\t instead of a direct property lookup. The getPropertyValue method is slower than a direct lookup, which is why we avoid it by default. */\n\t if (IE === 9 && property === \"filter\") {\n\t computedValue = computedStyle.getPropertyValue(property); /* GET */\n\t } else {\n\t computedValue = computedStyle[property];\n\t }\n\n\t /* Fall back to the property's style value (if defined) when computedValue returns nothing,\n\t which can happen when the element hasn't been painted. */\n\t if (computedValue === \"\" || computedValue === null) {\n\t computedValue = element.style[property];\n\t }\n\n\t revertDisplay();\n\t }\n\n\t /* For top, right, bottom, and left (TRBL) values that are set to \"auto\" on elements of \"fixed\" or \"absolute\" position,\n\t defer to jQuery for converting \"auto\" to a numeric value. (For elements with a \"static\" or \"relative\" position, \"auto\" has the same\n\t effect as being set to 0, so no conversion is necessary.) */\n\t /* An example of why numeric conversion is necessary: When an element with \"position:absolute\" has an untouched \"left\"\n\t property, which reverts to \"auto\", left's value is 0 relative to its parent element, but is often non-zero relative\n\t to its *containing* (not parent) element, which is the nearest \"position:relative\" ancestor or the viewport (and always the viewport in the case of \"position:fixed\"). */\n\t if (computedValue === \"auto\" && /^(top|right|bottom|left)$/i.test(property)) {\n\t var position = computePropertyValue(element, \"position\"); /* GET */\n\n\t /* For absolute positioning, jQuery's $.position() only returns values for top and left;\n\t right and bottom will have their \"auto\" value reverted to 0. */\n\t /* Note: A jQuery object must be created here since jQuery doesn't have a low-level alias for $.position().\n\t Not a big deal since we're currently in a GET batch anyway. */\n\t if (position === \"fixed\" || (position === \"absolute\" && /top|left/i.test(property))) {\n\t /* Note: jQuery strips the pixel unit from its returned values; we re-add it here to conform with computePropertyValue's behavior. */\n\t computedValue = $(element).position()[property] + \"px\"; /* GET */\n\t }\n\t }\n\n\t return computedValue;\n\t }", "title": "" }, { "docid": "2bf976e51eb332a6d1b1bef8b64126a6", "score": "0.6243132", "text": "function computePropertyValue (element, property) {\n\t /* When box-sizing isn't set to border-box, height and width style values are incorrectly computed when an\n\t element's scrollbars are visible (which expands the element's dimensions). Thus, we defer to the more accurate\n\t offsetHeight/Width property, which includes the total dimensions for interior, border, padding, and scrollbar.\n\t We subtract border and padding to get the sum of interior + scrollbar. */\n\t var computedValue = 0;\n\n\t /* IE<=8 doesn't support window.getComputedStyle, thus we defer to jQuery, which has an extensive array\n\t of hacks to accurately retrieve IE8 property values. Re-implementing that logic here is not worth bloating the\n\t codebase for a dying browser. The performance repercussions of using jQuery here are minimal since\n\t Velocity is optimized to rarely (and sometimes never) query the DOM. Further, the $.css() codepath isn't that slow. */\n\t if (IE <= 8) {\n\t computedValue = $.css(element, property); /* GET */\n\t /* All other browsers support getComputedStyle. The returned live object reference is cached onto its\n\t associated element so that it does not need to be refetched upon every GET. */\n\t } else {\n\t /* Browsers do not return height and width values for elements that are set to display:\"none\". Thus, we temporarily\n\t toggle display to the element type's default value. */\n\t var toggleDisplay = false;\n\n\t if (/^(width|height)$/.test(property) && CSS.getPropertyValue(element, \"display\") === 0) {\n\t toggleDisplay = true;\n\t CSS.setPropertyValue(element, \"display\", CSS.Values.getDisplayType(element));\n\t }\n\n\t function revertDisplay () {\n\t if (toggleDisplay) {\n\t CSS.setPropertyValue(element, \"display\", \"none\");\n\t }\n\t }\n\n\t if (!forceStyleLookup) {\n\t if (property === \"height\" && CSS.getPropertyValue(element, \"boxSizing\").toString().toLowerCase() !== \"border-box\") {\n\t var contentBoxHeight = element.offsetHeight - (parseFloat(CSS.getPropertyValue(element, \"borderTopWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"borderBottomWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingTop\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingBottom\")) || 0);\n\t revertDisplay();\n\n\t return contentBoxHeight;\n\t } else if (property === \"width\" && CSS.getPropertyValue(element, \"boxSizing\").toString().toLowerCase() !== \"border-box\") {\n\t var contentBoxWidth = element.offsetWidth - (parseFloat(CSS.getPropertyValue(element, \"borderLeftWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"borderRightWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingLeft\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingRight\")) || 0);\n\t revertDisplay();\n\n\t return contentBoxWidth;\n\t }\n\t }\n\n\t var computedStyle;\n\n\t /* For elements that Velocity hasn't been called on directly (e.g. when Velocity queries the DOM on behalf\n\t of a parent of an element its animating), perform a direct getComputedStyle lookup since the object isn't cached. */\n\t if (Data(element) === undefined) {\n\t computedStyle = window.getComputedStyle(element, null); /* GET */\n\t /* If the computedStyle object has yet to be cached, do so now. */\n\t } else if (!Data(element).computedStyle) {\n\t computedStyle = Data(element).computedStyle = window.getComputedStyle(element, null); /* GET */\n\t /* If computedStyle is cached, use it. */\n\t } else {\n\t computedStyle = Data(element).computedStyle;\n\t }\n\n\t /* IE and Firefox do not return a value for the generic borderColor -- they only return individual values for each border side's color.\n\t Also, in all browsers, when border colors aren't all the same, a compound value is returned that Velocity isn't setup to parse.\n\t So, as a polyfill for querying individual border side colors, we just return the top border's color and animate all borders from that value. */\n\t if (property === \"borderColor\") {\n\t property = \"borderTopColor\";\n\t }\n\n\t /* IE9 has a bug in which the \"filter\" property must be accessed from computedStyle using the getPropertyValue method\n\t instead of a direct property lookup. The getPropertyValue method is slower than a direct lookup, which is why we avoid it by default. */\n\t if (IE === 9 && property === \"filter\") {\n\t computedValue = computedStyle.getPropertyValue(property); /* GET */\n\t } else {\n\t computedValue = computedStyle[property];\n\t }\n\n\t /* Fall back to the property's style value (if defined) when computedValue returns nothing,\n\t which can happen when the element hasn't been painted. */\n\t if (computedValue === \"\" || computedValue === null) {\n\t computedValue = element.style[property];\n\t }\n\n\t revertDisplay();\n\t }\n\n\t /* For top, right, bottom, and left (TRBL) values that are set to \"auto\" on elements of \"fixed\" or \"absolute\" position,\n\t defer to jQuery for converting \"auto\" to a numeric value. (For elements with a \"static\" or \"relative\" position, \"auto\" has the same\n\t effect as being set to 0, so no conversion is necessary.) */\n\t /* An example of why numeric conversion is necessary: When an element with \"position:absolute\" has an untouched \"left\"\n\t property, which reverts to \"auto\", left's value is 0 relative to its parent element, but is often non-zero relative\n\t to its *containing* (not parent) element, which is the nearest \"position:relative\" ancestor or the viewport (and always the viewport in the case of \"position:fixed\"). */\n\t if (computedValue === \"auto\" && /^(top|right|bottom|left)$/i.test(property)) {\n\t var position = computePropertyValue(element, \"position\"); /* GET */\n\n\t /* For absolute positioning, jQuery's $.position() only returns values for top and left;\n\t right and bottom will have their \"auto\" value reverted to 0. */\n\t /* Note: A jQuery object must be created here since jQuery doesn't have a low-level alias for $.position().\n\t Not a big deal since we're currently in a GET batch anyway. */\n\t if (position === \"fixed\" || (position === \"absolute\" && /top|left/i.test(property))) {\n\t /* Note: jQuery strips the pixel unit from its returned values; we re-add it here to conform with computePropertyValue's behavior. */\n\t computedValue = $(element).position()[property] + \"px\"; /* GET */\n\t }\n\t }\n\n\t return computedValue;\n\t }", "title": "" }, { "docid": "2bf976e51eb332a6d1b1bef8b64126a6", "score": "0.6243132", "text": "function computePropertyValue (element, property) {\n\t /* When box-sizing isn't set to border-box, height and width style values are incorrectly computed when an\n\t element's scrollbars are visible (which expands the element's dimensions). Thus, we defer to the more accurate\n\t offsetHeight/Width property, which includes the total dimensions for interior, border, padding, and scrollbar.\n\t We subtract border and padding to get the sum of interior + scrollbar. */\n\t var computedValue = 0;\n\n\t /* IE<=8 doesn't support window.getComputedStyle, thus we defer to jQuery, which has an extensive array\n\t of hacks to accurately retrieve IE8 property values. Re-implementing that logic here is not worth bloating the\n\t codebase for a dying browser. The performance repercussions of using jQuery here are minimal since\n\t Velocity is optimized to rarely (and sometimes never) query the DOM. Further, the $.css() codepath isn't that slow. */\n\t if (IE <= 8) {\n\t computedValue = $.css(element, property); /* GET */\n\t /* All other browsers support getComputedStyle. The returned live object reference is cached onto its\n\t associated element so that it does not need to be refetched upon every GET. */\n\t } else {\n\t /* Browsers do not return height and width values for elements that are set to display:\"none\". Thus, we temporarily\n\t toggle display to the element type's default value. */\n\t var toggleDisplay = false;\n\n\t if (/^(width|height)$/.test(property) && CSS.getPropertyValue(element, \"display\") === 0) {\n\t toggleDisplay = true;\n\t CSS.setPropertyValue(element, \"display\", CSS.Values.getDisplayType(element));\n\t }\n\n\t function revertDisplay () {\n\t if (toggleDisplay) {\n\t CSS.setPropertyValue(element, \"display\", \"none\");\n\t }\n\t }\n\n\t if (!forceStyleLookup) {\n\t if (property === \"height\" && CSS.getPropertyValue(element, \"boxSizing\").toString().toLowerCase() !== \"border-box\") {\n\t var contentBoxHeight = element.offsetHeight - (parseFloat(CSS.getPropertyValue(element, \"borderTopWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"borderBottomWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingTop\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingBottom\")) || 0);\n\t revertDisplay();\n\n\t return contentBoxHeight;\n\t } else if (property === \"width\" && CSS.getPropertyValue(element, \"boxSizing\").toString().toLowerCase() !== \"border-box\") {\n\t var contentBoxWidth = element.offsetWidth - (parseFloat(CSS.getPropertyValue(element, \"borderLeftWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"borderRightWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingLeft\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingRight\")) || 0);\n\t revertDisplay();\n\n\t return contentBoxWidth;\n\t }\n\t }\n\n\t var computedStyle;\n\n\t /* For elements that Velocity hasn't been called on directly (e.g. when Velocity queries the DOM on behalf\n\t of a parent of an element its animating), perform a direct getComputedStyle lookup since the object isn't cached. */\n\t if (Data(element) === undefined) {\n\t computedStyle = window.getComputedStyle(element, null); /* GET */\n\t /* If the computedStyle object has yet to be cached, do so now. */\n\t } else if (!Data(element).computedStyle) {\n\t computedStyle = Data(element).computedStyle = window.getComputedStyle(element, null); /* GET */\n\t /* If computedStyle is cached, use it. */\n\t } else {\n\t computedStyle = Data(element).computedStyle;\n\t }\n\n\t /* IE and Firefox do not return a value for the generic borderColor -- they only return individual values for each border side's color.\n\t Also, in all browsers, when border colors aren't all the same, a compound value is returned that Velocity isn't setup to parse.\n\t So, as a polyfill for querying individual border side colors, we just return the top border's color and animate all borders from that value. */\n\t if (property === \"borderColor\") {\n\t property = \"borderTopColor\";\n\t }\n\n\t /* IE9 has a bug in which the \"filter\" property must be accessed from computedStyle using the getPropertyValue method\n\t instead of a direct property lookup. The getPropertyValue method is slower than a direct lookup, which is why we avoid it by default. */\n\t if (IE === 9 && property === \"filter\") {\n\t computedValue = computedStyle.getPropertyValue(property); /* GET */\n\t } else {\n\t computedValue = computedStyle[property];\n\t }\n\n\t /* Fall back to the property's style value (if defined) when computedValue returns nothing,\n\t which can happen when the element hasn't been painted. */\n\t if (computedValue === \"\" || computedValue === null) {\n\t computedValue = element.style[property];\n\t }\n\n\t revertDisplay();\n\t }\n\n\t /* For top, right, bottom, and left (TRBL) values that are set to \"auto\" on elements of \"fixed\" or \"absolute\" position,\n\t defer to jQuery for converting \"auto\" to a numeric value. (For elements with a \"static\" or \"relative\" position, \"auto\" has the same\n\t effect as being set to 0, so no conversion is necessary.) */\n\t /* An example of why numeric conversion is necessary: When an element with \"position:absolute\" has an untouched \"left\"\n\t property, which reverts to \"auto\", left's value is 0 relative to its parent element, but is often non-zero relative\n\t to its *containing* (not parent) element, which is the nearest \"position:relative\" ancestor or the viewport (and always the viewport in the case of \"position:fixed\"). */\n\t if (computedValue === \"auto\" && /^(top|right|bottom|left)$/i.test(property)) {\n\t var position = computePropertyValue(element, \"position\"); /* GET */\n\n\t /* For absolute positioning, jQuery's $.position() only returns values for top and left;\n\t right and bottom will have their \"auto\" value reverted to 0. */\n\t /* Note: A jQuery object must be created here since jQuery doesn't have a low-level alias for $.position().\n\t Not a big deal since we're currently in a GET batch anyway. */\n\t if (position === \"fixed\" || (position === \"absolute\" && /top|left/i.test(property))) {\n\t /* Note: jQuery strips the pixel unit from its returned values; we re-add it here to conform with computePropertyValue's behavior. */\n\t computedValue = $(element).position()[property] + \"px\"; /* GET */\n\t }\n\t }\n\n\t return computedValue;\n\t }", "title": "" }, { "docid": "64d3818a0e516bd3a1795653edbeae02", "score": "0.6242832", "text": "function computePropertyValue (element, property) {\n\t /* When box-sizing isn't set to border-box, height and width style values are incorrectly computed when an\n\t element's scrollbars are visible (which expands the element's dimensions). Thus, we defer to the more accurate\n\t offsetHeight/Width property, which includes the total dimensions for interior, border, padding, and scrollbar.\n\t We subtract border and padding to get the sum of interior + scrollbar. */\n\t var computedValue = 0;\n\t\n\t /* IE<=8 doesn't support window.getComputedStyle, thus we defer to jQuery, which has an extensive array\n\t of hacks to accurately retrieve IE8 property values. Re-implementing that logic here is not worth bloating the\n\t codebase for a dying browser. The performance repercussions of using jQuery here are minimal since\n\t Velocity is optimized to rarely (and sometimes never) query the DOM. Further, the $.css() codepath isn't that slow. */\n\t if (IE <= 8) {\n\t computedValue = $.css(element, property); /* GET */\n\t /* All other browsers support getComputedStyle. The returned live object reference is cached onto its\n\t associated element so that it does not need to be refetched upon every GET. */\n\t } else {\n\t /* Browsers do not return height and width values for elements that are set to display:\"none\". Thus, we temporarily\n\t toggle display to the element type's default value. */\n\t var toggleDisplay = false;\n\t\n\t if (/^(width|height)$/.test(property) && CSS.getPropertyValue(element, \"display\") === 0) {\n\t toggleDisplay = true;\n\t CSS.setPropertyValue(element, \"display\", CSS.Values.getDisplayType(element));\n\t }\n\t\n\t function revertDisplay () {\n\t if (toggleDisplay) {\n\t CSS.setPropertyValue(element, \"display\", \"none\");\n\t }\n\t }\n\t\n\t if (!forceStyleLookup) {\n\t if (property === \"height\" && CSS.getPropertyValue(element, \"boxSizing\").toString().toLowerCase() !== \"border-box\") {\n\t var contentBoxHeight = element.offsetHeight - (parseFloat(CSS.getPropertyValue(element, \"borderTopWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"borderBottomWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingTop\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingBottom\")) || 0);\n\t revertDisplay();\n\t\n\t return contentBoxHeight;\n\t } else if (property === \"width\" && CSS.getPropertyValue(element, \"boxSizing\").toString().toLowerCase() !== \"border-box\") {\n\t var contentBoxWidth = element.offsetWidth - (parseFloat(CSS.getPropertyValue(element, \"borderLeftWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"borderRightWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingLeft\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingRight\")) || 0);\n\t revertDisplay();\n\t\n\t return contentBoxWidth;\n\t }\n\t }\n\t\n\t var computedStyle;\n\t\n\t /* For elements that Velocity hasn't been called on directly (e.g. when Velocity queries the DOM on behalf\n\t of a parent of an element its animating), perform a direct getComputedStyle lookup since the object isn't cached. */\n\t if (Data(element) === undefined) {\n\t computedStyle = window.getComputedStyle(element, null); /* GET */\n\t /* If the computedStyle object has yet to be cached, do so now. */\n\t } else if (!Data(element).computedStyle) {\n\t computedStyle = Data(element).computedStyle = window.getComputedStyle(element, null); /* GET */\n\t /* If computedStyle is cached, use it. */\n\t } else {\n\t computedStyle = Data(element).computedStyle;\n\t }\n\t\n\t /* IE and Firefox do not return a value for the generic borderColor -- they only return individual values for each border side's color.\n\t Also, in all browsers, when border colors aren't all the same, a compound value is returned that Velocity isn't setup to parse.\n\t So, as a polyfill for querying individual border side colors, we just return the top border's color and animate all borders from that value. */\n\t if (property === \"borderColor\") {\n\t property = \"borderTopColor\";\n\t }\n\t\n\t /* IE9 has a bug in which the \"filter\" property must be accessed from computedStyle using the getPropertyValue method\n\t instead of a direct property lookup. The getPropertyValue method is slower than a direct lookup, which is why we avoid it by default. */\n\t if (IE === 9 && property === \"filter\") {\n\t computedValue = computedStyle.getPropertyValue(property); /* GET */\n\t } else {\n\t computedValue = computedStyle[property];\n\t }\n\t\n\t /* Fall back to the property's style value (if defined) when computedValue returns nothing,\n\t which can happen when the element hasn't been painted. */\n\t if (computedValue === \"\" || computedValue === null) {\n\t computedValue = element.style[property];\n\t }\n\t\n\t revertDisplay();\n\t }\n\t\n\t /* For top, right, bottom, and left (TRBL) values that are set to \"auto\" on elements of \"fixed\" or \"absolute\" position,\n\t defer to jQuery for converting \"auto\" to a numeric value. (For elements with a \"static\" or \"relative\" position, \"auto\" has the same\n\t effect as being set to 0, so no conversion is necessary.) */\n\t /* An example of why numeric conversion is necessary: When an element with \"position:absolute\" has an untouched \"left\"\n\t property, which reverts to \"auto\", left's value is 0 relative to its parent element, but is often non-zero relative\n\t to its *containing* (not parent) element, which is the nearest \"position:relative\" ancestor or the viewport (and always the viewport in the case of \"position:fixed\"). */\n\t if (computedValue === \"auto\" && /^(top|right|bottom|left)$/i.test(property)) {\n\t var position = computePropertyValue(element, \"position\"); /* GET */\n\t\n\t /* For absolute positioning, jQuery's $.position() only returns values for top and left;\n\t right and bottom will have their \"auto\" value reverted to 0. */\n\t /* Note: A jQuery object must be created here since jQuery doesn't have a low-level alias for $.position().\n\t Not a big deal since we're currently in a GET batch anyway. */\n\t if (position === \"fixed\" || (position === \"absolute\" && /top|left/i.test(property))) {\n\t /* Note: jQuery strips the pixel unit from its returned values; we re-add it here to conform with computePropertyValue's behavior. */\n\t computedValue = $(element).position()[property] + \"px\"; /* GET */\n\t }\n\t }\n\t\n\t return computedValue;\n\t }", "title": "" }, { "docid": "64d3818a0e516bd3a1795653edbeae02", "score": "0.6242832", "text": "function computePropertyValue (element, property) {\n\t /* When box-sizing isn't set to border-box, height and width style values are incorrectly computed when an\n\t element's scrollbars are visible (which expands the element's dimensions). Thus, we defer to the more accurate\n\t offsetHeight/Width property, which includes the total dimensions for interior, border, padding, and scrollbar.\n\t We subtract border and padding to get the sum of interior + scrollbar. */\n\t var computedValue = 0;\n\t\n\t /* IE<=8 doesn't support window.getComputedStyle, thus we defer to jQuery, which has an extensive array\n\t of hacks to accurately retrieve IE8 property values. Re-implementing that logic here is not worth bloating the\n\t codebase for a dying browser. The performance repercussions of using jQuery here are minimal since\n\t Velocity is optimized to rarely (and sometimes never) query the DOM. Further, the $.css() codepath isn't that slow. */\n\t if (IE <= 8) {\n\t computedValue = $.css(element, property); /* GET */\n\t /* All other browsers support getComputedStyle. The returned live object reference is cached onto its\n\t associated element so that it does not need to be refetched upon every GET. */\n\t } else {\n\t /* Browsers do not return height and width values for elements that are set to display:\"none\". Thus, we temporarily\n\t toggle display to the element type's default value. */\n\t var toggleDisplay = false;\n\t\n\t if (/^(width|height)$/.test(property) && CSS.getPropertyValue(element, \"display\") === 0) {\n\t toggleDisplay = true;\n\t CSS.setPropertyValue(element, \"display\", CSS.Values.getDisplayType(element));\n\t }\n\t\n\t function revertDisplay () {\n\t if (toggleDisplay) {\n\t CSS.setPropertyValue(element, \"display\", \"none\");\n\t }\n\t }\n\t\n\t if (!forceStyleLookup) {\n\t if (property === \"height\" && CSS.getPropertyValue(element, \"boxSizing\").toString().toLowerCase() !== \"border-box\") {\n\t var contentBoxHeight = element.offsetHeight - (parseFloat(CSS.getPropertyValue(element, \"borderTopWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"borderBottomWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingTop\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingBottom\")) || 0);\n\t revertDisplay();\n\t\n\t return contentBoxHeight;\n\t } else if (property === \"width\" && CSS.getPropertyValue(element, \"boxSizing\").toString().toLowerCase() !== \"border-box\") {\n\t var contentBoxWidth = element.offsetWidth - (parseFloat(CSS.getPropertyValue(element, \"borderLeftWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"borderRightWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingLeft\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingRight\")) || 0);\n\t revertDisplay();\n\t\n\t return contentBoxWidth;\n\t }\n\t }\n\t\n\t var computedStyle;\n\t\n\t /* For elements that Velocity hasn't been called on directly (e.g. when Velocity queries the DOM on behalf\n\t of a parent of an element its animating), perform a direct getComputedStyle lookup since the object isn't cached. */\n\t if (Data(element) === undefined) {\n\t computedStyle = window.getComputedStyle(element, null); /* GET */\n\t /* If the computedStyle object has yet to be cached, do so now. */\n\t } else if (!Data(element).computedStyle) {\n\t computedStyle = Data(element).computedStyle = window.getComputedStyle(element, null); /* GET */\n\t /* If computedStyle is cached, use it. */\n\t } else {\n\t computedStyle = Data(element).computedStyle;\n\t }\n\t\n\t /* IE and Firefox do not return a value for the generic borderColor -- they only return individual values for each border side's color.\n\t Also, in all browsers, when border colors aren't all the same, a compound value is returned that Velocity isn't setup to parse.\n\t So, as a polyfill for querying individual border side colors, we just return the top border's color and animate all borders from that value. */\n\t if (property === \"borderColor\") {\n\t property = \"borderTopColor\";\n\t }\n\t\n\t /* IE9 has a bug in which the \"filter\" property must be accessed from computedStyle using the getPropertyValue method\n\t instead of a direct property lookup. The getPropertyValue method is slower than a direct lookup, which is why we avoid it by default. */\n\t if (IE === 9 && property === \"filter\") {\n\t computedValue = computedStyle.getPropertyValue(property); /* GET */\n\t } else {\n\t computedValue = computedStyle[property];\n\t }\n\t\n\t /* Fall back to the property's style value (if defined) when computedValue returns nothing,\n\t which can happen when the element hasn't been painted. */\n\t if (computedValue === \"\" || computedValue === null) {\n\t computedValue = element.style[property];\n\t }\n\t\n\t revertDisplay();\n\t }\n\t\n\t /* For top, right, bottom, and left (TRBL) values that are set to \"auto\" on elements of \"fixed\" or \"absolute\" position,\n\t defer to jQuery for converting \"auto\" to a numeric value. (For elements with a \"static\" or \"relative\" position, \"auto\" has the same\n\t effect as being set to 0, so no conversion is necessary.) */\n\t /* An example of why numeric conversion is necessary: When an element with \"position:absolute\" has an untouched \"left\"\n\t property, which reverts to \"auto\", left's value is 0 relative to its parent element, but is often non-zero relative\n\t to its *containing* (not parent) element, which is the nearest \"position:relative\" ancestor or the viewport (and always the viewport in the case of \"position:fixed\"). */\n\t if (computedValue === \"auto\" && /^(top|right|bottom|left)$/i.test(property)) {\n\t var position = computePropertyValue(element, \"position\"); /* GET */\n\t\n\t /* For absolute positioning, jQuery's $.position() only returns values for top and left;\n\t right and bottom will have their \"auto\" value reverted to 0. */\n\t /* Note: A jQuery object must be created here since jQuery doesn't have a low-level alias for $.position().\n\t Not a big deal since we're currently in a GET batch anyway. */\n\t if (position === \"fixed\" || (position === \"absolute\" && /top|left/i.test(property))) {\n\t /* Note: jQuery strips the pixel unit from its returned values; we re-add it here to conform with computePropertyValue's behavior. */\n\t computedValue = $(element).position()[property] + \"px\"; /* GET */\n\t }\n\t }\n\t\n\t return computedValue;\n\t }", "title": "" }, { "docid": "64d3818a0e516bd3a1795653edbeae02", "score": "0.6242832", "text": "function computePropertyValue (element, property) {\n\t /* When box-sizing isn't set to border-box, height and width style values are incorrectly computed when an\n\t element's scrollbars are visible (which expands the element's dimensions). Thus, we defer to the more accurate\n\t offsetHeight/Width property, which includes the total dimensions for interior, border, padding, and scrollbar.\n\t We subtract border and padding to get the sum of interior + scrollbar. */\n\t var computedValue = 0;\n\t\n\t /* IE<=8 doesn't support window.getComputedStyle, thus we defer to jQuery, which has an extensive array\n\t of hacks to accurately retrieve IE8 property values. Re-implementing that logic here is not worth bloating the\n\t codebase for a dying browser. The performance repercussions of using jQuery here are minimal since\n\t Velocity is optimized to rarely (and sometimes never) query the DOM. Further, the $.css() codepath isn't that slow. */\n\t if (IE <= 8) {\n\t computedValue = $.css(element, property); /* GET */\n\t /* All other browsers support getComputedStyle. The returned live object reference is cached onto its\n\t associated element so that it does not need to be refetched upon every GET. */\n\t } else {\n\t /* Browsers do not return height and width values for elements that are set to display:\"none\". Thus, we temporarily\n\t toggle display to the element type's default value. */\n\t var toggleDisplay = false;\n\t\n\t if (/^(width|height)$/.test(property) && CSS.getPropertyValue(element, \"display\") === 0) {\n\t toggleDisplay = true;\n\t CSS.setPropertyValue(element, \"display\", CSS.Values.getDisplayType(element));\n\t }\n\t\n\t function revertDisplay () {\n\t if (toggleDisplay) {\n\t CSS.setPropertyValue(element, \"display\", \"none\");\n\t }\n\t }\n\t\n\t if (!forceStyleLookup) {\n\t if (property === \"height\" && CSS.getPropertyValue(element, \"boxSizing\").toString().toLowerCase() !== \"border-box\") {\n\t var contentBoxHeight = element.offsetHeight - (parseFloat(CSS.getPropertyValue(element, \"borderTopWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"borderBottomWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingTop\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingBottom\")) || 0);\n\t revertDisplay();\n\t\n\t return contentBoxHeight;\n\t } else if (property === \"width\" && CSS.getPropertyValue(element, \"boxSizing\").toString().toLowerCase() !== \"border-box\") {\n\t var contentBoxWidth = element.offsetWidth - (parseFloat(CSS.getPropertyValue(element, \"borderLeftWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"borderRightWidth\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingLeft\")) || 0) - (parseFloat(CSS.getPropertyValue(element, \"paddingRight\")) || 0);\n\t revertDisplay();\n\t\n\t return contentBoxWidth;\n\t }\n\t }\n\t\n\t var computedStyle;\n\t\n\t /* For elements that Velocity hasn't been called on directly (e.g. when Velocity queries the DOM on behalf\n\t of a parent of an element its animating), perform a direct getComputedStyle lookup since the object isn't cached. */\n\t if (Data(element) === undefined) {\n\t computedStyle = window.getComputedStyle(element, null); /* GET */\n\t /* If the computedStyle object has yet to be cached, do so now. */\n\t } else if (!Data(element).computedStyle) {\n\t computedStyle = Data(element).computedStyle = window.getComputedStyle(element, null); /* GET */\n\t /* If computedStyle is cached, use it. */\n\t } else {\n\t computedStyle = Data(element).computedStyle;\n\t }\n\t\n\t /* IE and Firefox do not return a value for the generic borderColor -- they only return individual values for each border side's color.\n\t Also, in all browsers, when border colors aren't all the same, a compound value is returned that Velocity isn't setup to parse.\n\t So, as a polyfill for querying individual border side colors, we just return the top border's color and animate all borders from that value. */\n\t if (property === \"borderColor\") {\n\t property = \"borderTopColor\";\n\t }\n\t\n\t /* IE9 has a bug in which the \"filter\" property must be accessed from computedStyle using the getPropertyValue method\n\t instead of a direct property lookup. The getPropertyValue method is slower than a direct lookup, which is why we avoid it by default. */\n\t if (IE === 9 && property === \"filter\") {\n\t computedValue = computedStyle.getPropertyValue(property); /* GET */\n\t } else {\n\t computedValue = computedStyle[property];\n\t }\n\t\n\t /* Fall back to the property's style value (if defined) when computedValue returns nothing,\n\t which can happen when the element hasn't been painted. */\n\t if (computedValue === \"\" || computedValue === null) {\n\t computedValue = element.style[property];\n\t }\n\t\n\t revertDisplay();\n\t }\n\t\n\t /* For top, right, bottom, and left (TRBL) values that are set to \"auto\" on elements of \"fixed\" or \"absolute\" position,\n\t defer to jQuery for converting \"auto\" to a numeric value. (For elements with a \"static\" or \"relative\" position, \"auto\" has the same\n\t effect as being set to 0, so no conversion is necessary.) */\n\t /* An example of why numeric conversion is necessary: When an element with \"position:absolute\" has an untouched \"left\"\n\t property, which reverts to \"auto\", left's value is 0 relative to its parent element, but is often non-zero relative\n\t to its *containing* (not parent) element, which is the nearest \"position:relative\" ancestor or the viewport (and always the viewport in the case of \"position:fixed\"). */\n\t if (computedValue === \"auto\" && /^(top|right|bottom|left)$/i.test(property)) {\n\t var position = computePropertyValue(element, \"position\"); /* GET */\n\t\n\t /* For absolute positioning, jQuery's $.position() only returns values for top and left;\n\t right and bottom will have their \"auto\" value reverted to 0. */\n\t /* Note: A jQuery object must be created here since jQuery doesn't have a low-level alias for $.position().\n\t Not a big deal since we're currently in a GET batch anyway. */\n\t if (position === \"fixed\" || (position === \"absolute\" && /top|left/i.test(property))) {\n\t /* Note: jQuery strips the pixel unit from its returned values; we re-add it here to conform with computePropertyValue's behavior. */\n\t computedValue = $(element).position()[property] + \"px\"; /* GET */\n\t }\n\t }\n\t\n\t return computedValue;\n\t }", "title": "" }, { "docid": "563e86ed33fd074f9b0156d92ed84a9f", "score": "0.62420106", "text": "function getStyleSize( value ) {\r\n var num = parseFloat( value );\r\n // not a percent like '100%', and a number\r\n var isValid = value.indexOf('%') === -1 && !isNaN( num );\r\n return isValid && num;\r\n}", "title": "" }, { "docid": "3f85d88361bc097cf7fe6fd3c389abde", "score": "0.6240722", "text": "function po(e){return getComputedStyle(e)}", "title": "" } ]
3c7dbb9c95abb0b5f65fa82e58b503ee
validate ajax the category modal in adding stock table
[ { "docid": "c79fbf5210ca34c3c8a2f65e24d9e5bc", "score": "0.7433039", "text": "function ajax_validate(){\n$('#submit').click(function() {\n var form_data = {\n name: $('#name').val(),\n\t\tstatus: $('#status').val(),\n };\n $.ajax({\n url: \"http://localhost/projects/inventory/admin/category/ajax_validate\",\n type: 'POST',\n data: form_data,\n success: function(msg) {\n if (msg == 'success'){\n\t\t\t\t\t$('#alertmsg').hide();\n\t\t\t\t\t$('#sucmessage').show().html('<div class=\"alert alert-success\"><strong><i class=\"fa fa-check\"></i> Success ! </strong>Category Added Successfully.</div>');\t\t\t\t\t\n\t\t\t\t$('#productStockTable').ajax.reload(null, true);\n\t\t\t\t//$('#category').fadeOut('fast').load('<?php echo base_url().'admin/stock/get_cat' ?>').show('#category');\n\t\t\t}\n\t\t\t\t\n else\n $('#alertmsg').html('<div class=\"alert alert-danger\">' + msg + '</div>');\n }\n });\n return false;\n})}", "title": "" } ]
[ { "docid": "b2b41d7b159cc501fcfae015eeb1c9b8", "score": "0.7432481", "text": "function ajax_validate(){\n$('#submit').click(function() {\n var form_data = {\n name: $('#name').val(),\n\t\tstatus: $('#status').val(),\n };\n $.ajax({\n url: \"<?php echo base_url() ?>admin/category/ajax_validate\",\n type: 'POST',\n data: form_data,\n success: function(msg) {\n if (msg == 'success'){\n\t\t\t\t\t$('#alertmsg').hide();\n\t\t\t\t\t$('#sucmessage').show().html('<div class=\"alert alert-success\"><strong><i class=\"fa fa-check\"></i> Success ! </strong>Category Added Successfully.</div>');\t\t\t\t\t\n\t\t\t\t$('#productStockTable').ajax.reload(null, true);\n\t\t\t\t//$('#category').fadeOut('fast').load('<?php //echo base_url().'admin/stock/get_cat' ?>').show('#category');\n\t\t\t}\n\t\t\t\t\n else\n $('#alertmsg').html('<div class=\"alert alert-danger\">' + msg + '</div>');\n }\n });\n return false;\n})}", "title": "" }, { "docid": "d4344b3d1b72a4df6c5b3f6983b1784b", "score": "0.72437507", "text": "function NXCategoriesCreate() {\n //add category - form validation\n $(\"#commonModalForm\").validate().destroy();\n $(\"#commonModalForm\").validate({\n rules: {\n category_name: \"required\"\n },\n submitHandler: function (form) {\n nxAjaxUxRequest($(\"#commonModalSubmitButton\"));\n }\n });\n\n}", "title": "" }, { "docid": "544489116d511571a65726fd15a2ee8f", "score": "0.6786646", "text": "function _submit_data_category(){\n // SUBMIT NEW CATEGORY\n $('form#form_add_category').submit(function(e){\n e.preventDefault();\n _loading(1);\n $.post('/v1/api/data/products',{\n data: JSON.stringify({\n id: userData['id'],\n token: userData['token'],\n status: 1,\n category_name: $('#category_name').val(),\n })\n }, function (e) {\n if(e.status == '00'){\n if(e.data.status == '00'){\n $('#category_name').val('');\n $('.no_data').css('display', 'none');\n $('#data_body').prepend(\n '<tr id=\"data_category_' + e.data.id + '\">'+\n '<td><input class=\"check_data\" value=\"' + e.data.id + '\" type=\"checkbox\"></td>'+\n '<td class=\"data_category_name_' + e.data.id + '\">' + e.data.name + '</td>'+\n '<td class=\"data_category_list_' + e.data.id + '\">' + e.data.list.length + '</td>'+\n '<td>' +\n '<div class=\"menu\">'+\n '<i class=\"fas fa-ellipsis-h\"></i>'+\n '<div class=\"menu_dropdown\">'+\n '<a onclick=\"_open_category_modal(' + e.data.id + ')\">Edit</a>'+\n '<a class=\"logout\" onclick=\"_remove_category_modal(' + e.data.id + ')\">Remove</a>'+\n '</div>'+\n '</div>'+\n '</td>'+\n '</tr>'\n )\n close_sideform();\n _menu_dropdown();_check();\n notif('success', 'Product category has been successfully added');\n }else{\n notif('danger', e.data.message);\n }\n }\n }).fail(function(){\n notif('danger', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n });\n });\n\n // SUBMIT EDIT DATA CATEGORY\n $('form#form_edit_category').submit(function(e){\n e.preventDefault();\n _loading(1);\n $.post('/v1/api/data/products',{\n data: JSON.stringify({\n id: userData['id'],\n token: userData['token'],\n status: 3,\n category_name: $('#edit_category_name').val(),\n category_id: $('#edit_category_id').val(),\n })\n }, function (e) {\n if(e.status == '00'){\n $('#edit_category_name').val('');\n $('#edit_category_id').val('')\n $('.data_category_name_' + e.data.id).text(e.data.name);\n $('.data_category_list_' + e.data.id).text(e.data.list.length);\n close_sideform();\n }\n }).fail(function(){\n notif('danger', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n });\n });\n\n // SUBMIT REMOVE DATA CATEGORY\n $('form#form_remove_category').submit(function(e){\n e.preventDefault();\n _loading(1);\n $.post('/v1/api/data/products',{\n data: JSON.stringify({\n id: userData['id'],\n token: userData['token'],\n status: 4,\n category_id: $('#remove_category_id').val(),\n })\n }, function (e) {\n if(e.status == '00'){\n if(e.data.status == '00'){\n $('#remove_category_id').val('');\n $('#data_category_' + e.data.id).remove();\n close_sideform();\n let _list_row = $('#data_body > tr').length;\n if(_list_row == 0){\n $('.no_data').css('display', 'flex');\n }\n }else{\n notif('info', e.data.message);\n }\n }\n }).fail(function(){\n notif('danger', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n });\n });\n\n // SUBMIT REMOVE MANY DATA CATEGORY\n $('form#form_remove_many_category').submit(function(e){\n e.preventDefault();\n _loading(1);\n\n let category_list = []\n $('.check_data:checked').each(function() {\n category_list.push($(this).val());\n });\n\n $.post('/v1/api/data/products',{\n data: JSON.stringify({\n id: userData['id'],\n token: userData['token'],\n status: 5,\n category_list: category_list,\n })\n }, function (e) {\n if(e.status == '00'){\n for(i=0; i<e.data.length; i++){\n if(e.data[i].status == '00'){\n $('#data_category_' + e.data[i].id).remove();\n }else{\n\n }\n }\n close_sideform();\n }\n }).fail(function(){\n notif('danger', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n $('.check_all').prop('checked', false).change();\n });\n });\n}", "title": "" }, { "docid": "854e1640977fc73bd64237871a9bf319", "score": "0.6544485", "text": "function add_category(){\n\t$('#mod_add_category').modal();\n}", "title": "" }, { "docid": "2b595cf4b687b3dd1e913b7689780651", "score": "0.64930433", "text": "function addNewCategory(){\n \n/* alert($('#new_category_name').val());\nalert($('#add_row_status').val()); */\n var category_name = $('#new_category_name').val();\n var status = $('#add_row_status').val();\n\t$.ajax({\n\t\turl: base_url + \"admin/insertCategory\",\n\t\ttype: \"post\",\n\t\tdata: {category_name:category_name,status:status},\n\t\tsuccess: function(data) {\n\t\t\t$('#add_row').val(0); \n\t\t\t$('#add_row_status').val(0); \n\t\t\tcategoryDataTable();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "6a12460df60af105c855f4e75a94e6b9", "score": "0.64646137", "text": "function product_category_validation()\n{\n\treturn $('#product_category').valid();\n}", "title": "" }, { "docid": "4c4a1b40f6db49a83d75002d48584673", "score": "0.64390594", "text": "function checking_pre_add(main_id)\n{\n var main_name = jQuery(\"#category_name_check\").val();\n $.ajax({\n url: '/checking_category_exist',\n type: 'GET',\n data: {main_id: main_id, main_name: main_name},\n dataType: 'json',\n success: function(event)\n {\n if(event == false)\n {\n $(':button[type=\"submit\"]').prop('disabled', true);\n $(\".text-danger\").show();\n $(\".text-danger\").html(\"This Category Already Added\");\n }\n else if(event == true)\n {\n $(\".text-danger\").hide();\n $(':button[type=\"submit\"]').prop('disabled', false);\n }\n }\n })\n}", "title": "" }, { "docid": "c7953f843470b9db35226c46619f8f31", "score": "0.63337964", "text": "function _open_category_modal(cat_id){\n $.post('/v1/api/data/products',{\n data: JSON.stringify({\n id: userData['id'],\n token: userData['token'],\n status: 2,\n category_id: cat_id,\n })\n }, function (e) {\n if(e.status == '00'){\n $('#edit_category_modal_title').text(e.data.name);\n $('#edit_category_name').val(e.data.name);\n $('#edit_category_id').val(e.data.id);\n open_sideform('edit_category_modal');\n }\n }).fail(function(){\n notif('danger', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n });\n}", "title": "" }, { "docid": "2958d4c8f5cb1e02e65643a3ce362fc2", "score": "0.6290772", "text": "function addNewCategory(url){\r\n //clearFormModal();\r\n\r\n $(document).keydown(function(e) {\r\n \r\n //console.log(e.which);\r\n if (e.which == 27 ) //esc key\r\n {\r\n unblockModalForm();\r\n } \r\n });\r\n\r\n $('#add-new-category').click(function() {\r\n $('.error-cat').hide();\r\n customModalForm();\r\n });\r\n $('#cancel-add-category').click(function() {\r\n unblockModalForm();\r\n });\r\n \r\n //save handler\r\n $('#FormNewCategory').submit(function(){\r\n \r\n var title = $('input[name=\"titleCategory\"]').val();\r\n var lang = $('select[name=\"lang_category\"]').val();\r\n var content = tinyMCE.get('txtTinyCategory').getContent();\r\n \r\n if(title == \"\" && lang == 'default' && content == \"\")\r\n {\r\n $('.error-cat').fadeIn();\r\n }\r\n else if(title != \"\" && lang != 'default' && content != \"\")\r\n {\r\n $('.error-cat').hide();\r\n\r\n var params = {\r\n title:$('input[name=\"titleCategory\"]').val(),\r\n content: tinyMCE.get('txtTinyCategory').getContent(),\r\n lang_id : $('select[name=\"lang_category\"]').val()\r\n };\r\n var str = jQuery.param(params);\r\n\r\n $.ajax({\r\n type: $(this).attr('method'),\r\n url: $(this).attr('action'),\r\n data: str,\r\n dataType : 'json', \r\n success: function(data){\r\n\r\n $.post(url+'/manage/ajax/getcategory',\r\n {\r\n lang_id : $('select[name=\"lang_category\"]').val()\r\n },\r\n function(data){\r\n $('#addcategoryToContent').html(data.result);\r\n //$('#language_id').attr('value',lang_id);\r\n },'json');\r\n\r\n //$('select[name=\"addcategoryToContent\"]').append(data.result);\r\n unblockModalForm();\r\n clearFormModal();\r\n \r\n }\r\n }); \r\n }\r\n\r\n if(title == \"\")\r\n {\r\n $('#error-language-category').fadeIn();\r\n }\r\n else\r\n {\r\n $('#error-language-category').hide();\r\n }\r\n\r\n if(lang == 'default')\r\n {\r\n $('#error-language-category').fadeIn();\r\n }\r\n else\r\n {\r\n $('#error-language-category').hide();\r\n }\r\n\r\n if(content == \"\")\r\n {\r\n $('#error-content-category').fadeIn();\r\n }\r\n else\r\n {\r\n $('#error-content-category').hide();\r\n }\r\n return false;\r\n }); \r\n\r\n}", "title": "" }, { "docid": "d88a846e7fcd100ba75f623708f00804", "score": "0.6276794", "text": "function addNewCategory(url){\r\r\n //clearFormModal();\r\r\n\r\r\n $(document).keydown(function(e) {\r\r\n \r\r\n //console.log(e.which);\r\r\n if (e.which == 27 ) //esc key\r\r\n {\r\r\n unblockModalForm();\r\r\n } \r\r\n });\r\r\n\r\r\n $('#add-new-category').click(function() {\r\r\n $('.error-cat').hide();\r\r\n customModalForm();\r\r\n });\r\r\n $('#cancel-add-category').click(function() {\r\r\n unblockModalForm();\r\r\n });\r\r\n \r\r\n //save handler\r\r\n $('#FormNewCategory').submit(function(){\r\r\n \r\r\n var title = $('input[name=\"titleCategory\"]').val();\r\r\n var lang = $('select[name=\"lang_category\"]').val();\r\r\n var content = tinyMCE.get('txtTinyCategory').getContent();\r\r\n \r\r\n if(title == \"\" && lang == 'default' && content == \"\")\r\r\n {\r\r\n $('.error-cat').fadeIn();\r\r\n }\r\r\n else if(title != \"\" && lang != 'default' && content != \"\")\r\r\n {\r\r\n $('.error-cat').hide();\r\r\n\r\r\n var params = {\r\r\n title:$('input[name=\"titleCategory\"]').val(),\r\r\n content: tinyMCE.get('txtTinyCategory').getContent(),\r\r\n lang_id : $('select[name=\"lang_category\"]').val()\r\r\n };\r\r\n var str = jQuery.param(params);\r\r\n\r\r\n $.ajax({\r\r\n type: $(this).attr('method'),\r\r\n url: $(this).attr('action'),\r\r\n data: str,\r\r\n dataType : 'json', \r\r\n success: function(data){\r\r\n\r\r\n $.post(url+'/manage/ajax/getcategory',\r\r\n {\r\r\n lang_id : $('select[name=\"lang_category\"]').val()\r\r\n },\r\r\n function(data){\r\r\n $('#addcategoryToContent').html(data.result);\r\r\n //$('#language_id').attr('value',lang_id);\r\r\n },'json'); \r\r\n \r\r\n //$('select[name=\"addcategoryToContent\"]').append(data.result);\r\r\n unblockModalForm();\r\r\n clearFormModal();\r\r\n \r\r\n }\r\r\n }); \r\r\n }\r\r\n\r\r\n if(title == \"\")\r\r\n {\r\r\n $('#error-language-category').fadeIn();\r\r\n }\r\r\n else\r\r\n {\r\r\n $('#error-language-category').hide();\r\r\n }\r\r\n\r\r\n if(lang == 'default')\r\r\n {\r\r\n $('#error-language-category').fadeIn();\r\r\n }\r\r\n else\r\r\n {\r\r\n $('#error-language-category').hide();\r\r\n }\r\r\n\r\r\n if(content == \"\")\r\r\n {\r\r\n $('#error-content-category').fadeIn();\r\r\n }\r\r\n else\r\r\n {\r\r\n $('#error-content-category').hide();\r\r\n }\r\r\n return false;\r\r\n }); \r\r\n\r\r\n}", "title": "" }, { "docid": "1535493190a42ffb9f7acff0a01c12c6", "score": "0.6226428", "text": "function _remove_category_modal(cat_id){\n $.post('/v1/api/data/products',{\n data: JSON.stringify({\n id: userData['id'],\n token: userData['token'],\n status: 2,\n category_id: cat_id,\n })\n }, function (e) {\n if(e.status == '00'){\n $('#remove_category_modal_title').text(e.data.name);\n $('#remove_category_id').val(e.data.id);\n open_sideform('remove_category_modal');\n }\n }).fail(function(){\n notif('danger', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n });\n}", "title": "" }, { "docid": "fae8642b25a8ebe8b4a1271909848b83", "score": "0.6208522", "text": "function validateCatalogs(category) {\n\tvar catalogStr = collectCatalogs();\n\tjQuery.ajax({url:path + \"/products/validate?time=\"+ (new Date()).getTime(),\n\t\t\t\t type : 'POST',\n\t\t\t\t data : {\n\t\t\t\t \tcategory : category,\n\t\t\t\t \tcatalogStr : catalogStr\n\t\t\t\t },\n\t\t\t\t error : function() { alert(\"occur error!\") },\n\t\t\t\t success : function(data) {\n\t\t\t\t \tif (data != \"valid\") {\n\t\t\t\t \t\talert(\"Invalid catalog: \" + data);\n\t\t\t\t \t\treturn;\n\t\t\t\t \t} else {\n\t\t\t\t \t\tcalcTotalPrice();\n\t\t\t\t \t}\n\t\t\t\t \t\t\n\t\t\t\t }\n\t});\n}", "title": "" }, { "docid": "88462c78a25c5b2e64bd2874c6ec8071", "score": "0.6198498", "text": "function _products_category_list(){\n _loading(1);\n $.post('/v1/api/data/products',{\n data: JSON.stringify({\n 'id': userData['id'],\n 'token': userData['token'],\n 'status': 0,\n })\n }, function (e) {\n if(e.data.length > 0){\n $('.no_data').css('display', 'none');\n for(i=0; i<e.data.length; i++){\n $('#data_body').append(\n '<tr id=\"data_category_' + e.data[i].id + '\">'+\n '<td><input class=\"check_data\" value=\"' + e.data[i].id + '\" type=\"checkbox\"></td>'+\n '<td class=\"data_category_name_' + e.data[i].id + '\">' + e.data[i].name + '</td>'+\n '<td class=\"data_category_list_' + e.data[i].id + '\">' + e.data[i].list + '</td>'+\n '<td>' +\n '<div class=\"menu\">'+\n '<i class=\"fas fa-ellipsis-h\"></i>'+\n '<div class=\"menu_dropdown\">'+\n '<a onclick=\"_open_category_modal(' + e.data[i].id + ')\">Edit</a>'+\n '<a class=\"logout\" onclick=\"_remove_category_modal(' + e.data[i].id + ')\">Remove</a>'+\n '</div>'+\n '</div>'+\n '</td>'+\n '</tr>'\n )\n }\n _menu_dropdown();_check();\n }else{\n notif('info', 'Please, create at least a product category before you create your product item');\n $('.no_data').css('display', 'flex');\n $('a.mm').removeClass('actived');\n $('#nav_product-category').addClass('actived');\n }\n }).fail(function(){\n notif('danger', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n });\n}", "title": "" }, { "docid": "01b9487288d7c2957f60e992f03c78ea", "score": "0.6164726", "text": "function save_pre_form_category(category, category_name)\r\n{\r\n\t$('#bundle_select_submit').fadeOut();\r\n\tvar form_data = $('#form_category_'+category_name).review_data(1);\r\n\r\n\tif($.isEmptyObject(form_data))\r\n\t{\r\n\t\t$('#bundle_select_submit').fadeIn();\r\n\t\talert('Please enter a value');\r\n\t\treturn false;\r\n\t}\r\n\r\n\t$('#status-message').text('Saving your selection...');\r\n\r\n\t$('#status-window').dialog('open');\r\n\r\n\tvar data = { action: 'save_pre_form_category', mode: 'Sales.Create_Quote', form_data: JSON.stringify(form_data), category: category };\r\n\r\n\t$.ajax({\r\n\t\turl: '/',\r\n\t\tdataType: 'JSON',\r\n\t\ttype: 'POST',\r\n\t\tdata: data,\r\n\t\tsuccess: function(data)\r\n\t\t{\r\n\t\t\t$('#status-message').text('Selection saved. Please wait...');\r\n\r\n\t\t\tif(data.success)\r\n\t\t\t{\r\n\t\t\t\twindow.location = '/?m=Sales.Create_Quote';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$('#status-window').dialog('close');\r\n\t\t\t\t$('#bundle_select_submit').fadeIn();\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "4b8929c81767695374a50d97ff21351e", "score": "0.6155428", "text": "function Add() {\n //khai báo 1 object lấy dl từ form về\n var obj = {\n name: $('#name').val(),\n image: $('#image').val(),\n displayoder: $('#displayoder').val(),\n seotitle: $('#seotitle').val(),\n keyword: $('#keyword').val(),\n showonhome: $('#showonhome').val(),\n status: $('#status').val()\n }\n $.ajax({\n url: \"/Admin/Category/CreateCategory\",\n data: JSON.stringify(obj),\n type: \"POST\",\n contentType: \"application/json;charset=utf-8\",\n dataType: \"json\",\n success: function (Reposne) {\n //load data \n $('#myModal').modal('hide');\n ClearForm();\n loadData();\n \n //clear form\n },\n error: function (errormessage) {\n alert(errormessage.responseText);\n }\n\n })\n}", "title": "" }, { "docid": "87bd925345d60f2e9d2c2f35d59d8bc6", "score": "0.61451733", "text": "function opensubCate(id, name) {\n $('#subCategorytitle').html(name);\n $('#mainCatId').val(id);\n $.ajax({\n url: ajex_lab + 'admin/category/subCatDetail',\n type: 'post',\n data: {'id': id},\n dataType: 'json',\n beforeSend: subCatAddReqest,\n success: subCatAddResponse,\n error: function (xhr) {\n messageDialog({\n msg: ':( Server out of reach. Please try again later',\n error: true,\n closeBtnText: 'Close'\n });\n $('.overlay').addClass('hidden');\n\n\n }\n });\n\n}", "title": "" }, { "docid": "274d5e94887cb14f6251014feb13065d", "score": "0.61423683", "text": "function putCategory(dt) {\n if (dt[0].cat_id != 0) {\n $.each(dt, function (v, u) {\n let H = `<option value=\"${u.cat_id}\" data-content=\"${u.cat_id}\">${u.cat_name}</option>`;\n $('#txtCategoryPack').append(H);\n $('#txtCategoryProduct').append(H);\n $('#txtCategoryList').append(H);\n });\n }\n\n $('#txtCategoryPack').on('change', function () {\n let ops = `<option value=\"0\" selected>Selecciona una subcategoría</option>`;\n $('#txtSubcategoryPack').html(ops);\n let id = $(this).val();\n selSubcategoryPack(id);\n validator_part01();\n });\n\n $('#txtCategoryProduct').on('change', function () {\n let ops = `<option value=\"0\" selected>Selecciona una subcategoría</option>`;\n /* $('#txtSubcategoryProduct').val();\n $('#boxProducts').val();\n $('#listProducts .list-items').val(); */\n \n $('#txtSubcategoryProduct').html(ops);\n let id = $(this).val();\n console.log('Limpia', id);\n selSubcategoryProduct(id);\n // validator_part02();\n });\n\n $('#txtCategoryProduct')\n .unbind('click')\n .on('click', function () {\n $('.list-group').slideUp('slow');\n //console.log('Click categoria');\n });\n\n $('#txtCategoryList').on('change', function () {\n let catId = $(this).val();\n getPackages(catId);\n });\n}", "title": "" }, { "docid": "a62b73d130634ca8f8c57414e2accafe", "score": "0.6134663", "text": "function addRowToCategory(jqEvent) {\n var success = false;\n \n // Hide any error advice\n\n if($(jqEvent.currentTarget).hasClass(\"addCapacitor\")) {\n // Check if valid capacitor\n $('#capacitorFieldset').append(capacitorRow);\n $(\".addCapacitor\").on(\"click\", addRowToCategory);\n success = true;\n } else if($(jqEvent.currentTarget).hasClass(\"addResistor\")){\n // Check if valid resistor\n $('#resistorFieldset').append(resistorRow);\n $(\".addResistor\").on(\"click\", addRowToCategory);\n success = true;\n }\n if(success) {\n $(jqEvent.currentTarget).hide();\n } else {\n // Show error advice\n }\n\n}", "title": "" }, { "docid": "743a99e1b42d9e3441913902be9ef2b5", "score": "0.6119949", "text": "function blogCategorySubmit() {\n var error = '';\n var title = $.trim($('#modalAddBlogCategory [name=\"title[]\"]:first').val());\n if (!title) {\n error = 'Заглавието на езика по подразбиране е празно!';\n }\n if (variable.is_update == false && title) {\n $.ajax({\n async: false,\n type: \"POST\",\n url: variable.free_blog_category_url,\n data: {title: title}\n }).done(function (data) {\n if (data == '1') {\n error = 'Това заглавие се дублира. Трябва да бъде променено';\n }\n });\n }\n if (error.length > 0) {\n $('#modalAddBlogCategory .modal-errors').show().empty().append(error);\n return false;\n } else {\n $(\"#modalAddBlogCategory .submitPostCategory\").click();\n }\n}", "title": "" }, { "docid": "76cf76891f316ebca6897b119c923717", "score": "0.61148864", "text": "function validateCategory() {\n const ERROR = \"Musisz wybrać jakąś kategorię\";\n const categoryError = $(\".category-error\");\n\n (function() {\n if (!isCategorySelected()) {\n showErrorMessage();\n } else {\n categoryError.hide();\n }\n })();\n\n function isCategorySelected() {\n return categoryIdInputArray.length !== 0;\n }\n\n function showErrorMessage() {\n if (categoryError.length === 0) {\n let errorP = document.createElement(\"p\");\n errorP.innerHTML = ERROR;\n errorP.classList.add(\"form-donation-error\");\n errorP.classList.add(\"category-error\")\n $('.form--steps-counter').append(errorP);\n } else {\n if (categoryError.is(\":hidden\")) {\n categoryError.show();\n }\n }\n }\n\n return isCategorySelected();\n }", "title": "" }, { "docid": "11f47913d268a63147cb5b6b7a500fdd", "score": "0.61018926", "text": "function Add() {\n //alert(CKEDITOR.instances['Remarks'].getData());\n var date = new Date();\n var res = validate();\n if (res == false) {\n return false;\n }\n var category =\n {\n CategoryID: $('#CategoryID').val(),\n Level: $('#Level').val(),\n CategoryName: $('#CategoryName').val(),\n ParentCategoryID: $('#ParentCategoryId').val(),\n EditDate: date.toLocaleDateString(),\n Editor: 'thuan',\n Description: $('#Description').val(),\n Remarks: CKEDITOR.instances['Remarks'].getData()\n };\n //alert(JSON.stringify(category));\n $.ajax({\n url: \"/Home/Add\",\n data: JSON.stringify(category),\n type: \"POST\",\n contentType: \"application/json;charset=utf-8\",\n datatype: \"json\",\n success: function (result) {\n bootbox.alert('Add new category success!');\n //loaddatabyHung();\n loaddatabylevel($('#Level option:selected').val());\n loaddropdownlevel();\n //loaddropdownparentcatgory();\n $('#myModal').modal('hide');\n },\n error: function (errormessage) {\n alert(errormessage.responseText);\n }\n });\n\n}", "title": "" }, { "docid": "61ebdbab012daa6cd579ec9f0475b1b9", "score": "0.60594565", "text": "function addNewProduct() {\n let productCategory = $('.productCategory').val()\n let productSubCategory = $('.subCategory').val()\n let productDiscription = $('#productDiscription').val()\n if (!productDiscription || !productSubCategory || !productCategory) {\n alert(\"Input Required\");\n return false;\n }\n let newProduct = {\n productCategory,\n productDiscription,\n productSubCategory\n }\n $.ajax({\n type: \"POST\",\n contentType: \"application/json\",\n url: `${url}/addProduct`,\n data: JSON.stringify(newProduct),\n dataType: 'json',\n success: async function(data) {\n $('#productMasterModal').modal('hide');\n location.reload();\n },\n error: function(e) {\n alert(`Error : ${e.responseText}`)\n console.log(\"ERROR: \", e);\n }\n });\n}", "title": "" }, { "docid": "b556e77eed29d7b04fd46e91460bcf2e", "score": "0.6005292", "text": "function checkAddCat()\n{\n\twith (window.document.adddCatFrm) { \n\t if (isEmpty(cat_name, 'Please enter name')) {\n\t\t\treturn;\n\t\t}else if (isEmpty(cat_desc, 'Please enter description')) {\n\t\t\treturn;\n\t\t}else {\n\t\t\tsubmit();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "86c0b88577e95ca73c37bb2edee9a387", "score": "0.60032713", "text": "function valSubSCategory()\n{\n\tvar charstrng\t=\t/^[A-Za-z\\s]+$/;\n\tvar catgry\t\t=\t$.trim($('select#catgry').val());\n\tif(catgry == \"\")\n\t{\n\t\talert('Please select category');\n\t\t$('select#catgry').focus();\n\t\treturn false;\n\t}\n\tvar Subcatgry\t\t=\t$.trim($('select#Subcatgry').val());\n\tif(Subcatgry == \"\")\n\t{\n\t\talert('Please select sub category');\n\t\t$('select#Subcatgry').focus();\n\t\treturn false;\n\t}\n\tvar SubSubcatgry\t\t=\t$.trim($('input#SubSubcatgry').val());\n\tif(SubSubcatgry == \"\")\n\t{\n\t\talert('Please enter sub category');\n\t\t$('input#SubSubcatgry').focus();\n\t\treturn false;\n\t}\n\tif(!charstrng.test(SubSubcatgry) ) \n\t{ \n\t\talert(\"Please enter characters only\");\n\t\t$('input#SubSubcatgry').focus();\n\t\treturn false;\n\t}\n\t$('#submit').hide();\n\t$('#Cancel').hide();\n\t$('#loadingImg').show();\n\tvar dataStrng\t=\t'SubSubcatgry='+SubSubcatgry+'&Subcatgry='+Subcatgry+'&catgry='+catgry;\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"Ajax/newSSubCategory.php\",\n\t\tcache: false,\n\t\tdata:dataStrng,\n\t\tsuccess: function(data) { \t\n\t\t\tif(data == 0)\n\t\t\t{\n\t\t\t\talert('Similar Category already exist');\n\t\t\t\t$('#loadingImg').hide();\n\t\t\t\t$('#submit').show();\n\t\t\t\t$('#Cancel').show();\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$('#loadingImg').hide();\n\t\t\t\talert('Sub Category added sucessfully');\n\t\t\t\twindow.location='SubSubCategories.php';\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "1f9086898243440aff432366bfceed11", "score": "0.5999065", "text": "function _cat_verify(val) {\n\n\tvar uri = unique();\n\n\t$.ajax({\n\t\turl: \"stocks/catname/\" + uri,\n\t\tmethod: \"POST\",\n\t\tdata: {\n\t\t\tcname: val\n\t\t},\n\t\tdataType: \"json\",\n\t\tsuccess: function(data) {\n\t\t\tif(data.msg == 'Category name already exists.') {\n\t\t\t\t$('.err-msg-name').html(\"Category name already exists.\");\n\t\t\t\t$('#cat-submit').attr('disabled','disabled');\n\t\t\t} else {\n\t\t\t\t$('.err-msg-name').html('');\n\t\t\t\t$(\"input[type=submit]\").removeAttr('disabled');\n\t\t\t}\n\t\t},\n\t\terror: function() {\n\t\t\t$('err-msg-name').html('Something went wrong.');\n\t\t}\n\t});\n\n}", "title": "" }, { "docid": "af8d8f54d3f164c1fea7740e5eabbb50", "score": "0.59976673", "text": "function validaStok(){\n $(document).on(\"click\",\"#stokDisponible\",function(){\n $(\"#subTotalPro\").val($(\"#stokDisponible\").val());\n let stok=$(\"#stokDisponible\").val();\n if(stok<1){\n $(\".mostStokDisponible\").html(\"No se dispone de stock\");\n }else{\n $(\".mostStokDisponible\").html(\"Unidades Disponibles: \"+stok);\n }\n });\n\n}", "title": "" }, { "docid": "bd4bcb031058203903b6159059779073", "score": "0.5967857", "text": "function addCat() {\n\tvar newCat = document.getElementById(\"catName\").value;\n\tvar catVal = document.getElementById(\"catVal\").value;\n\tvar data = \"catName=\" + newCat + \"&catVal=\" + catVal;\n\tmakeReq(\"POST\", \"/cats\", 201, function() {\n\t\tvar catRow = document.getElementById(\"labelRow\");\n\t\taddCell(catRow, newCat);\n\t\n\t\tvar budgetRow = document.getElementById(\"budgetRow\");\n\t\taddCell(budgetRow, catVal);\n\t\n\t\tvar spentRow = document.getElementById(\"spentRow\");\n\t\taddCell(spentRow, 0);\n\t\n\t\tvar calcRow = document.getElementById(\"calcRow\");\n\t\taddCell(calcRow, catVal)\n\t}, data);\n\t\n\t\n\t\n\tdocument.getElementById(\"catForm\").reset();\n\t\n\tmakeReq(\"GET\", \"/cats\", 200, catDropDown);\n\t\n}", "title": "" }, { "docid": "601fc082b4ff7263dd98171bced46c25", "score": "0.59509605", "text": "function valSubCategory()\n{\n\tvar charstrng\t=\t/^[A-Za-z\\s]+$/;\n\tvar catgry\t\t=\t$.trim($('select#catgry').val());\n\tif(catgry == \"\")\n\t{\n\t\talert('Please select category');\n\t\t$('select#catgry').focus();\n\t\treturn false;\n\t}\n\tvar subcatgry\t\t=\t$.trim($('input#Subcatgry').val());\n\tif(subcatgry == \"\")\n\t{\n\t\talert('Please enter sub category');\n\t\t$('input#Subcatgry').focus();\n\t\treturn false;\n\t}\n\tif(!charstrng.test(subcatgry) ) \n\t{ \n\t\talert(\"Please enter characters only\");\n\t\t$('input#Subcatgry').focus();\n\t\treturn false;\n\t}\n\t$('#submit').hide();\n\t$('#Cancel').hide();\n\t$('#loadingImg').show();\n\tvar rSubCatg\t=\t$(\"input:radio[name=RsubCatg]:checked\").val();\n\tvar dataStrng\t=\t'subcatgry='+subcatgry+'&rSubCatg='+rSubCatg+'&catgry='+catgry;\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"Ajax/newSubCategory.php\",\n\t\tcache: false,\n\t\tdata:dataStrng,\n\t\tsuccess: function(data) { \t\n\t\t\tif(data == 0)\n\t\t\t{\n\t\t\t\talert('Similar Category already exist');\n\t\t\t\t$('#loadingImg').hide();\n\t\t\t\t$('#submit').show();\n\t\t\t\t$('#Cancel').show();\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$('#loadingImg').hide();\n\t\t\t\talert('Sub Category added sucessfully');\n\t\t\t\twindow.location='subCategories.php';\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "62213b63e75c511549cf2b3f51ff75ef", "score": "0.5946026", "text": "function validatejobcategory(){\n var job_category_name = $(\"#job_category_name\").val(); \n if(job_category_name ==''){\n document.getElementById('job_category_name').style.border = '1px solid red !important';\n $(\"#job_category_name_error\").css(\"display\", \"block\");\n document.getElementById(\"job_category_name_error\").innerHTML = \"Please enter name\";\n document.getElementById('job_category_name').focus();\n return false;\n }else{\n $(\"#job_category_name_error\").css(\"display\", \"none\"); \n document.getElementById('job_category_name').style.border = '';\n document.getElementById(\"job_category_name_error\").innerHTML = \"\";\n }\n\n var job_category_status = $(\"#job_category_status\").val(); \n if(job_category_status ==''){\n document.getElementById('job_category_status').style.border = '1px solid red !important';\n $(\"#job_category_status_error\").css(\"display\", \"block\");\n document.getElementById(\"job_category_status_error\").innerHTML = \"Please select status\";\n document.getElementById('job_category_status').focus();\n return false;\n }else{\n $(\"#job_category_status_error\").css(\"display\", \"none\"); \n document.getElementById('job_category_status').style.border = '';\n document.getElementById(\"job_category_status_error\").innerHTML = \"\";\n }\n }", "title": "" }, { "docid": "2ad352c0a2e3c711ad156443b394d27e", "score": "0.5943861", "text": "function getAddTable(){\n $(\"#myModal-addNew\").modal();\n $('#addLavaModelScheme').empty();\n var model_name = $('<label>Model Name</label><input id = \"model_name\" type = text name = \"model_name\"/><br>');\n var model_number= $('<label>Model Number</label><input id = \"model_number\" type = text name = \"model_number\"/>');\n var expire_date = $('<label>Expire Date</label><input id = \"expire_date\" type = text name = \"expire_date\" required id=\"expire_date\"/>');\n var finance_price = $('<label>Finance Price</label><input id = \"finance_price\" type = text name = \"finance_price\"/>');\n var down_payment = $('<label>Down Payment</label><input id = \"down_payment\" type = text name = \"down_payment\" />');\n var tenure = $('<label>Tenure</label><input id = \"tenure\" type = text name = \"tenure\"/>');\n\n $('#addLavaModelScheme').append(model_name);\n $('#addLavaModelScheme').append(model_number);\n $('#addLavaModelScheme').append(expire_date);\n $('#addLavaModelScheme').append(finance_price);\n $('#addLavaModelScheme').append(down_payment);\n $('#addLavaModelScheme').append(tenure);\n}", "title": "" }, { "docid": "6a3333bc3a49d0c57e5a2d7978f05624", "score": "0.59185404", "text": "function cekFormCreateNewItem(param) {\n if(param=='itemname') {\n var category = $(\"#DrdCategory\").val();\n var type = $(\"#DrdType\").val();\n var brand = $(\"#DrdBrand\").val();\n var itemname = $(\"#txtItemName\").val();\n\n if(itemname == '' && $.inArray(param, validation) > -1) {\n removeElementOfArray(validation, param);\n console.log(validation);\n } else {\n $.ajax({\n type: \"POST\",\n url: \"itemexec/cek_item?param=item\",\n data: {\n itemName: itemname,\n itemCat: category,\n itemType: type,\n itemBrand: brand\n },\n success: function(resp) {\n // console.log('Username ' + resp.data[0].user_login + ' sudah dipakai');\n if(resp.count === 1) {\n $(\"#nameIsAlreadyTaken\").html(\"<span>\" + resp.message + \"</span>\");\n $('#nameIsAlreadyTaken').show();\n } else {\n $('#nameIsAlreadyTaken').hide();\n \n if($.inArray(param, validation) == -1) {\n validation.push(param); \n }\n \n console.log(validation);\n enableButtonCreateNewItem();\n }\n },\n error: function(resp) {\n console.log('Error: ', resp);\n alert(\"something went wrong\");\n window.location.href = '/item';\n }\n });\n //console.log(category + ' | '+ type + ' | '+ brand + ' | '+ itemname);\n }\n } \n else if(param==\"category\") {\n var category = $(\"#DrdCategory\").val();\n // console.log(userLevel);\n \n if(category == 0) {\n if($.inArray(param, validation) > -1) {\n removeElementOfArray(validation, param);\n enableButtonCreateNewItem();\n console.log(validation);\n } else {\n $(\"#categoryIsNull\").html(\"<span>Must choose one!</span>\");\n $(\"#categoryIsNull\").show();\n }\n } else {\n $('#categoryIsNull').hide();\n\n if($.inArray(param, validation) == -1) {\n validation.push(param); \n }\n\n console.log(validation);\n enableButtonCreateNewItem();\n }\n }\n else if(param==\"type\") {\n var type = $(\"#DrdType\").val();\n // console.log(userLevel);\n \n if(type == 0) {\n if($.inArray(param, validation) > -1) {\n removeElementOfArray(validation, param);\n enableButtonCreateNewItem();\n console.log(validation);\n } else {\n $(\"#typeIsNull\").html(\"<span>Must choose one!</span>\");\n $(\"#typeIsNull\").show();\n }\n } else {\n $('#typeIsNull').hide();\n\n if($.inArray(param, validation) == -1) {\n validation.push(param); \n }\n\n console.log(validation);\n enableButtonCreateNewItem();\n }\n }\n else if(param==\"brand\") {\n var brand = $(\"#DrdBrand\").val();\n // console.log(userLevel);\n \n if(brand == 0) {\n if($.inArray(param, validation) > -1) {\n removeElementOfArray(validation, param);\n enableButtonCreateNewItem();\n console.log(validation);\n } else {\n $(\"#brandIsNull\").html(\"<span>Must choose one!</span>\");\n $(\"#brandIsNull\").show();\n }\n } else {\n $('#brandIsNull').hide();\n\n if($.inArray(param, validation) == -1) {\n validation.push(param); \n }\n\n console.log(validation);\n enableButtonCreateNewItem();\n }\n }\n}", "title": "" }, { "docid": "84e23aecf842face2ecd7a246802f535", "score": "0.590971", "text": "function addCategory() {\n\n var general = document.addCategoryform.general.value;\n var gendiv = document.getElementById('generalError');\n var cat = document.addCategoryform.addcategory.value;\n var catdiv = document.getElementById('addCategory');\n var errdiv = document.getElementById('addCategoryfeedback');\n var catok = nameValidate(cat, catdiv);\n var genok = generalValidate(general, gendiv);\n if (catok === false) {\n document.addCategoryform.addcategory.focus();\n } else if (genok === false) {\n document.addCategoryform.general.focus();\n } else {\n addCategorysql(general, cat, errdiv);\n }\n\n}", "title": "" }, { "docid": "6baf1356fdf80f23752f5baa0a2b8e7a", "score": "0.58875203", "text": "function container_add(event){\n var formdata = $(\"#cont_add\").serialize();\n debugger;\n viewid = event.currentTarget.dataset['viewid'];\n console.log(formdata);\n $.ajax({\n type: 'POST',\n url: \"/transactionview/viewcomponent/\"+viewid,\n data: formdata,\n //dataType: 'json', \n success: function(data) {\n\n ///alert(\"success\");\n $(\"#cont_add\")[0].reset();\n $(\"#CompModal\").modal('hide');\n $('#viewtable').html(\"\");\n $('#viewtable').html(data);\n var datatable = $('#tabcol').dataTable({\n \"ordering\": false,\n stateSave: true\n });\n $('#tabcol').DataTable();\n /* clear the error message first */\n $(\"#divResults\").empty();\n\n $(\"#divResults\").fadeTo(2000, 500).append(\"<h4>Alert!</h4>Saved Successfully.\").addClass(\"alert alert-success alert-dismissible\").slideUp(500, function() {\n $(\"#divResults\").slideUp(500);\n });\n },\n error: function(data) {\n console.log(data)\n console.log(JSON.parse(data.responseText));\n result = JSON.parse(data.responseText);\n listid = ['','title','caption','containertype','inputtype','parent','dbtable','displayorder']\n var element = document.getElementById('cont_add').querySelectorAll('*[name]');\n for (var i=1;i<element.length;i++){\n let id = element[i].id;\n let name = listid[i];\n try{\n $(\"#\"+id+\"er\").empty() \n $(\"#\"+id+\"er\").fadeTo(2000, 1000).append('<p style=\"color:red\">'+result[name][0]+'</p>').slideUp(1000, function() {\n $(\"#\"+id+\"er\").slideUp(1000);\n });\n }\n catch(err) {\n console.log(err);\n } \n }\n $(\"#divResults\").empty(); \n $(\"#divResults\").fadeTo(2000, 500).append(\"<h4>Alert!</h4>Saved Failed.\").addClass(\"alert alert-danger alert-dismissible\").slideUp(500, function() {\n $(\"#divResults\").slideUp(500);\n });\n }\n });\n }", "title": "" }, { "docid": "1da48466aefc997607d9283e2c2e7742", "score": "0.5886244", "text": "function add_fn(){\n \n $('#add').click(function(){\n //alert('add');\n var new_row = 0;\n var obj_sl = obj_select;\n var attr_sl = attr_select\n var txt = 'addfunction : insert_url= '+ settings.insert_url +\n 'update_url= '+settings.update_url ;\n //console.log(txt);\n //alert(txt + ' '+ obj_sl + \" \" + attr_sl );\n $(attr_sl + \"modal_title_\" +obj_sl + \"_edit\").text(\"เพิ่มข้อมูล\");\n change_data_modal();\n var obj_selector = $(attr_sl+\"modal_\"+obj_sl+\"_edit\");\n new_row = count_row_table();\n //console.log('new row = '+new_row);\n obj_selector.attr('data-row',new_row);\n //$('#modal_mytable_edit').find('[name=\"BulkID\"]').prop('readonly',false);\n //$(attr_sl +\"modal_\"+ obj_sl + \"_edit\").modal('show');\n if (obj_selector.attr('data-edit-html')) {\n // console.log('data-edit-html is exist');\n obj_selector.removeAttr('data-edit-html');\n }\n obj_selector.attr('data-add-html',curl);\n \n \n obj_selector.find('[data-pk=\"pk\"]').prop('readonly',false);\n obj_selector.modal('show');\n \n });\n \n }", "title": "" }, { "docid": "b04fb7a1d1ba8d71a02842fa743a7f20", "score": "0.58709663", "text": "function modalAdddonatur() {\n\tif ($(\"#hid_Xaitam\").val() == '' && $(\"#kategori_santri\") == 'TMI')\n\t{\n\t\tbootbox.alert(\"tidan bisa!!\");\n\t}\n\telse\n\t{\n\t\tclearvalidate_add_donatur\n\t\t$('#hiddenidDonatur').hide();\n\t\t$('#spansearchcloseDonatur').hide();\n\t\t// $('#spansearchDonatur').hide();\n\t\t$('#btn_donatur').text('Tambah');\n\t\t$('#Modal_add_donatur').modal('show');\n\n\t}\n}", "title": "" }, { "docid": "d019adb6ac1d9fb32dd8370b8d0366b5", "score": "0.5854989", "text": "function addCategory() {\r\n\r\n var emptyCategroy = \r\n \"<tr class=\\\"category\\\" name=cat-\"+ catCount +\"\\\">\" +\r\n \"<td><input type=\\\"text\\\" name=\\\"catName-\" + catCount + \"\\\" size='35' placeholder='Catagory Name'</td>\" +\r\n \"<td><input type=\\\"text\\\" class=\\\"weight\\\" name=\\\"catWeight-\" + catCount + \"\\\" size='5' placeholder='Weight'></td>\" +\r\n \"<td><input type=\\\"text\\\" class=\\\"avg\\\" name=\\\"catAvg-\" + catCount + \"\\\" size='5' placeholder='Average'></td>\" +\r\n '<td><input class=\"deletebtn deleteCat\" category=\\\"\" + catCount + \"\\\" type=\"image\" src=\"media/delete.png\"></td>' +\r\n \"</tr>\";\r\n\r\n $(\".categoryList\").append( emptyCategroy );\r\n\r\n console.log(\"Added new category-\" + catCount);\r\n\r\n catCount++;\r\n}", "title": "" }, { "docid": "2d4600ec457a55061a2e2f28e61ec6a4", "score": "0.5839584", "text": "function app_render_modal_category_add() {\r\n\r\n let myHTML = `\r\n <div class=\"app-modal modal\" id=\"modal-add-category\">\r\n <div class=\"app-modal-container\">\r\n <h1>Add New Category</h1>\r\n <input type=\"text\" id=\"input-field-category-name\" class=\"input-category-name\" placeholder=\"Ex: Christmas Movies\"\r\n onfocus=\"this.placeholder = ''\" onblur=\"this.placeholder = 'Ex: Christmas Movies'\">\r\n <button id=\"btn-add-category\" onclick=\"app_category_add_new()\" type=\"button\" class=\"input-btn\">Create Category</button>\r\n </div>\r\n </div>`;\r\n\r\n $('body').append(myHTML);\r\n $('#modal-add-category').modal(\r\n {\r\n showClose: true,\r\n clickClose: true,\r\n fadeDuration: 200\r\n }\r\n );\r\n\r\n $('#modal-add-category').on($.modal.CLOSE, function (event, modal) {\r\n $(this).remove();\r\n });\r\n\r\n // Add enter key detection for input field\r\n $(\"#input-field-category-name\").keyup(function (event) {\r\n if (event.keyCode === 13) {\r\n $(\"#btn-add-category\").click();\r\n }\r\n });\r\n}", "title": "" }, { "docid": "3355bd7e4daa6371f85b499d663626aa", "score": "0.58237326", "text": "In_Stock(member) {\n let In_Stock = $('#input_in_stock').val();\n if ( In_Stock == \"\") {\n $('#error09').show();\n return false;\n }\n \n else {\n $('#error09').hide();\n return true;\n }\n\n }", "title": "" }, { "docid": "6100bc945b4264084ff2951574ce3e0d", "score": "0.58194387", "text": "function CancelationFeeSubmitfun() {\n $.ajax({\n dataType: 'json',\n type: \"Post\",\n url: base_url+'/backend/hotels/CancelationFeeSubmit',\n data: $('#CancelationFee_form').serialize(),\n success: function(data) {\n $(\".close\").trigger(\"click\");\n if ($(\"#id\").val()!=\"\") {\n addToast(\"Updated Successfully\",\"green\");\n } else {\n addToast(\"Inserted Successfully\",\"green\");\n }\n CancelationFee_contract_id = $('#contract_id').val();\n CancelationFee_hotel_id = $('#hotel_id').val();\n var CancelationFee_table = $('#CancelationFee_table').dataTable({\n \"bDestroy\": true,\n \"ajax\": {\n url : base_url+'/backend/hotels/CancelationFeeList?hotel_id='+CancelationFee_hotel_id+'&contract_id='+CancelationFee_contract_id,\n type : 'GET'\n },\n \"fnDrawCallback\": function(settings){\n $('[data-toggle=\"tooltip\"]').tooltip(); \n }\n });\n }\n }, 'JSON');\n}", "title": "" }, { "docid": "1ad9e2240c07b8bb2a21d0a59828a4d3", "score": "0.5788229", "text": "function cleanFormAddProduct(){\r\n\t\t\t\t// display button\r\n\t\t\t\t$('input[name=\"submit_addproduct\"]').css('display','inline');\r\n\t\t\t\t$('input[name=\"submit_updateproduct\"]').css('display','none');\r\n\r\n\t\t\t\t$('img.image-link').css(\"display\",'none');\r\n\t\t\t\t$('tr.list-image').css('display','table-row');\r\n\t\t\t\t$('input[name=\"name\"]').val('');\r\n \t\t$('input[name=\"price\"]').val('');\r\n \t\t$('select[name=\"category\"]').val('');\r\n \t\t$('input[name=\"new\"]').prop('checked', false);\r\n \t\t$('input[name=\"best\"]').prop('checked', false);\r\n \t\t$( '#ui-id-1' ).html('Add new product');\r\n \t\t$('div.error_product').html('');\r\n\r\n\t\t\t}", "title": "" }, { "docid": "f26681b9c0e533b96b7f9b4f2e459be5", "score": "0.5785772", "text": "function checkValidFormInsert() {\t\t\n\t\tvar nameCategoryVi = document.getElementById(\"nameCategoryVi\").value;\n\t\tvar nameCategoryJa = document.getElementById(\"nameCategoryJa\").value;\n\t\t\t\t\n\t\tvar c_value = 0;\n\t\t\n\t\t\n\t\t//Kiểm tra định dạng ảnh\n\t\t\n\t\t\t var test_value = $(\"#Image\").val();\n\t\t\t var extension = test_value.split('.').pop().toLowerCase();\n\t\t\t \n\t\t\t \n\t\t\t \n\t\t\t\n\t\t\t\n\t\t\t\n\t\tif (nameCategoryVi == \"\" || nameCategoryJa == \"\") {\n\n\t\t\talert(\"Bạn phải nhập tên danh mục(vừa tiếng việt vừa tiếng nhật) - 項目を必ず入力下さい(日本語とベトナム語)\");\n\t\t\treturn false;\n\t\t}\n\t\tfor (var i = 0; i < document.formcreateCategory.display.length; i++) {\n\t\t\tif (document.formcreateCategory.display[i].checked) {\n\t\t\t\tc_value = 1;\n\t\t\t}\n\t\t}\n\t\tif (c_value == 0) {\n\t\t\talert(\"Bạn phải chọn có hiển thị lên trang chủ hay không - ホームに表示するかどうかを必ず選択して下さい。\");\n\t\t\treturn false;\n\t\t} \n\t\tif ($.inArray(extension, ['png', 'gif', 'jpeg', 'jpg']) == -1) {\n\t\t alert(\"File ảnh không hợp lệ - 写真のファイルが無効です!\");\n\t\t return false;\n\t\t } \n\t\treturn true;\n\t}", "title": "" }, { "docid": "3e75caa9c48e627c99c837be3e7ea471", "score": "0.5784052", "text": "function putCategory(dt) {\n if (dt[0].cat_id != 0) {\n $.each(dt, function (v, u) {\n let H = `<option value=\"${u.cat_id}\" data-content=\"${u.cat_id}\">${u.cat_name}</option>`;\n $('#txtCategoryPack').append(H);\n $('#txtCategoryProduct').append(H);\n });\n }\n\n $('#txtCategoryPack').on('change', function () {\n let ops = `<option value=\"0\" selected>Selecciona una subcategoría</option>`;\n $('#txtSubcategoryPack').html(ops);\n let id = $(this).val();\n //lsbc_id = id;\n selSubcategoryPack(id);\n //validator_part01();\n });\n}", "title": "" }, { "docid": "5315d71c36583928c21165dd77f402a5", "score": "0.5781937", "text": "function validateblogcategory(){\n var blog_category_name = $(\"#blog_category_name\").val(); \n if(blog_category_name ==''){\n document.getElementById('blog_category_name').style.border = '1px solid red !important';\n $(\"#blog_category_name_error\").css(\"display\", \"block\");\n document.getElementById(\"blog_category_name_error\").innerHTML = \"Please enter name\";\n document.getElementById('blog_category_name').focus();\n return false;\n }else{\n $(\"#blog_category_name_error\").css(\"display\", \"none\"); \n document.getElementById('blog_category_name').style.border = '';\n document.getElementById(\"blog_category_name_error\").innerHTML = \"\";\n }\n\n var blog_category_status = $(\"#blog_category_status\").val(); \n if(blog_category_status ==''){\n document.getElementById('blog_category_status').style.border = '1px solid red !important';\n $(\"#blog_category_status_error\").css(\"display\", \"block\");\n document.getElementById(\"blog_category_status_error\").innerHTML = \"Please select status\";\n document.getElementById('blog_category_status').focus();\n return false;\n }else{\n $(\"#blog_category_status_error\").css(\"display\", \"none\"); \n document.getElementById('blog_category_status').style.border = '';\n document.getElementById(\"blog_category_status_error\").innerHTML = \"\";\n }\n }", "title": "" }, { "docid": "8df7077e61f8826dfe33eea58794c2ab", "score": "0.57777065", "text": "function addIngredientButClicked() {\n\tvar name = document.getElementById(\"nameInput_addIngredient\").value;\n\tvar selIndex = document.getElementById(\"typeSBox_addIngredient\").selectedIndex;\n\tvar minAmount = document.getElementById(\"minAmountInput_addIngredient\").value;\n\tvar maxAmount = document.getElementById(\"maxAmountInput_addIngredient\").value;\n\t// type id\n\tvar type = document.getElementById(\"typeSBox_addIngredient\").options[selIndex].value;\t\n\n\t// validate input data\n\tvar validationRes = ingredientInfoValidation(name, \"1\", minAmount, maxAmount);\n\tswitch (validationRes) {\n\tcase 0:\n\t\tbreak;\n\tcase 1:\n\t\talert(\"Tên nguyên liệu không hợp lệ\");\n\t\treturn;\n\tcase 2:\n\t\talert(\"Số lượng không hợp lệ\");\n\t\treturn;\n\tcase 3:\n\t\talert(\"Số lượng tối thiểu không hợp lệ\");\n\t\treturn;\n\tcase 4:\n\t\talert(\"Số lượng tối đa không hợp lệ\");\n\t\treturn;\n\tcase 5:\n\t\talert(\"Số lượng tối đa không nhỏ hơn số lượng tối thiểu\");\n\t\treturn;\n\tdefault: break;\n\t}\n\n\tvar http = createXMLHttpRequest();\n\tvar nocache = Math.random();\n\tvar serverURL = \"../controller/ModuleIngredientManagementController.php?action=insert&nocache=\"\n\t\t\t+ nocache\n\t\t\t+ \"&materialname=\"\n\t\t\t+ $.trim(name)\n\t\t\t+ \"&materialtype=\"\n\t\t\t+ $.trim(type)\n\t\t\t+ \"&minquantity=\"\n\t\t\t+ $.trim(minAmount)\n\t\t\t+ \"&maxquantity=\" + $.trim(maxAmount);\n\thttp.open(\"POST\", serverURL, true);\n\thttp.onreadystatechange = function() {\n\t\tif (http.readyState == 4 && http.status == 200) {\n\t\t\tvar response = http.responseText;\n\t\t\tif (response == true) {\t\t\t\t\n\t\t\t\t$('#addIngredientDialog').dialog(\"close\");\n\t\t\t\talert(\"Thêm nguyên liệu mới thành công\");\n\t\t\t\treloadIngredientGrid();\n\t\t\t} else {\n\t\t\t\talert(\"Thêm nguyên liệu mới không thành công\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t};\n\thttp.send();\n}", "title": "" }, { "docid": "d66d2c99cb60762c0c969b6ecbf896c9", "score": "0.5777618", "text": "function ontology_vinculate_taxonomy(src,title,msg) {\n var selKeys = $.map($(\"#dynatree_select_taxonomies\").dynatree(\"getSelectedNodes\"), function (node) {\n return node.data;\n });\n if (selKeys[0]) {\n $('#modalAddCategoria').modal('hide');\n swal({\n title: title,\n text: msg+' '+selKeys[0].title,\n type: \"info\",\n showCancelButton: true,\n confirmButtonClass: 'btn-primary',\n closeOnConfirm: true,\n closeOnCancel: true\n },\n function (isConfirm) {\n if (isConfirm) {\n $.ajax({\n url: src + '/controllers/category/ontology_category_controller.php',\n type: 'POST',\n data: {\n operation: 'add_facet',\n taxonomy_id: selKeys[0].key,\n collection_id: $(\"#collection_id\").val()}\n }).done(function (result) {\n json = JSON.parse(result);\n showAlertGeneral(json.title, json.msg, 'info');\n //funcao do core que da relaod no menu lateral\n set_containers_class($('#collection_id').val());\n });\n }else{\n $('#modalAddCategoria').modal('show');\n }\n }); \n }\n}", "title": "" }, { "docid": "7e515257988748de918a43607451e0a1", "score": "0.5756914", "text": "function openModal(modalId) {\n $(\"label.error\").remove();\n if (modalId == 'sub_item_added_form') {\n $.ajax({\n url: baseUrl + \"includes/item_process.php?process_type=get_parent_category\",\n type: 'POST',\n dataType: 'html',\n success: function(response) {\n $('#' + modalId).modal('show');\n $('#parent_item_id').html(response);\n }\n });\n } else if (modalId == 'item_added_form') {\n $.ajax({\n url: baseUrl + \"includes/item_process.php?process_type=get_parent_category\",\n type: 'POST',\n dataType: 'html',\n success: function(response) {\n $('#' + modalId).modal('show');\n $('#main_item_id').html(response);\n }\n });\n } else if (modalId == 'parent_item_added_form') {\n $.ajax({\n url: baseUrl + \"includes/item_process.php?process_type=get_category_code\",\n type: 'POST',\n dataType: 'json',\n data: 'cat_type=parent&data_type=ajax',\n success: function(response) {\n $('#' + modalId).modal('show');\n $('#category_id').val(response.code);\n }\n });\n } else {\n $('#' + modalId).modal('show');\n }\n}", "title": "" }, { "docid": "6d15230026bbbf745be9bd36e28d2464", "score": "0.5752931", "text": "function MinimumStaySubmitfun() {\n $.ajax({\n dataType: 'json',\n type: \"Post\",\n url: base_url+'/backend/hotels/MinimumStaySubmit',\n data: $('#MinimumStay_form').serialize(),\n success: function(data) {\n $(\".close\").trigger(\"click\");\n if ($(\"#id\").val()!=\"\") {\n addToast(\"Updated Successfully\",\"green\");\n } else {\n addToast(\"Inserted Successfully\",\"green\");\n }\n MinimumStay_contract_id = $('#contract_id').val();\n MinimumStay_hotel_id = $('#hotel_id').val();\n var MinimumStay_table = $('#MinimumStay_table').dataTable({\n \"bDestroy\": true,\n \"ajax\": {\n url : base_url+'/backend/hotels/MinimumStayList?hotel_id='+MinimumStay_hotel_id+'&contract_id='+MinimumStay_contract_id,\n type : 'GET'\n },\n \"fnDrawCallback\": function(settings){\n $('[data-toggle=\"tooltip\"]').tooltip(); \n }\n });\n }\n }, 'JSON');\n}", "title": "" }, { "docid": "fb84b30a297605b44019daa27a06314a", "score": "0.57444966", "text": "function validacion_categoria()\n{\n\tvar nombre_categoria= $('#nombre-categoria-modal').val();\n\tvar descripcion_categoria= $('#descripcion-categoria-modal').val();\n\n\tvar verdad=true;\n\n\tif (nombre_categoria==\"\")\n\t{\n\t\talertify.alert(\"Error!\",\"La categoría esta Vacía\", function(){});\n\t\t$('#nombre-categoria-modal').focus();\n\t\treturn false;\n\t}\n\telse if (nombre_categoria.length<=2 || nombre_categoria.length>45) \n\t{\n\t\talertify.alert(\"Información!\",\"Categoría no valida\", function(){});\n\t\t$('#nombre-categoria-modal').focus();\n\t\treturn false;\n\t}\n\telse if (descripcion_categoria==\"\") \n\t{\n\t\talertify.alert(\"Error!\",\"Descripción esta Vacío\", function(){});\n\t\t$('#descripcion-categoria-modal').focus();\n\t\treturn false;\n\t}\n\telse if (descripcion_categoria.length<5) \n\t{\n\t\talertify.alert(\"Información!\",\"Debe dar una descripción valida\", function(){});\n\t\t$('#descripcion-categoria-modal').focus();\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn verdad;\n\t}\n}", "title": "" }, { "docid": "fb6273331aec38e686e245f9f2e088ad", "score": "0.5729327", "text": "function validationRepeat(){\n //var validation=false;\n var item=categories.find(category =>category.nombre === name);\n if( item===undefined){\n handleSubmit();\n // console.log('no esta repetido');\n }else {\n alertError('No esta permitido repetir categorias');\n // console.log('si esta repetido');\n }\n }", "title": "" }, { "docid": "332f04262047a21817571e9288520473", "score": "0.57092327", "text": "function GeneralSupplementSubmitfun() {\n $.ajax({\n dataType: 'json',\n type: \"Post\",\n url: base_url+'/backend/hotels/GeneralSupplementSubmit',\n data: $('#generalSupplement_form').serialize(),\n success: function(data) {\n $(\".close\").trigger(\"click\");\n if ($(\"#id\").val()!=\"\") {\n addToast(\"Updated Successfully\",\"green\");\n } else {\n addToast(\"Inserted Successfully\",\"green\");\n }\n GeneralSupplement_contract_id = $('#contract_id').val();\n GeneralSupplement_hotel_id = $('#hotel_id').val();\n var GeneralSupplement_table = $('#GeneralSupplement_table').dataTable({\n \"bDestroy\": true,\n \"ajax\": {\n url : base_url+'/backend/hotels/GeneralSupplementList?hotel_id='+GeneralSupplement_hotel_id+'&contract_id='+GeneralSupplement_contract_id,\n type : 'GET'\n },\n \"fnDrawCallback\": function(settings){\n $('[data-toggle=\"tooltip\"]').tooltip(); \n }\n });\n $(\"#generalSupplement_submit\").removeAttr(\"disabled\",\"disabled\");\n }\n }, 'JSON');\n}", "title": "" }, { "docid": "7adc3e0444c08a34f2c6ed29e37d0047", "score": "0.5699375", "text": "function extrabedsubmitfun() {\n $.ajax({\n dataType: 'json',\n type: \"Post\",\n url: base_url+'/backend/hotels/extrabedsubmit',\n data: $('#extrabed_form').serialize(),\n success: function(data) {\n $(\".close\").trigger(\"click\");\n if ($(\"#id\").val()!=\"\") {\n addToast(\"Updated Successfully\",\"green\");\n } else {\n addToast(\"Inserted Successfully\",\"green\");\n }\n extrabed_contract_id = $('#contract_id').val();\n extrabed_hotel_id = $('#hotel_id').val();\n var extrabed_table = $('#extrabed_table').dataTable({\n \"bDestroy\": true,\n \"ajax\": {\n url : base_url+'/backend/hotels/extrabedList?hotel_id='+extrabed_hotel_id+'&con_id='+extrabed_contract_id,\n type : 'GET'\n },\n \"fnDrawCallback\": function(settings){\n $('[data-toggle=\"tooltip\"]').tooltip(); \n }\n });\n }\n }, 'JSON');\n}", "title": "" }, { "docid": "e25e73434d3704e42963a56813592568", "score": "0.5695983", "text": "function validateClickSave(){\r\n\t//$(\".cdms_ul_error\").remove();\r\n\tremoveError();\r\n\tvar flag = true;\r\n\t// check category code, item code is empty\r\n\tif ($(\"#categoryCdValue\").val() == \"\"){\r\n\t\tflag = false;\r\n\t\t$('#categoryCdValue').parent().parent().append(generateHtmlError(\"EB-0003\", \"\", \"\"));\r\n\t\t$(\"#categoryCdValue\").addClass(\"input-error\");\r\n\t\t$(\"#categoryCd\").next().addClass(\"btn-error\");\r\n\t}\r\n\tif ($(\"#itemCdValue\").val() == \"\"){\r\n\t\tflag = false;\r\n\t\t$('#itemCdValue').parent().parent().append(generateHtmlError(\"EB-0001\", \"\", \"\"));\r\n\t\t$(\"#itemCdValue\").addClass(\"input-error\");\r\n\t\t$(\"#itemCd\").next().addClass(\"btn-error\");\r\n\t}\r\n\treturn flag;\r\n}", "title": "" }, { "docid": "3ae7ab9fbf9e50bfe62326edf7fc767e", "score": "0.56955916", "text": "function addMasterComponentToDBAndPage() {\n var masterComponentSelected = ($('input[name=\"masterComponentListfromDBCheckBoxes\"]:checked').serialize());\n var companyId = document.getElementById(\"companyIdStoringTextField\").value;\n var primaryDataCenterName = null;\n $.ajax({\n url: 'getCompanyDetailWithId',\n type : 'get',\n aync: false,\n data: { pstrCompanyId: companyId },\n datatype: 'json',\n cache: false,\n success: function (data) {\n primaryDataCenterName = data.DBPrimaryCenter;\n $.ajax({\n url: \"addMasterComponentToDB\",\n type: 'get',\n async: false,\n datatype: 'json',\n cache: false,\n data: { pstrMasterComponentListFromPage: masterComponentSelected, pstrCompanyId: companyId, pstrPrimaryDataCenterName: primaryDataCenterName },\n success: function (data) {\n //alert(data);\n },\n error: function () { alert(\"error\"); }\n });\n $(\"#masterPageContentPlace\").load(\"ComponentandStatus/?commonCheck=CheckIfTrueErrorWin\");\n },\n error: function () {\n alert(\"unable to fetch company Details to add components\");\n }\n });\n \n $('input[name=\"masterComponentListfromDBCheckBoxes\"]:checked').closest(\"tr\").css(\"background-color\", \"#CCFFCC\");\n \n $('#AddMasterComponentModal').on('hide.bs.modal', function () {\n $('#AddMasterComponentModal').removeClass(\"modal-backdrop fade in\");\n });\n }", "title": "" }, { "docid": "01994ed9657638fddac5e83bcea3e61c", "score": "0.5693281", "text": "function request_database_query(json,radio_checkbox_select_array) {\n var height = document.getElementById('element_container').scrollHeight;\n height = height + 230;\n var form_log = new cat_box();\n form_log.field = radio_checkbox_select_array;\n var json_varible_log = jQuery.toJSON(form_log);\n jQuery.ajax({\n type: \"POST\",\n url: base_url + \"home/ajax_insert\",\n data: {json_data: json,\n page_height: height,\n json_cat: json_varible_log\n },\n async: false,\n success: function(data) {\n\t\t\twindow.onbeforeunload = null;\n if ($.trim(data) == 'login') {\n //alert(\"data inserted successfully...\"); \n cat_insert(radio_checkbox_select_array);\t\t\t\t\n }\n else if ($.trim(data) == 'logout') {\n \t\t/* popup comment start here */\n\t\t\t\t\t\n\t\t\t\t/*\n jQuery.noConflict();\n jQuery().colorbox({\n iframe: true,\n href: base_url + \"popup\",\n innerWidth: 752,\n innerHeight: 290\n });\n jQuery(\"#save_form_button\").removeClass('loadding_button');\n jQuery(\"#save_form_button\").addClass('save_form');\n\t\t\t\t*/\n\t\t\t\t\t\n\t\t\t /* popup comment end here */\n\t\t\t \n\t\t\t /*new code start*/\n\t jQuery(\"#save_form_button\").removeClass('loadding_button');\n jQuery(\"#save_form_button\").addClass('save_form');\n\t\t\t \n\t\t\t window.location.assign(base_url+\"login?p=popup\");\n } else if (data == 'limit-over') {\n\n show_message();\n }\n else\n {\n // alert('error');\n }\n },\n error: function(XMLHttpRequest, textStatus, errorThrown) {\n // alert(\"error\");\n }\n });\n}", "title": "" }, { "docid": "bdc49cb4d6b2e50297266a3a0d9cd63f", "score": "0.569056", "text": "function _remove_item_modal(cat_id){\n $.post('/v1/api/data/products',{\n data: JSON.stringify({\n id: userData['id'],\n token: userData['token'],\n status: 10,\n product_id: cat_id,\n })\n }, function (e) {\n if(e.status == '00'){\n $('#remove_item_modal_title').text(e.data.name);\n $('#remove_item_id').val(e.data.id);\n open_sideform('remove_item_modal');\n }\n }).fail(function(){\n notif('danger', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n });\n}", "title": "" }, { "docid": "f59203073ee0a3fea670e8a950ade2bc", "score": "0.56904405", "text": "function addSelectedCharity() {\r\n\t var selectedCharityName = $F('addCharityName');\r\n\t var selectedCharityId = $F('addCharityId');\r\n\t var allowChars=/[a-zA-Z0-9]{1}[a-zA-Z0-9 ]{0,40}/;\r\n\t var error;\r\n\r\n\t$('showError').hide(); \r\n\t$('multipleCharityWorkingIndicator').show();\r\n var url = \"ajaxAddCharityAction.action\";\r\n var params = 'selectedCharityName=' + selectedCharityName;\r\n params = params + '&selectedCharityId=' + selectedCharityId;\r\n new Ajax.Request(url, {\r\n\t\t\tmethod :'POST',\t\r\n\t\t\tparameters :params,\r\n\t\t\tasynchronous :true,\r\n\t\t\tonSuccess :displayUrlResponse\r\n\t\t});\t\t\r\n\t \t \r\n\t function displayUrlResponse(transport){\r\n\t\t $('multiCharityErrorImage').hide();\r\n\t\t\t$('multiCharityErrorMessage').hide();\r\n\t\t\tif ($('fundSplitErrorMessage') != null) {\r\n\t\t\t\t$('fundSplitErrorMessage').hide();\r\n\t\t\t}\t\t\t\t\t\t\r\n\t\t\t$('showError').hide();\r\n\t\t\t$('showExceedFive').hide();\r\n\t\t\t$('charityAlreadyExist').hide();\r\n\t\t\t$('multipleCharityWorkingIndicator').hide();\r\n\t\t\tif ($('totalNotHundredErrorMessage') != null) {\r\n\t\t\t\t$('totalNotHundredErrorMessage').hide();\r\n\t\t\t}\t\t\t\r\n\t\t\tif ($('charityAdminErrorMessage') != null) {\r\n\t\t\t\t$('charityAdminErrorMessage').hide();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t var NODE_ERROR_CODE = \"errorCode\";\r\n\t\t var NODE_ERROR_DESCRIPTION = \"errorDescription\";\r\n\t\t var VALIDATION_CODE_BLANK_TEXT_PROVIDED = \"BLANK_TEXT_PROVIDED\";\r\n\t\t var VALIDATION_CODE_INVALID_CHARACTERS = \"INVALID_CHARACTERS_FOR_CHARITY_NAME\";\r\n\t\t \r\n\t\t var xml_doc = transport.responseXML.documentElement;\r\n\t\t var errorMessage = xml_doc.getAttribute(\"errorMessage\");\r\n\t\t var charityName = xml_doc.getAttribute(\"selcharityName\");\r\n\t\t var errorCode = xml_doc.getAttribute(NODE_ERROR_CODE);\r\n\t\t var errorDescription = xml_doc.getAttribute(NODE_ERROR_DESCRIPTION);\r\n\r\n\t\t if (errorCode == VALIDATION_CODE_BLANK_TEXT_PROVIDED) {\r\n\t\t\t\t error=errorDescription;\r\n\t\t\t\t document.getElementById('showError').innerHTML=error;\r\n\t\t\t\t $('showError').show();\r\n\t\t\t\t $('multiCharityErrorImage').show();\r\n\t\t }\r\n\t\t else if (errorCode == VALIDATION_CODE_INVALID_CHARACTERS) {\r\n\t\t\t\t error=errorDescription;\r\n\t\t\t\t document.getElementById('showError').innerHTML=error;\r\n\t\t\t\t $('showError').show();\r\n\t\t\t\t $('multiCharityErrorImage').show();\r\n\t\t }\r\n\t\t else {\t\r\n\t\t \r\n\t\t\t\ttheList = $('createCharity');\r\n\t\t\t\tnewList = document.createElement('span');\r\n\t\t\t\ttheList.parentNode.replaceChild(newList,theList);\t\t \t\r\n\t\t\t\tnewList.id = \"createCharity\";\t\r\n\t\t \t\t\r\n\t\t\t\tcharityListSize = xml_doc.childNodes[0].childNodes.length;\r\n\t\t\t\tcreateCharityList(xml_doc, charityListSize);\r\n\t\t\t\t\r\n\t\t\t\tif($('charityDonationSplit_organisedEventBean_organisedEventFeeDetails_donationSplitReqIndN').checked == true) {\r\n\t\t\t\t\ttheSplitList = $('createFundSplit');\r\n\t\t\t\t\tnewSplitList = document.createElement('span');\r\n\t\t\t\t\ttheSplitList.parentNode.replaceChild(newSplitList,theSplitList);\t\t \t\r\n\t\t\t\t\tnewSplitList.id = \"createFundSplit\";\r\n\t\t\t\t\tcreateDonationSplitTotal(xml_doc,charityListSize);\r\n\t\t\t\t}\r\n\r\n\t\t\t\r\n\t\t\tif (errorMessage == \"No\" ) {\t\t\t\t\t\r\n\t\t\t $('addCharityName').clear();\r\n\t\t\t\t$('addCharityId').clear();\r\n\t\t\t $('showExceedFive').hide();\r\n\t\t\t $('charityAlreadyExist').hide();\r\n\t\t\t} else if (errorMessage == \"Yes\") {\t\t\t\r\n\t\t\t\tvar errorDisplay = \"You can only select a maximum of 5 charities.\";\r\n\t\t\t\tdocument.getElementById('showExceedFive').innerHTML = errorDisplay;\r\n\t\t\t\t$('addCharityName').clear();\r\n\t\t\t\t$('addCharityId').clear();\r\n\t\t\t\t$('showExceedFive').show();\r\n\t\t\t\t$('charityAlreadyExist').hide();\r\n\t\t } else if (errorMessage == \"charityAlreadyExist\") {\t\t\t\t\t\t\r\n\t\t\t\tvar errorDisplay = \"This charity has already been selected.\";\r\n\t\t\t\tdocument.getElementById('charityAlreadyExist').innerHTML = errorDisplay;\r\n\t\t\t\t$('addCharityName').clear();\r\n\t\t\t\t$('addCharityId').clear();\r\n\t\t\t\t$('showExceedFive').hide();\r\n\t\t\t\t$('charityAlreadyExist').show();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n}", "title": "" }, { "docid": "c5efe38c35ccf3920e611f1e0d52ee25", "score": "0.56644493", "text": "function add_new_type(combo, empresa, url, myModal) {\n $.ajaxSetup({\n headers: {\n \"X-CSRF-TOKEN\": $('meta[name=\"csrf-token\"]').attr(\"content\"),\n },\n });\n\n if (empresa.value != \"\") {\n $.ajax({\n type: \"POST\",\n url: url,\n data: \"name=\" + empresa.value,\n success: function (data) {\n $(combo).html(data);\n },\n });\n empresa.value = \"\";\n $(myModal).modal(\"hide\");\n }\n}", "title": "" }, { "docid": "57d22e055bd98d0ebb1a2ccca1342d0f", "score": "0.5654832", "text": "function validar_add_alcance1(){\r\n\r\n\tif(document.getElementById('txt_alcance').value==''){\r\n\t\tmostrarDiv('error_alcance');\t\r\n\t\treturn false;\r\n\t}\r\n\tif(document.getElementById('txt_fecha_registro').value==''){\r\n\t\tmostrarDiv('error_fecha_registro');\t\r\n\t\treturn false;\r\n\t}\r\n\tif(document.getElementById('sel_responsable_contratante').value=='-1'){\r\n\t\tmostrarDiv('error_responsable_contratante');\r\n\t\treturn false;\r\n\t}\r\n\tif(document.getElementById('sel_responsable_contratista').value=='-1'){\r\n\t\tmostrarDiv('error_responsable_contratista');\r\n\t\treturn false;\r\n\t}\r\n if(document.getElementById('sel_responsable_interventoria').value=='-1'){\r\n\t\tmostrarDiv('error_responsable_interventoria');\r\n\t\treturn false;\r\n\t}\r\n if(document.getElementById('sel_estado').value=='-1'){\r\n\t\tmostrarDiv('error_estado');\r\n\t\treturn false;\r\n\t}\r\n\r\n\tdocument.getElementById('frm_add_alcance').action='?mod=alcances&task=saveAdd';\r\n\tdocument.getElementById('frm_add_alcance').submit();\r\n}", "title": "" }, { "docid": "b346b449ef7ecfdb22d4a6d7668e0a31", "score": "0.56375694", "text": "function closeoutSubmitfun() {\n $.ajax({\n dataType: 'json',\n type: \"Post\",\n url: base_url+'/backend/hotels/update_close_hotel',\n data: $('#update_closeout_hotel').serialize(),\n success: function(data) {\n $(\".close\").trigger(\"click\");\n if ($(\"#id\").val()!=\"\") {\n addToast(\"Updated Successfully\",\"green\");\n } else {\n addToast(\"Inserted Successfully\",\"green\");\n }\n var closeouthotel_id = $(\"#hotel_id\").val();\n var closeoutcontract_id = $(\"#contract_id\").val();\n var hotel_closeout_table = $('#hotel_closeout_table').dataTable({\n \"bDestroy\": true,\n \"ajax\": {\n url : base_url+'/backend/hotels/hotel_closeout_list?id='+closeouthotel_id+'&contract_id='+closeoutcontract_id,\n type : 'GET'\n },\n \"fnDrawCallback\": function(settings){\n $('[data-toggle=\"tooltip\"]').tooltip(); \n }\n });\n }\n }, 'JSON');\n}", "title": "" }, { "docid": "b405617613295e47c9cba0ac6541c769", "score": "0.5635704", "text": "function insertRecord_Equip() {\n \n $.ajax({\n url: '/ManageEquipment/AddEquipment',\n data: { equipmentID: id, model: model, serialNumber: serial, ip: ip, port: port, deviceID: deviceid, type: type, hostID : hostid},\n method: 'post'\n }).success(function (val) {\n \n if (val == \"True\") {\n modal_checker = 1;\n $(\"#modal_div\").modal(\"hide\");\n $(\"#form_modal_div\").modal(\"hide\");\n $('#EquipmentGrid').jqxGrid('updatebounddata');\n notification_modal_dynamic(\"Notification\", \"Machine Added\", 'success', identifier);\n identifier++;\n }\n else {\n modal_checker = 1;\n $(\"#modal_div\").modal(\"hide\");\n $(\"#form_modal_div\").modal(\"hide\");\n notification_modal_dynamic_super(\"Notification\", \"Something went wrong please try again later\", 'danger', 'form_modal_div', identifier)\n identifier++;\n }\n }).error(function (e) {\n modal_checker = 1;\n $(\"#modal_div\").modal(\"hide\");\n $(\"#form_modal_div\").modal(\"hide\");\n notification_modal_dynamic_super(\"Notification\", \"Something went wrong please try again later\", 'danger', 'form_modal_div', identifier)\n identifier++;\n });\n}", "title": "" }, { "docid": "d9c898ae42d7857d6bc77ff4090f8999", "score": "0.56335354", "text": "function addNewTransaction() {\n try {\n let transactionDate = $(\"#transactionDate\").val();\n let transactionType = $(\"#transactionType\").val();\n let product = $(\"#transactionProductId\").val()\n let quantity = $(\"#transactionQuantity\").val()\n let remark = $(\"#transactionRemark\").val()\n let availableStock = $(\"#availableStock\").val();\n console.log(transactionType);\n if (transactionType == \"Outward\" && (parseInt(availableStock) == 0 || parseInt(quantity) > parseInt(availableStock))) {\n // console.log(\"qty issue\");\n throw (\"Check Order Quantity With Available Quantity.\");\n }\n let newTransaction = {\n transactionDate,\n transactionType,\n product,\n quantity,\n remark\n }\n $.ajax({\n type: \"POST\",\n contentType: \"application/json\",\n url: `${url}/addTransaction`,\n data: JSON.stringify(newTransaction),\n dataType: 'json',\n success: async function(data) {\n $('#transactionModal').modal('hide');\n location.reload();\n },\n error: function(e) {\n alert(\"Error!\")\n console.log(\"ERROR: \", e);\n }\n });\n } catch (error) {\n alert(error);\n\n }\n}", "title": "" }, { "docid": "e9cf9716bc28e6ba9716082f39cfdd14", "score": "0.55984515", "text": "function _submit_data_item(){\n // SUBMIT NEW ITEM\n $('form#form_add_item').submit(function(e){\n e.preventDefault();\n _loading(1);\n let variant=false, sold=false, composed=false, stock=false;\n if($('#add_product_variant').is(':checked')){\n variant = true;\n }\n if($('#add_product_sold').is(':checked')){\n sold = true;\n }\n if($('#add_product_composed').is(':checked')){\n composed = true;\n }\n if($('#add_manage_stock').is(':checked')){\n stock = true;\n }\n let _cat = $('.input_category'), _data = [];\n for(i=0; i<_cat.length; i++){\n if($(_cat[i]).val().length > 0){\n let _detail = {}\n _target = $(_cat[i]).data('target');\n _detail['id'] = $(_cat[i]).data('id');\n _detail['name'] = $(_cat[i]).val();\n _detail['sub_variant'] = []\n _tag = $('.tag_list_' + _target + ' > a')\n if(_tag.length > 0){\n for(x=0; x<_tag.length;x++){\n _detail['sub_variant'].push({\n 'id' : $(_tag[x]).data('id'),\n 'name' : $(_tag[x]).data('name'),\n })\n }\n }\n _data.push(_detail)\n }\n }\n\n $.post('/v1/api/data/products',{\n data: JSON.stringify({\n id: userData['id'],\n token: userData['token'],\n status: 9,\n product_name: $('#add_product_name').val(),\n product_category: $('#add_product_category').val(),\n product_price: $('#add_product_price').val(),\n product_sku: $('#add_product_sku').val(),\n product_barcode: $('#add_product_barcode').val(),\n product_measurement: {\n id:$('#edit_product_measurement').attr('data-id'),\n name:$('#edit_product_measurement').val().trim()\n },\n product_description: $('#add_product_description').val(),\n product_sold: sold,\n product_variant: variant,\n product_composed: composed,\n product_stock: stock,\n data_variant: _data,\n })\n }, function (e) {\n if(e.status == '00'){\n if(e.data.status == '00'){\n nav_href('product-item');\n notif('success','Product item has been added successfully');\n }else{\n notif('danger', e.data.message);\n }\n }\n }).fail(function(){\n notif('danger', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n });\n });\n\n // SUBMIT EDIT DATA ITEM\n $('form#form_edit_item').submit(function(e){\n e.preventDefault();\n _loading(1);\n let variant=false, sold=false, composed=false;\n if($('#edit_product_variant').is(':checked')){\n variant = true;\n }\n if($('#edit_product_sold').is(':checked')){\n sold = true;\n }\n if($('#edit_product_composed').is(':checked')){\n composed = true;\n }\n $.post('/v1/api/data/products',{\n data: JSON.stringify({\n id: userData['id'],\n token: userData['token'],\n status: 11,\n product_id: userData['iid'],\n product_name: $('#edit_product_name').val(),\n product_category: $('#edit_product_category').val(),\n product_price: $('#edit_product_price').val(),\n product_sku: $('#edit_product_sku').val(),\n product_barcode: $('#edit_product_barcode').val(),\n product_measurement: {id:$('#edit_product_measurement').attr('data-id'), name:$('#edit_product_measurement').val().trim()},\n product_description: $('#edit_product_description').val(),\n product_sold: sold,\n product_variant: variant,\n product_composed: composed,\n })\n }, function (e) {\n if(e.status == '00'){\n nav_href('product-item');\n notif('success','Product item has been edited successfully');\n }\n }).fail(function(){\n notif('danger', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n });\n });\n\n $('form#form_add_manage_variant').on('submit', function(e){\n e.preventDefault()\n _loading(1);\n let _cat = $('.input_category'), _data = [];\n for(i=0; i<_cat.length; i++){\n if($(_cat[i]).val().length > 0){\n let _detail = {}\n _target = $(_cat[i]).data('target');\n _detail['id'] = $(_cat[i]).data('id');\n _detail['name'] = $(_cat[i]).val();\n _detail['sub_variant'] = []\n _tag = $('.tag_list_' + _target + ' > a')\n if(_tag.length > 0){\n for(x=0; x<_tag.length;x++){\n _detail['sub_variant'].push({\n 'id' : $(_tag[x]).data('id'),\n 'name' : $(_tag[x]).data('name'),\n })\n }\n }else{\n notif('danger','Please, fill all required fields.');\n _loading(0);\n return false\n }\n _data.push(_detail)\n }else{\n notif('danger','Please, fill all required fields.');\n _loading(0);\n return false\n }\n }\n _loading(0);\n close_sideform();\n });\n\n $('form#form_edit_manage_variant').on('submit', function(e){\n e.preventDefault()\n _loading(1);\n let _cat = $('.input_category'), _data = [];\n for(i=0; i<_cat.length; i++){\n if($(_cat[i]).val().length > 0){\n let _detail = {}\n _target = $(_cat[i]).data('target');\n _detail['id'] = $(_cat[i]).data('id');\n _detail['name'] = $(_cat[i]).val();\n _detail['sub_variant'] = []\n _tag = $('.tag_list_' + _target + ' > a')\n if(_tag.length > 0){\n for(x=0; x<_tag.length;x++){\n _detail['sub_variant'].push({\n 'id' : $(_tag[x]).data('id'),\n 'name' : $(_tag[x]).data('name'),\n })\n }\n }else{\n notif('danger','Please, fill all required fields.');\n return false\n }\n _data.push(_detail)\n }else{\n notif('danger','Please, fill all required fields.');\n return false\n }\n }\n $.post('/v1/api/data/products',{\n data: JSON.stringify({\n id: userData['id'],\n token: userData['token'],\n status: 19,\n product_id: $('#manage_variant_id').val(),\n data_list: _data,\n })\n }, function (e) {\n if(e.data.status == '00'){\n close_sideform();\n }\n }).fail(function(){\n notif('danger', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n });\n });\n\n // SUBMIT REMOVE DATA ITEM\n $('form#form_remove_item').submit(function(e){\n e.preventDefault();\n _loading(1);\n $.post('/v1/api/data/products',{\n data: JSON.stringify({\n id: userData['id'],\n token: userData['token'],\n status: 12,\n product_id: $('#remove_item_id').val(),\n })\n }, function (e) {\n if(e.status == '00'){\n $('#remove_item_id').val('');\n $('#data_item_' + e.data.id).remove();\n close_sideform();\n }\n }).fail(function(){\n notif('danger', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n });\n });\n\n // SUBMIT REMOVE MANY DATA ITEM\n $('form#form_remove_many_item').submit(function(e){\n e.preventDefault();\n _loading(1);\n\n let item_list = []\n $('.check_data:checked').each(function() {\n item_list.push($(this).val());\n });\n\n $.post('/v1/api/data/products',{\n data: JSON.stringify({\n id: userData['id'],\n token: userData['token'],\n status: 13,\n product_list: item_list,\n })\n }, function (e) {\n if(e.status == '00'){\n for(i=0; i<e.data.length; i++){\n if(e.data[i].status == '00'){\n $('#data_item_' + e.data[i].id).remove();\n }else{\n\n }\n }\n close_sideform();\n }\n }).fail(function(){\n notif('danger', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n $('.check_all').prop('checked', false).change();\n });\n });\n\n\n // Manage Product's Price\n $('form#form_manage_price').submit(function(e){\n e.preventDefault();\n _loading(1);\n let same_price=false;\n if($('#same_price_manage').is(':checked')){\n same_price = true;\n }\n let price = [], input_price = $('.main_price');\n for(i=0; i<input_price.length;i++){\n\n let pi = '', vi = '', sold_val = false;\n let sold_type = '.main_sold_pi_' + $(input_price[i]).data('pi') + '_vi_' + $(input_price[i]).data('vi')\n if($(sold_type).is(':checked')){\n sold_val = true;\n }\n if($(input_price[i]).data('vi') != null){\n vi = $(input_price[i]).data('vi');\n }\n if($(input_price[i]).data('pi') != null){\n pi = $(input_price[i]).data('pi');\n }\n price.push({\n 'pi': pi,\n 'vi': vi,\n 'sold': sold_val,\n 'value': $(input_price[i]).val().toString()\n })\n }\n $.post('/v1/api/data/products',{\n data: JSON.stringify({\n id: userData['id'],\n token: userData['token'],\n status: 15,\n product_id: userData['iid'],\n same_price: same_price,\n price: price,\n })\n }, function (e) {\n if(e.status == '00'){\n nav_href('product-item');\n }\n }).fail(function(){\n notif('danger', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n });\n });\n\n // Manage Product Price per outlet\n $('form#form_manage_outlet_price').submit(function(e){\n e.preventDefault();\n _loading(1);\n let price = [], input_price = $('.outlet_price');\n for(i=0; i<input_price.length;i++){\n let pi = '', vi = '';\n if($(input_price[i]).data('vi') != null){\n vi = $(input_price[i]).data('vi');\n }\n if($(input_price[i]).data('pi') != null){\n pi = $(input_price[i]).data('pi');\n }\n price.push({\n 'pi': pi,\n 'vi': vi,\n 'value': $(input_price[i]).val().toString()\n })\n }\n\n $.post('/v1/api/data/products',{\n data: JSON.stringify({\n id: userData['id'],\n token: userData['token'],\n status: 17,\n product_id: userData['iid'],\n outlet_id: $('#manage_outlet_price_id').val(),\n price: price,\n })\n }, function (e) {\n if(e.status == '00'){\n $('#manage_outlet_price_id').val('');\n $('#manage_outlet_price_price').val('');\n close_sideform();\n }\n }).fail(function(){\n notif('danger', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n });\n });\n\n // Manage Product's Stock\n $('form#form_manage_stock').submit(function(e){\n e.preventDefault();\n // _loading(1);\n let stock = [], input_stock = $('.main_stock');\n for(i=0; i<input_stock.length;i++){\n\n let pi = '', vi = '', mng_val = false, alert_val=false;\n let mng_type = '.main_mng_pi_' + $(input_stock[i]).data('pi') + '_vi_' + $(input_stock[i]).data('vi'),\n alert_type = '.main_alert_pi_' + $(input_stock[i]).data('pi') + '_vi_' + $(input_stock[i]).data('vi');\n if($(mng_type).is(':checked')){\n mng_val = true;\n }\n if($(alert_type).is(':checked')){\n alert_val = true;\n }\n\n vi = 0\n if($(input_stock[i]).data('vi') != null){\n vi = $(input_stock[i]).data('vi');\n }\n if($(input_stock[i]).data('pi') != null){\n pi = $(input_stock[i]).data('pi');\n }\n _value = '0'\n if($(input_stock[i]).val().toString().length > 0){\n _value = $(input_stock[i]).val().toString()\n }\n stock.push({\n 'pi': pi,\n 'vi': vi,\n 'invent_type': mng_val,\n 'alert_type': alert_val,\n 'value': _value\n })\n }\n $.post('/v1/api/data/products',{\n data: JSON.stringify({\n id: userData['id'],\n token: userData['token'],\n status: 26,\n product_id: userData['iid'],\n stock: stock,\n })\n }, function (e) {\n if(e.status == '00'){\n nav_href('product-item');\n }\n }).fail(function(){\n notif('danger', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n });\n });\n\n // Manage Ingredients (UPDATE DATA)\n $('form#form_manage_ingredients').submit(function(e){\n e.preventDefault();\n _loading(1);\n\n let input_field = $('.ingredients_field'), data_list = [];\n let main_data_list = {};\n main_data_list['vid'] = []\n for(i=0; i<input_field.length;i++){\n let\n row = $(input_field[i]).data('row'),\n mpid = $(input_field[i]).data('pid'),\n mvid = $(input_field[i]).data('vid'),\n ipid = $(input_field[i]).data('ipid'),\n ivariant= $(input_field[i]).data('variant'),\n ivid = '0', ival = '0';\n if(ivariant == true){\n ivid = $('.ingredients_variant_pid_' + mpid + '_vid_' + mvid + '_row_' + row).val();\n }\n if($('.ingredients_value_pid_' + mpid + '_vid_' + mvid + '_row_' + row).val().trim().length > 0){\n ival = $('.ingredients_value_pid_' + mpid + '_vid_' + mvid + '_row_' + row).val();\n }\n\n main_data_list['pid'] = mpid;\n if(main_data_list['vid'].includes(mvid) == false){\n main_data_list['vid'].push(mvid)\n }\n\n if(ipid != '0'){\n let _detail = {\n 'mpid':mpid,\n 'mvid':mvid,\n 'ipid':ipid,\n 'ivariant': ivariant,\n 'ivid': ivid,\n 'value': ival,\n }\n data_list.push(_detail)\n }\n }\n\n $.post('/v1/api/data/products',{\n data: JSON.stringify({\n id: userData['id'],\n token: userData['token'],\n status: 21,\n main_data_list: main_data_list,\n product_list: data_list,\n })\n }, function (e) {\n if(e.status == '00'){\n nav_href('product-item');\n }\n }).fail(function(){\n notif('danger', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n });\n });\n\n // Import Data from Products\n $('form#form_manage_import_ingredients').submit(function(e){\n e.preventDefault();\n _loading(1);\n\n let import_item = $('#import_item'), import_mvid=null;\n if($(import_item).attr('data-variant')){\n import_mvid=$('#import_variant').val()\n }\n let mpid = $('#import_pid_vid_id').attr('data-mpid'),\n mvid = $('#import_pid_vid_id').attr('data-mvid');\n\n $.post('/v1/api/data/products',{\n data: JSON.stringify({\n id: userData['id'],\n token: userData['token'],\n status: 24,\n import_mpid: import_item.val(),\n import_mvid: import_mvid,\n })\n }, function (e) {\n console.log(e)\n if(e.data.status == '00'){\n let exist_list = e.data.ingredients_list;\n $('.ingredients_list_append_pid_' + mpid + '_vid_' + mvid).empty()\n for(x=0; x<exist_list.list.length; x++){\n row = _num_row(mpid, mvid)\n ingredients_list_append_ingredients(mpid, mvid, row);\n ivid = 0\n if( exist_list.list[x].ipid.variant_type == true){\n ivid = exist_list.list[x].ivid.id;\n }\n choose_ingredients_option(mpid, mvid, row, exist_list.list[x].ipid.id, exist_list.list[x].ipid.name, exist_list.list[x].ipid.variant_type, ivid);\n $('.ingredients_value_pid_' + mpid + '_vid_' + mvid + '_row_' + row).val(exist_list.list[x].amount);\n }\n close_sideform();\n }\n }).fail(function(){\n notif('danger', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n });\n });\n\n\n}", "title": "" }, { "docid": "4c0044ff599a2629996b6ee2039fa538", "score": "0.5591749", "text": "function prepareNewCategoryForm() {\n $('#editCategorySubmit').click(function(event) {\n event.preventDefault();\n var categoryName = $('#editCategoryName').attr('value');\n putCategory(categoryName, function() {\n addCategory(categoryName);\n $('#editCategoryName').attr('value', '');\n });\n });\n}", "title": "" }, { "docid": "97db95e8d45f9e6ce9e2e3f483834924", "score": "0.5583915", "text": "function validateSilverBuying(form){\n\n var thisForm = $(form);\n var goldCountExchange = thisForm.find('input[name=\"buy_silver\"]').val();\n\n $.ajax({\n url: ajaxurl, //exchange_silver_error.json //js/json/exchange_silver_error.json\n data:{action:'exchange_gold_to_silver', formData:goldCountExchange},\n method:'POST',\n success:function(data){\n\n if(typeof data == 'object'){\n var buyingSilverData = data;\n }else{\n var buyingSilverData = JSON.parse(data);\n }\n\n console.log(buyingSilverData);\n\n if(buyingSilverData.change == 0){\n\n popupCalling('exchange_error_gold', \"exchange-error-wrap\", thisForm);\n\n }else if(buyingSilverData.change == 1){\n\n $('.header-box .resurses .gold').text(buyingSilverData.gold_count);\n $('.header-box .resurses .silver').text(buyingSilverData.silver_count);\n\n $.fancybox.close();\n\n }\n\n }\n });\n\n }", "title": "" }, { "docid": "267e082794a74aed5c2540bb4626af47", "score": "0.5578647", "text": "function add_category(){\nvar Mybase_url = base_url();\nvar businessid = $('#businessid11').val();\nvar id = $('#policyId').val();\nvar arrcat=new Array();\n$('#tblCategory tbody tr').each(function(row,tr){\narrcat[row]={ \"cat_id\":$(tr).find('td:nth-child(1) input[type=hidden]').val() ,\n\"sp_cat_single_exp_limit\":$(tr).find('td:nth-child(4) input[type=text]').val() ,\n\"sp_cat_single_daily_limit\":$(tr).find('td:nth-child(5) input[type=text]').val() ,\n\"sp_cat_single_month_limit\":$(tr).find('td:nth-child(6) input[type=text]').val()\n};\n\n})\n // var savedatacat = JSON.stringify(arr);\n // alert(savedatacat);\n\n $.ajax({\n url: Mybase_url+'ssa/policy/ssapolicycategory/',\n type:'POST',\n data: { 'a_mode':'Insert', 'policyId':id,'a_BusinessId':businessid, 't_PolicyName':arrcat},\n success: function(data){\n console.log(data);\n }\n });\n\n // alert(JSON.stringify(arr));\n\n}", "title": "" }, { "docid": "aa1172abbf692b472db0ae43808b7b76", "score": "0.55782044", "text": "function add_to_compar_list(product_id)\n{\n //send data to products controler to add to catr function \n var host_name=document.location.protocol+'//'+document.location.host;\n $.ajax({\n url:host_name+'/consumer/compar-list/add/'+product_id,\n method:'GET',\n success:function(data){\n //alert(data);\n if(data)\n {\n $('#compar_list_button'+product_id).css('color','#F8694A');\n //alert success\n Swal.fire({\n //position: 'top-end',\n icon: 'success',\n title: 'تم إضافة المنتج إلى قائمة المقارنة',\n showConfirmButton: false,\n timer: 1500\n });\n }else\n {\n $('#compar_list_button'+product_id).css('color','#30323A');\n //alert success\n Swal.fire({\n //position: 'top-end',\n icon: 'success',\n title: 'تم حذف المنتج إلى قائمة المقارنة',\n showConfirmButton: false,\n timer: 1500\n });\n }\n \n }\n });\n}", "title": "" }, { "docid": "e974cfe99e546a91a07acfb3b94d2d68", "score": "0.557274", "text": "function validateCategoryForm(e) {\n let hasError = false;\n let name = $('#category_name').val();\n let parent = $('#category_parent').val();\n\n if (!name || name.trim().length <= 0) {\n $('#category_name').addClass('is-invalid');\n hasError = true;\n } else {\n $('#category_name').removeClass('is-invalid');\n }\n\n if (!parent) {\n $('#category_parent').addClass('is-invalid');\n hasError = true;\n } else {\n $('#category_parent').removeClass('is-invalid');\n }\n\n if (hasError) {\n e.preventDefault();\n }\n\n return hasError;\n }", "title": "" }, { "docid": "ad543bbe413e78daa4e9fb857e081e2d", "score": "0.5570726", "text": "function Update() {\n var res = validate();\n if (res == false) {\n return false;\n }\n\n var categoryObj = {\n CategoryID: $('#CategoryID').val(),\n CategoryName: $('#CategoryName').val(),\n SeoTitle: $('#SeoTitle').val(),\n MetaKeywords: $('#MetaKeywords').val(),\n MetaDescription: $('#MetaDescription').val(),\n Status: $('#Status').val(),\n CreatedDate: $('#CreatedDate').val(),\n CreatedBy: $('#CreatedBy').val(),\n ShowOnHome: $('#ShowOnHome').val()\n };\n\n $.ajax({\n url: \"/Admin/BookCategory/Update\",\n data: JSON.stringify(categoryObj),\n type: \"POST\",\n contentType: \"application/json;charset=utf-8\",\n dataType: \"json\",\n success: function (result) {\n loadData(1, \"\");\n $('#myModal').modal('hide');\n $('#CategoryName').val(\"\");\n $('#SeoTitle').val(\"\");\n $('#MetaKeywords').val(\"\");\n $('#MetaDescription').val(\"\");\n $('#Status').val(\"\");\n $('#CreatedDate').val(\"\");\n $('#CreatedBy').val(\"\");\n $('#ShowOnHome').val(\"\");\n $.notify(result.message, {\n globalPosition: \"top center\",\n className: \"success\"\n });\n\n },\n error: function (errormessage) {\n alert(errormessage.responseText);\n }\n });\n}", "title": "" }, { "docid": "d40bcbcbf778417f24ad8a527abb07f5", "score": "0.5568147", "text": "function addNewItem(category){\n if(confirm(\"Are you sure you want to proceed?\")){\n $.ajax({\n url:\"addItem.jsp\",\n type:\"post\",\n data:{\"itemName\" : $(\"#textItemName\").val(),\n \"itemDesc\": $(\"#textItemDesc\").val(),\n \"inStock\" : $(\"#textInStock\").val(),\n \"price\" : $(\"#textPrice\").val(),\n \"supplyPrice\": $(\"#textSupplyPrice\").val(),\n \"category\" : category\n },\n success: function(){\n location.reload(true);\n alert(\"Item added Successfully!\");\n }\n })\n }\n}", "title": "" }, { "docid": "a760f91afa09ecccb33445c35e7de403", "score": "0.55617064", "text": "function addCategory()\n{\n\t// Read in the current HTML.\n\t// Add a row to the table.\n\tvar _category = document.getElementById( 'addCategoryInput' ).value;\n\tvar _budgeted = document.getElementById( 'addBudgetedInput' ).value;\n\tvar totalsRow = {};\n\tvar duplicate = false;\n\n\t//alert( 'Add Category is still being implemented, here are the values you entered:\\n' + _category + '\\n' + _budgeted );\n\n\t// Check categoryArray[] for a pre-existing category of this name.\n\tfor( var i = 0; i < categoryArray.length; i++ )\n\t{\n\t\tif( categoryArray[i].category == _category )\n\t\t{\n\t\t\talert( 'A category of this name already exists!' );\n\t\t\tduplicate = true;\n\t\t\tconsole.log( 'Duplicate category \"' + categoryArray[i].category + '\" was not re-added.' );\n\t\t}\n\t}\n\tif( duplicate )\n\t{\n\t\t//alert( 'Unable to add this category due to duplication!' );\n\t}\n\telse\n\t{\n\t\t// Add the new category to categoryArray[].\n\t\tvar tempCategory = new categoryItem( _category, parseInt( _budgeted ), 0 );\n\t\ttotalsRow = categoryArray.pop();\n\t\t//console.log( 'addCategory total: ' + totalsRow.spent );\n\t\tcategoryArray.push( tempCategory );\n\t\tcategoryArray.push( totalsRow );\n\t}\n\tfor( var i = 0; i < categoryArray.length; i++ )\n\t{\n\t\t//console.log( categoryArray[i].category + ' ' + categoryArray[i].budgeted );\n\t}\n\n\t// Update the Select list.\n\tupdateSelect();\n\t// Redraw the table.\n\ttableRedraw();\n} // End of addCategory() function.", "title": "" }, { "docid": "2df7a7232b4aa4f2f937afa258d372fc", "score": "0.55606157", "text": "function sujung_modal(){\n\n\t\t\t\tif(company_num == false){ // 현장을 선택하지않으면 \n\n\t\t\t\t\talert(\"현장을 선택하세요.\");\n\t\t\t\t\treturn false;\n\n\t\t\t\t}else{ //현장을 선택하면\n\n\t\t\t\t\tc = confirm(\"'\" + company_name + \"'\" + \"을(를) 수정하시겠습니까?\");\n\n\t\t\t\t}\t\t\t\t\n\t\t\t\tif(c == true){ // 수정확인을 누르면 ajax 통신\n\t\t\t\t\t\n\t\t\t\t\t$('#sujung_modal').modal('show');\n\n\t\t\t\t\t$.ajax({\n\t\t\t\n\t\t\t\t\t\t\turl: \"/index.php/ajax/new_register/HyunjangInfo_Ajax/hyunjang_modal_ajax\", \n\t\t\t\t\t\t\ttype: \"post\",\n\t\t\t\t\t\t\tdata : {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t'companyNum'\t: company_num,\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tdataType:\"json\",\n\t\t\t\t\t\t\ttimeout: 30000,\n\t\t\t\t\t\t\tsuccess: function(data) {\n\t\t\t\t\t\t\t\tkosa_data= new Array();\n\t\t\t\t\t\t\t\t$.each(data, function(key, val){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tkosa_data.push({\n\t\t\t\t\t\t\t\t\t\"num\"\t\t\t\t\t:val.num,\n\t\t\t\t\t\t\t\t\t\"hyun_jang_number\"\t\t:val.hyun_jang_number,\n\t\t\t\t\t\t\t\t\t\"manageBunho\"\t\t\t:val.manageBunho,\n\t\t\t\t\t\t\t\t\t\"hyun_jang_name\"\t\t:val.hyun_jang_name,\n\t\t\t\t\t\t\t\t\t\"kosa_name\"\t\t\t\t:val.kosa_name,\n\t\t\t\t\t\t\t\t\t\"balju_company\"\t\t\t:val.balju_company,\n\t\t\t\t\t\t\t\t\t\"kosa_gigan_start\"\t\t:val.kosa_gigan_start,\n\t\t\t\t\t\t\t\t\t\"kosa_gigan_end\"\t\t:val.kosa_gigan_end,\n\t\t\t\t\t\t\t\t\t\"bogoja\"\t\t\t\t:val.bogoja,\n\t\t\t\t\t\t\t\t\t\"wdate\"\t\t\t\t\t:val.wdate,\n\t\t\t\t\t\t\t\t\t\"id\"\t\t\t\t\t:val.id,\n\t\t\t\t\t\t\t\t\t\"content\"\t\t\t\t:val.content,\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\t});//each end;\n\t\t\t\t\t\t\t$('#kosaNum').val(kosa_data[0].num);\t\n\t\t\t\t\t\t\t$('#hyun_jang_name').val(kosa_data[0].hyun_jang_name);\t\n\t\t\t\t\t\t\t$('#bogoja').val(kosa_data[0].bogoja);\n\t\t\t\t\t\t\t$('#balju_company').val(kosa_data[0].balju_company);\n\t\t\t\t\t\t\t$('#kosa_name').val(kosa_data[0].kosa_name);\n\t\t\t\t\t\t\t$('#hyun_jang_number').val(kosa_data[0].hyun_jang_number);\n\t\t\t\t\t\t\t$('#kosa_gigan_start').val(kosa_data[0].kosa_gigan_start);\n\t\t\t\t\t\t\t$('#kosa_gigan_end').val(kosa_data[0].kosa_gigan_end);\n\t\t\t\t\t\t\t$('#special_content').val(kosa_data[0].content);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\n\t\t\t\t\t\t\terror: function(xhr, valStatus, errorThrown) {\n\t\t\t\t\t\t\t\talert(\"데이터 수신 실패!\\n\" + valStatus + \" (HTTP-\" + xhr.status + \" / \" + errorThrown + \")\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t\t});//ajax end\n\t\t\t\n\t\t\t\t}else{ //수정취소를 누르면 취소\n\t\t\t\t\t\n\t\t\t\t\t$('#sujung_modal').modal('hide');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t}", "title": "" }, { "docid": "08f295083117e3472509a5815f9c3a33", "score": "0.5553895", "text": "Category_code(member) {\n let Category_code = $('#input_category_code').val();\n if ( Category_code == \"\") {\n $('#error08').show();\n return false;\n }\n \n else {\n $('#error08').hide();\n return true;\n }\n\n }", "title": "" }, { "docid": "4256a0e13e11dacd0b13fdd12492e451", "score": "0.55530125", "text": "function updatecontainer(event){\n debugger;\n var formdata = $(\"#contform\").serialize();\n var containerid = event.currentTarget.attributes['data-container'].value\n $.ajax({\n type: 'POST',\n url: \"/transactionview/editcontainer/\" + containerid,\n data: formdata,\n //dataType: 'json', \n success: function(data) {\n\n ///alert(\"success\");\n $('#viewtable').html(\"\");\n $('#viewtable').html(data);\n var datatable = $('#tabcol').dataTable({\n \"ordering\": false,\n stateSave: true\n });\n $('#tabcol').DataTable();\n \n $(\"#divResults\").empty();\n\n $(\"#divResults\").fadeTo(2000, 500).append(\"<h4>Alert!</h4>Saved Successfully.\").addClass(\"alert alert-success alert-dismissible\").slideUp(500, function() {\n $(\"#divResults\").slideUp(500);\n });\n $(\"#createIoniclb\").removeClass('bg-green-active');\n $(\"#createIoniclb\").addClass('bg-blue');\n },\n error: function(data) {\n console.log(data)\n result = JSON.parse(data.responseText);\n listid = ['title','caption','containertype','inputtype','parent','dbtable','displayorder']\n var errmsg =\"\";\n for (var i=0;i<listid.length;i++){\n var name = listid[i];\n\n try{\n errmsg += result[name][0]; \n }\n catch(err) {\n console.log(err);\n } }\n popupmessage(\"Errors:\"+errmsg);\n $(\"#divErrorMessages\").empty();\n $(\"#divErrorMessages\").fadeTo(2000, 500).append(\"<h4>Alert!</h4>Saved Failed.\").addClass(\"alert alert-danger alert-dismissible\").slideUp(500, function() {\n $(\"#divErrorMessages\").slideUp(500);\n });\n }\n });\n }", "title": "" }, { "docid": "2ff3332a15885d3f7a4113c34d1fa9a2", "score": "0.55527824", "text": "function formAddCategories(response){\n clearContent()\n checkLoader()\n var data = response.data\n setTimeout(function() {\n\n removeLoader()\n\n var containerFluid = document.createElement('div')\n containerFluid.setAttribute('class','container-fluid')\n\n var blockHeader = document.createElement('div')\n blockHeader.setAttribute('class','block-header')\n blockHeader.style.textAlign = \"center\"\n\n var h2Block = document.createElement('h2')\n h2Block.style.fontWeight = \"bold\"\n h2Block.style.fontSize = \"24px\"\n h2Block.innerText = \"ADD ARTICLE CATEGORY\"\n\n var small = document.createElement('small')\n var aSmall = document.createElement('a')\n aSmall.setAttribute('href',\"https://bookmarks-apis.herokuapp.com/api/article-categories/\")\n aSmall.innerText = \" https://bookmarks-apis.herokuapp.com/api/article-categories/\"\n\n small.innerText = \"Taken From \"\n small.appendChild(aSmall)\n blockHeader.appendChild(h2Block)\n blockHeader.appendChild(small)\n\n //\n\n var rowClearFix = document.createElement('div')\n rowClearFix.setAttribute('class','row clearfix')\n\n var column = document.createElement('div')\n column.setAttribute('class','col-lg-12 col-md-12 col-sm-12 col-xs-12')\n\n var card = document.createElement('div')\n card.setAttribute('class','card')\n\n var body = document.createElement('div')\n body.setAttribute('class','body')\n\n var form = document.createElement('form')\n form.setAttribute('class','form-horizontal')\n form.setAttribute('id','form-add')\n\n var rowClearFix2 = document.createElement('div')\n rowClearFix2.setAttribute('class','row clearfix')\n var column21 = document.createElement('div')\n column21.setAttribute('class','col-lg-2 col-md-2 col-sm-4 col-xs-5 form-control-label')\n var label2 = document.createElement('label')\n label2.innerText = \"Category Title : \"\n column21.appendChild(label2)\n\n var column22 = document.createElement('div')\n column22.setAttribute('class','col-lg-10 col-md-10 col-sm-8 col-xs-7')\n var formGroup2 = document.createElement('div')\n formGroup2.setAttribute('class','form-group title')\n var formLine2 = document.createElement('div')\n formLine2.setAttribute('class','form-line title')\n var input2 = document.createElement('input')\n input2.setAttribute('class','form-control title')\n input2.setAttribute('type','text')\n input2.setAttribute('id','title')\n input2.setAttribute('required','required')\n input2.setAttribute('placeholder','Article category must be unique*')\n formLine2.appendChild(input2)\n formGroup2.appendChild(formLine2)\n column22.appendChild(formGroup2)\n\n rowClearFix2.appendChild(column21)\n rowClearFix2.appendChild(column22)\n \n var rowClearFix5 = document.createElement('div')\n rowClearFix5.setAttribute('class','row clearfix')\n var column51 = document.createElement('div')\n column51.setAttribute('class','col-lg-offset-2 col-md-offset-2 col-sm-offset-4 col-xs-offset-5')\n\n var button6 = document.createElement('button')\n button6.setAttribute('type','button')\n button6.setAttribute('class','btn btn-warning m-t-15')\n button6.setAttribute('id','back')\n button6.style.width=\"225px\"\n button6.style.fontSize=\"16px\"\n button6.innerText = \"See All Article Categories\"\n\n var button5 = document.createElement('button')\n button5.setAttribute('type','submit')\n button5.setAttribute('class','btn btn-success m-t-15')\n button5.setAttribute('id','tambahtambah')\n button5.style.width=\"225px\"\n button5.style.fontSize=\"16px\"\n button5.style.marginLeft = \"50px\"\n button5.innerText = \"Add Article Category\"\n\n\n column51.appendChild(button6)\n column51.appendChild(button5)\n \n rowClearFix5.appendChild(column51)\n\n form.appendChild(rowClearFix2)\n form.appendChild(rowClearFix5)\n\n body.appendChild(form)\n card.appendChild(body)\n column.appendChild(card)\n rowClearFix.appendChild(column)\n \n containerFluid.appendChild(blockHeader)\n containerFluid.appendChild(rowClearFix)\n \n var section = document.getElementsByClassName('content main')[0]\n section.appendChild(containerFluid)\n\n var back = document.getElementById('back')\n back.addEventListener('click',function(){\n var API_URL = \"https://bookmarks-apis.herokuapp.com/api/article-categories/\"\n panggilAxiosCategories(API_URL)\n })\n\n var tambah = document.getElementById(\"form-add\");\n tambah.addEventListener(\"submit\", function(event) {\n var tampung=0;\n for( var totalCategories = 0 ;totalCategories<data.length;totalCategories++){\n var judul = document.getElementById('title').value\n if (data[totalCategories].title.toLowerCase() == judul.toLowerCase()){\n tampung++;\n }\n }\n if(tampung == 0){\n var answer = confirm(\"Do you really want to add this article category ?\");\n if (answer) {\n var judul = document.getElementById('title').value\n var categoryUrl = \"https://bookmarks-apis.herokuapp.com/api/article-categories/\"\n axios\n .post(categoryUrl, {\n title: judul\n })\n .then()\n .catch(tampungError);\n \n addCategoryPlus();\n event.preventDefault()\n }else{\n event.preventDefault()\n }\n }else{\n alert(\"Sorry, this category title already exists\")\n event.preventDefault()\n }\n });\n }, 200);\n}", "title": "" }, { "docid": "18cdbcdd073ab9edc5a5643225e9b079", "score": "0.55498123", "text": "function product_category_cancel_button() {\n\t$('#product_category').trigger(\"reset\");\n\tupdate_id=\"\";\n\tbutton_create(1);\n\tcategory_datatable_function();\n}", "title": "" }, { "docid": "8e07f6fe2eaecc0021e93435f98263f6", "score": "0.55497074", "text": "function ajaxRenderSectionCrearProducto() {\r\n PopupPosition();\r\n $.ajax({\r\n type: 'GET',\r\n url: urlBase +'crearProducto',\r\n dataType: 'json',\r\n success: function (data) {\r\n OcultarPopupposition();\r\n $('#principalPanel').empty().append($(data));\r\n },\r\n error: function (data) {\r\n OcultarPopupposition();\r\n var errors = data.responseJSON;\r\n if (errors) {\r\n $.each(errors, function (i) {\r\n console.log(errors[i]);\r\n });\r\n }\r\n }\r\n });\r\n}", "title": "" }, { "docid": "f5f6fa81cf1d8fb6633fc4f9b8ded18e", "score": "0.5538661", "text": "function bindMiniBasket () {\n\t\tvar options = { \n\t\t success: function(){\n\t\t\t\t$(\"#miniBasket2\").load(\"/actions/ShowMiniBasket/\"+lang,function(){\n\t\t\t\t\tbindMiniBasket();\t\t\t\t\t\n\t\t\t\t\t$(\"#loading\").stop(true,false).fadeOut();\n\t\t\t\t});\n\n\n\t\t\t} // post-submit callback \n\t\t};\n\t\t$(\".quantity\").blur(function(e){\n\t\t\tif ($(e.target).attr(\"id\")!=\"updateQuantities\") {\n\t\t\t\t$(\"#miniBasketForm\").submit();\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t$(\"#miniBasketForm\").submit(function(){\n\t\t\t$(\"#loading\").fadeIn();\n\n\t\t\t$(\"#miniBasketForm\").ajaxSubmit(options);\n\t\t\treturn false;\n\t\t});\n\t\t$(\".removeCell a\").click(function(){\n\t\t\t$(\"#loading\").fadeIn();\n\t\t\t$.ajax({ url: $(this).attr(\"href\"), success: function(){\n\t\t\t\t$(\"#miniBasket2\").load(\"/actions/ShowMiniBasket/\"+lang,function(){\n\t\t\t\tbindMiniBasket();\n\t\t\t\t$(\"#loading\").stop(true,false).fadeOut();\n\n\t\t\t\t});\n\t\t\t}});\n\t\t\treturn false;\n\t\t});\n\t}", "title": "" }, { "docid": "e70ab0ab49e734506f47d6ad524751b1", "score": "0.5535467", "text": "addCategory(event){\n\t\tevent.preventDefault();\n\t\tvar categoryName = this.refs.categoryName.value.trim();\n\t\tvar NoofQuestion = this.refs.NoofQuestion.value.trim();\n\t\tvar categoryMarks = this.refs.categoryMarks.value.trim();\n\t\tvar _id = this.refs._id.value;\n\t\tif(categoryMarks>0){\n\t\t\tvar findCategory = CategoryMaster.findOne({\"categoryName\":categoryName});\n\t\t\tif(findCategory){\n\t\t\t\tif(_id){\n\t\t\t\t\tMeteor.call(\"addCategory\",categoryName,NoofQuestion,categoryMarks,_id,(error,result)=>{\n\t\t\t\t\t\tif(error){\n\t\t\t\t\t\t\tconsole.log(\"somthing went wrong\");\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tFlowRouter.go('/AddCategories');\n\t\t\t\t\t\t\tswal(\"Category Updated Successfully\",\"\",\"success\");\n\t\t\t\t\t\t\t$('.addCategoryBtn').html(\"Add\");\n\t\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\t\t'categoryName' : '',\n\t\t\t\t\t\t\t\t'NoofQuestion' : '',\n\t\t\t\t\t\t\t\t'categoryMarks' : '',\n\t\t\t\t\t\t\t\t'_id' : '',\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}else{\n\t\t\t\t\tthis.refs.categoryName.value = '';\t\n\t\t\t\t\tthis.refs.categoryMarks.value = '';\n\t\t\t\t\tthis.refs.NoofQuestion.value = '';\n\t\t\t\t\tswal(\"Category Already Exist\",\"\",\"warning\");\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\tMeteor.call(\"addCategory\",categoryName,NoofQuestion,categoryMarks,_id,(error,result)=>{\n\t\t\t\t\tif(error){\n\t\t\t\t\t\tconsole.log(\"somthing went wrong\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tswal('\"' +categoryName+'\"' +\" Category Added Successfully\",\"\",\"success\");\n\t\t\t\t\t\tFlowRouter.go('/AddCategories');\n\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\t'categoryName' : '',\n\t\t\t\t\t\t\t'NoofQuestion' : '',\n\t\t\t\t\t\t\t'categoryMarks' : '',\n\t\t\t\t\t\t\t'_id' : '',\n\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}else{\n\t\t\tswal(\"Marks must be greater than zero\",\"\",\"warning\");\n\t\t}\n\t}", "title": "" }, { "docid": "efa5fc87735a93957578cad7b786bf55", "score": "0.55294704", "text": "function viewMyStoreCategory() {\n var combo = document.viewStoreCategory.general;\n var combodiv = document.getElementById('VSCgeneral');\n var title = document.getElementById('VSCgeneralName');\n var table = document.getElementById('VSCTable');\n //remember graph\n\n var count = document.getElementById('VSCcount');\n var amount = document.getElementById('VSCAmount');\n var arrname = '';\n var arrdat = '';\n var ajax = getAjax();\n var url = 'AjaxPhp/test.php?cat=viewMyStoreCategory';\n ajax.onreadystatechange = function () {\n if (ajax.readyState === 4) {\n var response = ajax.responseText;\n combo.innerHTML = response.substring(response.indexOf('~') + 1, response.indexOf('!'));\n count.innerHTML = response.substring(response.indexOf('!') + 1, response.indexOf('@'));\n table.innerHTML = response.substring(response.indexOf('@') + 1, response.indexOf('#'));\n title.innerHTML = \"ALL Category Groups\";\n arrname = response.substring(response.indexOf('#') + 1, response.indexOf('$'));\n arrdat = response.substring(response.indexOf('$') + 1, response.indexOf('%'));\n amount.innerHTML = document.getElementById('totalSumDisplay').innerHTML;\n combodiv.innerHTML = '';\n loadGraphCat(arrname, arrdat, 'ALL');\n } else {\n combodiv.innerHTML = title.innerHTML = table.innerHTML =\n count.innerHTML = amount.innerHTML = '<i class=\"fa fa-spin fa-refresh\"></i>';\n }\n };\n ajax.open('GET', url, true);\n ajax.send();\n\n //populate combo box\n\n //populate table\n\n //get totalAmnt, total count,\n\n\n\n $('#viewStoreCategoryModal').modal('toggle');\n}", "title": "" }, { "docid": "e3402b149c5d689dd132616a7d458e74", "score": "0.5528341", "text": "function showProduct(bool,newCategory){ //( SHOW CASE:1.2, DELETE CASE:3.5 )\r\n deleteLabel();\r\n emptySpan();\r\n emptySort();\r\n emptySearch();\r\n removeTbody();\r\n emptyFields();\r\n\r\n var category=document.getElementById(\"category-show\").value;\r\n if(bool==true){ \r\n if(category==\"Select Category\"){\r\n alert(\"Please Select Category\");\r\n }\r\n else{\r\n productOperations.show(callBackForShowProduct,category);\r\n }\r\n }\r\n else{\r\n productOperations.show(callBackForShowProduct,newCategory); \r\n }\r\n}", "title": "" }, { "docid": "2829ba14851c4fe1cd49f7cb449463a3", "score": "0.5517304", "text": "function valid_action(id_pembayaran)\r\n{\r\n \r\n\r\n $.ajax({\r\n async:false,\r\n type: \"post\",\r\n url: base_url+\"admin/validasi_pembayaran\",\r\n data: {id_pembayaran:id_pembayaran},\r\n dataType: \"json\",\r\n success: function (response) {\r\n if (response.kode != 1) {\r\n alert_bootstrap(response.kode, response.pesan);\r\n\r\n } else {\r\n button_disabler($('.btn-submit'));\r\n alert_bootstrap(response.kode, response.pesan);\r\n setTimeout(function(){\r\n $('#modal-detail-pembayaran').modal('hide');\r\n reload_table();\r\n },700);\r\n \r\n }\r\n }\r\n });\r\n\r\n \r\n}", "title": "" }, { "docid": "0ef5b771dcb57864454a25baf5749769", "score": "0.5515477", "text": "function addNewSkyTv(){\n/* \nalert($('#new_tv_name').val());\nalert($('#new_tv_desc').val());\nalert($('#add_row_status').val()); */\n\nvar name = $('#new_tv_name').val();\n//var desc = $('#new_tv_desc').val();\nvar desc = '';\nvar status = $('#add_row_status').val();\nvar television_type = $('#tv_category_new').val();\n//alert(television_type);\n\t $.ajax({\n\t\turl: base_url + \"admin/insertTvChannel\",\n\t\ttype: \"post\",\n\t\tdata: {name:name,desc:desc,status:status,television_type:television_type},\n\t\tsuccess: function(data) {\n\t\t\t$('#add_row').val(0); \n\t\t\t$('#add_row_status').val(0); \n\t\t\tskyTv_list();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "d451ce6a02040591ca4655cb55185a35", "score": "0.55147177", "text": "function category_datatable_function(param)\n{\n\tif(!param && param != undefined){\n\t\tvar data={csrfmiddlewaretoken:$(\"input[name=csrfmiddlewaretoken]\").val()}\t\n\t}\n\telse if(param){\n\t\tvar data={csrfmiddlewaretoken:$(\"input[name=csrfmiddlewaretoken]\").val(),\"value\":param}\n\t}\n\t$.ajax(\n\t\t\t{\n\t\t\t\turl : '/product/category/data/',\n\t\t\t\ttype : 'POST',\n\t\t\t\ttimeout : 10000,\n\t\t\t\tdata:data, \n\t\t\t\tasync:false,\n\t\t\t}).done(\n\t\t\t\t\tfunction(json_data)\n\t\t\t\t\t{ \n\t\t\t\t\t\tvar data = JSON.parse(json_data)\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (data.vals){\n\t\t\t\t\t\t\tif (data.status==\"all\"){\n\t\t\t\t\t\t\t\t drawDataTable('category',data.vals, columns,0);\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\telse if (data.status==\"select\"){\n\t\t\t\t\t\t\t\tbutton_create();\n\t\t\t\t\t\t\t\tput_product_category_vals(data.vals)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tdrawDataTable('category',[], columns,0);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttable_data=data.value;\n\t\t\t\t\t\tteam_code=data.code\n\t\t\t\t\t\tif(team_code){\n\t\t\t\t\t\t\tteam_code=team_code[0].code;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\treturn false\n}", "title": "" }, { "docid": "7b95ab7021b86c5c3ce89fff02d71707", "score": "0.5513941", "text": "function submitAddForm() {\n\tvar categoryID = $('#add-form-categoryID :selected').val();\n\tvar arr = $(\"#add-form-price\").val().split(\",\");\n\tvar price = arr.join('');\n\tvar photoName = $(\"#add-form-code\").val();\n\tvar file = $('#add-form-photo').get(0).files[0];\n\n\t// var photo = $(\"#add-form-photo\").val();\n\tvar product = {\n\t\t\"productCode\" : $(\"#add-form-code\").val(),\n\t\t\"productName\" : $(\"#add-form-name\").val(),\n\t\t\"price\" : price,\n\t\t\"listSize\" : $(\"#add-form-size\").val(),\n\t\t\"description\" : $(\"#add-form-description\").val(),\n\t\t\"categoryID\" : categoryID,\n\t\t\"photo\" : photoName\n\t};\n\n\t$.ajax({\n\t\ttype : \"POST\",\n\t\tcontentType : \"application/json\",\n\t\turl : \"/sanpham/themsanpham\",\n\t\tdata : JSON.stringify(product)\n\t});\n\n\t$(\"#add-modal\").modal(\"hide\");\n\n\tswitch (categoryID) {\n\tcase '1':\n\t\ttableId = 'vestTable';\n\t\tif (vestFlag === true) {\n\t\t\treloadTable();\n\t\t}\n\t\tbreak;\n\tcase '2':\n\t\ttableId = 'somiTable';\n\t\tif (somiFlag === true) {\n\t\t\treloadTable();\n\t\t}\n\t\tbreak;\n\tcase '3':\n\t\ttableId = 'quanTable'\n\t\tif (quanFlag === true) {\n\t\t\treloadTable();\n\t\t}\n\t\tbreak;\n\tcase '4':\n\t\ttableId = 'giayTable'\n\t\tif (giayFlag === true) {\n\t\t\treloadTable();\n\t\t}\n\t\tbreak;\n\tcase '5':\n\t\ttableId = 'otherTable'\n\t\tif (phukienFlag === true) {\n\t\t\treloadTable();\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tbreak;\n\t}\n\n\t// clearStatus();\n}", "title": "" }, { "docid": "987851d547be52c2308b97d4f274deb9", "score": "0.55137885", "text": "function existcategory()\n{\n\tvar main=document.existCatForm.existCatName.value;\n\t\n\tif(main==\"select\")\n\t{\n\t\t\n\talert(\"please choose any category name\")\n\tdocument.existCatForm.existCatName.focus();\n\treturn false;\n\t}\n\tdocument.existCatForm.submit();\n\t\n\t\n}", "title": "" }, { "docid": "2be9ce6ca316e94ed92883018874bedf", "score": "0.55083483", "text": "categoryValidation() {\n var input;\n input = document.getElementById(\"category\").value;\n\n if(input === undefined) {\n alert(\"Please select a category\");\n return false;\n }\n }", "title": "" }, { "docid": "f044dfa4450492d6f34d13aa9698c57f", "score": "0.55061024", "text": "function addMarchandizingInfo(){\t\n\t$(\"#err_merchandizing_dialog\").text(\"\");\n\t\n\tvar mz_item_name_id=$(\"#marchandizing_item_id\").val();\n\tvar mz_item_name_id_List=mz_item_name_id.split('-')\n\t\n\tvar mz_item_name=mz_item_name_id_List[0]\n\tvar mz_item_id=mz_item_name_id_List[1];\n\t\n\tvar mz_item_qty=$(\"#mz_qty\").val();\n\tvar mz_date=$(\"#mz_ins_date\").val();\n\t\n\tvar mz_status=$(\"#mz_status\").val();\n\tvar mz_visible=$(\"#mz_visible\").val();\n\tvar mz_dismantle=\"NO\";\n\t\n\tif(mz_item_name_id=='' || mz_item_qty=='' || mz_date=='' || mz_status=='' || mz_visible==''){\t\t\n\t\t$(\"#err_merchandizing_dialog\").text(\"All value required\");\n\t}else{\n\t\t\n\t\tvar tempQty=0\n\t\ttry{\n\t\t\ttempQty=eval(mz_item_qty);\n\t\t}catch(ex){\n\t\t\ttempQty=0;\n\t\t\t}\n\t\t\n\t\tif(tempQty<=0){\n\t\t\t\t$(\"#err_merchandizing_dialog\").text(\"Invalid Quantity\");\t\t\t\t\n\t\t}else{\n\t\t\t\n\t\t\tvar mz_date_ok = new Date(mz_date);\n\t\t\t\n\t\t\tif (mz_date_ok.toString()=='Invalid Date'){\t\t\n\t\t\t\t$(\"#err_merchandizing_dialog\").text(\"Invalid date\");\n\t\t\t\t\t\n\t\t\t}else{\t\t\t\n\t\t\t\tvar mz_n_str=mz_item_id+'<fd>'+mz_item_name+'<fd>'+mz_item_qty+'<fd>'+mz_date+'<fd>'+mz_visible+'<fd>'+mz_status+'<fd>'+mz_dismantle+'<fd>1';\n\t\t\t\t//alert(mz_n_str);\t\n\t\t\t\tif(localStorage.marchandizingStr=='' || localStorage.marchandizingStr==undefined){\n\t\t\t\t\tlocalStorage.marchandizingStr=mz_n_str;\n\t\t\t\t}else{\n\t\t\t\t\tlocalStorage.marchandizingStr=localStorage.marchandizingStr+'<rd>'+mz_n_str\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tgetMarchandizing();\n\t\t\t\n\t\t }//date check\n\t\t}//\tqty check\n\t\t\n\t}//all value\n\t\n }//function", "title": "" }, { "docid": "18f63d740accb547c548b5661ce28866", "score": "0.55051666", "text": "function addRow() {\n\n\tdocument.getElementById('addCategory').style.display='block'; \t\t// display input for adding a category\n\tdocument.getElementById('updateCategory').style.display='block'; \t// display done and cancelled buttons\n\tdocument.getElementById('showInput').style.display='none'; \t\t\t// hide add row link\n\tdocument.getElementById('saveButtons').style.display='none'; \t\t// hide cancel, save draft, and publish buttons\n\tdocument.getElementById('categoryEdit').style.display='none'; \t\t// hide category edit link\n\n\t// Hide tag buttons\n\t$j('#tagEditButton, #tagAddButton').hide();\n\n\t// the state of \"checked\" categories needs to be preserved in case the user cancels the add row operation\n\tcheckedIds.length = 0;\n\n\tvar checkElem = document.getElementsByName('category');\n\n\tif (checkElem != null) {\n\t\tfor (i=0; i<checkElem.length; i++) {\n\t\t\tif (checkElem[i].checked == true) {\n\t\t\t\tcheckedIds.push(checkElem[i].value);\n\t\t\t}\n\t\t}\n\t}\n\n\n\tdocument.onkeypress = stopRKey;\n\t$j('#input_newRow').focus();\n\n}", "title": "" }, { "docid": "699f60deeb6cfad01427d4c92a5188b9", "score": "0.5504334", "text": "function addDataCenterToDb() {\n var dataCenterName = document.getElementById(\"DataCenterName\").value;\n var dataCenterType = document.getElementById(\"selectDataCenterType\").value;\n if (dataCenterName != null) {\n $.ajax({\n url: 'addDataCenterToDB',\n type: 'get',\n async: false,\n data: { pstrDataCenterName: dataCenterName, pstrDataCentertype: dataCenterType },\n datatype: 'json',\n cache:false,\n success: function () {\n //alert(\"data center added successfully\");\n },\n error: function () {\n alert(\"error occured in adding datacenter\");\n }\n });\n $('#addDataCenterModal').on('hide.bs.modal', function () {\n $('#addDataCenterModal').removeClass(\"modal-backdrop fade in\");\n });\n $(\"#masterPageContentPlace\").load(\"CompanyDashboard/?commonCheck=CheckIfTrueErrorWin\");\n }\n else {\n alert(\"Enter Data Center Name\");\n }\n\n }", "title": "" }, { "docid": "3c135c1e9e65d33696e8658b4f84b8ce", "score": "0.5503743", "text": "function openAddMasterComponentModalFuntion() {\n $.ajax({ //to add master components from database to the modal\n url: 'getMasterComponentDataFromDataBase',\n type: 'get',\n async: false,\n datatype: 'json',\n cache:false,\n success: function (data) {\n var newRow, i, eachRow, rowCountHtmlPage;\n rowCountHtmlPage = document.getElementById(\"addMasterComponentModalTable\").rows.length;\n if (rowCountHtmlPage <= data.length)\n {\n for (i = 0; i < data.length; i++)\n {\n newRow = '<tr style=\"font-size:medium; font-weight:500; color:black;\"><td><input type=\"checkBox\" name=\"masterComponentListfromDBCheckBoxes\" value=\"' + data[i].DBMasterComponentName + '\"></td><td>' + data[i].DBMasterComponentName + '</td><tr>';\n $(\"#addMasterComponentModalTableBody\").append(newRow);\n }\n }\n },\n error: function () { alert(\"error\"); }\n });\n\n $(function () {\n function reposition() {\n var modal = $(this),\n dialog = modal.find('.modal-dialog');\n modal.css('display', 'block');\n\n // Dividing by two centers the modal exactly, but dividing by three \n // or four works better for larger screens.\n dialog.css(\"margin-top\", Math.max(0, ($(window).height() - dialog.height()) / 3));\n }\n // Reposition when a modal is shown\n $('.modal').on('show.bs.modal', reposition);\n // Reposition when the window is resized\n $(window).on('resize', function () {\n $('.modal:visible').each(reposition);\n });\n });\n $(\"#AddMasterComponentModal\").modal('show');\n }", "title": "" }, { "docid": "29a10c7ff3f107e6164bde992abdbd43", "score": "0.5503529", "text": "function getStudentCategory(id) {\n $.ajax({\n url: base_url + 'student/categoryDetails',\n type: 'POST',\n data: {'id': id},\n dataType: \"json\",\n success: function (data) {\n $('#ecategory_id').val(data.id);\n $('#ecategory_name').val(data.name);\n $('#ebranch_id').val(data.branch_id).trigger('change');\n mfp_modal('#modal');\n }\n });\n}", "title": "" }, { "docid": "21760c74ba8f1dbcef56084786958867", "score": "0.55001545", "text": "function save_sub_category(){\n\t//alert();\n\tvar category = document.getElementById('txt_sc_category').value;\n\tvar sub_category = document.getElementById('txt_sc_category_desc').value;\n\tif(category.length==0){\n\t\t alert(\"Please select Category.\");\n $('#txt_sc_category').focus();\n\t}else if(sub_category.length==0){\n\t\t alert(\"Please input Sub-Category.\");\n $('#txt_sc_category_desc').focus();\n\t}else{\n\t\t$.post(\"../php/save_sub_category.php\",{\n\t\tcategory: category,\n\t\tsub_category: sub_category\n\t\t}, function(result){\n\t\t if(result==1){\n\t\t\t\talert(\"Fill up all fields.\");\n\t\t\t}else if(result==2){\n\t\t\t\talert(\"Succcessfully Added.\");\n\t\t\t\t//$(\"#closeformadd\").click();\n\t\t\t\tlocation.reload();\n\t\t\t}else{\n\t\t\t\talert(result);\n\t\t\t}\n\n\t});\n\t}\n\t\n}", "title": "" }, { "docid": "2277c1494b3bba7b8ff096d05db17d8f", "score": "0.5489919", "text": "function updateCategoryField(tagCattegory) {\n var clickCount = 0\n\n $.ajax({\n url: '/admin/getCategoryResultsForm',\n type: 'POST',\n contentType: 'application/json',\n data: JSON.stringify({tagCattegory: tagCattegory}),\n success: function (response) {\n console.info('getContentResultsForm')\n console.info(response)\n\n //3 Show results\n $('#contentElement').html('')\n $('#contentElement').html(response.form.form)\n var catValueList = response.form.catValueList\n\n $('#CatValueTable').html(addCatValueForm(catValueList))\n\n $('#addCattegory').click(function () {\n clickCount++\n console.info(clickCount)\n addCatValue(clickCount)\n })\n\n }\n })\n}", "title": "" }, { "docid": "a0b5212a2e45323bc5bee84790785492", "score": "0.5484164", "text": "function validarCategoria() {\n if (document.getElementById('categorias').value) {\n document.getElementById('mex').style.display = 'block';\n document.getElementById('mese').style.display = 'none';\n var categ = {\n nombre: document.getElementById('categorias').value,\n descripcion: document.getElementById('descripcion').value,\n }\n categoriasTabla[k] = categ;\n anexarCategoria(k);\n k++;\n } else {\n document.getElementById('mese').style.display = 'block';\n document.getElementById('mex').style.display = 'none';\n }\n}", "title": "" }, { "docid": "3cb670eb9bc1d7fe9d44fe35d1c4ca33", "score": "0.54829854", "text": "function new_contract()\n{\n if($(\"#txtContrato\").val() == '')\n {\n msjAlert(' El campor contrato no pued estar vacio.');\n }\n else{\n if($(\"#txtIdProvider\").val() == '')\n {\n msjAlert(' Debes de tener un proveedor selecionado.');\n }\n else{\n $.ajax({\n type:'POST',\n url: '/contrato/save/',\n data:{\n txtContrato:$(\"input[name=txtContrato]\").val(),\n txtIdProveedor:$(\"input[name=txtIdProvider]\").val(),\n txtMonto:$(\"input[name=txtMontoContrato]\").val(),\n txtIVA:$(\"input[name=txtIVAContrato]\").val(),\n csrfmiddlewaretoken: $(\"input[name=csrfmiddlewaretoken]\").val(),\n },\n success:function(data)\n {\n if (data >= 1)\n {\n msjSucces('Contrato asigando con exito !');\n load_contract();\n $(\"#txtContrato\").val('');\n $(\"#txtMonto\").val('');\n $(\"#txtIVA\").val('');\n }\n else{\n msjError();\n }\n },\n error:function(req,e,er) {\n msjError();\n }\n });\n\n }\n }\n}", "title": "" }, { "docid": "2651ca34935d3f39f80f34253e199cc4", "score": "0.5474538", "text": "function add_tot(){\n\t$('#mod_add_type_test').modal();\n}", "title": "" }, { "docid": "ab0c78e788f42698c18308a750d93f3e", "score": "0.5473442", "text": "function add_new_customer(){\n\t$(document).ready(function() {\n /////// validation of inputs \nvar valid=1;\n \n if($(\"#cust_fullname\").val()==\"\") {alert(\"يرجى كتابة اسم العميل الثلاثي\") ;$(\"#cust_fullname\").focus();valid=0;}\nif(!validateLength($(\"#cust_fullname\"),10) ){alert(\"الاسم يجب أن لا يقل عن 10 حروف ولا يزيد عن 20 حرف\") ;$(\"#cust_fullname\").focus();valid=0;}\n\nif($(\"#cust_mob1\").val()==\"\") {alert(\"يرجى كتابة رقم المحمول للعميل\") ;$(\"#cust_mob1\").focus();valid=0;}\nif(!validateLength($(\"#cust_mob1\"),9) ){alert(\"رقم المحمول يجب ان لا يقل عن 10 رقما\") ;$(\"#cust_mob1\").focus();valid=0;}\n \n \n ///// execute addition of new customer\n if(valid){\nvar addcustomerform = $( \"#addnewcustform\" ).serialize();\n\n $(\"#spinner\").show();\n $(\"#spinner\").fadeIn(400).html('<img src=\"img/spinner.gif\" />');\n $.ajax({\n type: \"POST\",\n\t dataType: 'json',\n url: \"php/cashier_func2.php\",\n data: addcustomerform,\n cache: false,\n success: function(result){\n\t\t if(result==1){\n alert(\"تم حفظ العميل\");\n\t clearaddnewcust();\n\t populatecustomerslist();\n\t window.location.href =\"#\";\n\t\t }else{\n\t\t\talert(\"عفوا ... هناك خطأ في حفظ العميل\");\n\t\t \n\t\t }\n\t $(\"#spinner\").hide();\n\t \n\t }\n });\n \n }\n\t});\n}//END add new customer from popup window function end", "title": "" }, { "docid": "80c05cfdcb3f75094016d1194e94a125", "score": "0.54729664", "text": "function pullLowStockProduct()\n {\n var url = $('#pullingLowProductListByAjax').data('url');\n var alert_quantity = getValueFromInputField('low_quantity_id_class');\n var unit_id = getValueFromSelectOption('unit_id_class');\n var category_id = getValueFromSelectOption('category_id_class');\n var brand_id = getValueFromSelectOption('brand_id_classs');\n $.ajax({\n url: url,\n data: {alert_quantity:alert_quantity,unit_id:unit_id,category_id:category_id,brand_id:brand_id},\n type: \"GET\",\n //datatype:\"JSON\",\n beforeSend:function(){\n //$('.loading').fadeIn();\n },\n success: function(response){\n //console.log(response);\n $('#showResult').html(response);\n $('#pullLowStockProduct').modal('hide')\n totalQtyAndTotalAmountSetAsText();\n },\n complete:function(){\n //$('.loading').fadeOut();\n },\n });\n //end ajax\n }", "title": "" }, { "docid": "90d11a4a631e1b532af07e611a05a10d", "score": "0.54613423", "text": "function insert_validation(item) {\n if(item.Criterio != \"\" && item.Componente != \"\") return true;\n else $.notify(\"Complete todos los campos primero!\",\"info\");\n }", "title": "" }, { "docid": "6c83a792e658bc31f4df9e1d1e97b685", "score": "0.5459154", "text": "function validarProducto() {\n\n if ($('#description').val().trim() == '') {\n swal(\"Error!\", \"Debe Agregar una descripcion\", \"error\");\n return false;\n }\n if ($('#categoria').val().trim() == '') {\n swal(\"Error!\", \"Debe Agregar una Categoria\", \"error\");\n return false;\n }\n return true;\n}", "title": "" } ]
21bce911663c0fcce1d9e929cb5aba1c
Lookup by stream, then id to store [values, id]]
[ { "docid": "39b4b21a697858ff5214153c13333db9", "score": "0.5201559", "text": "_addVariableEntry() {\n if (!this._dataPending()) {\n return;\n }\n\n // Lookup where to put the value\n let fieldName = 'doubles';\n const value = this._values[0];\n if (typeof value === 'string' || value instanceof String) {\n fieldName = 'strings';\n } else if (typeof value === 'boolean') {\n fieldName = 'bools';\n }\n\n const entry = {values: {[fieldName]: this._values}};\n if (this._id) {\n entry.base = {object_id: this._id}; // eslint-disable-line camelcase\n }\n\n const streamEntry = this._data.get(this._streamId);\n if (streamEntry) {\n // We have stream, now get id\n const idEntry = streamEntry.get(this._id);\n if (idEntry) {\n // already have values for this objet\n this.validateError(`Input \\`values\\` already set for id ${this._id}`);\n } else {\n // create new mapping of id -> entry\n streamEntry.set(this._id, entry);\n }\n } else {\n // No stream\n // create new stream -> id\n const idEntry = new Map();\n idEntry.set(this._id, entry);\n // create stream entry\n this._data.set(this._streamId, idEntry);\n }\n }", "title": "" } ]
[ { "docid": "98d2ac71c52400a3b8cc801cd40cfce6", "score": "0.6135192", "text": "getStreamFromId(id) {\n for (item in this.options) {\n var locations = this.options[item].locations;\n\n for (var i=0; i<locations.length; i++) {\n if (locations[i].id == id) {\n return locations[i];\n }\n }\n }\n }", "title": "" }, { "docid": "44ed1d2c292ec8934b3f3d27a9a46661", "score": "0.5731325", "text": "function getStreamById(id) {\n\t for(var i=0; i<rtc.remoteStreams.length;i++) {\n\t \tif (rtc.remoteStreams[i].id === id) {return rtc.remoteStreams[i];}\n\t }\n\t\t}", "title": "" }, { "docid": "8693a2bc16109c6ff21dba1e156f146b", "score": "0.5424672", "text": "static getAccountStreamIdsForUser(): Map<string, Array<string>> {\n if ( SystemStreamsSerializer.allAccountStreamIdsForUser != null ) return SystemStreamsSerializer.allAccountStreamIdsForUser;\n \n const returnObject = new Map();\n returnObject.uniqueAccountFields = [];\n returnObject.readableAccountFields = [];\n returnObject.accountFields = [];\n returnObject.accountFieldsWithPrefix = [];\n\n const accountStreams = SystemStreamsSerializer.getAccountMap();\n \n Object.keys(accountStreams).forEach(streamId => {\n returnObject.accountFieldsWithPrefix.push(streamId);\n const streamIdWithoutPrefix = SystemStreamsSerializer.removePrefixFromStreamId(streamId);\n if (accountStreams[streamId].isUnique == true) {\n returnObject.uniqueAccountFields.push(streamIdWithoutPrefix);\n }\n if (accountStreams[streamId].isShown == true) {\n returnObject.readableAccountFields.push(streamIdWithoutPrefix);\n } \n returnObject.accountFields.push(streamIdWithoutPrefix);\n });\n SystemStreamsSerializer.allAccountStreamIdsForUser = returnObject;\n \n return SystemStreamsSerializer.allAccountStreamIdsForUser;\n }", "title": "" }, { "docid": "dce63d4f5aa2ecaa7d2f5bcbbd958210", "score": "0.5257008", "text": "function filterMapStreams (streams: Array<SystemStream>, filter: string = IS_SHOWN): Map<string, SystemStream> {\n let streamsMap: Map<string, SystemStream> = new Map();\n \n if (! Array.isArray(streams)) {\n return streamsMap;\n }\n const flatStreamsList = treeUtils.flattenTree(streams);\n\n // convert list to objects\n for (let i = 0; i < flatStreamsList.length; i++){\n \n if (filter === ALL || flatStreamsList[i][filter]) {\n streamsMap[flatStreamsList[i].id] = flatStreamsList[i]\n } else {\n // escape it\n }\n }\n return streamsMap;\n}", "title": "" }, { "docid": "d34c3cb314348d56bfafecf0c2b1d488", "score": "0.5249951", "text": "function extractFromStreamFormat(value) {\n const [streamId, trackList] = value.split(' ');\n const tracks = [];\n trackList.split(',').forEach(id => {\n const [kind, trackId] = id.split(':');\n tracks.push({kind, trackId});\n });\n return {streamId, tracks};\n}", "title": "" }, { "docid": "e9a930d6ef2456b9c9aba433750f79d0", "score": "0.51556516", "text": "function streamTrack(trackInfos, url, bfKey, stream) {\n return new Promise((resolve, reject) => {\n http.get(url, function(response) {\n let i = 0;\n let percent = 0;\n response.on(\"readable\", () => {\n while ((chunk = response.read(2048))) {\n if (\n (100 * 2048 * i) / response.headers[\"content-length\"] >=\n percent + 1\n ) {\n percent++;\n }\n if (i % 3 > 0 || chunk.length < 2048) {\n stream.write(chunk);\n } else {\n const bfDecrypt = crypto.createDecipheriv(\n \"bf-cbc\",\n bfKey,\n \"\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\"\n );\n bfDecrypt.setAutoPadding(false);\n\n let chunkDec = bfDecrypt.update(\n chunk.toString(\"hex\"),\n \"hex\",\n \"hex\"\n );\n chunkDec += bfDecrypt.final(\"hex\");\n stream.write(chunkDec, \"hex\");\n }\n i++;\n }\n });\n response.on(\"end\", () => {\n stream.end();\n resolve(trackInfos);\n });\n });\n });\n}", "title": "" }, { "docid": "aca31a1e9e51d20b823298267f9c556a", "score": "0.50775295", "text": "function index_stream(activity) {\n var stream = activity.stream;\n // if (!activity.stream) {\n // return Promise.reject([\"Missing stream in \", activity]);\n // }\n return new Promise(function(resolve, reject) {\n var metadata = {domain: {}};\n\n if (stream) {\n metadata.geojson = stream.geojson;\n var latlng_stream = stream.latlng;\n var alt_stream = stream.altitude;\n if (latlng_stream && latlng_stream.data) {\n metadata.domain.lat = d3.extent(latlng_stream.data, accessor(0));\n metadata.domain.lng = d3.extent(latlng_stream.data, accessor(1));\n }\n if (alt_stream && alt_stream.data) {\n metadata.domain.alt = d3.extent(alt_stream.data);\n }\n }\n resolve(metadata);\n });\n }", "title": "" }, { "docid": "9f31660b808f4a965e8987e81f784b4a", "score": "0.5053906", "text": "async fetchStreams () {\n\t\tif (this.streamIds.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst streams = await this.data.streams.getByIds(this.streamIds);\n\t\t// only allow editing to be set for file-type streams in the same team and repo\n\t\tthis.fetchedStreams = streams.filter(stream => {\n\t\t\treturn (\n\t\t\t\tstream.get('type') === 'file' &&\n\t\t\t\tstream.get('repoId') === this.repoId &&\n\t\t\t\tstream.get('teamId') === this.teamId\n\t\t\t);\n\t\t});\n\t}", "title": "" }, { "docid": "854f8257855bace10dda37d66b639760", "score": "0.504864", "text": "function extractSource(sources, id) {\n var sourceKey, source;\n for (sourceKey in sources) {\n source = sources[sourceKey];\n if (source.id === id) return source;\n }\n\n return {};\n }", "title": "" }, { "docid": "b76e35496bb922da786affe1c9e4e840", "score": "0.50222296", "text": "function exampleData2() {\n return stream_layers(3,10+Math.random()*100,.1).map(function(data, i) {\n return {\n key: 'Stream ' + i,\n values: data\n };\n });\n}", "title": "" }, { "docid": "4973d8e616e800a3bb5f2debd384c284", "score": "0.5021593", "text": "function gotStream(stream, id) {\n stream.hide();\n \n stream.elt.muted = true;\n \n all[id] = new Avatar(stream, 0, 0, 0);\n}", "title": "" }, { "docid": "66b4b8b6e7b5b0432c2e451b71d5c6ae", "score": "0.50214744", "text": "function live(op) {\n return pull(\n pullAsync((cb) =>\n onReady(() => {\n executeOperation(op, (err) => cb(err))\n })\n ),\n pull.map(() => {\n let offset = -1\n let seqStream\n\n function detectOffsetAndSeqStream(ops) {\n ops.forEach((op) => {\n if (op.type === 'EQUAL' || op.type === 'INCLUDES') {\n if (!indexes[op.data.indexName]) offset = -1\n else offset = indexes[op.data.indexName].offset\n } else if (\n op.type === 'AND' ||\n op.type === 'OR' ||\n op.type === 'NOT'\n ) {\n detectOffsetAndSeqStream(op.data)\n } else if (op.type === 'LIVESEQS') {\n if (seqStream)\n throw new Error('Only one seq stream in live supported')\n seqStream = op.stream\n }\n })\n }\n\n detectOffsetAndSeqStream([op])\n\n // There are two cases here:\n // - op contains a live seq stream, in which case we let the\n // seq stream drive new values\n // - op doesn't, in which we let the log stream drive new values\n\n let recordStream\n if (seqStream) {\n recordStream = pull(\n seqStream,\n pull.asyncMap((seq, cb) => {\n ensureSeqIndexSync(() => {\n getRecord(seq, cb)\n })\n })\n )\n } else {\n const opts =\n offset === -1\n ? { live: true, gt: indexes['seq'].offset }\n : { live: true, gt: offset }\n const logstreamId = Math.ceil(Math.random() * 1000)\n debug(`log.stream #${logstreamId} started, for a live query`)\n recordStream = toPull(log.stream(opts))\n }\n\n return recordStream\n }),\n pull.flatten(),\n pull.filter((record) => isValueOk([op], record.value)),\n pull.through(() => {\n if (debugQuery.enabled)\n debugQuery(\n `live(${getNameFromOperation(op)}): 1 new msg`.replace(/%/g, '%% ')\n )\n }),\n pull.map((record) => bipf.decode(record.value, 0))\n )\n }", "title": "" }, { "docid": "38191810c688515bbe090e002a51eec1", "score": "0.4995613", "text": "function next(stream){\n return stream.next().value;\n}", "title": "" }, { "docid": "508dcd7de4caa7c38804dcc09429c086", "score": "0.4981127", "text": "function addUsersToStreamObjects(streamsData) {\n if (streamsData.data.length < 1) {\n return new Promise(function(resolve, reject) {resolve()});\n }\n const userIds = streamsData.data.map(function(stream) {\n return stream.user_id;\n });\n console.log(userIds)\n return new Promise(function(resolve, reject) {\n get('user', userIds.map(function(userID) {return `id=${userID}&`}).join(''))\n .then(function(users) {\n resolve(streamsData.data.map(function(stream, index) {\n return {\n ...stream,\n url: 'https://twitch.tv/' + users.data[index].login,\n description: users.data[index].description\n }\n }))\n })\n })\n}", "title": "" }, { "docid": "bd953072cfb155449834a44991622076", "score": "0.49394187", "text": "function Stream(...sources){\n const o = Object.create(Stream.prototype);\n o[last] = undefined;\n o[out] = new Set();\n o[src] = sources;\n return o;\n}", "title": "" }, { "docid": "bc93d3f57017a384caf4f9d816452c63", "score": "0.49357432", "text": "function readRedisStream(streamName, min, max) {\n console.log(`invoked with id ${min} and streamName ${streamName}`);\n // deconstruct tuple array back to js object\n Redis.Command.setReplyTransformer('xrange', (streamResult) => {\n if (Array.isArray(streamResult)) {\n // convert reddis stream to array of objects\n // each object is a seperate log entry\n const newResult = [];\n for (const val of streamResult) {\n const obj = {\n id: val[0],\n };\n // array with original key:val pairs stored as consecutive values\n const logValues = val[1];\n for (let i = 0; i < logValues.length; i += 2) {\n const key = logValues[i];\n const value = logValues[i + 1];\n obj[key] = value;\n }\n newResult.push(obj);\n }\n return newResult;\n }\n });\n\n redis\n .xrange(streamName, min, max)\n .then((log) => {\n console.log('READING LATEST REDIS STREAM', log);\n // console.log(`Successfully read from Redis stream -- ${streamName}: ${parsedLog}`)\n })\n .catch((err) => console.log(`Error reading from Redis stream: ${err}`));\n}", "title": "" }, { "docid": "c64664565254e4b34a15a95743f9d492", "score": "0.4928218", "text": "scan(reducer, seed, stream) {\n return sink => {\n let current = seed\n sink(current)\n return stream(x => {\n current = reducer(current, x)\n sink(current)\n })\n }\n }", "title": "" }, { "docid": "f540242fbf9dc8805b7c5266fb78b124", "score": "0.48715088", "text": "function getStreamInfo(id) {\n return request({\n url: `https://vmobile.douyu.com/video/getInfo?vid=${id}`,\n headers: {\n 'X-Requested-With': 'XMLHttpRequest'\n },\n json: true\n });\n}", "title": "" }, { "docid": "2bd990b955361dac494e8a830828fff6", "score": "0.4868965", "text": "function exampleData1() {\n return stream_layers(3,10+Math.random()*100,.1).map(function(data, i) {\n return {\n key: 'Stream ' + i,\n values: data\n };\n });\n}", "title": "" }, { "docid": "cbd1bcfa0156b6d54b3b790ce6e63814", "score": "0.48683143", "text": "getDataStreams(query) {\n let self = this;\n let targetUrl = '';\n if (this.target.selectedThingDirty || this.target.selectedSensorDirty) {\n return [{\n text: 'select a datastream',\n value: 0\n }];\n }\n if (this.target.type === 'Sensors') {\n targetUrl = '/Sensors('+this.getFormatedId(this.target.selectedSensorId)+')/Datastreams';\n } else {\n targetUrl = '/Things('+this.getFormatedId(this.target.selectedThingId)+')/Datastreams';\n }\n return this.datasource.metricFindQuery((query || ''),targetUrl,'datastream').then((result)=>{\n self.allDataSources = result;\n return result;\n }).catch(this.handleQueryCtrlError.bind(this));\n }", "title": "" }, { "docid": "7dacb5cee2ea29f2c6086dafe308dcd6", "score": "0.48373228", "text": "_nextStreamId ()/* : number */ {\n let id = this._nextId\n this._nextId += 2\n return id\n }", "title": "" }, { "docid": "6ba3d4ea0bd4efe0ae1355ab06b9fe18", "score": "0.48116198", "text": "function exampleData4() {\n return stream_layers(3,10+Math.random()*100,.1).map(function(data, i) {\n return {\n key: 'Stream ' + i,\n values: data\n };\n });\n}", "title": "" }, { "docid": "333c2b77513a34a8bad1aaf6c3141d1a", "score": "0.48048168", "text": "function getTrackData(id, cb) {\n var endpoint, data = {}\n\n if (isSoundcloudUrl(id)) {\n endpoint = 'resolve'\n data = { url: id }\n } else {\n endpoint = 'tracks/' + id + '.json'\n }\n\n get(endpoint, data, function(err, data) {\n if (err) return cb(err)\n\n if (!data.streamable) return cb({message: 'track is not streamable'})\n\n var user = data.user || {}\n\n var params = {\n originId: data.id,\n title: data.title,\n length: (data.duration / 1000),\n artist: user.username\n }\n\n cb(null, params)\n })\n}", "title": "" }, { "docid": "e2784afb09c48afcbe92708abb3b8f45", "score": "0.47838068", "text": "function getStreamDifferentThenStreamname (streamname) {\n var streamsCopy = entries.slice();\n var index = streamsCopy.findIndex(function (stream) {\n return stream.h5live.rtmp.streamname === streamname;\n });\n\n if (index > -1) {\n streamsCopy.splice(index, 1);\n }\n\n return streamsCopy;\n }", "title": "" }, { "docid": "ddbbe869d56d676c6e2bfcb14bf7ce30", "score": "0.47671518", "text": "function Stream (params) {\n return DataStream.get(params);\n }", "title": "" }, { "docid": "e9c7cdd141c0640b5edc946a915c1096", "score": "0.47542977", "text": "function exampleData() {\n return stream_layers(3,10+Math.random()*100,.1).map(function(data, i) {\n return {\n key: 'Stream ' + i,\n values: data\n };\n });\n}", "title": "" }, { "docid": "cc6f7abe02d995a9c65872c89b62321f", "score": "0.4715201", "text": "getFromId(id) {\n this._idMap.get(id);\n }", "title": "" }, { "docid": "40823602f98a5743d162b4b661d83df1", "score": "0.47006407", "text": "function stream (requests) {\n return pull(values(requests), paramap(map))\n}", "title": "" }, { "docid": "b0a9094ffd39a02e2ebd670c25a6df7f", "score": "0.47004068", "text": "getObjectFromListById(list, id) {\n let val = list.reduce((acc, current) => {\n if (current.id === id) {\n return current;\n } else return acc;\n }, {});\n\n return val;\n }", "title": "" }, { "docid": "7dbc2e77765ee53c880ab723b2ced262", "score": "0.46892843", "text": "function exampleData() {\n return stream_layers(3,10+Math.random()*100,.1).map(function(data, i) {\n return {\n key: 'Stream #' + i,\n values: data\n };\n });\n }", "title": "" }, { "docid": "e48bb694c9c291a6173ff7c3077ed466", "score": "0.46882826", "text": "function VDIgotStream(stream) { \r\n\tlocalStream = stream.clone();\r\n\tVDILocal.srcObject = stream;\r\n\treturn vdiCitrix.enumerateDevices().then(VDIgotDevices).catch(VDIhandleError);\r\n}", "title": "" }, { "docid": "c9257fcaed3bdbb6d51e2eece0e5d63d", "score": "0.46778283", "text": "function getReadingById(id)\r\n{\r\n for(var i=0; i < readings.length; i++)\r\n {\r\n var reading = readings[i];\r\n if(reading.id == id)\r\n {\r\n return reading;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "77650197f3652b90cfbc526b8d714f61", "score": "0.46641442", "text": "function getStreamID(source) {\n return mobileURLPattern.exec(source)[1];\n}", "title": "" }, { "docid": "65e6aa9493758307a5d1aa117367968b", "score": "0.4658792", "text": "function subscribeToStreams(streams) {\n\t\t\t\t\t// PUT in code that was removed\n\t\t\t\t\t\n\t\t\t\t\tfor (var i = 0; i < streams.length; i++) {\n\t\t\t\t\t\tvar stream = streams[i];\n\t\t\t\t\t\t// Me\n\t\t\t\t\t\t//if (stream.connection.connectionId == session.connection.connectionId) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar parentDiv = document.getElementById(\"temp_vid_holder\");\n\t\t\t\t\t\t\t//var parentDiv = document.getElementById(\"cbc_vid_1\");\n\t\t\t\t\t\t\tvar stubDiv = document.createElement(\"div\");\n\t\t\t\t\t\t\tstubDiv.id = \"vid_3_inner\";\n\t\t\t\t\t\t\tparentDiv.appendChild(stubDiv);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar subscriberProps = {\n\t\t\t\t\t\t\t\twidth: 44,\n\t\t\t\t\t\t\t\theight: 44,\n\t\t\t\t\t\t\t\taudioEnabled: false\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tme = session.subscribe(stream, stubDiv.id, subscriberProps);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar temp_str_id = new String(me.id);\n\t\t\t\t\t\t\t// Remove temp subscribe\n\t\t\t\t\t\t\t$(\"#temp_vid_holder\").html(\"\");\n\t\t\t\t\t\t\t//if (stream.connection.connectionId == session.connection.connectionId) {\n\t\t\t\t\t\t\t\tvar temp_id_array = temp_str_id.split(\"_\");\n\t\t\t\t\t\t\t\tif(!temp_id_array) {\n\t\t\t\t\t\t\t\t\tvar temp_id_array = temp_str_id.split(\",\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t\t//else {\n\t\t\t\t\t\t\t//\tvar temp_id_array = temp_str_id.split(\",\");\n\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t\tconsole.log (\"This is the split: \"+ temp_id_array);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// This will have to be changed to 13 or 14\n\t\t\t\t\t\t\tif(temp_id_array[2] == 12 || temp_id_array[2] == 13/**4**/) {\n\t\t\t\t\t\t\t\ttemp_id_array[2] = 2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(temp_id_array[2] == 24 || temp_id_array[2] == 25/**4**/) {\n\t\t\t\t\t\t\t\ttemp_id_array[2] = 3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar parentDiv = document.getElementById(\"cbc_vid_\" + temp_id_array[2]);\n\t\t\t\t\t\t\tvar stubDiv = document.createElement(\"div\");\n\t\t\t\t\t\t\tstubDiv.id = \"vid_3_inner\";\n\t\t\t\t\t\t\tparentDiv.appendChild(stubDiv);\n\t\t\t\t\t\t\tme = session.subscribe(stream, stubDiv.id, subscriberProps);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//crb1_v_XXX\n\t\t\t\t\t\t\tvar subscriberProps = {\n\t\t\t\t\t\t\t\twidth: 140,\n\t\t\t\t\t\t\t\theight: 155,\n\t\t\t\t\t\t\t\taudioEnabled: false\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor(index = 1; index <=9; index++) {\n\t\t\t\t\t\t\t\tvar parentDiv = document.getElementById(\"crb\" + index +\"_v_\" + temp_id_array[2]);\n\t\t\t\t\t\t\t\t//console.log(crb1_v_1);\n\t\t\t\t\t\t\t\tvar stubDiv = document.createElement(\"div\");\n\t\t\t\t\t\t\t\tstubDiv.id = \"vid_3_inner\";\n\t\t\t\t\t\t\t\tparentDiv.appendChild(stubDiv);\n\t\t\t\t\t\t\t\tsubscriber = session.subscribe(stream, stubDiv.id, subscriberProps);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t//$(\"#vid_4\").append($(\"#vid_3\").html());\n\t\t\t\t\t\t//$(\"#vid_5\").html('<object type=\"application/x-shockwave-flash\" id=\"'+me.id+'\" data=\"http://staging.tokbox.com/v0.91.7.201103041054/flash/f_subscribewidget.swf?partnerId=330921\" width=\"300\" height=\"300\">' + $(\"#\"+ me.id).html() + '</object>');\n\t\t\t\t\t\t//}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (stream.connection.connectionId != session.connection.connectionId) {\n\t\t\t\t\t\t\tvar parentDiv = document.getElementById(\"settings_vid_\" + temp_id_array[2]);\n\t\t\t\t\t\t\tconsole.log(\"NAME IS:\"+temp_id_array[2]);\n\t\t\t\t\t\t\tvar stubDiv = document.createElement(\"div\");\n\t\t\t\t\t\t\tstubDiv.id = \"vid_3_inner\";\n\t\t\t\t\t\t\tparentDiv.appendChild(stubDiv);\n\t\t\t\t\t\t\tvar subscriberProps = {\n\t\t\t\t\t\t\t\twidth: 215,\n\t\t\t\t\t\t\t\theight: 150,\n\t\t\t\t\t\t\t\taudioEnabled: false\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tsession.subscribe(stream, stubDiv.id, subscriberProps);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add names associated to user video-feed\n\t\t\t\t\t\t$.post('php/magic1.php',\n\t\t\t\t\t\t\t{comm : 'names'},\n\t\t\t\t\t\t\tfunction(data){\n\t\t\t\t\t\t\t\t//Put them on the screen\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "f92439d42a2d356466ecb8f659b4c8dd", "score": "0.465342", "text": "function Lookup(id, idkey, subkey, seeds, opts) {\n if(opts === undefined && seeds === undefined) {\n opts = subkey;\n seeds = idkey;\n subkey = undefined;\n idkey = undefined;\n }\n events.EventEmitter.call(this);\n this._targetId = id;\n this._opts = opts;\n this._idkey = idkey;\n this._subkey = subkey;\n this._value = undefined;\n this._valueTimeout = undefined;\n this._srccontact = {};\n this._list = new LookupList(id, opts.size);\n this._concurrents = 0;\n this._depth = 0;\n // The first alpha contacts selected are used to create a shortlist for the\n // search. (§4.5)\n this._list.insertMany(seeds);\n}", "title": "" }, { "docid": "eed42d34d4d3f930354457d4f606f2b0", "score": "0.4650318", "text": "constructor(feeds) {\n this.id2Value = {};\n this.id2Mask = {};\n this.name2Id = {};\n\n if (feeds instanceof FeedDict) {\n for (const id in feeds.id2Value) {\n this.id2Value[id] = feeds.id2Value[id];\n\n if (id in feeds.id2Mask) {\n this.id2Mask[id] = feeds.id2Mask[id];\n }\n }\n } else {\n if (feeds == null) {\n return;\n }\n\n for (const feed of feeds) {\n this.add(feed.key, feed.value);\n }\n }\n }", "title": "" }, { "docid": "cf4fde48e992b4fba150f206aec989f8", "score": "0.46440443", "text": "function getStreamFields( streamID ) {\n try {\n phantApiServices.streamInfo( getServerUrlByID($scope.streamsList[streamID].serverid), $scope.streamsList[streamID].key )\n .then ( function ( result ) {\n //console.log(\"getStreamFields SUCCESS: \");\n $scope.streamsList[streamID].fields=[];\n angular.forEach( result.data[0] , function ( value , key ) // yes, its first value and then key \n {\n //console.log(\"Key: \" + key +\" Value: \" + value );\n $scope.streamsList[streamID].fields.push(key);\n }\n \n );\n \n },\n function ( result ) {\n console.log(\"Error.....\");\n $scope.streamsList[streamID].fields=[];\n\n pushError(\"Can't get fields for \" + $scope.streamsList[streamID].name);\n }\n );\n } catch(err) { console.log(err.name + ': \"' + err.message + '\" occurred when retrieving Stream Fields.') };\n \n }", "title": "" }, { "docid": "f4658cd654839a50ee000e7ce12aa230", "score": "0.46358794", "text": "function transformHashData(stream, item) {\n var vals = [], row = [], headers = stream.headers, i = -1, headersLength = stream.headersLength;\n if (stream.totalCount++) {\n row.push(stream.rowDelimiter);\n }\n while (++i < headersLength) {\n vals[i] = item[headers[i]];\n }\n row.push(stream.formatter(vals));\n return row.join(\"\");\n}", "title": "" }, { "docid": "f4658cd654839a50ee000e7ce12aa230", "score": "0.46358794", "text": "function transformHashData(stream, item) {\n var vals = [], row = [], headers = stream.headers, i = -1, headersLength = stream.headersLength;\n if (stream.totalCount++) {\n row.push(stream.rowDelimiter);\n }\n while (++i < headersLength) {\n vals[i] = item[headers[i]];\n }\n row.push(stream.formatter(vals));\n return row.join(\"\");\n}", "title": "" }, { "docid": "7994dc960186f1d3c255a619792af0ae", "score": "0.4635679", "text": "function streamResponse(req, res, fn) {\n var sessionId = req.query.sid;\n if (!sessionId) { return res.json({error: 'sid missing from request'}, 400); }\n\n var streamId = genStreamId();\n var stream = genStream(sessionId, streamId);\n\n if (stream) {\n // signal to our caller that we have a stream\n // id that they need to subscribe to.\n res.json({streamId: streamId});\n process.nextTick(function() { fn(stream); });\n } else {\n res.json({error: 'stream cannot be initialized'}, 400);\n }\n\n}", "title": "" }, { "docid": "947c88587a4923b2a8187a51d76fca88", "score": "0.46329042", "text": "stream_index(val) {\n this._stream_index = val;\n return this;\n }", "title": "" }, { "docid": "6492c124ed4acb0b6eed182e77b54660", "score": "0.46249098", "text": "function exampleData3() {\n return stream_layers(3,10+Math.random()*100,.1).map(function(data, i) {\n return {\n key: 'Stream ' + i,\n values: data\n };\n });\n}", "title": "" }, { "docid": "5407e12cb5646a3094a7624dc93551ae", "score": "0.461233", "text": "function inputX(stream) {\n return {\n ...stream,\n x: 2,\n }\n}", "title": "" }, { "docid": "dc8a6cc5fad4f9729fce527de096d34f", "score": "0.46011195", "text": "function mapIds(id) {\n return { '3': '0',\n '1': '1',\n '2': '2',\n '4': '3' }[id]\n }", "title": "" }, { "docid": "1f44b8af379f3b93e8870326ea5cb2b2", "score": "0.4599469", "text": "constructor(feeds) {\n this.id2Value = {};\n this.id2Mask = {};\n this.name2Id = {};\n\n if (feeds instanceof executor_FeedDict) {\n for (const id in feeds.id2Value) {\n this.id2Value[id] = feeds.id2Value[id];\n\n if (id in feeds.id2Mask) {\n this.id2Mask[id] = feeds.id2Mask[id];\n }\n }\n } else {\n if (feeds == null) {\n return;\n }\n\n for (const feed of feeds) {\n this.add(feed.key, feed.value);\n }\n }\n }", "title": "" }, { "docid": "77bae3ee5538f2630c14f994066ddba3", "score": "0.4584826", "text": "async function search(term) {\n\n const twitchClient = TwitchClient.withCredentials(clientId, accessToken)\n const streams = await twitchClient.kraken.search.searchStreams(term)\n\n const tags=[]\n // const broadcasts_id=streams.map(bId=>bId._data.channel._id)\n // console.log('first broad cast id',broadcasts_id[0])\n\n // streams.map( stream=>{ stream._data['tag']=['h1','h2']})\n // console.log(streams[0]._data.tag)\n\n await Promise.all( streams.map(\n async stream=> {\n const tags=await tag(stream._data.channel._id);\n\n//Predefined Language Tags\n if (tags.includes('English')) {\n stream._data['lang']=tagsJson['English']\n const index = tags.indexOf('English');\n tags.splice(index, 1);\n }\n// No check further if English Most common tag found\n else {\n let langFilter= tags.filter(value => lang.includes(value))\n if (langFilter.length<1){\n stream._data['lang']=tagsJson[langFilter[0]]\n const index = tags.indexOf(langFilter[0]);\n tags.splice(index, 1);\n }\n else {\n // English Automatic Tag\n stream._data['lang']=tagsJson['English']\n }\n }\n//Predefined Genre Tags else empty\n stream._data['genre']=[]\n if (tags.length>-1){\n let array1=tags.filter(value => genre.includes(value))\n // console.log(array1)\n let array2=array1.map(array=>tagsJson[array])\n // console.log(array2)\n stream._data['genre']=array2\n\n }\n\n // console.log(stream);\n }))\n\nreturn streams\n}", "title": "" }, { "docid": "da3fb4022e2d3001050947975d18ca02", "score": "0.4565823", "text": "_processBibStream (stream, options) {\n if (!options) options = {}\n var totalProcessed = 0\n\n return new Promise((resolve, reject) => {\n stream\n .map((b) => {\n log.debug('Processing bib: ', JSON.stringify(b, null, 2))\n return b\n })\n .map((bib) => this.extractStatements(bib).then((statements) => ({ statements, bib })))\n .flatMap((r) => H(r))\n .map((stmts) => {\n log.debug(`Got ${stmts.statements ? stmts.statements.length : 'null'} statements for ${stmts.bib.id}`)\n return stmts\n })\n .reduce([], (memo, batch) => memo.concat(batch.statements)) // Flatten array\n .map((statements) => db.upsertStatements('resource', statements).then(() => statements).catch((e) => {\n throw new Error('Error updating database; assume connection error')\n }))\n .flatMap((r) => H(r))\n .map((statements) => db.deleteStaleStatements('resource', statements, 'bib').then(() => statements)) // Delete extra (previously serialized) statements\n .flatMap((r) => H(r))\n .map((statements) => {\n log.debug('Statements: ', statements)\n // Report on success\n // Get distinct subject_ids:\n const num = utils.distinctSubjectIds(statements).length\n\n if (options.onUpdate) options.onUpdate(num)\n totalProcessed += num\n log.info(`BibsUpdater#update: Saved batch of ${num} (${statements.length} statements): (${totalProcessed} total processed, index ${totalProcessed + options.offset})`)\n return statements\n })\n .map((batch) => this._writeToIndexDocumentQueue(batch)) // Write to IndexDocumentQueue stream\n .flatMap((r) => H(r))\n .stopOnError((e) => reject(this.handleError(e, '...')))\n .done(function (err) {\n if (err) log.error(err)\n log.info(`BibsUpdater#update: Done updating ${totalProcessed} resources (from ${options.offset || 0}, limit ${options.limit || '[unbounded]'})`)\n if (options.onDone) options.onDone()\n\n db.disconnect()\n\n resolve(totalProcessed)\n })\n })\n }", "title": "" }, { "docid": "1c751b750e78a3c1ac0bf688247e258c", "score": "0.45521495", "text": "static getAccountStreamIds(): Array<string> {\n if ( SystemStreamsSerializer.accountStreamIds != null ) return SystemStreamsSerializer.accountStreamIds;\n \n SystemStreamsSerializer.accountStreamIds = Object.keys(SystemStreamsSerializer.getAccountMap());\n return SystemStreamsSerializer.accountStreamIds;\n }", "title": "" }, { "docid": "eaf6d460fe0f9ba364332b78c83535df", "score": "0.45488614", "text": "function filterMetadata(sampleValue) {\n // console.log(sampleValue);\n \n for (var i = 0; i <metadata.length; i++){\n // console.log(sampleValue);\n // console.log(metadata[i].id);\n if (sampleValue == metadata[i].id) {\n // console.log(sampleValue);\n // console.log(metadata[i].id);\n return metadata[i];\n }\n }\n }", "title": "" }, { "docid": "0dd56d3585924362a40ef9abad58d3c9", "score": "0.45479017", "text": "function process_stream(stream) {\n readline.createInterface({\n input: stream,\n output: process.stdout,\n terminal: false\n }).on('line', function(line) {\n var obj = JSON.parse(line);\n\n var key = [];\n\n for (var i=0; i<key_exprs.length; i++) {\n key.push(JSON.stringify(jsonpath.eval(obj, key_exprs[i])));\n }\n\n key = key.join(argv.d);\n\n sort.stdin.write(key + argv.d + line + '\\n');\n }).on('close', function() {\n process_streams();\n });\n}", "title": "" }, { "docid": "b52cbe59a1778bce50bb64c77f4877a0", "score": "0.45471004", "text": "map(id, source) {\n console.log(\"map =>\", id, source)\n }", "title": "" }, { "docid": "fcfa80183d9328f6d0d4d85a6688abe7", "score": "0.45465437", "text": "function find(id_processor) {\n\tvar numObjectsRead = 0;\n\tvar lo = 0, high = readChunkSize;\n\twhile ( numObjectsRead < maxNumObjects ) {\n\t\tvar ids = readObjectIds(lo, hi);\n\t\tconsole.dir(ids);\n\t\tlo = hi + 1;\n\t\thi = hi + readChunkSize;\n\t\tnumObjectsRead = numObjectsRead + ids.length;\n\t\tconsole.log('numObjectsRead='+numObjectsRead+' ids.length='+ids.length);\n\t\tif ( ids.length > 0 ) {\n\t\t\tid_processor( ids );\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e35cdb2fc11e7ee1ca95b1162e71cfe8", "score": "0.4534251", "text": "function matchdata(id) {\n for (let i = 0; i < dataArray.length; i++) {\n if(id == dataArray[i].id){\n return dataArray[i]\n }\n }\n}", "title": "" }, { "docid": "25b4ad1abc4daddce6e4238b9e74c132", "score": "0.4533677", "text": "function streaming(src) {\n\t var view = this,\n\t ds = this._model.data(src);\n\t if (!ds) return log.error('Data source \"'+src+'\" is not defined.');\n\t\n\t var listener = ds.pipeline()[0],\n\t streamer = this._streamer,\n\t api = {};\n\t\n\t // If we have it stashed, don't create a new closure.\n\t if (this._api[src]) return this._api[src];\n\t\n\t api.insert = function(vals) {\n\t ds.insert(dl.duplicate(vals)); // Don't pollute the environment\n\t streamer.addListener(listener);\n\t view._changeset.data[src] = 1;\n\t return api;\n\t };\n\t\n\t api.update = function() {\n\t streamer.addListener(listener);\n\t view._changeset.data[src] = 1;\n\t return (ds.update.apply(ds, arguments), api);\n\t };\n\t\n\t api.remove = function() {\n\t streamer.addListener(listener);\n\t view._changeset.data[src] = 1;\n\t return (ds.remove.apply(ds, arguments), api);\n\t };\n\t\n\t api.values = function() { return ds.values(); };\n\t\n\t return (this._api[src] = api);\n\t}", "title": "" }, { "docid": "a83d72eba5c2d7441359b051edb995f3", "score": "0.45194545", "text": "function checkStream(stream_id, callback){\n var query = {\n \"type\": \"select\",\n \"args\": {\n \"table\" : \"stream\",\n \"columns\": [\"name\"],\n \"where\": {\"id\": stream_id}\n }\n }\n var options = {\n method: \"POST\",\n url: domain + '/v1/query',\n json: true,\n headers: {\n \"Authorization\": \"Bearer \" + admin.getToken()\n },\n body: query\n }\n request(options, function(error, response, body){\n if(error){\n console.log(error);\n callback(false);\n }else if(body.length!=1){\n console.log(body);\n callback(false);\n }else{\n callback(true);\n }\n });\n}", "title": "" }, { "docid": "c3fce21b4aa0cb60ecfb0df3fc6ef789", "score": "0.4512827", "text": "match(subject, predicate, object, graph) {\n var stream = new _stream.Readable({\n objectMode: true\n }); // Initialize stream once it is being read\n\n stream._read = () => {\n for (var quad of this.getQuads(subject, predicate, object, graph))\n stream.push(quad);\n\n stream.push(null);\n };\n\n return stream;\n }", "title": "" }, { "docid": "227456a9ce7df9927aaf6a439ddad8b0", "score": "0.4506502", "text": "static getSource(id){\n return this.sources.find( ({ SOURCE }) => SOURCE === id );\n }", "title": "" }, { "docid": "e8bacbf99fffb9f25eed594a2f8b11da", "score": "0.4495288", "text": "function get_idmap_id(sourceObject)\n{\n//debug logP4Msg(\"get_idmap_id\", \"SAMIF\", sourceObject.samObjectFullName );\n//\tlogStatus(\"sourceObject.alt_idmap\", sourceObject.alt_idmap);\n\n// Invariant length check\n\n//debug if (sourceObject.invariant != undefined) {\n//debug\tlogP4Msg(\"get_idmap_id\", \"SAMIF\", \"invariant length is \" + sourceObject.invariant.length + \" for \" + sourceObject.invariant);\n//debug\t}\n\n\n\tif (sourceObject.alt_idmap != undefined) {\n//debug\t\tlogP4Msg(\"get_idmap_id\", \"SAMIF\", \"Using alternate idmap function\");\n \t\tPV.adaptor.modelInterface.addIdMap(sourceObject.alt_idmap.value.toString().concat(\",\").concat(sourceObject.id.toString()).concat(\",\").concat(sourceObject.element.collectorNumber.toString()));\n// \t\tPV.adaptor.modelInterface.addIdMap(sourceObject.alt_idmap.toString().concat(\",\").concat(sourceObject.id.toString()).concat(\",\").concat(sourceObject.element.collectorNumber.toString()));\n\t\t} else {\n\t\tif (sourceObject.samObjectFullName != undefined) {\n//debug\t\tlogP4Msg(\"get_idmap_id\", \"SAMIF\", \"Using regular idmap function\");\n \t\tPV.adaptor.modelInterface.addIdMap(sourceObject.samObjectFullName.value.toString().concat(\",\").concat(sourceObject.id.toString()).concat(\",\").concat(sourceObject.element.collectorNumber.toString()));\n\t\t}\n\t\t else\n\t\t \tlogP0Msg(\"get_idmap_id\", \"SAMIF\", \"objectFullName undefined\");\n\t}\n}", "title": "" }, { "docid": "2cd7b61f2090e13ba9722adf7dbf47bf", "score": "0.44870314", "text": "function extractTracks(peerConnectionLog) {\n const tracks = new Map();\n for (let i = 0; i < peerConnectionLog.length; i++) {\n const {type, value} = peerConnectionLog[i];\n if (type === 'addStream') {\n const {streamId, tracks: listOfTracks} = extractFromStreamFormat(value);\n listOfTracks.forEach(({kind, trackId}) => {\n tracks.set(trackId, {kind, streamId, direction: 'send', stats: []});\n });\n } else if (type === 'addTrack' || type === 'ontrack') {\n const direction = type === 'addTrack' ? 'send' : 'recv';\n const {kind, trackId, streamId} = extractFromTrackFormat(value);\n tracks.set(trackId, {kind, streamId, direction, stats: []});\n } else if (type === 'getStats') {\n Object.keys(value).forEach(id => {\n const report = value[id];\n if (report.type === 'ssrc') {\n const {trackIdentifier} = report;\n if (tracks.has(trackIdentifier)) {\n report.timestamp = peerConnectionLog[i].time;\n tracks.get(trackIdentifier).stats.push(report);\n } else if (trackIdentifier !== undefined) {\n console.log('NO ONTRACK FOR', trackIdentifier, report.ssrc);\n }\n }\n });\n }\n }\n return tracks;\n}", "title": "" }, { "docid": "2b81d7bec90cde09f70e2ce11137e352", "score": "0.44862574", "text": "function getTagValue(datastream_objects,fval1,fval2) {\n var tag_objects;\n var tagval = '';\n var tagkey ='';\n var tagValueStrg = '';\n var fval1_flag = fval1 ? 1:0;\n var fval2_flag = fval2 ? 1:0;\n \n for (var l=0; l < datastream_objects['tags'].length; l++) { \n tag_objects = datastream_objects['tags'][l];\n tagkey = tag_objects['tagkey'];\n tagval = tag_objects['tagvalue'];\n /*\n For Sclass and DC, if the value is specified in the tagvalue, then the value will get higher precendence.\n */\n if (tagkey == tsdb_filter['FILTER1']) {\n fval1_flag = 0;\n tagval = tag_objects['tagvalue'] || fval1 ;\n }\n\n if (tagkey == tsdb_filter['FILTER2']) {\n fval2_flag = 0;\n tagval = tag_objects['tagvalue'] || fval2 ;\n }\n\n if (tagval != '') { // not writing if tagval is empty\n if (tagValueStrg == '') {\n tagValueStrg = tagkey+'='+tagval;\n } else {\n tagValueStrg = tagValueStrg + ',' + tagkey+'='+tagval;\n }\n }\n }\n if (fval1_flag==1) {\n if (tagValueStrg == '') {\n tagValueStrg = tsdb_filter['FILTER1']+'='+fval1;\n } else {\n tagValueStrg = tagValueStrg + ','+tsdb_filter['FILTER1']+'='+fval1;\n }\n }\n if (fval2_flag==1) {\n if (tagValueStrg == '') {\n tagValueStrg = tsdb_filter['FILTER2']+'='+fval2;\n } else {\n tagValueStrg = tagValueStrg + ','+tsdb_filter['FILTER2']+'='+fval2;\n }\n }\n return tagValueStrg;\n}", "title": "" }, { "docid": "219e1fd579fc40e83757bfdda0697129", "score": "0.44683018", "text": "function stream_index(d, i) {\n return {x: i, y: d.price};\n }", "title": "" }, { "docid": "b93cd6059019c851f29915bbc80e2adb", "score": "0.44653207", "text": "function streaming(src) {\n var view = this,\n ds = this._model.data(src);\n if (!ds) return log.error('Data source \"' + src + '\" is not defined.');\n\n var listener = ds.pipeline()[0],\n streamer = this._streamer,\n api = {};\n\n // If we have it stashed, don't create a new closure.\n if (this._api[src]) return this._api[src];\n\n api.insert = function (vals) {\n ds.insert(dl.duplicate(vals)); // Don't pollute the environment\n streamer.addListener(listener);\n view._changeset.data[src] = 1;\n return api;\n };\n\n api.update = function () {\n streamer.addListener(listener);\n view._changeset.data[src] = 1;\n return ds.update.apply(ds, arguments), api;\n };\n\n api.remove = function () {\n streamer.addListener(listener);\n view._changeset.data[src] = 1;\n return ds.remove.apply(ds, arguments), api;\n };\n\n api.values = function () {\n return ds.values();\n };\n\n return this._api[src] = api;\n}", "title": "" }, { "docid": "125cfa84f42bf5972c31103d9fdce76f", "score": "0.44648027", "text": "find(aggregateId, fromSeq = 1){\n debug('find()', aggregateId, fromSeq);\n let events = (this._journal[aggregateId] || []).filter((e) => {\n return e.seq >= fromSeq;\n });\n return streamify(events);\n }", "title": "" }, { "docid": "5941b5e4228713cb002f0868f5ea9ea9", "score": "0.4459088", "text": "mapExternalIds(id) {\n const params = new Array();\n if (id != null) {\n params.push(`id=${id}`);\n }\n return this.rest.get(`${this.baseUrl}/map-external-ids`, ...params);\n }", "title": "" }, { "docid": "5941b5e4228713cb002f0868f5ea9ea9", "score": "0.4459088", "text": "mapExternalIds(id) {\n const params = new Array();\n if (id != null) {\n params.push(`id=${id}`);\n }\n return this.rest.get(`${this.baseUrl}/map-external-ids`, ...params);\n }", "title": "" }, { "docid": "5941b5e4228713cb002f0868f5ea9ea9", "score": "0.4459088", "text": "mapExternalIds(id) {\n const params = new Array();\n if (id != null) {\n params.push(`id=${id}`);\n }\n return this.rest.get(`${this.baseUrl}/map-external-ids`, ...params);\n }", "title": "" }, { "docid": "644b518d9ccf939c56969e89ddacd37f", "score": "0.44550738", "text": "track(_, { id }, { dataSources }) {\n return dataSources.trackAPI.getTrack(id)\n }", "title": "" }, { "docid": "7f5b68f350843b3fd8e26189124a8b9c", "score": "0.44549814", "text": "set(key, value) {\n // Normalize stream data.\n let item = this._createItem({ value });\n this._map.set(key, item);\n }", "title": "" }, { "docid": "56503417b01e48fd496f23ab6cb31a0b", "score": "0.44549334", "text": "streamContainers(pubSub, type, data, stream) {\n return {\n publisher: {\n camera: \"#cameraPublisherContainer\",\n screen: \"#screenPublisherContainer\"\n },\n subscriber: {\n camera: \"#cameraSubscriberContainer\",\n screen: \"#screenSubscriberContainer\"\n }\n }[pubSub][type];\n }", "title": "" }, { "docid": "21bb2976ef8d75d71d72d58344544802", "score": "0.44542983", "text": "function streamName(stream) {\n return stream === stream1 ? 'stream1'\n : stream === stream2 ? 'stream2'\n : 'unknown stream';\n }", "title": "" }, { "docid": "0edfa22da9b0a1877d2c8c4676cb757d", "score": "0.44485933", "text": "function generateData() {\n return stream_layers(3,50+Math.random()*50,.1).map(function(data, i) {\n return {\n key: 'Stream' + i,\n values: data\n };\n });\n }", "title": "" }, { "docid": "32f2bbb40466ed89f0a71e6b3ab6f0e3", "score": "0.44451982", "text": "_stream(connection, obj, stream, options) {\n options = options || {};\n const queryOptions = Object.assign({ sql: obj.sql }, obj.options);\n return new Promise((resolver, rejecter) => {\n stream.on('error', rejecter);\n stream.on('end', resolver);\n const queryStream = connection\n .query(queryOptions, obj.bindings)\n .stream(options);\n\n queryStream.on('error', (err) => {\n rejecter(err);\n stream.emit('error', err);\n });\n\n queryStream.pipe(stream);\n });\n }", "title": "" }, { "docid": "79e621343ce1e862f06789feb1bb973c", "score": "0.44406608", "text": "mapTo (newList) {\n var cur = newList.head;\n var results = { };\n\n this.each ((data,node)=>{\n if (!cur){\n results = null;\n return false;\n }\n\n results [node.id] = cur.id;\n cur = cur.next;\n });\n\n return results;\n }", "title": "" }, { "docid": "70114a5fb71d03b9c9c3dc87f52f13ca", "score": "0.44376016", "text": "function getCurrentValue(stream, key) {\n\tif(stream._currentEvent && stream._currentEvent.type === key) {\n\t\treturn stream._currentEvent.value;\n\t} else {\n\t\tvar names = keyNames[key];\n\t\tif(!names) {\n\t\t\treturn stream[key];\n\t\t}\n\t\tvar VALUE,\n\t\t\tvalueHandler = function(value){\n\t\t\t\tVALUE = value;\n\t\t\t};\n\t\tstream[names.on](valueHandler);\n\t\tstream[names.off](valueHandler);\n\t\treturn VALUE;\n\t}\n}", "title": "" }, { "docid": "3bfe6f1154e41552c8180d375f2715fd", "score": "0.44371408", "text": "function getPhotoStreamById(id) {\n const db = getDbReference();\n const bucket = new GridFSBucket(db, { bucketName: \"photos\" });\n if (!ObjectId.isValid(id)) {\n return null;\n } else {\n return bucket.openDownloadStream(new ObjectId(id));\n }\n}", "title": "" }, { "docid": "73299da5b0bfad95aaccaa19ccf98422", "score": "0.44344142", "text": "function getByValue2(arr, value) {\n var result = arr.filter(function(o){return o.id == value;} );\n return result? result[0] : null; // or undefined\n }", "title": "" }, { "docid": "f22589af1675db513fd24b7912a525b7", "score": "0.44253775", "text": "function getById(id) {\n for (let i = 0; i < allEvents.length; i += 1) {\n if (id === allEvents[i].id) {\n return allEvents[i];\n }\n }\n return null;\n}", "title": "" }, { "docid": "83df3c0b2d6a13370e44cfe9f04ff923", "score": "0.44202417", "text": "zt(t) {\n return Ei(t).get(this.userId).next((t => t || new _s(this.userId, -1, \n /*lastStreamToken=*/ \"\")));\n }", "title": "" }, { "docid": "e71dbb5218c69d7271ba3a0e117d2726", "score": "0.44188842", "text": "function findStream(streamURL) {\n\t\tvar stream = streamsInfo.filter(function search(item) {\n\t\t\treturn item.Stream_URL === streamURL;\n\t\t});\n\n\t\tif (stream.length !== 1) {\n\t\t\tlogToWindow(\"Can't locate the stream !!!!\");\n\t\t\treturn null;\n\t\t}\n\t\treturn stream[0];\n\t}", "title": "" }, { "docid": "c8df06ddc359a5a5b53e85da5559bd0e", "score": "0.44157162", "text": "function index_streams(activities) {\n return Promise.all(activities.map(index_stream));\n }", "title": "" }, { "docid": "f9e7352ab62ddb7d4bec4d1a371b19eb", "score": "0.44119588", "text": "function lookup(arr, elem) {\n for (var i in arr) {\n if (arr[i].key == elem.id) {\n return arr[i].id;\n }\n }\n }", "title": "" }, { "docid": "f43ea40bffa0bab1f0f721dd78ddfaba", "score": "0.44093835", "text": "function mapStream (stream,streammin,streammax) {\n\treturn map(stream,streammin,streammax,-1,1);\n}", "title": "" }, { "docid": "f8abd9609e6490453a954158d25cfadb", "score": "0.4409143", "text": "function generateData() {\n return stream_layers(3,10+Math.random()*200,.1).map(function(data, i) {\n return {\n key: 'Stream' + i,\n values: data\n };\n });\n }", "title": "" }, { "docid": "1d7decb631edc6419cbb72a069944801", "score": "0.44052547", "text": "function generateData() {\n return stream_layers(3,50+Math.random()*50,.1).map(function(data, i) {\n return {\n key: 'Stream' + i,\n values: data\n };\n });\n }", "title": "" }, { "docid": "769a35eacb19fcb60a571267d6296a1a", "score": "0.4403033", "text": "map(fn, stream) {\n return sink => stream(payload => sink(fn(payload)))\n }", "title": "" }, { "docid": "ed6081245dd20df46ddc4e30b3675516", "score": "0.43997195", "text": "function getNextId(filter, id) {\n return getId(filter, id, true);\n }", "title": "" }, { "docid": "7da57716a6df8db7e1327bfbdf14ee34", "score": "0.4398312", "text": "function Sf(t){if(t instanceof no[\"default\"])return t.id;if(t instanceof xf)return t.get(\"id\");throw new Error(\"Illegal map argument\")}", "title": "" }, { "docid": "fdef703ea9cb6d1140c5e03d04bb1dfb", "score": "0.43965903", "text": "function getSteamID32(id, callback)\r\n{\r\n parser.on('error', function(err) { console.log('Parser error', err); });\r\n //HTTP request to Steam to get profile information\r\n var profileType\r\n if (!isNaN(id)) {\r\n };\r\n http.get('http://steamcommunity.com/id/' + id + '?xml=1', function(res)\r\n {\r\n //if code is successful\r\n if (res.statusCode >= 200 && res.statusCode < 400)\r\n {\r\n var data = '';\r\n //convert data to string\r\n res.on('data', function(data_) { data += data_.toString(); });\r\n //when the request ends\r\n res.on('end', function()\r\n {\r\n //run XML through parser to convert to JSON\r\n parser.parseString(data, function(err, result)\r\n {\r\n //Initialise steam ID convertor to change from 64 to 32 bit ID\r\n var convertor = require('steam-id-convertor');\r\n var steamID64 = '';\r\n var steamID32 = '';\r\n //convert the ID\r\n steamID64 = result.profile.steamID64.toString();\r\n steamID32 = convertor.to32(steamID64);\r\n //log IDs to console for debug purposes\r\n console.log('Steam64 ID: ', steamID64);\r\n console.log('Steam32 ID: ', steamID32);\r\n //return the ID\r\n callback(steamID32);\r\n });\r\n });\r\n };\r\n });\r\n}", "title": "" }, { "docid": "7e2cb1cdaee0d96a03e0ce210e545f0f", "score": "0.43872094", "text": "function findBook(id) {\n const genObj2 = iterateBookClubs(bookClubs)\n let result = genObj2.next()\n\n while (!result.done) { //while result isnt done(not at the end)\n if (result.value.id === id) { //check the id to see if it matches the id paramter we describe\n return result.value //return the value if id is matched\n } else {\n result = genObj2.next() //otherwise keep going next\n }\n }\n}", "title": "" }, { "docid": "3c770a55c146dbb09d4cf2530c008436", "score": "0.43833992", "text": "function getInfo(id) {\n const U32 = new Uint32Array(memory.buffer);\n const count = U32[rttiBase >>> 2];\n if ((id >>>= 0) >= count) throw Error(\"invalid id: \" + id);\n return U32[(rttiBase + 4 >>> 2) + id * 2];\n }", "title": "" }, { "docid": "8580ac8ca0a8ea5da66338c3ba543eef", "score": "0.43812215", "text": "function getStreamData() {\n\n // pipe in analysing to getUserMedia\n navigator.mediaDevices.getUserMedia({ audio: true, video: false })\n .then(stream => audioCtx.createMediaStreamSource(stream))\n .then(source => {\n source.connect(analyserNode);\n console.log('got stream');\n });\n}", "title": "" }, { "docid": "a32252252fe4792d03b7e7049d8025ef", "score": "0.4379041", "text": "function indexStreamFn (index, getkey) {\n return function (opts) {\n var lastAccessed = index.lastAccessed\n index.touch()\n\n // emulate the `ssb.createFeedStream` interface\n var lt = o(opts, 'lt')\n var lte = o(opts, 'lte')\n var gt = o(opts, 'gt')\n var gte = o(opts, 'gte')\n var limit = o(opts, 'limit')\n var threads = o(opts, 'threads')\n\n // lt, lte, gt, gte should look like:\n // [msg.value.timestamp, msg.value.author]\n\n // helper to create emittable rows\n function lookup (row) {\n if (!row) return\n var key = (getkey) ? getkey(row) : row.key\n if (key) {\n var rowcopy = { key: key }\n for (var k in row) { // copy index attrs into rowcopy\n if (!rowcopy[k]) rowcopy[k] = row[k]\n }\n return rowcopy\n }\n }\n\n // helper to fetch rows\n function fetch (row, cb) {\n if (threads) {\n threadlib.getPostSummary(sbot, row.key, function (err, thread) {\n for (var k in thread)\n row[k] = thread[k]\n cb(null, row)\n })\n } else {\n sbot.get(row.key, function (err, value) {\n // if (err) {\n // suppress this error\n // the message isnt in the local cache (yet)\n // but it got into the index, likely due to a link\n // instead of an error, we'll put a null there to indicate the gap\n // }\n row.value = value\n cb(null, row)\n })\n }\n }\n\n // readstream\n var readPush = pushable()\n var read = pull(readPush, paramap(fetch))\n\n // await sync, then emit the reads\n awaitSync(function () {\n var added = 0\n for (var i=0; i < index.rows.length; i++) {\n var row = index.rows[i]\n\n if (limit && added >= limit)\n break\n\n // we're going to only look at timestamp, because that's all that phoenix cares about\n var invalid = !!(\n (lt && row.ts >= lt[0]) ||\n (lte && row.ts > lte[0]) ||\n (gt && row.ts <= gt[0]) ||\n (gte && row.ts < gte[0])\n )\n if (invalid)\n continue\n\n var r = lookup(row)\n if (r) {\n r.isNew = r.ts > lastAccessed\n readPush.push(r)\n added++\n }\n }\n readPush.end()\n })\n\n if (opts && opts.live) {\n // live stream, concat the live-emitter on the end\n index.on('add', onadd)\n var livePush = pushable(function () { index.removeListener('add', onadd) })\n function onadd (row) { livePush.push(lookup(row)) }\n var live = pull(livePush, paramap(fetch))\n return cat([read, live])\n }\n return read\n }\n }", "title": "" }, { "docid": "e732da0035e6e982e023b8ba255637bc", "score": "0.43686548", "text": "_stream(connection, obj, stream) {\n if (!obj || typeof obj === 'string') obj = { sql: obj };\n return new Promise((resolver, rejecter) => {\n stream.on('error', (err) => {\n rejecter(err);\n });\n stream.on('end', resolver);\n const { sql } = obj;\n if (!sql) return resolver();\n const req = (connection.tx_ || connection).request();\n //req.verbose = true;\n req.multiple = true;\n req.stream = true;\n if (obj.bindings) {\n for (let i = 0; i < obj.bindings.length; i++) {\n this._setReqInput(req, i, obj.bindings[i]);\n }\n }\n req.pipe(stream);\n req.query(sql);\n });\n }", "title": "" }, { "docid": "6d5c7ca8a0887d27426eeeb78a43e541", "score": "0.4365964", "text": "function openStream(id, url) {\n ipcRenderer.send('service-change', {\n id: id,\n url: url\n })\n}", "title": "" }, { "docid": "6fc28933fcd2f19594b147ae0d255490", "score": "0.43639278", "text": "function multiread(stream, get) {\n if (stream._multiread === undefined) {\n stream._multiread = stream._multiread || [];\n stream._multireading = stream._multireading || 0;\n stream._multireadmax = stream._multireadmax || concurrency;\n }\n if (stream._multiread.length) {\n push();\n } else {\n stream.once('_push', push);\n }\n while ((stream._multiread.length + stream._multireading) < stream._multireadmax) {\n stream._multireading++;\n if (!get(done)) break;\n }\n\n function done(item) {\n stream._multireading--;\n if (item === null && !stream._multireading) {\n stream.emit('_push');\n } else if (item) {\n stream._multiread.push(item);\n stream.emit('_push');\n }\n }\n\n function push() {\n if (stream._multiread.length) {\n stream.push(stream._multiread.shift());\n } else {\n stream.push(null);\n }\n }\n}", "title": "" }, { "docid": "19ac8623e145ed7c132ca6cef0290b13", "score": "0.43575704", "text": "function getStreamData(lat, lng) {\n var url = \"https://ofmpub.epa.gov/waters10/PointIndexing.Service\";\n var latitude = lat.toString();\n var longitude = lng.toString();\n $('#latVal').html(Number(latitude).toFixed(6));\n $('#lngVal').html(Number(longitude).toFixed(6));\n\n var ptIndexParams = {\n 'pGeometry': 'POINT(' + longitude + ' ' + latitude + ')'\n , 'pGeometryMod': 'WKT,SRSNAME=urn:ogc:def:crs:OGC::CRS84'\n , 'pPointIndexingMethod': 'DISTANCE'\n , 'pPointIndexingMaxDist': 25\n , 'pOutputPathFlag': 'TRUE'\n , 'pReturnFlowlineGeomFlag': 'TRUE'\n , 'optOutCS': 'SRSNAME=urn:ogc:def:crs:OGC::CRS84'\n , 'optOutPrettyPrint': 0\n };\n\n $.ajax({\n type: \"GET\",\n url: url,\n jsonp: true,\n data: ptIndexParams,\n success: function (data, status, jqXHR) {\n if (typeof data === 'object' && data !== null) {\n console.log(\"streamData is an object\")\n var streamData = data;\n } else {\n console.log(\"streamData getting parsed as JSON\")\n var streamData = JSON.parse(data);\n }\n var selectedComid = streamData.output.ary_flowlines[0].comid;\n var wantedData = outputData.intakes.COMID[selectedComid]\n $('#boxid').html(selectedComid);\n addStreamSeg(streamData, selectedComid);\n if (wantedData.length == 0) {\n $('#pestTable').hide();\n $('#saveTable').hide();\n DEBUG && console.log(\"Selected stream was not included in SAM run\");\n return false;\n }\n setTimeout(populateFilteredTable(wantedData), 300);\n return false;\n },\n error: function (jqXHR, status) {\n $('#boxid').html(\"Error attempting to get river data.\");\n return false;\n }\n });\n}", "title": "" }, { "docid": "908fcc74af784c9683b494509d01b714", "score": "0.43517235", "text": "function transformHashArrayData(stream, item) {\n var vals = [], row = [], i = -1, headersLength = stream.headersLength;\n if (stream.totalCount++) {\n row.push(stream.rowDelimiter);\n }\n while (++i < headersLength) {\n vals[i] = item[i][1];\n }\n row.push(stream.formatter(vals));\n return row.join(\"\");\n}", "title": "" }, { "docid": "908fcc74af784c9683b494509d01b714", "score": "0.43517235", "text": "function transformHashArrayData(stream, item) {\n var vals = [], row = [], i = -1, headersLength = stream.headersLength;\n if (stream.totalCount++) {\n row.push(stream.rowDelimiter);\n }\n while (++i < headersLength) {\n vals[i] = item[i][1];\n }\n row.push(stream.formatter(vals));\n return row.join(\"\");\n}", "title": "" }, { "docid": "283f9fd06750d0589f6e11e462753dcf", "score": "0.43479624", "text": "static getEntryFromId(type, id) {\r\n console.log(type)\r\n switch(type) {\r\n case \"user\":\r\n return users.filter((user) => user.id === id)[0];\r\n\r\n case \"chapter\":\r\n return chapters.filter((chapter) => chapter.id === id)[0];\r\n\r\n case \"course\":\r\n return courses.filter((course) => course.id === id)[0];\r\n\r\n default:\r\n return null;\r\n }\r\n }", "title": "" }, { "docid": "07ef0e7907e89bf9dd1e7092ba209814", "score": "0.43403792", "text": "function urlsForUser(id) {\r\n let filteredData = {};\r\n for (let shortURL in urlDatabase) {\r\n if (id === urlDatabase[shortURL].userID) {\r\n filteredData[shortURL] = {\r\n 'userID': id,\r\n 'longURL': urlDatabase[shortURL].longURL,\r\n };\r\n }\r\n }\r\n return filteredData;\r\n}", "title": "" } ]
00c68013629eb189c6d920608b827374
Returns Content 3rd Party Details
[ { "docid": "9a17774b8c3b5d8c1027ac2a5107ed1d", "score": "0.74442935", "text": "function IQ_GetContent3rdPartyDetails(contentid, JSONCallback){\n\n}", "title": "" } ]
[ { "docid": "db3327656c32bf1e176200a26e7929ce", "score": "0.60870594", "text": "getThirdPartyInfo() {\n var _this = this;\n let customAccounts = \"SmartCampus__SystemManagement/1.0.0/getCustomAccountTypeDefinition\";\n _this.callAPIConn(customAccounts, { start: 0, limit: 20 }, _this.callCustomListBack, null, \"PostAPIConnector\");\n }", "title": "" }, { "docid": "a64233e540f7a64d301dd6bc33d102e3", "score": "0.5938328", "text": "async getCREHeadlines() {\n const response = await fetch(`${newsAPIurl}/search?apiKey=${newsAPIKey}&domain=cnbc.com,wsj.com,bloomberg.com&country=us&keywords=commercial real estate`)\n const result = await response.json()\n return result\n }", "title": "" }, { "docid": "6cf58d6a46ec4e8a3967148511bcbf47", "score": "0.5893145", "text": "async details(){\n const { ctx } = this;\n const params = ctx.request.query;\n let data = await ctx.service.content.details(params);\n ctx.helper.success({data});\n }", "title": "" }, { "docid": "70c36d7e27f111e9be7c129ddffc3a27", "score": "0.5693469", "text": "getLegalInformation() {\n const query = {};\n\n return APIClient.execute(\n this._conf,\n \"get\",\n `/service/application/content/v1.0/legal`,\n query,\n {}\n );\n }", "title": "" }, { "docid": "27abc23a165ed8feec27e47dc530397d", "score": "0.5672543", "text": "function getQuote(){\r\n return fetch(RANDOM_QUOTE_URL)\r\n .then(res => res.json())\r\n .then(data => data.content)\r\n}", "title": "" }, { "docid": "546413863f8133bef41223bf1d2eb50d", "score": "0.56233114", "text": "function IQ_GetContentExtendedDetails(contentid, personid, JSONCallback){\n\n\tvar url = urlPrefix + \"nsDetailsHandler.ashx?cmd=fetchcontentdetails&contentid=\"+contentid+\"&personid=\"+personid;\\\n\n\t// make the query to the server\n\tIQ_AjaxCall(url, JSONCallback);\n}", "title": "" }, { "docid": "63fefc334f37c97fd7c2341986dd0ddb", "score": "0.55649334", "text": "getSanityDetails () {\n return this\n .getJson({\n q: 'sanity'\n })\n }", "title": "" }, { "docid": "a59f379eec7dc1e4877ae5e2414bed3c", "score": "0.55368716", "text": "function getData() {\n\n $.ajax({\n url: 'https://api.forismatic.com/api/1.0/',\n jsonp: 'jsonp',\n dataType: 'jsonp',\n data: {\n method: 'getQuote',\n lang: 'en',\n format: 'jsonp'\n },\n success: function (data) {\n console.log(data);\n var currentQuote = data.quoteText;\n var currentAuthor = data.quoteAuthor;\n $(\"#quotes\").html(currentQuote);\n $(\"#author\").html(currentAuthor);\n\n }\n });\n }", "title": "" }, { "docid": "6ab8bd1dedfc6e8a6cb864f6a6e79f47", "score": "0.5515936", "text": "function parsePexCopyrights(data, url)\n{\n let rA = [];\n rA['url'] = '';\n rA['id'] = '';\n rA['author'] = '';\n rA['title'] = '';\n\n const urlPattern = /^([^\\?]+)(\\?.*)?$/;\n if (url.search(urlPattern) != -1) {\n rA['url'] = url.match(urlPattern)[1];\n } else {\n rA['url'] = url;\n }\n\n const idPattern = /^https:\\/\\/www\\.pexels\\.com(\\/[a-z]{2}-[a-z]{2})?\\/[^\\/]+\\/(([^\\/]+)-)?([0-9]+)\\/.*$/;\n if (url.search(idPattern) != -1) {\n rA['id'] = url.match(idPattern)[4];\n }\n\n const authorPattern = /^.*<a( rel=\"[^\"]*\")? class=\"[^\"]*\" href=\"(\\/[a-z-]+)?\\/@([a-z0-9-]+)\\/\">[^<]*<h5 class=\"[^\"]*\">([^<]+)<\\/h5>[^<]*<\\/a>.*$/mi;\n if (data.search(authorPattern) != -1) {\n rA['author'] = data.match(authorPattern)[4].trim();\n }\n\n const titlePattern = /^.*\"name\":\"([^\"]+)\",.*$/mi;\n if (data.search(titlePattern) != -1) {\n rA['title'] = data.match(titlePattern)[1].trim();\n }\n\n return rA;\n}", "title": "" }, { "docid": "c6c5cadb42efeff5d98c3e37dfaaed59", "score": "0.5512072", "text": "function getProduct() {\r\n if (document.getElementById(\"dp\") == null) {\r\n return null;\r\n }\r\n var temp = document.getElementsByTagName('meta')[4].getAttribute('content');\r\n product = temp;\r\n return product\r\n}", "title": "" }, { "docid": "d9dc1e6923bf566305fa465dd85c4fca", "score": "0.55082214", "text": "getExternalData({ commit }) {\n Prismic.getApi(API_ENDPOINT, { accessToken: API_TOKEN })\n .then(function(api) {\n return api.query(Prismic.Predicates.at(\"document.type\", \"external\"));\n })\n .then(\n function(response) {\n // This is a single type so there is only one item in the array.\n const obj = response.results[0];\n\n const content = {\n // Brand is the logo.\n brand: {\n // Store the img alt and url and name.\n alt: obj.data.brand.alt || \"\",\n img: obj.data.brand.url\n },\n // Social Media contains the link/s to social media.\n socialMedia: obj.data.social_media.map(obj => ({\n link: obj.link.url,\n // This should be taken from https://www.s-ings.com/typicons/, without \"social-\". For example, to get a Facebook logo we need to use \"social-facebook\" as a name, so the name here should be \"Facebook\".\n name: obj.name\n }))\n };\n\n // Mutate the \"externalData\" state.\n commit(\"externalData\", content);\n // Show Footer\n commit(\"ready\", [\"appFooter\", true]);\n // Show Nav\n commit(\"ready\", [\"appNav\", true]);\n },\n function(error) {\n console.log(error); // eslint-disable-line no-console\n }\n );\n }", "title": "" }, { "docid": "1b8c343d1b9a495b32077592435f13d9", "score": "0.55063695", "text": "function info_box_get_contents() {\n return document.getElementById('info-contents');\n}", "title": "" }, { "docid": "7baee298a7bf5829407e7b4d0d8fb4b5", "score": "0.5505613", "text": "async fetchAdditional () {\n manifest = (await get('http://content.warframe.com/MobileExport/Manifest/ExportManifest.json')).Manifest\n wikiaData = await scrapeWikia()\n }", "title": "" }, { "docid": "1c370537c4919542e525f348b8b0fe79", "score": "0.55016744", "text": "function getProductData(pid, apiURL, options) {\n var url;\n url = apiURL + pid + \".json\" + EXCLUDE_CALL// real url\n // make the request to the NAP api for the content information\n $.ajax({\n url: url,\n dataType: 'json',\n success: function(data, textStatus, jqXHR) {\n if(options) {\n (options.onComplete || function(){} ).call(data, textStatus, jqXHR);\n }\n },\n error : function(jqXHR, textStatus, errorThrown) {\n if (options) {\n (options.onError || function(){} ).call(jqXHR, textStatus, errorThrown);\n }\n }\n });\n }", "title": "" }, { "docid": "f90b21c05d7fc3f1e3d9101c94e93f03", "score": "0.54646724", "text": "function getDetails() {\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n produse = JSON.parse(this.responseText);\n drawDetails();\n }\n };\n xhttp.open(\"GET\", `https://shop-lounge.firebaseio.com/${idx}.json`, true)\n xhttp.send();\n}", "title": "" }, { "docid": "12b44505f52d3ba6045ca9d01f3c905d", "score": "0.54561", "text": "function getDetails(url) {\n return new Promise((resolve, reject) => {\n $.getJSON(url, details => {\n resolve(details);\n }).fail(err => {\n reject(err);\n });\n });\n }", "title": "" }, { "docid": "299107165cb0568ca6d5b54dbb026c3e", "score": "0.5448774", "text": "function IQ_GetPerson3rdPartyDetails(username, JSONCallback){\n\n}", "title": "" }, { "docid": "48c8d7a196eb2b7da0bdfdfc519c0391", "score": "0.5433271", "text": "function getJournalDetails(obj) {\n var journal_id = obj.attr('data-id');\n $.ajax({\n url: ReturnLink('/ajax/ajax_journal_details.php'),\n data: {journal_id: journal_id},\n type: 'post',\n success: function (data) {\n var ret = null;\n try {\n ret = $.parseJSON(data);\n } catch (Ex) {\n return;\n }\n if (ret.error) {\n TTAlert({\n msg: ret.error,\n type: 'alert',\n btn1: t('ok'),\n btn2: '',\n btn2Callback: null\n });\n return;\n } else {\n var journal_name = ret.journal_name;\n var journal_desc = ret.journal_desc;\n var journal_desc_init = ret.journal_desc_init;\n var formatted_date = ret.formatted_date;\n var location_name = ret.location_name;\n var is_visible = ret.is_visible;\n var country = ret.country;\n var city = ret.city;\n var city_hidden_value = ret.city_hidden_value;\n var city_hidden_valueid = ret.city_hidden_valueid;\n var keywords = ret.keywords;\n var enable_share_comment = ret.enable_share_comment;\n var privacy_kind_type = ret.privacy_kind_type;\n var privacy_kind_icon = privacy_kind_type;\n try {\n var privacy_kind_type_arr = privacy_kind_type.split(\",\"); // An array of the options in case of \"custom\".\n if (privacy_kind_type_arr.length > 1)\n privacy_kind_icon = USER_PRIVACY_SELECTED;\n } catch (e) {\n var privacy_kind_type_arr = privacy_kind_type;\n }\n var privacy_users = ret.privacy_users;\n var privacy_users_arr = ret.custom_privacy_users;\n // If the privacy kind includes more than 1 class, make it 'custom'.\n //\t\t\tif(privacy_kind_type.indexOf(',') != -1)\n //\t\t\t\tprivacy_kind_type = 4;\n\n // Fill the description fields.\n $(\"#desc_timestamp\").html(t(\"uploaded \") + formatted_date);\n $(\"#desc_journal_name\").html(journal_name);\n $(\"#desc_journal_location\").html(location_name);\n $(\".description_journal\").html('<div class=\"scrollpane_description_journal\" style=\"max-height:405px; float: left; width:255px;\"><div class=\"albumdesc albumdesc_journal\">' + journal_desc + '</div></div>');\n\n var privacy_iconDiv = $(\".privacy_iconDiv\");\n privacy_iconDiv.removeClass('privacy_icon0');\n privacy_iconDiv.removeClass('privacy_icon1'); // Remove all classes.\n privacy_iconDiv.removeClass('privacy_icon2');\n privacy_iconDiv.removeClass('privacy_icon3');\n privacy_iconDiv.removeClass('privacy_icon4');\n privacy_iconDiv.removeClass('privacy_icon5');\n privacy_iconDiv.attr('data-title', ret.privacy_kind_str);\n privacy_iconDiv.addClass('privacy_icon' + privacy_kind_icon); // Add the specific privacy class.\n // End description fields.\n\n\n // Fill the edit fields.\n $(\"#edit_title\").attr(\"value\", '');\n $(\"#edit_description\").attr(\"value\", '');\n $(\"#edit_location\").attr(\"value\", '');\n\n $(\"#edit_title\").attr(\"value\", journal_name);\n $(\"#edit_description\").attr(\"value\", journal_desc_init);\n $(\"#edit_location\").attr(\"value\", location_name);\n $(\"#edit_country\").attr(\"value\", country);\n $(\"#edit_city_text\").attr(\"value\", city);\n $(\"#edit_city_text_cityname\").attr(\"value\", city_hidden_value);\n $(\"#edit_city_text_cityname\").attr(\"data-id\", city_hidden_valueid);\n $(\"#edit_keywords\").attr(\"value\", keywords);\n\n $(\"#edit_title\").blur();\n $(\"#edit_description\").blur();\n $(\"#edit_location\").blur();\n\n // The privacy details.\n // Reset the privacy boxes selection.\n $(\"#privacyclass_user0\").removeClass('active');\n $(\"#privacyclass_user1\").removeClass('active');\n $(\"#privacyclass_user2\").removeClass('active');\n $(\"#privacyclass_user3\").removeClass('active');\n $(\"#privacyclass_user4\").removeClass('active');\n $(\"#privacyclass_user5\").removeClass('active');\n\n\n // Reset the custom box choices.\n if (parseInt(is_owner) == 1) {\n $(\".emailcontainer\").html(add_more_box);\n addmoreusersautocomplete_custom_journal($('#addmoretext_custum_privacy_detailed'));\n $(\".uploadinfocheckbox4\").removeClass('active');\n $(\".uploadinfocheckbox_friends_of_friends\").removeClass('active');\n $(\".uploadinfocheckbox3\").removeClass('active');\n }\n\n // Custom privacy.\n if (parseInt(is_owner) == 1 && (privacy_kind_type.length > 1 || privacy_users.length > 0)) {\n // Select the \"custom\" icon.\n $(\"#privacyclass_user4\").addClass('active');\n \n // Reset the custom box adding the \"add more\" box.\n $(\".emailcontainer\").html(add_more_box);\n addmoreusersautocomplete_custom_journal($('#addmoretext_custum_privacy_detailed'));\n\n // Select the predefined categories.\n if (privacy_kind_type_arr.indexOf('5') != -1) {\n $(\".uploadinfocheckbox4\").addClass('active');\n $(\".emailcontainer\").append(followers_box);\n }\n if (privacy_kind_type_arr.indexOf('3') != -1) {\n $(\".uploadinfocheckbox_friends_of_friends\").addClass('active');\n $(\".emailcontainer\").append(friends_of_friends_box);\n }\n if (privacy_kind_type_arr.indexOf('1') != -1) {\n $(\".uploadinfocheckbox3\").addClass('active');\n $(\".emailcontainer\").append(friends_box);\n }\n\n // Show the users entered manually in the custom box.\n if (privacy_users != '' && privacy_users != 'undefined') {\n for (i = 0; i < privacy_users_arr.length; i++) {\n var tmp_box_item = user_box.replace('%user_id%', privacy_users_arr[i]['id']);\n var tmp_box_item = tmp_box_item.replace('%username%', privacy_users_arr[i]['FullName']);\n\n $(\".emailcontainer\").append(tmp_box_item);\n\n // Save the names in case the user cancels the changes they made to the custom box.\n custom_privacy_names[ privacy_users_arr[i]['id'] ] = privacy_users_arr[i]['FullName'];\n }\n }\n\n }\n // Other privacies.\n else {\n $(\"#privacyclass_user\" + privacy_kind_type).addClass('active');\n }\n\n\n if (is_visible == 1)\n $(\"#hide_button\").html(t(\"hide\"));\n else\n $(\"#hide_button\").html(t(\"unhide\"));\n\n if (enable_share_comment == 1) {\n $(\".overdatabutenable\").attr('data-status', '1');\n $('.overdatabutntficon').removeClass('inactive');\n } else {\n $(\".overdatabutenable\").attr('data-status', '0');\n $('.overdatabutntficon').addClass('inactive');\n }\n\n if ($(\".albumdesc_journal\").height() > 405) {\n initscrollPaneSocial($(\".scrollpane_description_journal\"), false);\n }\n $('.privacyclass.active').click();\n // End edit fields.\n }\n }\n });\n}", "title": "" }, { "docid": "24d15121c45a31de140be470881a9dfd", "score": "0.5428915", "text": "getDetails(block) {\n // Use this method to load your content from the selected APIs\n const countries = $('.countries');\n const name = block.find('h1').text();\n this.load(`https://restcountries.eu/rest/v2/name/${name}?fullText=true`)\n .then((data) => {\n data.forEach((ctry, index) => {\n let $list = block.find('.my-list');\n $list.find('.js-capital').text(\"Capital:\" + \" \" + ctry.capital);\n $list.find('.js-population').text(\"Population:\" + \" \" + ctry.population);\n $list.find('.js-people').text(\"People:\" + \" \" + ctry.demonym);\n $list.find('.map').attr('href', `https://www.google.com/maps/place/${ctry.name}`).text('map');\n });\n });\n }", "title": "" }, { "docid": "4712a88ca7d0da336a1743afefab9e0c", "score": "0.54140157", "text": "function getUrlContent(idPost)\n{\n //Generando URL para el detalle\n var url = URL_API + POST_API_DETAIL + idPost;\n return url;\n}", "title": "" }, { "docid": "4d4d72ca7a32d12dc091a046e2ffc54f", "score": "0.53961766", "text": "async function getData() {\n const proxy = 'https://serene-grand-teton-69312.herokuapp.com/';\n // const url = 'https://api.kawalcorona.com/indonesia/provinsi/';\n const url = 'https://type.fit/api/quotes';\n const res = await fetch(proxy + url);\n const data = await res.json();\n return data;\n}", "title": "" }, { "docid": "2b16c00804b276a99a1f2c84a65c1baf", "score": "0.5387819", "text": "function getQuotes(){\n \n randomBackground();\n \n var url = \"http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=?\";\n \n $.getJSON(url)\n .done(function(data){\n \n var quote = data ;\n \n $(\"blockquote\").html(\"<p>\"+ quote.quoteText + \"</p><footer class='author'>\" + quote.quoteAuthor +\"</footer>\")\n\n })\n \n .fail(function(jqxhr, textStatus, error ){\n var err = textStatus + \", \" + error;\n\n console.log( \"Request Failed: \" + err );\n\n });\n }", "title": "" }, { "docid": "ff206bf3d947c4739af2c6bf40084c9d", "score": "0.5376007", "text": "GetPartDetail() {\n var Param = {\"state\": \"get_all_data\"};\n return Param;\n }", "title": "" }, { "docid": "227ccd3cdc6245aa9ed8fcb02113121d", "score": "0.53582895", "text": "async getDetails() {\n // defensive coding\n if (this.accountID === undefined) return undefined\n // actual logic that matters\n let detailsString = await this.getItem(this.accountID)\n if (detailsString === undefined || detailsString === null) {\n return undefined\n }\n let details = JSON.parse(detailsString)\n return details\n }", "title": "" }, { "docid": "1403c460dd85c828d8e7b609591fc9ab", "score": "0.5323104", "text": "function fetchContentDataById(id) {\n let url = objectBaseURL + id + \"?api_key=\"+apiKey;\n window\n .fetch(url)\n .then(res => res.json())\n .then(data => {\n console.log(\"Here's the content data of the specified object:\", data.response);\n })\n .catch(error => {\n console.log(error);\n })\n}", "title": "" }, { "docid": "7e6b21aa293d852a3782bf3db9711c5f", "score": "0.5306634", "text": "function getPublisherInfo(){\n\tvar url = \"http://sharethis.com/get-publisher-info.php?callback=parsePublisherInfo\";\n\tvar script = document.createElement('script');\n\tscript.setAttribute('src', url);\n\tdocument.getElementsByTagName('head')[0].appendChild(script); \n}", "title": "" }, { "docid": "efe3da92ac912cbbcc8d0eb95f1dbf6e", "score": "0.53054196", "text": "static detailItem(id) {\r\n return fetch(`https://www.themealdb.com/api/json/v1/1/lookup.php?i=${id}`)\r\n .then((response) => {\r\n return response.json();\r\n })\r\n .then((responseJson) => {\r\n if (responseJson.meals) {\r\n return Promise.resolve(responseJson.meals);\r\n } else {\r\n return Promise.reject(`data tidak ditemukan`);\r\n }\r\n });\r\n }", "title": "" }, { "docid": "6e0cbdcb50cf20e5879d2902b38a6b23", "score": "0.5295574", "text": "function getDetails(){\n // Query the store for the product details\n log(\"getDetails\");\n inappbilling.getProductDetails(successHandler, errorHandler, [\"gas\",\"infinite_gas\"]);\n}", "title": "" }, { "docid": "6eddab62a0f019186d22366162bd0995", "score": "0.5285149", "text": "function getContent() {\n return androidConnector.getArticleContent();\n }", "title": "" }, { "docid": "af7c20c83c9cf41b3df6ef31b81b7945", "score": "0.5283528", "text": "function getRecipeInfo(box, id){\n let queryURL = \"https://api.spoonacular.com/recipes/\" + id + \"/information?&apiKey=\" + key;\n fetch(queryURL)\n .then(function (response) {\n if (response.status === 404) {\n }\n return response.json();\n })\n .then(function (data) {\n // Check if the response is 200\n console.log(data);\n box.attr(\"href\", data[\"sourceUrl\"]);\n }); \n}", "title": "" }, { "docid": "8cf542c77849518c4553d000341895e6", "score": "0.52691823", "text": "function _scrapeLdInfo() {\n const text = $('script[type=\"application/ld+json\"]').text()\n const json = JSON.parse(text)\n if (!json) return null\n return json.itemListElement\n}", "title": "" }, { "docid": "fe492bfdf3d827dae5dd505296beecf7", "score": "0.52625597", "text": "function getContent(name,type,city){\n var content = '<div class=\"Markercontent\">'+\n '<h4 class=\"detailName\">'+name+'</h4>'+\n '<p class=\"detailType\">'+type+'</p>'+\n '<p clas=\"detailCity\">'+city+'</p>'+\n '<button class=\"btncontent\" id=\"BtnContent\">VIEW STORE DETAIL'+'</button>'+\n '</div>';\n return content;\n }", "title": "" }, { "docid": "fe595c6fbdd72219c2be0f64425bc875", "score": "0.5260339", "text": "async function getInfoFromAPI() {\n const urlInfo = `http://ibmrisvol.ibm.ntnu.no/data/info?id=${dataType}`;\n const response = await fetch(urlInfo);\n const info = await response.json();\n return info.description;\n }", "title": "" }, { "docid": "23b76356c75fbdc611e71d5c742f4dbb", "score": "0.52588755", "text": "function get_site_info() {\n var author = document.getElementsByTagName(\"meta\")[\"author\"]['content'];\n var info = author.split(\" \");\n return info;\n }", "title": "" }, { "docid": "8ad69911d7e5dd53ff542746e5f02c20", "score": "0.5244971", "text": "function loadData() {\n console.log(\"\\nCONTENT>>>> LD - \" + oneQuote.content);\n console.log(\"\\nTITLE>>>> LD - \" + oneQuote.title);\n\n\t\tif (oneQuote.content.length > 200) {\n\t\t\tgetQuote();\n\t\t} else {\n\t\t $('#quoteMsg').html(oneQuote.content);\n\n\t\t if (oneQuote.title){\n\t\t $('#quoteAuthor').html(oneQuote.title);\n\t\t }\n\t\t else{\n $('#quoteAuthor').text('Anonymous');\n\t\t }\n }\n }", "title": "" }, { "docid": "a2352044da70d7cd23c9264e4079607a", "score": "0.5243549", "text": "function parseAstCopyrights(data, url)\n{\n let rA = [];\n rA['url'] = '';\n rA['id'] = '';\n rA['author'] = '';\n rA['title'] = '';\n\n const urlPattern = /^([^\\?]+)(\\?.*)?$/;\n if (url.search(urlPattern) != -1) {\n rA['url'] = url.match(urlPattern)[1];\n } else {\n rA['url'] = url;\n }\n\n const idPattern = /^https:\\/\\/stock\\.adobe\\.com\\/([a-z]+\\/)?[0-9a-z-]+\\/[^\\/]+\\/([1-9][0-9]*).*$/;\n if (url.search(idPattern) != -1) {\n rA['id'] = url.match(idPattern)[2];\n }\n\n const authorPattern = /^.*<script type=\"application\\/json\" id=\"image-detail-json\">(.*)<\\/script>.*$/mi;\n if (data.search(authorPattern) != -1) {\n let imgObject = JSON.parse(data.match(authorPattern)[1].trim());\n rA['author'] = imgObject[rA['id']][\"author\"];\n }\n\n\tconst titlePattern = /^.*<h1[^>]*>[^<>]*<span[^>]*>([^<>]+)<\\/span>[^<>]*<\\/h1>.*$/mi;\n if (data.search(titlePattern) != -1) {\n rA['title'] = data.match(titlePattern)[1].trim();\n }\n \n if (rA['title'] == '') {\n\t\tconst altTitlePattern = /^.*<h1[^>]*>([^<]+)<.*$/mi;\n\t\tif (data.search(altTitlePattern) != -1) {\n\t rA['title'] = data.match(altTitlePattern)[1].trim();\n\t }\n\t}\n \n return rA;\n}", "title": "" }, { "docid": "e14704cd17277b5a617642d485a6aeca", "score": "0.523796", "text": "function getMetadata()\n{\n var iterator = document.evaluate('//a-entity[@route]/*[local-name()!=\"a-cylinder\"]', document, null, XPathResult.ANY_TYPE, null);\n var thisNode = iterator.iterateNext();\n\n // var metadata = \"\";\n\n var activities = [];\n\n while (thisNode) {\n\n activities.push({\n id: thisNode.id,\n x: thisNode.object3D.position.x,\n y: thisNode.object3D.position.y\n })\n\n //metadata += \"id:\"+thisNode.id+\" x:\"+thisNode.object3D.position.x+\" y:\"+thisNode.object3D.position.y+\"\\n\"\n thisNode = iterator.iterateNext();\n }\n\n //return metadata;\n return JSON.stringify(activities,null,'\\t');\n}", "title": "" }, { "docid": "c6e4e28b46ff0e7ccc90009bf267906c", "score": "0.5237483", "text": "function fetchDetails() {\r\n try {\r\n var fetchData=fs.readFileSync('notes-data.json');\r\n return JSON.parse(fetchData);\r\n } catch (e){\r\n return [];\r\n }\r\n}", "title": "" }, { "docid": "0c98dcd9082dfbf6d0e73b5be88c8bbd", "score": "0.5235461", "text": "function getdataAirq(){\r\n //var url = \"https://data.cityofnewyork.us/api/views/c3uy-2p5r/rows.json?accessType=DOWNLOAD\"\r\n var url = \"https://data.cityofnewyork.us/resource/ah89-62h9.json?$where=year_description=%222013%22%20AND%20geo_entity_name=%22Manhattan%22\";\r\n var data = $.get(url, () => {\r\n\t\tconsole.log( url );\r\n\t})\r\n\t.done(function () {\r\n\t\tconsole.log(data);\r\n\t\tvar resp = data.responseJSON;\r\n\t\talert(\"Air Quality in Manhattan:\\n\"+resp[0].name+\": \"+resp[0].data_valuemessage+\" \"+resp[0].measure);\r\n\t})\r\n\t.fail(function (error) {\r\n\t\t//fail\r\n\t\tconsole.error(error);\r\n\t})\r\n}", "title": "" }, { "docid": "cf9e39f7a8525e00848171954e72e0a0", "score": "0.52256763", "text": "function getRandomQuote(){\n return fetch(RANDOM_QUOTE_API_URL)\n .then(response => response.json())\n .then(data => data.content)\n}", "title": "" }, { "docid": "1b6fe88cb253d1ca05f856d8f0e999c6", "score": "0.52254426", "text": "function getContent(name,type,city){\r\n var content = '<div class=\"Markercontent\">'+\r\n '<h4 class=\"detailName\">'+name+'</h4>'+\r\n '<p class=\"detailType\">'+type+'</p>'+\r\n '<p clas=\"detailCity\">'+city+'</p>'+\r\n \r\n '</div>';\r\n return content;\r\n }", "title": "" }, { "docid": "760aca4c2b368878a29763faf0bb31b5", "score": "0.52252275", "text": "function getQuote() {\n fetch(quoteAPIUrl, {\n cache: \"no-store\"\n })\n .then((response) => {\n return response.json();\n })\n .then((data) => {\n while (authorDiv.firstChild) {\n quoteDiv.removeChild(quoteDiv.firstChild);\n authorDiv.removeChild(authorDiv.firstChild);\n }\n quote = data.content;\n author = \"-\" + data.author;\n p = document.createElement(\"p\");\n p.textContent = quote;\n quoteDiv.appendChild(p);\n p = document.createElement(\"p\");\n p.textContent = author;\n authorDiv.appendChild(p);\n randomQuote = quote;\n randomAuthor = author;\n document.querySelectorAll(\".fa-twitter\")[0].setAttribute(\"href\", tweetAPIUrl + randomQuote + \" \" + randomAuthor);\n })\n .catch(function(error) {\n console.log(error);\n });\n }", "title": "" }, { "docid": "38bdbd13569c02918400976893591dd9", "score": "0.5217913", "text": "async function getQuote(){\n showLoading();\n const proxyUrl= 'https://cors-anywhere.herokuapp.com/'\n const apiUrl= 'http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=json';\n try{\n const response= await fetch(proxyUrl + apiUrl);\n const data= await response.json();\n // if Author is unknown\n if(authorText===''){\n authorText.innerText = 'Unknown';\n }\n else {\n authorText.innerText = data.quoteAuthor;\n }\n \n if(data.quoteText.length > 120)\n {\n quoteText.classList.add('long-quote');\n }\n else{\n quoteText.classList.remove('long-quote');\n }\n quoteText.innerText = data.quoteText\n \n hideLoading(); \n\n }catch(error){\n getQuote();\n console.log('oops, no quote',error);\n }\n}", "title": "" }, { "docid": "f6a2e00ebb5c9c1e7869523f95cb8397", "score": "0.5216325", "text": "function parsePxbCopyrights(data, url)\n{\n let rA = [];\n rA['url'] = '';\n rA['id'] = '';\n rA['author'] = '';\n rA['title'] = '';\n\n const urlPattern = /^([^\\?]+)(\\?.*)?$/;\n if (url.search(urlPattern) != -1) {\n rA['url'] = url.match(urlPattern)[1];\n } else {\n rA['url'] = url;\n }\n\n const idPattern = /^.+<link rel=\"canonical\" href=\"https:\\/\\/pixabay\\.com\\/([a-z]{2,2}\\/)?[a-z-]+\\/[^\\/]+-([0-9]+)\\/.+$/mi;\n if (data.search(idPattern) != -1) {\n rA['id'] = data.match(idPattern)[2];\n }\n\n const authorPattern = /^.*<a[^>]+class=\"userName[^>]+>([^<]+)<\\/a>.*$/mi;\n if (data.search(authorPattern) != -1) {\n rA['author'] = data.match(authorPattern)[1].trim();\n }\n\n const titlePattern = /^.*<meta property=\"og:title\" content=\"([^\"]+)\".*$/mi;\n if (data.search(titlePattern) != -1) {\n rA['title'] = data.match(titlePattern)[1].trim();\n }\n \n return rA;\n}", "title": "" }, { "docid": "b9b8602215090dbd116e0a6205fd997c", "score": "0.52111423", "text": "function getMarketoLead(n){var e=encodeURIComponent(Cookies.get(\"_mkto_trk\"));void 0===e&&n([]),$.ajax({type:\"GET\",url:\"/proxy/get-lead.php?cookieValue=\"+e,contentType:\"application/json; charset=utf-8\",dataType:\"json\",success:function(e){var a=e.result[0]||{},t={Email:a.email,FirstName:a.firstName,LastName:a.lastName,Phone:a.phone,companySize:a.companySize,currentCRM_account:a.currentCRM_account,emailProvider:a.emailProvider,Industry:a.industry,Company:a.company};n(t)},error:function(){n([])}})}", "title": "" }, { "docid": "f08aa9b979e44490351675761b9ac47e", "score": "0.5199376", "text": "function loadInfo() {\n var url = 'api';\n \n fetch(url)\n .then(function(response) {\n // console.log(response.json())\n return response.json();\n })\n .then(function(info){\n console.log(info)\n\n for (var i = 0; i < resource_notes.length; i++) {\n resource_notes[i].innerHTML = info[selectedCategoryIndex].Resources[i].notes;\n resource_names[i].innerHTML = info[selectedCategoryIndex].Resources[i].name;\n resource_names[i].href = info[selectedCategoryIndex].Resources[i].link;\n }\n })\n .catch(function(error){\n console.log(error);\n });\n }", "title": "" }, { "docid": "18672ffe0769170db4616ead3303a958", "score": "0.5198087", "text": "function getMetadata(metadata, context) {\n let data = {}\n if (context === 'single') {\n // Get info of interest from the object from on-page script\n if (metadata.section && metadata.section.course) {\n data.courseName = metadata.section.course.courseName;\n data.courseId = metadata.section.course.id;\n }\n if (metadata.lesson) {\n data.name = metadata.lesson.name;\n }\n if (metadata.video) {\n data.thumbnailUrl = metadata.video.thumbnailUrl;\n data.duration = metadata.video.duration; // in milliseconds\n }\n if (metadata.video && metadata.video.current) {\n data.files = metadata.video.current.primaryFiles; // each contains: {height, s3Url, size, width}\n let audioFile = metadata.video.current.audioFiles[0];\n audioFile.isAudio = true;\n data.files.push(audioFile);\n }\n if (metadata.video && metadata.video.current && metadata.video.current.audioFiles && metadata.video.current.audioFiles.length > 0) {\n data.audio = metadata.video.current.audioFiles[0] // {s3Url, size}\n }\n } else if (context === 'menu') {\n // Get info of interest from the object from API request\n if (metadata.video && metadata.video.published) {\n data.courseName = metadata.video.published.courseName;\n data.courseId = metadata.video.published.courseId;\n }\n if (metadata.video && metadata.video.media) {\n data.name = metadata.video.media.name;\n }\n if (metadata.video && metadata.video.media && metadata.video.media.media) {\n data.thumbnailUrl = metadata.video.media.media.thumbnailUrl;\n data.duration = metadata.video.media.media.duration; // in milliseconds\n }\n if (metadata.video && metadata.video.media && metadata.video.media.media && metadata.video.media.media.current) {\n data.files = metadata.video.media.media.current.primaryFiles; // each contains: {height, s3Url, size, width}\n data.thumbnailLink = (data.files.length > 0) ? data.files[0].s3Url : data.thumbnailUrl;\n let audioFile = metadata.video.media.media.current.audioFiles[0];\n audioFile.isAudio = true;\n data.files.push(audioFile);\n }\n }\n return data;\n}", "title": "" }, { "docid": "ebff6e74a001091b728ba0cf2e66ef30", "score": "0.51938283", "text": "GetSinglePartDetail() {\n var Param = {\"state\": \"get_single_data\"};\n return Param;\n }", "title": "" }, { "docid": "9f1b2855d75b4c66baeeb98c683fa86a", "score": "0.5190321", "text": "getPageOfFics(document) {\n const fics = document.querySelectorAll(\"li.work\");\n let ficDataForPage = [];\n\n fics.forEach((fic) => {\n const heading = fic.querySelector(\"h4.heading\");\n\n const data = {\n title: heading.querySelector(\"a\").innerHTML,\n author: heading.querySelector(\"a[rel]\").innerHTML,\n summary: this.getSummary(fic),\n date: this.parseDate(fic),\n link: heading.querySelector(\"a\").getAttribute(\"href\"),\n author_link: heading.querySelector(\"a[rel]\").getAttribute(\"href\"),\n source: \"AO3\",\n };\n\n ficDataForPage.push(data);\n });\n\n return ficDataForPage;\n }", "title": "" }, { "docid": "9a05d4589e5d757a0967229f3eb87146", "score": "0.51857674", "text": "function getFT() {\n loading();\n clearArticles();\n var ftKey = \"59cbaf20e3e06d3565778e7b3eea8499b81a49bbaf7ba01c19fe21a1\";\n var url = \"https://peaceful-lake-77400.herokuapp.com/\";\n var rootUrl = \"http://api.ft.com/content/search/v1\";\n var data = {\n \"queryString\": \"banks\",\n \"resultContext\": {\n \"aspects\": [\"title\", \"lifecycle\", \"location\", \"summary\", \"editorial\"]\n }\n };\n var results = [];\n $.ajax({\n url: url,\n headers: {\n \"X-Api-Key\": ftKey,\n \"Content-Type\": \"application/json\",\n \"Target-URL\": rootUrl\n },\n contentType: \"application/json\",\n dataType: \"json\",\n data: JSON.stringify(data),\n method: \"POST\"\n }).success(function (result) {\n var resultSet = result.results[0].results;\n console.log(resultSet);\n for(var i in resultSet) {\n iResult = resultSet[i];\n var content = iResult[\"summary\"][\"excerpt\"] || \"No summary available\";\n results.push({\n title: iResult[\"title\"][\"title\"],\n content: content,\n link: iResult[\"location\"][\"uri\"],\n imageSource: \"images/no.png\",\n category: \"Stuffy Brits\",\n length: content.length || 0\n });\n for(var i in results) {\n buildArticle(results[i]);\n }\n }\n finishLoading(true);\n }).fail(function (err) {\n showError(\"the Financial Times\");\n console.log(err);\n });\n return results;\n}", "title": "" }, { "docid": "909f93f0004365d9fd557058f61596c3", "score": "0.518424", "text": "function getCopyright(pageParam) {\n return storyData[pageParam][\"copyright\"];\n}", "title": "" }, { "docid": "bd2b30e0086a269f1a328a254239967d", "score": "0.5182993", "text": "function getSpecificCatalog(documentID) {\n return fetch(\"https://developer-api.openbom.com/catalog/\" + documentID, {\n method: \"get\",\n headers: {\n \"x-openbom-accesstoken\": access_token,\n \"x-openbom-appkey\": openbom_appkey\n }\n })\n .then(res => res.json())\n .catch(err => console.log(err))\n}", "title": "" }, { "docid": "ed8cf2cc81223800a891e0019c270a2e", "score": "0.5182044", "text": "function fetchData(acmeURL){\n // let cityName = 'Greenville'; // The data we want from the weather.json file\n fetch(acmeURL)\n .then(function(response) {\n if(response.ok){\n return response.json();\n }\n throw new ERROR('Network response was not OK.');\n })\n .then(function(data){\n // Check the data object that was retrieved\n console.log(data);\n\n // shorten the variable and focus only on the data we want to reduce typing\n let g = data[productName];\n\n // ************ Get the content ******************************\n\n // Get the picture and description data\n let locImage = g.path;\n let locDescription = g.description;\n\n // See if it worked\n console.log('Image path and description are: '+ locImage +\" \"+ locDescription);\n\n // Get the name, manufacturer, price and reviews\n let productTitle = g.name;\n let productManufacturer = g.manufacturer;\n let productPrice = g.price;\n let productReviews = g.reviews;\n\n // Display title, manufacturer, price and reviews\n console.log(\"Title, manu, price and reviews are \"+productTitle+\" \"+productManufacturer+\" \"+productPrice+\" \"+productReviews);\n \n let pageTitle = document.getElementById('page-title');\n\n // Create a text node containing the full name \n let fullNameNode = document.createTextNode(productTitle);\n // inserts the productTitle value before any other content that might exist\n pageTitle.innerHTML = \"\";\n pageTitle.insertBefore(fullNameNode, pageTitle.childNodes[0]);\n\n // Set product description information\n let nameContent = document.getElementById('product-name');\n nameContent.innerHTML = productTitle;\n\n let imageContent = document.getElementById('product-picture');\n switch (locImage){\n case \"/acme-project/images/products/anvil.png\":\n imageContent.setAttribute(\"class\", \"anvil\"); //\"anvil\" is the CSS rule selector\n break;\n case \"/acme-project/images/products/tnt.png\":\n imageContent.setAttribute(\"class\", \"tnt\");\n break;\n case \"/acme-project/images/products/roadrunner.jpg\":\n imageContent.setAttribute(\"class\", \"roadrunner\");\n break;\n case \"/acme-project/images/products/trap.jpg\":\n imageContent.setAttribute(\"class\", \"traps\");\n break;\n }\n\n let descriptionContent = document.getElementById('description-paragraph');\n descriptionContent.innerHTML = locDescription;\n\n let manufacturerContent = document.getElementById('manufacturer-span');\n manufacturerContent.innerHTML = productManufacturer;\n\n let reviewsContent = document.getElementById('stars-span');\n reviewsContent.innerHTML = productReviews+\"/5 stars\";\n\n let priceContent = document.getElementById('amount-span');\n priceContent.innerHTML = \"$\"+productPrice;\n \n // hide home page section\n let contentContainer = document.getElementById('content-page');\n let homeContainer = document.getElementById('home-page-content');\n\n contentContainer.setAttribute('class', ''); // removes the hide class\n homeContainer.setAttribute('class', 'hide'); // hides the status container\n })\n .catch(function(error){\n console.log('There was a fetch problem: ', error.message);\n statusContainer.innerHTML = 'Sorry, the data could not be processed.';\n })\n}", "title": "" }, { "docid": "f514a392b32304022b0d2b81097e2a35", "score": "0.5181228", "text": "gatherInfo(info, content) {\n info.apple_artist_id = content.artistId.toString();\n info.apple_album_id = content.collectionId ? content.collectionId.toString() : null;\n info.apple_song_id = content.trackId ? content.trackId.toString() : null;\n info.apple_artist_url = content.artistViewUrl ? content.artistViewUrl : content.artistLinkUrl;\n info.apple_album_url = content.collectionViewUrl ? content.collectionViewUrl : null;\n info.apple_song_url = content.trackViewUrl ? content.trackViewUrl : null;\n return info;\n }", "title": "" }, { "docid": "9b3296503c4b60a4602510f22401eb46", "score": "0.5179572", "text": "static async get(params) { super.get(params, 'party') }", "title": "" }, { "docid": "bcbdf42f186e0d5b15e947105122fb5c", "score": "0.5178525", "text": "async function getQuote() {\n //note: 1. to overcome the CORS issue; we call a proxy url first\n const proxyURL = 'https://cors-anywhere.herokuapp.com/';\n const apiURL =\n 'http://api.forismatic.com/api/1.0/?method=getQuote&format=json&lang=en';\n // const apiURL = 'https://type.fit/api/quotes';\n\n try {\n //2. combine the fetch call for the proxyURL and the apiURL\n const response = await fetch(proxyURL + apiURL);\n const data = await response.json();\n\n //If author name is empty then replace it with 'unknown author'\n if (data.quoteAuthor === '') {\n authorText.innerText = 'Unknown Author';\n } else {\n authorText.innerText = data.quoteAuthor;\n }\n\n //Reduce font size for long quotes\n if (data.quoteText.length > 120) {\n quoteText.classList.add('long-quote');\n } else {\n quoteText.classList.remove('long-quote');\n }\n quoteText.innerText = data.quoteText;\n } catch (error) {\n // getQuote();\n }\n}", "title": "" }, { "docid": "1f99027fee505642aff2070dbfe9dcc6", "score": "0.5174885", "text": "function getContent(url, filter) {\n var activeLoaderKey = 's-js-course-materials-full';\n\n url += (url.indexOf('?') ? '&' : '?') + 'ajax=1&style=full';\n sToggleActiveLoader(activeLoaderKey, wrapperObj);\n $.ajax({\n url: url,\n success: function(data) {\n var contentObj = $(data),\n currentMaterialsBody = wrapperObj.find('.s-js-materials-body'),\n newMaterialsBody = contentObj.find('.s-js-materials-body');\n if (currentMaterialsBody.length) {\n currentMaterialsBody.replaceWith(newMaterialsBody);\n } else {\n wrapperObj.append(newMaterialsBody);\n }\n\n Drupal.attachBehaviors(wrapperObj.find('.s-js-materials-body'));\n\n sAngular.trigger('sCourseMaterialsFilterContentRefreshed', filter);\n },\n complete: function() {\n sToggleActiveLoader(activeLoaderKey);\n }\n });\n }", "title": "" }, { "docid": "2144f29302a37ea95805498d86c2ddbc", "score": "0.5174813", "text": "get webinfos() {\n return SPCollection(this, \"webinfos\");\n }", "title": "" }, { "docid": "bc5891f53a66f2c9a6940a12a59a0f47", "score": "0.5167154", "text": "getCart(context) {\n let headers = auth.getAuthHeader();\n return context.$http.get(PRODUCT_URL,{headers : headers})\n }", "title": "" }, { "docid": "6888cb86055380226be19d3fc5b28572", "score": "0.5166341", "text": "function get_quote() {\n var requestURL = \"http://api.forismatic.com/api/1.0/?method=getQuote&format=json&lang=en&key\";\n var request = new XMLHttpRequest();\n request.open('GET', requestURL);\n request.responseType = 'json';\n request.send();\n request.onload = function () {\n var quote = request.response;\n populateQuoteDiv(quote);\n }\n}", "title": "" }, { "docid": "b315b1a73c26f26c1fc6d4d81bf0bb1e", "score": "0.5164629", "text": "function extractFields(object) {\n // fields with `*` are exported.\n\n // These pieces of info are critical. Should them missing the online\n // resource is abnormal.\n var body, MedlineCitation, pmid;\n try {\n body = object.PubmedArticle;\n MedlineCitation = uniqueObject(body.MedlineCitation);\n pmid = uniqueText(MedlineCitation.PMID);\n } catch (e) {\n throw 'The online resource is invalid:' + e;\n }\n\n // Date\n var dateCreated;\n var dateCompleted;\n var dateRevised;\n try {\n dateCreated = reduceDate(uniqueObject(MedlineCitation.DateCreated));\n dateCompleted = reduceDate(uniqueObject(MedlineCitation.DateCompleted));\n dateRevised = reduceDate(uniqueObject(MedlineCitation.DateRevised));\n } catch (e) {\n // do nothing. If any of the date is available, user will see it.\n }\n\n // Journal info\n var Article, Journal, issnType, issn, journalTitle, journalAbbr, articleTitle;\n try {\n Article = uniqueObject(MedlineCitation.Article);\n Journal = uniqueObject(Article.Journal);\n issnType = uniqueAttr(Journal.ISSN, 'IssnType');\n issn = uniqueText(Journal.ISSN);\n // JournalIssue = uniqueObject(Journal.JournalIssue);\n // pubDate = uniqueObject(JournalIssue.PubDate);\n // volume = uniqueText(JournalIssue.Volume);\n // issue = uniqueText(JournalIssue.issue);\n\n journalTitle = uniqueText(Journal.Title);\n journalAbbr = uniqueText(Journal.ISOAbbreviation);\n articleTitle = uniqueText(Article.ArticleTitle);\n } catch (e) {\n // do nothing as above.\n } finally {\n\n }\n\n\n // Retrive author info\n var AuthorList, Authors, authors, author, lastName, foreName, name,\n AffiliationInfo, affiliation;\n try {\n var AuthorList = uniqueObject(Article.AuthorList);\n var Authors = AuthorList.Author;\n if (!Authors.length) {\n Authors = [];\n }\n var authors = []; //*\n for (var i = 0; i < Authors.length; i++) {\n var author = Authors[i];\n var lastName = uniqueText(author.LastName);\n var foreName = uniqueText(author.ForeName);\n var collectiveName = uniqueText(author.CollectiveName);\n var initials = uniqueText(author.Initials);\n var name = `${lastName} ${initials}`;\n var AffiliationInfo = uniqueObject(author.AffiliationInfo);\n var affiliation = uniqueText(AffiliationInfo.Affiliation);\n authors.push({\n name,\n lastName,\n foreName,\n collectiveName,\n affiliation\n });\n }\n } catch (e) {\n // Fail to parse author info\n authors = [];\n }\n\n // Retrive PublicationTypeList\n try {\n var PublicationTypeList = uniqueObject(Article.PublicationTypeList);\n var PublicationTypes = PublicationTypeList.PublicationType;\n if (!PublicationTypes.length) {\n PublicationTypes = [];\n }\n var publicationTypes = []; //*\n for (var i = 0; i < PublicationTypes.length; i++) {\n var publicationType = uniqueText(PublicationTypes[i]);\n publicationTypes.push(publicationType);\n }\n } catch (e) {\n publicationTypes = [];\n }\n\n return {\n pmid,\n dateCreated,\n dateCompleted,\n dateRevised,\n issn,\n issnType,\n journalTitle,\n journalAbbr,\n articleTitle,\n authors,\n publicationTypes\n };\n}", "title": "" }, { "docid": "059235df0a70ff2419cee544f443a646", "score": "0.51492447", "text": "function getResearchInfo(id) {\n\tconsole.log(\"target: \" + id);\t\n\tvar match = '';\n\tmyXHR('get', {'path':'/research/byInterestArea/areaName='+id}).done(function(json){\n\t\tvar x='';\n\t\t$.each(json.citations, function(i, item) {\n\t\t\tx+='<p>'+item+'</p>';\n\t\t});\n\t\t$('#modal-text').html(x);\n\t\t$('#modal').iziModal('setTitle', json.areaName);\n $('#modal').iziModal('open');\n\t});\n}", "title": "" }, { "docid": "a746c6dac3f08a4bb86b40485e37d971", "score": "0.5148969", "text": "function getContact() {\n fetch(baseLink + \"/contact\")\n .then(res => res.json())\n .then(showContact)\n}", "title": "" }, { "docid": "1ad9ec360a9125344d0aa99313856401", "score": "0.51466846", "text": "function getStudyAbroadInfo(id) {\n\tconsole.log(\"HERE\");\n\tmyXHR('get', {'path':'/resources/'}).done(function(json){\n\t\tvar x ='';\n\t\tx+='<h2>'+json.studyAbroad.title+'</h2>';\n\t\tx+='<p>'+json.studyAbroad.description+'</p>';\n\t\t$.each(json.studyAbroad.places, function (i, item){\n\t\t\tx+='<h3>'+item.nameOfPlace+'</h3>';\n\t\t\tx+='<p>'+item.description+'</p>';\n\t\t});\n\t\t$('#modal-text').html(x);\n\t\t$('#modal').iziModal('setTitle', json.title);\n $('#modal').iziModal('open');\n\t});\n}", "title": "" }, { "docid": "8f0af7a1daab952ce40f384d14dbd730", "score": "0.51462495", "text": "function parseUspCopyrights(data, url)\n{\n let rA = [];\n rA['url'] = '';\n rA['id'] = '';\n rA['author'] = '';\n rA['title'] = '';\n\n const urlPattern = /^([^\\?]+)(\\?.*)?$/;\n if (url.search(urlPattern) != -1) {\n rA['url'] = url.match(urlPattern)[1];\n } else {\n rA['url'] = url;\n }\n\n const idPattern = /^https:\\/\\/unsplash\\.com\\/([a-z-]{2,5}\\/)?(photos|fotos|foto|fotografias|%E5%86%99%E7%9C%9F|%EC%82%AC%EC%A7%84)\\/([^\\/]+-)?([a-zA-Z0-9_]+).*$/i;\n if (url.search(idPattern) != -1) {\n rA['id'] = url.match(idPattern)[4];\n }\n const authorPattern = /^.*<meta property=\"og:title\" content=\"(Foto von |Photo by |Foto de |Photo de |Foto di |Foto de |사진 작가: |Unsplashで)([^\"]+)( auf Unsplash| on Unsplash|, Unsplash| en Unsplash| sur Unsplash| su Unsplash| na Unsplash|が撮影した写真)\".*$/mi;\n if (data.search(authorPattern) != -1) {\n rA['author'] = data.match(authorPattern)[2];\n }\n\n const titlePattern = /^.*<title>([^<]+)<\\/title>.*$/mi;\n if (data.search(titlePattern) != -1) {\n rA['title'] = data.match(titlePattern)[1].trim();\n }\n\n return rA;\n}", "title": "" }, { "docid": "1f64a9fe19e6ebea04fea5824d852156", "score": "0.5144214", "text": "function getDetails(info) {\n var defer = $q.defer();\n // using the 'get' function to pull up all the data for info\n $http({\n method: 'GET',\n url: 'http://www.omdbapi.com/',\n params: {\n apikey: 'c800acd6', \n i: info\n }\n }).then(function(result) {\n if(typeof result === 'object') {\n defer.resolve(result);\n } else{\n defer.reject('service error');\n }\n },\n function(error){\n defect.reject(error);\n });\n return defer.promise;\n }", "title": "" }, { "docid": "6d776b4824334ce7c61df9a5f2c57f98", "score": "0.5133925", "text": "function getFields(){\n \n var entity = \"Contribution\"; \n var action = \"get\"; \n var payload = \"\";\n \n var response = fetchURL(entity, action, payload);\n\n return response; \n}", "title": "" }, { "docid": "b8bcb5a4bff710c73091231aef2ef0e4", "score": "0.51300997", "text": "async function getQuote() {\n\tconst proxyUrl = \"https://cors-anywhere.herokuapp.com/\";\n\tconst apiUrl =\n\t\t\"https://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=json\";\n\ttry {\n\t\tconst response = await fetch(proxyUrl + apiUrl);\n\t\tconst data = await response.json();\n\t\tconsole.log(data);\n\t} catch (error) {\n\t\t// getQuote();\n\t\tconsole.log(\"whoops! No Quote\", error);\n\t}\n}", "title": "" }, { "docid": "b54afcf06630dc1d5cd9a98708e67631", "score": "0.5121448", "text": "function getArticleData(url, cb) {\n // API request setup\n const reqOptions = {\n url: 'https://mercury.postlight.com/parser?url=' + url,\n json: true,\n headers: { 'x-api-key': mercuryApiKey }\n };\n\n // Mercury API returns article content as HTML, so I use html-to-text to\n // to convert the HTML to plain text.\n const htmlToTextOptions = {\n wordwrap: null,\n ignoreHref: true,\n ignoreImage: true,\n preserveNewlines: false,\n uppercaseHeadings: false,\n singleNewLineParagraphs: false\n };\n\n request.get(reqOptions, (err, res, body) => {\n if (err) {\n cb(err, null);\n } else if (res.statusCode != 200) {\n cb('Mercury Parser experienced and issue.', null);\n } else if (!body.content || !body.title) {\n cb('Mercury Parser could not find or process the article body.', null);\n } else {\n // Convert content to plain text\n body.content = htmlToText.fromString(body.content, htmlToTextOptions);\n\n // Add some of the article metadata to the content\n if (body.domain) { body.content = 'Published at: ' + body.domain + '\\n\\n' + body.content; }\n if (body.date_published) {\n const date = new Date(body.date_published);\n body.content = 'Published on: ' + date.toDateString() + '\\n\\n' + body.content;\n }\n if (body.author) { body.content = 'By: ' + body.author + '\\n\\n' + body.content; }\n if (body.title) { body.content = body.title + '\\n\\n' + body.content; }\n\n cb(null, body);\n }\n });\n}", "title": "" }, { "docid": "b76e022b92e0ac070b22095d25c422b7", "score": "0.5114777", "text": "function getContentByContentId (contentId) {\n\n var defer = $q.defer();\n\n $http({\n method:'GET',\n url: originLoungeExpressAPIBaseURL + 'content/' + contentId\n })\n\n .then(function(response) {\n\n if (typeof response.data === \"object\") {\n\n defer.resolve(response.data);\n \n } else {\n\n defer.reject(response);\n }\n \n },\n\n function(error) {\n\n defer.reject(error);\n\n });\n\n return defer.promise; \n }", "title": "" }, { "docid": "ecf093ab07e13a21f82a0e304e356184", "score": "0.51141196", "text": "_getData() {\r\n\r\n this._makeAjax(`http://10.117.189.175:9090/mealbox/vendors`, \"get\", null);\r\n }", "title": "" }, { "docid": "ff73ebfd368056bddb753cdd576c345e", "score": "0.5109937", "text": "function getAuthorsByGetElementsAPI() {\r\n var author = new Array();\r\n // find all Element nodes who's local name is author and namespace is w3.ibm.com/hr\r\n var nodelist = domTree.getElementsByTagNameNS('http://w3.ibm.com/hr', 'author');\r\n for (var c=0; c<nodelist.length; c++) {\r\n author.push(nodelist.item(c).textContent);\r\n }\r\n return author;\r\n}", "title": "" }, { "docid": "f8c1ea3ce435201a03a1ffa4d18dd8cb", "score": "0.51091856", "text": "function getCrowdsourcedMetadata() {\n // I really hate how much this function knows about the DOM.\n var result = {},\n $table = $modalBox.find('#g2e-required-fields-based-on-tag'),\n key;\n $.each(tagger.getNewFields(), function(i, key) {\n var $input = $table.find('#' + key + ' input');\n if ($input.length) {\n result[key] = $input.val().trim();\n }\n });\n key = $modalBox.find('#g2e-user-key').val() || courseraUserKey;\n if (key !== '') {\n result.user_key = key;\n localStorage.setItem('g2e-submission-key', key);\n }\n return result;\n }", "title": "" }, { "docid": "19fcf0cd3eb56d7f06cb7619bbbccea7", "score": "0.51061344", "text": "function getESData2() {\n\tconsole.log(\"about to fetch\");\n\treturn new Promise(function(resolve, reject) {\n\t\tfetch('http://mtg-hunter.com/cards/card/_search?from=0&size=18000')\n\t\t.then(function(res) {\n\t resolve( res.json() );\n\t })\n\t})\n}", "title": "" }, { "docid": "9dad865dc1defa9e2b1de1e9b6833f5f", "score": "0.51059824", "text": "function parseMyMCLItemDetails() {\n\t\tvar table, ths, tds, locationIndex, callIndex, volumeIndex, statusIndex, i, j, className; \n\t\t\n\t\t// Make element to put the html content into for content extraction\t\n\t\tvar el = document.createElement('div');\n\t\tel.innerHTML = this.responseText;\n\t\t// Now find all info needed from ajax request\n\t\tvar headings = el.getElementsByTagName('h1');\n\t\tfor (i = 0; i < headings.length; i += 1) {\n\t\t\tif (headings[i].getAttribute('id') === 'aria_bib_title') item.title = cleanHTML(headings[i].innerHTML);\n\t\t\tclassName = headings[i].getAttribute('class') || headings[i].className; // className attr is for IE\n\t\t\tif (className === 'group_heading' && headings[i].innerHTML.search('Not available at this time') === -1) {\n\t\t\t\ttable = headings[i].nextSibling;\n\t\t\t\t// This isn't always the table, but it's nearby. Loop to find it\n\t\t\t\twhile (table.tagName !== 'TABLE') table = table.nextSibling;\n\t\t\t\tths = table.getElementsByTagName('th');\n\t\t\t\ttds = table.getElementsByTagName('td');\n\t\t\t\t// Loop through table headings to get placements of the ones we care about\n\t\t\t\tfor (j = 0; j < ths.length; j += 1) {\n\t\t\t\t\tswitch (ths[j].innerHTML) {\n\t\t\t\t\t\tcase 'Collection':\n\t\t\t\t\t\t\tlocationIndex = j;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'Call Number':\n\t\t\t\t\t\t\tcallIndex = j;\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tcase 'Call No.':\n\t\t\t\t\t\t\tcallIndex = j;\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tdefault: break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// go over table rows by headings length, add indexes for heading values\n\t\t\t\tfor (j = 0; j < tds.length; j += ths.length) {\n\t\t\t\t\tif (locationIndex !== undefined && tds[j + locationIndex].innerHTML.indexOf('Central') > -1 &&\n\t\t\t\t\t\tisNotRepeated(tds[j + locationIndex].innerHTML + tds[j + callIndex].innerHTML)) {\n\t\t\t\t\t\titem.location.push(cleanHTML(tds[j + locationIndex].innerHTML));\n\t\t\t\t\t\t//if (volumeIndex !== undefined) item.volume.push(cleanHTML(tds[j + volumeIndex].innerHTML));\n\t\t\t\t\t\tif (callIndex !== undefined) item.callNumber.push(cleanHTML(tds[j + callIndex].innerHTML));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (item.location.length < 1) {\n\t\t\tnoAvailableItems();\n\t\t\treturn;\n\t\t}\n\t\tcopyToClipboard(JSON.stringify(item));\n\t} // END parseMyMCLItemDetails()", "title": "" }, { "docid": "1a72418816b57aab5a0b3d72a8770c5f", "score": "0.5097557", "text": "function getItemDescription(listingID) {\n\n}", "title": "" }, { "docid": "0fdee081c7b04d85a49625331f09cd29", "score": "0.509597", "text": "static async getCorporation(corporationId) {\n try {\n const response = await cachedFetch(`https://esi.evetech.net/latest/corporations/${corporationId}/?datasource=tranquility`);\n if (!response.ok) {\n throw Error(response.statusText);\n }\n \n return response.json();\n }\n catch (error) {\n console.log(error);\n }\n }", "title": "" }, { "docid": "be7d303560465dac982fda909aa799d9", "score": "0.50930524", "text": "function getTutorsInfo(id) {\n\tmyXHR('get', {'path':'/resources/'}).done(function(json){\n\t\tvar x ='';\n\t\tx+='<h2>'+json.tutorsAndLabInformation.title+'</h2>';\n\t\tx+='<p>'+json.tutorsAndLabInformation.description+'</p>';\n\t\tx+='<a href=\"'+json.tutorsAndLabInformation.tutoringLabHoursLink+'\">'+json.tutorsAndLabInformation.tutoringLabHoursLink+'</a>';\n\t\t$('#modal-text').html(x);\n\t\t$('#modal').iziModal('setTitle', json.title);\n $('#modal').iziModal('open');\n\t});\n}", "title": "" }, { "docid": "91b850908e87646d7336e4b7e763aa10", "score": "0.50910705", "text": "async myContent() {\n // Get nft records\n const state = await this.getContractState();\n const registerRecords = state.registeredRecord;\n // Get array of my awaitable NFTs\n const contentViewProms = [];\n for (const [txId, addr] of Object.entries(registerRecords))\n if (addr === this.address)\n contentViewProms.push(this.contentView(txId, state));\n // Process NFTs simultaneously then return\n return await Promise.all(contentViewProms);\n }", "title": "" }, { "docid": "84cf986995cffdcd9ec15f562a10fb2f", "score": "0.5088986", "text": "function get_book_info_in_bookweb(book, after) {\n //htm.struct_data_c(book.address, conv, function (html) {\n htm.struct_data(\"img-cash-\" + (a++ % 5) + \".appspot.com/converter???encode=sjis&path=\" + escape(\"http://\" + book.address), \"utf8\", function (html) {\n var list = html.cls_map[\"check-du\"];\n if (list !== undefined) {\n book.name = \"\";\n book.author = \"\";\n book.date = new Date(2000, 0, 1);\n book.publisher = \"\";\n book.preview = \"\";\n book.price = \"\";\n book.image_address = \"\";\n book.type = -1;\n book.links = [];\n book.links.push(\"bookweb.kinokuniya.co.jp\" + html.cls_map[\"pro-bname\"][0].children[0].attributes[\"href\"]);\n }\n else {\n var product = html.cls_map[\"dbooktitle\"][0];\n book.name = html.cls_map[\"font16\"][0].children[0].text;\n var p_next = product.next();\n book.author = \"\";\n for (var i = 0; ; i++) {\n if (i == p_next.children.length - 1) {\n book.publisher = p_next.children[i].text;\n break;\n }\n var text = p_next.children[i].text;\n var n = text.indexOf(\"【\");\n if (n != -1) text = text.substring(0, n);\n book.author += text;\n }\n var numbers = p_next.text.get_numbers();\n book.date = new Date(numbers[0], numbers[1] - 1, numbers[2]);\n var bk = html.cls_map[\"dtul\"];\n if (bk === undefined) book.type = 16;\n else book.type = 1;\n var pb = html.cls_map[\"pro-bname\"];\n book.price = html.cls_map[\"pro-price2\"][0].text + \"(税込)\";\n var n3 = html.data.indexOf('<div class=\"pickup_title2\"><h3>詳細</h3></div>');\n if (n3 == -1) {\n book.preview = \"\";\n }\n else {\n n3 += '<div class=\"pickup_title2\"><h3>詳細</h3></div>'.length;\n book.preview = html.data.substring(n3, html.data.indexOf('<div class=\"sp-h20\">', n3));\n }\n if (html.name_map[\"API\"] === undefined) book.free = false;\n else book.free = true;\n var dlid_0 = html.cls_map[\"dltd\"][0].children[0];\n if (dlid_0.type == \"img\") book.image_address = \"html://bookweb.kinokuniya.co.jp\" + dlid_0.attributes[\"src\"];\n else book.image_address = \"http://bookweb.kinokuniya.co.jp\" + dlid_0.children[0].attributes[\"src\"];\n book.links = [];\n if (pb !== undefined) {\n book.links.push(\"bookweb.kinokuniya.co.jp\" + pb[0].next().next().attributes[\"href\"]);\n }\n var cls = html.cls_map[\"rb2td\"];\n if (cls !== undefined) {\n for (var i = 0; i < cls.length; i++) {\n var link = cls[i].children[0].attributes[\"href\"];\n link = link.replace(\"./\", \"/guest/cgi-bin/\");\n link = link.replace(\"-1\", \"\");\n link = link.replace(\"_1\", \"\");\n link = link.replace(\"ureflg=1&\", \"\");\n book.links.push(\"bookweb.kinokuniya.co.jp\" + link);\n }\n }\n cls = html.cls_map[\"genre-r03-td01_4\"];\n if (cls !== undefined) {\n for (var i = 0; i < cls.length; i++) {\n var link = cls[i].children[0].attributes[\"href\"];\n link = link.replace(\"./\", \"/guest/cgi-bin/\");\n link = link.replace(\"-1\", \"\");\n link = link.replace(\"_1\", \"\");\n link = link.replace(\"ureflg=1&\", \"\");\n book.links.push(\"bookweb.kinokuniya.co.jp\" + link);\n }\n }\n }\n book.set_name(book.name);\n if (after === undefined) book.check();\n else {\n book.set_key();\n after(book);\n }\n });\n}", "title": "" }, { "docid": "78640fafb45098c10b5863694915f5dd", "score": "0.50871867", "text": "function showDetailsContent(selectValue) {\n var item, content, div;\n\n item = request.responseXML.getElementsByTagName(\"entry\")[selectValue];\n content = getElementTextNS(\"\", \"content\", item, 0);\n\n if (!item) {\n item = request.responseXML.getElementsByTagName(\"item\")[selectValue];\n content = getElementTextNS(\"content\", \"encoded\", item, 0);\n\n }\n\n div = document.getElementById(\"details\");\n div.innerHTML = \"\";\n // blast new HTML content into \"details\" <div>\n div.innerHTML = content;\n}", "title": "" }, { "docid": "a7a0ce4f5f589ddc5533b9ea29d9a597", "score": "0.50853115", "text": "function showDemonContent(icuitem, title, xurl) {\r\n\r\n if (xurl.indexOf(\"ct.asp\") != -1 || xurl.indexOf(\"ct_cert.asp\") != -1) {\r\n // navigator.notification.alert(\"是全球網內容頁,參數為: \" + xurl.substring(xurl.indexOf(\"?\")+1), null);\r\n var requestParam = xurl.substring(xurl.indexOf(\"?\") + 1);\r\n $.mobile.showPageLoadingMsg();\r\n $.ajax({\r\n url: servicesURL.demonCp + requestParam,\r\n type: 'GET',\r\n dataType: 'xml',\r\n timeout: System.globalTimeout,\r\n beforeSend: function () {\r\n DebugLog('before get demon cp~~');\r\n },\r\n error: function () {\r\n ErrorLog(\"query demon cp ERROR: \" + (servicesURL.demonCp + requestParam));\r\n },\r\n success: function (xml) {\r\n DebugLog('query demon cp success');\r\n },\r\n complete: function (jqx, textStatus) {\r\n\r\n DebugLog('complete:' + textStatus);\r\n if (textStatus == 'success') {\r\n \tsetOfflineXml(servicesURL.demonCp + requestParam, jqx.responseText);\r\n var xml = jqx.responseXML;\r\n var xbody = $(xml).find(\"MainArticleField > fieldName:contains('xbody')\");\r\n DebugLog(\"xbody element-->\" + xbody);\r\n var xbodyText = $(xbody).parent().find(\"Value:first\").text();\r\n DebugLog(\"xbodyText-->\" + xbodyText);\r\n\r\n var contentHtml = \"\";\r\n contentHtml += '<h1>' + title + '</h1>'\r\n + '<div name=\"xbody\">' + xbodyText + '</div>';\r\n\r\n $(\"#demonContentDetail\").html(contentHtml);\r\n $(\"#demonContentHeader\").html(demonLPTitle);\r\n $.mobile.hidePageLoadingMsg();\r\n switchPage(\"#demonContent\");\r\n } else if (textStatus == 'error' || textStatus == 'timeout') {\r\n var xml = getOfflineXml(servicesURL.demonCp + requestParam);\r\n if(xml !== null){\r\n \tvar xbody = $(xml).find(\"MainArticleField > fieldName:contains('xbody')\");\r\n DebugLog(\"xbody element-->\" + xbody);\r\n var xbodyText = $(xbody).parent().find(\"Value:first\").text();\r\n DebugLog(\"xbodyText-->\" + xbodyText);\r\n\r\n var contentHtml = \"\";\r\n contentHtml += '<h1>' + title + '</h1>'\r\n + '<div name=\"xbody\">' + xbodyText + '</div>';\r\n\r\n $(\"#demonContentDetail\").html(contentHtml);\r\n $(\"#demonContentHeader\").html(demonLPTitle);\r\n $.mobile.hidePageLoadingMsg();\r\n switchPage(\"#demonContent\");\r\n }else{\r\n \t$.mobile.hidePageLoadingMsg();\r\n \tshowServiceError();\r\n }\r\n }\r\n }\r\n });\r\n } else {\r\n ErrorLog(\"非正常業務小精靈內容頁但卻進來了!!!\" + xurl);\r\n }\r\n}", "title": "" }, { "docid": "94c3c0b532ec3a9c93c5559f72c3372b", "score": "0.5084064", "text": "function getSoundContent(soundID){\n\tvar url = 'http://www.freesound.org/apiv2/sounds/' + soundID + '/?token=';\n\tvar myURL = url + myKey;\n\t$.ajax({\n\t\turl: myURL,\n\t\ttype: 'GET',\n\t\tdataType: 'json',\n\t\terror: function(data){\n\t\t\tconsole.log(\"We got problems\");\n\t\t\tconsole.log(data.status);\n\t\t},\n\t\tsuccess: function(data){\n\t\t\tconsole.log(\"WooHoo 2!\");\n\t\t\tconsole.log(data);\n\t\t\tvar audioLink = data.previews['preview-hq-mp3'];\n\t\t\tconsole.log(audioLink);\n\t\t\t//return;\n\t\t\tmakeAudioRequest(audioLink);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "132e8596e736c618733f976ceb745b07", "score": "0.50764567", "text": "function ScrapDetails($sub_page){\r\n // ********** MAKE THIS GENERIC ***************** //\r\n\r\n // AMAZON INDIA\r\n\r\n var data = {\r\n product_link : linkPage.link,\r\n name : $sub_page(\"#title\").text().replace(/[\\n\\t\\r]/g,\"\").trim(),\r\n price : $sub_page(\"#priceblock_ourprice\").text().replace(/[\\n\\t\\r]/g,\"\").trim(),\r\n image : $sub_page(\"#landingImage\").attr(\"src\"),\r\n description : $sub_page(\"#feature-bullets\").text().replace(/[\\n\\t\\r]/g,\"\").trim()\r\n }\r\n\r\n // ALI EXPRESS\r\n/* \r\n var temp_data = $sub_page('#j-detail-gallery-main script').get()[0].children[0].data ;\r\n var images_string=temp_data.substring(temp_data.lastIndexOf(\"[\")+1,temp_data.lastIndexOf(\"]\"));\r\n var data = {\r\n product_link : linkPage.link,\r\n name : $sub_page(\".detail-main .product-name\").text().replace(/[\\n\\t\\r]/g,\"\").trim(),\r\n price : $sub_page(\"#j-sku-price\").text().replace(/[\\n\\t\\r]/g,\"\").trim(),\r\n rating : $sub_page(\".percent-num\").text().replace(/[\\n\\t\\r]/g,\"\").trim(),\r\n images : images_string.replace(/[\\n\\t\\r]/g,\"\").trim(),\r\n brnad_name : $sub_page(\"#product-prop-2 .propery-des\").text().replace(/[\\n\\t\\r]/g,\"\").trim(),\r\n type : $sub_page(\"#product-prop-351 .propery-des\").text().replace(/[\\n\\t\\r]/g,\"\").trim(),\r\n benefit : $sub_page(\"#product-prop-200001174 .propery-des\").text().replace(/[\\n\\t\\r]/g,\"\").trim(),\r\n formulation : $sub_page(\"#product-prop-200001170 .propery-des\").text().replace(/[\\n\\t\\r]/g,\"\").trim(),\r\n size : $sub_page(\"#product-prop-491 .propery-des\").text().replace(/[\\n\\t\\r]/g,\"\").trim(),\r\n sublock : $sub_page(\"#product-prop-200001185 .propery-des\").text().replace(/[\\n\\t\\r]/g,\"\").trim(),\r\n net_weight : $sub_page(\"#product-prop-200000581 .propery-des\").text().replace(/[\\n\\t\\r]/g,\"\").trim(),\r\n skin_type : $sub_page(\"#product-prop-200001171 .propery-des\").text().replace(/[\\n\\t\\r]/g,\"\").trim(),\r\n packagin_details : $sub_page(\"#j-product-desc .product-packaging-list\").text().replace(/[\\n\\t\\r]/g,\"\").trim(),\r\n description_text : $sub_page(\".description-content\").text().replace(/[\\n\\t\\r]/g,\"\").trim(),\r\n\r\n }*/\r\n console.log(data);\r\n main_details.push(data);\r\n}", "title": "" }, { "docid": "6be4357e48c941c28c37dd4500398cc7", "score": "0.5073121", "text": "function itemContent(item) {\n if (item.pr !== undefined) {\n return ['<strong>PR#', item.pr, '</strong>'].join(' ');\n } else if (item.branch !== undefined){\n return ['<strong>Branch:', item.branch, '</strong>'].join(' ');\n } else {\n throw new Error('Can\\'t read version\\'s identifier');\n }\n}", "title": "" }, { "docid": "2eff01c2f75456fe23af3a5a75181dad", "score": "0.50724757", "text": "async getBizHeadlines() {\n const response = await fetch(`${newsAPIurl}/search?apiKey=${newsAPIKey}&domain=cnbc.com,wsj.com&country=us&category=business`)\n const result = await response.json()\n return result\n }", "title": "" }, { "docid": "550b08416ebb23120ff7ab11bf751652", "score": "0.50723463", "text": "async function fetchStoreInformation() {\n let url\n if (country.toLowerCase() === 'at') {\n url = 'https://store-data-service.services.dmtech.com/stores/item/at/' + storeId\n widget.url = 'https://www.dm.at/search?query=toilettenpapier&searchType=product'\n } else {\n url = 'https://store-data-service.services.dmtech.com/stores/item/de/' + storeId\n widget.url = 'https://www.dm.de/search?query=toilettenpapier&searchType=product'\n }\n let req = new Request(url)\n let apiResult = await req.loadJSON()\n return apiResult\n}", "title": "" }, { "docid": "b9d2eaa9d3e019c7ebcc6a409b7372ae", "score": "0.50720215", "text": "function source(data){\n let url = \"http://www.bea.gov/national/pdf/nipaguid.pdf\"\n let item = document.createElement(\"a\");\n item.innerHTML = data.description\n item.className = \"source\";\n item.href = url;\n let title = document.getElementById('card')\n title.appendChild(item)\n }", "title": "" }, { "docid": "4244ae5c0a0d8f8e72877d50e09ea8ad", "score": "0.5064532", "text": "function IQ_GetContentForMetaTag(metatag, JSONCallback){\n\n\tvar url = urlPrefix + \"nsIQHandler.ashx?cmd=findcontentformetatag&metatag=\" + metatag;\n\n\t// make the query to the server\n\tIQ_AjaxCall(url, JSONCallback);\n\n}", "title": "" }, { "docid": "586eae205651811ed396e2c6f9eb4dbc", "score": "0.5063449", "text": "function retrievePageContent(callback) {\n\tvar params = {\n\t RequestItems: {\n\t bethepeople: {\n\t Keys: [\n\t {pagename: {S: 'about'}},\n\t {pagename: {S: 'chapters'}},\n\t \t{pagename: {S: 'contact'}}\n\t ]\n\t }\n\t }\n\t};\n\n\tddb.scan({TableName: 'bethepeople'}, function(err, data) {\n\t\tif (err) {\n\t\t\tconsole.log(err);\n\t\t} else {\n\t\t var res = data.Items;\n\t\t res.sort(function(a, b) {\n\t\t return a.pagename.S > b.pagename.S;\n\t\t });\n\t \tvar result = {\n\t \t\tabout: res[0].content.L,\n\t \t\tbackgrounds: res[1].content.L,\n\t \t\tchapters: res[2].content.L,\n\t \t\tcontact: res[3].content.L\n\t \t}\n\t callback({status: 'success', data: result});\n\t\t}\n\t});\n}", "title": "" }, { "docid": "dea8caa3ccd2ba67f6bc436179d17a91", "score": "0.5058096", "text": "async fetchDescription() {\n let response = await fetch(\"https://dittejohannejustesen.dk/wordpress/wordpress-cfh/wp-json/wp/v2/posts?_embed&categories=2&per_page=17\")\n this.descriptions = await response.json();\n }", "title": "" }, { "docid": "310bcbe51118d37d6b53bd9ab72c170c", "score": "0.505276", "text": "getSupportInformation() {\n const query = {};\n\n return APIClient.execute(\n this._conf,\n \"get\",\n `/service/application/content/v1.0/support`,\n query,\n {}\n );\n }", "title": "" }, { "docid": "a3f7c5cfb74d75f5cc86d73177742042", "score": "0.5048355", "text": "async function getInfo() {\n const response = await fetch('https://syscontrol.azurewebsites.net/FLH/buscarPorNomTel?nombre=' + text + '');\n const invitado = await response.json();\n return invitado;\n }", "title": "" }, { "docid": "7530ca88432d3756380e5609eabf1547", "score": "0.5045965", "text": "function getTextContent(graphic) {\n \n var content;\n content = \"<br/>SCHEME:&nbsp \" + graphic.attributes.scheme;\n content += \"<br/>DISTRICT:&nbsp \" + graphic.attributes.district;\n content += \"<br/>REGION:&nbsp \" + graphic.attributes.region;\n content += \"<br/>AGRICULTURAL DEVELOPMENT DIVISION:&nbsp \" + graphic.attributes.ADD_Name;\n content += \"<br>EXTENSION PLANNING AREA:&nbsp \" + graphic.attributes.epa;\n content += \"<br>CATCHMENT:&nbsp \" + graphic.attributes.catchment;\n content += \"<br>ALTITUDE(M):&nbsp \" + graphic.attributes.altitude_m;\n content += \"<br>DESCRIPTION:&nbsp \" + graphic.attributes.description;\n content += \"<br>AREA(Ha):&nbsp \" + graphic.attributes.area_ha;\n return content;\n }", "title": "" }, { "docid": "492a525b8bf77ba6e89a3b2bd3f0053f", "score": "0.50452924", "text": "function showDemonContent(icuitem, title, xurl) {\n \n if(xurl.indexOf(\"ct.asp\") != -1 || xurl.indexOf(\"ct_cert.asp\") != -1){\n// navigator.notification.alert(\"是全球網內容頁,參數為: \" + xurl.substring(xurl.indexOf(\"?\")+1), null);\n var requestParam = xurl.substring(xurl.indexOf(\"?\")+1);\n $.ajax({\n url: servicesURL.demonCp + requestParam,\n type: 'GET',\n dataType: 'xml',\n timeout: System.globalTimeout,\n beforeSend: function() {\n DebugLog('before get demon cp~~'); \n },\n error: function() {\n ErrorLog(\"query demon cp ERROR: \" + (servicesURL.demonCp + requestParam));\n },\n success: function(xml) {\n DebugLog('query demon cp success');\n },\n complete: function(jqx, textStatus) {\n DebugLog('complete:' + textStatus);\n \n if(textStatus === 'success'){\n \tvar xml = jqx.responseXML;\n \tsetOfflineXml(servicesURL.demonCp + requestParam, jqx.responseText);\n var xbody = $(xml).find(\"MainArticleField > fieldName:contains('xbody')\");\n DebugLog(\"xbody element-->\" + xbody);\n var xbodyText = $(xbody).parent().find(\"Value:first\").text();\n //DebugLog(\"xbodyText-->\" + xbodyText);\n console.log(\"xbodyText-->\" + xbodyText);\n var contentHtml = \"\";\n contentHtml += '<h1>' + title + '</h1>'\n + '<div name=\"xbody\">' + xbodyText + '</div>';\n \n $(\"#demonContentDetail\").html(contentHtml);\n $(\"#demonContentHeader\").html(demonLPTitle);\n switchPage(\"#demonContent\");\n }else if(textStatus === 'timeout' || textStatus ==='error'){\n \tvar xml = getOfflineXml(servicesURL.demonCp + requestParam);\n \tif(xml !== null){\n \t\tvar xbody = $(xml).find(\"MainArticleField > fieldName:contains('xbody')\");\n DebugLog(\"xbody element-->\" + xbody);\n var xbodyText = $(xbody).parent().find(\"Value:first\").text();\n //DebugLog(\"xbodyText-->\" + xbodyText);\n console.log(\"xbodyText-->\" + xbodyText);\n var contentHtml = \"\";\n contentHtml += '<h1>' + title + '</h1>'\n + '<div name=\"xbody\">' + xbodyText + '</div>';\n \n $(\"#demonContentDetail\").html(contentHtml);\n $(\"#demonContentHeader\").html(demonLPTitle);\n switchPage(\"#demonContent\");\n \t}else{\n \t\tshowServiceError();\n \t}\n }\n }\n });\n } else {\n ErrorLog(\"非正常業務小精靈內容頁但卻進來了!!!\" + xurl);\n }\n}", "title": "" }, { "docid": "144fa659aca9a369dc58a5fbbfb6b804", "score": "0.50442874", "text": "function license_details(agent) {\n return licenseFetchCall(['license_details'])\n .then( function( message ){\n agent.add(message);\n return Promise.resolve();\n })\n .catch( function( err ){\n agent.add(`Uh oh, something happened.`);\n return Promise.resolve(); // Don't reject again, or it might not send the reply\n });\n }", "title": "" }, { "docid": "9bfa378eca415f719df785f0851bb37c", "score": "0.5044071", "text": "async getFull() {\n return this.$GoAbout.getProductOrSubscription({ url: this.getLink('self') })\n }", "title": "" }, { "docid": "c4d783ffa25a04a72ab9d8d84f60527a", "score": "0.5043518", "text": "function getPeopleInfo(url) {\n return fetch(url)\n .then(response => response.json())\n .then(data => {\n galleryHTML(data.results);\n modalAppear(data.results);\n })\n .catch(err => console.log(\"Error Fetching Random People: \", err)); //catches error if the API has failed to process;\n}", "title": "" }, { "docid": "0f732aa0b39e370adce29c9533f65214", "score": "0.5039757", "text": "async function getContact() {\n\tconsole.log(\"Kontakt info \");\n\tlet pagesURL = \"http://widespace.dk/MET-WP/wp-json/wp/v2/kontakt/114\";\n\tlet jsonData = await fetch(pagesURL);\n\tlet section = await jsonData.json();\n\tinsertContact(section);\n}", "title": "" }, { "docid": "d7c49a7ba26e2b2c694daf870e0f869d", "score": "0.5037768", "text": "function videoSelected(vid){\n var request = gapi.client.youtube.videos.list({\n id: vid,\n onBehalfOfContentOwner: 'mlbam',\n part: 'id,contentDetails,snippet,statistics,status,player'\n });\n\n request.execute(function(response) {\n \n $('#player').html(response.result.items[0].player.embedHtml + '<br><br>');\n\n var contentdetails_html = '<b>Title: </b>' + response.result.items[0].snippet.title;\n contentdetails_html += '<br><b>Channel: </b>' + response.result.items[0].snippet.channelTitle;\n contentdetails_html += '<br><b>Video ID: </b>' + response.result.items[0].id;\n contentdetails_html += '<br><b>Published At: </b>' + new Date(response.result.items[0].snippet.publishedAt).toString();\n \n contentdetails_html += '<br><b>Duration: </b>' + response.result.items[0].contentDetails.duration;\n contentdetails_html += '<br><b>Dimension: </b>' + response.result.items[0].contentDetails.dimension;\n contentdetails_html += '<br><b>Definition: </b>' + response.result.items[0].contentDetails.definition; \n contentdetails_html += '<br><b>Caption: </b>' + response.result.items[0].contentDetails.caption; \n contentdetails_html += '<br><b>Licensed Content: </b>' + response.result.items[0].contentDetails.licensedContent; \n \n console.log (response.result.items[0].contentDetails);\n if ('regionRestriction' in response.result.items[0].contentDetails) {\n \n contentdetails_html += '<br><b>Region Restriction: </b> Allowed:' + response.result.items[0].contentDetails.regionRestriction.allowed; \n contentdetails_html += '<br><b>Region Restriction: </b> Blocked:' + response.result.items[0].contentDetails.regionRestriction.blocked; \n \n }\n else {\n \t//contentdetails_html += '<br><b>Region Restriction: </b> none'; \n //contentdetails_html += '<br><b>Region Restriction: </b> Allowed:' + response.result.items[0].contentDetails.regionRestriction.allowed; \n //contentdetails_html += '<br><b>Region Restriction: </b> Blocked:' + response.result.items[0].contentDetails.regionRestriction.blocked; \n \n }\n\t\n \n \n \n $('#contentdetails').html(contentdetails_html);\n \n \n $('#description').html(response.result.items[0].snippet.description);\n\n $('#tags').text(response.result.items[0].snippet.tags);\n\n\t//console.log(response);\n channelId = response.result.items[0].snippet.channelId;\n //displayVideoAnalytics(vid);\n \n var stats_html = 'View Count: ' + response.result.items[0].statistics.viewCount;\n stats_html += '<br>Like Count: ' + response.result.items[0].statistics.likeCount;\n stats_html += '<br>Comment Count: ' + response.result.items[0].statistics.commentCount; \n $('#statistics').html(stats_html);\n\n var status_html = 'Upload Status: ' + response.result.items[0].status.uploadStatus;\n status_html += '<br>Privacy Status: ' + response.result.items[0].status.privacyStatus;\n status_html += '<br>License: ' + response.result.items[0].status.license; \n status_html += '<br>embeddable: ' + response.result.items[0].status.embeddable; \n status_html += '<br>Public Stats Viewable: ' + response.result.items[0].status.publicStatsViewable; \n \n $('#status').html(status_html);\n \n var contentid_html = 'Content Owner: ' + contentOwner;\n\n \n var requestOptions = {\n\t q: vid,\n\t onBehalfOfContentOwner: contentOwner\n };\n var request = gapi.client.youtubePartner.claimSearch.list(requestOptions);\n request.execute(function(response) {\n \t if ('error' in response) {\n\t\talert('claimSearch list error: ' + response.error.message);\n\t } else {\n var num = response.result.pageInfo.totalResults;\n\t contentid_html += '<br>Number of Claims on video: ' + num;\n\t if (num > 0) {\n\t\t contentid_html += '<br>id first claim: ' + response.result.items[0].id;\n\t\t contentid_html += '<br>status first claim: ' + response.result.items[0].status;\n\t\t contentid_html += '<br>Type of Claim: ' + response.result.items[0].contentType;\t \n\t\t\n\t\t var claimDate = new Date (response.result.items[0].timeCreated); \n\n\t contentid_html += '<br>Claim created: ' + claimDate.toDateString();\t\n\t } \t \n\t }\n\t$('#contentid').html(contentid_html);\n });\n });\n}", "title": "" } ]
19ed42199c4bc57a36f0e1058fa6ce1f
Find the deepest React component completely containing the root of the passedin instance (for use when entire React trees are nested within each other). If React trees are not nested, returns null.
[ { "docid": "e994ce5cd24cd19d4ccf8e70a46b9ade", "score": "0.0", "text": "function findParent(inst) {\n\t // TODO: It may be a good idea to cache this to prevent unnecessary DOM\n\t // traversal, but caching is difficult to do correctly without using a\n\t // mutation observer to listen for all DOM changes.\n\t while (inst._hostParent) {\n\t inst = inst._hostParent;\n\t }\n\t var rootNode = ReactDOMComponentTree.getNodeFromInstance(inst);\n\t var container = rootNode.parentNode;\n\t return ReactDOMComponentTree.getClosestInstanceFromNode(container);\n\t}", "title": "" } ]
[ { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.68767685", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.68767685", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.68767685", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.68767685", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.68767685", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.68767685", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.68767685", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.68767685", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.68767685", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.68767685", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.68767685", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.68767685", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.68767685", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.68767685", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.679824", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.679824", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.679824", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.679824", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.679824", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.679824", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.679824", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.679824", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.679824", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.679824", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.679824", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.679824", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.679824", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.679824", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.679824", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.679824", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6787811", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6787811", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6787811", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6787811", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6787811", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6787811", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6787811", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "8a373da0e0bd6f7fe31e93117fccae55", "score": "0.67798924", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}return null;}", "title": "" }, { "docid": "8a373da0e0bd6f7fe31e93117fccae55", "score": "0.67798924", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}return null;}", "title": "" }, { "docid": "8a373da0e0bd6f7fe31e93117fccae55", "score": "0.67798924", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}return null;}", "title": "" }, { "docid": "8a373da0e0bd6f7fe31e93117fccae55", "score": "0.67798924", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}return null;}", "title": "" }, { "docid": "86e2e644ec53d43740b33cc4a83ed598", "score": "0.67581457", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n }", "title": "" }, { "docid": "86e2e644ec53d43740b33cc4a83ed598", "score": "0.67581457", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n }", "title": "" }, { "docid": "86e2e644ec53d43740b33cc4a83ed598", "score": "0.67581457", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n }", "title": "" }, { "docid": "f533a3e28befce94feff334e5c712660", "score": "0.6751699", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n }", "title": "" }, { "docid": "3bd949fd6bdf752ee3455d5957d12976", "score": "0.67239153", "text": "function findFirstReactDOMImpl(node) {\n\t\t // This node might be from another React instance, so we make sure not to\n\t\t // examine the node cache here\n\t\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t\t if (node.nodeType !== 1) {\n\t\t // Not a DOMElement, therefore not a React component\n\t\t continue;\n\t\t }\n\t\t var nodeID = internalGetID(node);\n\t\t if (!nodeID) {\n\t\t continue;\n\t\t }\n\t\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\t\n\t\t // If containersByReactRootID contains the container we find by crawling up\n\t\t // the tree, we know that this instance of React rendered the node.\n\t\t // nb. isValid's strategy (with containsNode) does not work because render\n\t\t // trees may be nested and we don't want a false positive in that case.\n\t\t var current = node;\n\t\t var lastID;\n\t\t do {\n\t\t lastID = internalGetID(current);\n\t\t current = current.parentNode;\n\t\t if (current == null) {\n\t\t // The passed-in node has been detached from the container it was\n\t\t // originally rendered into.\n\t\t return null;\n\t\t }\n\t\t } while (lastID !== reactRootID);\n\t\t\n\t\t if (current === containersByReactRootID[reactRootID]) {\n\t\t return node;\n\t\t }\n\t\t }\n\t\t return null;\n\t\t}", "title": "" }, { "docid": "aaa987d8516662470bc3d2ebcb5c040e", "score": "0.66982824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n }\n else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n return null;\n }", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.6667359", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" } ]
b0d649ee5e81aabb20f6f157b1d8b8a0
TO DO: Maybe finished query batching
[ { "docid": "abf5424781086b517fe235353157331f", "score": "0.6456513", "text": "willBatch(query) {\n const now = Date.now();\n if (this.io_stats.since < Date.now()) {\n this.io_stats.since = Date.now();\n this.io_stats.queries = 0;\n }\n else {\n this.io_stats.queries++;\n }\n if (this.io_stats.queries > this.io_stats.throttle_queries_per_sec) {\n return true;\n }\n }", "title": "" } ]
[ { "docid": "99f066f0c7f4996826d9dfdac7ad8b06", "score": "0.6895774", "text": "function next() {\n\n if (pointer >= amount)\n return callback(false, bulk);\n\n var amountParams = bulk[pointer].params.length;\n\n bulk[pointer].batches = new Array();\n\n var i, j;\n for (i = 0, j = bulk[pointer].params.length; i < j; i += limitOfBatch) {\n bulk[pointer].batches.push(bulk[pointer].params.slice(i, i + limitOfBatch));\n }\n\n var amountBatches = bulk[pointer].batches.length;\n var pointerBatches = 0;\n\n console.log(\"Bulk number: \" + (pointer + 1) + \" of \" + amount);\n console.log(\"Amount queries: \" + amountParams + \" limitOfBatch: \" + limitOfBatch);\n console.log(\"Amount batches: \" + amountBatches);\n\n function nextBatch() {\n if (pointerBatches >= amountBatches) {\n pointer++;\n next();\n } else {\n\n db.query(bulk[pointer].sql, [bulk[pointer].batches[pointerBatches]], function (err) {\n if (err) return callback(err);\n pointerBatches++;\n console.log(\"Sql batch complete: \" + pointerBatches + \" of \" + amountBatches);\n nextBatch();\n });\n }\n }\n nextBatch();\n }", "title": "" }, { "docid": "ca12c96b170e18b940d67bd960a8dfb9", "score": "0.68616647", "text": "function executeBatch () {\n try {\n batchStartTime = (new Date()).getTime();\n\n var currentPayloadsBatch = payloadsArray.splice(0, batchSize);\n\n if (currentPayloadsBatch.length > 0) {\n //process the batch\n var promisesBatch = currentPayloadsBatch.map(promiseFactory);\n Q.allSettled(promisesBatch)\n .then(function (results) {\n aggregatedResults = aggregatedResults.concat(results);\n\n attemptExecution(executeBatch);\n })\n .catch(function(reason) {\n /**\n * The failed batch wil be added to results with the failure reason\n */\n currentPayloadsBatch.forEach(function (payload) {\n aggregatedResults.push({ payload: payload, reason: reason, success: false });\n });\n\n attemptExecution(executeBatch);\n });\n\n } else {\n /**\n * Prepare the result\n * @type {Array}\n */\n aggregatedResults = aggregatedResults.map(function(result) {\n return (result && result.value) ? result.value : result.reason;\n });\n deferred.resolve(aggregatedResults);\n }\n\n } catch (error) {\n console.log('ERROR: ', error.toString());\n }\n\n }", "title": "" }, { "docid": "c84902482226f2fdf3ad8f054bc903db", "score": "0.68164605", "text": "function runBatchGets(batch) {\r\n\r\n return doBatchGet(batch)\r\n .then(data => {\r\n\r\n let success = data.Responses[tableName];\r\n let failed = data.UnprocessedKeys[tableName];\r\n\r\n buffer.items.push(...filterFunction(success));\r\n _.pullAll(buffer.nextKeys, success.map(item => item.id))\r\n\r\n if (failed && failed.length > 0) {\r\n return runBatchGets(failed.map(item => item[keyString]));\r\n }\r\n\r\n if (buffer.nextKeys.length <= 0) {\r\n return buffer;\r\n }\r\n\r\n return runBatchGets(buffer.nextKeys.slice(0, BATCH_LIMIT));\r\n });\r\n\r\n }", "title": "" }, { "docid": "4d9015e7ea75f1b91787462c8965527e", "score": "0.66027313", "text": "async prepareData(data) {\n if (!isArray(data)) {\n data = [data];\n }\n\n const batches = [];\n const batchSize = this.options.batchSize;\n let currentBatch = [];\n let fieldCount;\n\n await Promise.all(\n data.map(async (data) => {\n const instance = this.getInstance(data);\n const row = await this.getRow(instance);\n const rowFieldCount = Object.values(row).length;\n\n if (fieldCount === undefined) {\n fieldCount = rowFieldCount;\n } else if (fieldCount !== rowFieldCount) {\n throw new this.constructor.QueryError(\n `${this.model.name}: all objects for ${\n this.config.forUpdate ? 'update' : 'insert'\n } should have the same number of fields`\n );\n }\n\n if (batchSize) {\n if (currentBatch.length >= batchSize) {\n batches.push(currentBatch);\n currentBatch = [row];\n } else {\n currentBatch.push(row);\n }\n } else {\n currentBatch.push(row);\n }\n })\n );\n\n if (currentBatch.length) {\n batches.push(currentBatch);\n }\n\n return batches;\n }", "title": "" }, { "docid": "c4c69261411c4f11decb5020b3801c4b", "score": "0.6589266", "text": "prepareUpdateBatch(batch) {\n return this.sql.update(this.getTable(), batch[0]);\n }", "title": "" }, { "docid": "802e0fbd3de3cbbac223a1f0e8f5f656", "score": "0.65381", "text": "async batchMinedPayments( )\n {\n var self = this ;\n\n var unbatched_pmnts = await self.mongoInterface.findAll('balance_payment',{batchId: null})\n\n\n var batchedPayments = 0;\n\n\n const MIN_PAYMENTS_IN_BATCH = 5; //5\n\n if( unbatched_pmnts.length >= MIN_PAYMENTS_IN_BATCH)\n {\n\n\n var batchData = {\n id: web3utils.randomHex(32),\n confirmed: false\n }\n\n await self.mongoInterface.upsertOne('payment_batch',{id: batchData.id}, batchData )\n\n\n\n var paymentsToBatch = unbatched_pmnts.slice(0,25) //max to batch is 25\n\n for( var element of paymentsToBatch ) {\n\n element.batchId = batchData.id;\n\n await self.mongoInterface.upsertOne('balance_payment',{id: element.id}, element )\n\n batchedPayments++;\n\n }\n\n\n }\n\n return {success:true,batchedPayments:batchedPayments} ;\n }", "title": "" }, { "docid": "f3124bb603adab4c7cc298258f12372b", "score": "0.6532759", "text": "complete(results, file) {\n const bytesUsed = results.meta.cursor;\n // Ensure any final (partial) batch gets emitted\n const batch = tableBatchBuilder.getBatch({bytesUsed});\n if (batch) {\n asyncQueue.enqueue(batch);\n }\n asyncQueue.close();\n }", "title": "" }, { "docid": "c2f0bcb08c924b66e94e4e422fa4c675", "score": "0.6436628", "text": "function startBatchTransaction() {}", "title": "" }, { "docid": "19d047ddc77047aed71f02c3852d5b5b", "score": "0.63703066", "text": "async function processResults(poolQuery, results) {\n for (let i = 0; i < results.length; i += rowSplit) {\n const insert = await createInsert(results, i, rowSplit, table, staticParam, poolQuery, existsAttr);\n console.log(insert);\n try {\n const records = await poolQuery(insert);\n console.dir(records);\n } catch (e) { console.log(e); }\n }\n }", "title": "" }, { "docid": "0611aa088c9c0343203dbdcfed230f89", "score": "0.63630533", "text": "async function batch(...args) {\n const [query, options, callback] = pull(args)\n if (config.simpleid) flipid(query)\n parseOptions(options)\n\n const size = options.size || config.batchsize\n delete options.size\n\n // Fetch ids\n const all = await find(query, {\n sort: options.sort,\n limit: options.limit,\n fields: { id: 1 }\n })\n\n const total = all.length\n const pages = parseInt(total / size) + 1\n\n let count = 0\n for (let page = 1; page <= pages; page++) {\n const ids = all.slice(count, page * size).map((x) => x.id)\n const result = await find(\n { id: { $in: ids } },\n {\n sort: options.sort,\n fields: options.fields\n }\n )\n denullify(result)\n if (config.simpleid) flipid(result, true)\n count += result.length\n if (typeof callback == 'function') {\n const percent = ((page / pages) * 100).toFixed(2)\n await callback(result, {\n total,\n page,\n pages,\n count,\n percent\n })\n }\n }\n }", "title": "" }, { "docid": "a938ef4716f28c9d5f553bbf64273e42", "score": "0.6222375", "text": "function batch_rec(batches, userid_table, count, connection, callback) {\n if (batches && batches.length) {\n batch(batches[0], userid_table, count, connection, (err) => {\n if (err) {\n callback(err)\n } else {\n batches.shift()\n count ++\n return batch_rec(batches, userid_table, count, connection, callback)\n }\n })\n } else {\n callback(null)\n }\n}", "title": "" }, { "docid": "08282cace063e477ff6cb2b79b7eed6f", "score": "0.62165666", "text": "async fetchAllRowsAndWriteIntoLocalFile() {\n\t\t\tconst oThis = this;\n\n\t\t\tlet lastProcessTime = await oThis.fetchLastProcessTime();\n\n\t\t\tconsole.info(oThis.model.tableName, \"- lastProcessTime-\", lastProcessTime);\n\n\t\t\tlet r = await oThis.fetchTotalRowCountAndMaxUpdated({lastProcessTime: lastProcessTime});\n\n\n\t\t\tlet totalRowCount = r[0].totalRowCount || 0;\n\t\t\tlet maxUpdatedAtStr = r[0].maxUpdatedAt || lastProcessTime;\n\n\t\t\tconsole.info(oThis.model.tableName, \"- totalRowCount-\", totalRowCount);\n\t\t\tconsole.info(oThis.model.tableName, \"- maxUpdatedAtStr-\", maxUpdatedAtStr);\n\n\t\t\tif (totalRowCount == 0){\n\t\t\t\treturn responseHelper.successWithData({hasRows: false});\n\t\t\t}\n\n\t\t\tshell.mkdir(\"-p\", oThis.localDirFullFilePath);\n\n\t\t\tlet perBatchSize = Math.ceil(totalRowCount/(oThis.mysqlLimit * oThis.parallelProcessCount));\n\n\t\t\tlet startOffset = 0;\n\t\t\tlet endOffset = 0;\n\n\t\t\tlet promiseArray = [];\n\t\t\tfor(let batchNumber=1; batchNumber <= oThis.parallelProcessCount; batchNumber++){\n\t\t\t\tendOffset = startOffset + (oThis.mysqlLimit * perBatchSize);\n\t\t\t\tlet params = {\n\t\t\t\t\tstartOffset: startOffset, endOffset: endOffset,\n\t\t\t\t\tlastProcessTime: lastProcessTime, batchNumber: batchNumber\n\t\t\t\t};\n\t\t\t\tlet r = oThis.fetchDetailsAndWriteIntoLocalFile(params);\n\t\t\t\tpromiseArray.push(r);\n\t\t\t\tif(endOffset >= totalRowCount){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tstartOffset = endOffset;\n }\n\n await Promise.all(promiseArray).catch((err)=>{\n \treturn Promise.reject(err);\n\t\t\t});\n\t\t\treturn responseHelper.successWithData({hasRows: true, maxUpdatedAtStr: maxUpdatedAtStr});\n\t }", "title": "" }, { "docid": "1e819d925e3977c09d2062c622534078", "score": "0.62134117", "text": "function processBatch() {\n var self = this;\n db = require('monk')('');\n self.doBatch();\n}", "title": "" }, { "docid": "ea13b6f5314d9174fa6aecf78f5e6fc1", "score": "0.6179316", "text": "writeBatch(callback: WriteCallback): void {\n const batch = this.batch;\n // reset the instance batch\n this.batch = [];\n const tx = this.db.transaction(this.objectStore, \"readwrite\");\n const store = tx.objectStore(this.objectStore);\n for (const item of batch) {\n const toInsert = this.options.extra ? { ...item, ...this.options.extra } : item;\n store.put(toInsert);\n }\n // use setTimeout to yield the thread a bit - even with their quasi-asyncness\n // node streams can sometimes cause a bit too much throughput pressure on writes\n tx.complete.then(() => setTimeout(callback, 1)).catch(callback);\n }", "title": "" }, { "docid": "c5594bd63e4b5551edd08bc62ab6b750", "score": "0.6162951", "text": "function insertAndGetBatch() {\n var docs = [];\n ['foo', 'bar', 'la', 'bamba'].forEach(function (val) {\n docs.push({value: val});\n });\n\n return dataDb.saveAsync(docs)\n .then(function () {\n return dataDb.viewAsync('data/byValue', {keys: ['foo', 'bar'], limit: 10});\n });\n}", "title": "" }, { "docid": "3833a42ecbffe2346146505c3d2a3741", "score": "0.61042655", "text": "static async commitBatch(batch) {\n return batch.commit();\n }", "title": "" }, { "docid": "71fa8537f8105bb4826b0d893934e7bd", "score": "0.601653", "text": "function doBatchWrite(batch) {\r\n\r\n let requestBatch = batch.map(function (item) {\r\n return {\r\n PutRequest: {\r\n Item: item\r\n }\r\n };\r\n });\r\n\r\n let params = {\r\n RequestItems: {}\r\n };\r\n\r\n params.RequestItems[tableName] = requestBatch;\r\n\r\n return new Promise((resolve, reject) => {\r\n setTimeout(() => {\r\n const toResolve = docClient.batchWrite(params).promise()\r\n .then(data => {\r\n return data;\r\n });\r\n\r\n resolve(toResolve)\r\n }, writeDelay);\r\n })\r\n }", "title": "" }, { "docid": "d1c02fcabb734edc71db986c27610428", "score": "0.59960985", "text": "async batch (items) {\n try {\n for (const item of items) item.id = this.getNextRequestId++\n\n const data = await makeHTTPRequest(this.opts, JSON.stringify(items))\n const batch = JSON.parse(data)\n if (!Array.isArray(batch)) throw new Error(JSON.stringify(batch))\n\n const itemsById = lodash.keyBy(items, 'id')\n for (const { result, error, id } of batch) {\n const { resolve, reject } = itemsById[id]\n if (error) reject(Object.assign(new Error(error.message || error.code), { code: error.code }))\n else if (result === undefined) reject(new TypeError('Missing RPC result'))\n else resolve(result)\n }\n } catch (e) {\n if (e.message === 'Internal server error') {\n return this.batch(items)\n }\n throw e\n }\n }", "title": "" }, { "docid": "5b458364bb985d48b134288aeca04c4d", "score": "0.5964902", "text": "static async createBatch() {\n return admin.firestore().batch();\n }", "title": "" }, { "docid": "4a851b58c91b5a0aacab9841f0e7f70d", "score": "0.5895714", "text": "_bulkSave() {\n let { _saveQueue: saveQueue } = this;\n\n let promises = array();\n for (let i in saveQueue) {\n promises.push(this.add(i, saveQueue[i]));\n saveQueue[i] = array();\n }\n\n return Promise.all(promises, 'indexedDb/_bulkSave');\n }", "title": "" }, { "docid": "658aaed0d1a5ddf3cfecd6de44a2aab9", "score": "0.5892379", "text": "function batch_sync(batches, userid_table, connection, callback) {\n async.waterfall([\n // Process the files and insert into userid_table\n function process(cb) {\n batch_rec(batches, userid_table, 0, connection, (err) => {\n if (err) {\n callback(err)\n } else {\n callback(null)\n }\n })\n },\n // Aggregate errors from userid_table\n function select(cb) {\n let cols = []\n for (rf of relevant_fields) {\n cols.push(rf)\n }\n cols.push('hash')\n cols.push('userid')\n const cols_string = comma(cols)\n const select_query = \"SELECT *, SUM(count) AS count FROM \" + userid_table + \" GROUP BY \" + cols_string\n \n connection.query(select_query, (err, result, fields) => {\n if (err) {\n cb(err)\n } else {\n cb(null, result)\n }\n })\n },\n // Flush userid_table\n function del(output, cb) {\n const delete_query = \"DELETE FROM \" + userid_table\n connection.query(delete_query, (err, result) => {\n if (err) {\n console.log('Error flushing: ' + userid_table)\n cb(err)\n } else {\n console.log('Flushed: ' + userid_table)\n cb(null, output)\n }\n })\n },\n // Insert aggregated errors into userid_table\n function insert(output, cb) {\n insert_table(output, userid_table, connection, (err) => {\n if (err) {\n console.log('Error aggregating errors in: ' + userid_table)\n cb(err)\n } else {\n console.log('Aggregated ' + output.length + ' errors into: ' + userid_table)\n cb(null, output)\n }\n })\n },\n ], \n function (err, result) {\n if (err) {\n callback(err)\n } else {\n callback(null, result)\n }\n })\n}", "title": "" }, { "docid": "b6db70d44eda639e5c19a41250f7d572", "score": "0.58896005", "text": "function writeManyRecords() {\n var conn = Jdbc.getCloudSqlConnection(dbUrl, user, userPwd);\n conn.setAutoCommit(false);\n\n var start = new Date();\n var stmt = conn.prepareStatement('INSERT INTO entries ' +\n '(guestName, content) values (?, ?)');\n for (var i = 0; i < 500; i++) {\n stmt.setString(1, 'Name ' + i);\n stmt.setString(2, 'Hello, world ' + i);\n stmt.addBatch();\n }\n\n var batch = stmt.executeBatch();\n conn.commit();\n conn.close();\n\n var end = new Date();\n Logger.log('Time elapsed: %sms for %s rows.', end - start, batch.length);\n}", "title": "" }, { "docid": "657eaed64808e07ae04fa4c39dc1e3fc", "score": "0.587246", "text": "function bulkImport(cb) {\n client.bulk({body: currentBatch}, function (err, response) {\n if (err) {\n helpers.exit(err);\n }\n\n if (response.error) {\n helpers.exit('When executing bulk query: ' + response.error.toString());\n }\n\n cb();\n });\n}", "title": "" }, { "docid": "bb1b4aa78d30f78b5daa549b7e4ee652", "score": "0.5864728", "text": "function runBatchedCursor(objectStore, startKey, descending, batchSize, onBatch) {\n\n // Bail out of getAll()/getAllKeys() in the following cases:\n // 1) either method is unsupported (we need both)\n // 2) batchSize is 1 (might as well use IDBCursor), or batchSize is -1 (i.e. batchSize unlimited,\n // not really clear the user wants a batched approach where the entire DB is read into memory,\n // perhaps they are filtering on a per-doc basis)\n // 3) descending – no real way to do this via getAll()/getAllKeys()\n var useGetAll = typeof objectStore.getAll === 'function' &&\n typeof objectStore.getAllKeys === 'function' && batchSize > 1 && !descending;\n\n var keysBatch;\n var valuesBatch;\n var pseudoCursor;\n\n function onGetAll(e) {\n valuesBatch = e.target.result;\n if (keysBatch) {\n onBatch(keysBatch, valuesBatch, pseudoCursor);\n }\n }\n\n function onGetAllKeys(e) {\n keysBatch = e.target.result;\n if (valuesBatch) {\n onBatch(keysBatch, valuesBatch, pseudoCursor);\n }\n }\n\n function continuePseudoCursor() {\n if (!keysBatch.length) { // no more results\n return onBatch();\n }\n // fetch next batch, exclusive start\n range = IDBKeyRange.lowerBound(keysBatch[keysBatch.length - 1], true);\n keysBatch = null;\n valuesBatch = null;\n objectStore.getAll(range, batchSize).onsuccess = onGetAll;\n objectStore.getAllKeys(range, batchSize).onsuccess = onGetAllKeys;\n }\n\n function onCursor(e) {\n var cursor = e.target.result;\n if (!cursor) { // done\n return onBatch();\n }\n // regular IDBCursor acts like a batch where batch size is always 1\n onBatch([cursor.key], [cursor.value], cursor);\n }\n\n var range = (startKey && !descending) ? IDBKeyRange.lowerBound(startKey, true) : null;\n\n if (useGetAll) {\n pseudoCursor = {\"continue\": continuePseudoCursor};\n objectStore.getAll(range, batchSize).onsuccess = onGetAll;\n objectStore.getAllKeys(range, batchSize).onsuccess = onGetAllKeys;\n } else if (descending) {\n objectStore.openCursor(range, 'prev').onsuccess = onCursor;\n } else {\n objectStore.openCursor(range).onsuccess = onCursor;\n }\n}", "title": "" }, { "docid": "973f01d0b51fc616e58b1e1a4cc00bb7", "score": "0.5857197", "text": "getResultBatch(batchSize) {\n const items = super.getResultBatch(batchSize);\n if (items.length > 0) {\n this.bufferSize = this.results.length / items.length;\n }\n else if (!this.activeRequests.length) {\n // if we don't have any items to process, and no active requests, buffer size should be zero.\n this.bufferSize = 0;\n }\n return items;\n }", "title": "" }, { "docid": "791cc28a7f471f1aaf70f35bcdd2a5a2", "score": "0.58450097", "text": "function sendBatch(batch)\n{\n var sendRequest = true;\n var attemptNo = 1;\n // While we want to keep making request, please keep making requests. We use the async\n // library here rather than a straight up while loop. This is necessary because the AWS\n // batchWriteItem is async and would cause an ordinary while loop to make repeated same-requests.\n async.whilst(\n // Test function;\n function()\n {\n return attemptNo < 3 && sendRequest;\n },\n // Function to call each time test function passes. This function will be called\n // until the batchWriteItem callback returns no unprocessed items.\n function(cb)\n {\n attemptNo++;\n\n // Request parameters.\n var params = {\n ReturnConsumedCapacity: \"TOTAL\",\n RequestItems: {}\n };\n params.RequestItems[batch.table] = batch.batch;\n\n dynDb.batchWriteItem(params, function(error, awsResults)\n {\n // There is an error. Stop processing immediately.\n if (error)\n {\n log(\"AWS batch write request errored: \" + error);\n log(\"Batch contained \" + batch.batch.length + \" items\");\n sendRequest = false; // Remove this line to make multiple attempts.\n cb();\n return;\n }\n\n // No error. Please continue.\n awsData = awsResults.unprocessedItems;\n // Test the data response. If there are no more unprocessed items,\n // signify that we do not wish to continue making AWS calls.\n if (!awsResults.unprocessedItems) sendRequest = false;\n // We have finished. call the callback.\n cb();\n });\n },\n // Function to call when repeated execution of main function has ceased.\n function(error)\n {\n if (error) log (error);\n }\n );\n}", "title": "" }, { "docid": "f82162f5c01d389a8c9d33278296abdd", "score": "0.5843105", "text": "async _apply (batch) {\n const b = this.bee.batch({ update: false })\n for (const node of batch) {\n const op = JSON.parse(node.value.toString())\n // TODO: Handle deletions\n if (op.type === 'put') await b.put(op.key, op.value)\n }\n await b.flush()\n }", "title": "" }, { "docid": "48130a2bd281e8ea05114f76eeb8907a", "score": "0.5832376", "text": "function batchUpdate(connectionString, collectionName, query, updateCallback) {\n\tvar qStr = JSON.stringify(query);\n\treturn new Promise(function (resolve, reject) {\n\t\tMongoClient.connect(connectionString, function (err, db) {\n\t\t\tif (err) {\n\t\t\t\treturn reject(err);\n\t\t\t}\n\t\t\tvar collection = db.collection(collectionName);\n\t\t\t// first check there are records because cursor.forEach() hangs on empty result sets.\n\t\t\tcollection.find(query).count()\n\t\t\t.then(function (cnt) {\n\t\t\t\tif (cnt === 0) {\n\t\t\t\t\tconsole.log(\"No results for query \", qStr);\n\t\t\t\t\tdb.close();\n\t\t\t\t\treturn resolve(0);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"Update batch \", qStr);\n\t\t\t\t\tvar pending = 0;\n\t\t\t\t\tvar cursor = collection.find(query).limit(LIMIT).forEach(function (document) {\n\t\t\t\t\t\tpending++;\n\t\t\t\t\t\tupdateCallback(document)\n\t\t\t\t\t\t.then(function (d) {\n\t\t\t\t\t\t\tcollection.update({_id: d._id}, {$set: d}, function (err, result) {\n\t\t\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\t\t\tdb.close();\n\t\t\t\t\t\t\t\t\treturn reject(err);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tpending--;\n\t\t\t\t\t\t\t\tif (pending === 0) {\n\t\t\t\t\t\t\t\t\t// exit for each .. we're done .. return count of remaining records\n\t\t\t\t\t\t\t\t\tcollection.find(query).count()\n\t\t\t\t\t\t\t\t\t.then(function (cnt) {\n\t\t\t\t\t\t\t\t\t\tconsole.log(\"Done batch \", qStr, \" remaining cnt: \", cnt);\n\t\t\t\t\t\t\t\t\t\tdb.close();\n\t\t\t\t\t\t\t\t\t\treturn resolve(cnt);\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});\n\t\t});\n\t});\n}", "title": "" }, { "docid": "1f62b10afbb6799f0cdcbf269d0e3ea2", "score": "0.58279693", "text": "returnInvalidAssociations() {\n return new Promise(\n\n async (resolve, reject) => {\n try {\n //query all associations.. page 2000 rows\n \n //for each association row - validate that from/to source actually exists\n //find that layerId fromSourceId, fromGlobalId, query Count and make sure it exists. \n //find the layerId of toSourceId, toGlobalId , query count make sure it exists \n //if doesn't exist add to invalid assocaition array. \n const invalidAssociations = [];\n //objectid >= ${offset} and objectid <= ${recordCount+offset}\n let c = 0;\n let offset = 0;\n let recordCount = 2000;\n while(true) {\n const result = await this.query(500001, `1=1`, undefined, undefined, [\"*\"], \"sde.DEFAULT\", offset, recordCount)\n console.log(`Processing ${recordCount} associations`)\n //for each assocaition check if its valid\n const bar = new ProgressBar(':bar', { total: result.features.length });\n for (let i = 0 ; i < result.features.length; i++){\n const associationRow = result.features[i]\n const isValid = await this.isAssocaitionValid( associationRow);\n if (!isValid){ \n const associationGuid = v(associationRow.attributes, \"globalid\");\n invalidAssociations.push({\n \"assocaitionGuid\":associationGuid\n })\n //console.log(`Discoved an invalid assocaition. ${associationGuid}`)\n //console.log(\"x\")\n }\n \n bar.tick();\n }\n \n\n //keep asking if this is true\n if (!result.exceededTransferLimit) break;\n offset+= recordCount;\n }\n \n resolve(invalidAssociations); \n }catch (ex) {\n reject(ex);\n }\n \n \n\n }\n )\n \n\n }", "title": "" }, { "docid": "5de504572c181dc83bdd75842ec75e70", "score": "0.57931685", "text": "function doProcessBatch() {\n clearTimeout(timer);\n timer = null;\n var thisBatch = batch;\n var thisCbs = batchCbs;\n var thisItemCount = itemCount;\n // reuse the old batch if still empty, else start a new batch\n if (itemCount !== 0) {\n batch = startBatch ? startBatch(maxBatchSize) : new Array();\n batchCbs = new Array();\n itemCount = 0;\n }\n // batch processing is allowed to overlap; io inherently serializes, or use eg quickq\n // thisItemCount will only be 0 if a scheduled batch filled up and has already been processed\n // process the batch nextTick so if more items are added they will be processed in order\n if (thisItemCount > 0) process.nextTick(function() {\n processBatchFunc(thisBatch, function(err) {\n // an error received from the batch errors out all items in the batch\n for (var i = 0; i < thisCbs.length; i++) thisCbs[i](err);\n // TODO: should batch errors affect subsequent batches too?\n })\n })\n }", "title": "" }, { "docid": "1c149b4a64baad978650087b78d64800", "score": "0.5792794", "text": "function querytest() {\n for (let index = 0; index < 100000; index++) {\n const results2 = knex.select(knex.raw(`\n dalong4();`))\n results2.map(columes => {\n console.log(columes)\n }).catch(err => {\n console.log(err)\n })\n }\n}", "title": "" }, { "docid": "ae002139b0123ca6b742b9ee6cd17af6", "score": "0.5771072", "text": "function mergeBatchResults(batch, bulkResult, err, result) {\n // If we have an error set the result to be the err object\n if (err) {\n result = err;\n } else if (result && result.result) {\n result = result.result;\n } else if (result == null) {\n return;\n }\n\n // Do we have a top level error stop processing and return\n if (result.ok === 0 && bulkResult.ok === 1) {\n bulkResult.ok = 0;\n\n const writeError = {\n index: 0,\n code: result.code || 0,\n errmsg: result.message,\n op: batch.operations[0]\n };\n\n bulkResult.writeErrors.push(new WriteError(writeError));\n return;\n } else if (result.ok === 0 && bulkResult.ok === 0) {\n return;\n }\n\n // Deal with opTime if available\n if (result.opTime || result.lastOp) {\n const opTime = result.lastOp || result.opTime;\n let lastOpTS = null;\n let lastOpT = null;\n\n // We have a time stamp\n if (opTime && opTime._bsontype === 'Timestamp') {\n if (bulkResult.lastOp == null) {\n bulkResult.lastOp = opTime;\n } else if (opTime.greaterThan(bulkResult.lastOp)) {\n bulkResult.lastOp = opTime;\n }\n } else {\n // Existing TS\n if (bulkResult.lastOp) {\n lastOpTS =\n typeof bulkResult.lastOp.ts === 'number'\n ? Long.fromNumber(bulkResult.lastOp.ts)\n : bulkResult.lastOp.ts;\n lastOpT =\n typeof bulkResult.lastOp.t === 'number'\n ? Long.fromNumber(bulkResult.lastOp.t)\n : bulkResult.lastOp.t;\n }\n\n // Current OpTime TS\n const opTimeTS = typeof opTime.ts === 'number' ? Long.fromNumber(opTime.ts) : opTime.ts;\n const opTimeT = typeof opTime.t === 'number' ? Long.fromNumber(opTime.t) : opTime.t;\n\n // Compare the opTime's\n if (bulkResult.lastOp == null) {\n bulkResult.lastOp = opTime;\n } else if (opTimeTS.greaterThan(lastOpTS)) {\n bulkResult.lastOp = opTime;\n } else if (opTimeTS.equals(lastOpTS)) {\n if (opTimeT.greaterThan(lastOpT)) {\n bulkResult.lastOp = opTime;\n }\n }\n }\n }\n\n // If we have an insert Batch type\n if (batch.batchType === INSERT && result.n) {\n bulkResult.nInserted = bulkResult.nInserted + result.n;\n }\n\n // If we have an insert Batch type\n if (batch.batchType === REMOVE && result.n) {\n bulkResult.nRemoved = bulkResult.nRemoved + result.n;\n }\n\n let nUpserted = 0;\n\n // We have an array of upserted values, we need to rewrite the indexes\n if (Array.isArray(result.upserted)) {\n nUpserted = result.upserted.length;\n\n for (let i = 0; i < result.upserted.length; i++) {\n bulkResult.upserted.push({\n index: result.upserted[i].index + batch.originalZeroIndex,\n _id: result.upserted[i]._id\n });\n }\n } else if (result.upserted) {\n nUpserted = 1;\n\n bulkResult.upserted.push({\n index: batch.originalZeroIndex,\n _id: result.upserted\n });\n }\n\n // If we have an update Batch type\n if (batch.batchType === UPDATE && result.n) {\n const nModified = result.nModified;\n bulkResult.nUpserted = bulkResult.nUpserted + nUpserted;\n bulkResult.nMatched = bulkResult.nMatched + (result.n - nUpserted);\n\n if (typeof nModified === 'number') {\n bulkResult.nModified = bulkResult.nModified + nModified;\n } else {\n bulkResult.nModified = null;\n }\n }\n\n if (Array.isArray(result.writeErrors)) {\n for (let i = 0; i < result.writeErrors.length; i++) {\n const writeError = {\n index: batch.originalIndexes[result.writeErrors[i].index],\n code: result.writeErrors[i].code,\n errmsg: result.writeErrors[i].errmsg,\n op: batch.operations[result.writeErrors[i].index]\n };\n\n bulkResult.writeErrors.push(new WriteError(writeError));\n }\n }\n\n if (result.writeConcernError) {\n bulkResult.writeConcernErrors.push(new WriteConcernError(result.writeConcernError));\n }\n}", "title": "" }, { "docid": "ae002139b0123ca6b742b9ee6cd17af6", "score": "0.5771072", "text": "function mergeBatchResults(batch, bulkResult, err, result) {\n // If we have an error set the result to be the err object\n if (err) {\n result = err;\n } else if (result && result.result) {\n result = result.result;\n } else if (result == null) {\n return;\n }\n\n // Do we have a top level error stop processing and return\n if (result.ok === 0 && bulkResult.ok === 1) {\n bulkResult.ok = 0;\n\n const writeError = {\n index: 0,\n code: result.code || 0,\n errmsg: result.message,\n op: batch.operations[0]\n };\n\n bulkResult.writeErrors.push(new WriteError(writeError));\n return;\n } else if (result.ok === 0 && bulkResult.ok === 0) {\n return;\n }\n\n // Deal with opTime if available\n if (result.opTime || result.lastOp) {\n const opTime = result.lastOp || result.opTime;\n let lastOpTS = null;\n let lastOpT = null;\n\n // We have a time stamp\n if (opTime && opTime._bsontype === 'Timestamp') {\n if (bulkResult.lastOp == null) {\n bulkResult.lastOp = opTime;\n } else if (opTime.greaterThan(bulkResult.lastOp)) {\n bulkResult.lastOp = opTime;\n }\n } else {\n // Existing TS\n if (bulkResult.lastOp) {\n lastOpTS =\n typeof bulkResult.lastOp.ts === 'number'\n ? Long.fromNumber(bulkResult.lastOp.ts)\n : bulkResult.lastOp.ts;\n lastOpT =\n typeof bulkResult.lastOp.t === 'number'\n ? Long.fromNumber(bulkResult.lastOp.t)\n : bulkResult.lastOp.t;\n }\n\n // Current OpTime TS\n const opTimeTS = typeof opTime.ts === 'number' ? Long.fromNumber(opTime.ts) : opTime.ts;\n const opTimeT = typeof opTime.t === 'number' ? Long.fromNumber(opTime.t) : opTime.t;\n\n // Compare the opTime's\n if (bulkResult.lastOp == null) {\n bulkResult.lastOp = opTime;\n } else if (opTimeTS.greaterThan(lastOpTS)) {\n bulkResult.lastOp = opTime;\n } else if (opTimeTS.equals(lastOpTS)) {\n if (opTimeT.greaterThan(lastOpT)) {\n bulkResult.lastOp = opTime;\n }\n }\n }\n }\n\n // If we have an insert Batch type\n if (batch.batchType === INSERT && result.n) {\n bulkResult.nInserted = bulkResult.nInserted + result.n;\n }\n\n // If we have an insert Batch type\n if (batch.batchType === REMOVE && result.n) {\n bulkResult.nRemoved = bulkResult.nRemoved + result.n;\n }\n\n let nUpserted = 0;\n\n // We have an array of upserted values, we need to rewrite the indexes\n if (Array.isArray(result.upserted)) {\n nUpserted = result.upserted.length;\n\n for (let i = 0; i < result.upserted.length; i++) {\n bulkResult.upserted.push({\n index: result.upserted[i].index + batch.originalZeroIndex,\n _id: result.upserted[i]._id\n });\n }\n } else if (result.upserted) {\n nUpserted = 1;\n\n bulkResult.upserted.push({\n index: batch.originalZeroIndex,\n _id: result.upserted\n });\n }\n\n // If we have an update Batch type\n if (batch.batchType === UPDATE && result.n) {\n const nModified = result.nModified;\n bulkResult.nUpserted = bulkResult.nUpserted + nUpserted;\n bulkResult.nMatched = bulkResult.nMatched + (result.n - nUpserted);\n\n if (typeof nModified === 'number') {\n bulkResult.nModified = bulkResult.nModified + nModified;\n } else {\n bulkResult.nModified = null;\n }\n }\n\n if (Array.isArray(result.writeErrors)) {\n for (let i = 0; i < result.writeErrors.length; i++) {\n const writeError = {\n index: batch.originalIndexes[result.writeErrors[i].index],\n code: result.writeErrors[i].code,\n errmsg: result.writeErrors[i].errmsg,\n op: batch.operations[result.writeErrors[i].index]\n };\n\n bulkResult.writeErrors.push(new WriteError(writeError));\n }\n }\n\n if (result.writeConcernError) {\n bulkResult.writeConcernErrors.push(new WriteConcernError(result.writeConcernError));\n }\n}", "title": "" }, { "docid": "101da3fa0d3b36f545f3c7ac6d52afeb", "score": "0.5769516", "text": "function storeFinalData(results, callback) {\n var updatedFinalData = results.merge_all_final_data;\n var bulk = Data.collection.initializeOrderedBulkOp();\n var bulkExecute;\n var now = new Date();\n\n //set the update parameters for query\n bulkExecute = false;\n for (var i = 0; i < updatedFinalData.length; i++) {\n\n //next(null,{'error':{'metricId':dataFromDb[j].data.metricId,'objectId':dataFromDb[j].data.objectId}})\n if (results.merge_all_final_data[i].error) {\n console.log('results.merge_all_final_data[i].error', results.merge_all_final_data[i].error)\n //bulkExecute = false;\n var mailOptions = {\n from: 'Datapoolt Team <rajalakshmi.c@habile.in>',\n to: 'rajalakshmi.c@habile.in',\n subject: 'Error alert for the metric' + results.merge_all_final_data[i].error.metricId + 'and object id' + results.merge_all_final_data[i].error.objectId,\n\n // HTML Version\n // html: '<span>The data has crossed the limit of <b>' + thresholdValue + '</b></span>' + '<span> for the metric <b>' + metric.name + '</b></span>' + '<span> in <b>' + object.name + '</b></span>'\n\n };\n utility.sendEmail(mailOptions, '', function (err, response) {\n //callback(null, 'success');\n console.log('errormail', response)\n });\n errorDataList.push(results.merge_all_final_data[i].error)\n }\n else if (results.merge_all_final_data[i] != 'DataFromDb' && !results.merge_all_final_data[i].error) {\n bulkExecute = true;\n\n //set query condition\n var query = {\n 'objectId': results.data[i].objectId,\n 'metricId': results.data[i].metricId\n };\n\n //set the values\n var update = {\n $setOnInsert: {created: now},\n $set: {\n data: results.merge_all_final_data[i],\n updated: now\n }\n };\n\n //form the query\n bulk.find(query).upsert().update(update);\n }\n }\n if (bulkExecute === true) {\n\n //Doing the bulk update\n bulk.execute(function (err, response) {\n callback(err, 'success');\n });\n }\n }", "title": "" }, { "docid": "0abde15a3e70d03f7b148353d7e8b063", "score": "0.5746705", "text": "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = {};\n requests.forEach(function (request) {\n if (request.id in requestsById) {\n requestsById[request.id].push(request);\n } else {\n requestsById[request.id] = [request];\n }\n });\n\n var numDocs = Object.keys(requestsById).length;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = Object.keys(requestsById);\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById[docId];\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "title": "" }, { "docid": "0abde15a3e70d03f7b148353d7e8b063", "score": "0.5746705", "text": "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = {};\n requests.forEach(function (request) {\n if (request.id in requestsById) {\n requestsById[request.id].push(request);\n } else {\n requestsById[request.id] = [request];\n }\n });\n\n var numDocs = Object.keys(requestsById).length;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = Object.keys(requestsById);\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById[docId];\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "title": "" }, { "docid": "0abde15a3e70d03f7b148353d7e8b063", "score": "0.5746705", "text": "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = {};\n requests.forEach(function (request) {\n if (request.id in requestsById) {\n requestsById[request.id].push(request);\n } else {\n requestsById[request.id] = [request];\n }\n });\n\n var numDocs = Object.keys(requestsById).length;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = Object.keys(requestsById);\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById[docId];\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "title": "" }, { "docid": "0abde15a3e70d03f7b148353d7e8b063", "score": "0.5746705", "text": "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = {};\n requests.forEach(function (request) {\n if (request.id in requestsById) {\n requestsById[request.id].push(request);\n } else {\n requestsById[request.id] = [request];\n }\n });\n\n var numDocs = Object.keys(requestsById).length;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = Object.keys(requestsById);\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById[docId];\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "title": "" }, { "docid": "ec991d459d133ae8974e174b3223fd1e", "score": "0.57416075", "text": "function bulkGet(db, opts, callback) {\n\t var requests = opts.docs;\n\t\n\t // consolidate into one request per doc if possible\n\t var requestsById = {};\n\t requests.forEach(function (request) {\n\t if (request.id in requestsById) {\n\t requestsById[request.id].push(request);\n\t } else {\n\t requestsById[request.id] = [request];\n\t }\n\t });\n\t\n\t var numDocs = Object.keys(requestsById).length;\n\t var numDone = 0;\n\t var perDocResults = new Array(numDocs);\n\t\n\t function collapseResultsAndFinish() {\n\t var results = [];\n\t perDocResults.forEach(function (res) {\n\t res.docs.forEach(function (info) {\n\t results.push({\n\t id: res.id,\n\t docs: [info]\n\t });\n\t });\n\t });\n\t callback(null, {results: results});\n\t }\n\t\n\t function checkDone() {\n\t if (++numDone === numDocs) {\n\t collapseResultsAndFinish();\n\t }\n\t }\n\t\n\t function gotResult(docIndex, id, docs) {\n\t perDocResults[docIndex] = {id: id, docs: docs};\n\t checkDone();\n\t }\n\t\n\t var allRequests = Object.keys(requestsById);\n\t\n\t var i = 0;\n\t\n\t function nextBatch() {\n\t\n\t if (i >= allRequests.length) {\n\t return;\n\t }\n\t\n\t var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n\t var batch = allRequests.slice(i, upTo);\n\t processBatch(batch, i);\n\t i += batch.length;\n\t }\n\t\n\t function processBatch(batch, offset) {\n\t batch.forEach(function (docId, j) {\n\t var docIdx = offset + j;\n\t var docRequests = requestsById[docId];\n\t\n\t // just use the first request as the \"template\"\n\t // TODO: The _bulk_get API allows for more subtle use cases than this,\n\t // but for now it is unlikely that there will be a mix of different\n\t // \"atts_since\" or \"attachments\" in the same request, since it's just\n\t // replicate.js that is using this for the moment.\n\t // Also, atts_since is aspirational, since we don't support it yet.\n\t var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n\t docOpts.open_revs = docRequests.map(function (request) {\n\t // rev is optional, open_revs disallowed\n\t return request.rev;\n\t });\n\t\n\t // remove falsey / undefined revisions\n\t docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\t\n\t var formatResult = identityFunction;\n\t\n\t if (docOpts.open_revs.length === 0) {\n\t delete docOpts.open_revs;\n\t\n\t // when fetching only the \"winning\" leaf,\n\t // transform the result so it looks like an open_revs\n\t // request\n\t formatResult = formatResultForOpenRevsGet;\n\t }\n\t\n\t // globally-supplied options\n\t ['revs', 'attachments', 'binary', 'ajax'].forEach(function (param) {\n\t if (param in opts) {\n\t docOpts[param] = opts[param];\n\t }\n\t });\n\t db.get(docId, docOpts, function (err, res) {\n\t var result;\n\t /* istanbul ignore if */\n\t if (err) {\n\t result = [{error: err}];\n\t } else {\n\t result = formatResult(res);\n\t }\n\t gotResult(docIdx, docId, result);\n\t nextBatch();\n\t });\n\t });\n\t }\n\t\n\t nextBatch();\n\t\n\t}", "title": "" }, { "docid": "af972567ab8907e44a5b6084f61461a8", "score": "0.57117045", "text": "function afterExecute(err, results) {\n debug(`executed(${query.database.uuid || 'default'}) : ${query.sql}`);\n\n if (benchmark) {\n query.sequelize.log('Executed (' + (query.database.uuid || 'default') + '): ' + query.sql, Date.now() - queryBegin, query.options);\n }\n\n if (err) {\n err.sql = query.sql;\n reject(query.formatError(err));\n } else {\n const metaData = this;\n let result = query.instance;\n\n // add the inserted row id to the instance\n if (query.isInsertQuery(results, metaData)) {\n query.handleInsertQuery(results, metaData);\n if (!query.instance) {\n // handle bulkCreate AI primary key\n if (\n metaData.constructor.name === 'Statement'\n && query.model\n && query.model.autoIncrementField\n && query.model.autoIncrementField === query.model.primaryKeyAttribute\n && query.model.rawAttributes[query.model.primaryKeyAttribute]\n ) {\n const startId = metaData[query.getInsertIdField()] - metaData.changes + 1;\n result = [];\n for (let i = startId; i < startId + metaData.changes; i++) {\n result.push({ [query.model.rawAttributes[query.model.primaryKeyAttribute].field]: i });\n }\n } else {\n result = metaData[query.getInsertIdField()];\n }\n }\n }\n\n if (query.sql.indexOf('sqlite_master') !== -1) {\n if (query.sql.indexOf('SELECT sql FROM sqlite_master WHERE tbl_name') !== -1) {\n result = results;\n if (result && result[0] && result[0].sql.indexOf('CONSTRAINT') !== -1) {\n result = query.parseConstraintsFromSql(results[0].sql);\n }\n } else {\n result = results.map(resultSet => resultSet.name);\n }\n } else if (query.isSelectQuery()) {\n if (!query.options.raw) {\n // This is a map of prefix strings to models, e.g. user.projects -> Project model\n const prefixes = query._collectModels(query.options.include);\n\n results = results.map(result => {\n return _.mapValues(result, (value, name) => {\n let model;\n if (name.indexOf('.') !== -1) {\n const lastind = name.lastIndexOf('.');\n\n model = prefixes[name.substr(0, lastind)];\n\n name = name.substr(lastind + 1);\n } else {\n model = query.options.model;\n }\n\n const tableName = model.getTableName().toString().replace(/`/g, '');\n const tableTypes = columnTypes[tableName] || {};\n\n if (tableTypes && !(name in tableTypes)) {\n // The column is aliased\n _.forOwn(model.rawAttributes, (attribute, key) => {\n if (name === key && attribute.field) {\n name = attribute.field;\n return false;\n }\n });\n }\n\n return tableTypes[name]\n ? query.applyParsers(tableTypes[name], value)\n : value;\n });\n });\n }\n\n result = query.handleSelectQuery(results);\n } else if (query.isShowOrDescribeQuery()) {\n result = results;\n } else if (query.sql.indexOf('PRAGMA INDEX_LIST') !== -1) {\n result = query.handleShowIndexesQuery(results);\n } else if (query.sql.indexOf('PRAGMA INDEX_INFO') !== -1) {\n result = results;\n } else if (query.sql.indexOf('PRAGMA TABLE_INFO') !== -1) {\n // this is the sqlite way of getting the metadata of a table\n result = {};\n\n let defaultValue;\n for (const _result of results) {\n if (_result.dflt_value === null) {\n // Column schema omits any \"DEFAULT ...\"\n defaultValue = undefined;\n } else if (_result.dflt_value === 'NULL') {\n // Column schema is a \"DEFAULT NULL\"\n defaultValue = null;\n } else {\n defaultValue = _result.dflt_value;\n }\n\n result[_result.name] = {\n type: _result.type,\n allowNull: _result.notnull === 0,\n defaultValue,\n primaryKey: _result.pk !== 0\n };\n\n if (result[_result.name].type === 'TINYINT(1)') {\n result[_result.name].defaultValue = { '0': false, '1': true }[result[_result.name].defaultValue];\n }\n\n if (typeof result[_result.name].defaultValue === 'string') {\n result[_result.name].defaultValue = result[_result.name].defaultValue.replace(/'/g, '');\n }\n }\n } else if (query.sql.indexOf('PRAGMA foreign_keys;') !== -1) {\n result = results[0];\n } else if (query.sql.indexOf('PRAGMA foreign_keys') !== -1) {\n result = results;\n } else if (query.sql.indexOf('PRAGMA foreign_key_list') !== -1) {\n result = results;\n } else if ([QueryTypes.BULKUPDATE, QueryTypes.BULKDELETE].indexOf(query.options.type) !== -1) {\n result = metaData.changes;\n } else if (query.options.type === QueryTypes.UPSERT) {\n result = undefined;\n } else if (query.options.type === QueryTypes.VERSION) {\n result = results[0].version;\n } else if (query.options.type === QueryTypes.RAW) {\n result = [results, metaData];\n } else if (query.isUpdateQuery() || query.isInsertQuery()) {\n result = [result, metaData.changes];\n }\n\n resolve(result);\n }\n }", "title": "" }, { "docid": "f4975cd22fe06731a8f25fec1ffb84cc", "score": "0.5711695", "text": "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new ExportedMap();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "title": "" }, { "docid": "f4975cd22fe06731a8f25fec1ffb84cc", "score": "0.5711695", "text": "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new ExportedMap();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "title": "" }, { "docid": "f4975cd22fe06731a8f25fec1ffb84cc", "score": "0.5711695", "text": "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new ExportedMap();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "title": "" }, { "docid": "f4975cd22fe06731a8f25fec1ffb84cc", "score": "0.5711695", "text": "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new ExportedMap();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "title": "" }, { "docid": "f4975cd22fe06731a8f25fec1ffb84cc", "score": "0.5711695", "text": "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new ExportedMap();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "title": "" }, { "docid": "f4975cd22fe06731a8f25fec1ffb84cc", "score": "0.5711695", "text": "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new ExportedMap();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "title": "" }, { "docid": "f4975cd22fe06731a8f25fec1ffb84cc", "score": "0.5711695", "text": "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new ExportedMap();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "title": "" }, { "docid": "6adf01ca8e16ef6cfe7a4a9644122577", "score": "0.5699982", "text": "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "title": "" }, { "docid": "6adf01ca8e16ef6cfe7a4a9644122577", "score": "0.5699982", "text": "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "title": "" }, { "docid": "6adf01ca8e16ef6cfe7a4a9644122577", "score": "0.5699982", "text": "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "title": "" }, { "docid": "6adf01ca8e16ef6cfe7a4a9644122577", "score": "0.5699982", "text": "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "title": "" }, { "docid": "6adf01ca8e16ef6cfe7a4a9644122577", "score": "0.5699982", "text": "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "title": "" }, { "docid": "6adf01ca8e16ef6cfe7a4a9644122577", "score": "0.5699982", "text": "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "title": "" }, { "docid": "6adf01ca8e16ef6cfe7a4a9644122577", "score": "0.5699982", "text": "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "title": "" }, { "docid": "6adf01ca8e16ef6cfe7a4a9644122577", "score": "0.5699982", "text": "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "title": "" }, { "docid": "6adf01ca8e16ef6cfe7a4a9644122577", "score": "0.5699982", "text": "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "title": "" }, { "docid": "6adf01ca8e16ef6cfe7a4a9644122577", "score": "0.5699982", "text": "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "title": "" }, { "docid": "6adf01ca8e16ef6cfe7a4a9644122577", "score": "0.5699982", "text": "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "title": "" }, { "docid": "6adf01ca8e16ef6cfe7a4a9644122577", "score": "0.5699982", "text": "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "title": "" }, { "docid": "6adf01ca8e16ef6cfe7a4a9644122577", "score": "0.5699982", "text": "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "title": "" }, { "docid": "6adf01ca8e16ef6cfe7a4a9644122577", "score": "0.5699982", "text": "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "title": "" }, { "docid": "6adf01ca8e16ef6cfe7a4a9644122577", "score": "0.5699982", "text": "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "title": "" }, { "docid": "6adf01ca8e16ef6cfe7a4a9644122577", "score": "0.5699982", "text": "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "title": "" }, { "docid": "a5c0ed6b021d1d1c7c93eab6c3698edc", "score": "0.5684301", "text": "performSpecifics(onSpecificsFinished){\n if(this.#specificItems.length == 0){\n onSpecificsFinished();\n return;\n }\n let limitPerSecond = 5;\n let counter = new bpu.AsyncCounter(limitPerSecond, ()=>{\n onSpecificsFinished();\n })\n for(var i=0;i<limitPerSecond;i++){\n let limitPerSearch = 20;\n let startIndex = 0;\n let endIndex = (this.#specificItems.length > limitPerSearch ? limitPerSearch : this.#specificItems.length);\n let itemSplice = this.#specificItems.splice(startIndex,endIndex);\n let itemIds = itemSplice.map((item)=>{return item.itemId[0]})\n if(itemIds.length == 0) {\n counter.increment();\n } else {\n this.#ebay.getMultipleItems({\n itemId: itemIds,\n IncludeSelector: 'ItemSpecifics'\n }).then((data) => {\n // insert specifics data in database here JON !!\n counter.increment();\n /*\n for (let k = 0; k < data.Item.length; k++) {\n for (let l = 0; l < items[0].searchResult[0].item.length; l++) {\n if (items[0].searchResult[0].item[l].itemId[0] == data.Item[k].ItemID) {\n items[0].searchResult[0].item[l].specifics = data.Item[k].ItemSpecifics\n }\n }\n }\n if (count == chunked.length) {\n callback(items)\n }\n */\n }, (error) => {\n console.log('Failed to fetch specifics' + error);\n // if failed to fetch specifics end the items to the end of the items to search specifics array\n for(failedItem in itemSplice){\n this.#specificItems.push(failedItem);\n }\n counter.increment();\n });\n }\n } \n }", "title": "" }, { "docid": "99a8bc6fdd31dd2e34c6a1916ac79ddb", "score": "0.56761885", "text": "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new ExportedMap();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n }", "title": "" }, { "docid": "305d27ea14a92e20f1bd2d63b1302af8", "score": "0.56737465", "text": "async function poolQuery(){\n for (element of req.body.genres){\n console.log(req.body.genres);\n console.log(element);\n console.log(createdMovieId);\n // SECOND QUERY ADDS GENRE FOR THAT NEW MOVIE\n pool.query(insertMovieGenreQuery, [createdMovieId, element])\n // .then(result => {\n // //Now that both are done, send back success!\n // res.sendStatus(201);\n // }).catch(err => {\n // // catch for second query\n // console.log(err);\n // res.sendStatus(500)\n // })\n }\n }", "title": "" }, { "docid": "8b067f8216beb58f290ebc1789edc15d", "score": "0.5668326", "text": "function runBatchedCursor(objectStore, keyRange, descending, batchSize, onBatch) {\n\n // Bail out of getAll()/getAllKeys() in the following cases:\n // 1) either method is unsupported - we need both\n // 2) batchSize is 1 (might as well use IDBCursor), or batchSize is -1 (i.e. batchSize unlimited,\n // not really clear the user wants a batched approach where the entire DB is read into memory,\n // perhaps they are filtering on a per-doc basis)\n // 3) descending – no real way to do this via getAll()/getAllKeys()\n\n var useGetAll = typeof objectStore.getAll === 'function' &&\n typeof objectStore.getAllKeys === 'function' &&\n batchSize > 1 && !descending;\n\n var keysBatch;\n var valuesBatch;\n var pseudoCursor;\n\n function onGetAll(e) {\n valuesBatch = e.target.result;\n if (keysBatch) {\n onBatch(keysBatch, valuesBatch, pseudoCursor);\n }\n }\n\n function onGetAllKeys(e) {\n keysBatch = e.target.result;\n if (valuesBatch) {\n onBatch(keysBatch, valuesBatch, pseudoCursor);\n }\n }\n\n function continuePseudoCursor() {\n if (!keysBatch.length) { // no more results\n return onBatch();\n }\n // fetch next batch, exclusive start\n var lastKey = keysBatch[keysBatch.length - 1];\n var newKeyRange;\n if (keyRange && keyRange.upper) {\n try {\n newKeyRange = IDBKeyRange.bound(lastKey, keyRange.upper,\n true, keyRange.upperOpen);\n } catch (e) {\n if (e.name === \"DataError\" && e.code === 0) {\n return onBatch(); // we're done, startkey and endkey are equal\n }\n }\n } else {\n newKeyRange = IDBKeyRange.lowerBound(lastKey, true);\n }\n keyRange = newKeyRange;\n keysBatch = null;\n valuesBatch = null;\n objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll;\n objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys;\n }\n\n function onCursor(e) {\n var cursor = e.target.result;\n if (!cursor) { // done\n return onBatch();\n }\n // regular IDBCursor acts like a batch where batch size is always 1\n onBatch([cursor.key], [cursor.value], cursor);\n }\n\n if (useGetAll) {\n pseudoCursor = {\"continue\": continuePseudoCursor};\n objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll;\n objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys;\n } else if (descending) {\n objectStore.openCursor(keyRange, 'prev').onsuccess = onCursor;\n } else {\n objectStore.openCursor(keyRange).onsuccess = onCursor;\n }\n}", "title": "" }, { "docid": "8b067f8216beb58f290ebc1789edc15d", "score": "0.5668326", "text": "function runBatchedCursor(objectStore, keyRange, descending, batchSize, onBatch) {\n\n // Bail out of getAll()/getAllKeys() in the following cases:\n // 1) either method is unsupported - we need both\n // 2) batchSize is 1 (might as well use IDBCursor), or batchSize is -1 (i.e. batchSize unlimited,\n // not really clear the user wants a batched approach where the entire DB is read into memory,\n // perhaps they are filtering on a per-doc basis)\n // 3) descending – no real way to do this via getAll()/getAllKeys()\n\n var useGetAll = typeof objectStore.getAll === 'function' &&\n typeof objectStore.getAllKeys === 'function' &&\n batchSize > 1 && !descending;\n\n var keysBatch;\n var valuesBatch;\n var pseudoCursor;\n\n function onGetAll(e) {\n valuesBatch = e.target.result;\n if (keysBatch) {\n onBatch(keysBatch, valuesBatch, pseudoCursor);\n }\n }\n\n function onGetAllKeys(e) {\n keysBatch = e.target.result;\n if (valuesBatch) {\n onBatch(keysBatch, valuesBatch, pseudoCursor);\n }\n }\n\n function continuePseudoCursor() {\n if (!keysBatch.length) { // no more results\n return onBatch();\n }\n // fetch next batch, exclusive start\n var lastKey = keysBatch[keysBatch.length - 1];\n var newKeyRange;\n if (keyRange && keyRange.upper) {\n try {\n newKeyRange = IDBKeyRange.bound(lastKey, keyRange.upper,\n true, keyRange.upperOpen);\n } catch (e) {\n if (e.name === \"DataError\" && e.code === 0) {\n return onBatch(); // we're done, startkey and endkey are equal\n }\n }\n } else {\n newKeyRange = IDBKeyRange.lowerBound(lastKey, true);\n }\n keyRange = newKeyRange;\n keysBatch = null;\n valuesBatch = null;\n objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll;\n objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys;\n }\n\n function onCursor(e) {\n var cursor = e.target.result;\n if (!cursor) { // done\n return onBatch();\n }\n // regular IDBCursor acts like a batch where batch size is always 1\n onBatch([cursor.key], [cursor.value], cursor);\n }\n\n if (useGetAll) {\n pseudoCursor = {\"continue\": continuePseudoCursor};\n objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll;\n objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys;\n } else if (descending) {\n objectStore.openCursor(keyRange, 'prev').onsuccess = onCursor;\n } else {\n objectStore.openCursor(keyRange).onsuccess = onCursor;\n }\n}", "title": "" }, { "docid": "8b067f8216beb58f290ebc1789edc15d", "score": "0.5668326", "text": "function runBatchedCursor(objectStore, keyRange, descending, batchSize, onBatch) {\n\n // Bail out of getAll()/getAllKeys() in the following cases:\n // 1) either method is unsupported - we need both\n // 2) batchSize is 1 (might as well use IDBCursor), or batchSize is -1 (i.e. batchSize unlimited,\n // not really clear the user wants a batched approach where the entire DB is read into memory,\n // perhaps they are filtering on a per-doc basis)\n // 3) descending – no real way to do this via getAll()/getAllKeys()\n\n var useGetAll = typeof objectStore.getAll === 'function' &&\n typeof objectStore.getAllKeys === 'function' &&\n batchSize > 1 && !descending;\n\n var keysBatch;\n var valuesBatch;\n var pseudoCursor;\n\n function onGetAll(e) {\n valuesBatch = e.target.result;\n if (keysBatch) {\n onBatch(keysBatch, valuesBatch, pseudoCursor);\n }\n }\n\n function onGetAllKeys(e) {\n keysBatch = e.target.result;\n if (valuesBatch) {\n onBatch(keysBatch, valuesBatch, pseudoCursor);\n }\n }\n\n function continuePseudoCursor() {\n if (!keysBatch.length) { // no more results\n return onBatch();\n }\n // fetch next batch, exclusive start\n var lastKey = keysBatch[keysBatch.length - 1];\n var newKeyRange;\n if (keyRange && keyRange.upper) {\n try {\n newKeyRange = IDBKeyRange.bound(lastKey, keyRange.upper,\n true, keyRange.upperOpen);\n } catch (e) {\n if (e.name === \"DataError\" && e.code === 0) {\n return onBatch(); // we're done, startkey and endkey are equal\n }\n }\n } else {\n newKeyRange = IDBKeyRange.lowerBound(lastKey, true);\n }\n keyRange = newKeyRange;\n keysBatch = null;\n valuesBatch = null;\n objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll;\n objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys;\n }\n\n function onCursor(e) {\n var cursor = e.target.result;\n if (!cursor) { // done\n return onBatch();\n }\n // regular IDBCursor acts like a batch where batch size is always 1\n onBatch([cursor.key], [cursor.value], cursor);\n }\n\n if (useGetAll) {\n pseudoCursor = {\"continue\": continuePseudoCursor};\n objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll;\n objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys;\n } else if (descending) {\n objectStore.openCursor(keyRange, 'prev').onsuccess = onCursor;\n } else {\n objectStore.openCursor(keyRange).onsuccess = onCursor;\n }\n}", "title": "" }, { "docid": "8b067f8216beb58f290ebc1789edc15d", "score": "0.5668326", "text": "function runBatchedCursor(objectStore, keyRange, descending, batchSize, onBatch) {\n\n // Bail out of getAll()/getAllKeys() in the following cases:\n // 1) either method is unsupported - we need both\n // 2) batchSize is 1 (might as well use IDBCursor), or batchSize is -1 (i.e. batchSize unlimited,\n // not really clear the user wants a batched approach where the entire DB is read into memory,\n // perhaps they are filtering on a per-doc basis)\n // 3) descending – no real way to do this via getAll()/getAllKeys()\n\n var useGetAll = typeof objectStore.getAll === 'function' &&\n typeof objectStore.getAllKeys === 'function' &&\n batchSize > 1 && !descending;\n\n var keysBatch;\n var valuesBatch;\n var pseudoCursor;\n\n function onGetAll(e) {\n valuesBatch = e.target.result;\n if (keysBatch) {\n onBatch(keysBatch, valuesBatch, pseudoCursor);\n }\n }\n\n function onGetAllKeys(e) {\n keysBatch = e.target.result;\n if (valuesBatch) {\n onBatch(keysBatch, valuesBatch, pseudoCursor);\n }\n }\n\n function continuePseudoCursor() {\n if (!keysBatch.length) { // no more results\n return onBatch();\n }\n // fetch next batch, exclusive start\n var lastKey = keysBatch[keysBatch.length - 1];\n var newKeyRange;\n if (keyRange && keyRange.upper) {\n try {\n newKeyRange = IDBKeyRange.bound(lastKey, keyRange.upper,\n true, keyRange.upperOpen);\n } catch (e) {\n if (e.name === \"DataError\" && e.code === 0) {\n return onBatch(); // we're done, startkey and endkey are equal\n }\n }\n } else {\n newKeyRange = IDBKeyRange.lowerBound(lastKey, true);\n }\n keyRange = newKeyRange;\n keysBatch = null;\n valuesBatch = null;\n objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll;\n objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys;\n }\n\n function onCursor(e) {\n var cursor = e.target.result;\n if (!cursor) { // done\n return onBatch();\n }\n // regular IDBCursor acts like a batch where batch size is always 1\n onBatch([cursor.key], [cursor.value], cursor);\n }\n\n if (useGetAll) {\n pseudoCursor = {\"continue\": continuePseudoCursor};\n objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll;\n objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys;\n } else if (descending) {\n objectStore.openCursor(keyRange, 'prev').onsuccess = onCursor;\n } else {\n objectStore.openCursor(keyRange).onsuccess = onCursor;\n }\n}", "title": "" }, { "docid": "d82fb60df3efc793559838a863d09190", "score": "0.565784", "text": "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new __WEBPACK_IMPORTED_MODULE_3_pouchdb_collections__[\"a\" /* Map */]();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "title": "" }, { "docid": "76db8adade75e2c6f929d41f53d837f4", "score": "0.5653877", "text": "function processAll(rows, callback) {\n var groups = [],\n i = 0,\n len = rows.length;\n\n while (rows.length > 0) {\n groups.push({\n id: i,\n rows: rows.splice(0, NUM_ROWS_IN_GROUP)\n });\n\n i += 1;\n }\n\n pconsole.log('Processing ' + len + ' rows in ' + groups.length + ' groups');\n\n async.eachSeries(groups,\n function (group, cb) {\n processRowGroup(group, function (err, queries) {\n if (err) throw err;\n\n conn.execTransaction(queries).then(function () {\n pconsole.inline(' ... Done');\n\n setTimeout(function () {\n cb();\n }, DELAY);\n }, function (err) {\n cb(err);\n });\n });\n },\n function (err) {\n if (err) throw err;\n });\n}", "title": "" }, { "docid": "447019eaadd17be8bbdc52a28cd2f7de", "score": "0.5646593", "text": "function bulkGet(db, opts, callback) {\n\t var requests = opts.docs;\n\n\t // consolidate into one request per doc if possible\n\t var requestsById = new ExportedMap();\n\t requests.forEach(function (request) {\n\t if (requestsById.has(request.id)) {\n\t requestsById.get(request.id).push(request);\n\t } else {\n\t requestsById.set(request.id, [request]);\n\t }\n\t });\n\n\t var numDocs = requestsById.size;\n\t var numDone = 0;\n\t var perDocResults = new Array(numDocs);\n\n\t function collapseResultsAndFinish() {\n\t var results = [];\n\t perDocResults.forEach(function (res) {\n\t res.docs.forEach(function (info) {\n\t results.push({\n\t id: res.id,\n\t docs: [info]\n\t });\n\t });\n\t });\n\t callback(null, {results: results});\n\t }\n\n\t function checkDone() {\n\t if (++numDone === numDocs) {\n\t collapseResultsAndFinish();\n\t }\n\t }\n\n\t function gotResult(docIndex, id, docs) {\n\t perDocResults[docIndex] = {id: id, docs: docs};\n\t checkDone();\n\t }\n\n\t var allRequests = [];\n\t requestsById.forEach(function (value, key) {\n\t allRequests.push(key);\n\t });\n\n\t var i = 0;\n\n\t function nextBatch() {\n\n\t if (i >= allRequests.length) {\n\t return;\n\t }\n\n\t var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n\t var batch = allRequests.slice(i, upTo);\n\t processBatch(batch, i);\n\t i += batch.length;\n\t }\n\n\t function processBatch(batch, offset) {\n\t batch.forEach(function (docId, j) {\n\t var docIdx = offset + j;\n\t var docRequests = requestsById.get(docId);\n\n\t // just use the first request as the \"template\"\n\t // TODO: The _bulk_get API allows for more subtle use cases than this,\n\t // but for now it is unlikely that there will be a mix of different\n\t // \"atts_since\" or \"attachments\" in the same request, since it's just\n\t // replicate.js that is using this for the moment.\n\t // Also, atts_since is aspirational, since we don't support it yet.\n\t var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n\t docOpts.open_revs = docRequests.map(function (request) {\n\t // rev is optional, open_revs disallowed\n\t return request.rev;\n\t });\n\n\t // remove falsey / undefined revisions\n\t docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n\t var formatResult = identityFunction;\n\n\t if (docOpts.open_revs.length === 0) {\n\t delete docOpts.open_revs;\n\n\t // when fetching only the \"winning\" leaf,\n\t // transform the result so it looks like an open_revs\n\t // request\n\t formatResult = formatResultForOpenRevsGet;\n\t }\n\n\t // globally-supplied options\n\t ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n\t if (param in opts) {\n\t docOpts[param] = opts[param];\n\t }\n\t });\n\t db.get(docId, docOpts, function (err, res) {\n\t var result;\n\t /* istanbul ignore if */\n\t if (err) {\n\t result = [{error: err}];\n\t } else {\n\t result = formatResult(res);\n\t }\n\t gotResult(docIdx, docId, result);\n\t nextBatch();\n\t });\n\t });\n\t }\n\n\t nextBatch();\n\n\t}", "title": "" }, { "docid": "ede4f80724842e7a57b73b94907dce37", "score": "0.5644428", "text": "function doBatchGet(batch) {\r\n\r\n const keys = batch.map((keyValue) => {\r\n let keyObj = {};\r\n\r\n keyObj[keyString] = keyValue;\r\n\r\n return keyObj;\r\n });\r\n\r\n const params = {\r\n RequestItems: {\r\n [tableName]: {\r\n Keys: keys\r\n }\r\n }\r\n };\r\n\r\n return docClient.batchGet(params).promise();\r\n }", "title": "" }, { "docid": "0233c419151cb84fc263c55b9a9e9db4", "score": "0.56425256", "text": "batchGetParams(_items,options={},params={},meta=false) {\n\n let items = Array.isArray(_items) ? _items : [_items]\n\n // Error on no items\n if (items.length === 0)\n error(`No items supplied`)\n\n const {\n capacity,\n consistent,\n attributes,\n ..._args\n } = options\n\n // Remove other valid options from options\n const args = Object.keys(_args).filter(x => !['execute','parse'].includes(x))\n\n // Error on extraneous arguments\n if (args.length > 0)\n error(`Invalid batchGet options: ${args.join(', ')}`)\n\n // Verify capacity\n if (capacity !== undefined\n && (typeof capacity !== 'string' || !['NONE','TOTAL','INDEXES'].includes(capacity.toUpperCase())))\n error(`'capacity' must be one of 'NONE','TOTAL', OR 'INDEXES'`)\n\n // Init RequestItems and Tables reference\n const RequestItems = {}\n const Tables = {}\n const TableAliases = {}\n let EntityProjections = {}\n let TableProjections = {}\n \n // // Loop through items\n for (const i in items) {\n const item = items[i]\n\n // Check item for Table reference and key\n if (\n item\n && item.Table \n && item.Table.constructor.name === 'Table'\n && item.Key\n && typeof item.Key === 'object'\n && !Array.isArray(item.Key)\n ) {\n\n // Set the table\n const table = item.Table.name\n\n // If it doesn't exist\n if (!RequestItems[table]) {\n // Create a table property with an empty array\n RequestItems[table] = { Keys: [] }\n // Add the table/table alias reference\n Tables[table] = item.Table\n if (item.Table.alias) TableAliases[item.Table.alias] = table\n }\n\n // Push request onto the table array\n RequestItems[table].Keys.push(item.Key) \n\n } else {\n error(`Item references must contain a valid Table object and Key`)\n }\n \n } // end item loop\n\n // Parse 'consistent' option\n if (consistent) {\n // If true, add to all table mappings\n if (consistent === true) {\n for (const tbl in RequestItems) RequestItems[tbl].ConsistentRead = true\n } else if (typeof consistent === 'object' && !Array.isArray(consistent)) {\n for (const tbl in consistent) {\n const tbl_name = TableAliases[tbl] || tbl \n if (RequestItems[tbl_name]) {\n if (typeof consistent[tbl] === 'boolean') { RequestItems[tbl_name].ConsistentRead = consistent[tbl] }\n else { error(`'consistent' values must be booleans (${tbl})`) }\n } else {\n error(`There are no items for the table or table alias: ${tbl}`)\n }\n } // end if\n } else {\n error(`'consistent' must be a boolean or an map of table names`)\n }\n } // end consistent\n\n // If projections\n if (attributes) {\n\n let attrs = attributes\n\n // If an Array, ensure single table and convert to standard format\n if (Array.isArray(attributes)) {\n if (Object.keys(RequestItems).length === 1) {\n attrs = { [Object.keys(RequestItems)[0]]: attributes }\n } else {\n error(`'attributes' must use a table map when requesting items from multiple tables`)\n }\n } // end if array\n\n for (const tbl in attrs) { \n const tbl_name = TableAliases[tbl] || tbl \n if (Tables[tbl_name]) {\n const { names, projections, entities, tableAttrs } = parseProjections(attrs[tbl],Tables[tbl_name],null,true)\n RequestItems[tbl_name].ExpressionAttributeNames = names\n RequestItems[tbl_name].ProjectionExpression = projections\n EntityProjections[tbl_name] = entities\n TableProjections[tbl_name] = tableAttrs\n } else {\n error(`There are no items for the table: ${tbl}`)\n }\n }\n\n } // end if projections\n\n const payload = Object.assign(\n { RequestItems },\n capacity ? { ReturnConsumedCapacity: capacity.toUpperCase() } : null,\n typeof params === 'object' ? params : null\n )\n\n return meta ? { payload, Tables, EntityProjections, TableProjections } : payload\n }", "title": "" }, { "docid": "41f0c42f9146f4953fd4905cb1b98d12", "score": "0.5638108", "text": "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n}", "title": "" }, { "docid": "1b26e18cd8dc3353f167fde5144c6709", "score": "0.56367314", "text": "async function submitPendingTransactions() {\n // See what transactions in the db are still pending\n var pendingTransactions = connection.query(\"SELECT * FROM stellartransactions WHERE state = ?\", [\"pending\"]);\n \n\n if (pendingTransactions.length > 0) {\n var tx = pendingTransactions.pop();\n await submitTransaction( tx.id, tx.destination, tx.xlm_amount, tx.memo);\n }\n\n // Wait 30 seconds and process next batch of transactions.\n setTimeout(\n function() {\n submitPendingTransactions();\n }, 0*1000);\n\n}", "title": "" }, { "docid": "4418664671995b28b150e6f2d8423a23", "score": "0.562732", "text": "function runBatchedCursor(objectStore, keyRange, descending, batchSize, onBatch) {\n\n if (batchSize === -1) {\n batchSize = 1000;\n }\n\n // Bail out of getAll()/getAllKeys() in the following cases:\n // 1) either method is unsupported - we need both\n // 2) batchSize is 1 (might as well use IDBCursor)\n // 3) descending – no real way to do this via getAll()/getAllKeys()\n\n var useGetAll = typeof objectStore.getAll === 'function' &&\n typeof objectStore.getAllKeys === 'function' &&\n batchSize > 1 && !descending;\n\n var keysBatch;\n var valuesBatch;\n var pseudoCursor;\n\n function onGetAll(e) {\n valuesBatch = e.target.result;\n if (keysBatch) {\n onBatch(keysBatch, valuesBatch, pseudoCursor);\n }\n }\n\n function onGetAllKeys(e) {\n keysBatch = e.target.result;\n if (valuesBatch) {\n onBatch(keysBatch, valuesBatch, pseudoCursor);\n }\n }\n\n function continuePseudoCursor() {\n if (!keysBatch.length) { // no more results\n return onBatch();\n }\n // fetch next batch, exclusive start\n var lastKey = keysBatch[keysBatch.length - 1];\n var newKeyRange;\n if (keyRange && keyRange.upper) {\n try {\n newKeyRange = IDBKeyRange.bound(lastKey, keyRange.upper,\n true, keyRange.upperOpen);\n } catch (e) {\n if (e.name === \"DataError\" && e.code === 0) {\n return onBatch(); // we're done, startkey and endkey are equal\n }\n }\n } else {\n newKeyRange = IDBKeyRange.lowerBound(lastKey, true);\n }\n keyRange = newKeyRange;\n keysBatch = null;\n valuesBatch = null;\n objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll;\n objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys;\n }\n\n function onCursor(e) {\n var cursor = e.target.result;\n if (!cursor) { // done\n return onBatch();\n }\n // regular IDBCursor acts like a batch where batch size is always 1\n onBatch([cursor.key], [cursor.value], cursor);\n }\n\n if (useGetAll) {\n pseudoCursor = {\"continue\": continuePseudoCursor};\n objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll;\n objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys;\n } else if (descending) {\n objectStore.openCursor(keyRange, 'prev').onsuccess = onCursor;\n } else {\n objectStore.openCursor(keyRange).onsuccess = onCursor;\n }\n }", "title": "" }, { "docid": "a12a951772999b5a00428ff6dc8d2161", "score": "0.5615974", "text": "function completeQuery(id, data) {\n var query = queryQueue[id];\n if (query) {\n try {\n delete queryQueue[id];\n\n // Get transaction\n var tx = query.tx;\n\n // If transaction hasn't failed\n // Note: We ignore all query results if previous query\n // in the same transaction failed.\n if (tx && tx.queryList[id]) {\n\n // Save query results\n var r = new DroidDB_Result();\n r.rows.resultSet = data;\n r.rows.length = data.length;\n try {\n if (typeof query.successCallback === 'function') {\n query.successCallback(query.tx, r);\n }\n } catch (ex) {\n console.log(\"executeSql error calling user success callback: \"+ex);\n }\n\n tx.queryComplete(id);\n }\n } catch (e) {\n console.log(\"executeSql error: \"+e);\n }\n }\n}", "title": "" }, { "docid": "52c047d5ccf0f240df1bfdf5002ac69b", "score": "0.56049544", "text": "function batchRequest(){\n // Use the lower value of items left in the link array or maxRequests\n var total = (linkArr.length-1 > maxRequests) ? maxRequests : linkArr.length-1;\n for(var i = 0; i<= total; i++) {\n qwest.get(endPoint+encodeURIComponent(linkArr[0]))\n .then(function(response) {\n apiActions.response({pageURL: response.url, report: response.data});\n })\n .catch(function(e, response) {\n console.log('>> Error: ', e, '\\nResponse: ', response);\n })\n // Remove the head from the array\n linkArr.shift();\n }\n\n // Batch request again if there's anything left in the array\n if(linkArr.length > 0) {\n setTimeout(function() {\n batchRequest();\n }, 30*1000);\n }\n}", "title": "" }, { "docid": "3e53e294caef4764dc644c8bba8784f9", "score": "0.56031954", "text": "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new pouchdbCollections.Map();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n }", "title": "" }, { "docid": "9bfa8b74066dd12033fce42897c4479c", "score": "0.5602623", "text": "upsertBatch({\n commit\n }, list) {\n const url = `${endpointUrl}/batch-upsert`;\n return axios.post(url, list).then(result => {\n commit('CLEAR_LIST');\n\n if (result.data.error) {\n throw new Error(result.data.error);\n }\n\n for (let i = 0, l = result.data.length; i < l; i++) {\n const createdCell = result.data[i];\n\n if (createdCell) {\n //console.log('createdCell', createdCell); \n commit('ADD', createdCell);\n } else {//console.warn('createdCell is', createdCell);\n }\n }\n\n return result.data;\n });\n }", "title": "" }, { "docid": "f35aeac66fee65d9a2da7fa3fd735144", "score": "0.55936325", "text": "async execute(...queries) {\n if(!queries.every(q=>q instanceof SQLQuery)) throw new Error('All queries must be instances of SQLQuery object');\n const autoRelease = !this.connection;\n const executing = [];\n const connection = await this.connect(); \n queries.forEach((query, index) => {\n //Logger.verbose(`Executing\\n${query.toString()}\\nwith ${query.params.length} parameters`);\n executing[index] = connection.query(...query.prepare());\n })\n\n try {\n let result = await Promise.all(executing);\n if (autoRelease) connection.release();\n return queries.length === 1 ? result[0] : result;\n }catch(err){\n console.log(err)\n Logger.error(`[MysqlDatabase][${err.code}][${err.message}]`)\n throw err\n }\n \n }", "title": "" }, { "docid": "f14b5a3ce8078ad4c8e12da7b5936794", "score": "0.5589633", "text": "function runBatchedCursor(objectStore, keyRange, descending, batchSize, onBatch) {\n\n if (batchSize === -1) {\n batchSize = 1000;\n }\n\n // Bail out of getAll()/getAllKeys() in the following cases:\n // 1) either method is unsupported - we need both\n // 2) batchSize is 1 (might as well use IDBCursor)\n // 3) descending – no real way to do this via getAll()/getAllKeys()\n\n var useGetAll = typeof objectStore.getAll === 'function' &&\n typeof objectStore.getAllKeys === 'function' &&\n batchSize > 1 && !descending;\n\n var keysBatch;\n var valuesBatch;\n var pseudoCursor;\n\n function onGetAll(e) {\n valuesBatch = e.target.result;\n if (keysBatch) {\n onBatch(keysBatch, valuesBatch, pseudoCursor);\n }\n }\n\n function onGetAllKeys(e) {\n keysBatch = e.target.result;\n if (valuesBatch) {\n onBatch(keysBatch, valuesBatch, pseudoCursor);\n }\n }\n\n function continuePseudoCursor() {\n if (!keysBatch.length) { // no more results\n return onBatch();\n }\n // fetch next batch, exclusive start\n var lastKey = keysBatch[keysBatch.length - 1];\n var newKeyRange;\n if (keyRange && keyRange.upper) {\n try {\n newKeyRange = IDBKeyRange.bound(lastKey, keyRange.upper,\n true, keyRange.upperOpen);\n } catch (e) {\n if (e.name === \"DataError\" && e.code === 0) {\n return onBatch(); // we're done, startkey and endkey are equal\n }\n }\n } else {\n newKeyRange = IDBKeyRange.lowerBound(lastKey, true);\n }\n keyRange = newKeyRange;\n keysBatch = null;\n valuesBatch = null;\n objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll;\n objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys;\n }\n\n function onCursor(e) {\n var cursor = e.target.result;\n if (!cursor) { // done\n return onBatch();\n }\n // regular IDBCursor acts like a batch where batch size is always 1\n onBatch([cursor.key], [cursor.value], cursor);\n }\n\n if (useGetAll) {\n pseudoCursor = {\"continue\": continuePseudoCursor};\n objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll;\n objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys;\n } else if (descending) {\n objectStore.openCursor(keyRange, 'prev').onsuccess = onCursor;\n } else {\n objectStore.openCursor(keyRange).onsuccess = onCursor;\n }\n}", "title": "" }, { "docid": "06e96d22e679af2a96e601ed517e59ec", "score": "0.558389", "text": "updateRemainingQueries(queries) {\n for (let query of queries) {\n this.remainingQueries.push(query);\n }\n }", "title": "" }, { "docid": "2aab253df4f3d8523206186b34b8733d", "score": "0.5564325", "text": "inBatch(batch) {\r\n if (this.batch !== null) {\r\n throw Error(\"This query is already part of a batch.\");\r\n }\r\n this._batch = batch;\r\n return this;\r\n }", "title": "" }, { "docid": "9058a03b98997c5ff0a939690d148413", "score": "0.5557203", "text": "batchInsert(tableName, insertItems) {\n // creating the params object\n let params = {\n RequestItems: {}\n };\n let icount = 0;\n let recursive = false;\n const BreakException = {};\n \n // const mapExceptions = { types: { public: 'B', private: 'B' } };\n \n params.RequestItems[tableName] = [];\n \n // processing the items to insert\n // const putRequests = [];\n \n if(insertItems.length > 25) {\n recursive = true;\n }\n \n try {\n insertItems.forEach(item => {\n let request = {\n PutRequest: {\n Item: {}\n }\n };\n \n request.PutRequest.Item['id'] = { 'S': item.key };\n // delete item.key;\n \n let forBinary = {};\n \n let cleanItem = this.cleanObject(item);\n // this.logger.debug(JSON.stringify(item));\n \n request.PutRequest.Item = { ...request.PutRequest.Item, ...attr.wrap(cleanItem) };\n // this.logger.debug(JSON.stringify(request.PutRequest.Item)); process.exit();\n // adding each insert request object\n params.RequestItems[tableName].push(request);\n icount++;\n \n // removing current item from insertItems\n let index = insertItems.findIndex(element => {\n return _.isEqual(element, item);\n });\n \n if(index > -1) {\n insertItems = insertItems.slice(index+1);\n }\n \n if(icount >= 25) {\n // insertItems = insertItems.slice(24);\n icount = 0;\n throw BreakException;\n }\n });\n } catch(e) {\n if (e !== BreakException) throw e;\n }\n \n // this.logger.debug(JSON.stringify(params)); process.exit();\n // console.log(insertItems.length, params.RequestItems[tableName].length); process.exit();\n // this.logger.debug(JSON.stringify(params)); process.exit();\n // this.logger.debug(JSON.stringify(params));\n \n // after generates all the params, then batch to save\n this.dynamodb.batchWriteItem(params, (err, data) => {\n if(err) {\n this.logger.debug(\"Error inserting data. JSON Error: \" + JSON.stringify(err));\n process.exit(1);\n } else {\n if(recursive) {\n this.logger.info('Batch inserted!');\n // this.logger.info('New insert:::::::::::::::');\n // this.logger.debug(JSON.stringify(insertItems));\n this.batchInsert(tableName, insertItems);\n } else {\n this.logger.info('Success: ', data);\n this.logger.info('END the work!');\n process.exit();\n }\n }\n });\n }", "title": "" }, { "docid": "9ebccadb033c411093df784d3bf4d2c0", "score": "0.555596", "text": "preprocess () {\n let items = []\n if (this.lokiQuery) {\n items = this.overpass.db.find(this.lokiQuery)\n }\n\n for (let i = 0; i < items.length; i++) {\n if (this.options.limit && this.count >= this.options.limit) {\n this.loadFinish = true\n return\n }\n\n const id = items[i].id\n\n if (!(id in this.overpass.cacheElements)) {\n continue\n }\n const ob = this.overpass.cacheElements[id]\n\n if (id in this.doneFeatures) {\n continue\n }\n\n // maybe we need an additional check\n if (this.lokiQueryNeedMatch && !this.filterQuery.match(ob)) {\n continue\n }\n\n // also check the object directly if it intersects the bbox - if possible\n if (ob.intersects(this.bounds) < 2) {\n continue\n }\n\n if ((this.options.properties & ob.properties) === this.options.properties) {\n this.receiveObject(ob)\n this.featureCallback(null, ob)\n }\n }\n\n if (this.options.limit && this.count >= this.options.limit) {\n this.loadFinish = true\n }\n }", "title": "" }, { "docid": "7b929d3d77c69aa5504f21fa4284cf27", "score": "0.55544907", "text": "function queueBatch(table, batch)\n{\n if (!batches[table]) batches[table] = [];\n batches[table].push({ table: table, batch: batch});\n}", "title": "" }, { "docid": "67365595d278a8fe319365e47ac1f0a7", "score": "0.55444306", "text": "async resolveBatchResults(results) {\n const messageIDs = results.reduce((acc, { associatedIDs }) => acc.concat(associatedIDs), []);\n const representations = await this.client.rest.messages.fetchMany(messageIDs);\n return Promise.all(representations.map(rep => this.add(rep)));\n }", "title": "" }, { "docid": "72095919e56118fb74410a06771db346", "score": "0.5536114", "text": "function getEntries() {\r\n db.transaction(queryDB,dbErrorHandler);\r\n}", "title": "" }, { "docid": "c0f48648005fe8419e98251a5d711a11", "score": "0.5520505", "text": "async checkBatchPaymentsStatus()\n {\n console.log('checkBatchPaymentsStatus')\n\n\n var self = this;\n var unconfirmedBatches = await self.mongoInterface.findAll('payment_batch',{confirmed: false} )\n\n\n //this type of for loop works with async & .forEach does not\n console.log(\"batch: \" + unconfirmedBatches)\n for( var element of unconfirmedBatches ) {\n\n console.log(self.getPaymentContractAddress(), element.id)\n\n var complete = await self.paymentContract.methods.paymentSuccessful(element.id).call() ;\n console.log('complete??',complete)\n\n if(complete)\n {\n element.confirmed = true;\n\n await self.markPaymentsCompleteForBatch( element )\n }\n\n await self.mongoInterface.upsertOne('payment_batch',{id: element.id}, element )\n\n }\n\n console.log('done w for each ')\n\n\n return true ;\n }", "title": "" }, { "docid": "5683205b8a132b4d5d1b31b1e8702e95", "score": "0.55193835", "text": "async broadcastPaymentBatches()\n {\n\n var self = this ;\n\n\n //if we have a pending broadcasting batch just continue..\n //IMPLEMENT ^\n var broadcastedPayment = null;\n\n try {\n\n\n var currentEthBlock = await self.redisInterface.getEthBlockNumber();\n\n var REBROADCAST_WAIT_BLOCKS = 50;\n\n\n var unconfirmedBatches = await self.mongoInterface.findAll('payment_batch',{confirmed: false} )\n\n\n\n for(var element of unconfirmedBatches)\n {\n console.log(\"broadcatedAT: \", element.broadcastedAt)\n console.log(\"broadcatedATBlocks: \", currentEthBlock - REBROADCAST_WAIT_BLOCKS)\n ///if it has not been recently broadcasted\n if(element.broadcastedAt == null || element.broadcastedAt < (currentEthBlock - REBROADCAST_WAIT_BLOCKS)){\n\n var complete = await self.paymentContract.methods.paymentSuccessful(element.id).call() ;\n\n //if it REALLY has never been completed before (double check)\n if(!complete )\n {\n broadcastedPayment = await self.transferPaymentBatch(element)\n break; //we will broadcast just this one and that is all\n }\n\n }\n }\n // var unbatched_pmnts = await this.mongoInterface.findAll('balance_payment',{batchId: null})\n // await this.batchMinedPayments( unbatched_pmnts )\n\n\n\n\n }catch(e){\n console.log('error',e)\n }\n\n\n setTimeout(function(){self.broadcastPaymentBatches()},10*60*1000) //ten minutes\n\n return broadcastedPayment;\n }", "title": "" }, { "docid": "5887c84ca9530d5efebb58aa8b03a826", "score": "0.55132306", "text": "function _startBatch() {\n ++_batch;\n }", "title": "" }, { "docid": "4b62fb30872648ae1e6b9ca0b94d119d", "score": "0.55061555", "text": "queryAll(callback) {\r\n var self = this;\r\n this.table.findAll(this.select)\r\n .then(function (data) {\r\n self.data = data;\r\n callback(self);\r\n },\r\n function (err) {\r\n localData = { error: err };\r\n callback(self);\r\n });\r\n }", "title": "" }, { "docid": "e8b9064c96cd27993d8fc740f87b376a", "score": "0.5503866", "text": "constructor(fileName, batchSize=16) {\n this.buff = undefined;\n\n this.targetsAvailable = {};\n this.target2Ids = new Map(); \n this.target2IdTaken = new Map();\n this.epoch = 0;\n this.batchSize = batchSize;\n\t\tthis.dbp = new Database.Database( fileName);\n\n this.prepare_list = this.dbp\n .select('SELECT DISTINCT target FROM ids')\n .then((x) => {this.targetsAvailable = x;})\n .then(() => {\n return(this.dbp.select('SELECT target, ex_id FROM ids'))\n })\n .then(\n (x) => {\n for(let row of x){\n let target = row.target;\n let ex_id = row.ex_id;\n if(! this.target2Ids.has(target)){\n this.target2IdTaken.set(target, 0);\n this.target2Ids.set(target, new Array());\n }\n this.target2Ids.get(target).push(ex_id);\n }\n }\n )\n .then(() => {this.shuffleIds();}).catch( (error) => { console.log( error );});\n\n\t}", "title": "" }, { "docid": "426b3790ed95718a1e4a9a57038788dd", "score": "0.54801095", "text": "updateData() {\n let new_qs = this.getQuerySet(this.view, this.qs_url).clone().prefetch();\n return new_qs.items().then(instances => {\n if(deepEqual(this.getQuerySet(this.view, this.qs_url).query, new_qs.query)) {\n this.setQuerySet(this.view, this.qs_url, new_qs);\n\n this.setInstancesToData(instances);\n\n return true;\n } else {\n return false;\n }\n }).catch(error => {\n debugger;\n });\n }", "title": "" }, { "docid": "414113a679aebae5f6641a223af87935", "score": "0.54767233", "text": "function index_browser_es_bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new index_es_ExportedMap();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + index_browser_es_MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = index_browser_es_pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(index_browser_es_identityFunction);\n\n var formatResult = index_browser_es_identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = index_browser_es_formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "title": "" }, { "docid": "390ced437b9260920a0c808390091af2", "score": "0.5475383", "text": "function doBatchDelete(batch) {\r\n\r\n const requestBatch = buffer.nextKeys.map((keyVal) => {\r\n return {\r\n DeleteRequest: {\r\n Key: { [keyString]: keyVal }\r\n }\r\n };\r\n });\r\n\r\n let params = {\r\n RequestItems: {}\r\n };\r\n\r\n params.RequestItems[tableName] = requestBatch;\r\n\r\n return new Promise((resolve, reject) => {\r\n setTimeout(() => {\r\n const toResolve = docClient.batchWrite(params).promise()\r\n .then(data => {\r\n return data;\r\n });\r\n\r\n resolve(toResolve)\r\n }, writeDelay);\r\n })\r\n }", "title": "" }, { "docid": "4eed451dad1973cd09dc50d9cab606f0", "score": "0.54742527", "text": "createQueryGroup() {\n this._currentQueryInd++;\n }", "title": "" } ]
9c32a4ddef81014ebe30174ce29363b9
Fim [add_marker] Inicio [render]
[ { "docid": "e182b0211c63ba6b24a9f41f6eb97451", "score": "0.0", "text": "function render(arr){\n\tfor(var layer in omarker){\n\t\tvar l = omarker[layer];\n\t\tomapa.removeLayer( l );\n\t}\n\tomarker = [];\n\tfor(var bus in arr){\n\t\tvar b = arr[bus];\n\t\tadd_marker({lat: b[3], lon: b[4], datahora: b[0], ordem: b[1], linha: b[2], vel: b[5]});\n\t}\n\t//console.log(omapa.getLayers());\n\treturn false;\n}", "title": "" } ]
[ { "docid": "a0a9fbe8ba55b23f2081243cb5f361e4", "score": "0.74909216", "text": "function placeMarkers(){}", "title": "" }, { "docid": "57d19e884adb48fdbd223716bfc5d524", "score": "0.7144001", "text": "addMarker() {\n const markerObj = {\n Snap: this.Snap,\n array: this.array,\n svgCanvas: this.newSVG,\n container: this.container,\n scrollContainer: this.scroll,\n lastPoint: this.convert(this.array.length - 1),\n firstPoint: this.convert(0),\n color: this.color,\n snap: this.snap,\n path: this.line,\n width: this.width,\n label: this.labelFormatter,\n onChange: this.options.onChange\n };\n\n this.marker = new Marker(markerObj);\n }", "title": "" }, { "docid": "4b548d3efb80710cb0c5450b926b3597", "score": "0.70853674", "text": "addMarker(){\n this.currentMarker = {\n marker: '',\n pos: [57.180707,65.517749],\n color: '#EF6C00',\n data: 'название файла'\n };\n $(this.editModal).find('.modal').modal();\n }", "title": "" }, { "docid": "7f24f915744301b164d6911535111874", "score": "0.6896129", "text": "function marker(real) {\n return addMarker(real, \"/\");\n}", "title": "" }, { "docid": "2eb5bf4cd78f863162ca1d978e5ec482", "score": "0.6891649", "text": "function addMarkers(info){\n var coor = new google.maps.LatLng(info[\"lat\"],info[\"long\"]);\n var iconImage = {\n url: 'http://maps.google.com/mapfiles/ms/icons/blue.png'\n };\n\n var marker = new google.maps.Marker({\n icon: iconImage,\n position: coor,\n animation: google.maps.Animation.DROP,\n title: info[\"jobtitle\"],\n map: map,\n zIndex: info[\"z\"]\n });\n markers.push(marker);\n var jobInfo = '<div id=\"inhoud\">'+\n '<h1><a href=\"'+info[\"url\"]+'\" target=\"_blank\">'\n +info[\"jobtitle\"]+'</a> - '+info[\"company\"]+'</h1>'+\n '<p class=\"jobLocatie\">'+info[\"formloc\"]+\n '</p>';\n\n\n google.maps.event.addListener(marker, 'click', function() {\n infowindow.setOptions({\n content: jobInfo,\n position: coor,\n zIndex: info[\"z\"]\n });\n\n infowindow.open(map,marker);\n });\n}", "title": "" }, { "docid": "7f9f3b6795aa63a9be071b37157ee13c", "score": "0.68398225", "text": "function addToMapDepartamento(item) {\n var marker = new google.maps.Marker({\n position: { lat: item.lat, lng: item.lng },\n title: item.solicitante + ', ' + item.FECHA,\n //icon: getIcon(item.streamStatus),\n icon: 'http://192.168.1.10/appsgi/assets/images/small/departamento.svg',\n map: map\n});\n marker.addListener('click', function() {\n document.getElementById('solicitante').value = item.solicitante\n document.getElementById('cliente').value = item.cliente\n document.getElementById('ubicacion').value = item.ubicacion\n document.getElementById('terreno_area').value = numeral(item.terreno_area).format('0,0.00');\n document.getElementById('terreno_valorunitario').value = numeral(item.terreno_valorunitario).format('$0,0.00');\n document.getElementById('valor_comercial').value = numeral(item.valor_comercial).format('$0,0.00');\n document.getElementById('ruta_informe').value = item.ruta_informe\n $('#default').modal('show')\n });\n //attachSecretMessage(marker,secretMessage)\n // miEvento(marker,secretMessage);\n markers.push(marker);\n}", "title": "" }, { "docid": "bc7f0dc4b1593ae595bd8e6c127ec737", "score": "0.67868936", "text": "_AddMinimapMarker(date) {\n const marker = new Graphics();\n this._minimap_markers.push(marker);\n marker.date = date;\n marker.lineStyle(2, 0x595755, 1);\n let pos = $('.minimap').offset().left + 1 + ($('.minimap').outerWidth() - 2) *\n ( (date.year - this._time_start.year) / (this._time_end.year - this._time_start.year) );\n marker.moveTo(pos, $('.minimap').offset().top - 2);\n marker.lineTo(pos, $('.minimap').offset().top + $('.minimap').outerHeight() + 2);\n app.stage.addChild(marker);\n }", "title": "" }, { "docid": "0bacab000dd9c49eb511a528c1e00683", "score": "0.6755723", "text": "function addMarker(pos,title,category,starttime,startdate,furl,vname,vaddress) {\n switch(category){\n case 'Family':\n icon= starpin;\n break;\n case 'Concert':\n icon= musicpin;\n break;\n case 'Course' :\n icon= coursepin;\n break;\n case 'Lecture':\n icon = coursepin;\n break;\n case 'Technology':\n icon = technologypin;\n break;\n case 'Art':\n icon= exhitionpin;\n break;\n case 'Food':\n icon= foodpin;\n break;\n case 'Outdoor':\n icon= outdoorpin;\n break;\n case 'Party':\n icon= partypin;\n break;\n case 'Theatre':\n icon= theaterpin;\n break;\n case 'Festival':\n icon= musicpin;\n break;\n case 'Theater':\n icon= theaterpin;\n break;\n case 'Sport':\n icon= sportpin;\n break;\n case 'Literature':\n icon=bookpin;\n break;\n case 'Exhibition':\n icon = exhitionpin;\n break;\n case 'Movies':\n icon = moviepin;\n break;\n case '':\n icon = exhitionpin;\n break;\n default:\n icon = nothingpin;\n }\n var currentMarker = L.marker(pos);\n if (icon!=null)\n currentMarker.setIcon(icon);\n var time = starttime.substring(0,starttime.length -3);\n var date = startdate.substring(8,10)+'.'+startdate.substring(5,7)+'.'+ startdate.substring(0,4);\n console.log(date);\n var popup = ('<h5>'+title+'</h5><p><i class=\"far fa-clock\"></i> '+time+' <i class=\"far fa-calendar-alt\"></i> '+ date+'</p><p><i class=\"far fa-star\"></i> '+category+'</p> <p><i class=\"fas fa-map-marker-alt\"></i> '+vname+', '+vaddress+' </p> ');\n if (furl !=''){\n popup += ('<a href = '+furl+' class=button target=\"_blank\"><i class=\"fab fa-facebook-square\"></i> Go to event</a>');\n }\n currentMarker.bindPopup(popup);\n currentMarker.on('click', function (ev) {\n ev.target.openPopup();\n });\n return currentMarker;\n}", "title": "" }, { "docid": "ce4bc905ca5068dbaa82fb66354626d8", "score": "0.67336655", "text": "function addMarkerOnCurrentLoc(currentCoord){\n let marker = new google.maps.Marker(); \n marker = new google.maps.Marker({\n position: currentCoord,\n map: state.map ,\n label: {\n fontFamily: 'Fontawesome', text: '\\uf015', color: 'green'}\n });\n \n state.markers.push(marker);\n let contentString = `<div class =\"info-window\">\n <h3><i class=\"fa fa-home\"></i></h3>\n <p>${$('#search-box').val()}</p>\n </div>`;\n addEventListner(marker, contentString);\n}", "title": "" }, { "docid": "fa2f25f604acd13bc3bf5fba0edca27c", "score": "0.67286944", "text": "function startMarker(){\n coord4326 = ol.proj.transform(obj.coordinate, 'EPSG:3857', 'EPSG:4326'),\n iconStyle = new ol.style.Style({\n image: new ol.style.Circle({ \n fill: null,\n radius: 5,\n snapToPixel: true, \n stroke: new ol.style.Stroke({ color: '#111', width: 2 })\n }),\n text: new ol.style.Text({\n offsetY: 25,\n text: ol.coordinate.format(coord4326, \"Start\", 2),\n font: '15px Open Sans,sans-serif',\n fill: new ol.style.Fill({ color: '#111' }),\n stroke: new ol.style.Stroke({ color: '#eee', width: 2 })\n })\n }),\n feature = new ol.Feature({\n type: 'removable',\n geometry: new ol.geom.Point(obj.coordinate)\n });\n }", "title": "" }, { "docid": "d38e97ca9e1943e9148b41fb208ab896", "score": "0.671649", "text": "function add_marker(){\n\t\n\t\tvar desc = document.getElementById(\"f_story\").value;\n\t\tvar m_title = document.getElementById(\"f_title\").value;\n\t\tvar m_img = document.getElementById(\"f_img\").value;\n\t\t\n\t\tif(desc === \"\" || m_title === \"\" || m_img === \"\"){\n\t\t\talert(\"Please fill out all fields\");\n\t\t\treturn;\n\t\t}\n\t\tvar data = \"<div id = 'm_content' style ='width:200px; height:100%; max-height:400px;'>\" + \n\t\t\"<h3 id = 'head_title'>\" + m_title + \"</h3>\" +\n\t\t\"<img id = 'm_img' height = '150px' width = '150px' src= ' \" + m_img + \" ' />\" +\n\t\t\"<p id = 'm_story'>\"+ desc +\"</p>\" +\n\t\t\"</div>\";\n\t\tvar iContent = new google.maps.InfoWindow({\n\t\t\ttg: true,\n\t\t\tcontent : data });\n\t\t\n\t\tif (curr_marker !== null){\n\t\t\tcurr_marker.setTitle(m_title);\n\t\t\t//curr_marker.setPosition(infoWindow.getPosition()); \n\t\t}else{\n\t\t\talert(\"An error occured please try again\");\n\t\t}\n\t\t\n\t\tinfoWindow.close();\n\t\tsave_data(m_img,desc);\n\t\t\n\t\tmarker_dat.event.push (function(i_content,curr) {\n\t\t\tgoogle.maps.event.addListener(curr, \"click\" , function() { iToggle(i_content,curr) })\n\t\t\t}(iContent,curr_marker)\n\t\t\t);\n\t\tmarker_dat.marker.push(curr_marker);\n\t\tmarker_dat.content.push(iContent);\n\t\t/*}else{\n\t\t\tcurr_marker.setMap(null);\n\t\t\tcurr_marker = null;\n\t\t\t\n\t\t}*/\n\t\t\n\t}", "title": "" }, { "docid": "a8c05319f519f913349496c9e2899aec", "score": "0.66939056", "text": "function createMarker(point, number) {\n\t\t\t// create custom icon\n\t\t\tvar icon = new GIcon();\n\t\t\ticon.image = (settings.data.locations[number].icon.indexOf(\"http:\") < 0)?\n\t\t\t\t\t\t\tsettings.relativepath + settings.data.locations[number].icon:settings.data.locations[number].icon;\n\t\t\ticon.iconSize = new GSize(18, 18);\n\t\t\ticon.iconAnchor = new GPoint(6, 18);\n\t\t\ticon.infoWindowAnchor = new GPoint(5, 1);\n\n \tvar marker = new GMarker(point, icon);\n\t\t \t\n \tGEvent.addListener(marker, \"click\", function() {\n\t\t\t\tif (settings.data.locations[number].maximizedContent != \"\"){\n\t\t\t\t\tsimpleContent = settings.data.locations[number].simpleContent + \"<a href='#' style='font-size:10px;margin-top:20px;display: block;' onclick='$(\\\"#\"+obj.id+\"\\\").get(0).mapa.getInfoWindow().maximize();return false;'>Ver informaci&oacute;n expandida</a>\"\n \t\tmarker.openInfoWindowHtml(simpleContent, \n\t\t\t\t\t\t\t\t\t{maxUrl:(settings.data.locations[number].maximizedContent.indexOf(\"http:\") < 0)?\n\t\t\t\t\t\t\t\t\t\t\tsettings.relativepath + settings.data.locations[number].maximizedContent:\n\t\t\t\t\t\t\t\t\t\t\tsettings.data.locations[number].maximizedContent\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}else{\n\t\t\t\t\tmarker.openInfoWindowHtml(settings.data.locations[number].simpleContent);\n\t\t\t\t}\t\t\t\t\n\t\t\t});\n\t\t\t\n\t\t\tgitems.push(marker);\n \n return marker;\n }", "title": "" }, { "docid": "009b39733c024418d50396a3629558fd", "score": "0.66934806", "text": "function showMarkers() {\n setAllMap(peta1.getMap());\n}", "title": "" }, { "docid": "5da956eedb6a89302d4696ddbd78da0e", "score": "0.66701037", "text": "function add_marker( $marker, map ) {\n\t\tvar latlng = new google.maps.LatLng( $marker.attr('data-lat'), $marker.attr('data-lng') );\n\n\t\tvar icon = {\n\t\t\turl: riyo.url + '/wp-content/themes/riyo/images/map-marker.svg',\n\t\t}\n\n\t\tvar marker = new google.maps.Marker({\n\t\t\tposition\t: latlng,\n\t\t\tmap\t\t\t: map,\n\t\t\ticon : icon,\n\t\t});\n\n\t\tmap.markers.push( marker );\n\n\t\tif( $marker.html() )\n\t\t{\n\t\t\tvar infowindow = new google.maps.InfoWindow({\n\t\t\t\tcontent\t\t: $marker.html()\n\t\t\t});\n\n\t\t\tgoogle.maps.event.addListener(marker, 'click', function() {\n\n\t\t\t\tinfowindow.open( map, marker );\n\n\t\t\t});\n\t\t}\n\n\t}", "title": "" }, { "docid": "8f1d601baa258321013cfe7a7b271488", "score": "0.6638727", "text": "function addMarker(location, line_name) {\n var marker = new google.maps.Marker({\n position: location,\n map: map,\n animation: google.maps.Animation.DROP,\n });\n \n coord.push(marker);\n \n //Open information about location \n info_window = new google.maps.InfoWindow({\n content: line_name,\n\n });\n info_window.open(map, marker);\n \n }", "title": "" }, { "docid": "d35c061e86250d614acd9b81030a8cb7", "score": "0.6637283", "text": "function info_evento(marker) {\n var color = tags[marker.tag].color;\n document.getElementById(\"panel_tag\").style.visibility = 'hidden';\n document.getElementById(\"panel_info\").style.visibility = 'visible';\n document.getElementById(\"buttonjoin\").style.backgroundColor = color;\n document.getElementById(\"buttonjoin\").style.visibility = 'visible';\n if (marker.owner == username_id) {\n document.getElementById(\"buttonjoin\").style.visibility = 'hidden';\n }\n\n document.getElementById(\"img_owner\").src = \"avatar/\" + marker.owner;\n document.getElementById(\"panel_info\").style.borderColor = color;\n\n $(\".fa.fa-times\").css(\"color\", color);\n\n document.getElementById(\"A\").innerHTML = marker.event;\n $(\"#A\").css(\"color\", color);\n document.getElementById(\"B\").innerHTML = marker.content;\n\n document.getElementById(\"description\").innerHTML = marker.description;\n document.getElementById(\"fecha\").innerHTML = marker.date;\n id = marker.id;\n}", "title": "" }, { "docid": "32f59b3d5d6fe2a266f9d4cf426118eb", "score": "0.66203403", "text": "function addMarker(map, name, description, location, statut, messageAlert) {\n\n /*Creation du pin rouge ou vert*/\n var icon = \"\";\n switch (statut) {\n case \"0\":\n icon = \"en-panne.png\";\n break;\n case \"1\":\n icon = \"fonctionnement.png\";\n break;\n }\n icon = \"/wp-content/plugins/carte-coupures/front/assets/\" + icon;\n\n /*icon*/\n var marker = new google.maps.Marker({\n position: location,\n map: map,\n title: name,\n icon: new google.maps.MarkerImage(icon)\n });\n\n\n /*----Infos bulle-----*/\n\n /*Création du contenu*/\n var signalerButton = '';\n if (statut == 1) {/* Si \"en fonctionnement\" */\n signalerButton = '<a href=\"/contact\">Signaler une panne</a>';\n messageAlert = '';\n } else if (messageAlert && statut == 0) { /*Si \"en panne\" et qu'une date à été rentrée*/\n messageAlert = '<div class=\"alert\" style=\"color:red;\"><strong>' + messageAlert + '</strong></div>';\n }\n\n var contentString = '<h3>' + name + '</h3>' +\n '<p>' + description + '</p>' + signalerButton + messageAlert;\n\n\n /*Info bulle*/\n google.maps.event.addListener(marker, 'click', function () {\n /*On ferme les infos window ouvertes*/\n if (typeof infowindow != 'undefined')\n infowindow.close();\n infowindow = new google.maps.InfoWindow({\n content: contentString\n });\n infowindow.open(map, marker);\n });\n}", "title": "" }, { "docid": "defb7bfbbcb82c855fa727bfaf0cf7c0", "score": "0.66158533", "text": "function addMarker() {\r\n \r\n // Create the marker (#MarkerOptions) \r\n var marker = new google.maps.Marker ({\r\n\r\n // Yoobee Coordinates\r\n position: new google.maps.LatLng(-36.856967,174.764428),\r\n map: map,\r\n\r\n // Free Icon reference - https://www.flaticon.com/packs/wildlife-14\r\n icon: {\r\n url: '../img/elephant.png', \r\n size: new google.maps.Size(64,64),\r\n origin: new google.maps.Point(0,0),\r\n anchor: new google.maps.Point(38,42),\r\n scaledSize: new google.maps.Size(64,64)\r\n }\r\n \r\n });\r\n\r\n return marker;\r\n}", "title": "" }, { "docid": "c08d1f65f8e535d7632cef0f53c766c1", "score": "0.6614116", "text": "function add_marker(pt){\n\tvar marker = [];\n\tvar iconFeature = new ol.Feature({\n\t\tgeometry: new ol.geom.Point(ol.proj.transform([pt.lon, pt.lat], \"EPSG:4326\", \"EPSG:3857\")),\n\t\tdatahora: pt.datahora,\n\t\tordem: pt.ordem,\n\t\tlinha: pt.linha,\n\t\tlat: pt.lat,\n\t\tlon: pt.lon,\n\t\tvel: pt.vel\n\t});\n\n\tvar iconStyle = new ol.style.Style({\n\t\timage: new ol.style.Icon(({\n\t\tanchor: [0.5, 1],\n\t\t//src: \"http://cdn.mapmarker.io/api/v1/pin?text=B&size=50&hoffset=1\"\n\t\tsrc: \"https://cdn.mapmarker.io/api/v1/pin?size=50&background=%234D4D4D&text=B&color=%23FFFFFF&voffset=-1&hoffset=1&\"\n\t\t}))\n\t});\n\ticonFeature.setStyle(iconStyle);\n\tmarker.push(iconFeature);\n\n\tvar ovectorSource = new ol.source.Vector({\n\t\tfeatures: marker\n\t});\n\n\tvar ovectorLayer = new ol.layer.Vector({\n\t\tsource: ovectorSource\n\t});\n\n\t//var coordinate = ovectorLayer.getSource().getFeatures()[0].getGeometry().getCoordinates();\n\t//var pixel = omapa.getPixelFromCoordinate(coordinate);\n\t//console.log(pixel);\n\t//var span = $(\"<span class='square'></span>\");\n\t//span.css({left: pixel[0], top: pixel[1]});\n\t//$(\"body\").append(span);\n\n\tomarker.push(ovectorLayer);\n\tomapa.addLayer(ovectorLayer);\n\t//omapa.removeLayer(ovectorLayer);\n\treturn false;\n}", "title": "" }, { "docid": "dfa11969f0ff9f5d71bee0fa2ef2a8e8", "score": "0.66042465", "text": "function createMarker(point, name, html) {\n // use a custom icon with letter A - Z\n var letter = String.fromCharCode(\"A\".charCodeAt(0) + i);\n var myIcon = new GIcon(G_DEFAULT_ICON, \"http://www.google.com/mapfiles/marker\" + letter + \".png\");\n myIcon.printImage = \"https://maps.google.com/mapfiles/marker\" + letter + \"ie.gif\"\n myIcon.mozPrintImage = \"https://maps.google.com/mapfiles/marker\" + letter + \"ff.gif\"\n\n var marker = new GMarker(point, {icon: myIcon});\n GEvent.addListener(marker, \"click\", function () {\n marker.openInfoWindowHtml(html);\n });\n // save the info we need to use later for the side_bar\n gmarkers[i] = marker;\n // add a line to the side_bar html\n side_bar_html += '<div class=\"map-marker\"><b>' + letter + '</b> <a href=\"javascript:myclick(' + i + ')\">' + name + '</a></div>';\n i++;\n return marker;\n}", "title": "" }, { "docid": "4fc2ccc498fc747bc1f3889ab40ef1dd", "score": "0.6595285", "text": "function addMarker(crd, teksti) {\n //crd={latitude:'60.171040', longitude:'24.941957'}; //Helsingin päärautatieasema\n L.marker([crd.latitude, crd.longitude], {icon: meIcon}).addTo(map).bindPopup('<p class=\"iconText\">'+teksti+'</p>').openPopup().on('click', function () {\n });\n}", "title": "" }, { "docid": "ae1cf81ab6749de9f1672ac59f36bde3", "score": "0.65802103", "text": "function addMark(lat, lon, info) {\n \n // Se remueve marcas existentes\n removePath();\n \n var newLatLng = new L.LatLng(lat, lon);\n var marker = new L.Marker(newLatLng)\n .bindPopup(info); \n map.addLayer(marker);\n map.setView(newLatLng, 16);\n marker.openPopup();\n}", "title": "" }, { "docid": "95110f0f29e8307ce95d8222609b1a1b", "score": "0.657842", "text": "function drawMyMarker(){\n\tmyMarker = new google.maps.Marker({\n\t\tmap: map,\n\t\ttitle: 'My location',\n\t\ticon: 'http://jspace.com.au/gmap/img/markers/arrow.png',\n\t\tposition: myPos\n\t});\n}", "title": "" }, { "docid": "c599b68b816a6a2f9e759b609e96a9ba", "score": "0.65403044", "text": "function add_marker(lat, lon, title, canvas) {\n coords = new google.maps.LatLng(lat, lon);\n var marker = new google.maps.Marker({position: coords, map: map, title: title});\n marker.setMap(map);\n markers.push(marker);\n}", "title": "" }, { "docid": "2bbdc1e4f86a153dc033803a48125047", "score": "0.6525202", "text": "function createMarker(latlng, name, address1, comentarios, seguridad, tranquilidad, limpia, ruido) {\n var marker = new google.maps.Marker({\n map: map,\n position: latlng,\n icon: icons,\n title: name\n });\n\n // This event expects a click on a marker\n // When this event is fired the Info Window content is created\n // and the Info Window is opened.\n var list = google.maps.event.addListener(marker, 'click', function() {\n\n // Creating the content to be inserted in the infowindow\n var iwContent = '<div class=\"col-md-4\"><div id=\"iw-container\">' +\n '<div class=\"iw-title\">' + name + '</div>' +\n '<div class=\"iw-content\">' +\n '<div class=\"iw-subTitle\">' + address1 + '</div>' +\n '<p>' + comentarios + '</p>' +\n '<div class=\"iw-subTitle\">Peligrosidad de la zona:</div>' +\n '<div class=\"progress\">' +\n '<div class=\"progress-bar progress-bar-danger\" role=\"progressbar\" aria-valuenow=\"80\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width:' + seguridad + '%\">' +\n '<span class=\"sr-only\">80% Complete (danger)</span>' +\n '</div></div>' +\n '<div class=\"iw-subTitle\">Es tranquila?</div>' +\n '<div class=\"progress\">' +\n '<div class=\"progress-bar progress-bar-warning\" role=\"progressbar\" aria-valuenow=\"60\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width: ' + tranquilidad + '%\">' +\n '<span class=\"sr-only\">60% Complete (warning)</span>' +\n '</div>' +\n '</div>' +\n '<div class=\"iw-subTitle\">Es Ruidosa?</div>' +\n '<div class=\"progress\">' +\n '<div class=\"progress-bar progress-bar-info\" role=\"progressbar\" aria-valuenow=\"20\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width: ' + ruido + '%\">' +\n '<span class=\"sr-only\">20% Complete</span>' +\n ' </div></div>' +\n '<div class=\"iw-subTitle\">Es Limpia?</div>' +\n '<div class=\"progress\">' +\n '<div class=\"progress-bar progress-bar-success\" role=\"progressbar\" aria-valuenow=\"20\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width: ' + limpia + '%\">' +\n '<span class=\"sr-only\">20% Complete</span>' +\n ' </div></div>' +\n '</div>' +\n '</div></div>';\n\n // including content to the Info Window.\n infoWindow.setContent(iwContent);\n // opening the Info Window in the current map and at the current marker location.\n $('.content-maps').append(iwContent);\n\n infoWindow.open(map, marker);\n list.remove();\n });\n\n\n }", "title": "" }, { "docid": "0d29311792193c6c10125d2ff2345e3c", "score": "0.6522485", "text": "function createMarker(point,html){\n\tvar marker = new GMarker(point);\n\tGEvent.addListener(marker, \"click\", function() {\n\t\tmarker.openInfoWindowHtml(html);\n\t});\n\t// save the info we need to use later for the side_bar\n\tgmarkers[i] = marker;\n\ti++;\n\n\treturn marker;\n}", "title": "" }, { "docid": "2d55b90efc0fd90495b1dc320ca5b882", "score": "0.6520198", "text": "function addMarker(i, lat, lng, data) {\n if (!isNaN(lat) && !isNaN(lng) && lng != null && lat !=0 & lng!=0 && lat !='' && lng !='') {\n \n \n //var myLatlng = new google.maps.LatLng(lat, lng);\n // To add the marker to the map, use the 'map' property\n // var marker = new google.maps.Marker({position: myLatlng, map: map,zIndex: i, title:data['post_title']});\n \n \n // ajout fenetre\n /*\n var contentString = '<div id=\"content\">'+\n '<div id=\"siteNotice\">'+\n '</div>'+\n '<h5 id=\"firstHeading\" class=\"firstHeading\">'+data['post_title']+'</h5>'+\n '<div id=\"bodyContent\">'+\n '<li> Nombre de joueurs : '+data['tennisdefi_nbJoueurs']+'</li>'+\n '<li> Adresse : '+data['adresse']+' '+ data['adresse2']+', '+data['ville']+' '+data['cp']+'</li>'+\n '</div>'+\n '</div>';\n\n var infowindow = new google.maps.InfoWindow({\n content: contentString,\n maxWidth: 200\n });\n \n google.maps.event.addListener(marker, 'click', function() {\n infowindow.open(map,marker);\n });\n \n */\n \n \n myLatLng = new google.maps.LatLng(lat, lng);\n bounds = new google.maps.LatLngBounds();\n \n \n\n makers_index ++; \n //alert(\"Ajout item: \"+makers_index+\"=>\"+data['post_title']+\"\\tLat =\"+lat +\"\\zIndex:\"+makers_index);\n var marker = new google.maps.Marker({ position: myLatLng, map: map, zIndex: makers_index});\n marker.title = data['post_title'];\n \n //eval('var marker' + i + ' = new google.maps.Marker({ position: myLatLng, map: map, zIndex: i});');\n \n\n \n // var marker_obj = marker; //eval('marker' + i);\n //bounds.extend(marker_obj.position);\n // markersArray.push(eval('marker' + i));\n // marker_obj.title = data['post_title'];\n \n \n var content = '</div>'+\n '<h5 id=\"firstHeading\" class=\"firstHeading\">'+data['post_title']+'</h5>'+\n '<div id=\"bodyContent\">'+\n '<li> Nombre de joueurs : '+data['tennisdefi_nbJoueurs']+'</li>'+\n '<li> Adresse : '+data['adresse']+' '+ data['adresse2']+', '+data['ville']+' '+data['cp']+'</li>'+\n '</div>'+\n '</div>';\n \n \n marker_content.push(content);\n markers.push(marker);\n \n // eval('var infowindow' + i + ' = new google.maps.InfoWindow({ content: content, maxWidth: 370});');\n // var infowindow_obj = eval('infowindow' + i);\n //var marker_obj = eval('marker' + i);\n google.maps.event.addListener(marker, 'click', function () {\n oInfo.setContent( marker_content[marker.zIndex]);\n oInfo.open( map, marker);\n } )\n // infowindow_obj.open(map, marker_obj);\n //);}\n \n\n }// lat != null\n \n \n \n \n \n \n}", "title": "" }, { "docid": "48c0768ef0c30f111a1bb932268d7809", "score": "0.65155107", "text": "function addMarker(loca)\n{\n RMPApplication.debug(\"begin addMarker\");\n // c_debug(debug.sla, \"=> addMarker: loca = \", loca);\n\n var contentInfo = setSiteInfo(loca);\n // c_debug(debug.sla, \"=> addMarker: contentInfo = \", contentInfo);\n var place = new google.maps.LatLng (loca.wo_list[0].loc_latitude, loca.wo_list[0].loc_longitude);\n // c_debug(debug.sla, \"=> addMarker: place = \", place);\n \n // define a rectangle with all markers on the map\n if (!isEmpty(place)) {\n bounds.extend(place);\n }\n\n // place marker on the map\n var marker = new google.maps.Marker({\n map: map,\n position: place,\n title: loca.loc_name,\n icon: loca.wo_list[0].sla_def.marker\n });\n marker.setMap(map);\n // c_debug(debug.sla, \"=> addMarker: marker = \", marker);\n\n // keep all current markers on the map in an array\n current_markers.push(marker);\n\n // Allow each marker to have an info window \n google.maps.event.addListener(marker, 'click', (function(marker) {\n return function() {\n infoWindow.setContent(contentInfo); \n infoWindow.open(map, marker);\n $('.gm-style-iw').parent('div').css({\"background-color\": \"#FFFFFF\"});\n }\n })(marker));\n\n RMPApplication.debug(\"end addMarker\");\n}", "title": "" }, { "docid": "8aa72503a2aa7619d9a87e1e5a3a8eca", "score": "0.6514832", "text": "function addMarker(marker) {\n var tip = marker[4];\n var title = marker[1];\n var pos = new google.maps.LatLng(marker[2], marker[3]);\n var content = marker[1];\n var icon = marker[5];\n\n\n marker1 = new google.maps.Marker({\n title: title,\n position: pos,\n tip: tip,\n map: map,\n icon: icon\n\n });\n\n \n \n \n gmarkers1.push(marker1);\n\n // Marker click listener\n google.maps.event.addListener(marker1, 'click', (function(marker1, content) {\n return function() {\n console.log('Gmarker 1 gets pushed');\n infowindow.setContent(content);\n infowindow.open(map, marker1);\n // map.panTo(this.getPosition()); --center position when sected marker\n \n }\n })(marker1, content));\n}", "title": "" }, { "docid": "fb04f12969b3db4478a492a14f416e97", "score": "0.6500132", "text": "function addMarker(props){\r\n var marker = new google.maps.Marker({\r\n position: {lat: props.lat, lng: props.lng},\r\n map: map\r\n });\r\n\r\n //Add the information to the marker\r\n var infoWindow = new google.maps.InfoWindow({\r\n content: '<h5>Magnitud: ' + props.magnitude + '</h5><h6>Fecha: ' + props.datetime.substring(0,10) + '</h6>'\r\n });\r\n\r\n //Show the information of the marker when clicked\r\n marker.addListener('click',function(){\r\n infoWindow.open(map,marker);\r\n });\r\n\r\n markers.push(marker);\r\n }", "title": "" }, { "docid": "8086ec872f655f014eee27d56efdc8bf", "score": "0.6499908", "text": "function createMarker(latlng, tr){\n var markers = new google.maps.Marker({\n position: latlng,\n map: map,\n animation: google.maps.Animation.DROP,\n }); \n showMsg(markers, tr);\n markerss.push(markers); \n }", "title": "" }, { "docid": "2f6dd769caa500bc2f49cba42a4c6657", "score": "0.6479254", "text": "function add_marker($marker, map) {\n\n // var\n var latlng = new google.maps.LatLng($marker.attr('data-lat'), $marker.attr('data-lng'));\n\n // create marker\n var marker = new google.maps.Marker({\n position: latlng,\n map: map\n });\n\n // add to array\n map.markers.push(marker);\n\n // if marker contains HTML, add it to an infoWindow\n if ($marker.html()) {\n // create info window\n var infowindow = new google.maps.InfoWindow({\n content: $marker.html()\n });\n\n // show info window when marker is clicked\n google.maps.event.addListener(marker, 'click', function () {\n\n infowindow.open(map, marker);\n\n });\n }\n\n }", "title": "" }, { "docid": "695c898cb47bfc574adb6f63c5d25059", "score": "0.64750785", "text": "function addMarker(data) {\n const meta = things[data.thing];\n const el = document.createElement('div');\n el.className = `marker ${meta && meta.ammo || ''} ${data.color || ''}`;\n el.setAttribute('x', data.x);\n el.setAttribute('y', data.y);\n el.title = meta && meta.long;\n el.setAttribute('data-short', data.thing);\n el.setAttribute('data', JSON.stringify(data));\n setMarkerPos(el);\n el.innerText = data.thing;\n $('.overlay').appendChild(el);\n return el;\n}", "title": "" }, { "docid": "f859c0177df87bb4fcb5c4da58597520", "score": "0.64710754", "text": "function add_marker( $marker, map ) {\n \n // var\n var latlng = new google.maps.LatLng( $marker.attr('data-lat'), $marker.attr('data-lng') );\n \n // create marker\n var marker = new google.maps.Marker({\n position : latlng,\n map : map\n });\n \n // add to array\n map.markers.push( marker );\n \n // if marker contains HTML, add it to an infoWindow\n if( $marker.html() )\n {\n // create info window\n var infowindow = new google.maps.InfoWindow({\n content : $marker.html()\n });\n \n // show info window when marker is clicked\n google.maps.event.addListener(marker, 'click', function() {\n \n infowindow.open( map, marker );\n \n });\n\n infowindow.open( map, marker );\n }\n \n}", "title": "" }, { "docid": "cd5fd1e68c4f0ca11f310408f4a0fe96", "score": "0.6465074", "text": "function initMap(){\n var options ={\n zoom:8,\n center: {lat:19.4400,lng:-99.1270}\n }\n\n var map = new\n google.maps.Map(document.getElementById('map'),options);\n\n addMarker({\n coords:{lat:19.440057053713137,lng:-99.12704709742486},\n content: '<p>Barajas, Bahena and Kano</p>'\n\n });\n\n// add marker function\n function addMarker(props){\n var marker = new google.maps.Marker({\n position:props.coords,\n map:map,\n });\n if(props.content){\n var infoWindow = new google.maps.InfoWindow({\n content: props.content\n });\n marker.addListener('click', function(){\n infoWindow.open(map,marker);\n });\n }\n }\n}", "title": "" }, { "docid": "bbefd2f04ac3da143a3034995d38d9ac", "score": "0.6463335", "text": "function addMarker(props){\n var marker= new google.maps.Marker({\n position:props.coord,\n map:map,\n draggable:false,\n icon:\"images/laptopicon.png\",\n\n \n });\n if(props.content){\n \n var infowindow= new google.maps.InfoWindow({\n content:props.content\n\t});\n \n marker.addListener('click', function(){\n infowindow.open(map,marker);\n \n });\n \n }\n \n }", "title": "" }, { "docid": "93a92b7f614eb186f44659ba2e4eee0a", "score": "0.64604473", "text": "onAdd() {\n // If the marker button hasn't already been created,\n // then create it and add it to the overlay image pane\n if (!this.markerButton) {\n this.createMarkerHTML();\n this.appendMarkerButtonToOverlay();\n }\n }", "title": "" }, { "docid": "6bcaec54e6073d759337614cb2073175", "score": "0.64478666", "text": "function addMarker(props) {\n var marker = new google.maps.Marker({\n position: props.coods,\n map: map,\n icon: props.iconImage,\n });\n \n var infoWindow = new google.maps.InfoWindow({\n content: props.infoText,\n });\n \n marker.addListener(\"click\", function () {\n infoWindow.open(map, marker);\n });\n \n return marker;\n }", "title": "" }, { "docid": "28f69c65141ef9edff93deb286f86227", "score": "0.6444002", "text": "function addCurrentMarks () {\n \n // Se remueve marcas existentes\n removePath();\n \n // Obtiene listado de objetos point (coordenadas)\n var lst_pto = select2list('lst_pto_rte', '|');\n \n var newlatlon = null;\n for (var i = 0; i < lst_pto.length; i++) {\n var point = lst_pto.pop();\n newlatlon = new L.LatLng(point.latitud, point.longitud); \n var marker = new L.Marker(newlatlon, {icon: greyIcon}, {draggable:'true'})\n .bindPopup(point.info);\n marker.on('popupopen', onPopupOpen);\n marker.on('dragend', onDragEvent); \n map.addLayer(marker);\n }\n \n if (newlatlon != null) {\n map.setView(newlatlon, 8);\n }\n}", "title": "" }, { "docid": "cf9522d0663bf8de9ab8153a8e1ca876", "score": "0.64363605", "text": "function initMarker($marker, map) {\n\n // Get position from marker.\n var lat = $marker.data('lat');\n var lng = $marker.data('lng');\n var latLng = {\n lat: parseFloat(lat),\n lng: parseFloat(lng)\n };\n\n let icon = {\n url: theme_params.stylesheet_dir + '/dist/images/marker.png', // url\n scaledSize: new google.maps.Size(38, 50)\n };\n\n // Create marker instance.\n var marker = new google.maps.Marker({\n position: latLng,\n map: map,\n icon: icon\n });\n\n // Append to reference for later use.\n markers.push(marker);\n\n\n // If marker contains HTML, add it to an infoWindow.\n if ($marker.html()) {\n\n let infoBox = new InfoBox();\n\n var myOptions = {\n content: $marker.html(),\n disableAutoPan: false,\n maxWidth: 0,\n pixelOffset: new google.maps.Size(-40, 10),\n alignBottom: false,\n zIndex: null,\n boxStyle: {\n opacity: 1,\n width: \"390px\"\n },\n // closeBoxMargin: \"0 0 0 0\",\n closeBoxURL: theme_params.stylesheet_dir + '/dist/images/close.png',\n infoBoxClearance: new google.maps.Size(1, 1),\n isHidden: false,\n pane: \"floatPane\",\n enableEventPropagation: false\n };\n\n\n // Create info window.\n // var infowindow = new google.maps.InfoWindow({\n // content: $marker.html()\n // });\n\n infoBox.setOptions(myOptions);\n\n infoBoxes.push(infoBox);\n\n // Show info window when marker is clicked.\n google.maps.event.addListener(infoBox, 'closeclick', function () {\n if (activeInfowindow !== null) {\n activeInfowindow.close();\n }\n\n for (let i = 0; i < markers.length; i++) {\n if (markers[i].type === 'Distributor') {\n markers[i].setIcon({\n url: theme_params.stylesheet_dir + '/dist/images/marker-primary.png', // url\n scaledSize: new google.maps.Size(38, 50)\n });\n } else {\n markers[i].setIcon({\n url: theme_params.stylesheet_dir + '/dist/images/marker.png', // url\n scaledSize: new google.maps.Size(38, 50)\n });\n }\n }\n });\n\n google.maps.event.addListener(marker, 'click', function () {\n\n if (activeInfowindow !== null) {\n activeInfowindow.close();\n }\n\n for (let i = 0; i < markers.length; i++) {\n markers[i].setIcon({\n url: theme_params.stylesheet_dir + '/dist/images/marker.png', // url\n scaledSize: new google.maps.Size(38, 50)\n });\n }\n\n\n marker.setIcon({\n url: theme_params.stylesheet_dir + '/dist/images/marker-solid.png', // url\n scaledSize: new google.maps.Size(38, 50)\n });\n\n\n infoBox.open(map, marker);\n map.setCenter(marker.getPosition());\n activeInfowindow = infoBox;\n\n });\n }\n }", "title": "" }, { "docid": "461868e15fbe57ebc1075d3f370cc915", "score": "0.6431995", "text": "function CreateMarker(map, lat, long, color, markerLabelText, infoWindowContent, markerId, plate) {\n // if the marker have an infowindow then create it and associate marker click event with opening it; otherwise do not create info window\n var markerIcon = {\n path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW,\n scale: 4,\n strokeColor: color,\n rotation: 0\n }\n if (infoWindowContent == undefined) {\n return new MarkerWithLabel({\n position: new google.maps.LatLng(lat, long),\n labelContent: \"<div><p id=\\\"markerText_\" +\n markerId +\n \"\\\" style=\\\"text-align:center;color:black;z-index:100\\\" class='markerLabelText'>\" +\n markerLabelText +\n \"</p></div>\",\n icon: markerIcon\n });\n } else {\n var infowindow = new google.maps.InfoWindow({\n content: infoWindowContent\n });\n var tmpMarker = new MarkerWithLabel({\n position: new google.maps.LatLng(lat, long),\n labelContent: \"<div><p id=\\\"markerText_\" +\n markerId +\n \"\\\" style=\\\"text-align:center;color:black;z-index:100\\\" class='markerLabelText'>\" +\n markerLabelText +\n \"</p></div>\",\n icon: markerIcon,\n infoWindow: infowindow\n });\n // set a function on marker click event that will open the infowindow and set the selected plate so the map will recenter with its changing position\n google.maps.event.addListener(tmpMarker,\n \"click\",\n function () {\n this.infoWindow.open(map, this);\n //selectedPlaka = this.label.labelDiv_.children[0].children[1].innerText.split('-')[1].trim();\n selectedPlaka = plate;\n });\n google.maps.event.addListener(infowindow,\n \"domready\",\n function () {\n var iwOuter = $(\"#\" + selectedPlaka.replace(/ /g, \"-\")).parent(\"div\").parent(\"div\").parent(\"div.gm-style-iw\");\n var iwCloseBtn = iwOuter.next();\n iwCloseBtn.css({\n width: \"19px\",\n height: \"19px\",\n opacity: \"1\",\n right: \"27px\",\n top: \"13px\",\n border: \"3px solid #48b5e9\",\n 'border-radius': \"3px !important\",\n 'box-shadow': \"0 0 5px #3990B9\"\n });\n iwCloseBtn.mouseout(function () {\n $(this).css({ opacity: \"1\" });\n });\n });\n return tmpMarker;\n }\n }", "title": "" }, { "docid": "f200efe78e37ae332f604bb3021dedd2", "score": "0.6431936", "text": "function addMarkerToGroup(coordinate, html, group) {\n //console.log(html.properties)\n if (html.properties.ruta_tapa == \"1\"){\n var evIcon = new H.map.Icon('assets/markers/marker_rutaTapa.png');\n }\n else{\n if (html.properties.cocina == \"TAPAS\"){\n var evIcon = new H.map.Icon('assets/markers/marker_tapas.png');\n }\n else if (html.properties.cocina == \"POSTRES\"){\n var evIcon = new H.map.Icon('assets/markers/marker_postre.png');\n }\n else if (html.properties.cocina == \"AMERICANA\"){\n var evIcon = new H.map.Icon('assets/markers/marker_americana.png');\n }\n else if (html.properties.cocina == \"INTERNACIONAL\"){\n var evIcon = new H.map.Icon('assets/markers/marker_internacional.png');\n }\n else if (html.properties.cocina == \"GALLEGA\"){\n var evIcon = new H.map.Icon('assets/markers/marker_gallega.png');\n }\n else if (html.properties.cocina == \"ASTURIANA\"){\n var evIcon = new H.map.Icon('assets/markers/marker_asturiana.png');\n }\n }\n var marker = new H.map.Marker(coordinate, { icon: evIcon });\n if (html.properties.imagen)\n imagen = html.properties.imagen;\n else\n imagen = \"assets/images/default.png\"\n if (html.properties.cocina)\n cocina = html.properties.cocina\n else\n cocina = \"AMERICANA\"\n telefono = \"91 580 42 60\";\n url = `https://www.here.com/directions/${mode}/start:${geoPosition.coords.latitude},${geoPosition.coords.longitude}/end:${html.geometry.coordinates[1]},${html.geometry.coordinates[0]}`\n marker.setData(`<figure id=\"cardFigure\"><img id=\"cardImage\"src=\"${imagen}\"/></figure>\n <div id=\"cardDecription\">\n <div id=\"cardDescriptionInfo\">\n <h5 id=\"cardDescriptionTitle\">${html.properties.NombreComercial}</h5>\n <p id=\"cardDescriptionAddress\">${html.properties.Dirección}</p>\n <p class=\"cardDescriptionInfo\"><i>${telefono}</i></p>\n <p class=\"cardDescriptionInfo\"><i>${cocina}</i></p>\n </div>\n <div id=\"cardPrice\">\n <a id=\"cardPriceAnchor\" href=\" ${url} \">\n <img id=\"cardPriceImage\" src=\"assets/logos/directions.png\"/>\n </a>\n <p id=\"cardPricePrice\">€€</p>\n </div>\n </div>`);\n marker.id = \"marker\";\n group.addObject(marker);\n}", "title": "" }, { "docid": "9802cc404a5d4ae516b72c3d3525c426", "score": "0.6430184", "text": "function createMarkers()\n {\n \tcodeLatLng(\"60.220647,24.805065\", \"Toilet\",\"images/toilet.jpg\",\"1st Floor, A-Building\");\n \t//codeLatLng(\"60.221006,24.804713\", \"Toilet\",\"images/toilet.jpg\",\"1st Floor, A-Building\");\n \t//codeLatLng(\"60.221816,24.804205\", \"Toilet\",\"images/toilet.jpg\",\"2nd Floor, B-Building\");\n \t//codeLatLng(\"60.220647,24.804250\", \"Toilet\",\"images/toilet.jpg\",\"1st Floor, A-Building\");\n \tcodeLatLng(\"60.221007,24.804050\", \"Cafeteria\",\"images/food.gif\",\"1st Floor, A-Building\");\n \tcodeLatLng(\"60.221457,24.804050\", \"Library\",\"images/book.jpg\",\"1st Floor, A-Building\");\n \tcodeLatLng(\"60.221000,24.805050\", \"Porter\",\"images/porter.png\",\"1st Floor, A-Building\");\n \tcodeLatLng(\"60.221000,24.804650\", \"Entrance\",\"images/entrance.png\",\"1st Floor, A-Building\");\n\n\n }", "title": "" }, { "docid": "cbd154ee5d49ae8e47fc6723b34ee7e5", "score": "0.64284414", "text": "function addMarker(latitude, longitude, markerContent, icon, index)\n {\n if(arguments.length == 3){\n var marker = new google.maps.Marker({\n position: new google.maps.LatLng(latitude, longitude)\n });\n } else if (arguments.length == 4) { // 4 arguments\n var marker = new google.maps.Marker({\n position: new google.maps.LatLng(latitude, longitude),\n icon: icon\n });\n } else { //5 arguments\n var marker = new google.maps.Marker({\n position: new google.maps.LatLng(latitude, longitude),\n icon: icon,\n index: index\n });\n }\n marker.setMap(map);\n marker.addListener('click', function () {\n infoWindow.setContent(markerContent);\n infoWindow.open(map, marker);\n // if 5 arguments\n if (this.index || this.index == 0){\n triggerSearch(this.index);\n }\n\n //hide iframe\n $('#iframe_container').hide('slow');\n });\n return marker;\n }", "title": "" }, { "docid": "9c6869916083eed7d04870a21f559fac", "score": "0.6427331", "text": "function createMark(data){\n\t\t\t\t//\tCreo el nuevo marcador y lo asigno al mapa principal\n\t\t\t\tvar myLatLng = new google.maps.LatLng(data.latitude,data.longitude);\n\t\t\t\tvar tmp_marks = new google.maps.Marker({\n\t\t\t\t\tposition: myLatLng,\n\t\t\t\t\ticon: \"images/location.png\",\n\t\t\t\t\tmap: map\n\t\t\t\t});\n\t \t\t\tvar contentString = '<h3>'+data.name+'</h3>';\n\t \t\t\t\tcontentString += '<p>';\n\t \t\t\t\tcontentString += data.addres;\n\t \t\t\t\tcontentString += '</p>';\n\n\t\t\t\tvar infowindow = new google.maps.InfoWindow({\n\t\t\t\t content: contentString,\n\t\t\t\t maxWidth: 200\n\t\t\t\t});\n\t\t\t\t// infowindow.open(map, tmp_marks);\n\t\t\t\tgoogle.maps.event.addListener(tmp_marks, 'click', function () {\n\t\t\t\t\t// infowindow.setContent(this.html);\n\t\t\t\t\tinfowindow.open(map, this);\n\t\t\t\t});\n\t\t\t\t// Agrego la marka en el Array de markas\n\t\t\t\tmarks.push(tmp_marks);\n\t\t\t\tinfo.push(infowindow);\n\n\t\t\t}", "title": "" }, { "docid": "7b145841ab34e26ff200e1198336217a", "score": "0.64258", "text": "function addMarker(position, title, markerText, markerColor) {\n var pinImage = new google.maps.MarkerImage(\"http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=\" + markerText + \"|\" + markerColor + \"|FFF\");\n var bounds = new google.maps.LatLngBounds();\n var marker = new google.maps.Marker({\n position: position,\n map: map,\n //animation: google.maps.Animation.DROP,\n icon: pinImage,\n title: title\n });\n bounds.extend(marker.position);\n}", "title": "" }, { "docid": "583ca750f6f8a89471e02f78b60e610c", "score": "0.6415128", "text": "function addAMarker(position, someObject) {\n\n var marker = new google.maps.Marker({\n position: position,\n animation: google.maps.Animation.DROP,\n icon: \"food.png\",\n map: map\n });\n\n var infowindow = new google.maps.InfoWindow({\n content: someObject.info\n });\n\n marker.addListener(\"click\", function() {\n if (currentInfoWindow) {\n currentInfoWindow.close();\n }\n infowindow.open(map, marker);\n map.setCenter(marker.position);\n currentInfoWindow = infowindow;\n\n });\n\n }", "title": "" }, { "docid": "fec7b5e3fa309bfcd87d8f2a6a19edb6", "score": "0.640883", "text": "function createMarker(point, i, markerLength) {\r\n\r\n\tvar icon = new GIcon();\r\n\ticon.shadow = \"mm_20_shadow.png\";\r\n\ticon.iconSize = new GSize(24, 38);\r\n\ticon.shadowSize = new GSize(22, 20);\r\n\r\n\ticon.iconAnchor = new GPoint(10, 34); \r\n\ticon.infoWindowAnchor = new GPoint(9, 5);\r\n\t\t\t\t\t\t\r\n\tif (i == 0 ){\r\n\t\tcheckPoints[currentCheckPoint] = {\r\n\t\t\ttimestamp: markers[i].getElementsByTagName('Time')[0].firstChild.nodeValue\r\n\t\t};\r\n\t\tmap.centerAndZoom(point, 2);\r\n\t\ticon.image = \"mm_20_green.png\";\r\n\t\tvar marker = new GMarker(point,icon);\r\n\t\tmap.addOverlay(marker);\r\n\t\tGEvent.addListener(marker, \"click\", function() {\r\n\t\tmarker.openInfoWindowHtml(\"¿ªÊ¼\");});\r\n\t\treturn marker;\r\n\t} else if(i == markers.length -1){\r\n\t\ticon.image = \"mm_20_red.png\";\r\n\t\tvar marker = new GMarker(point,icon);\r\n\t\tmap.addOverlay(marker);\r\n\t\tGEvent.addListener(marker, \"click\", function() {\r\n\t\tmarker.openInfoWindowHtml(\"½áÊø\");});\r\n\t\tmap.recenterOrPanToLatLng(point, 2000);\r\n\t\treturn marker;\r\n\t}\t\t\r\n\r\n\tif (checkPointDistance - checkPoint >= 0 && checkPoint != 0){\r\n\t\tcurrentCheckPoint = currentCheckPoint + 1;\r\n\t\tcheckPoints[currentCheckPoint] = {\r\n\t\t\ttimestamp: markers[i].getElementsByTagName('Time')[0].firstChild.nodeValue\r\n\t\t};\r\n\r\n\t\tvar thisCheckPointDuration = getTimeBetweenCheckPoints(checkPoints[currentCheckPoint-1].timestamp,checkPoints[currentCheckPoint].timestamp);\r\n\t\tvar thisCheckPoint = currentCheckPoint;\r\n\t\tvar lastMileMinutes = thisCheckPointDuration / 60;\r\n\t\tvar mileTime = displayMinutes(lastMileMinutes);\r\n\t\tif (lastMileMinutes < 6.5) {\r\n\t\t\ticon.image = \"images/red\" + thisCheckPoint + \".png\";\r\n\t\t} else {\r\n\t\t\ticon.image = \"images/green\" + thisCheckPoint + \".png\";\r\n\t\t}\r\n\t\tvar distance1 = checkPointDistance;\r\n\t\tvar marker = new GMarker(point,icon);\r\n\t\tmap.addOverlay(marker);\r\n\t\tGEvent.addListener(marker, \"click\", function() {\r\n\t\tmarker.openInfoWindowHtml(\"Distance: \" + thisCheckPoint + \" mi.<br/>Last Mile \" + mileTime);});\r\n\t\tcheckPointDistance = 0;\r\n\t\tcheckPointCount += 1;\r\n\t} else {\r\n\t\tvar marker = new GMarker(point, icon);\r\n\t}\r\n\t\t\r\n\treturn marker;\r\n}", "title": "" }, { "docid": "49da4f4214d7590bbaaf6b419886d9e5", "score": "0.6407527", "text": "function addMarker(location, map, title, ic) {\r\n var marker = new google.maps.Marker({\r\n position: location, \r\n map: map,\r\n title: title,\r\n icon: ic\r\n });\r\n markers.push(marker);\r\n}", "title": "" }, { "docid": "1839fdd6f1ea0a6d1526f7ca04f92e87", "score": "0.6405961", "text": "function add_marker( $marker, map ) {\n\n // var\n var latlng = new google.maps.LatLng( $marker.attr('data-lat'), $marker.attr('data-lng') );\n\n // create marker\n var marker = new google.maps.Marker({\n position : latlng,\n map : map\n });\n\n // add to array\n map.markers.push( marker );\n\n // if marker contains HTML, add it to an infoWindow\n if( $marker.html() )\n {\n // create info window\n var infowindow = new google.maps.InfoWindow({\n content : $marker.html()\n });\n\n // show info window when marker is clicked\n google.maps.event.addListener(marker, 'click', function() {\n\n infowindow.open( map, marker );\n\n });\n }\n\n}", "title": "" }, { "docid": "a5da0ed9ae9290518be311d9012de925", "score": "0.6398794", "text": "_setupMarker()\n\t{\n\t\t/*\tthis is now deprecated and replaced by _body.hitArea\n\t\t// transparent rectangle necessary to capture pointer events outside of marker and labels:\n\t\tconst eventCaptureRectangle = new PIXI.Graphics();\n\t\teventCaptureRectangle.beginFill(0, 0);\n\t\teventCaptureRectangle.drawRect(\n\t\t\t-this._barSize_px[0] / 2 - this._tickSize_px[0] / 2,\n\t\t\t-this._barSize_px[1] / 2 - this._tickSize_px[1] / 2,\n\t\t\tthis._barSize_px[0] + this._tickSize_px[0],\n\t\t\tthis._barSize_px[1] + this._tickSize_px[1]\n\t\t);\n\t\teventCaptureRectangle.endFill();\n\t\tthis._pixi.addChild(eventCaptureRectangle);\n\t\t*/\n\n\t\t// marker:\n\t\tthis._marker = new PIXI.Graphics();\n\t\tlet markerVal = undefined;\n\n\t\tif (Number.isFinite(this._rating))\n\t\t{\n\t\t\tmarkerVal = this._rating;\n\t\t}\n\t\telse if (Number.isFinite(this._startValue))\n\t\t{\n\t\t\tmarkerVal = this._startValue;\n\t\t}\n\n\t\tif (Number.isFinite(markerVal))\n\t\t{\n\t\t\tthis._markerPos = this._granularise(markerVal);\n\t\t\tconst visibleMarkerPos = this._ratingToPos([this._markerPos]);\n\t\t\tthis._marker.position = to_pixiPoint(visibleMarkerPos[0], this.units, this.win, true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis._marker.alpha = 0; // invisible until markerPos is defined\n\t\t}\n\t\tthis._marker.interactive = true;\n\t\tthis._pixi.addChild(this._marker);\n\n\t\tconst halfMarkerSize_px = Math.round(Math.max(...this._markerSize_px) / 2);\n\t\tif (this._markerType === Slider.Shape.DISC)\n\t\t{\n\t\t\tthis._marker.lineStyle(1, this._markerColor.int, 1, 0.5);\n\t\t\tthis._marker.beginFill(this._markerColor.int, 1);\n\t\t\tthis._marker.drawCircle(0, 0, halfMarkerSize_px);\n\t\t\tthis._marker.endFill();\n\t\t}\n\t\telse if (this._markerType === Slider.Shape.TRIANGLE)\n\t\t{\n\t\t\tthis._marker.lineStyle(1, this._markerColor.int, 1, 0.5);\n\t\t\tthis._marker.beginFill(this._markerColor.int, 1);\n\t\t\tthis._marker.moveTo(0, 0);\n\t\t\tif (this._isHorizontal())\n\t\t\t{\n\t\t\t\tif (this._flip)\n\t\t\t\t{\n\t\t\t\t\tthis._marker.lineTo(halfMarkerSize_px, halfMarkerSize_px);\n\t\t\t\t\tthis._marker.lineTo(-halfMarkerSize_px, halfMarkerSize_px);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._marker.lineTo(halfMarkerSize_px, -halfMarkerSize_px);\n\t\t\t\t\tthis._marker.lineTo(-halfMarkerSize_px, -halfMarkerSize_px);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (this._flip)\n\t\t\t\t{\n\t\t\t\t\tthis._marker.lineTo(-halfMarkerSize_px, halfMarkerSize_px);\n\t\t\t\t\tthis._marker.lineTo(-halfMarkerSize_px, -halfMarkerSize_px);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._marker.lineTo(halfMarkerSize_px, halfMarkerSize_px);\n\t\t\t\t\tthis._marker.lineTo(halfMarkerSize_px, -halfMarkerSize_px);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._marker.endFill();\n\t\t}\n\t\telse if (this._markerType === Slider.Shape.BOX)\n\t\t{\n\t\t\tthis._marker.lineStyle(1, this.getContrastedColor(this._markerColor, 0.5).int, 1, 0);\n\t\t\tthis._marker.beginFill(this._markerColor.int, 1);\n\t\t\tthis._marker.drawRect(\n\t\t\t\tMath.round(-this._markerSize_px[0] / 2),\n\t\t\t\tMath.round(-this._markerSize_px[1] / 2),\n\t\t\t\tthis._markerSize_px[0],\n\t\t\t\tthis._markerSize_px[1],\n\t\t\t);\n\t\t\tthis._marker.endFill();\n\n\t\t\t// this._marker.lineStyle(1, new Color('white').int, 1, 0.5);\n\t\t\t// this._marker.drawCircle(0, 0, this._markerSize_px[0] / 3);\n\t\t}\n\n\t\t// marker mouse events:\n\t\tconst self = this;\n\t\tself._markerDragging = false;\n\n\t\t// mouse wheel over slider:\n\t\tif (this._isSliderStyle)\n\t\t{\n\t\t\tself._pointerIsOver = false;\n\n\t\t\tthis._pixi.pointerover = this._pixi.mouseover = (event) =>\n\t\t\t{\n\t\t\t\tself._pointerIsOver = true;\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\t\t\tthis._pixi.pointerout = this._pixi.mouseout = (event) =>\n\t\t\t{\n\t\t\t\tself._pointerIsOver = false;\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\n\t\t\t/*renderer.view.addEventListener(\"wheel\", (event) =>\n\t\t\t{\n\n\t\t\t}*/\n\t\t}\n\t}", "title": "" }, { "docid": "bb9738238238be968effb49e6d8bd251", "score": "0.6397238", "text": "function addMarkerFD(location) {\n var marker = new google.maps.Marker({\n position: location,\n map: map,\n icon: \"img/fs-small-size.png\"\n });\n}", "title": "" }, { "docid": "28c072fa5e66687d117d16ba670abd20", "score": "0.6396234", "text": "function renderMap()\n{\n\tme = new google.maps.LatLng(myLat, myLng);\n \n\t// Update map and go there\n\tmap.panTo(me);\n\n\t// Create a marker\n\tvar my_image = 'cat.jpg';\n\tmarker = new google.maps.Marker({\n\t\tposition: me,\n\t\ttitle: \"Here I am!\",\n\t\ticon: my_image,\n\t});\n\tmarker.setMap(map);\n\n\tvar my_marker = \"<strong>\" + marker.title + \"</strong></br> \" + login\n\n\t// Open info window on click of marker\n\tgoogle.maps.event.addListener(marker, 'click', function() {\n\t\tinfowindow.close();\n\t\tinfowindow.setContent(my_marker);\n \tinfowindow.open(map, marker);\n\t});\n\n\t// create markers using data from the database API\n\tfor (var i = 0; i < data.length; i++) {\n\t\tif( data[i].login != \"JeremyMaletic\" ) // don't want to map myself twice\n\t\t\tcreateMarker(data[i]);\n\t}\n}", "title": "" }, { "docid": "37f918c273948ea4790eba8a3ce4509a", "score": "0.63951665", "text": "function createMarker(map, latlng, name, html, event_link) {\n var contentString = \"<h3>\" + name + \"</h3>\" + \"<p>\" + html + \"</p>\";\n var index = gmarkers.length;\n var icon_link = \"http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=\" + index + \"%7CFF0000%7C000000\";\n var marker = new google.maps.Marker({\n position: latlng,\n map: map,\n title: name,\n icon: icon_link,\n //zIndex: Math.round(latlng.lat()*-100000)<<5\n });\n marker.event_link = event_link;\n\n //show popu with title / description on mouseover\n google.maps.event.addListener(marker, 'mouseover', function() {\n infowindow.setContent(contentString); \n infowindow.open(map,marker);\n });\n\n //go to event's detail page on click\n google.maps.event.addListener(marker, 'click', function() {\n window.location = event_link;\n });\n // save the info we need to use later for the side_bar\n gmarkers.push(marker);\n // add a line to the side_bar html\n add_item_to_sidebar(index);\n}", "title": "" }, { "docid": "b8720c1afc854a859395bc5ad98049ce", "score": "0.6394561", "text": "function addMarker(location, map) {\n marker = new google.maps.Marker({\n position: location,\n animation:google.maps.Animation.BOUNCE,\n map: map\n }); \n }", "title": "" }, { "docid": "4dab68182500543de16aeca6af0232a6", "score": "0.6391679", "text": "function showMarkerOnFrontend(latitude, longitude, name, level) {\n var markerLocation = {lat: latitude, lng: longitude};\n var marker = new google.maps.Marker({\n position: markerLocation,\n icon: levelImg(level), \n map: map, \n customInfo: {name, level}\n });\n\n google.maps.event.addDomListener(marker, 'click', function(e) {\n alert(\"clicked marker\");\n });\n google.maps.event.addDomListener(marker, 'mouseover', function(e) {\n $(\"#fish-pin-name\").text(this.customInfo.name);\n $(\"#fish-pin-level\").text(this.customInfo.level);\n $(\"#fish-pin-lat\").text(this.position.lat());\n $(\"#fish-pin-lng\").text(this.position.lng());\n });\n google.maps.event.addDomListener(marker, 'mouseout', function(e) {\n $(\"#fish-pin-name\").text(\"\");\n $(\"#fish-pin-level\").text(\"\");\n $(\"#fish-pin-lat\").text(\"\");\n $(\"#fish-pin-lng\").text(\"\");\n });\n }", "title": "" }, { "docid": "4d9365229a340bc54df0812fe85bf014", "score": "0.6391299", "text": "function add_marker( $marker, map ) {\n\n // var\n var latlng = new google.maps.LatLng( $marker.attr('data-lat'), $marker.attr('data-lng') );\n\n // create marker\n var marker = new google.maps.Marker({\n position\t: latlng,\n map\t\t\t: map\n });\n\n // add to array\n map.markers.push( marker );\n\n // if marker contains HTML, add it to an infoWindow\n if( $marker.html() )\n {\n // create info window\n var infowindow = new google.maps.InfoWindow({\n content\t\t: $marker.html()\n });\n\n // show info window when marker is clicked\n google.maps.event.addListener(marker, 'click', function() {\n\n infowindow.open( map, marker );\n\n });\n }\n\n }", "title": "" }, { "docid": "ce6d94169ac56208e4fcd2cb0ac81be8", "score": "0.63883597", "text": "function addmarker(airport, col) {\n var infoString;\n if (dest != undefined && airport.icao == dest.icao) {\n infoString = \"Destination\" + \"<br>\";\n infoString += \"Icao: \" + airport.icao;\n } else {\n infoString = \"Icao: \" + airport.icao + \"<br>\";\n infoString += \"Distance: \" + airport.distance + \"km <br>\";\n infoString += \"Has tower: \" + airport.has_tower + \"<br>\";\n infoString += \"Longest Runway: \" + airport.longest_runway + \" ft <br>\";\n infoString += \"Approaches: \" + airport.approaches;\n }\n\n center = new google.maps.LatLng(Number(airport.lat), Number(airport.lon));\n let url = \"http://maps.google.com/mapfiles/ms/icons/\" + col + \"-dot.png\";\n marker = new google.maps.Marker({\n position: center,\n map: map,\n icon: {\n url: url,\n }\n });\n\n google.maps.event.addListener(marker, 'click', (function (marker) {\n return function () {\n infowindow.setContent(infoString);\n infowindow.open(map, marker);\n }\n })(marker));\n map_markers[airport.icao] = marker;\n}", "title": "" }, { "docid": "de84d1af0342fb4fa19f9d8ee7e4536c", "score": "0.63843954", "text": "function addMarker(lat,lng,title,message){\n console.log(message)\n L.marker([lat,lng]).addTo(myMap).bindPopup(`<h2>${title}</h2>`)\n createButtons(lat,lng,title); // new line!!!\n return message\n}", "title": "" }, { "docid": "902e78a17d19b6ead4338ff21977539f", "score": "0.6381574", "text": "function addMarker(obj){\n var marker = new google.maps.Marker({\n position: obj.coords,\n map: map,\n icon: obj.icon\n });\n\n var infoWindow = new google.maps.InfoWindow({\n content: obj.info\n });\n marker.addListener('mouseover', function() {\n infoWindow.open(map, marker);\n });\n marker.addListener('mouseout', function() {\n infoWindow.close(map,marker);\n });\n }", "title": "" }, { "docid": "b3bacf0ec01d6e5c14435719bbfd10be", "score": "0.6380643", "text": "function makeeMarkersIcoon(markerColor) { //passing marker color and building marker icon in this function to tell what marker will do\n var markersImg = new google.maps.MarkerImage(\n //it is just like a fnote work same as pin ::\n // http://chart.googleapis.com/chart?chst=d_fnote_title&chld=balloon|1|#99ffea| '\n //chst::type of marker\n //chld::styling of marker\n 'http://chart.googleapis.com/chart?chst=d_fnote_title&chld=balloon|1|#99ffea|' + markerColor +\n '#99ffea',\n new google.maps.Size(20, 30), //size of marker height and widh\n new google.maps.Point(0, 0),\n new google.maps.Point(11, 32), //accuracy of pointing .\n new google.maps.Size(22, 36));\n return markersImg;\n }", "title": "" }, { "docid": "661636694b79a4e64412b6c4b4a922d4", "score": "0.6357654", "text": "function addMarker (props){\n var marker = new google.maps.Marker({\n position: props.coordinates, //buckhead\n map:map,\n //icon:props.iconImage\n });\n\n //check for customicon\n if(props.iconImage) {\n //set Icon Image\n marker.setIcon(props.iconImage);\n }\n\n //check content\n if(props.content) {\n var infoWindow = new google.maps.InfoWindow({\n content: props.content\n });\n\n marker.addListener('click', function() {\n infoWindow.open(map, marker);\n });\n }\n\n }", "title": "" }, { "docid": "9e3cd834b12b259fcad0aee0ea4b78fa", "score": "0.6354727", "text": "function addMarker(latlng,flag) {\n\t\tif (map.graphics){\n\t\t\t map.graphics.clear();\n\t\t}\n\t\tif(flag==1) // differentiate if it is search location or get location\n\t\t{\n\t\t\t//var symbol = new esri.symbol.PictureMarkerSymbol('./src/css/custom/img/red-pin.png', 37, 75); //commented by lavanya satuluri 9-sept-2014\n\t\t\tvar symbol = new esri.symbol.PictureMarkerSymbol('./src/css/custom/img/red_glow.gif', 50, 50); //added by lavanya satuluri 9-sept-2014\n\t\t}\n\t\telse\n\t\t{\t\t\t\n\t\t\tvar symbol = new esri.symbol.PictureMarkerSymbol('./src/css/custom/img/locate-pin.png', 55, 55);\n\t\t}\n\t\tvar marker = new esri.Graphic(latlng, symbol);\n\t\tmap.graphics.add(marker);\n\t\t\n\t\t//lavanya test 12 sept 2014\n\t\t // if(audePlanFlag == 1)\n\t\t// {\n\t\t // queryAUDEPoints();\n\t\t// }\n\t}", "title": "" }, { "docid": "eb8e375fc0a46d2d03b6692277ce91b9", "score": "0.6341639", "text": "AddMarker(position, map) {\n return new google.maps.Marker({\n position,\n map,\n // label: this.getLabel()\n });\n }", "title": "" }, { "docid": "b5ba4ffbab607aefd2d6c0f1faf934b1", "score": "0.63396925", "text": "function pstarMarker(lat,lng,title,message){\n console.log(message)\n L.marker([lat,lng],{icon: myIcon}).addTo(map).bindPopup(`<h2>${message}</h2>`).openPopup();\n createButtons(lat,lng,title); // new line!!!\n return message\n}", "title": "" }, { "docid": "d0259d659510238183bf29cc039bf570", "score": "0.6338166", "text": "function addMarker(lat,lng,title,message,zoom){\n console.log(message)\n L.marker([lat,lng]).addTo(myMap).bindPopup(`<h2>${title}</h2>`)\n createButtons(lat,lng,title,zoom); // new line!!!\n return message\n}", "title": "" }, { "docid": "5fd5e22c45926f5b669be4f0e1106239", "score": "0.6335354", "text": "function setMarkers(map, rooms2) {\n\n var shape = {\n coords: [1, 1, 1, 20, 18, 20, 18, 1],\n type: 'poly'\n };\n \n for (var i = 0; i < rooms2.length; i++) {\n\n var room = rooms2[i];\n\n var contentString =\n '<div id=\"content\">' +\n '<h1>R$' + room.price + ' / noite</h1>' +\n '<div>' + room.name + '</div>' +\n '</div>'; \n\n infowindow.setContent(contentString);\n \n var marker = new google.maps.Marker({\n position: { lat: room.lat, lng: room.lng },\n map: map,\n shape: shape,\n label: labels[labelIndex++ % labels.length],\n \n });\n attachContent(marker, contentString);\n } \n\n function attachContent(marker, contentString) {\n \n marker.addListener('click', function () {\n infowindow.setContent(contentString);\n infowindow.open(map, this) \n });\n } \n}", "title": "" }, { "docid": "5cecc8c7d8108cdf53d5740a3d9b64ec", "score": "0.63351023", "text": "function crearMarker(id, nombre, direccion, icono, ilatitud, ilongitud, mostrarInfo){\n\ticono='img/categorias/'+icono+'.png';\n\tvar localizacion = new google.maps.LatLng(ilatitud, ilongitud);\n\t\n\tvar marker = new google.maps.Marker({\n\t\t position: localizacion, \n\t\t map: map,\n\t\t //draggable:true,\n\t\t animation: google.maps.Animation.DROP,\n\t\t icon: icono\n\t });\n\n\t marcadores.push(marker); //Agrego marcador a una lista de marcadres\n\t //Elimino todas las ventanas\n\t delVentans();\n\t \n\t //Evento mover mouse\n\t google.maps.event.addListener(marker, 'mouseover', \n\t function (){\n\t\t makerMouseOver(nombre, direccion, localizacion, mostrarInfo);\n\t });\n\t \n\t //evento click\n\t google.maps.event.addListener(marker, 'click', \n\t function (){\n\t\t clickMarker(id);\n\t\t map.setCenter(localizacion);\n\t\t \n\t });\n\t if (mostrarInfo)\n\t \tmakerMouseOver(nombre, direccion, localizacion, mostrarInfo);\n}", "title": "" }, { "docid": "ec77f43da68e60c68e2b18fe30de0e80", "score": "0.63331103", "text": "function add_marker( $marker, map ) {\n\n\t// var\n\tvar latlng = new google.maps.LatLng( $marker.attr('data-lat'), $marker.attr('data-lng') );\n\n\t// create marker\n\tvar marker = new google.maps.Marker({\n\t\tposition\t: latlng,\n\t\tmap\t\t\t: map\n\t});\n\n\t// add to array\n\tmap.markers.push( marker );\n\n\t// if marker contains HTML, add it to an infoWindow\n\tif( $marker.html() )\n\t{\n\t\t// create info window\n\t\tvar infowindow = new google.maps.InfoWindow({\n\t\t\tcontent\t\t: $marker.html()\n\t\t});\n\n\t\t// show info window when marker is clicked\n\t\tgoogle.maps.event.addListener(marker, 'click', function() {\n\n\t\t\tinfowindow.open( map, marker );\n\n\t\t});\n\t}\n\n}", "title": "" }, { "docid": "127313cb1a037c4e269e0a5dafab7fea", "score": "0.6332257", "text": "function addInfoBubble(map) {\n let group = new H.map.Group();\n\n map.addObject(group);\n// envento tap': abre la info del group\n group.addEventListener('tap', function (evt) {\n\n// para todos los objetos que contiene\n let bubble = new H.ui.InfoBubble(evt.target.getPosition(), {\n// lee la info\n content: evt.target.getData()\n });\n// muestra la info\n ui.addBubble(bubble);\n }, false);\n\n let numero_reporte = document.getElementsByClassName('id_reporte');\n let longitud = document.getElementsByClassName('longitud');\n let latitud = document.getElementsByClassName('latitud');\n let foto = document.getElementsByClassName('foto');\n let descripcion= document.getElementsByClassName('descripcion');\n //iteramos los reportes y los agregamos al mapa\n for(let i = 0; i < longitud.length; i++){\n\n addMarkerToGroup(group, {lat: latitud[i].innerHTML, lng: longitud[i].innerHTML},\n '<div class=\"infoReporte\"><div><p>'+numero_reporte[i].innerHTML +'</p><a> <img class=\"reporte\" src=\"'+foto[i].innerHTML+'\"></a>' +\n '</div><div> '+descripcion[i].innerHTML+'</div></div>');\n\n }\n\n}", "title": "" }, { "docid": "e31219ba458a8e64ad514e44d0157d62", "score": "0.6329666", "text": "function addMarker(map, position, description, popup) {\n L.mapquest.textMarker(position, {\n text: description,\n title: popup,\n position: 'right',\n type: 'marker',\n icon: {\n primaryColor: '#FF0000',\n secondaryColor: '#00FF00',\n size: 'sm'\n }\n\n\n }).addTo(map);\n } // end inner function addMarker", "title": "" }, { "docid": "287d1d08692a9fc1e911222cc87c2fd5", "score": "0.63294244", "text": "function addMarker(place)\n{\n // configure marker and add to map\n var marker = new google.maps.Marker({\n position: {lat: place.latitude, lng: place.longitude},\n map: map,\n title: 'News for ' + place.place_name,\n icon: Flask.url_for(\"static\", {\"filename\": \"newsagent.png\"})\n });\n\n // set click listener on each marker\n marker.addListener('click', function() {\n\n // update content of info window to ajax gif\n showInfo();\n\n // open info window\n info.open(map, marker);\n\n // fetch articles for marker's zip code\n var parameters = {\n geo: place.postal_code\n };\n $.getJSON(Flask.url_for(\"articles\"), parameters)\n .done(function(data, textStatus, jqXHR) {\n\n // prepare content based on returned articles\n var ul = \"<ul>\";\n $.each(data, function(i, obj) {\n ul += infotemplate(obj);\n });\n ul += \"</ul>\";\n\n // update info window to list of articles\n showInfo(ul);\n })\n .fail(function(jqXHR, textStatus, errorThrown) {\n\n // log error to browser's console\n console.log(errorThrown.toString());\n });\n });\n\n // add marker to global marker array\n markers.push(marker);\n}", "title": "" }, { "docid": "2443ffb57f7a7c40fa7477e06af34d96", "score": "0.63285184", "text": "function createMarker(cart) {\n var marker = new google.maps.Marker({\n position: cart.pos,\n map: map,\n contentString: cart.contentString\n })\n marker.addListener('click', function() {\n showInfoWindow(marker);\n })\n markers.push(marker);\n }", "title": "" }, { "docid": "fcca66d4327770ae200b47dd6c7ab2fa", "score": "0.6321554", "text": "function addMarker(feature) {\n\t\tvar contentString = '<div id=\"content\">'+\n\t\t\t\t\t \t'<h3 class=\"firstHeading\">'+feature.heading+'</h3>'+ //titel goes here\n\t\t\t\t\t \t//id was probably only necessary for delete function\n\t\t\t\t\t \t'<div id=\"bodyContent\" data-id=\"' + feature.placesId + '\">'+ \n\t\t\t\t\t \t\t'<p>'+feature.description+'</p>'+ // description goes here\n\t\t\t\t\t \t'</div>'+\n\t\t\t\t\t \t'</div>';\n\n\t\tvar marker = new google.maps.Marker({\n \tposition: feature.position,\n\t\t\tmap: map,\n\t\t\ticon: icons[feature.type]\n\t\t});\n\t\t\n\t\t//eventlistener to display information when pin is clicked\n\t\tmarker.addListener('click', function() {\n\t\t\tinfowindow.close();\n\t\t\tinfowindow = new google.maps.InfoWindow({\n\t \t\tcontent: contentString,\n\t \t\t});\n\t \tinfowindow.open(map, this);\n //marker.setIcon('https://www.google.com/mapfiles/marker_green.png'); //change image to different icon\n\t \t });\n\n\t\tmarkers.push(marker);\n\t}", "title": "" }, { "docid": "e2c65cb8a3515f0213d06aa5c8772e5d", "score": "0.63212", "text": "function createMarker(latlng, name, id, html, label, color, pin, colorstroke) {\n var contentString = html;\n var marker = new google.maps.Marker({\n position: latlng,\n label: label,\n map: map,\n zIndex: Math.round(latlng.lat() * -100000) << 5,\n icon: pinSymbol(color, colorstroke, pin),\n scaledSize: new google.maps.Size(50, 50)\n });\n google.maps.event.addListener(marker, 'click', function () {\n infowindow.setContent(contentString);\n infowindow.open(map, marker);\n });\n // save the info we need to use later for the side_bar\n gmarkers.push(marker);\n // add a line to the side_bar html\n side_bar_html += '<div class=\"side-bar_element\"><a href=\"javascript:myclick(' + (gmarkers.length - 1) + ')\">' + name + '<\\/a></div>';\n}", "title": "" }, { "docid": "98f5d462644c01241d13245777af4ba0", "score": "0.63208103", "text": "function sbvcgmap_add_marker( $marker, map, map_id ) {\r\n\t \r\n\t\tvar latlng = new google.maps.LatLng( $marker.attr('data-lat'), $marker.attr('data-lng') );\r\n\t\tvar animation = sbvcgmap_get_marker_animation($marker.attr('animation'));\r\n\t\t// create marker\r\n\t\tvar marker = new google.maps.Marker({\r\n\t\t\tposition\t: latlng,\r\n\t\t\tmap\t\t\t: map,\r\n\t\t\tanimation\t: animation,\r\n\t\t\ticon\t\t: $marker.attr('icon')\r\n\t\t});\r\n\t \r\n\t\t// add to array\r\n\t\tmap.markers.push( marker );\r\n\t\tsbvcgmap_markers[map_id].push( marker );\r\n\t\t\r\n\t\t// if marker contains HTML, add it to an infoWindow\r\n\t\tif($marker.html()) {\r\n\t\t\t// create info window\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tvar customstyles = sbvcgmap_check_bool($marker.attr('customstyles'));\r\n\t\t\t\r\n\t\t\tif(customstyles) {\r\n\r\n\t\t\t\tvar csbg = $marker.attr('csbg');\r\n\t\t\t\r\n\t\t\t\tvar cswidth = $marker.attr('cswidth');\r\n\t\t\t\tvar cspadding = $marker.attr('cspadding');\r\n\t\t\t\tvar csborderradius = $marker.attr('csborderradius');\r\n\t\t\t\tvar csboxshadow = $marker.attr('csboxshadow');\r\n\t\t\t\tvar csborder = $marker.attr('csborder');\r\n\t\t\t\t\r\n\t\t\t\tvar cscloseimage = $marker.attr('cscloseimage');\r\n\t\t\t\tvar csclosemargin = $marker.attr('csclosemargin');\r\n\t\t\t\t\r\n\t\t\t\tvar csxposition = parseInt($marker.attr('csxposition'));\r\n\t\t\t\tvar csyposition = parseInt($marker.attr('csyposition'));\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tvar infowindow = new InfoBox({\r\n\t\t\t\t\tcontent: $marker.html()\r\n\t\t\t\t\t,disableAutoPan: false\r\n\t\t\t\t\t,maxWidth: 0\r\n\t\t\t\t\t,alignBottom: true\r\n\t\t\t\t\t,pixelOffset: new google.maps.Size(csxposition, csyposition)\r\n\t\t\t\t\t,zIndex: null\r\n\t\t\t\t\t,boxStyle: { \r\n\t\t\t\t\t\tbackground: csbg\r\n\t\t\t\t\t\t,opacity: 1\r\n\t\t\t\t\t\t,border: csborder\r\n\t\t\t\t\t\t,width: cswidth\r\n\t\t\t\t\t\t,padding: cspadding\r\n\t\t\t\t\t\t,boxShadow: csboxshadow\r\n\t\t\t\t\t\t,borderRadius: csborderradius\r\n\t\t\t\t\t}\r\n\t\t\t\t\t,closeBoxMargin: csclosemargin\r\n\t\t\t\t\t,closeBoxURL: cscloseimage\r\n\t\t\t\t\t,infoBoxClearance: new google.maps.Size(10, 10)\r\n\t\t\t\t\t,isHidden: false\r\n\t\t\t\t\t,pane: 'floatPane'\r\n\t\t\t\t\t,enableEventPropagation: false\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tvar infowindow = new google.maps.InfoWindow({\r\n\t\t\t\t\tcontent\t\t: $marker.html()\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t \r\n\t\t\t// show info window when marker is clicked\r\n\t\t\tgoogle.maps.event.addListener(marker, 'click', function() {\r\n\t\t\t\t$('.sbvcgmap-map .infoBox > img:first').trigger('click');\r\n\t\t\t\t$('.gm-style-iw').each(function(){\r\n\t\t\t\t\t$(this).next('div').trigger('click');\r\n\t\t\t\t});\r\n\t\t\t\tinfowindow.open( map, marker );\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tvar infowindow_popup = sbvcgmap_check_bool($marker.attr('infowindow'));\r\n\t\t\tif(infowindow_popup) {\r\n\t\t\t\tinfowindow.open( map, marker );\r\n\t\t\t}\r\n\t\t}\r\n\t \r\n\t}", "title": "" }, { "docid": "da6ee3ba6a57eb9491bc6a5dd80ece12", "score": "0.6320775", "text": "function showMarkers() {\r\n setAllMap(map);\r\n}", "title": "" }, { "docid": "0acf3e47aca910d9898c414ee6d25cd7", "score": "0.6318034", "text": "function addMarker(lat,lng,title,message){\n console.log(message)\n L.marker([lat,lng]).addTo(map).bindPopup(`<h2>${message}</h2>`)\n createButtons(lat,lng,title); // new line!!!\n return message\n}", "title": "" }, { "docid": "0a55caf10352931f18162b75a3ef3402", "score": "0.6316778", "text": "function addMarker(myLatLng, urls, content) {\n \n var image = \"http://maps.google.com/mapfiles/ms/icons/red-dot.png\"; // smaller pin\n var marker = new google.maps.Marker({\n position: myLatLng,\n map: map,\n animation: google.maps.Animation.DROP\n // icon: image\n });\n\n // create new info window object\n var infowindow = new google.maps.InfoWindow({\n content: content\n });\n\n marker.addListener('click', function() {\n while (infoWindows.length > 0) {\n infoWindows.pop().setMap(null);\n }\n infowindow.open(map, marker);\n infoWindows.push(infowindow);\n\n // call get directions here\n getDirections(myLatLng);\n\n // After you open the info window, the see-pictures element exists, so\n // we can now define its click handler.\n $(\"#see-pictures\").click(function(evt) {\n showPictures(myLatLng, urls);\n });\n });\n\n // // listener for when marker clicked, success function is showpics\n // marker.addListener('click', function(evt) { \n // showPictures(myLatLng, urls);\n // // loop through and set each icon back to default, except for the first one (the point searched for)\n // for (var i = 1; i < markers.length; i++) {\n // markers[i].setIcon(null);\n // }\n // // change the selected marker to the sunpin \n // this.setIcon(\"http://i66.tinypic.com/17wjro.png\");\n // });\n\n return marker;\n }", "title": "" }, { "docid": "494117d4e688b38cb6e2222d8e4cd2c1", "score": "0.63157344", "text": "function createMarker(latlng, name, html) {\n var contentString = html;\n var marker = new google.maps.Marker({\n position: latlng,\n map: map,\n zIndex: Math.round(latlng.lat()*-100000)<<5\n });\n\n google.maps.event.addListener(marker, 'click', function() {\n infowindow.setContent(contentString); \n infowindow.open(map,marker);\n });\n // save the info we need to use later for the side_bar\n gmarkers.push(marker);\n // add a line to the side_bar html\n side_bar_html += '<a href=\"javascript:myclick(' + (gmarkers.length-1) + ')\">' + name + '<\\/a><br>';\n}", "title": "" }, { "docid": "9e4402082ea59c28eda99ced433ce20c", "score": "0.6310266", "text": "function setMarkers(map) {\n if ($(\"#mapa\").length > 0) {\n $.getJSON(\"../controlador\", {listar: \"true\"})\n .done(function (json) {\n if (json.length > 0) {\n var infowindow = new google.maps.InfoWindow();\n for (var i = 0; i < puntos.length; i++) {\n //console.log(json[i].api_cloud);\n\n var marker = new google.maps.Marker({\n position: {\n lat: puntos[i][1],\n lng: puntos[i][2]\n },\n map: map,\n title: puntos[i][0]\n });\n\n google.maps.event.addListener(marker, 'click', (function (marker, i) {\n return function () {\n infowindow.setContent('<img src=\"' + puntos[i][3]\n + '\" width=\"200px\">');\n infowindow.open(map, marker);\n }\n })(marker, i));\n }\n }\n });\n }\n \n\n}", "title": "" }, { "docid": "8c5fe99217837fdfcdaf5346dbc6efa0", "score": "0.63097346", "text": "function showMarkers()\n{\n setAllMap(map);\n}", "title": "" }, { "docid": "fe40411bba77170e6e75c64c4fcb0dba", "score": "0.6306435", "text": "function add_marker( $marker, map ) {\n\n\tconsole.log('$marker', $marker);\n\n\t// var\n\tvar latlng = new global.google.maps.LatLng( $marker.attr('data-lat'), $marker.attr('data-lng') );\n\tvar the_icon = $marker.attr('data-icon');\n\tvar the_iconx = $marker.attr('data-iconx');\n\tvar the_icony = $marker.attr('data-icony');\n\tvar lat = $marker.attr('data-lat');\n\tvar lng = $marker.attr('data-lng');\n\tvar redirect_url = $marker.attr('data-redirecturl');\n\tvar address = $marker.attr('data-address');\n\n\tvar marker;\n\n\t// create marker\n\tif (the_icon)\n\t{\n\t\tmarker = new global.google.maps.Marker({\n\t\t\tposition\t: latlng,\n\t\t\tmap\t\t\t: map,\n\t\t\ticon \t\t: {url: the_icon , anchor: new global.google.maps.Point(the_iconx,the_icony) }\n\t\t});\n\t}\n\telse\n\t{\n\t\tmarker = new global.google.maps.Marker({\n\t\t\tposition\t: latlng,\n\t\t\tmap\t\t\t: map\n\t\t});\n\t}\n\n\t// add to array\n\tmap.markers.push(marker);\n\n\t// if marker contains HTML, add it to an infoWindow\n\tif( $marker.html() )\n\t{\n\t\t// create info window\n\t\tvar infowindow = new global.google.maps.InfoWindow({\n\t\t\tcontent\t\t: $marker.html()\n\t\t});\n\n\t\t// show info window when marker is clicked\n\t\tglobal.google.maps.event.addListener(marker, 'click', function() {\n\t\t\tinfowindow.open(map, marker);\n\t\t});\n\t}\n\n\tconsole.log('lat', $marker.attr('data-lat'), 'lng', $marker.attr('data-lng'));\n\n\tglobal.google.maps.event.addListener(marker, 'click', function() {\n\t\t// map.setZoom(14);\n\t\t// map.setCenter(marker.getPosition());\n\t\t//window.open(redirect_url, '_blank'); // <- This is what makes it open in a new window.\n\t\twindow.open('https://www.google.com/maps?q='+address, '_blank'); // <- This is what makes it open in a new window.\n\t});\n\n\t// global.google.maps.event.addListener(marker, 'click', function() {\n\t// \t// create an anchor, add to body, trigger click\n\t// \tvar a = document.createElement('a');\n\t// \ta.setAttribute('href','https://www.google.nl/maps/dir//1e+Hogeweg,+3701+Zeist/@52.0855084,5.2410498,17z/data=!4m13!1m4!3m3!1s0x47c642a8006b2a1d:0x3da088239d5ff057!2s1e+Hogeweg,+3701+Zeist!3b1!4m7!1m0!1m5!1m1!1s0x47c642a8006b2a1d:0x3da088239d5ff057!2m2!1d5.2410498!2d52.0855084');\n\t// \ta.setAttribute('target', '_blank');\n\t// \tdocument.body.appendChild(a);\n\t// \ta.click();\n\t// });\n\n}", "title": "" }, { "docid": "d71ea5e5b40d8cec7fac3377cdfb058e", "score": "0.6304356", "text": "function addFibonacciMarkers(){\n var fibonacciMarker;\n \n for(var i = 0; i < fibonacciPoints.length; i++) {\n fibonacciMarker = new google.maps.Marker({\n position: fibonacciPoints[i].latLng,\n map: map,\n title: fibonacciPoints[i].number.toString()\n });\n }\n }", "title": "" }, { "docid": "87a6cb707cc5b80dbc3114baa46a2d2d", "score": "0.6303495", "text": "function renderRichMarker(i,method){\n if( method == \"latitudeLongitude\" ){\n marker = new RichMarker({\n position: new google.maps.LatLng( markers[i][\"latitude\"], markers[i][\"longitude\"] ),\n map: map,\n draggable: false,\n content: markerContent,\n flat: true\n });\n google.maps.event.addListener(marker, 'click', (function(marker, i) {\n return function() {\n if( markerTarget == \"sidebar\"){\n openSidebarDetail( $(this.content.firstChild).attr(\"data-id\") );\n }\n else if( markerTarget == \"infobox\" ){\n openInfobox( $(this.content.firstChild).attr(\"data-id\"), this, i );\n }\n else if( markerTarget == \"modal\" ){\n openModal($(this.content.firstChild).attr(\"data-id\"), \"modal_item.php\");\n }\n }\n })(marker, i));\n newMarkers.push(marker);\n }\n else if ( method == \"address\" ){\n a = i;\n var geocoder = new google.maps.Geocoder();\n var geoOptions = {\n address: markers[i][\"address\"]\n };\n geocoder.geocode(geoOptions, geocodeCallback(markerContent));\n\n }\n\n if ( mapAutoZoom == 1 ){\n var bounds = new google.maps.LatLngBounds();\n for (var i = 0; i < newMarkers.length; i++ ) {\n bounds.extend(newMarkers[i].getPosition());\n }\n map.fitBounds(bounds);\n }\n\n }", "title": "" }, { "docid": "f5febcefe77e97ca71a7f359bb3e1221", "score": "0.6302669", "text": "function showMarkers() {\r\n console.log(\"showMarkers\");\r\n setAllMap(map);\r\n}", "title": "" }, { "docid": "ad93570c45023b2f2af154ae8c06d016", "score": "0.6302327", "text": "function ajout_marker(lat, lng, libelle, icone) {\n\t\tif(icone)\n\t\t\tvar marker = L.marker([parseFloat(lat).toFixed(6), parseFloat(lng).toFixed(6)], {icon: icone}).addTo(map);\n\t\telse\n\t\t\tvar marker = L.marker([parseFloat(lat).toFixed(6), parseFloat(lng).toFixed(6)]).addTo(map);\n\n\t\t//var a = getAddresse(lat, lng, val_zoom, marker);\n\t\t//console.log(a);\n\n\t marker.bindPopup(libelle+\"<br/>latitude:\"+lat+\", longitude:\"+lng)\n\t .on('mouseover', function(e){ marker.openPopup(); })\n\t .on('mouseout', function(e){ marker.closePopup(); });\n\n\t return marker;\n\t}", "title": "" }, { "docid": "025752e59e69a6dc2ef2ea2e53b0818a", "score": "0.630125", "text": "function createMarker(point, name, html, lat, lng, icontype) {\n var marker = new google.maps.Marker({\n position: point,\n map: map,\n icon: icons[icontype]//,\n //title: \"Hello!\"\n });\n\n markersArray.push(marker);\n\n google.maps.event.addListener(marker, \"click\", function() {\n\n if (infowindow)\n infowindow.close();\n infowindow = new google.maps.InfoWindow({\n content: html\n });\n infowindow.open(map, this);\n });\n points[i] = point;\n lats[i] = lat;\n lngs[i] = lng;\n gmarkers[i] = marker;\n i++;\n return marker;\n }", "title": "" }, { "docid": "34fc6442363499ce2b362037f96dfc22", "score": "0.6295699", "text": "function createMarker() {\n let element = document.createElement('div');\n element.className = 'issIcon';\n let marker = new mapboxgl.Marker(element);\n return marker;\n}", "title": "" }, { "docid": "9c8e0845779f61731b153eee7eadac13", "score": "0.6293196", "text": "function addMarker(map, x, y, description) {\n L.marker([x, y])\n .addTo(map)\n .bindPopup(description);\n}", "title": "" }, { "docid": "944cc24d287cb946d900ccf35b630f2b", "score": "0.6290139", "text": "reRender(map, icon){\n this.marker.setMap(null);\n this.marker = new google.maps.Marker({\n position: this.coords,\n map: map,\n icon: icon\n });\n }", "title": "" }, { "docid": "b4735a94607ac60c5c1ea4d134da5d76", "score": "0.6289949", "text": "function marks(lat,lon,message,image){\n\t\t\t// animation null\n\t\tvar ubicacion=new google.maps.LatLng(lat,lon);\n\t\tvar puntero=new google.maps.Marker({\n\t\t\t\t\t\tposition:ubicacion,\n\t\t\t\t\t\tmap:mapa,\n\t\t\t\t\t\tanimation: google.maps.Animation.DROP,\n\t\t\t\t\t\ticon:image\n\t\t\t\t\t\t});\n\n\n\t\tvar infowindow = new google.maps.InfoWindow({\n\t\t\t\t content: message\n\t\t\t\t});\n\n\t\t\tinfowindow.open(mapa,puntero);\n\n\t\t\tgoogle.maps.event.addListener(puntero, 'click', function() {\n\t\t\tinfowindow.open(mapa,puntero);\n\t\t\t});\n\n\t\t}", "title": "" }, { "docid": "e6dad5bec9e5d9138d87df398bc63661", "score": "0.62890506", "text": "function markerMaker(rest) {\n var popup = new mapboxgl.Popup()\n .setHTML(\"<h1>\" + rest.name + \"</h1>\")\n .setMaxWidth(\"200px\");\n var marker = new mapboxgl.Marker()\n .setLngLat(rest.location)\n .setDraggable(true)\n .setPopup(popup)\n .addTo(map);\n}", "title": "" }, { "docid": "a5c795e633f8303d90bc98f73b7d2991", "score": "0.6288599", "text": "function cargarMarcador(marker,map,lat,lon,dr,im){\n if(marker == undefined){\n var marker = new google.maps.Marker({\n position: new google.maps.LatLng(lat, lon),\n draggable:dr,\n icon: im,\n });\n marker.setMap(map);\n }\n else{\n console.log('entro');\n marker.setPosition(new google.maps.LatLng(lat, lon));\n }\n centrarMapa(map,lat,lon);\n return marker;\n}", "title": "" }, { "docid": "a2dd7fb5dce6fcbe585c6477f05a9ae1", "score": "0.6286559", "text": "function addMarker(property) \n {\n \n //sets location based on lat and long from array\n const marker = new google.maps.Marker({\n position: property.location,\n map: map,\n });\n\n //if want to use custom icon for the markers will be done here\n if (property.imageIcon) {\n // set image icon\n marker.setIcon(property.imageIcon)\n }\n\n //this if statement relates to event handling for the markers\n if (property.content) \n {\n //used h4 to make the display window small\n temp = \"<h4>\"+property.content+\"</h4>\"\n const detailWindow = new google.maps.InfoWindow({\n \n content: temp\n });\n\n //if mouse hovers over marker then display info window and search name with Wikipedia\n marker.addListener(\"mouseover\", () => {\n detailWindow.open(map, marker);\n handleSubmit(property.content)\n \n })\n\n }\n\n }", "title": "" }, { "docid": "a6fa54116f2e5281f4a56e9f203ad1c1", "score": "0.6286428", "text": "function renderRichMarker(i,method){\n if( method == \"latitudeLongitude\" ){\n marker = new RichMarker({\n position: new google.maps.LatLng( markers[i][\"latitude\"], markers[i][\"longitude\"] ),\n map: map,\n draggable: false,\n content: markerContent,\n flat: true\n });\n google.maps.event.addListener(marker, 'click', (function(marker, i) {\n return function() {\n //if( markerTarget == \"sidebar\"){\n // openSidebarDetail( $(this.content.firstChild).attr(\"data-id\") );\n //}\n if( markerTarget == \"infobox\" ){\n openInfobox( $(this.content.firstChild).attr(\"data-id\"), this, i );\n }\n //else if( markerTarget == \"modal\" ){\n // openModal($(this.content.firstChild).attr(\"data-id\"), \"modal_item.php\");\n //}\n }\n })(marker, i));\n newMarkers.push(marker);\n }\n //else if ( method == \"address\" ){\n // a = i;\n // var geocoder = new google.maps.Geocoder();\n // var geoOptions = {\n // address: markers[i][\"address\"]\n // };\n // geocoder.geocode(geoOptions, geocodeCallback(markerContent));\n //\n //}\n\n\n var bounds = new google.maps.LatLngBounds();\n for (var i = 0; i < newMarkers.length; i++ ) {\n bounds.extend(newMarkers[i].getPosition());\n }\n map.fitBounds(bounds);\n\n\n }", "title": "" }, { "docid": "b6ba0db448049e454e8e9bafd73da380", "score": "0.6284774", "text": "function addMapMarker(map, results, ui) {\n results.forEach(function(result){\n const lat = result.position.lat;\n const lng = result.position.lng;\n\n var outerElement = document.createElement('div'),\n innerElement = document.createElement('div');\n outerElement.appendChild(innerElement);\n \n innerElement.innerHTML = `<img src=\"assets/images/location-icon-32.png\">`; // Add image to the DOM element\n\n let markerIcon = adjustMarkerIcon(outerElement); //function to adjust map markers opacity\n \n const locationMarker = new H.map.DomMarker({lat:lat, lng:lng}, {\n icon: markerIcon //sets the icon as domIcon\n });\n\n let markerBody = makeMarkerHTML(result); //Create the inner html of the marker\n locationMarker.setData(markerBody);\n\n clickMapMarker(ui,map,locationMarker,lat,lng); //What happens when a marker is clicked\n \n map.addObject(locationMarker); //Add the marker to the map\n });\n}", "title": "" }, { "docid": "170bd453a37b67845aabe9eb96b8cf1c", "score": "0.6284495", "text": "function initialize(noteWidget) {\n var map = new google.maps.Map(document.getElementById('map-canvas'),\n mapOptions);\n\n// MAP STUFFFFFFFFF ============================\n\n function placeInMarkers(inNotes, imageUrls, noteUsernames) {\n for (var i = 0; i < inNotes.length; i++) {\n current_marker = setExistingMarker(inNotes[i], inIcon); //global icon\n // addInfoWindow(current_marker, inNotes[i], imageUrls[i], noteUsernames[i]);\n }\n }\n\n function setExistingMarker(note, icon) {\n return new google.maps.Marker({\n position: new google.maps.LatLng(note.longitude, note.latitude),\n icon: icon, //extract into a model att?\n animation: google.maps.Animation.DROP, //extract into a model attr\n map: map //global map object\n });\n }\n\n\n function placeOutMarkers(outNotes) {\n for (var j = 0; j < outNotes.length; j++) {\n setExistingMarker(outNotes[j], outIcon); //global icon\n }\n }\n\n\n // function addInfoWindow(marker, note, imageUrl, username) {\n // var info = infoWindowTemplate(note.comment, imageUrl, username);\n\n // // var infoWindow = newInfoWindow(info);\n\n // // google.maps.event.addListener(marker, 'click', function () {\n // // infoWindow.open(map, marker); //global map object\n // // });\n\n // var buttonSelector = \"#\"+ note.id;\n\n // if ($(buttonSelector).length > 0) {\n // $(buttonSelector).on(\"click\", function(){\n // note = $(this).parent()[0];\n // $('#currentNote').empty();\n // $(note).clone().appendTo('#currentNote').show();\n // });\n // }\n\n // };\n\n// function newInfoWindow(info) {\n// return new google.maps.InfoWindow({\n// content: info\n// });\n// }\n\n// function infoWindowTemplate(comment, imageUrl, username) {\n// if(imageUrl === \"/images/original/missing.png\") {\n// return \"<h5>\"+ username +\"</h6>\" + comment + \"</h5>\";\n// } else {\n// return \"<h5>\"+ username +\"</h6>\" + comment + \"<br><img src=\" + imageUrl + \"></h5>\";\n// }\n// }\n// take this comment out after\n\nfunction setUserMarker(pos) {\n return new google.maps.Marker({\n position: pos,\n animation: google.maps.Animation.DROP,\n map: map //global map object\n });\n}\n\n\nfunction setCircleRadius(pos) {\n return new google.maps.Circle({\n center: pos,\n radius: 9,\n fillColor: \"#00EEEE\",\n fillOpacity: 0.5,\n strokeOpacity: 0.0,\n strokeWeight: 0,\n map: map //global map object\n });\n}\n\n\n// GEO NAV PARTY ==============\n\nif(navigator.geolocation) {\n\n navigator.geolocation.getCurrentPosition(function(position) {\n\n var pos = new google.maps.LatLng(position.coords.latitude,\n position.coords.longitude);\n\n var currentLocation = setUserMarker(pos);\n var circle = setCircleRadius(pos);\n\n var longitudeMax = currentLocation.position.k + 0.000090;\n var longitudeMin = currentLocation.position.k - 0.000090;\n var latitudeMax = currentLocation.position.B + 0.000090;\n var latitudeMin = currentLocation.position.B - 0.000090;\n\n\n $.ajax({\n url: '/notes/1',\n type: 'get',\n data: {longitudeMax: longitudeMax, longitudeMin: longitudeMin, latitudeMax: latitudeMax, latitudeMin: latitudeMin },\n })\n .success(function(data) {\n console.log(\"success\");\n noteWidget.addReadableNotes(data[0], data[1], data[2], data[5]);\n placeInMarkers(data[0], data[1], data[2]);\n placeOutMarkers(data[3]);\n })\n .fail(function() {\n console.log(\"error\");\n });\n\n\n $(\"#leaveANote\").on('click', function() { //controller binding event\n\n $(\"#myModalNote\").foundation('reveal', 'open'); //view thingy\n\n $('#noteSubmit').click(function() { // controller binding event\n\n $(\"#noteForm\").ajaxForm({\n success: setNewMarker\n }).submit(function(){\n });\n\n });\n\n function updateNoteLocation(note, marker) {\n var userLongitude = marker.position.k;\n var userLatitude = marker.position.B;\n\n $.ajax({\n url: \"/notes/\" + note[0].id,\n type: 'PUT',\n data: {longitude: userLongitude, latitude: userLatitude}\n })\n .success(function(data) {\n $(\"#noteForm\")[0].reset();\n $(\"#myModalNote\").foundation('reveal', 'close');\n noteWidget.addReadableNotes([note[0]], [note[1]], [note[2]], data.id);\n // addInfoWindow(marker, note[0], note[1], note[2]);\n $(\"#noCommentError\").text(\"\");\n console.log(\"success\");\n })\n .fail(function() {\n console.log(\"error\");\n $(\"#noCommentError\").text(\"Note field can't be empty.\");\n }); //end ajax request\n\n } //end updateNoteLocation function\n\n\n var setNewMarker = function(note) {\n var noteMarker = new google.maps.Marker({\n position: pos,\n icon: inIcon,\n animation: google.maps.Animation.DROP,\n map: map\n });\n\n updateNoteLocation(note, noteMarker);\n\n }; //end createNewMarker\n\n }); // leave note on click function\n\nmap.setCenter(pos);\n}, function() { // end get current position\n handleNoGeolocation(true);\n});\n\n} else { //end of if nav geo\n handleNoGeolocation(false);\n} //end else\n\n} // end initalize function", "title": "" }, { "docid": "62477b7535e2d6a64ed6f57f02ec4f77", "score": "0.62817967", "text": "function addNewSimpleMark (lat, lon) {\n var newLatLng = new L.LatLng(lat, lon);\n var marker = new L.Marker(newLatLng, {draggable:'false'});\n \n // Asigna direccion de coordenada\n setDirCoord(lat, lon); \n marker.on('click', onClickEvent); \n map.addLayer(marker);\n \n map.setView(new L.LatLng(lat, lon), 12);\n}", "title": "" }, { "docid": "bbf1710c3d7930842caa9ad188981c47", "score": "0.62752557", "text": "function drawMarker() {\n if (!fix.fix || !settings.drawMarker) return;\n var p = m.latLonToXY(fix.lat, fix.lon);\n if (isInside(R, p, 4, 4)) { // avoid drawing over widget area\n g.setColor(1,0,0);\n g.fillRect(p.x-2, p.y-2, p.x+2, p.y+2);\n }\n}", "title": "" }, { "docid": "6a54bd6dddc4f17f87b51da1c1d74b1b", "score": "0.62738603", "text": "function drawStartPoint(map,data){\n\tvar obj = (document.getElementsByClassName('objMarker'))\n\tvar marker = ''\n\tvar el =''\n\tif(obj.length==0){\n\t\tel = document.createElement('div')\n\t\tel.className='objMarker'\n\t\tmarker = new mapboxgl.Marker(el)\n\t\tmarker.setLngLat(data.features[0].geometry.coordinates)\n\t\tmarker.addTo(map)\n\t} else {\n\t\t$('.objMarker').remove()\n\t\tel = document.createElement('div')\n\t\tel.className='objMarker'\n\t\tmarker = new mapboxgl.Marker(el)\n\t\tmarker.setLngLat(data.features[0].geometry.coordinates)\n\t\tmarker.addTo(map)\n\t}\n}", "title": "" } ]
56aa6dc2a937817ef05001ee601daa20
returns a function for filtering head child elements which shouldn't be duplicated, like Also adds support for deduplicated `key` properties
[ { "docid": "6f101482750643c9ad4efad2b06e8651", "score": "0.5222795", "text": "function unique() {\n var keys = new _Set();\n var tags = new _Set();\n var metaTypes = new _Set();\n var metaCategories = {};\n return function (h) {\n var unique = true;\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n var key = h.key.slice(h.key.indexOf('$') + 1);\n\n if (keys.has(key)) {\n unique = false;\n } else {\n keys.add(key);\n }\n } // eslint-disable-next-line default-case\n\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n unique = false;\n } else {\n tags.add(h.type);\n }\n\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n unique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new _Set();\n\n if (categories.has(category)) {\n unique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n\n break;\n }\n\n return unique;\n };\n}", "title": "" } ]
[ { "docid": "ebe630af367033e75ecdd81b5462dc54", "score": "0.56671464", "text": "removeDuplicatesHash() {\n let currentNode = this.head;\n let uniqueEls = {};\n let prev;\n\n while (currentNode) {\n if (uniqueEls[currentNode.value]) {\n // I need to set this element to look at it's next pointer\n prev.next = currentNode.next;\n if (!currentNode.next) this.tail = prev;\n } else {\n uniqueEls[currentNode.value] = currentNode;\n prev = currentNode;\n }\n currentNode = currentNode.next;\n }\n }", "title": "" }, { "docid": "f5dbabf7816c31fe44a65c31f655cc11", "score": "0.5567514", "text": "function head(node) {\n var children = node.children\n var length = children.length\n var seen = []\n var index = -1\n var child\n var name\n\n while (++index < length) {\n child = children[index]\n name = child.tagName\n\n if (element(child, uniqueHeadMetadata)) {\n if (seen.indexOf(name) !== -1) {\n return false\n }\n\n seen.push(name)\n }\n }\n\n return length !== 0\n}", "title": "" }, { "docid": "a9ce26a018775c7305a02bd375b43915", "score": "0.55100083", "text": "removeDupesSorted(){\n let runner = this.head;\n while(runner.next !== null){\n if(runner.next.value == runner.value){\n runner.next = runner.next.next;\n }\n else{\n runner = runner.next;\n }\n return this;\n }\n }", "title": "" }, { "docid": "345389471fcc28629f8cd499330e8c2e", "score": "0.5435662", "text": "function makeDupeFilter(keyFn) {\n const keyTracker = {};\n return function(item) {\n const key = keyFn(item);\n if (key in keyTracker) {\n return false;\n }\n keyTracker[key] = true;\n return true;\n };\n}", "title": "" }, { "docid": "a78a635758ea8c61cfe86c2acd68aaf5", "score": "0.5392471", "text": "filterByTitle(news) {\n const seenTitles = [];\n const uniqueItems = [];\n for (let i = 0; i < news.length; i++) {\n let item = news[i];\n if (seenTitles.indexOf(item.title) === -1) {\n if (item.description) {\n if (!(this.containsBogus(item.description))) {\n seenTitles.push(item.title);\n uniqueItems.push(item);\n }\n }\n }\n }\n return uniqueItems;\n }", "title": "" }, { "docid": "830018252020adb68c001cc777a94bd4", "score": "0.5375843", "text": "uniqBy(a, key) {\n\t\tlet seen = new Set();\n\t\treturn a.filter(item => {\n\t\t\tlet k = key(item);\n\t\t\treturn seen.has(k) ? false : seen.add(k);\n\t\t});\n\t}", "title": "" }, { "docid": "51a7c49eb4b10fb677b2bce540fc6059", "score": "0.53495294", "text": "function unique() {\n const keys = new Set();\n const tags = new Set();\n const metaTypes = new Set();\n const metaCategories = {};\n return (h)=>{\n let isUnique = true;\n let hasKey = false;\n if (h.key && typeof h.key !== \"number\" && h.key.indexOf(\"$\") > 0) {\n hasKey = true;\n const key = h.key.slice(h.key.indexOf(\"$\") + 1);\n if (keys.has(key)) {\n isUnique = false;\n } else {\n keys.add(key);\n }\n }\n // eslint-disable-next-line default-case\n switch(h.type){\n case \"title\":\n case \"base\":\n if (tags.has(h.type)) {\n isUnique = false;\n } else {\n tags.add(h.type);\n }\n break;\n case \"meta\":\n for(let i = 0, len = METATYPES.length; i < len; i++){\n const metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n if (metatype === \"charSet\") {\n if (metaTypes.has(metatype)) {\n isUnique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n const category = h.props[metatype];\n const categories = metaCategories[metatype] || new Set();\n if ((metatype !== \"name\" || !hasKey) && categories.has(category)) {\n isUnique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n break;\n }\n return isUnique;\n };\n}", "title": "" }, { "docid": "d66ac0240ffc784eb815e76116c6b193", "score": "0.53034216", "text": "filterMergedDupes(elem) {\n return this.indexOf(elem) === -1;\n }", "title": "" }, { "docid": "4da4be45da8812181963ba5042935f0d", "score": "0.5231584", "text": "removeDuplicates() {\n // If the linked list is empty or only has 1 value then we will return the head node\n // This is because if there is only 0 or 1 values there is nothing duplicate to remove\n if (this.head === null || this.head.next === null) return this.head;\n\n // Create a variable to track the nodes in the linked list\n // Set the variable to equal the head node\n let current = this.head;\n // Iterate over the linked list until we get to the end of the linked list\n while (current.next !== null) {\n // If the current value does not equal the next value\n // That means it is not a duplicate and we can continue iterating\n if (current.value !== current.next.value) {\n // Set current to equal the next node in the linked list\n current = current.next;\n } else {\n // We need to keep moving the next node in the linked list until we meet 1 of 2 conditions\n // Either the value is unique and we can change current\n // Or the value is null and we exit the while loop\n current.next = current.next.next;\n }\n }\n // Return the head node, not current\n return this.head;\n }", "title": "" }, { "docid": "b01189591cc1aa78bf3c8ad350361eb4", "score": "0.5214208", "text": "function unique() {\n var keys = new Set();\n var tags = new Set();\n var metaTypes = new Set();\n var metaCategories = {};\n return function (h) {\n var unique = true;\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n var key = h.key.slice(h.key.indexOf('$') + 1);\n\n if (keys.has(key)) {\n unique = false;\n } else {\n keys.add(key);\n }\n } // eslint-disable-next-line default-case\n\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n unique = false;\n } else {\n tags.add(h.type);\n }\n\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n unique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new Set();\n\n if (categories.has(category)) {\n unique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n\n break;\n }\n\n return unique;\n };\n}", "title": "" }, { "docid": "b01189591cc1aa78bf3c8ad350361eb4", "score": "0.5214208", "text": "function unique() {\n var keys = new Set();\n var tags = new Set();\n var metaTypes = new Set();\n var metaCategories = {};\n return function (h) {\n var unique = true;\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n var key = h.key.slice(h.key.indexOf('$') + 1);\n\n if (keys.has(key)) {\n unique = false;\n } else {\n keys.add(key);\n }\n } // eslint-disable-next-line default-case\n\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n unique = false;\n } else {\n tags.add(h.type);\n }\n\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n unique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new Set();\n\n if (categories.has(category)) {\n unique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n\n break;\n }\n\n return unique;\n };\n}", "title": "" }, { "docid": "b01189591cc1aa78bf3c8ad350361eb4", "score": "0.5214208", "text": "function unique() {\n var keys = new Set();\n var tags = new Set();\n var metaTypes = new Set();\n var metaCategories = {};\n return function (h) {\n var unique = true;\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n var key = h.key.slice(h.key.indexOf('$') + 1);\n\n if (keys.has(key)) {\n unique = false;\n } else {\n keys.add(key);\n }\n } // eslint-disable-next-line default-case\n\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n unique = false;\n } else {\n tags.add(h.type);\n }\n\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n unique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new Set();\n\n if (categories.has(category)) {\n unique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n\n break;\n }\n\n return unique;\n };\n}", "title": "" }, { "docid": "b01189591cc1aa78bf3c8ad350361eb4", "score": "0.5214208", "text": "function unique() {\n var keys = new Set();\n var tags = new Set();\n var metaTypes = new Set();\n var metaCategories = {};\n return function (h) {\n var unique = true;\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n var key = h.key.slice(h.key.indexOf('$') + 1);\n\n if (keys.has(key)) {\n unique = false;\n } else {\n keys.add(key);\n }\n } // eslint-disable-next-line default-case\n\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n unique = false;\n } else {\n tags.add(h.type);\n }\n\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n unique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new Set();\n\n if (categories.has(category)) {\n unique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n\n break;\n }\n\n return unique;\n };\n}", "title": "" }, { "docid": "b01189591cc1aa78bf3c8ad350361eb4", "score": "0.5214208", "text": "function unique() {\n var keys = new Set();\n var tags = new Set();\n var metaTypes = new Set();\n var metaCategories = {};\n return function (h) {\n var unique = true;\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n var key = h.key.slice(h.key.indexOf('$') + 1);\n\n if (keys.has(key)) {\n unique = false;\n } else {\n keys.add(key);\n }\n } // eslint-disable-next-line default-case\n\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n unique = false;\n } else {\n tags.add(h.type);\n }\n\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n unique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new Set();\n\n if (categories.has(category)) {\n unique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n\n break;\n }\n\n return unique;\n };\n}", "title": "" }, { "docid": "b01189591cc1aa78bf3c8ad350361eb4", "score": "0.5214208", "text": "function unique() {\n var keys = new Set();\n var tags = new Set();\n var metaTypes = new Set();\n var metaCategories = {};\n return function (h) {\n var unique = true;\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n var key = h.key.slice(h.key.indexOf('$') + 1);\n\n if (keys.has(key)) {\n unique = false;\n } else {\n keys.add(key);\n }\n } // eslint-disable-next-line default-case\n\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n unique = false;\n } else {\n tags.add(h.type);\n }\n\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n unique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new Set();\n\n if (categories.has(category)) {\n unique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n\n break;\n }\n\n return unique;\n };\n}", "title": "" }, { "docid": "b01189591cc1aa78bf3c8ad350361eb4", "score": "0.5214208", "text": "function unique() {\n var keys = new Set();\n var tags = new Set();\n var metaTypes = new Set();\n var metaCategories = {};\n return function (h) {\n var unique = true;\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n var key = h.key.slice(h.key.indexOf('$') + 1);\n\n if (keys.has(key)) {\n unique = false;\n } else {\n keys.add(key);\n }\n } // eslint-disable-next-line default-case\n\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n unique = false;\n } else {\n tags.add(h.type);\n }\n\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n unique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new Set();\n\n if (categories.has(category)) {\n unique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n\n break;\n }\n\n return unique;\n };\n}", "title": "" }, { "docid": "b01189591cc1aa78bf3c8ad350361eb4", "score": "0.5214208", "text": "function unique() {\n var keys = new Set();\n var tags = new Set();\n var metaTypes = new Set();\n var metaCategories = {};\n return function (h) {\n var unique = true;\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n var key = h.key.slice(h.key.indexOf('$') + 1);\n\n if (keys.has(key)) {\n unique = false;\n } else {\n keys.add(key);\n }\n } // eslint-disable-next-line default-case\n\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n unique = false;\n } else {\n tags.add(h.type);\n }\n\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n unique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new Set();\n\n if (categories.has(category)) {\n unique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n\n break;\n }\n\n return unique;\n };\n}", "title": "" }, { "docid": "b01189591cc1aa78bf3c8ad350361eb4", "score": "0.5214208", "text": "function unique() {\n var keys = new Set();\n var tags = new Set();\n var metaTypes = new Set();\n var metaCategories = {};\n return function (h) {\n var unique = true;\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n var key = h.key.slice(h.key.indexOf('$') + 1);\n\n if (keys.has(key)) {\n unique = false;\n } else {\n keys.add(key);\n }\n } // eslint-disable-next-line default-case\n\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n unique = false;\n } else {\n tags.add(h.type);\n }\n\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n unique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new Set();\n\n if (categories.has(category)) {\n unique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n\n break;\n }\n\n return unique;\n };\n}", "title": "" }, { "docid": "b01189591cc1aa78bf3c8ad350361eb4", "score": "0.5214208", "text": "function unique() {\n var keys = new Set();\n var tags = new Set();\n var metaTypes = new Set();\n var metaCategories = {};\n return function (h) {\n var unique = true;\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n var key = h.key.slice(h.key.indexOf('$') + 1);\n\n if (keys.has(key)) {\n unique = false;\n } else {\n keys.add(key);\n }\n } // eslint-disable-next-line default-case\n\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n unique = false;\n } else {\n tags.add(h.type);\n }\n\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n unique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new Set();\n\n if (categories.has(category)) {\n unique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n\n break;\n }\n\n return unique;\n };\n}", "title": "" }, { "docid": "b01189591cc1aa78bf3c8ad350361eb4", "score": "0.5214208", "text": "function unique() {\n var keys = new Set();\n var tags = new Set();\n var metaTypes = new Set();\n var metaCategories = {};\n return function (h) {\n var unique = true;\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n var key = h.key.slice(h.key.indexOf('$') + 1);\n\n if (keys.has(key)) {\n unique = false;\n } else {\n keys.add(key);\n }\n } // eslint-disable-next-line default-case\n\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n unique = false;\n } else {\n tags.add(h.type);\n }\n\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n unique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new Set();\n\n if (categories.has(category)) {\n unique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n\n break;\n }\n\n return unique;\n };\n}", "title": "" }, { "docid": "c620679cebefafbe83be9284fade69c6", "score": "0.52062804", "text": "function unique() {\n const keys = new Set();\n const tags = new Set();\n const metaTypes = new Set();\n const metaCategories = {};\n return h => {\n let unique = true;\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n const key = h.key.slice(h.key.indexOf('$') + 1);\n\n if (keys.has(key)) {\n unique = false;\n } else {\n keys.add(key);\n }\n } // eslint-disable-next-line default-case\n\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n unique = false;\n } else {\n tags.add(h.type);\n }\n\n break;\n\n case 'meta':\n for (let i = 0, len = METATYPES.length; i < len; i++) {\n const metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n unique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n const category = h.props[metatype];\n const categories = metaCategories[metatype] || new Set();\n\n if (categories.has(category)) {\n unique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n\n break;\n }\n\n return unique;\n };\n}", "title": "" }, { "docid": "c19c7535efb1a15573228b06b82890f2", "score": "0.5205285", "text": "static removeDuplicates(list) {\n if (!list.head || !list.head.next) {\n return;\n }\n\n let prev;\n let curr;\n let nodes = {};\n\n prev = list.head;\n curr = prev.next;\n nodes[prev.data] = true;\n\n while (curr) {\n let data = curr.data;\n if (nodes[data]) {\n prev.next = curr.next;\n } else {\n nodes[data] = true;\n prev = curr;\n }\n curr = curr.next;\n }\n }", "title": "" }, { "docid": "34b235871e29dab17e735e77ca28707d", "score": "0.51871485", "text": "function remove_dups(node) {\n let current;\n while(current) {\n current = node.head\n let runner = current\n while(runner.next) {\n if (current.value === runner.value) {\n let nextNode = runner.next\n let prevNode = runner.prev\n prevNode.next = nextNode\n }\n runner = runner.next\n }\n current = current.next\n }\n return node\n}", "title": "" }, { "docid": "1f2da74e485f09e61ecc13a91fbcb9a0", "score": "0.5174357", "text": "deDup() {\n let prev = this.head;\n let counter = 0;\n let currentNode = this.head.next;\n let nodeToDelete = null;\n let hash = {};\n\n while (currentNode) {\n if (!hash[currentNode.data]) {\n hash[currentNode.data] = true;\n prev = currentNode;\n currentNode = currentNode.next;\n } else {\n prev.next = currentNode.next;\n nodeToDelete = currentNode;\n currentNode = currentNode.next.next;\n nodeToDelete = null;\n this._length--;\n }\n counter++;\n }\n return this;\n }", "title": "" }, { "docid": "c3d175140978bb2d2d23234c83849f5a", "score": "0.5173786", "text": "removeDupsFast(){\n if (this.head == null){\n return\n }\n var previous = null;\n var current = this.head;\n var set = new Set();\n while (current != null){\n if (set.has(current.value)){\n previous.next = current.next;\n }else {\n set.add(current.value);\n previous = current;\n }\n current = current.next;\n }\n }", "title": "" }, { "docid": "04c64971011afc8d8bf6ed767b5e92e6", "score": "0.51478046", "text": "function unique() {\n var keys = new _set.default();\n var tags = new _set.default();\n var metaTypes = new _set.default();\n var metaCategories = {};\n return function (h) {\n if (h.key && h.key.indexOf('.$') === 0) {\n if (keys.has(h.key)) return false;\n keys.add(h.key);\n }\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) return false;\n tags.add(h.type);\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) return false;\n metaTypes.add(metatype);\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new _set.default();\n if (categories.has(category) && ALLOWED_DUPLICATES.indexOf(category) === -1) return false;\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n\n break;\n }\n\n return true;\n };\n}", "title": "" }, { "docid": "04c64971011afc8d8bf6ed767b5e92e6", "score": "0.51478046", "text": "function unique() {\n var keys = new _set.default();\n var tags = new _set.default();\n var metaTypes = new _set.default();\n var metaCategories = {};\n return function (h) {\n if (h.key && h.key.indexOf('.$') === 0) {\n if (keys.has(h.key)) return false;\n keys.add(h.key);\n }\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) return false;\n tags.add(h.type);\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) return false;\n metaTypes.add(metatype);\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new _set.default();\n if (categories.has(category) && ALLOWED_DUPLICATES.indexOf(category) === -1) return false;\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n\n break;\n }\n\n return true;\n };\n}", "title": "" }, { "docid": "04c64971011afc8d8bf6ed767b5e92e6", "score": "0.51478046", "text": "function unique() {\n var keys = new _set.default();\n var tags = new _set.default();\n var metaTypes = new _set.default();\n var metaCategories = {};\n return function (h) {\n if (h.key && h.key.indexOf('.$') === 0) {\n if (keys.has(h.key)) return false;\n keys.add(h.key);\n }\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) return false;\n tags.add(h.type);\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) return false;\n metaTypes.add(metatype);\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new _set.default();\n if (categories.has(category) && ALLOWED_DUPLICATES.indexOf(category) === -1) return false;\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n\n break;\n }\n\n return true;\n };\n}", "title": "" }, { "docid": "69f3ac5b71199fbf2a4e467b4f072ce0", "score": "0.5139732", "text": "function unique() {\n var keys = new Set();\n var tags = new Set();\n var metaTypes = new Set();\n var metaCategories = {};\n return function (h) {\n var isUnique = true;\n var hasKey = false;\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n hasKey = true;\n var key = h.key.slice(h.key.indexOf('$') + 1);\n\n if (keys.has(key)) {\n isUnique = false;\n } else {\n keys.add(key);\n }\n } // eslint-disable-next-line default-case\n\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n isUnique = false;\n } else {\n tags.add(h.type);\n }\n\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n isUnique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new Set();\n\n if ((metatype !== 'name' || !hasKey) && categories.has(category)) {\n isUnique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n\n break;\n }\n\n return isUnique;\n };\n}", "title": "" }, { "docid": "69f3ac5b71199fbf2a4e467b4f072ce0", "score": "0.5139732", "text": "function unique() {\n var keys = new Set();\n var tags = new Set();\n var metaTypes = new Set();\n var metaCategories = {};\n return function (h) {\n var isUnique = true;\n var hasKey = false;\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n hasKey = true;\n var key = h.key.slice(h.key.indexOf('$') + 1);\n\n if (keys.has(key)) {\n isUnique = false;\n } else {\n keys.add(key);\n }\n } // eslint-disable-next-line default-case\n\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n isUnique = false;\n } else {\n tags.add(h.type);\n }\n\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n isUnique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new Set();\n\n if ((metatype !== 'name' || !hasKey) && categories.has(category)) {\n isUnique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n\n break;\n }\n\n return isUnique;\n };\n}", "title": "" }, { "docid": "69f3ac5b71199fbf2a4e467b4f072ce0", "score": "0.5139732", "text": "function unique() {\n var keys = new Set();\n var tags = new Set();\n var metaTypes = new Set();\n var metaCategories = {};\n return function (h) {\n var isUnique = true;\n var hasKey = false;\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n hasKey = true;\n var key = h.key.slice(h.key.indexOf('$') + 1);\n\n if (keys.has(key)) {\n isUnique = false;\n } else {\n keys.add(key);\n }\n } // eslint-disable-next-line default-case\n\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n isUnique = false;\n } else {\n tags.add(h.type);\n }\n\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n isUnique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new Set();\n\n if ((metatype !== 'name' || !hasKey) && categories.has(category)) {\n isUnique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n\n break;\n }\n\n return isUnique;\n };\n}", "title": "" }, { "docid": "69f3ac5b71199fbf2a4e467b4f072ce0", "score": "0.5139732", "text": "function unique() {\n var keys = new Set();\n var tags = new Set();\n var metaTypes = new Set();\n var metaCategories = {};\n return function (h) {\n var isUnique = true;\n var hasKey = false;\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n hasKey = true;\n var key = h.key.slice(h.key.indexOf('$') + 1);\n\n if (keys.has(key)) {\n isUnique = false;\n } else {\n keys.add(key);\n }\n } // eslint-disable-next-line default-case\n\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n isUnique = false;\n } else {\n tags.add(h.type);\n }\n\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n isUnique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new Set();\n\n if ((metatype !== 'name' || !hasKey) && categories.has(category)) {\n isUnique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n\n break;\n }\n\n return isUnique;\n };\n}", "title": "" }, { "docid": "69f3ac5b71199fbf2a4e467b4f072ce0", "score": "0.5139732", "text": "function unique() {\n var keys = new Set();\n var tags = new Set();\n var metaTypes = new Set();\n var metaCategories = {};\n return function (h) {\n var isUnique = true;\n var hasKey = false;\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n hasKey = true;\n var key = h.key.slice(h.key.indexOf('$') + 1);\n\n if (keys.has(key)) {\n isUnique = false;\n } else {\n keys.add(key);\n }\n } // eslint-disable-next-line default-case\n\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n isUnique = false;\n } else {\n tags.add(h.type);\n }\n\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n isUnique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new Set();\n\n if ((metatype !== 'name' || !hasKey) && categories.has(category)) {\n isUnique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n\n break;\n }\n\n return isUnique;\n };\n}", "title": "" }, { "docid": "c01e7745887857e0f8dd6e59a6c58ef4", "score": "0.51236826", "text": "function unique() {\n const keys = new Set();\n const tags = new Set();\n const metaTypes = new Set();\n const metaCategories = {};\n return h => {\n let isUnique = true;\n let hasKey = false;\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n hasKey = true;\n const key = h.key.slice(h.key.indexOf('$') + 1);\n\n if (keys.has(key)) {\n isUnique = false;\n } else {\n keys.add(key);\n }\n } // eslint-disable-next-line default-case\n\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n isUnique = false;\n } else {\n tags.add(h.type);\n }\n\n break;\n\n case 'meta':\n for (let i = 0, len = METATYPES.length; i < len; i++) {\n const metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n isUnique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n const category = h.props[metatype];\n const categories = metaCategories[metatype] || new Set();\n\n if ((metatype !== 'name' || !hasKey) && categories.has(category)) {\n isUnique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n\n break;\n }\n\n return isUnique;\n };\n}", "title": "" }, { "docid": "3c03a40b2d0fe615c780cbe1f113a5eb", "score": "0.51193476", "text": "function removeDuplicatesV2(head, prev = null, re = null) {\n if (!head) return re\n\n re = re || head\n if (prev && prev.data === head.data) {\n prev.next = head.next\n } else {\n prev = head\n }\n\n return removeDuplicatesV2(head.next, prev, re)\n}", "title": "" }, { "docid": "5b1ff7a7ec2c375b3c311df3d5f160c2", "score": "0.5096205", "text": "function distinct() {\n \n //Data for output\n var outData = [];\n\n //For each element on current instance\n for (var i = 0; i < this.items.length; i++) {\n\n //Flag for element found\n var wasFound = false;\n\n //Check if element is already on outData\n for (var n = 0; n < outData.length; n++) {\n\n //If current element on \"i\" matches the one on \"n\"\n\t\t\t\tif (equals(outData[n], this.items[i])){\n wasFound = true;\n break;\n }\n }\n\n //If element was not found, append to output\n if (!wasFound)\n outData.push(this.items[i]);\n }\n\n //Return for chaining\n return new jslinq(outData);\n }", "title": "" }, { "docid": "ce580d16bbd54e8f670b0ba790823e32", "score": "0.5054219", "text": "function unique() {\n var keys = new Set();\n var tags = new Set();\n var metaTypes = new Set();\n var metaCategories = {};\n return function (h) {\n var isUnique = true;\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n var key = h.key.slice(h.key.indexOf('$') + 1);\n\n if (keys.has(key)) {\n isUnique = false;\n } else {\n keys.add(key);\n }\n } // eslint-disable-next-line default-case\n\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n isUnique = false;\n } else {\n tags.add(h.type);\n }\n\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n isUnique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new Set();\n\n if (categories.has(category)) {\n isUnique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n\n break;\n }\n\n return isUnique;\n };\n}", "title": "" }, { "docid": "ce580d16bbd54e8f670b0ba790823e32", "score": "0.5054219", "text": "function unique() {\n var keys = new Set();\n var tags = new Set();\n var metaTypes = new Set();\n var metaCategories = {};\n return function (h) {\n var isUnique = true;\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n var key = h.key.slice(h.key.indexOf('$') + 1);\n\n if (keys.has(key)) {\n isUnique = false;\n } else {\n keys.add(key);\n }\n } // eslint-disable-next-line default-case\n\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n isUnique = false;\n } else {\n tags.add(h.type);\n }\n\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n isUnique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new Set();\n\n if (categories.has(category)) {\n isUnique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n\n break;\n }\n\n return isUnique;\n };\n}", "title": "" }, { "docid": "ce580d16bbd54e8f670b0ba790823e32", "score": "0.5054219", "text": "function unique() {\n var keys = new Set();\n var tags = new Set();\n var metaTypes = new Set();\n var metaCategories = {};\n return function (h) {\n var isUnique = true;\n\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {\n var key = h.key.slice(h.key.indexOf('$') + 1);\n\n if (keys.has(key)) {\n isUnique = false;\n } else {\n keys.add(key);\n }\n } // eslint-disable-next-line default-case\n\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) {\n isUnique = false;\n } else {\n tags.add(h.type);\n }\n\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) {\n isUnique = false;\n } else {\n metaTypes.add(metatype);\n }\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new Set();\n\n if (categories.has(category)) {\n isUnique = false;\n } else {\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n }\n\n break;\n }\n\n return isUnique;\n };\n}", "title": "" }, { "docid": "ec11c1d1add925c9de3fe332153e3a37", "score": "0.5053209", "text": "function unique() {\n var keys = new _set.default();\n var tags = new _set.default();\n var metaTypes = new _set.default();\n var metaCategories = {};\n return function (h) {\n if (h.key && typeof h.key !== 'number' && h.key.indexOf(\".$\") === 0) {\n if (keys.has(h.key)) return false;\n keys.add(h.key);\n return true;\n }\n\n switch (h.type) {\n case \"title\":\n case \"base\":\n if (tags.has(h.type)) return false;\n tags.add(h.type);\n break;\n\n case \"meta\":\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === \"charSet\" || metatype === \"viewport\") {\n if (metaTypes.has(metatype)) return false;\n metaTypes.add(metatype);\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new _set.default();\n if (categories.has(category)) return false;\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n\n break;\n }\n\n return true;\n };\n}", "title": "" }, { "docid": "ec11c1d1add925c9de3fe332153e3a37", "score": "0.5053209", "text": "function unique() {\n var keys = new _set.default();\n var tags = new _set.default();\n var metaTypes = new _set.default();\n var metaCategories = {};\n return function (h) {\n if (h.key && typeof h.key !== 'number' && h.key.indexOf(\".$\") === 0) {\n if (keys.has(h.key)) return false;\n keys.add(h.key);\n return true;\n }\n\n switch (h.type) {\n case \"title\":\n case \"base\":\n if (tags.has(h.type)) return false;\n tags.add(h.type);\n break;\n\n case \"meta\":\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === \"charSet\" || metatype === \"viewport\") {\n if (metaTypes.has(metatype)) return false;\n metaTypes.add(metatype);\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new _set.default();\n if (categories.has(category)) return false;\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n\n break;\n }\n\n return true;\n };\n}", "title": "" }, { "docid": "ec11c1d1add925c9de3fe332153e3a37", "score": "0.5053209", "text": "function unique() {\n var keys = new _set.default();\n var tags = new _set.default();\n var metaTypes = new _set.default();\n var metaCategories = {};\n return function (h) {\n if (h.key && typeof h.key !== 'number' && h.key.indexOf(\".$\") === 0) {\n if (keys.has(h.key)) return false;\n keys.add(h.key);\n return true;\n }\n\n switch (h.type) {\n case \"title\":\n case \"base\":\n if (tags.has(h.type)) return false;\n tags.add(h.type);\n break;\n\n case \"meta\":\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === \"charSet\" || metatype === \"viewport\") {\n if (metaTypes.has(metatype)) return false;\n metaTypes.add(metatype);\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new _set.default();\n if (categories.has(category)) return false;\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n\n break;\n }\n\n return true;\n };\n}", "title": "" }, { "docid": "53ccaf4e78e36e35c15bebb3484ebb78", "score": "0.5030909", "text": "function unique() {\n var keys = new _Set();\n var tags = new _Set();\n var metaTypes = new _Set();\n var metaCategories = {};\n return function (h) {\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('.$') === 0) {\n if (keys.has(h.key)) return false;\n keys.add(h.key);\n return true;\n }\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) return false;\n tags.add(h.type);\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) return false;\n metaTypes.add(metatype);\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new _Set();\n if (categories.has(category)) return false;\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n\n break;\n }\n\n return true;\n };\n}", "title": "" }, { "docid": "53ccaf4e78e36e35c15bebb3484ebb78", "score": "0.5030909", "text": "function unique() {\n var keys = new _Set();\n var tags = new _Set();\n var metaTypes = new _Set();\n var metaCategories = {};\n return function (h) {\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('.$') === 0) {\n if (keys.has(h.key)) return false;\n keys.add(h.key);\n return true;\n }\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) return false;\n tags.add(h.type);\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) return false;\n metaTypes.add(metatype);\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new _Set();\n if (categories.has(category)) return false;\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n\n break;\n }\n\n return true;\n };\n}", "title": "" }, { "docid": "53ccaf4e78e36e35c15bebb3484ebb78", "score": "0.5030909", "text": "function unique() {\n var keys = new _Set();\n var tags = new _Set();\n var metaTypes = new _Set();\n var metaCategories = {};\n return function (h) {\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('.$') === 0) {\n if (keys.has(h.key)) return false;\n keys.add(h.key);\n return true;\n }\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) return false;\n tags.add(h.type);\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) return false;\n metaTypes.add(metatype);\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new _Set();\n if (categories.has(category)) return false;\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n\n break;\n }\n\n return true;\n };\n}", "title": "" }, { "docid": "fc9ad38097f60d00ab30d224b70ae4ef", "score": "0.502311", "text": "findDeleteDuplicate() {\n let n = this.first;\n let i = this.first;\n let prevNode = null;\n\n while(n.next != null) {\n while(i.next != null) {\n prevNode = i;\n i = i.next;\n if(i.data == n.data) {\n prevNode.next = i.next;\n }\n }\n n = n.next;\n i = n;\n }\n }", "title": "" }, { "docid": "ad966914ced3968c1346de80f7826458", "score": "0.5016625", "text": "function unique() {\n var keys = new _set2.default();\n var tags = new _set2.default();\n var metaTypes = new _set2.default();\n var metaCategories = {};\n\n return function (h) {\n if (h.key && h.key.startsWith('.$')) {\n if (keys.has(h.key)) return false;\n keys.add(h.key);\n }\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) return false;\n tags.add(h.type);\n break;\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) return false;\n metaTypes.add(metatype);\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new _set2.default();\n if (categories.has(category)) return false;\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n break;\n }\n return true;\n };\n}", "title": "" }, { "docid": "ad966914ced3968c1346de80f7826458", "score": "0.5016625", "text": "function unique() {\n var keys = new _set2.default();\n var tags = new _set2.default();\n var metaTypes = new _set2.default();\n var metaCategories = {};\n\n return function (h) {\n if (h.key && h.key.startsWith('.$')) {\n if (keys.has(h.key)) return false;\n keys.add(h.key);\n }\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) return false;\n tags.add(h.type);\n break;\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) return false;\n metaTypes.add(metatype);\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new _set2.default();\n if (categories.has(category)) return false;\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n break;\n }\n return true;\n };\n}", "title": "" }, { "docid": "16345ec5bbd3bdff1ef151e322545416", "score": "0.49908426", "text": "function unique() {\n var keys = new _set.default();\n var tags = new _set.default();\n var metaTypes = new _set.default();\n var metaCategories = {};\n return function (h) {\n if (h.key && typeof h.key !== 'number' && h.key.indexOf(\".$\") === 0) {\n if (keys.has(h.key)) return false;\n keys.add(h.key);\n return true;\n }\n\n switch (h.type) {\n case \"title\":\n case \"base\":\n if (tags.has(h.type)) return false;\n tags.add(h.type);\n break;\n\n case \"meta\":\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === \"charSet\") {\n if (metaTypes.has(metatype)) return false;\n metaTypes.add(metatype);\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new _set.default();\n if (categories.has(category)) return false;\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n\n break;\n }\n\n return true;\n };\n}", "title": "" }, { "docid": "16345ec5bbd3bdff1ef151e322545416", "score": "0.49908426", "text": "function unique() {\n var keys = new _set.default();\n var tags = new _set.default();\n var metaTypes = new _set.default();\n var metaCategories = {};\n return function (h) {\n if (h.key && typeof h.key !== 'number' && h.key.indexOf(\".$\") === 0) {\n if (keys.has(h.key)) return false;\n keys.add(h.key);\n return true;\n }\n\n switch (h.type) {\n case \"title\":\n case \"base\":\n if (tags.has(h.type)) return false;\n tags.add(h.type);\n break;\n\n case \"meta\":\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === \"charSet\") {\n if (metaTypes.has(metatype)) return false;\n metaTypes.add(metatype);\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new _set.default();\n if (categories.has(category)) return false;\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n\n break;\n }\n\n return true;\n };\n}", "title": "" }, { "docid": "04054cfd656d07b306ee11ad544f6d81", "score": "0.49659017", "text": "function firstDuplicate(xs) {\n let s = new Map;\n for (let i = 0; i < xs.length; ++i) {\n let { descType, name } = xs[i];\n let val = [];\n if (s.has(name)) {\n val = s.get(name);\n switch (descType) {\n case 'get':\n case 'set':\n if (val.includes(descType)) return name;\n break;\n default:\n return name;\n }\n }\n val.push(descType);\n s.set(name, val);\n }\n }", "title": "" }, { "docid": "30fb5166f5b77f750113c244f045a1f0", "score": "0.496074", "text": "_getDuplicates(first, second) {\n var mixer = this;\n return second.map(function (c) {\n var duplicate = false;\n first.forEach(function (i) {\n // Does the main link match?\n if (UrlCompare.sameUrls(c.label, i.label)) {\n duplicate = true;\n return;\n }\n\n // Do any of the sublinks match?\n var sublinks = mixer._collectSublinks(i.data);\n sublinks.some(function (u) {\n if (UrlCompare.sameUrls(u, c.label)) {\n duplicate = true;\n return true; // stop iteration\n }\n });\n });\n\n if (duplicate) {\n return c;\n }\n }).filter(function (result) {\n return result;\n });\n }", "title": "" }, { "docid": "41ce6e3d5082c9246877bc012d92010b", "score": "0.49581888", "text": "function removeDups(tags) {\n\t\t\t\t\t\tlet unique = {};\n\t\t\t\t\t\ttags.forEach(function(i) {\n\t\t\t\t\t\t if(!unique[i]) {\n\t\t\t\t\t\t\tunique[i] = true;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn Object.keys(unique);\n\t\t\t\t\t}", "title": "" }, { "docid": "1e9878a12c1a5dead7c0e482754f434e", "score": "0.49542406", "text": "keyElements(elements) {\n return elements.map((el, index) => {\n return React.cloneElement(el, { key: index });\n });\n }", "title": "" }, { "docid": "f007794a766488e28c0071e7a03b4faa", "score": "0.49502438", "text": "function unique() {\n var keys = new _set[\"default\"]();\n var tags = new _set[\"default\"]();\n var metaTypes = new _set[\"default\"]();\n var metaCategories = {};\n return function (h) {\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('.$') === 0) {\n if (keys.has(h.key)) return false;\n keys.add(h.key);\n return true;\n }\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) return false;\n tags.add(h.type);\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) return false;\n metaTypes.add(metatype);\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new _set[\"default\"]();\n if (categories.has(category)) return false;\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n\n break;\n }\n\n return true;\n };\n}", "title": "" }, { "docid": "f007794a766488e28c0071e7a03b4faa", "score": "0.49502438", "text": "function unique() {\n var keys = new _set[\"default\"]();\n var tags = new _set[\"default\"]();\n var metaTypes = new _set[\"default\"]();\n var metaCategories = {};\n return function (h) {\n if (h.key && typeof h.key !== 'number' && h.key.indexOf('.$') === 0) {\n if (keys.has(h.key)) return false;\n keys.add(h.key);\n return true;\n }\n\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) return false;\n tags.add(h.type);\n break;\n\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) return false;\n metaTypes.add(metatype);\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new _set[\"default\"]();\n if (categories.has(category)) return false;\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n\n break;\n }\n\n return true;\n };\n}", "title": "" }, { "docid": "dd5cfe08935a47b40cc64f4800d851fb", "score": "0.4947117", "text": "function filterRec(t, f) {\n const many = (t = []) => t.flatMap(one);\n\n const one = (t = {}) =>\n Boolean(f(t)) ? [{ ...t, children: many(t.children) }] : [];\n\n return many(t);\n }", "title": "" }, { "docid": "3dae18694e614ee1647e6d402afecaa4", "score": "0.49424827", "text": "removeDuplicates(obj){\n var array = obj;\n var seenObj = {};\n array = array.filter(function(currentObject) {\n if (currentObject.name in seenObj) {\n return false;\n } else {\n seenObj[currentObject.name] = true;\n return true;\n }\n });\n return array;\n }", "title": "" }, { "docid": "3dae18694e614ee1647e6d402afecaa4", "score": "0.49424827", "text": "removeDuplicates(obj){\n var array = obj;\n var seenObj = {};\n array = array.filter(function(currentObject) {\n if (currentObject.name in seenObj) {\n return false;\n } else {\n seenObj[currentObject.name] = true;\n return true;\n }\n });\n return array;\n }", "title": "" }, { "docid": "a4a6a15ff9316a111f1bbb7c00d1ca70", "score": "0.4931732", "text": "function removeDuplicates(head) {\n if (!head) return null\n\n const nextNode = head.next\n if (nextNode && head.data === nextNode.data) {\n head.next = nextNode.next\n return removeDuplicates(head)\n }\n\n head.next = removeDuplicates(nextNode)\n return head\n}", "title": "" }, { "docid": "4e5105800c3e861eaa02249e121934ec", "score": "0.492887", "text": "removeHead() {\n const removeHead = this.head.value;\n this.head = this.head.next;\n return removeHead;\n }", "title": "" }, { "docid": "7b21df9d5cda7cbdee898327f03447ad", "score": "0.4923337", "text": "function removeDuplicates(node) {\n const seenSoFar = new Set();\n let prev = null;\n let current = node;\n\n while (current !== null) {\n\n //if it's a duplicate element, connect prev to current's next\n if (seenSoFar.has(current.val)) {\n prev.next = current.next;\n } else {\n //otherwise advance prev and add to set.\n prev = current;\n seenSoFar.add(current.val);\n }\n //advance current\n current = current.next;\n }\n return node;\n}", "title": "" }, { "docid": "7a9766579fcb656f5834fcbcaba4a3c6", "score": "0.49204603", "text": "unique(key) {\n return this.reduce((a, b) => {\n if (a.find(e => e[key] === b[key]) === undefined) a.push(b);\n return a;\n }, new KArray());\n }", "title": "" }, { "docid": "a635a01fa530d4d6bb33b3a17ff0d32b", "score": "0.48898295", "text": "filterDuplicateInnerHighlights(hits, type) {\n for (let hit of hits) {\n if (hit.inner_hits && hit.inner_hits[type] && hit.inner_hits[type].hits) {\n for (let innerHit of hit.inner_hits[type].hits.hits) {\n if (innerHit.highlight) {\n let seenHighlights = [];\n for (let key in innerHit.highlight) {\n innerHit.highlight[key] = innerHit.highlight[key].filter(highlight => {\n if (seenHighlights.indexOf(highlight) === -1) {\n seenHighlights.push(highlight);\n return true;\n } else {\n return false;\n }\n });\n }\n }\n }\n }\n }\n return hits;\n }", "title": "" }, { "docid": "0b461785dd450a4bfeb5958d0750ee3d", "score": "0.4879422", "text": "filter(fn) {\n let newSet = new SpecialSet();\n // copy over elements that pass the filter\n for (let item of this) {\n if (fn(item) === true) {\n newSet.add(item);\n }\n }\n return newSet;\n }", "title": "" }, { "docid": "17bea1dc28aa8a97f351f76b375cdb8a", "score": "0.487451", "text": "function uniqBy(a, key) {\n var seen = {};\n return a.filter(function(item) {\n var k = item[key];\n return seen.hasOwnProperty(k) ? false : (seen[k] = true);\n });\n}", "title": "" }, { "docid": "68cfcf0543f53e7eb163225f3245423c", "score": "0.48689917", "text": "function getListElms() {\n return $(domToAry(element.children()).filter(function(elm) {\n return !single(elm).hasClass('ag-clone');\n }));\n }", "title": "" }, { "docid": "a35fd10c8c4ac05698264ac6d703d037", "score": "0.4846968", "text": "function distinctUntilKeyChanged(key, compare) {\n return distinctUntilChanged(function (x, y) { return compare ? compare(x[key], y[key]) : x[key] === y[key]; });\n}", "title": "" }, { "docid": "e9d862950354c206ebe013ef9538f9f1", "score": "0.48437065", "text": "function removeDuplicates(data) {\n finalData = data.reduce(function (unique, o) {\n if (!unique.some(function (obj) { return obj.key === o.key && obj.theme === o.theme && obj.name === o.name; })) {\n unique.push(o);\n }\n return unique;\n }, []);\n}", "title": "" }, { "docid": "b86281c94a6cb4eb66c51229abe57911", "score": "0.48213398", "text": "filter(predicate)\n {\n let reducer = (node, acc, parents) => {\n if (predicate(node))\n acc.push(node);\n return acc;\n };\n return this.reduce(reducer, []);\n }", "title": "" }, { "docid": "7e8d47138725d925b9a0eac456418816", "score": "0.48202565", "text": "filter_domobj_by_itemdata(data_predicate) {\n Array.from(this._domobj.children).forEach(\n ch => {\n let i = this._domobj_item_map.get(ch)\n if(data_predicate(i._data)) {\n ch.classList.remove(\"display-none\")\n } else {\n ch.classList.add(\"display-none\")\n }\n }\n )\n }", "title": "" }, { "docid": "8c8210110e2309d1de37786b047f6d7b", "score": "0.47958282", "text": "function removeDups(head) {\n let dupHash = findDups(head);\n let currNode = head.next;\n let prevNode = head;\n\n while(currNode) {\n if(dupHash[currNode.value] > 1) {\n prevNode.next = currNode.next;\n dupHash[currNode.value]--;\n } else {\n prevNode = currNode;\n }\n\n currNode = currNode.next;\n }\n}", "title": "" }, { "docid": "6da50c9f2b41396015ca3fa1ef48e36a", "score": "0.4779304", "text": "function rehashScrapedArticlesList(article) {\n rehashedList = arr.filter(function(el){\n return el.heading !== article.heading;\n });\n return rehashedList; \n}", "title": "" }, { "docid": "9aaf0eb457e9d507a098784e6468e2fa", "score": "0.4772752", "text": "function dupeHead(current){\n\n\tdStart = new ParseNode();\n\tdStart.newNode(current);\n\n\n\tfor (var i = 0; i < current.children.length; i++) {\n\t\tvar child = dupeSub(current.children[i]);\n\t\tchild.parent = dStart;\n\t\tdStart.children.push(child);\n\t}\n\n\tif(dlastnode == undefined && lastnode == current)\n\t\tdlastnode = dStart;\n\n}", "title": "" }, { "docid": "7c6379357db469b6a649db8be5ab8fac", "score": "0.47664073", "text": "removeDuplicates(myArr, prop) {\n return myArr.filter((obj, pos, arr) => {\n return arr.map(mapObj => mapObj[prop]).indexOf(obj[prop]) === pos;\n });\n }", "title": "" }, { "docid": "ebc91c4e621cf7008615c53e16a19e81", "score": "0.47655728", "text": "removeArrayDuplicates(array, key) {\n try {\n // Iterate through the array, filtering out...\n return array.filter(\n (elem, index, self) => index === self.findIndex(innerElem => innerElem[key] === elem[key])\n );\n }\n catch (err) {\n throw err;\n }\n }", "title": "" }, { "docid": "60a5f27f495670f0ce09041e31800bd4", "score": "0.4761043", "text": "removeDuplicates() {\r\n // *************************** list.head = list.sort(list.head); ****************\r\n this.head = this.sort(this.head);\r\n\r\n for (let current = this.head; current; current = current.next) {\r\n // console.log(`current = ${current.value}`);\r\n if (current.next && current.value === current.next.value) {\r\n let temp = current.next.next;\r\n current.next = temp;\r\n this._length--;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "e28df56e70b2de643169e6611abba648", "score": "0.4757119", "text": "prefixedBy(prefix) {\n\t\tlet node = this.root;\n\t\tlet result = [];\n\n\t\tfor (let i = 0; i < prefix.length; i++) {\n\t\t\tif (node.children.get(prefix[i])) {\n\t\t\t\tnode = node.children;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "aa0e71388b7b001bd551a1616a619089", "score": "0.47509164", "text": "function removeDuplicateItems(arr) {}", "title": "" }, { "docid": "2ef13b8bb5f7f821b15949f0ac90367e", "score": "0.4745173", "text": "removeduplicate(){\r\n let current=this.head;\r\n let previous;\r\n while(current != null && current.next!= null){\r\n if(current.data===current.next.data){\r\n previous=current.next.next;\r\n // if(previous==null){\r\n // current.next=null;\r\n // break;\r\n // }\r\n current.next=previous;\r\n }if(current.data != current.next.data){\r\n current=current.next;}\r\n\r\n }\r\n\r\n}", "title": "" }, { "docid": "77ca95d70ea6ed6a26377125c97221b5", "score": "0.47420302", "text": "function filterMultiKey(){ \n var filter = getFilterKey();\n console.log(filter);\n\n filteredData = tableData.filter(function(item) {\n for (var key in filter) {\n if (item[key] === undefined || item[key] != filter[key])\n return false;\n }\n return true;\n });\n return filteredData\n}", "title": "" }, { "docid": "dddf6bba7a7529663af2f404d53780c7", "score": "0.4741094", "text": "removeDuplicates(myArr, prop) {\n return myArr.filter((obj, pos, arr) => {\n return arr.map(mapObj => mapObj[prop]).indexOf(obj[prop]) === pos\n })\n }", "title": "" }, { "docid": "4c67974d503bff9df00651e438bddfd1", "score": "0.47323114", "text": "function isFirstElement(key) {\n\n if (key == document.getElementById(\"hdnOrgShowLevel\").value && myDiagram.model.findNodeDataForKey(key).parent != \"999999\")\n return true;\n else\n return false;\n }", "title": "" }, { "docid": "2403227a2e1b068915fefb53b8d1d54c", "score": "0.473034", "text": "removeDups(){ //assume this is of none trivial length.\n //implement two pointers, one points at current element and the other run ahead to delete dups\n if (this.head == null){\n return\n }\n //Have a current, and then have a runner, if next element from runner is the same as current value, then move runner's next pointer, which is currently pointing at current, to skip over the next node; runner.next = runner.next.next, otherwise, runner = runner.next. Keep doing this for as long as runner.next is not null.\n var current = this.head;\n while(current != null){\n var runner = current;\n while(runner.next != null){\n if (runner.next.value == current.value){\n runner.next = runner.next.next; //Important to note here is that runner is sufficient to move the pointers to the proper places, current is just here to check \n }else { \n runner = runner.next;\n }\n }\n current = current.next;\n }\n }", "title": "" }, { "docid": "a6f226890d3217e219947c5a3148932c", "score": "0.47287652", "text": "removeHead() {\n\t\tconst removed = this.head.value;\n\t\tthis.head = this.head.next;\n\t\treturn removed;\n\t}", "title": "" }, { "docid": "0c67bfd76f5d3ae98e54005fcf28acdf", "score": "0.47202733", "text": "function distinct(array, keyFn) {\n if (!keyFn) {\n return array.filter(function (element, position) {\n return array.indexOf(element) === position;\n });\n }\n var seen = Object.create(null);\n return array.filter(function (elem) {\n var key = keyFn(elem);\n if (seen[key]) {\n return false;\n }\n seen[key] = true;\n return true;\n });\n }", "title": "" }, { "docid": "a8ddbd304d4b141a89a520104ce191e3", "score": "0.47113806", "text": "extract() {\n var length = this._h.length\n\n if (length === 0) {\n return undefined\n }\n\n this.swap(0, length - 1)\n\n var item = this._h.pop()\n , index = 0\n , childIndexes = this.getChildIndexes(index)\n , currentItem = this._h[index]\n\n while (childIndexes[0] in this._h && childIndexes[1] in this._h &&\n !(this.compare(currentItem, this._h[childIndexes[0]]) &&\n this.compare(currentItem, this._h[childIndexes[1]]))) {\n\n var smallerChildIndex = this.compare(this._h[childIndexes[0]], this._h[childIndexes[1]]) ?\n childIndexes[0] : childIndexes[1]\n\n this.swap(index, smallerChildIndex)\n\n index = smallerChildIndex\n childIndexes = this.getChildIndexes(index)\n currentItem = this._h[index]\n\n }\n\n return item\n }", "title": "" }, { "docid": "b35b25a0aff80cdc44be5c2249669831", "score": "0.4705812", "text": "filterDeep(pred) {\n return this.reduce((acc, node) => {\n if (pred(node)) {\n acc.push(node);\n }\n\n return acc.concat(node.filterDeep(pred));\n }, []);\n }", "title": "" }, { "docid": "758d2b3bf82f5aae6b891c01d29f1576", "score": "0.47049278", "text": "function unique() {\n var tags = new _set2.default();\n var metaTypes = new _set2.default();\n var metaCategories = {};\n\n return function (h) {\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) return false;\n tags.add(h.type);\n break;\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) return false;\n metaTypes.add(metatype);\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new _set2.default();\n if (categories.has(category)) return false;\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n break;\n }\n return true;\n };\n}", "title": "" }, { "docid": "758d2b3bf82f5aae6b891c01d29f1576", "score": "0.47049278", "text": "function unique() {\n var tags = new _set2.default();\n var metaTypes = new _set2.default();\n var metaCategories = {};\n\n return function (h) {\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) return false;\n tags.add(h.type);\n break;\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) return false;\n metaTypes.add(metatype);\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new _set2.default();\n if (categories.has(category)) return false;\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n break;\n }\n return true;\n };\n}", "title": "" }, { "docid": "758d2b3bf82f5aae6b891c01d29f1576", "score": "0.47049278", "text": "function unique() {\n var tags = new _set2.default();\n var metaTypes = new _set2.default();\n var metaCategories = {};\n\n return function (h) {\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) return false;\n tags.add(h.type);\n break;\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) return false;\n metaTypes.add(metatype);\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new _set2.default();\n if (categories.has(category)) return false;\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n break;\n }\n return true;\n };\n}", "title": "" }, { "docid": "758d2b3bf82f5aae6b891c01d29f1576", "score": "0.47049278", "text": "function unique() {\n var tags = new _set2.default();\n var metaTypes = new _set2.default();\n var metaCategories = {};\n\n return function (h) {\n switch (h.type) {\n case 'title':\n case 'base':\n if (tags.has(h.type)) return false;\n tags.add(h.type);\n break;\n case 'meta':\n for (var i = 0, len = METATYPES.length; i < len; i++) {\n var metatype = METATYPES[i];\n if (!h.props.hasOwnProperty(metatype)) continue;\n\n if (metatype === 'charSet') {\n if (metaTypes.has(metatype)) return false;\n metaTypes.add(metatype);\n } else {\n var category = h.props[metatype];\n var categories = metaCategories[metatype] || new _set2.default();\n if (categories.has(category)) return false;\n categories.add(category);\n metaCategories[metatype] = categories;\n }\n }\n break;\n }\n return true;\n };\n}", "title": "" }, { "docid": "bdb4d8af5013144a13ff2d1adfba97c2", "score": "0.46919575", "text": "function distinct(array, keyFn) {\n if (!keyFn) {\n return array.filter(function (element, position) {\n return array.indexOf(element) === position;\n });\n }\n var seen = Object.create(null);\n return array.filter(function (elem) {\n var key = keyFn(elem);\n if (seen[key]) {\n return false;\n }\n seen[key] = true;\n return true;\n });\n}", "title": "" }, { "docid": "bdb4d8af5013144a13ff2d1adfba97c2", "score": "0.46919575", "text": "function distinct(array, keyFn) {\n if (!keyFn) {\n return array.filter(function (element, position) {\n return array.indexOf(element) === position;\n });\n }\n var seen = Object.create(null);\n return array.filter(function (elem) {\n var key = keyFn(elem);\n if (seen[key]) {\n return false;\n }\n seen[key] = true;\n return true;\n });\n}", "title": "" }, { "docid": "cb10915f938fd675a39f2d5ad9e22d7a", "score": "0.46759886", "text": "visitGroup_by_elements(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "1d2859193e61440ae8bae5be601ea261", "score": "0.46708587", "text": "function filter(el,filterFn){Array.prototype.filter.call(el,filterFn);}//https://jsfiddle.net/w1rktecz/", "title": "" }, { "docid": "205361b7f9109fc0de9e58f23e5fcdd1", "score": "0.46698636", "text": "function deleteDuplicates(head) {\n let node = head;\n\n while (node && node.next) {\n if (node.val === node.next.val) {\n node.next = node.next.next;\n } else {\n node = node.next;\n }\n }\n\n return head;\n}", "title": "" }, { "docid": "39dd2f094bd5f26a47a5a33fcd95ee7f", "score": "0.46512902", "text": "function removeDuplicates(array, key) {\n var lookup = {};\n var result = [];\n $.each(array, function (i, value) {\n if (!lookup[value[key]]) {\n lookup[value[key]] = true;\n result.push(value);\n };\n });\n return result;\n }", "title": "" } ]
5304ea79c6bd07b47ca53e66e6d47211
Function to return completed matches, i.e. only matches that reached FullTime
[ { "docid": "3f5b8a6b316bfddffa36df698f27af84", "score": "0.60400975", "text": "function isFullTime(match) {\n return match.MatchInfo.Period === 'FullTime';\n }", "title": "" } ]
[ { "docid": "0144ca03645e1b68a0d6e9dc540bcee7", "score": "0.61511713", "text": "function getCurrentMatches(callback){\n\tvar currentMatchesData={\n\t\tapikey:\"qMdsykxRTkft5pvwqdaqOI8D6Sm2\"\n\t};\n\trequest({\n\t\turi:'http://cricapi.com/api/matchCalendar',\n\t\tmethod:'POST',\n\t\tjson:currentMatchesData\n\t},function(error,response,body){\n\t\t//console.log(body.matches[0].unique_id);\n\t\tif(!error && response.statusCode==200){\n\t\t\tvar today=moment().format('LL');\n\t\t\tconsole.log(today);\n\t\t\tvar matches=body.data;\n\t\t\tvar todayMatches=matches.filter(function(match){\n\t\t\t\treturn (match.date===today);\n\t\t\t});\n\t\t\tvar matchesWithId=todayMatches.filter(function(match){\n\t\t\t\treturn ((match.unique_id.indexOf('will generate') < 0));\n\t\t\t});\n\t\t\tmatchesWithId.forEach(function(matches){\n\t\t\t\tmatches.matchStarted=true;\n\t\t\t});\n\t\t\tconsole.log(\"TODAY MATCHES - \");\n\t\t\tconsole.log(todayMatches);\n\t\t\tconsole.log(\"MATCHES WITH ID - \");\n\t\t\tconsole.log(matchesWithId);\n\t\t\tvar allCurrentMatches=matchesWithId;\n\t\t\tvar matchesWithNoId=todayMatches.filter(function(match){\n\t\t\t\treturn (match.unique_id.indexOf('will generate') > -1);\n\t\t\t});\n\t\t\tconsole.log(\"MATCHES WITH NO ID - \");\n\t\t\tconsole.log(matchesWithNoId);\n\t\t\tif(matchesWithNoId.length>0){\n\t\t\t\tgetUniqueId(function(newMatches){\n\t\t\t\t\tconsole.log(\"NEW MATCHES ----- \");\n\t\t\t\t\tconsole.log(newMatches);\n\t\t\t\t\tallCurrentMatches=matchesWithId.concat(newMatches);\n\t\t\t\t\tconsole.log(\"ALL CURRENT MATCHES ----- \")\n\t\t\t\t\tconsole.log(allCurrentMatches);\n\t\t\t\t\tvar startedMatches=allCurrentMatches.filter(function(match){\n\t\t\t\t\t\treturn (match.matchStarted);\n\t\t\t\t\t});\n\t\t\t\t\tcallback(startedMatches);\n\t\t\t\t},matchesWithNoId);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcallback(allCurrentMatches);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tconsole.error(\"Unable to retrieve current matches\");\n\t\t\tconsole.error(response);\n\t\t\tconsole.error(error);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "98a0b2d6958fd2a3a46f686283d68ec6", "score": "0.6099511", "text": "function checkifALLMatched(){\n if (matched == 8){\n stopTimer();\n displaySummary();\n }\n}", "title": "" }, { "docid": "3cd7f6f71b6571875fce47c7278d5b93", "score": "0.60624886", "text": "function findMatchLoop() {\n // Loop through all players looking for a match\n for (var playerId in playersLookingForMatch) {\n\n var player = playersLookingForMatch[playerId];\n\n // Timeout the player and continue to the next if they have been searching for too long\n if (nowTime > (player.startTime + matchSearchTimeout)) {\n\t\t\tfindMatchTimeout(playerId);\n\t\t\tcontinue;\n\t\t}\n\n if (player.matchFound) {\n continue;\n } else {\n // Find potentional opponents\n for (var opponentId in playersLookingForMatch) {\n\n var opponent = playersLookingForMatch[opponentId];\n\n\t\t\t\t// We treat the 'host' player as the player who first initiated the findMatch,\n\t\t\t\t// so the 'join' player must always come later in time.\n if (opponent.startMuTime < player.startMuTime\n\t\t\t\t\t&& opponent.matchFound == false) {\n\n\t\t\t\t\tplayer.matchFound = true;\n\t\t\t\t\topponent.matchFound = true;\n\n\t\t\t\t\t// match found, trigger it\n\t\t\t\t\tmatchFound(opponent, player);\n\n\t\t\t\t}\n }\n }\n }\n}", "title": "" }, { "docid": "72f67babfe9c4f1a1175740b22cc344e", "score": "0.58777326", "text": "async function GetAllMatchesWithoutReferee(){\n \n \n var matches = await matches_utils.getLeagueMatches();\n var matchesWithReferee = [[],[]];\n\n matches[0].map((element) => {\n if(element.refereeID == null){\n var matchDate = matches_domain.getDateTimeDisplayFormat(element.matchDateAndTime);\n matchesWithReferee[0].push({\n matchID : element.match_id,\n matchDate : matchDate,\n localTeamName : element.localTeamName,\n visitorTeamName : element.visitorTeamName,\n venueName : element.venueName\n });\n };\n });\n\n matches[1].map((element) => {\n if(element.refereeID == null){\n var matchDateAndTime = matches_domain.getDateTimeDisplayFormat(element.matchDateAndTime);\n matchesWithReferee[1].push({\n matchID : element.match_id,\n matchDateAndTime : matchDateAndTime,\n localTeamName : element.localTeamName,\n visitorTeamName : element.visitorTeamName,\n venueName : element.venueName,\n localTeamScore : element.localTeamScore,\n visitorTeamScore : element.visitorTeamScore\n });\n };\n });\n\n return matchesWithReferee;\n \n}", "title": "" }, { "docid": "d1b75c63de56ce2b8c528c1dcbd8d9f0", "score": "0.58198786", "text": "function checkAllMatched(successfulMatches) {\n if (successfulMatches === 8) {\n console.log(\"Game has been completed\");\n stopTimer();\n openModal();\n if (hours > 0)\n document.getElementById(\"modal-hours\").innerText = hours + \" hours\";\n if (minutes > 0)\n document.getElementById(\"modal-minutes\").innerText = minutes + \" minutes\";\n if (seconds > 0)\n document.getElementById(\"modal-seconds\").innerText = seconds + \" seconds\";\n \n document.getElementById(\"modal-rating\").innerText = rating;\n\n const starFragment = document.createDocumentFragment();\n const star = document.createElement(\"li\");\n const icon = document.createElement(\"i\");\n icon.setAttribute(\"class\", \"fa fa-star\");\n icon.setAttribute(\"style\", \"color: rgb(255, 215, 0)\");\n \n star.appendChild(icon);\n\n for (let i = 1; i <= rating; i++) {\n starFragment.appendChild(star.cloneNode(true));\n }\n document.querySelector(\".modal-stars\").appendChild(starFragment);\n }\n}", "title": "" }, { "docid": "5e3be6a042918965ed50e2b058577fe3", "score": "0.57619905", "text": "function matching() {\n for (matchedCard of matchedCards) {\n matchedCard.classList.add('match');\n }\n //winning condition!Opens modal after 1 minute!\n if (matchedCards.length === 16) {\n stopTimer();\n setTimeout(openModal(), 1000);\n }\n}", "title": "" }, { "docid": "d9030ac6dc96cd6920e8c450582538e4", "score": "0.57594675", "text": "function complete(matches) {\n\tconsole.log('[info] ' + matches.length + ' matching networks found.');\n\tprocess.exit(0);\n}", "title": "" }, { "docid": "da2f76ae7f064eed0f3f32902c5c849e", "score": "0.5738392", "text": "function forTheWin(){\r\n let totalMatches=document.querySelectorAll('.match').length\r\n if (totalMatches===matchNum){\r\n stopTimer(clock)\r\n winModal()\r\n document.querySelector('#finalMove').innerHTML=clicks\r\n document.querySelector('#finalTime').innerHTML=Math.floor((totalTime-start_time)/60)+\" mins:\"+((totalTime-start_time)%60)+\" secs\"\r\n } \r\n}", "title": "" }, { "docid": "d609e0e01602edf691cefd53bc941193", "score": "0.5709328", "text": "async function checkIfPastOrFuture(matchID){\n \n var match = await matches_utils.getPastMatchByID(matchID);\n var whichMatch = \"past\";\n\n if (match.length == 0){\n match = await matches_utils.getFutureMatchByID(matchID);\n whichMatch = \"future\";\n }\n\n return { match : match , whichMatch : whichMatch };\n\n}", "title": "" }, { "docid": "da8bde2e6f598e35aa5c227a2e2c6205", "score": "0.56912076", "text": "async function GetPastMatchesWithoutResult(){\n\n var matches = await matches_utils.getLeagueMatches();\n var matchesWithResult = [];\n\n matches[0].map((element) => {\n if(element.visitorTeamScore == null || element.localTeamScore == null){\n var matchDateAndTime = matches_domain.getDateTimeDisplayFormat(element.matchDateAndTime);\n matchesWithResult.push({\n matchID : element.match_id,\n matchDateAndTime : matchDateAndTime,\n localTeamName : element.localTeamName,\n visitorTeamName : element.visitorTeamName,\n venueName : element.venueName,\n refereeID : element.refereeID,\n localTeamScore : element.localTeamScore,\n visitorTeamScore : element.visitorTeamScore\n });\n };\n });\n\n for ( var i=0 ; i < matchesWithResult.length ; i++ ){\n\n var refereeDic = await matches_utils.extractRefereeInfo(matchesWithResult[i][\"refereeID\"]);\n\n if ( refereeDic.length != undefined ){\n matchesWithResult[i][\"refereeInformation\"] = refereeDic[0];\n } else{\n matchesWithResult[i][\"refereeInformation\"] = {};\n }\n delete matchesWithResult[i].refereeID;\n }\n\n\n return matchesWithResult;\n \n}", "title": "" }, { "docid": "4724828df5a85498e0c1df1dd2a3081e", "score": "0.5657751", "text": "function endOfGameReached(){\n for (var i = 0; i < grid.cards.length; i++) {\n if (grid.cards[i].hasBeenSelected) {\n matched++;\n }\n }\n if (matched>=100){\n matched = 0;\n return true;\n }\n matched = 0;\n return false;\n }", "title": "" }, { "docid": "f92a8910a7d4310a9afd94073780e0b5", "score": "0.5652933", "text": "function isMatching(){\n if(matches.length == 2){\n //need to disable clicking for all other cards\n if (matches[0].childNodes[1].className === matches[1].childNodes[1].className){\n console.log('its a match');\n matches[0].classList.add(\"match\");\n matches[1].classList.add(\"match\");\n \n matches[0].classList.remove(\"show\", \"open\");\n matches[1].classList.remove(\"show\", \"open\");\n confirmMatches.push(matches[0].childNodes[1].className)\n matches = []\n scoreKeeper()\n } //end of if statement\n else{\n console.log('its not a match');\n //timeout function, then remove show and open\n setTimeout(function (){\n matches[0].classList.remove(\"show\", \"open\");\n matches[1].classList.remove(\"show\", \"open\");\n matches = [];\n scoreKeeper()\n }, 2000)\n \n } //end of else statement\n \n } //end of matches array length check\n} // end of isMatching function", "title": "" }, { "docid": "065f7ed530161841274e9298faacf0de", "score": "0.5627916", "text": "function GetMatchesProcessPerUser(req, res) {\n\tvar cuser = null;\n\tvar allmatches = [];\n\tvar newestMatch = null;\n\treturn apilib.requireParameters(req, [\"UserToken\", \"UserID\"])\n\t.then(function() { return userlib.validateToken(req.body[\"UserID\"], req.body[\"UserToken\"]); })\n\t.then(function(authuser) {\n\t\tcuser = authuser;\n\t\tif (authuser[\"AppStatus\"] != 2)\n\t\t\tthrow \"You're on the waitlist! Check back shortly.\";\n\t\t// find all previous non-dead matches:\n\t\treturn Promise.all([\n\t\t\tmodels.Matches.findAll({where : {\"IsDead\" : 0, \"OtherUserHasDeletedFlag\" : 0, \"ReachingOutUserHasDeletedFlag\" : 0, \"ReachingOutUserID\" : cuser[\"ID\"] } }),\n\t\t\tmodels.Matches.findAll({where : {\"IsDead\" : 0, \"OtherUserHasDeletedFlag\" : 0, \"ReachingOutUserHasDeletedFlag\" : 0, \"OtherUserID\" : cuser[\"ID\"], \"NewestMessageID\" : { $ne : null } } })\n\t\t]);\n\t})\n\t.then(function(matches) {\n\t\tfor (var i in matches)\n\t\t\tfor (var j in matches[i])\n\t\t\t\tallmatches.push( matches[i][j].get({plain: true}) );\n\t\t// check if we need to generate new matches\n\t\tvar isnewestexpired = false;\n\t\tif (allmatches.length > 0) {\n\t\t\tnewestMatch = allmatches[0];\n\t\t\tfor (var i in allmatches) {\n\t\t\t\tif ((allmatches[i][\"ReachingOutUserID\"] == cuser[\"ID\"]) && (allmatches[i][\"MatchDate\"] > newestMatch[\"MatchDate\"] ))\n\t\t\t\t\tnewestMatch = allmatches[i];\n\t\t\t}\n\t\t\tif (newestMatch[\"MatchExpireDate\"] < (new Date()))\n\t\t\t\tisnewestexpired = true;\n\t\t}\n\n\t\tif ((allmatches.length == 0) || (isnewestexpired) || ((req.body[\"GetNewMatch\"] !== undefined) && (req.body[\"GetNewMatch\"] == \"1\") ) ) {\n\t\t\treturn createNewMatch(cuser)\n\t\t\t.then(function(newMatch) {\n\t\t\t\tif (newMatch == null)\n\t\t\t\t\treturn true;\n\t\t\t\t// add as first element\n\t\t\t\tallmatches.unshift(newMatch);\n\t\t\t\tnewestMatch = newMatch;\n\t\t\t\treturn true;\n\t\t\t});\n\t\t}\n\t\treturn true;\n\t})\n\t// convert all matches into matchresults\n\t.then(function() {\n\t\treturn Promise.map(allmatches, function(m) {\n\t\t\t// get public user information\n\t\t\tvar res = null;\n\t\t\tvar cuid = (m[\"OtherUserID\"] == cuser[\"ID\"])?(m[\"ReachingOutUserID\"]):(m[\"OtherUserID\"]);\n\t\t\treturn userlib.getPublicUserInfo(cuid, false)\n\t\t\t.then(function(otherUserInfo) {\n\t\t\t\tres = userlib.copyValues(m, [\"MatchDate\", \"MatchRationale\"]);\n\t\t\t\tres[\"MatchID\"] = m[\"ID\"];\n\t\t\t\tres[\"UnreadMessageCount\"] = 0;\n\t\t\t\tres[\"UserHasViewedMatch\"] = m[\"ReachingOutUserHasViewedFlag\"];\n\t\t\t\tres[\"IsPreferredMatch\"] = false;\n\t\t\t\tres = apilib.formatAPICall(res, [\"MatchDate\"]);\n\t\t\t\tres[\"UserInformation\"] = otherUserInfo[\"PublicUserInformation\"];\n\t\t\t\tres[\"MatchExpireTime\"] = dateFormat(m[\"MatchExpireDate\"], \"mm/dd/yyyy HH:MM:ss\", true);\n\t\t\t\t// get latest one message\n\t\t\t\treturn models.Messages.findAll({where : {$or : [{ ReceiverID : m[\"ReachingOutUserID\"], SenderID : m[\"OtherUserID\"] },\n\t\t\t\t\t{ ReceiverID : m[\"OtherUserID\"], SenderID : m[\"ReachingOutUserID\"] } ] }, order : \"ID desc\", limit : 1});\n\t\t\t})\n\t\t\t.then(function(msg) {\n\t\t\t\tif ((msg == null) || (msg.length == 0)) {\n\t\t\t\t\tres[\"LatestMessage\"] = null;\n\t\t\t\t\treturn res;\n\t\t\t\t}\n\t\t\t\tcmsg = userlib.copyValues(msg[0].get({plain : true}), [\"ID\", \"DateCreated\", \"SenderID\", \"ReceiverID\", \"Type\", \"HasRead\"]);\n\t\t\t\tcmsg[\"Message\"] = msg[0][\"Message1\"];\n\t\t\t\tres[\"LatestMessage\"] = apilib.formatAPICall(cmsg, [\"DateCreated\"]);\n\t\t\t\treturn res;\n\t\t\t})\n\t\t})\n\t})\n\t// sort resulting array by: last message date, or Match date if no message have been sent yet\n\t.then(function(matchresults) {\n\t\tfunction getSortDate(m) {\n\t\t\tif ((m[\"LatestMessage\"] !== undefined) && (m[\"LatestMessage\"] != null) && (m[\"LatestMessage\"][\"DateCreated\"] !== undefined) )\n\t\t\t\treturn new Date(m[\"LatestMessage\"][\"DateCreated\"]).getTime();\n\t\t\treturn new Date(m[\"MatchDate\"]).getTime();\n\t\t};\n\t\tmatchresults.sort(function(a,b) {\n\t\t\t// if no message have been sent yet, set it as first\n\t\t\tif (a[\"LatestMessage\"] == null)\n\t\t\t\treturn -1;\n\t\t\tif (b[\"LatestMessage\"] == null)\n\t\t\t\treturn 1;\n\t\t\t// otherwise, sort by latest message\n\t\t\tvar ta = getSortDate(a);\n\t\t\tvar tb = getSortDate(b);\n\t\t\tif (ta == tb)\n\t\t\t\treturn 0;\n\t\t\treturn (ta > tb)?(-1):(1);\n\t\t})\n\t\treturn matchresults;\n\t})\n\t.then(function(matchresults) {\n\t\t// remove all expired & no-message matches; and related notifications\n\t\tif (matchresults.length < 2)\n\t\t\treturn matchresults;\n\t\tvar removeids = [];\n\t\tvar removenotifs = [];\n\t\tfor (var i = 1; i < matchresults.length; i++) {\n\t\t\tif (matchresults[i][\"LatestMessage\"] == null) {\n\t\t\t\tremoveids.push(matchresults[i][\"MatchID\"]);\n\t\t\t}\n\t\t}\n\t\tconsole.log(\"removeids \",removeids);\n\t\treturn Promise.map(removeids, function(citem) {\n\t\t\tconsole.log(\"removing \",citem);\n\t\t\treturn models.Matches.update({\"IsDead\" : true}, {where : { ID : citem}});\n\t\t})\n\t\t.then(function() {\n\t\t\tfor (var i in removeids) {\n\t\t\t\tfor (var j in matchresults) {\n\t\t\t\t\tif (matchresults[j][\"MatchID\"] == removeids[i]) {\n\t\t\t\t\t\tmatchresults.splice( j, 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn matchresults;\n\t\t})\n\t})\n\t.then(function(matchresults) {\n\t\t//if a message exists in a conversation, no longer can be preferred\n\t\tif ((matchresults.length > 0) && (matchresults[0][\"LatestMessage\"] == null))\n\t\t\tmatchresults[0][\"IsPreferredMatch\"] = \"true\";\n\t\tvar nextMatchDate = \"\";\n\t\tif (newestMatch != null)\n\t\t\tnextMatchDate = dateFormat(newestMatch[\"MatchExpireDate\"], \"mm/dd/yyyy HH:MM:ss\", true);\n\t\tvar msgres = {\"Matches\" : matchresults, \"NextMatchDate\" : nextMatchDate, \"Status\" : {\"Status\" : \"1\", \"StatusMessage\" : \"\" } };\n\t\treturn res.json({\"GetMatchesForUserResult\" : msgres });\n\t})\n\t.catch( apilib.errorhandler(\"GetMatchesForUserResult\", req, res));\n}", "title": "" }, { "docid": "d1862c05958687d737ebbcc68a5113f2", "score": "0.56269485", "text": "function matched() {\n\tmatchCards[0].classList.add('match');\n\tmatchCards[1].classList.add('match');\n\tfinishGame++;\n\n\tif (finishGame === 8) {\n\t\tclearInterval(timer);\n\t\tmodalMessage();\n\t}\n}", "title": "" }, { "docid": "b84eab3c8715016e87c86b171aba5e3d", "score": "0.56226236", "text": "function updateMatches() {}", "title": "" }, { "docid": "e3b8e920b394bd801fbddeada95bca76", "score": "0.55886614", "text": "function getMatchAll() {\n return new Promise(function(resolve, reject) {\n dbPromised\n .then(db => {\n let tx = db.transaction(\"matches\", \"readonly\");\n let store = tx.objectStore(\"matches\");\n return store.getAll();\n })\n .then(matches => {\n resolve(matches);\n });\n });\n}", "title": "" }, { "docid": "138446980920ca9f4a94fd20cda9dc2c", "score": "0.5587838", "text": "function checkMatched() {\n\n\tif (matchCards[0].classList.value === matchCards[1].classList.value) {\n\t\tsetTimeout(function() {\n\t\t\tmatched();\n\t\t\tmatchCards = [];\n\t\t}, (500));\n\n} else {\n\tnotMatched();\n\t}\n}", "title": "" }, { "docid": "dcf86e6679e25024acaeedd8442c5ebe", "score": "0.55094737", "text": "function matched() {\n\n\tenableClick = false;\n\n\tsetTimeout(function () {\n\n\t\topenCards.forEach(function (card) {\n\t\t\tcard.classList.add('match');\n\t\t\tmatchedCards.push(card);\n\n\t\t\tif (matchedCards.length === 16) {\n\t\t\t\tendGame();\n\t\t\t}\n\n\t\t});\n\t\topenCards = [];\n\t\tenableClick = true;\n\n\t}, 1000);\n\n}", "title": "" }, { "docid": "e710df4b5f7273c09a96c6b044ee2e4a", "score": "0.5495431", "text": "function timeMatchCards() {\n\t\tsetTimeout(matchCards, 500);\n\t}", "title": "" }, { "docid": "2d5091e7f32422d6c1f3161cb0d128c7", "score": "0.54867125", "text": "function aMatch() {\n isOpen[0].classList.add('match');\n isOpen[1].classList.add('match');\n isOpen = [];\n // at the last pairing the game is over\n if (document.getElementsByClassName('match').length === 16) {\n endGame(getTimeString(getElapsedTime()));\n }\n}", "title": "" }, { "docid": "43a3a0c724cfb3fc35b7f57bca69746f", "score": "0.54635096", "text": "function populateMatchesList(matchday){\r\n // Remove all the previous items\r\n $('#matchList li').remove();\r\n var currentMatches = storage.matches[matchday];\r\n storage['currentMatches'] = currentMatches\r\n var sortedCurrentMatches = []\r\n $.each(currentMatches, function(matchID, currentMatch){\r\n sortedCurrentMatches.push(currentMatch)\r\n });\r\n // Sorting the matches based on date time\r\n sortedCurrentMatches.sort(\r\n function(a, b){\r\n return (new Date(a['utcDate']) - new Date(b['utcDate']))\r\n });\r\n var dateTimeIterator = new Date('2000-01-01T00:00:00Z')\r\n $.each(sortedCurrentMatches, function(matchID, currentMatch){\r\n // Date and Time\r\n var datetime = new Date(currentMatch['utcDate'])\r\n var dateFormatOptions = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };\r\n var timeFormatOptions = {hour: '2-digit', minute:'2-digit', hour12: false}\r\n var date = datetime.toLocaleDateString('en-US', dateFormatOptions)\r\n var time = datetime.toLocaleTimeString('en-US', timeFormatOptions)\r\n\r\n // Score\r\n var homeTeamScore = 'unknown';\r\n var awayTeamScore = 'unknown';\r\n if (currentMatch['status'] === FINISHED){\r\n homeTeamScore = currentMatch['score']['fullTime'][homeTeam];\r\n awayTeamScore = currentMatch['score']['fullTime'][awayTeam];\r\n time = 'FT'\r\n } else if (currentMatch['status'] === SCHEDULED){\r\n homeTeamScore = '?';\r\n awayTeamScore = '?';\r\n } else if (currentMatch['status'] === IN_PLAY){\r\n homeTeamScore = currentMatch['score']['fullTime'][homeTeam] + '*';\r\n awayTeamScore = currentMatch['score']['fullTime'][awayTeam] + '*';\r\n time = 'Play'\r\n } else if (currentMatch['status'] === PAUSED){\r\n homeTeamScore = currentMatch['score']['fullTime'][homeTeam] + '*';\r\n awayTeamScore = currentMatch['score']['fullTime'][awayTeam] + '*';\r\n time = 'HT'\r\n }\r\n\r\n if (stringifyDate(dateTimeIterator) < stringifyDate(datetime)){\r\n dateTimeIterator = datetime;\r\n $('#matchList').append(\r\n '<li data-role=\"list-divider\">' + date + '</li>'\r\n )\r\n }\r\n \r\n\r\n $('#matchList').append(\r\n '<li><a href=\"#\" class=\"matchitem\" id=' + currentMatch['id'] + '>' + \r\n '<div class=\"ui-grid-c\">' + \r\n '<div class=\"ui-block-a time-cell\">' + \r\n time + \r\n '</div>' + \r\n '<div class=\"ui-block-b match-cell\">' + \r\n '<div class=ui-grid-solo>' + currentMatch[homeTeam]['name'] + '</div>' + \r\n '<div class=ui-grid-solo>' + currentMatch[awayTeam]['name'] + '</div>' + \r\n '</div>' + \r\n '<div class=\"ui-block-c score-cell\">' + \r\n '<div class=ui-grid-solo>' + homeTeamScore + '</div>' + \r\n '<div class=ui-grid-solo>' + awayTeamScore + '</div>' + \r\n '</div>' + \r\n '</div>' +\r\n '</a></li>'\r\n )\r\n });\r\n // Refresh the list (important)\r\n $('#matchList').listview('refresh');\r\n}", "title": "" }, { "docid": "8a79b32427a047a66e5be3405a301788", "score": "0.5457124", "text": "function checkIfAllMatched(matchingCards, startingTime) {\n if (matchingCards.length === 16) {\n stopTimer();\n let moves = document.querySelector('.moves');\n let moveCount = moves.textContent;\n let numberStars;\n const displayModal = document.querySelector('.modal');\n displayModal.style.display = 'block';\n timerInterval --;\n const minutes = Math.floor(timerInterval / 60);\n const seconds = timerInterval - minutes * 60; \n const timeClass = document.querySelector('.time');\n if (minutes === 1) {\n timeClass.textContent = 'time to win: ' + minutes + ' minute ' + parseInt(seconds) + ' seconds';\n }\n else {\n timeClass.textContent = 'time to win: ' + minutes + ' minutes ' + parseInt(seconds) + ' seconds';\n }\n if (moveCount < 26){\n numberStars = 3;\n }\n else if (moveCount < 36){\n numberStars = 2;\n }\n else {\n numberStars = 1;\n }\n let starRatings = document.querySelector('.starRating');\n starRatings.textContent = 'with a star rating of: ' + numberStars;\n };\n}", "title": "" }, { "docid": "6aa3c864465d1d0ed202761924218418", "score": "0.54480815", "text": "function checkGameFinished() {\n var numberOfMatched = cardList.length;\n if(numberOfMatched === $('.match').length){\n timer.stop();\n $(\".container\").hide();\n $(\".win-container\").show();\n } else{\n $(\".container\").show();\n $(\".win-container\").hide();\n }\n}", "title": "" }, { "docid": "a05be938b801da14de78cab08de0d0f1", "score": "0.54378474", "text": "async function checkMatch() {\n const matchUser = await Users.get(match.id);\n\n if (matchUser.matches && matchUser.matches[user.id] !== null)\n if (matchUser.matches[user.id] === false) {\n const oldMatches = user.matches || {};\n\n const userMatches = {\n [match.id]: false,\n ...oldMatches,\n };\n\n await Users.update(user.id, { matches: userMatches });\n\n setHadAwaiting(false);\n\n navigation.navigate(\"menu\");\n } else {\n const oldMatches = user.matches || {};\n\n const userMatches = {\n [match.id]: matchUser.matches[user.id],\n ...oldMatches,\n };\n\n await Users.update(user.id, { matches: userMatches });\n\n setHadAwaiting(false);\n\n navigation.navigate(\"Matches\");\n }\n }", "title": "" }, { "docid": "31cea89325836ac76d469f47dd82c6f6", "score": "0.5428682", "text": "async function getMatch (vainglory, region, search, status) {\n // Starts a timer to measure how long it took to call the API\n const startCall = Date.now()\n await vainglory.region(region).matches.collection(search).then((matches) => {\n if (matches.errors) {\n // Ends the timer\n const endCall = Date.now()\n status.push(`${matches.region.toUpperCase()} ❌`)\n status.push(`Error: ${matches.messages}`)\n checkSpeed(endCall, startCall, status)\n }\n const endCall = Date.now()\n const latest = new Date() - Date.parse(matches.data[0].attributes.createdAt)\n status.push(`${matches.data[0].attributes.shardId.toUpperCase()} ✅`)\n status.push(timeDiff(latest))\n checkSpeed(endCall, startCall, status)\n })\n}", "title": "" }, { "docid": "aca021fdfebd26358ae81eba152e1ae9", "score": "0.5360592", "text": "function matchPlayers() {\n queue.matchPlayers().then(matches => {\n if (queue.size >= 2)\n setTimeout(matchPlayers, timeBetweenAutoMatch);\n\n if (matches.length == 0)\n return;\n\n assert(matches.length == 2, \"Match should always be 2 long if it isn't empty\");\n\n MongoClient.get().then(client => {\n const db = client.db('eldritch_data');\n\n // get userdata from matched users\n Promise.all([\n db.collection('users').findOne(ObjectId(matches[0])),\n db.collection('users').findOne(ObjectId(matches[1]))\n ]).then(results => {\n // verify the players exist\n for (let result of results)\n if (!result)\n throw new Error(\"Matched nonexistant player\");\n\n // get usernames\n let users = results.map(u => u.username);\n\n // create a Match object\n let match = new Match(dataHandler);\n\n // get sockets\n /** @type {import(\"net\").Socket[]} */\n let connections = matches.map(id => clientConnections[id]);\n\n for (let i = 0; i < matches.length; i++) {\n // add player to match\n match.addPlayer(matches[i], connections[i]);\n\n // player cannot be removed after they are matched\n connections[i].removeListener('close', connections[i]._temp_remove);\n delete connections[i]._temp_remove;\n\n // player is now not using the old data handler\n connections[i].removeListener('data', dataHandler);\n }\n\n // notify the waiting users\n let matchID = `${users[0]} vs ${users[1]}`;\n connections[0].write(`match found: ${users[1]}\\n${matchID}\\n`);\n connections[1].write(`match found: ${users[0]}\\n${matchID}\\n`);\n\n \n\n return true;\n });\n }).catch(e => console.log(e));\n });\n}", "title": "" }, { "docid": "b53d9fbd87afee2481a869780178a62f", "score": "0.53494895", "text": "function allCardsMatched() {\n // there're 16 cards in total, so there're 8 matches possible. The game finishes when ther're 8 matches.\n if(numMatch === 8) {\n return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "d7f87529fde4f2742469cfe820739f24", "score": "0.5349472", "text": "displayAllMatchedRespondents() {\n console.log(\"\\nAll matches- ordered by matching scores:\");\n console.log(\"===================================\\n\");\n for (let i = 0; i < this.results.length; i++) {\n const curr = this.results[this.results.length - 1 - i];\n console.log(i);\n console.log(\n `Name: ${curr.name.slice(0, 1).toUpperCase()}${curr.name.slice(\n 1\n )}`\n );\n console.log(\n `Number of matching industries: ${curr.industriesMatch.number}`\n );\n console.log(\n `Job matches: ${(() =>\n curr.jobMatches.match\n ? curr.jobMatches.jobTitle\n : \"No job matches\")()}`\n );\n console.log(\n `Closest available city: ${curr.closestAvailableCity.city}`\n );\n console.log(\n `Distance to closest available city: ${curr.closestAvailableCity.distance}km`\n );\n console.log(`Matching Score: ${curr.score}`);\n console.log(\"-------------------------------\");\n }\n }", "title": "" }, { "docid": "179ca28a9ee9a0e2dd25f09f0f554fb8", "score": "0.53301585", "text": "async function getPastMatchesToAddReferee(){\n \n const referees = await getAllReferees();\n const matchesWithoutReferee = await GetAllMatchesWithoutReferee();\n\n const dataForUnionAgent = {\n referees : referees,\n futureMatchesWithoutReferee : matchesWithoutReferee[1],\n pastMatchesWithReferees : matchesWithoutReferee[0]\n }\n\n return dataForUnionAgent;\n \n}", "title": "" }, { "docid": "e8a29fd2c4d39d160147c1b7e41c1faf", "score": "0.5318953", "text": "function checkMatch(){\n increaseScore();\n if (open[0][0].innerHTML == open[1][0].innerHTML) {\n matched.push(open[0], open[1]);\n\n for (let i in open) {\n $(open[i]).toggleClass('open show match');\n }\n\n if (matched.length == cardsArray.length) {\n end = new Date();\n clearInterval(runtime);\n displayModal();\n }\n open.length = 0;\n }else {\n open[0].toggleClass('open show');\n open[1].toggleClass('open show');\n open.length = 0;\n }\n}", "title": "" }, { "docid": "d39de7a69870dc1a32f8e70731aabaa1", "score": "0.5314971", "text": "function check_for_match() {\n if (opened_cards[0].children().attr('class') == opened_cards[1].children().attr('class')) {\n\n opened_cards[0].addClass(\"match\");\n opened_cards[1].addClass(\"match\");\n\n matchers += 1;\n if (matchers == 8) {\n game_over($('#player').text(),$moves.text(),$timer.text())\n }\n $('.matches').html(matchers)\n } else {\n close_cards(opened_cards)\n }\n\n opened_cards = [];\n}", "title": "" }, { "docid": "d510c100ade4bd272b2af9649eece71d", "score": "0.5306165", "text": "parseMatches(player_id) {\n Meteor.apply(\"getMatchHistory\", [player_id],\n function(error, results) {\n if(results) {\n console.log(results.content);\n console.log(results.data.result.matches);\n var total_matches = results.data.result.matches.length;\n for(var i=0; i < results.data.result.matches.length; i++) {\n if(MatchHistory.searchMatch(results.data.result.matches[i].match_id) == 0) {\n MatchShort.insert(results.data.result.matches[i]);\n } else {\n console.log(\"Match \"+results.data.result.matches[i].match_id+\" already saved\");\n }\n //MatchHistory.saveMatch(results.data.result.matches[i].match_id);\n console.log(i + \" - Match \" + results.data.result.matches[i].match_id + \" saved\");\n }\n return;\n //this.displayMatches(results.data.result.matches);\n //displayMatches(results.data.result.matches);\n // for (var i=0; i < results.data.result.matches.length; i++) {\n // this.saveMatch(results.data.result.matches[i].match_id);\n // }\n } else {\n console.log(error);\n }\n });\n }", "title": "" }, { "docid": "b4ea4b569f6e807b3b0a9ccfab938ebb", "score": "0.5304463", "text": "function showResult() {\n\n var matchedCards = document.querySelectorAll('li.match');\n var selector = \"ul.finalScore\";\n var finalTime = document.querySelector(\"span.time\").textContent;\n\n //when modal is open, clear the interval handler.\n if(matchedCards.length === 16) {\n clearInterval(showResultModal);\n clearInterval(timerIntervalHandler);\n $(\"#successModal\").modal();\n }\n\n setRating(selector);\n document.querySelector(\"span.finalTime\").textContent = finalTime;\n}", "title": "" }, { "docid": "2455f881e3017fc2af47e014e63a7d37", "score": "0.5272371", "text": "async function findCC(CC, time) {\n\n // console.log(CC, time)\n const matchingCaptions = CC.find(cc => cc.startTime == time && time == cc.endTime)\n return matchingCaptions ? matchingCaptions : null\n\n\n}", "title": "" }, { "docid": "c35f1a57500cc4c4ae28006fa87d61a4", "score": "0.52649343", "text": "function completedRounds(gameSnap) {\n let game = gameSnap.val();\n\n return snapToArray(gameSnap.child('rounds'))\n .filter((round) => round[game.player1] && round[game.player2]);\n}", "title": "" }, { "docid": "362da9e59b281510ea77d832d581052b", "score": "0.52632546", "text": "function checkMatch(){\n var openCards=document.getElementsByClassName('open show');\n //Starting the timer if this is the first card opened\n if(movesCounter==0 && openCards.length==1){\n Timer=setInterval(TimeManager, 1000);\n }\n //2 cards are required to check for a match, so the length is checked\n if(openCards.length==2){\n toggleOverlay();\n updateMove();\n if(openCards[0].children[0].className==openCards[1].children[0].className){\n //If cards match, they are marked as match\n for(var i=openCards.length-1; i>=0; i--){\n openCards[i].classList.add(\"match\");\n openCards[i].classList.remove(\"open\",\"show\");\n }\n toggleOverlay();\n }\n else{\n //if cards don't match, 500 millisecond delay is provided for the user to see the card and then they are close\n setTimeout(function() {\n for(var i=openCards.length-1; i>=0; i--){\n openCards[i].classList.remove(\"open\",\"show\");\n }\n toggleOverlay();\n }, 500);\n }\n }\n}", "title": "" }, { "docid": "f3c480a4cb77c89268440fa8286e7af5", "score": "0.5256575", "text": "async function getPastMatchesToAddResult(){\n \n \n const pastMatchesWithoutResult = await GetPastMatchesWithoutResult();\n\n const resultResponse = {\n pastMatchesWithoutResult : pastMatchesWithoutResult\n }\n\n return resultResponse;\n \n}", "title": "" }, { "docid": "6850c49fd1eeefef89bf9cd6ca8af450", "score": "0.5253585", "text": "function checkForWin() {\n\tmatchesFound += 1;\n\tif(matchesFound == 8) {\n \ttimer.pause();\n \tdisplayRatingInModal();\n \tvar gameTime = timer.getTimeValues().toString();\n \t$('#gameTime').html(gameTime);\n \tshowResultModal();\n\t}\n}", "title": "" }, { "docid": "d9ed65f646ec9b52e5eaccba1f85e56e", "score": "0.52410424", "text": "get matchCount() {\r\n return this._results.length;\r\n }", "title": "" }, { "docid": "6dd48422eb3b6467e3d225c449456f46", "score": "0.5218842", "text": "function checkForMatch(){\n\tincrementMove();\n\tif ((openCards[0])[0].firstChild.className === (openCards[1])[0].firstChild.className){\n\t\tmatchedCount ++;\n\t\topenCards.forEach((card)=>{\n\t\t\t\tcard.animateCss('tada', function(){\n\t\t\t\tcard.toggleClass(\"open show match\");\n\t\t\t});\n\t\t});\n\t} else {\n\t\topenCards.forEach((card)=>{\n\t\t\tcard.animateCss('shake', function(){\n\t\t\t\tcard.toggleClass(\"open show\");\n\t\t\t});\n\t\t});\n\t}\n\tresetOpenCards();\n\tif (matchedCount === 8){\n\t\tendTheGame();\n\t}\n}", "title": "" }, { "docid": "f5dae3fe79b63ad449e8f73372a8704e", "score": "0.5218589", "text": "async triggerMatch(){\n const teams = this.teams;\n\n let fetchTeamsPromises = [];\n teams.forEach((teamId) => {\n let team = new Team(teamId, this.tournamentId);\n fetchTeamsPromises.push(team.fetchTeamDetails());\n });\n\n // 1. Get individual Team info.\n let teamsInfo = await Promise.all(fetchTeamsPromises);\n console.log(\"RS\", teamsInfo);\n\n // 2. get winning Match Score \n let payload = { tournamentId: this.tournamentId , round: this.round, match: this.match};\n let matchScore = await this.getMatchScore(payload);\n\n\n // 3. Get the Winning Score\n let teamScores = teamsInfo.map( (team) => {\n return team.score;\n });\n\n let winnerPayload = {tournamentId: this.tournamentId, teamScores: teamScores, matchScore: matchScore};\n let winningScore = await this.getWinnerScore(winnerPayload);\n\n //4. Find the teams which has the Winning Score\n let winnerTeams = teamsInfo.filter((team) => {\n return ( winningScore === team.score );\n });\n\n //5. If WinnerTeams more than one , with lowest teamId wins.\n if(winnerTeams.length>1){\n winnerTeams.sort((a,b) => a.teamId-b.teamId);\n }\n\n //6. Set the progress of the match in the DOM.\n this.setIndicatorLoading(this.round, this.match);\n return winnerTeams[0];\n }", "title": "" }, { "docid": "06f19503d55e97c02c50372e0d65857c", "score": "0.52172154", "text": "function matchedcard(){\n for(const ocard of opencards ){\n ocard.classList.remove('open','show');\n ocard.classList.add('match');}\n setTimeout(function(){\n isfinished();},100);\n opencards.pop();\n opencards.pop();}", "title": "" }, { "docid": "c31a205f3722a39c9c3c2cab3c5e404d", "score": "0.52145463", "text": "function checkMatch() {\n if (flippedCards[0].firstElementChild.className == flippedCards[1].firstElementChild.className) {\n setTimeout(match, 500);\n }\n else {\n setTimeout(unmatch, 1000);\n }\n}", "title": "" }, { "docid": "61c994ff8b193a5365833dccbce3a554", "score": "0.5210615", "text": "function cardsMatch () {\n if(\n cardList[0].firstElementChild.className ===\n cardList[1].firstElementChild.className\n ) {\n cardList[0].classList.toggle('match');\n cardList[1].classList.toggle('match');\n cardList = [];\n console.log(\"match\");\n matches = matches +1;\n checkMatches();\n setStats();\n } else {\n setTimeout(function() {\n flipCard(cardList[0]);\n flipCard(cardList[1]);\n cardList = [];\n }, 1000);\n }\n}", "title": "" }, { "docid": "8954c48f52c0a909dc732a580685d818", "score": "0.520594", "text": "function checkMatch() {\n if (flippedCards[0].firstElementChild.className === flippedCards[1].firstElementChild.className) {\n flippedCards[0].classList.toggle('match');\n flippedCards[1].classList.toggle('match');\n flippedCards = [];\n matchedPairs++;\n } else {\n setTimeout(() => {\n flipCard(flippedCards[0]);\n flipCard(flippedCards[1]);\n flippedCards = [];\n }, 1000);\n }\n}", "title": "" }, { "docid": "ff6a51b5a25acd13f29b8858a89c766f", "score": "0.52010125", "text": "checkAll () {\n let match = false\n let player\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.gameState[b][r][c] !== \" \") {\n match = match || this.isWinningMove(b, r, c, this.gameState[b][r][c])\n if (match) {\n player = this.gameState[b][r][c]\n break\n }\n }\n }\n }\n }\n\n\n return player\n\n\n // if (match) {\n // playerNum.style.color = this.board.playerColours[player]\n // winsDisplay.style.display = \"inline-block\"\n // } else {\n // this.playerIndex = ++this.playerIndex % this.players.length\n // winsDisplay.style.display = \"none\"\n // playerNum.style.color = this.board.playerColours[this.playerIndex]\n // }\n }", "title": "" }, { "docid": "6bae1b956687eff96d5be41d31cb3660", "score": "0.51980615", "text": "getUpcomingMatches() {\n return fetch(`${config.API_ENDPOINT}/matches/upcoming`, {\n method: 'GET'\n })\n .then(res =>\n (!res.ok)\n ? res.json().then(e => Promise.reject(e))\n : res.json()\n )\n .catch(error => error)\n }", "title": "" }, { "docid": "00198b61fd0b4a7f743f317cd32d8b6d", "score": "0.51976025", "text": "function matchCards() {\n if (openCards.length === 2) {\n setTimeout(function() {\n\n let openOne = openCards[0].children[0].className;\n let openTwo = openCards[1].children[0].className;\n\n openCards.forEach(function(card) {\n\n if (openOne === openTwo) {\n card.classList.remove('open');\n card.classList.add('match');\n matchedCards.push(card);\n\n wonGame();\n } else {\n card.classList.remove('open', 'show');\n }\n });\n\n openCards = [];\n }, 1000);\n }\n}", "title": "" }, { "docid": "29d378caa7e692436d97466de4dd9d57", "score": "0.5197029", "text": "isFull() {\n return (this.numPlayersPresent() >= MaxPlayersPerTeam*2);\n }", "title": "" }, { "docid": "e6b73c2fe026f0f751553f92849439da", "score": "0.51807296", "text": "function match(array) {\n setTimeout(function() {\n let first = array[0] , second = array[1];\n //debugging console.log(first.firstElementChild.classList[1] == second.firstElementChild.classList[1]);\n if(first.firstElementChild.classList[1] == second.firstElementChild.classList[1]){\n first.classList.add(\"match\");\n second.classList.add(\"match\");\n console.log(\"Match! Waow :)\");\n }else{\n first.classList.remove(\"show\",\"open\");\n second.classList.remove(\"show\",\"open\");\n }\n // call end game after each match to check if all cards are matched\n end_game();\n array.pop();\n array.pop();\n}, 700);\n}", "title": "" }, { "docid": "81bcc017c73b078a74a4b82817ccb1a3", "score": "0.5176121", "text": "function Get_list_of_matches_by_team(name){\n let team_type = t=>t.home_team == name || t.away_team == name;\n // The filter() method creates a new array with all elements \n // that pass the test implemented by the provided function.\n // callbackFn\n let playedGamesByTeam = playedGamesData[0].filter(team_type);\n let upcomingGamesByTeam = upcomingGamesData[0].filter(team_type);\n // The concat() method is used to merge two or more arrays. \n // This method does not change the existing arrays, but instead returns a new array\n let matchByTeam = playedGamesByTeam.concat(upcomingGamesByTeam);\n return matchByTeam;\n}", "title": "" }, { "docid": "3dda912b99acd449a87e6a6ac5c0b693", "score": "0.51625025", "text": "function getToday(data) {\n console.log('Gathering new FIFA match data.');\n\n var $ = cheerio.load(data);\n var teamAway, teamHome, date, time, scoreAway, scoreHome, arena, group, flagAway, flagHome;\n var matches = [];\n var id = 1;\n\n $(\".match-list\").find(\".match-list-date.anchor\").find(\".col-xs-12.clear-grid\").find(\".mu.result\").each(function() {\n var data = $(this);\n teamAway = data.children(\".mu-m-link\").children(\".mu-m\").children(\".t.away\").children(\".t-n\").children(\".t-nText\").text();\n teamHome = data.children(\".mu-m-link\").children(\".mu-m\").children(\".t.home\").children(\".t-n\").children(\".t-nText\").text();\n date = data.children(\".mu-m-link\").children(\".mu-i\").children(\".mu-i-date\").text();\n var tempTime = data.children(\".mu-m-link\").children(\".mu-i\").children(\".mu-i-datetime\").text();\n var timeSplit = tempTime.split(\"-\");\n time = timeSplit[1].replace(/^\\s+|\\s+$/g, \"\");\n var tempScore = data.children(\".mu-m-link\").children(\".mu-m\").children(\".s\").children().children().children().text();\n var scoreSplit = tempScore.split(\"-\");\n scoreAway = scoreSplit[1];\n scoreHome = scoreSplit[0];\n arena = data.children(\".mu-m-link\").children(\".mu-i\").children(\".mu-i-location\").children(\".mu-i-stadium\").text();\n group = data.children(\".mu-m-link\").children(\".mu-i\").children(\".mu-i-group\").text();\n flagAway = \"images/flags/\".concat(teamAway, \".png\");\n flagHome = \"images/flags/\".concat(teamHome, \".png\")\n var match = new Match(id, teamAway, teamHome, flagAway, flagHome, date, scoreAway, scoreHome, arena, group, time);\n matches.push(match);\n\n console.log(\"Match \".concat(teamAway, \" vs. \", teamHome, \" retrieved.\"));\n id++;\n });\n matches.reverse();\n\n console.log(\"Data gathering was successful.\");\n return matches;\n }", "title": "" }, { "docid": "8133a7bb64b75f548d21a70faf696aa2", "score": "0.5162237", "text": "function matchHandler(){\n\n // match\n if(selectedCards[0].cardColor == selectedCards[1].cardColor){\n\n getCardByID(selectedCards[0].cardID).matched = true;\n getCardByID(selectedCards[1].cardID).matched = true;\n selectedCards = [];\n\n }\n // not a match\n else{\n\n setTimeout(function(){\n flipCard(selectedCards[0].cardID);\n flipCard(selectedCards[1].cardID);\n selectedCards = [];\n }, 1000); \n\n }\n\n // check if user won\n return checkForWin();\n\n}", "title": "" }, { "docid": "8b23e744e51f082ced542a118676885a", "score": "0.515836", "text": "function checkForMatch(){\n var timeoutID2 = window.setTimeout(checkForWinner, 100);\n if($(\".active\").attr(\"src\") === $(\".active2\").attr(\"src\")){\n $(\".active\").parent().css(\"visibility\", \"hidden\");\n $(\".active2\").parent().css(\"visibility\", \"hidden\");\n hideDivsWithMatch();\n click = 0;\n pairs++;\n }\n else{\n hideDivsWithMatch();\n click = 0;\n }\n }", "title": "" }, { "docid": "4d27397152778343eef9b05dd5ca3284", "score": "0.5157837", "text": "function getScore() {\n if (matched.length === 16) {\n stopTimer();\n setStats();\n setTimeout(function() {\n scoreModal.style.display = 'block';\n }, 1000);\n }\n\n}", "title": "" }, { "docid": "ae9fa3cffe1f0477a24d4d655346a263", "score": "0.51497716", "text": "matchPlayers() {\n let matchedPlayers = new Set()\n\n for (let player of this.players.values()) {\n if (matchedPlayers.has(player)) {\n // We already matched this player with someone else; skip them\n continue\n }\n\n // Before searching, remove the player searching from the tree so they're not included in\n // results\n this.tree.remove(player.interval.low, player.interval.high, player)\n const results = this.tree.search(player.interval.low, player.interval.high)\n\n if (!results || results.length === 0) {\n // No matches for this player; increase their search interval and re-add them to the tree\n\n // TODO(2Pac): Replace this with the logic of our ranking system\n const newLow = player.interval.low - 10 > 0 ? player.interval.low - 10 : 0\n const newHigh = player.interval.high + 10\n const newInterval = new Interval({ low: newLow, high: newHigh })\n player = player.set('interval', newInterval)\n\n this.tree.insert(player.interval.low, player.interval.high, player)\n this.players = this.players.set(player.name, player)\n } else {\n const opponent = this.opponentChooser(player, results)\n\n // Remove the matched player from the tree\n this.tree.remove(opponent.interval.low, opponent.interval.high, opponent)\n\n // Remove the matched players from the queue we use for iteration\n this.players = this.players.delete(player.name)\n this.players = this.players.delete(opponent.name)\n\n // Since our iteration method returns the whole queue at once, the opponent will still be\n // iterated over, even though we removed them from the queue; To stop that from happening,\n // mark the opponent as 'matched' so it can be skipped later on in the iteration\n matchedPlayers = matchedPlayers.add(opponent)\n\n this.onMatchFound(player, opponent)\n }\n }\n }", "title": "" }, { "docid": "ef9bf9b01bfe3e7784ec70b127682fa8", "score": "0.51460224", "text": "function findMatches() {\n if (guesses < 25) {\n if ((cardOne[0].id === cardTwo[0].id) && (cardOne[0] !== cardTwo[0])) {\n matches.push(cardOne[0].id);\n } else null;\n } else if (guesses > 25) {\n loserBoard()\n alert(\"You lose! Reload the page to play again.\")\n\n }\n}", "title": "" }, { "docid": "4751e1690e4e96a878797074b3b93003", "score": "0.5140243", "text": "function getTomorrow(data) {\n // Scraping future games, i.e., > today\n console.log('Gathering future FIFA match data.');\n\n var $ = cheerio.load(data);\n var teamAway, teamHome, date, arena, group, flagAway, flagHome;\n var matches = [];\n var id = 0;\n\n $(\".match-list\").find(\".match-list-date.anchor\").find(\".col-xs-12.clear-grid\").find(\".mu.fixture\").each(function() {\n var data = $(this);\n if (data.children('.mu-m-link').length === 0) {\n teamAway = data.children(\".mu-m\").children(\".t.away\").children(\".t-n\").children(\".t-nText\").text();\n teamHome = data.children(\".mu-m\").children(\".t.home\").children(\".t-n\").children(\".t-nText\").text();\n date = data.children(\".mu-i\").children(\".mu-i-datetime\").text();\n arena = data.children(\".mu-i\").children(\".mu-i-location\").children(\".mu-i-stadium\").text();\n group = data.children(\".mu-i\").children(\".mu-i-group\").text();\n } else {\n teamAway = data.children('.mu-m-link').children(\".mu-m\").children(\".t.away\").children(\".t-n\").children(\".t-nText\").text();\n teamHome = data.children('.mu-m-link').children(\".mu-m\").children(\".t.home\").children(\".t-n\").children(\".t-nText\").text();\n date = data.children('.mu-m-link').children(\".mu-i\").children(\".mu-i-datetime\").text();\n arena = data.children('.mu-m-link').children(\".mu-i\").children(\".mu-i-location\").children(\".mu-i-stadium\").text();\n group = data.children('.mu-m-link').children(\".mu-i\").children(\".mu-i-group\").text();\n }\n\n flagAway = \"images/flags/\".concat(teamAway, \".png\");\n if (flagAway.search(\"\\\\[\") != -1) {\n flagAway.replace(/\\[.*?\\]/g, '');\n flagAway = \"images/flags/\".concat(\"blank\", \".png\")\n }\n flagHome = \"images/flags/\".concat(teamHome, \".png\")\n if (flagHome.search(\"\\\\[\") != -1) {\n flagHome.replace(/\\[.*?\\]/g, '');\n flagHome = \"images/flags/\".concat(\"blank\", \".png\")\n }\n\n var match = new TomorrowMatch(id, teamAway, teamHome, flagAway, flagHome, date, arena, group);\n matches.push(match);\n\n console.log(\"Match \".concat(teamAway, \" vs. \", teamHome, \" retrieved.\"));\n id--;\n });\n matches.reverse();\n\n console.log(\"Data gathering was successful.\");\n return matches;\n }", "title": "" }, { "docid": "f7b829c854424ec4e017ecdb60a5794f", "score": "0.5138393", "text": "function matchTrue() {\n\tmatchingTestArr[0].classList.add('match');\n\tmatchingTestArr[1].classList.add('match');\n\tmatchingTestArr[0].classList.remove('open', 'show', 'disabled');\n\tmatchingTestArr[1].classList.remove('open', 'show', 'disabled');\n\tmatchedArr.push(matchingTestArr[0])\n\tmatchedArr.push(matchingTestArr[1])\n\tmatchingTestArr.splice(0);\n\tenableAllCards();\n\t//Once all cards are matched, run the function to show modal\n\tif (matchedArr.length === 16) {\n\t\tshowModal();\n\t}\n}", "title": "" }, { "docid": "9644e455f8203b60c61c17c36f10ccd8", "score": "0.513712", "text": "function checkForMatch(){\n if(cardsInPlay[0] === cardsInPlay[1]){\n cardsInPlay = [];\n return;\n }\n if(cardsInPlay[0].getAttribute(\"alt\") === cardsInPlay[1].getAttribute(\"alt\")){\n console.log(\"Matched \" + cardsInPlay[0].getAttribute(\"alt\") + \" and \" + cardsInPlay[0].getAttribute(\"alt\"));\n doneCards.push(cardsInPlay[0]);\n doneCards.push(cardsInPlay[1]);\n cardsInPlay = [];\n } else{\n setTimeout(function(){\n flipCard(findCard(cards, cardsInPlay[0]));\n flipCard(findCard(cards, cardsInPlay[1]));\n cardsInPlay = [];\n }, 500);\n }\n}", "title": "" }, { "docid": "7c3da5faf1b5cc721744944543f83bd4", "score": "0.51310736", "text": "function matcher() {\n matchArr = [] \n for(i = 0; i < playerArr.length; i++) {\n playerArr[i] === buttonArr[i] ? matchArr.push(true) : matchArr.push(false)\n }\n console.log('matchArr: ',matchArr)\n return matchArr.every(m => m === true)\n}", "title": "" }, { "docid": "0521f26ab41d643e477e20e6713a372b", "score": "0.51308835", "text": "function getScheduledMatches(parent, date) {\n // create container for the scheduled matches dates in array\n const scheduled = [];\n\n //search and assign all scheduled matches from favourites\n let allScheduledMatches = parent.querySelectorAll('.event__match--scheduled');\n //store each of the scheduled matches in an array\n allScheduledMatches.forEach(item => {\n try {\n //search and assign all information of matches into an object\n let homeTeam = item.querySelector('.event__participant--home').innerText;\n let awayTeam = item.querySelector('.event__participant--away').innerText;\n let time = item.querySelector('.event__time').innerText;\n //insert each object into container\n scheduled.push({\n homeTeam, awayTeam, time, date,\n });\n }\n catch (err) {\n return err;\n }\n });\n //return the container\n return scheduled;\n}", "title": "" }, { "docid": "aea0276218e723280fa1ca2ed0fdd41f", "score": "0.51224476", "text": "function testMatch() {\n if (open[0].children().attr(\"class\") === open[1].children().attr(\"class\")) {\n $(\"li\").off();\n positive = setTimeout(positiveMatch, 500);\n } else {\n $(\"li\").off();\n negative = setTimeout(negativeMatch, 500);\n }\n}", "title": "" }, { "docid": "c7ae0b686a545b213f1e17b50321f16c", "score": "0.51123166", "text": "getMatches() {\n return fetch(`${config.API_ENDPOINT}/matches`, {\n method: 'GET'\n })\n .then(res =>\n (!res.ok)\n ? res.json().then(e => Promise.reject(e))\n : res.json()\n )\n .catch(error => error)\n }", "title": "" }, { "docid": "00b9b41e6f3bcebaa296a9cbba91a7bc", "score": "0.5109941", "text": "function matchedCards() {\n firstCard.addClass('match');\n secondCard.addClass('match');\n firstCard=undefined;\n secondCard=undefined;\n $('.moves').text(moves);\n matches++;\n (matches===8) ? setTimeout(displayWinDialog(), 500):'';\n //(matches===8) ? setTimeout(function(){confirm('YOU WON. You took ' + elapsedTime +' seconds and you got ' + stars + ' stars over ' + moves + ' moves!')}, 500):'';\n}", "title": "" }, { "docid": "e1791bbac16afab85d989db602061874", "score": "0.51018417", "text": "get matchCount() {\n return this._results.length;\n }", "title": "" }, { "docid": "e9b6f2d067ed5f6418b7a1dc20b31a5e", "score": "0.5100588", "text": "function generateMatchResults(starttime, endtime) {\r\n\tdb.run(\"BEGIN TRANSACTION\");\r\n\tdb.each(\"SELECT * FROM champ_info\", function (err, champ_info) {\r\n\t\tif(!err) {\r\n\t\t\tdb.run(\"SELECT * FROM champions WHERE champion_id=$champion_id\", {$champion_id: champ_info.champion_id}, function (err, champion) {\r\n\t\t\t\tdb.run(\"SELECT * FROM team_data WHERE team_id=$team_id\", {$team_id: champion.team_id}, function (err, team_data) {\r\n\t\t\t\t\tdb.run(\"UPDATE team_data SET team_kills=$team_kills, team_assists=$team_assists, team_deaths=$team_deaths, team_wins=$team_wins, team_gold=$team_gold, team_cs=$team_cs\", {\r\n\t\t\t\t\t\t$team_kills: team_data.team_kills + champ_info.kills,\r\n\t\t\t\t\t\t$team_assists: team_data.team_assists + champ_info.assists,\r\n\t\t\t\t\t\t$team_deaths: team_data.team_deaths + champ_info.deaths,\r\n\t\t\t\t\t\t$team_wins: team_data.team_wins + champ_info.win,\r\n\t\t\t\t\t\t$team_gold: team_data.team_gold + champ_info.gold,\r\n\t\t\t\t\t\t$team_cs: team_data.team_cs + champ_info.cs\r\n\t\t\t\t\t}, function (err, response) {\r\n\t\t\t\t\t\tif(err) {\r\n\t\t\t\t\t\t\tconsole.log(err);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})\r\n\t\t\t\t})\r\n\t\t\t})\r\n\t\t}\r\n\t});\r\n\tdb.run(\"END\");\r\n}", "title": "" }, { "docid": "f65be645d31211231d6335aaba1690c1", "score": "0.50993335", "text": "function checkMatch(matches) {\n if (matches.length == 0) {\n return document.getElementById(\"error\").innerHTML = (`Your search did not return any result.`)\n }\n recordMatch(matches)\n}", "title": "" }, { "docid": "42aa0ea1386f1aad1c489a76f768eee3", "score": "0.50968295", "text": "function isComplete() {\n if (randomNumber === value) {\n challengeCompleted();\n };\n }", "title": "" }, { "docid": "d9e25738308584163842a7ad53f5f2e5", "score": "0.5084025", "text": "function checkForMatch() {\n if (flippedCards[0].firstElementChild.className === flippedCards[1].firstElementChild.className) {\n flippedCards[0].classList.toggle('match');\n flippedCards[1].classList.toggle('match');\n flippedCards = [];\n matched++;\n if (matched === TOTAL_PAIRS) {\n gameOver();\n }\n }\n else {\n setTimeout(() => {\n toggleCard(flippedCards[0]);\n toggleCard(flippedCards[1]);\n flippedCards = [];\n }, 1000);\n }\n}", "title": "" }, { "docid": "24f5e848550a5cb6f2f69fc9719bedb3", "score": "0.507995", "text": "async function getAvailableReferees(game_time){\n let refs = await DButils.execQuery(`SELECT DISTINCT Name FROM Referees FULL OUTER JOIN (SELECT Referee, GameDateTime FROM Games\n WHERE Games.GameDateTime = '${game_time}') AS Unavailable\n ON Referees.Name = Unavailable.Referee WHERE \n Unavailable.Referee is NULL`);\n return refs\n}", "title": "" }, { "docid": "78aa236028b34b4ee7536982eb079e29", "score": "0.50789225", "text": "function checkMatch(cards) {\n if (openCards[0].innerHTML === openCards[1].innerHTML) {\n // console.log(openCards);\n // console.log(\"its a MATCH\");\n openCards[0].classList.add(\"match\");\n openCards[1].classList.add(\"match\");\n countMoves(); // two card opened is one move\n matchedCards += 1; // increment pairs matched by 1 for every match\n if (matchedCards === 8) {\n setTimeout(function() {\n let msg = `You took ${tminutes} min ${seconds} sec and ${movesCounter.innerText} Moves to COMPLETE!`\n let stars = ulStars.innerHTML;\n displayModal(msg, stars);\n }, 1000);\n startTimer('stop');\n }\n openCards = [];\n } else {\n openCards[0].classList.add(\"show\", \"open\", \"noMatch\"); // if NO MATCH , Hide the open cards\n openCards[1].classList.add(\"show\", \"open\", \"noMatch\"); // \n // console.log(\"its not a match!\");\n setTimeout(hideOpenCards, 500);\n countMoves();\n }\n}", "title": "" }, { "docid": "509f805d268c25afab5c3596919285e8", "score": "0.5078246", "text": "function handleUpcomingMatch() {\n var today = new Date();\n var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+ (\"0\" + today.getDate()).slice(-2)+'T'+today.getHours()+\":\"+today.getMinutes();\n handleUpcoming(date);\n}", "title": "" }, { "docid": "66ffebdbc822b4e286dbf5b7b06e5384", "score": "0.5077727", "text": "function incrementMatch () {\n allMatches += 1;\n}", "title": "" }, { "docid": "a8cdbe33693c2c09caf66509f86f6c5d", "score": "0.5066841", "text": "function onAnotherMatchRequested(data) {\n // Find player in array\n var requestingPlayer = playerById(this.id);\n\n // Player not found\n if (!requestingPlayer) {\n //util.log(\"Player not found: \"+this.id);\n return;\n };\n\n // searching for a pending player\n var id = _.sample(pendings);\n if (!id) {\n // we didn't find a player\n console.log(\"added \" + this.id + \" to pending\");\n pendings.push(requestingPlayer.id);\n // sending a pending event to player\n requestingPlayer.getSocket().emit(\"pending\", {status: \"pending\", message: \"waiting for a new player.\"});\n } else {\n // creating match\n pendings = _.without(pendings, id);\n matches[id] = requestingPlayer.id;\n matches[requestingPlayer.id] = id;\n\n // generating world for this match\n var numObstacles = _.random(10, 30);\n var height = _.random(70, 100);\n var MAX_X = 490\n var MINUS_MAX_X = -490\n var MAX_Z = 990\n var MINUS_MAX_Z = -990\n var positions = [];\n for (var i=0; i<numObstacles; i++) {\n positions.push({\n x: _.random(MINUS_MAX_X, MAX_X),\n z: _.random(MINUS_MAX_Z, MAX_Z) \n });\n }\n // choosing two points for players\n var p1 = {\n x: _.random(MINUS_MAX_X, MAX_X),\n z: _.random(MINUS_MAX_Z, MAX_Z) \n };\n\n var p2 = {\n x: _.random(MINUS_MAX_X, MAX_X),\n z: _.random(MINUS_MAX_Z, MAX_Z) \n };\n // check if positions are right\n while ((_.where(positions, p1) != 0) && (_.where(positions, p2) != 0) && !_.isEqual(p1, p2)) {\n p1 = {\n x: _.random(MINUS_MAX_X, MAX_X),\n z: _.random(MINUS_MAX_Z, MAX_Z) \n };\n\n p2 = {\n x: _.random(MINUS_MAX_X, MAX_X),\n z: _.random(MINUS_MAX_Z, MAX_Z) \n };\n }\n // sending both player info that they're connected\n requestingPlayer.getSocket().emit(\"matchstarted\", {status: \"matchstarted\", message: \"Player found!\", numObstacles: numObstacles, height: height, positions: positions, mypos: p1, otherpos: p2});\n playerById(id).getSocket().emit(\"matchstarted\", {status: \"matchstarted\", message: \"Player found!\", numObstacles: numObstacles, height: height, positions: positions, mypos: p2, otherpos: p1});\n }\n}", "title": "" }, { "docid": "4877e7efc2a2fac89d8f60b31bc450b3", "score": "0.50608665", "text": "function checkWin(){\n 'use strict';\n\n if($('.match').length === CardArray.length) {\n // endTime = Date.now();\n endTime = moment();\n clearInterval(IntervalId);\n\n let costTime = Math.floor(moment.duration(endTime-StartTime).asSeconds());\n\n $('#rst-cost-time').text(\"Cost \" + costTime + \" seconds!\");\n\n // get start\n if (costTime < 31 || clickCount <= 32){\n StartCount = 3;\n }\n refreshStarts();\n\n $('#rst-score').text(`You get ${StartCount} start${StartCount>1?'s':''}!`);\n $('#final-rst').css('display', 'inherit');\n }\n}", "title": "" }, { "docid": "67f330430b8d18bcfce50db74429c94a", "score": "0.505599", "text": "function checkMatch(){\n\n \tif(flippedCards[0].children('i').attr('class')==flippedCards[1].children('i').attr('class')){\n \t\t match++;\n \t\t\tflippedCards[0].removeClass('open show animated flipInY tada');\n \t\t\tflippedCards[1].removeClass('open show animated flipInY tada');\n \t\t\tflippedCards[0].addClass('match animated pulse');\n \t\t\tflippedCards[1].addClass('match animated pulse');\n \t\t\tdisableClickEvent();\n \t\t\tflippedCards = [];\n \t\t\tcheckWinner();\n \t\t}\n \telse\n \t\t{\n \t\t\tflippedCards[0].removeClass('open show animated flipInY');\n \t\t\tflippedCards[1].removeClass('open show animated flipInY');\n \t\t\tflippedCards[0].addClass('animated tada');\n \t\t\tflippedCards[1].addClass('animated tada');\n \t\t\tenableClickEvent();\n \t\t\tflippedCards = [];\n \t\t}\n\n }", "title": "" }, { "docid": "c23b8d054199937f31f6e80bd5517a9c", "score": "0.5054964", "text": "function matched() {\n\n openedCards[0].classList.add('match');\n openedCards[1].classList.add('match');\n openedCards = [];\n\n const remainingUnOpenedCards = document.querySelectorAll(\".card:not(.match)\");\n if (remainingUnOpenedCards.length == 0) {\n\n openDialog();\n }\n}", "title": "" }, { "docid": "72a4263b5ab8c1712fb7d1ed01cd6f74", "score": "0.5052195", "text": "async function getMatchForAddReferee(matchID){\n \n var futureMatch = await matches_utils.getFutureMatchByID(matchID);\n var pastMatch = await matches_utils.getPastMatchByID(matchID);\n\n return { futureMatch : futureMatch, pastMatch : pastMatch };\n\n}", "title": "" }, { "docid": "e151e469b73cc1fe0f9e45d4e9c4bed9", "score": "0.5050299", "text": "async function searchMatch(mMUser) {\n let isDuplicate;\n try {\n isDuplicate = await MatchMakingUser.find({\n summonerName: mMUser.summonerName,\n practiceChampionSelected: mMUser.practiceChampionSelected\n });\n } catch (err) {\n return MS.Duplicate;\n }\n\n if (isDuplicate.length === 0) {\n return MatchMakingUser.find({\n opponentChampions: mMUser.practiceChampionSelected\n })\n .then(res => {\n let MatchedChampions = [];\n if (res.length === 0) {\n mMUser.save();\n return MS.AddedToQueue;\n } else {\n for (let i = 0; i < mMUser.opponentChampions.length; i++) {\n for (let j = 0; j < res.length; j++) {\n if (\n mMUser.opponentChampions[i] === res[j].practiceChampionSelected\n ) {\n MatchedChampions.push(res[j]);\n }\n }\n }\n return MatchedChampions;\n }\n })\n .then(res => {\n if (res === MS.AddedToQueue) {\n return MS.AddedToQueue;\n } else {\n let MatchedPlayers = [];\n for (let i = 0; i < res.length; i++) {\n let rankDifference;\n if (mMUser.rank > res[i].rank) {\n rankDifference = mMUser.rank - res[i].rank;\n } else {\n rankDifference = res[i].rank - mMUser.rank;\n }\n\n if (rankDifference <= 15) {\n if (res[i].selectedLane === mMUser.selectedLane) {\n const info = {\n summonerName: res[i].summonerName,\n opponentChampions: res[i].opponentChampions,\n userChampion: res[i].practiceChampionSelected,\n selectedLane: res[i].selectedLane,\n rankedStats: `https://app.blitz.gg/lol/profile/${\n res[i].region\n }1/${res[i].summonerName}`,\n rank: res[i].rank,\n practiceChampionSelected: res[i].practiceChampionSelected\n };\n MatchedPlayers.push(info);\n }\n }\n }\n return MatchedPlayers;\n }\n })\n .catch(err => {\n console.log(`err: `);\n console.log(err);\n });\n } else {\n return MS.Duplicate;\n }\n}", "title": "" }, { "docid": "f30ed62702baf702e78364aaebcbb898", "score": "0.5049969", "text": "checkMatch(){\n\n // get tile below player tile\n let tileBelow = this.physics.overlapRect(this.player.x + this.tileSize / 2, this.player.y + this.tileSize * 1.5, 1, 1);\n\n // \"tileBelow\" is an array so we have to compare the first - and only - item frame with player frame. Are the two frames the same?\n if(tileBelow[0].gameObject.frame.name == this.player.frame.name){\n\n // we have a match\n this.matched = true;\n\n // check the whole row below player tile\n let rowBelow = this.physics.overlapRect(0, this.player.y + this.tileSize * 1.5, this.game.config.width, 1);\n\n this.score = this.score + this.gameOptions.columns;\n this.scoreText.setText('Score: ' + this.score);\n\n // tween down the player\n this.tweens.add({\n targets: [this.player],\n y: tileBelow[0].gameObject.y,\n duration: 300,\n callbackScope: this,\n onUpdate: function(tween, target){\n\n // at each update, we have to adjust player position because tiles continue moving up\n this.player.y = Math.min(this.player.y, tileBelow[0].gameObject.y)\n },\n\n // at the end of the tween, we have to move the row at the bottom, to reuse sprites\n onComplete: function(){\n\n // the good old array with all integers from zero to gameOptions.columns - 1\n let values = this.getRandomLane();\n\n // place all tiles below the lowest row\n for(let i = 0; i < this.gameOptions.columns; i++){\n let frameName = this.isLater ? values[i].id + 5 : values[i].id;\n rowBelow[i].gameObject.setFrame(frameName);\n rowBelow[i].gameObject.y += this.tileSize * this.gameOptions.rows;\n }\n\n // check for matches again, there could be a combo\n this.checkMatch();\n }\n });\n }\n\n // what to do when player moved but there isn't any match?\n else{\n\n // we can move again\n this.canMove = true;\n\n // is there a previous match? Did we come here from a previous match?\n if(this.matched){\n\n // no more matches\n this.matched = false;\n\n // get the tile below the player\n let tileBelow = this.physics.overlapRect(this.player.x + this.tileSize / 2, this.player.y + this.tileSize * 1.5, 1, 1);\n\n // the good old array with all integers from zero to gameOptions.columns - 1\n let values = this.isLater ? Phaser.Utils.Array.NumberArray(5, (this.gameOptions.columns - 1) + 5) : Phaser.Utils.Array.NumberArray(0, this.gameOptions.columns - 1);\n \n let tileBelowName = this.isLater ? tileBelow[0].gameObject.frame.name - 5 : tileBelow[0].gameObject.frame.name;\n // remove the item at \"frame\" value of tile below the player pbecause we don't want it to be randomly selected\n values.splice(tileBelowName, 1);\n\n \n\n // change player frame\n this.player.setFrame(Phaser.Utils.Array.GetRandom(values));\n }\n }\n }", "title": "" }, { "docid": "f30469d71b81f86c1e74748d1a7c70e5", "score": "0.5046741", "text": "function matched() {\n openedCards[0].classList.add(\"matched\", \"disabled\");\n openedCards[1].classList.add(\"matched\", \"disabled\");\n disabled(); // keeps rest of cards disabled still.\n setTimeout(function () {\n // the two opened and matched cards are pushed into the matched cards array\n matchedCards.push(openedCards[0], openedCards[1]);\n openedCards[0].classList.remove(\"show\", \"open\");\n openedCards[1].classList.remove(\"show\", \"open\");\n openedCards[0].classList.add(\"removed\");\n openedCards[1].classList.add(\"removed\");\n openedCards = [];\n enable(); // reenables cards for further gameplay\n endGame();\n }, 1500);\n}", "title": "" }, { "docid": "c2ee76c92f6251874efe0734196a8b68", "score": "0.50441194", "text": "get calls() {\n return this.matches;\n }", "title": "" }, { "docid": "89f57579aed9fe9ec21c7eb2d804ca29", "score": "0.50425273", "text": "function checkMatched() {\n let matchedNum = $('.match').length;\n\n if(matchedNum === $('.deck li').length){\n timer.stop();\n $(\".container\").hide();\n $(\".win-container\").show();\n } else{\n $(\".container\").show();\n $(\".win-container\").hide();\n }\n}", "title": "" }, { "docid": "6c203bd8944f70bcaafeaa670daff543", "score": "0.50402737", "text": "findMatches(){\n this.detecterMatch3Colonnes();\n this.detecterMatch3Lignes();\n }", "title": "" }, { "docid": "a120d90c854e517f79d3a3cd9b25df46", "score": "0.50402397", "text": "function checkForMatch(currentCard) {\n if (openCards[0].firstChild.classList[1] === currentCard.firstChild.classList[1]) {\n currentCard.classList.toggle('match');\n openCards[0].classList.toggle('match');\n numberOfMatches++;\n openCards = [];\n incrementNumberOfMoves();\n checkStarRank();\n if (numberOfMatches === 8) {\n totalSeconds = 0;\n clearInterval(timer);\n displayWinModal();\n }\n }\n else if (openCards[0].firstChild.classList[1] !== currentCard.firstChild.classList[1]) {\n isTimeoutStopped = false;\n currentCard.classList.toggle('wrong');\n openCards[0].classList.toggle('wrong');\n setTimeout(() => {\n currentCard.classList.remove('show', 'wrong');\n openCards[0].classList.remove('show', 'wrong');\n openCards[0].addEventListener('click', cardClickHandler);\n currentCard.addEventListener('click', cardClickHandler);\n openCards = [];\n incrementNumberOfMoves();\n checkStarRank();\n isTimeoutStopped = true;\n }, 500);\n }\n}", "title": "" }, { "docid": "48d409ef91b677688500ff2f91712e07", "score": "0.50344974", "text": "function countMatches() {\n\tnumberOfMatches += 1;\n\treturn numberOfMatches;\n}", "title": "" }, { "docid": "1d47d5038eab35e187fab28142e27eaf", "score": "0.50342876", "text": "function giveMatches(myFarm){\n\tfor(i=0;i<myFarm.length;i++)\n\t\tmyFarm[i].matches.push(myFarm[i].friends[myFarm[i].friends.length-1]);\n\t}", "title": "" }, { "docid": "26b56b443f91c4cef843689cc4e4d570", "score": "0.5016023", "text": "function checkMatch() {\n if (\n toggledCards[0].firstElementChild.className ===\n toggledCards[1].firstElementChild.className\n ){\n toggledCards[0].classList.toggle('match');\n toggledCards[1].classList.toggle('match');\n toggledCards = [];\n matched++;\n } else {\n setTimeout(() =>{\n toggleCard(toggledCards[0]);\n toggleCard(toggledCards[1]);\n toggledCards = [];\n }, 1000);\n}\nif (matched === totalPairs){\n gameOver();\n}\n}", "title": "" }, { "docid": "09fd4c9e57f0d3f24960eb1cfa50d665", "score": "0.5007863", "text": "function create_this_weeks_matches() {\n\n\t\tvar counter = matches.length;\n\t\tmatches.forEach(function(match) {\n\t\t\tdb.client.incr(\"match_counter\", function(err,reply) {\n\t\t\t\tif (err) return _error(err);\n\n\t\t\t\tcreate_single_match(parseInt(reply), match[0], match[1], function(err) {\n\t\t\t\t\tif (err) return _error(err);\n\n\t\t\t\t\tif (--counter == 0) {\n\t\t\t\t\t\treturn append_match_ids_to_set()\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "9891edb93892a2c1cf227ae2d4e787ba", "score": "0.5007117", "text": "function checkForMatching(){\n if(toggledCards[0].firstElementChild.className === toggledCards[1].firstElementChild.className){\n toggledCards[0].classList.toggle('match');\n toggledCards[1].classList.toggle('match');\n toggledCards = [];\n count++;\n Done();\n } else {\n setTimeout(() => {\n toggleCard(toggledCards[0]);\n toggleCard(toggledCards[1]);\n toggledCards[0].classList.toggle('mismatch');\n toggledCards[1].classList.toggle('mismatch');\n toggledCards = [];\n }, 750);\n }\n}", "title": "" }, { "docid": "e456165b9847d5e3d38d5c8bcde72c21", "score": "0.500611", "text": "async function search(wordToMatch) {\n const request = await fetch('/api');\n const restaurants = await request.json();\n\n function findMatches() {\n return restaurants.filter((place) => {\n const regex = new RegExp(wordToMatch, 'gi');\n return (\n place.zip.match(regex)\n );\n });\n }\n async function getTopFive() {\n const matchArray = findMatches();\n const firstFive = matchArray.slice(0, 5);\n return firstFive;\n }\n return getTopFive();\n}", "title": "" }, { "docid": "4e0665c1b884b47ac3a80aeb7f63fda4", "score": "0.5004045", "text": "won(player, contest){\n let count = 0;\n for(var i=0; i< player.activitiesLog.length; i++){\n if(player.activitiesLog[i].name == contest.activity)\n if(player.activitiesLog[i].date >= contest.start && \n player.activitiesLog[i].date <= contest.end){\n count++;\n }\n }\n if(count >= contest.frequency){\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "504121b2dc3297c65f5943e07f4e130f", "score": "0.4998384", "text": "function check() {\n if (openCards[0].innerHTML === openCards[1].innerHTML) {\n matchedCards.push(openCards[0], openCards[1]);\n matching();\n openCards = [];\n } else {\n setTimeout(function() {\n for (openCard of openCards) {\n openCard.className = \"card\";\n }\n openCards = [];;\n }, 1000);\n }\n\n}", "title": "" }, { "docid": "5fce3109760cc3a1259b88610112ddc2", "score": "0.49904212", "text": "function findMatch() {\n var peers = window.peerList;\n if (!window.inGame) {\n if (peers[window.peerx]) {\n if (peers[window.peerx] !== window.connectionId) { // Check to make sure we aren't connecting to ourself\n var timeout = 150; // Because many the window.peerList list is stagnant, it can contain many dead clients. A low timeout value is set so the whole list can be scanned faster.\n if (window.connTimeout) {\n window.connection.close();\n clearTimeout(window.connTimeout);\n window.connTimeout = null;\n }\n // Connecto to the peer\n window.connection = peer.connect(peers[window.peerx], {reliable: true});\n window.connection.on('open', function(){\n if (window.connTimeout) {\n clearTimeout(window.connTimeout);\n window.connTimeout = null;\n }\n window.connection.send({connected: true, matchmaking: true});\n window.connection.on('data', handleData);\n if (!window.inGame)\n window.connTimeout = setTimeout(function(){\n window.connTimeout = null;\n window.connection.close();\n window.peerx += 1;\n findMatch();\n }, timeout);\n });\n window.connTimeout = setTimeout(function(){\n window.connTimeout = null;\n window.connection.close();\n window.peerx += 1;\n findMatch();\n }, timeout);\n } else {\n window.peerx += 1;\n findMatch(); // Recursively find a peer until we succeed\n }\n } else {\n // If we've exhausted all peers, refresh the list and try again\n peer.listAllPeers(function(list) {\n window.peerList = list;\n if (window.connTimeout) {\n window.connection.close();\n clearTimeout(window.connTimeout);\n window.connTimeout = null;\n }\n if (list[0]) {\n window.peerx = 0;\n findMatch(); // Recursively find a peer until we succeed\n }\n });\n }\n }\n }", "title": "" }, { "docid": "99a1c8fdaeff3dc87158447f0559d1da", "score": "0.49873897", "text": "async function getAllRelevantPlayers(Search_Query, Query_info, Search_Type) {\r\n var last_players_standing=[];\r\n Query_info.forEach(team_info => {\r\n team_info.squad.data.forEach((player_info) => {\r\n const { player_id, fullname, image_path, position_id, common_name, nationality, birthdate, birthcountry, height, weight} = player_info.player.data;\r\n if(Search_Type=='All'){\r\n last_players_standing.push({\r\n // playerID: player_id,\r\n // name: fullname,\r\n // image: image_path,\r\n // position: position_id,\r\n // team_name: team_info.name\r\n playerShortInfo: {\r\n playerID: player_id,\r\n name: fullname,\r\n image: image_path,\r\n position: position_id,\r\n team_name: team_info.name,\r\n },\r\n commonName: common_name,\r\n nationality: nationality,\r\n birthDate: birthdate,\r\n birthCountry: birthcountry,\r\n height: height,\r\n weight: weight\r\n \r\n\r\n \r\n });\r\n }\r\n else if(fullname?.toLowerCase()?.includes(Search_Query?.toLowerCase())){\r\n last_players_standing.push({\r\n playerID: player_id,\r\n name: fullname,\r\n image: image_path,\r\n position: position_id,\r\n team_name: team_info.name\r\n \r\n });\r\n }\r\n });\r\n });\r\n\r\n return last_players_standing;\r\n}", "title": "" }, { "docid": "a33238c406af295525711837434f372e", "score": "0.49873242", "text": "function checkMatch(){\n\tif(toggledCards[0].firstElementChild.className === toggledCards[1].firstElementChild.className){\n\t\ttoggledCards[0].classList.toggle('match');\n\t\ttoggledCards[1].classList.toggle('match');\n\t\ttoggledCards = [];\n\t\tmatched++;\n\t}else{\n\t\tsetTimeout(() =>{\n\t\t\ttoggleCard(toggledCards[0]);\n\t\t\ttoggleCard(toggledCards[1]);\n\t\t\ttoggledCards = [];\n\t\t}, 1000);\n\t}\n}", "title": "" }, { "docid": "889f950346370e6a1ca163260962582b", "score": "0.49868965", "text": "completed() {\n\t\treturn this.filter((todo) => todo.get('completed'));\n\t}", "title": "" }, { "docid": "7621c65c9fe8c9f14c1eddcaec623ad4", "score": "0.49778393", "text": "function getMatches(){\r\n return $.ajax({\r\n url: footballDataBaseURL,\r\n type: 'GET',\r\n dataType: 'json',\r\n success: function(response) {\r\n storage.matches = {}\r\n storage.currentMatchday = response['matches'][0]['season']['currentMatchday'];\r\n if (storage.currentMatchdayView < 1){\r\n storage.currentMatchdayView = storage.currentMatchday;\r\n }\r\n if (storage.currentMatchdayMapView < 1){\r\n storage.currentMatchdayMapView = storage.currentMatchday;\r\n }\r\n response['matches'].forEach(match => {\r\n var matchday = match['matchday'];\r\n if(!(matchday in storage.matches)){\r\n storage.matches[matchday] = {};\r\n }\r\n storage.matches[matchday][match['id']] = {\r\n 'id': match['id'],\r\n 'utcDate': match['utcDate'],\r\n 'status': match['status'],\r\n homeTeam: match[homeTeam],\r\n awayTeam: match[awayTeam],\r\n 'score': {\r\n 'winner': match['score']['winner'],\r\n 'halfTime': match['score']['halfTime'],\r\n 'fullTime': match['score']['fullTime'],\r\n }\r\n };\r\n })\r\n },\r\n error: function(response) {\r\n console.log('ajax failed');\r\n console.log(response);\r\n },\r\n beforeSend: setHeader\r\n });\r\n}", "title": "" }, { "docid": "fe189e36977116e7093b84363baccf00", "score": "0.49558568", "text": "function check4newCompetitions() {\n\tvar time2 = time4scan + 600;\n\n\n\t//ask for approved competitions\n\tvar db = new Firebase('https://' + baseURL + '/competitions_approved');\n\n\t//1388534400 = 1/1/2014\n\tlogcat(\"check4newCompetitions - startAT - 1388534400 = 1/1/2014 endAT - \" + time2.toString());\n\n\t//via UTC now\n\t// var dbQuery = db.startAt(time4scan.toString()).endAt(time2.toString());\n\tvar dbQuery = db.startAt(\"1388534400\").endAt(time2.toString());\n\n\tdbQuery.once('value', function(snapshot) {\n\n\t\tsnapshot.forEach(function(competition) {\n\n\t\t\t/////////////////start\n\t\t\tvar record = {\n\t\t\t\tcategory : competition.val().category,\n\t\t\t\tcomment : competition.val().comment,\n\t\t\t\tlogo : competition.val().logo,\n\t\t\t\ttitle : competition.val().title,\n\t\t\t\tcompany_id : competition.val().company_id,\n\t\t\t\tcompany : competition.val().company,\n\t\t\t\tdate_start : competition.val().date_start,\n\t\t\t\tdate_end : competition.val().date_end,\n\t\t\t\tcauses : competition.val().causes,\n\t\t\t\tis_offer : competition.val().is_offer,\n\t\t\t\tcountry : competition.val().country\n\t\t\t};\n\n\t\t\tvar record4cause = {\n\t\t\t\tcategory : competition.val().category,\n\t\t\t\tcomment : competition.val().comment,\n\t\t\t\tlogo : competition.val().logo,\n\t\t\t\ttitle : competition.val().title,\n\t\t\t\tcompany_id : competition.val().company_id,\n\t\t\t\tcompany : competition.val().company,\n\t\t\t\tdate_start : competition.val().date_start,\n\t\t\t\tdate_end : competition.val().date_end,\n\t\t\t\tis_offer : competition.val().is_offer,\n\t\t\t\tcountry : competition.val().country\n\t\t\t};\n\n\t\t\t//**CATEGORIES**\n\t\t\taddNode('https://' + baseURL + '/categories/' + competition.val().category_id + '/competitions/' + competition.name(), record, competition.val().country + competition.val().date_end);\n\n\t\t\t//**CAUSES**\n\t\t\tvar causes = competition.child('causes');\n\t\t\tcauses.forEach(function(cause) {\n\t\t\t\taddNode('https://' + baseURL + '/causes/' + cause.name() + '/competitions/' + competition.name(), record4cause, competition.val().country + competition.val().date_end);\n\t\t\t});\n\n\t\t\t//**CAUSESCOMPANIES**\n\t\t\tvar causecompanies = competition.child('causes');\n\t\t\tcausecompanies.forEach(function(causecompany) {\n\t\t\t\taddNode('https://' + baseURL + '/causescompanies/' + causecompany.val().cause_company_id + '/competitions/' + competition.name(), record4cause, competition.val().country + competition.val().date_end);\n\t\t\t});\n\n\t\t\t//**COMPANIES**\n\t\t\taddNode('https://' + baseURL + '/companies/' + competition.val().company_id + \"/competitions/\" + competition.name(), {\n\t\t\t\tcategory : competition.val().category,\n\t\t\t\tcauses : competition.val().causes,\n\t\t\t\tlogo : competition.val().logo,\n\t\t\t\ttitle : competition.val().title,\n\t\t\t\tis_offer : competition.val().is_offer,\n\t\t\t\tdate_end : competition.val().date_end\n\t\t\t}, competition.val().country + competition.val().date_end);\n\n\t\t\t//record for causecategories/id/companies\n\t\t\tvar causecatCompREC = {\n\t\t\t\tlogo : competition.val().company_logo,\n\t\t\t\ttitle : competition.val().company\n\t\t\t}\n\n\t\t\t//**CAUSE CATEGORIES**\n\t\t\tvar causecategories = competition.child('causes_categories');\n\t\t\tcausecategories.forEach(function(causecategory) {\n\t\t\t\taddNode('https://' + baseURL + '/causecategories/' + causecategory.name() + '/competitions/' + competition.name(), record, competition.val().country + competition.val().date_end);\n\t\t\t});\n\n\t\t\t//**CAUSE CATEGORIES/NodeKEY/causes/competitions **\n\t\t\tcauses.forEach(function(cause) {\n\t\t\t\tvar cause_categories = cause.val().cause_categories.toString().split('|');\n\n\t\t\t\tfor (var c = 0; c < cause_categories.length - 1; c++) {\n\n\t\t\t\t\taddNode('https://' + baseURL + '/causecategories/' + cause_categories[c] + '/causes/' + cause.name() + '/competitions/' + competition.name(), {\n\t\t\t\t\t\td : \"\",\n\t\t\t\t\t\tis_offer : competition.val().is_offer,\n\t\t\t\t\t\tcompany_id : competition.val().company_id\n\t\t\t\t\t}, competition.val().country + competition.val().date_end);\n\t\t\t\t}\n\n\t\t\t\t//todo if is only competitions\n\t\t\t\t// dbQuery.child(competition.name() + \"/causes/\" + cause.name() + \"/\" + cause_categories).set = \"\";\n\t\t\t});\n\n\t\t\t//**CATEGORIES** id/companies/userid** - LAST ADDITION BY DINA\n\t\t\tupdateNodeSET('https://' + baseURL + '/categories/' + competition.val().category_id + '/companies/' + competition.val().company_id, causecatCompREC, competition.val().country);\n\n\t\t\t//**CATEGORIES**2nd the competition key under causecategories/id/companies/userid/comp/newid - LAST ADDITION BY DINA\n\t\t\tupdateNodeSET('https://' + baseURL + '/categories/' + competition.val().category_id + '/companies/' + competition.val().company_id + '/competitions/' + competition.name(), {\n\t\t\t\tis_offer : competition.val().is_offer,\n\t\t\t\td : \"\"\n\t\t\t}, competition.val().country + competition.val().date_end);\n\n\t\t\t//mark it as DONE on competitions aka change priority from 0 to real COUNTRY+DATE_END\n\t\t\t//+ store the who approved (comes from android admin)\n\t\t\tupdateNodeSET('https://' + baseURL + '/competitions/' + competition.name(), {\n\t\t\t\tis_offer : competition.val().is_offer,\n\t\t\t\tapproved_by_admin_id : competition.val().approved_by_admin_id\n\t\t\t}, competition.val().country + competition.val().date_end);\n\n\t\t\t// setPrority('https://' + baseURL + '/competitions/' + competition.name(), competition.val().country + competition.val().date_end);\n\n\t\t\t//mark it as DONE on competitions_approved, better delete it, will see!\n\t\t\tsetPrority('https://' + baseURL + '/competitions_approved/' + competition.name(), 1);\n\n\t\t\t/////////////////end\n\t\t\tlogcat('check4newCompetitions - competition moved! : ' + competition.val().title);\n\t\t\t// console.log('competition moved! : ' + competition.val().title);\n\n\t\t\t//TODO : UNREM!\n\t\t\t//push notification IOS + ANDROID\n\t\t\tsend_ios_push_post(competition.val().category_id);\n\n\t\t\t// GRAB THE USERS BELONG TO CORRESPONING CATEGORY AND SEND PUSH FROM THERE\n\t\t\tfetchUsersIDs4AndroidPush(competition.val().category_id, competition.val().title, competition.val().country);\n\n\t\t\t//email sponsor\n\t\t\tgetSend_Mail2_SponsorCompetitionStart(competition.val().company_id, competition.val().title, competition.name());\n\n\t\t});\n\t\t//forEach [END]\n\n\t});\n\t//dbQuery [END]\n}", "title": "" } ]
d829ae93b8798714284a56331e896b82
Shares an object based on the supplied options
[ { "docid": "1a9eb9c35f2c16074cb47966093ed5f7", "score": "0.684982", "text": "function shareObject(o, options, bypass = false) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () {\n if (bypass) {\n // if the bypass flag is set send the supplied parameters directly to the service\n return sendShareObjectRequest(o, options);\n }\n // extend our options with some defaults\n options = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_2__[\"assign\"])(options, {\n group: null,\n includeAnonymousLinkInEmail: false,\n propagateAcl: false,\n useSimplifiedRoles: true,\n }, true);\n const roleValue = yield getRoleValue(options.role, options.group);\n // handle the multiple input types\n if (!Array.isArray(options.loginNames)) {\n options.loginNames = [options.loginNames];\n }\n const userStr = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_2__[\"jsS\"])(options.loginNames.map(Key => ({ Key })));\n let postBody = {\n peoplePickerInput: userStr,\n roleValue: roleValue,\n url: options.url,\n };\n if (options.emailData !== undefined && options.emailData !== null) {\n postBody = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_2__[\"assign\"])(postBody, {\n emailBody: options.emailData.body,\n emailSubject: options.emailData.subject !== undefined ? options.emailData.subject : \"Shared with you.\",\n sendEmail: true,\n });\n }\n return sendShareObjectRequest(o, postBody);\n });\n}", "title": "" } ]
[ { "docid": "fc50ee063b9bf57e67a4dade23294736", "score": "0.59715945", "text": "async sharedWithMe(options = null) {\n const q = DriveItems(this, \"sharedWithMe\");\n if ((options === null || options === void 0 ? void 0 : options.allowExternal) != null) {\n q.query.set(\"allowexternal\", options === null || options === void 0 ? void 0 : options.allowExternal.toString());\n }\n return q();\n }", "title": "" }, { "docid": "4414ffefa48249bf890aecf8e67aefd9", "score": "0.5818546", "text": "function share() {\n\n // browser compatibility fix for window.location.origin\n if (!window.location.origin){window.location.origin = window.location.protocol+\"//\"+window.location.host;}\n\n var client = new Dropbox.Client({\n // this key has to change for each app\n key : \"Q60cVmMyg/A=|pQC3I1F1qW3kRyF3Q2s78saA2VpYpQQwBez7IsFKgQ==\",\n sandbox : true\n });\n\n // first step is authorization with Dropbox\n authorize(client);\n\n}", "title": "" }, { "docid": "2361c86b3ac729304898ddc93b2247d0", "score": "0.5771218", "text": "function useShare(data) {\n const supported = isClient && \"share\" in navigator;\n let share = () => Promise.resolve(false);\n let canShare = FALSE_OP;\n let shared = runtimeCore.ref(false);\n let cancelled = runtimeCore.ref(false);\n if (supported) {\n share = data => {\n shared.value = false;\n cancelled.value = false;\n return navigator\n .share(data)\n .then(x => {\n shared.value = true;\n return x;\n })\n .catch(e => {\n shared.value = false;\n cancelled.value = true;\n return false;\n });\n };\n canShare = data => navigator.canShare(data);\n if (data) {\n if (canShare(data)) {\n share(data);\n }\n }\n }\n return {\n supported,\n share,\n canShare,\n shared,\n cancelled\n };\n }", "title": "" }, { "docid": "887eb80a41d6685d10a3042057d70c4d", "score": "0.5736184", "text": "function share(model) {\n\t$('#shareDialog').dialog({\n\t\tmodal: true,\n\t\tbuttons: {\n\t\t\tShare: function () {\n\t\t\t\t$('#shareForm').parsley().validate();\n\t\t\t\tif ($('#shareForm').parsley().isValid()) {\n\t\t\t\t\tvar repo_name = $('#repoNameInput').val();\n\t\t\t\t\t//call share method on server\n\t\t\t\t\tinit(model, repo_name);\n\t\t\t\t\t$(this).dialog(\"close\");\n\t\t\t\t}\n\t\t\t},\n\t\t\tCancel: function () {\n\t\t\t\t$(this).dialog(\"close\");\n\t\t\t\tmodel.isShared(false);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "c88df8372fc77210851ab103e92ef5f9", "score": "0.55770934", "text": "set share (flag) {\n this.share = !!flag\n }", "title": "" }, { "docid": "2a79d3ba90d13b8ba0f5cecfaf824b58", "score": "0.55546516", "text": "share(e) {\n\t\t\t// if dynamic instance then fetch attributes again in case of updates\n\t\t\tif (this.data.dynamic) {\n\t\t\t\tthis.os.setData(data);\n\t\t\t}\n\n\t\t\tif (this.data.type.toLowerCase() === 'paypal') {\n\t\t\t\tthis.paypal.submit();\n\t\t\t} else this.os.share(e);\n\n\t\t\tEvents.trigger(this.element, 'shared');\n\t\t}", "title": "" }, { "docid": "99e44b8033ece179e25e38f055eaebe6", "score": "0.5364382", "text": "function shareSelectedItems() {\n var blobs = selectedFileNames.map(function(name) {\n return selectedFileNamesToBlobs[name];\n });\n share(blobs);\n}", "title": "" }, { "docid": "35c8c75c02d7be7b3aa3252f76dfe623", "score": "0.51980376", "text": "function aa_share( name, message, link, picture ) {\n\n // 1. Check the environment for the sharing modal\n\n // 2. If user is authenticated, then we can use the friend selector\n\n}", "title": "" }, { "docid": "919998b3a52aaafda30af5ef2eaa2875", "score": "0.5163162", "text": "function share_selected() {\n const nb_path = get_selected_path();\n\n get_current_sharing(home_relative_path(nb_path), function(shared_with) {\n const shared = shared_with.length > 0;\n\n // Create buttons list\n const buttons = {};\n buttons[\"Cancel\"] = {\"class\" : \"btn-default\"};\n\n if (shared) {\n buttons[\"Make Private\"] = {\n \"class\": \"btn-danger\",\n \"click\": function () {\n const my_path = home_relative_path(nb_path);\n const notebook = get_shared_notebook(my_path);\n remove_shared_notebook(notebook);\n }\n };\n }\n\n buttons[shared ? \"Update\" : \"Share\"] = {\n \"class\" : \"btn-primary\",\n \"click\": function() {\n const success = function(response) {\n // Close the old dialog\n close_modal();\n\n // Refresh the list of notebooks\n get_sharing_list();\n\n // Parse the message\n const message = JSON.parse(response).success;\n\n // Display a new dialog with the success message\n dialog.modal({\n title : \"Notebook Shared\",\n body : $(\"<div></div>\")\n .addClass(\"alert alert-success\")\n .append(message),\n buttons: {\"OK\": function() {}}\n });\n };\n\n const errors = function(response) {\n // Remove the loading screen\n $(\".repo-modal-cover\").remove();\n\n // Try to parse a JSON error response\n try {\n const json = JSON.parse(response.responseText);\n console.log(json);\n\n show_error_in_dialog(json.error);\n\n // If errored users are provided, display this\n if (json.users) {\n json.users.forEach(function(u) {\n shared_user_error(u);\n });\n }\n }\n catch (e) {\n // Assume this is a 500 error of some sort\n show_error_in_dialog(\"An error occured while attempting to share the notebook.\");\n }\n };\n\n // Send list to the server\n update_sharing(home_relative_path(nb_path), shared_with, success, errors);\n\n // Show the loading screen\n modal_loading_screen();\n\n // Wait for the callback to hide the dialog\n return false;\n }};\n\n // Create the dialog body\n const body = $(\"<div/>\");\n if (shared) {\n body.append(\n $(\"<div/>\")\n .addClass(\"alert alert-info\")\n .append(\"This notebook has been shared with the users listed below. To update this list, remove or add users and then click Update.\")\n );\n }\n else {\n body.append(\n $(\"<div/>\")\n .addClass(\"alert alert-info\")\n .append(\"Enter the username or registered email address of those you want to share the notebook with below.\")\n );\n }\n body.append(\n $(\"<h4></h4>\")\n .append(\"Send Sharing Invite\")\n );\n body.append(\n $(\"<div></div>\")\n .addClass(\"row\")\n .append(\n $(\"<div></div>\")\n .addClass(\"col-md-10\")\n .append(\n $(\"<input/>\")\n .addClass(\"form-control repo-shared-invite\")\n .attr(\"type\", \"text\")\n .attr(\"required\", \"required\")\n .attr(\"maxlength\", 64)\n .attr(\"placeholder\", \"Enter username or email\")\n )\n )\n .append(\n $(\"<div></div>\")\n .addClass(\"col-md-2\")\n .append(\"&nbsp;\")\n .append(\n $(\"<button></button>\")\n .addClass(\"btn btn-primary\")\n .append(\"Add\")\n .click(function() {\n const invite = $(\".repo-shared-invite\");\n const user = invite.val().trim();\n invite.val(\"\");\n\n if (user && shared_with.indexOf(user) === -1) add_shared_user(user, shared_with);\n })\n )\n )\n );\n body.append(\n $(\"<h4></h4>\")\n .append(\"Share With\")\n .css(\"margin-top\", \"30px\")\n );\n\n // Create the shared list\n const shared_list_div = $(\"<div></div>\")\n .addClass(\"repo-shared-list\")\n .append(\n $(\"<div></div>\")\n .addClass(\"repo-shared-nobody\")\n .text(\"Nobody\")\n )\n .appendTo(body);\n\n // Add shared users to the list\n if (shared_with.length > 0) {\n for (let i = 0; i < shared_with.length; i++) {\n const user = shared_with[i];\n add_shared_user(user, shared_with, shared_list_div)\n }\n }\n\n // Show the modal dialog\n dialog.modal({\n title : \"Share Notebook With Others\",\n body : body,\n buttons: buttons\n });\n });\n }", "title": "" }, { "docid": "d66f3033dc70bae53bf0b0249abd6dfb", "score": "0.51411974", "text": "function share_pair(object1, object2) {\n\tvar keys1 = []\n\t\tvalues1 =[]\n\t \tkeys2 =[]\n\t \tvalues2 = []\n\n\tfor (key in object1) {\n \t\tkeys1.push(key);\n \t\tvalues1.push(object1[key]);\n\t}\t\n\t\n\tfor (key in object2) {\n \t\tkeys2.push(key);\n \t\tvalues2.push(object2[key]);\n\t}\n\n}", "title": "" }, { "docid": "4dba885c4fcf6194f59dff2adc88d5b9", "score": "0.5087389", "text": "function syncShorthand (opts) {\n if (!opts._.length) return usage(opts)\n debug('Sync shortcut command')\n\n var parsed = require('../src/parse-args')(opts)\n\n // Download Key\n if (parsed.key) {\n // dat <dat://key> [<dir>] - clone/resume <link> in [dir]\n debug('Clone sync')\n opts.dir = parsed.dir || parsed.key // put in `process.cwd()/key` if no dir\n opts.exit = opts.exit || false\n return require('../src/commands/clone').command(opts)\n }\n\n // Sync dir\n // dat <dir> - sync existing dat in {dir}\n if (parsed.dir) {\n opts.shortcut = true\n debug('Share sync')\n\n // Set default opts. TODO: use default opts in share\n opts.watch = opts.watch || true\n opts.import = opts.import || true\n return require('../src/commands/share').command(opts)\n }\n\n // If directory sync fails, finally try extension\n if (config.extensions.indexOf(opts._[0]) > -1) return require('../src/extensions')(opts)\n\n // All else fails, show usage\n return usage(opts)\n}", "title": "" }, { "docid": "8ec2a90fed8ecf342ccf4d16cea2ef17", "score": "0.5058886", "text": "function shareWith(o, loginNames, role, requireSignin = false, propagateAcl = false, emailData) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () {\n // handle the multiple input types\n if (!Array.isArray(loginNames)) {\n loginNames = [loginNames];\n }\n const userStr = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_2__[\"jsS\"])(loginNames.map(login => {\n return { Key: login };\n }));\n const roleFilter = role === _types_js__WEBPACK_IMPORTED_MODULE_6__[\"SharingRole\"].Edit ? _types_js__WEBPACK_IMPORTED_MODULE_6__[\"RoleType\"].Contributor : _types_js__WEBPACK_IMPORTED_MODULE_6__[\"RoleType\"].Reader;\n // start by looking up the role definition id we need to set the roleValue\n // remove need to reference Web here, which created a circular build issue\n const w = Object(_sharepointqueryable_js__WEBPACK_IMPORTED_MODULE_3__[\"SharePointQueryableCollection\"])(\"_api/web\", \"roledefinitions\");\n const def = yield w.select(\"Id\").filter(`RoleTypeKind eq ${roleFilter}`).get();\n if (!Array.isArray(def) || def.length < 1) {\n throw Error(`Could not locate a role defintion with RoleTypeKind ${roleFilter}`);\n }\n let postBody = {\n includeAnonymousLinkInEmail: requireSignin,\n peoplePickerInput: userStr,\n propagateAcl: propagateAcl,\n roleValue: `role:${def[0].Id}`,\n useSimplifiedRoles: true,\n };\n if (emailData !== undefined) {\n postBody = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_2__[\"assign\"])(postBody, {\n emailBody: emailData.body,\n emailSubject: emailData.subject !== undefined ? emailData.subject : \"\",\n sendEmail: true,\n });\n }\n return Object(_operations_js__WEBPACK_IMPORTED_MODULE_7__[\"spPost\"])(_telemetry_js__WEBPACK_IMPORTED_MODULE_8__[\"tag\"].configure(o.clone(_sharepointqueryable_js__WEBPACK_IMPORTED_MODULE_3__[\"SharePointQueryableInstance\"], \"shareObject\"), \"sh.shareWith\"), Object(_pnp_odata__WEBPACK_IMPORTED_MODULE_1__[\"body\"])(postBody));\n });\n}", "title": "" }, { "docid": "220eaccbe978e93720b681100f4ed5b1", "score": "0.4993844", "text": "function shareOptions(opt) {\n var chosenOption = document.getElementById(opt);\n var shareBtn = document.getElementById(\"share-with\");\n shareBtn.innerHTML = chosenOption.value;\n}", "title": "" }, { "docid": "8ad92e548d504ad1ff9d4d6213fc54d5", "score": "0.49771655", "text": "function _2(name, options = {}) {\n let defaults = {\n speed: 50,\n unit: 'mph'\n };\n let settings = Object.assign({}, defaults, options);\n //{} = target object - it will me modified\n ////we're using an empty object here just so keep our objects intact\n //defaults, options = source objects\n ////the last object will override the other values\n //return = the merged object\n}", "title": "" }, { "docid": "0ffe6c51288b568e0da415254d0f7d70", "score": "0.4940452", "text": "function share(blobs, blobName) {\n if (blobs.length === 0)\n return;\n\n var names = [], types = [], fullpaths = [];\n\n // Get the file name (minus path) and type of each blob\n blobs.forEach(function(blob) {\n var name = blob.name;\n\n // Special case for blobs that are not File objects\n if (!name && blobs.length === 1)\n name = blobName;\n\n // We try to fix Bug 814323 by using\n // current workaround of bluetooth transfer\n // so we will pass both filenames and fullpaths\n // The fullpaths can be removed after Bug 811615 is fixed\n fullpaths.push(name);\n // Discard the path, we just want the base name\n name = name.substring(name.lastIndexOf('/') + 1);\n names.push(name);\n\n // And we just want the first component of the type \"image\" or \"video\"\n var type = blob.type;\n if (type)\n type = type.substring(0, type.indexOf('/'));\n types.push(type);\n });\n\n // If there is just one type, or if all types are the same, then use\n // that type plus '/*'. Otherwise, use 'multipart/mixed'\n // If all the blobs are image we use 'image/*'. If all are videos\n // we use 'video/*'. Otherwise, 'multipart/mixed'.\n var type;\n if (types.length === 1 || types.every(function(t) { return t === types[0]; }))\n type = types[0] + '/*';\n else\n type = 'multipart/mixed';\n\n var a = new MozActivity({\n name: 'share',\n data: {\n type: type,\n number: blobs.length,\n blobs: blobs,\n filenames: names,\n filepaths: fullpaths\n }\n });\n\n a.onerror = function(e) {\n if (a.error.name === 'NO_PROVIDER') {\n var msg = navigator.mozL10n.get('share-noprovider');\n alert(msg);\n }\n else {\n console.warn('share activity error:', a.error.name);\n }\n };\n}", "title": "" }, { "docid": "14aca2ba7eb02f9121e14c2f92f3601e", "score": "0.4934373", "text": "function postShare() {\n // Post the shared post\n post('/post/share', { post_id: data.post_id })\n setShared(true)\n }", "title": "" }, { "docid": "c46270ad4d7106ee38069f1028c8888c", "score": "0.4923081", "text": "share (destination, callback) {\n\t\tif (tools.notType(destination, 'string')) {\n\t\t\treturn;\n\t\t} else if (destination.slice(-4) !== '.sia') {\n\t\t\tconsole.error('Share path needs end in \".sia\"!', destination);\n\t\t\treturn;\n\t\t}\n\t\tsiad.apiCall({\n\t\t\turl: '/renter/share',\n\t\t\tqs: {\n\t\t\t\tsiapaths: this.paths,\n\t\t\t\tdestination: destination,\n\t\t\t},\n\t\t}, callback);\n\t}", "title": "" }, { "docid": "4fa9b5b11eaf150ea8fa5ff0122e0702", "score": "0.4922075", "text": "function makeShare(infoObject) {\n if (infoObject.platform === \"facebook\") {\n let res = shareFacebook({\n quote: `Q: ${infoObject.question}. A: ${infoObject.answer}. Check out this website that makes decisions for you!`,\n href: 'https://inthestars.tech',\n redirect_uri: 'https://inthestars.tech',\n app_id: '461357091916957'\n })\n // console.log(res)\n return res;\n } else if (infoObject.platform === \"twitter\") {\n let res = shareTwitterURL({\n text: `Q: ${infoObject.question}. A: ${infoObject.answer}. Check out this website that makes decisions for you!`,\n url: 'https://inthestars.tech',\n })\n // console.log(res)\n return res;\n }\n}", "title": "" }, { "docid": "af45c6892fbafa97900d457abd2fa3c8", "score": "0.49109903", "text": "function Share(entity){\n\tthis.$container;\n\tthis.$description;\n\tthis.$action;\n\tthis.entity = entity;\n\tthis.loaded = false;\n\tthis.partialLoaded = false;\n\tthis.init();\n}", "title": "" }, { "docid": "b68c94e7104d513d63224de35eac3cb4", "score": "0.48226294", "text": "function gbShare ( shareText, shareLink )\n{\n\tshareText = shareText || \"\";\n\tshareLink = shareLink || \"\";\n\tgbGetRequest ( \"goodbarber://share\", { \"text\":encodeURIComponent(shareText), \"link\":encodeURIComponent(shareLink) } );\n}", "title": "" }, { "docid": "e39589ff2becb4cf74bb606d43751b4a", "score": "0.48192853", "text": "function shareWith(o, loginNames, role, requireSignin, propagateAcl, emailData) {\r\n if (requireSignin === void 0) { requireSignin = false; }\r\n if (propagateAcl === void 0) { propagateAcl = false; }\r\n return __awaiter(this, void 0, void 0, function () {\r\n var userStr, roleFilter, w, def, postBody;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n // handle the multiple input types\r\n if (!Array.isArray(loginNames)) {\r\n loginNames = [loginNames];\r\n }\r\n userStr = jsS(loginNames.map(function (login) { return { Key: login }; }));\r\n roleFilter = role === SharingRole.Edit ? RoleType.Contributor : RoleType.Reader;\r\n w = SharePointQueryableCollection(\"_api/web\", \"roledefinitions\");\r\n return [4 /*yield*/, w.select(\"Id\").filter(\"RoleTypeKind eq \" + roleFilter).get()];\r\n case 1:\r\n def = _a.sent();\r\n if (!Array.isArray(def) || def.length < 1) {\r\n throw Error(\"Could not locate a role defintion with RoleTypeKind \" + roleFilter);\r\n }\r\n postBody = {\r\n includeAnonymousLinkInEmail: requireSignin,\r\n peoplePickerInput: userStr,\r\n propagateAcl: propagateAcl,\r\n roleValue: \"role:\" + def[0].Id,\r\n useSimplifiedRoles: true,\r\n };\r\n if (emailData !== undefined) {\r\n postBody = util_assign(postBody, {\r\n emailBody: emailData.body,\r\n emailSubject: emailData.subject !== undefined ? emailData.subject : \"\",\r\n sendEmail: true,\r\n });\r\n }\r\n return [2 /*return*/, spPost(tag.configure(o.clone(SharePointQueryableInstance, \"shareObject\"), \"sh.shareWith\"), body(postBody))];\r\n }\r\n });\r\n });\r\n}", "title": "" }, { "docid": "22aad84cfb4eda1d7117e98b75811a46", "score": "0.48064145", "text": "function prepareOptions(options) {\n\tswitch (typeof options) {\n\t\tcase \"string\":\n\t\t\toptions = {\n\t\t\t\tsrc: options\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"boolean\":\n\t\t\toptions = {\n\t\t\t\tshared: options\n\t\t\t}\n\t\t\tbreak;\n\t}\n\treturn options || {};\n}", "title": "" }, { "docid": "ce425e71b14d6d5a48695e75f02fe8b3", "score": "0.48011962", "text": "function shareContent() {\n // Build the JSON payload containing the content to be shared\n var payload = {\n \"comment\": \"@platerate is a great app to help you find food you love - Find the highest rated menu items - wherever you are!\",\n \"visibility\": {\n \"code\": \"anyone\"\n }\n };\n IN.API.Raw(\"/people/~/shares?format=json\")\n .method(\"POST\")\n .body(JSON.stringify(payload))\n .result(onSuccess)\n .error(onError);\n}", "title": "" }, { "docid": "5402e8bc798e51bb40808a03360242f0", "score": "0.47745955", "text": "function Share(element) {\n\n if (typeof isElement !== 'function') {\n throw new Error(\"Cant find isElement function!\");\n }\n\n if (!shareInfo || typeof shareInfo !== 'object') {\n throw new Error(\"Cant find shareInfo object!\");\n }\n\n if (!element || !isElement(element)) {\n throw new Error(\"Cant find share element!\");\n }\n\n try {\n addEvent(element, 'click', onClick);\n } catch (e) {\n element.onclick = onClick;\n }\n\n // It opens a sharing window when clicking on an element\n function onClick () {\n var sharingSite = element.getAttribute('data-site');\n\n // Получить информацию про страницу\n var url = shareInfo.get('url');\n var title = shareInfo.get('title');\n var desc = shareInfo.get('description');\n var image = shareInfo.get('image');\n\n // Set different URLs for different sharing sites\n var sharingUrl = '';\n switch (sharingSite) {\n case 'vk':\n sharingUrl = 'https://vk.com/share.php?&title=' + title + '&description=' + desc + '&image=' + image + '&noparse=true&url=' + url;\n break;\n case 'twitter':\n sharingUrl = 'https://twitter.com/share?text=' + title + '&url=' + url;\n break;\n case 'facebook':\n sharingUrl = 'https://www.facebook.com/sharer/sharer.php?u=' + url;\n break;\n case 'odnoklassniki':\n sharingUrl = 'http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1&st._surl=' + url + '&st.comments=' + title + '';\n break;\n case 'mail.ru':\n sharingUrl = 'http://connect.mail.ru/share?url=' + url + '&title=' + title + '&description=' + desc + '&imageurl=' + image + '';\n break;\n case 'google+':\n sharingUrl = 'https://plus.google.com/share?url=' + url;\n break;\n case 'tumblr':\n sharingUrl = 'http://www.tumblr.com/share?v=3&t=' + title + '&u=' + url;\n break;\n case 'pinterest':\n sharingUrl = 'http://pinterest.com/pin/create/button/?media=' + image + '&description=' + desc + '&url=' + url;\n break;\n default:\n sharingUrl = sharingSite;\n }\n window.open(sharingUrl, '_blank', \"width=\" + 500 + \", height=\" + 500);\n }\n}", "title": "" }, { "docid": "531a73acbbb56e04c1786c7eab74bd5c", "score": "0.4733244", "text": "handleOptions(data){\n\n if(\"option\" in data){\n self.remoteOption = Object.assign(data.option, settings.remote);\n }\n // ToDo Update Behavior of current PartitialAjax\n }", "title": "" }, { "docid": "20e3ecd1f813c2a55a69b3ff6d7988b3", "score": "0.4732491", "text": "function getObjectSharingSettings(useSimplifiedRoles) {\r\n if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; }\r\n var o = tag.configure(this.clone(SharePointQueryableInstance, \"getObjectSharingSettings\"), \"sh.getObjectSharingSettings\");\r\n return spPost(o, body({ useSimplifiedRoles: useSimplifiedRoles }));\r\n}", "title": "" }, { "docid": "2f010d23f893e766b90c1a05490bc509", "score": "0.4730188", "text": "function actionUsingAnOptionsObject(args) {\n dialogs.action({\n actions: [\"Option1\", \"Option2\"],\n cancelButtonText: \"Cancel text\",\n message: \"Your message\",\n }).then(function (result) {\n console.log(\"Dialog result: \" + result);\n if (result === \"Options1\") {\n // Do action1\n }\n else if (result === \"Option2\") {\n // Do action2\n }\n });\n}", "title": "" }, { "docid": "1c2a0d7fa642fd0b121f28d1b04ee1ad", "score": "0.4723435", "text": "function shareKeyValuePairs(obj1, obj2) {\n for (var i in obj1) {\n if ( obj2.hasOwnProperty(i) && obj1[i] == obj2[i]) {\n return true;\n }\n };\n return false;\n}", "title": "" }, { "docid": "0ef81c551d47e157f23f8773781f6839", "score": "0.4674085", "text": "getShareable() {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () {\n // sharing only works on the item end point, not the file one - so we create a folder instance with the item url internally\n const d = yield this.clone(_sharepointqueryable_js__WEBPACK_IMPORTED_MODULE_2__[\"SharePointQueryableInstance\"], \"listItemAllFields\", false).select(\"odata.id\")();\n let shareable = Object(_items_types_js__WEBPACK_IMPORTED_MODULE_4__[\"Item\"])(Object(_odata_js__WEBPACK_IMPORTED_MODULE_3__[\"odataUrlFrom\"])(d));\n // we need to handle batching\n if (this.hasBatch) {\n shareable = shareable.inBatch(this.batch);\n }\n return shareable;\n });\n }", "title": "" }, { "docid": "ce15d8d97fd50628ed7d86c9f3513989", "score": "0.4646432", "text": "function mix(obj, data, role) {\n var permitted = _.pick(data, permissionsFor(role).write || []);\n return _.extend(obj, permitted); \n }", "title": "" }, { "docid": "8e58137a24c44a2b3fd893f616fb02ab", "score": "0.46403927", "text": "shareAllSocialData(share) {\n return Object(_operations_js__WEBPACK_IMPORTED_MODULE_6__[\"spPost\"])(this.clone(ProfileLoaderFactory, `getuserprofile/shareallsocialdata(${share})`));\n }", "title": "" }, { "docid": "7a5045d289d98792c7fccfdf54bd9de1", "score": "0.46303555", "text": "function shareSelected() {\n EventBridge.emitWebEvent(JSON.stringify({\n type: \"snapshot\",\n action: paths\n }));\n}", "title": "" }, { "docid": "a18599b694ce1f5c9d330e4da34451df", "score": "0.4625529", "text": "function setOptions(options) {\n exports.options = options;\n home.options = options;\n}", "title": "" }, { "docid": "4d2fb5c13cf05514b8916942cf28eb02", "score": "0.46183154", "text": "async createFileShare(requestContext, gatewayArn, studyId, roleArn, overrideParameters = {}) {\n // Check if there's an existing file share\n // The record 'file_shares' is used to keep track of all file shares so we don't need to scan the table for all file shares\n // The size limit of one DDB item 400KB, the record 'file_shares' can store up to 3,000 file shares\n const studyService = await this.service('studyService');\n const study = await studyService.mustFind(requestContext, studyId, ['resources', 'id', 'rev']);\n if (study.resources.length !== 1) {\n throw this.boom.badRequest(\n `Study ${studyId} has ${study.resources.length} S3 paths associated with it, only study with 1 s3 path is supported.`,\n );\n }\n const resource = study.resources[0];\n if ('fileShareArn' in resource) {\n return resource.fileShareArn;\n }\n this.log.info(`File share does not exist, continue to create file share.`);\n\n const s3LocationArn = resource.arn;\n const existingSG = await this.mustFind(requestContext, { id: gatewayArn });\n const storageGateway = await this.getStorageGateway();\n\n // Check if the file share already exist in storage gateway\n const listFileSharesResult = await storageGateway.listFileShares({ GatewayARN: gatewayArn }).promise();\n const fileSharesArnList = listFileSharesResult.FileShareInfoList.filter(\n fileShare => fileShare.FileShareType === 'NFS',\n ).map(fileShare => fileShare.FileShareARN);\n\n const fileShareS3ToArnList = {};\n if (!_.isEmpty(fileSharesArnList)) {\n const describeFileSharesResult = await storageGateway\n .describeNFSFileShares({\n FileShareARNList: fileSharesArnList,\n })\n .promise();\n describeFileSharesResult.NFSFileShareInfoList.forEach(fileShare => {\n fileShareS3ToArnList[fileShare.LocationARN] = fileShare.FileShareARN;\n });\n }\n\n // Move forward with DB update if file share already exist\n // Create file share if it does not exist\n let fileShareArn;\n if (s3LocationArn in fileShareS3ToArnList) {\n fileShareArn = fileShareS3ToArnList[s3LocationArn];\n } else {\n const clientToken = uuid();\n const params = {\n ClientToken: clientToken,\n GatewayARN: gatewayArn,\n LocationARN: s3LocationArn,\n Role: roleArn,\n ClientList: [`${existingSG.elasticIP}/32`],\n };\n const result = await storageGateway.createNFSFileShare({ ...params, ...overrideParameters }).promise();\n fileShareArn = result.FileShareARN;\n }\n\n // Update storage gateway record\n let newFileShares = {};\n if ('fileShares' in existingSG) {\n newFileShares = existingSG.fileShares;\n }\n newFileShares[s3LocationArn] = fileShareArn;\n await this.update(requestContext, { fileShares: newFileShares }, gatewayArn);\n // Update study record\n resource.fileShareArn = fileShareArn;\n await studyService.update(requestContext, study);\n return fileShareArn;\n }", "title": "" }, { "docid": "d501a707408c5456afa996ef95b7daff", "score": "0.46153894", "text": "dialogSaveCluster(options) {\n const { dispatch } = this.props;\n const {\n clusterName,\n createSnapshotCatalogPolicy,\n cspCredentialId,\n cspCredentialName,\n cspDescription: description,\n cspDomainType,\n cspId: cspDomainId,\n cspTags: tags,\n domainName,\n encryptionAlgorithmObj,\n managementHost,\n passphrase,\n selectedCredentialType,\n selectedOption,\n } = options;\n const encryptionPassphrase = {\n kind: 'SECRET',\n value: passphrase,\n };\n const { encryptionAlgorithm } = encryptionAlgorithmObj || {};\n const protectionDomainName = `SNAPSHOT_CATALOG`;\n\n /**\n * Need to either\n *\n * (1) Use an existing domain\n *\n * or\n *\n * (2) Create a new domain with different chained actions\n * Optionally create the CSP credential\n * Create the CSP domain\n * Create the cluster\n */\n if (selectedOption === constants.OPTION_USE_EXISTING) {\n /**\n * Create the cluster using an existing domain\n */\n const authorizedAccounts = [];\n const clusterAttributes = {};\n const params = {\n clusterType: constants.ORCHESTRATOR_TYPE_KUBERNETES,\n name: clusterName,\n cspDomainId,\n ...(clusterAttributes && { clusterAttributes }),\n ...(authorizedAccounts && { authorizedAccounts }),\n ...(description && { description }),\n ...(tags && { tags }),\n };\n dispatch(postCluster(params));\n } else {\n const name = domainName;\n\n const cspDomainAttributes =\n selectedCredentialType === constants.OPTION_USE_EXISTING\n ? this.domainAttributesPruned(options)\n : this.domainAttributes(options);\n\n const params = {\n ...(cspCredentialName && { cspCredentialName }),\n ...(cspDomainType && { cspDomainType }),\n ...(description && { description }),\n ...(encryptionAlgorithm && { encryptionAlgorithm }),\n ...(encryptionPassphrase && { encryptionPassphrase }),\n ...(managementHost && { managementHost }),\n ...(name && { name }),\n ...(Object.keys(cspDomainAttributes).length > 0 && { cspDomainAttributes }),\n ...(protectionDomainName && { protectionDomainName }),\n ...(selectedCredentialType === constants.OPTION_USE_EXISTING && { cspCredentialId }),\n ...(tags.length > 0 && { tags }),\n ...(createSnapshotCatalogPolicy && { createSnapshotCatalogPolicy }),\n accountId: sessionGetAccount(),\n };\n\n if (selectedCredentialType === constants.OPTION_CREATE_NEW) {\n dispatch(postCredentialCSPCluster(params, clusterName));\n } else {\n dispatch(postCSPandCluster(params, clusterName));\n }\n }\n\n this.setState({ dialogOpenCreate: false });\n }", "title": "" }, { "docid": "7c06dc02fa373c3e065324951c21d074", "score": "0.46150252", "text": "updateSharePreference(share) {\n StorageController.getToken().then((token) => {\n this.post(`${env.serverURL}/api/location/shared/updatePreference`, { sharing: share }, 'POST', token);\n });\n }", "title": "" }, { "docid": "4206560b3feeddae7445f945181d1cb1", "score": "0.45964888", "text": "function combine(object, options, whitelistedKeys) {\n Object.keys(object).forEach((key) => {\n if (object[key] instanceof Object) {\n combine(object[key], options, whitelistedKeys)\n } else if (options[key] !== undefined && whitelistedKeys.indexOf(key) >= 0) {\n object[key] = options[key]\n }\n })\n}", "title": "" }, { "docid": "9700542eddf7fc2985e51bc53fc93e0f", "score": "0.45908427", "text": "function shareCurrentSong() {\n var song = Grooveshark.getCurrentSongStatus().song;\n if (song) {\n GS.trigger('lightbox:open', 'share', { item: GS.Models.Song.newOrUpdate({ SongID: song.songID }) });\n }\n }", "title": "" }, { "docid": "2dcde5727238bd19ccedaefdbd54b61e", "score": "0.45582134", "text": "function StorageOptions(options) {\n if (options === void 0) { options = {}; }\n return __assign({ event: undefined, event_source: undefined, prefix: \"svelte-commons.\" }, options);\n}", "title": "" }, { "docid": "000cf134746977fd2c86130d404eba0b", "score": "0.455481", "text": "function setupSharing() {\n\t$sharingLinks = jQuery('.sharing-list a:not([data-include-script]):not(.email)');\n\t$sharingLinks.click(function(e){\n\t\thref = this.getAttribute('href');\n\t\topenWindow(href, 'Share');\n\t\te.preventDefault();\n\t});\n\tvar $scriptLinks = jQuery('.sharing-list a[data-include-script]');\n\t$scriptLinks.click(function(e){\n\t\te.preventDefault(); // stop default\n\t\t// show loading indicator\n\t\tfaLoadingIndicator(jQuery(this), 2000);\n\t\t// get script src\n\t\tvar scriptToLoad = jQuery(this).attr('data-include-script');\n\t\t// load script\n\t\tvar s = document.createElement('script');\n\t\ts.setAttribute('type','text/javascript');\n\t\ts.setAttribute('charset','UTF-8');\n\t\ts.setAttribute('src',scriptToLoad);\n\t\tdocument.body.appendChild(s);\n\t});\n}", "title": "" }, { "docid": "08a8f18849f3a1321033177fef31a07a", "score": "0.45470664", "text": "setOptions( options ) {\n\n // save for later use\n this.options = Object.assign( DEFAULT_OPTIONS, options );\n\n // Create the first CAN instance with the appropriate message set\n this.options.can1.MSG = MSG_SET1;\n this.can1 = new CanInstance( this, 1, this.options.can1 );\n\n // Create the second CAN instance with the appropriate message set\n if( this.options.can2 ) {\n this.options.can2.MSG = MSG_SET2;\n this.can2 = new CanInstance( this, 2, this.options.can2 );\n }\n\n }", "title": "" }, { "docid": "686e59fc916b45e2ab7565dcae28d904", "score": "0.45434743", "text": "function clone (obj) {\n var copy;\n if (Array.isArray(obj)) {\n copy = new Array(obj.length);\n for (var i = 0; i < obj.length; i++) {\n copy[i] = clone(obj[i]);\n }\n return copy;\n }\n if (Object.prototype.toString.call(obj) === '[object Object]') {\n copy = {};\n var elems = Object.keys(obj);\n var elem;\n while (elem = elems.pop()) {\n if (elem === 'tls') { // special handle tls\n copy[elem] = obj[elem];\n continue;\n }\n // Accept camelCase options and convert them to snake_case\n var snake_case = elem.replace(/[A-Z][^A-Z]/g, '_$&').toLowerCase();\n // If camelCase is detected, pass it to the client, so all variables are going to be camelCased\n // There are no deep nested options objects yet, but let's handle this future proof\n if (snake_case !== elem.toLowerCase()) {\n camelCase = true;\n }\n copy[snake_case] = clone(obj[elem]);\n }\n return copy;\n }\n return obj;\n}", "title": "" }, { "docid": "3d597324ade72420460ef7eb1a414e3c", "score": "0.4542298", "text": "function shareThisFuckingShit() {}", "title": "" }, { "docid": "af782d4bf9c297e8b747b028d181c0a1", "score": "0.45273492", "text": "function cloneHelperOptions(options) {\n var ret = _.pick(options, 'fn', 'inverse', 'hash', 'data');\n ret.data = _.omit(options.data, 'cid', 'view', 'yield');\n return ret;\n}", "title": "" }, { "docid": "26569a93922d85dfecce426960cef187", "score": "0.45231953", "text": "constructor(name, args, opts) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;\n let inputs = {};\n opts = opts || {};\n if (!opts.id) {\n if ((!args || args.friendlyName === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'friendlyName'\");\n }\n if ((!args || args.hostName === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'hostName'\");\n }\n inputs[\"accessRecheckOfflineTimeout\"] = args ? args.accessRecheckOfflineTimeout : undefined;\n inputs[\"accessRecheckOnlineTimeout\"] = args ? args.accessRecheckOnlineTimeout : undefined;\n inputs[\"appSharingFromLevel\"] = (_a = (args ? args.appSharingFromLevel : undefined)) !== null && _a !== void 0 ? _a : \"none\";\n inputs[\"appSharingToLevel\"] = (_b = (args ? args.appSharingToLevel : undefined)) !== null && _b !== void 0 ? _b : \"none\";\n inputs[\"authentication\"] = (_c = (args ? args.authentication : undefined)) !== null && _c !== void 0 ? _c : \"required\";\n inputs[\"clipboardSharingLevel\"] = (_d = (args ? args.clipboardSharingLevel : undefined)) !== null && _d !== void 0 ? _d : \"blocked\";\n inputs[\"dataBackup\"] = (_e = (args ? args.dataBackup : undefined)) !== null && _e !== void 0 ? _e : \"allow\";\n inputs[\"description\"] = args ? args.description : undefined;\n inputs[\"deviceCompliance\"] = (_f = (args ? args.deviceCompliance : undefined)) !== null && _f !== void 0 ? _f : \"enable\";\n inputs[\"fileEncryption\"] = (_g = (args ? args.fileEncryption : undefined)) !== null && _g !== void 0 ? _g : \"required\";\n inputs[\"fileSharingSaveAs\"] = (_h = (args ? args.fileSharingSaveAs : undefined)) !== null && _h !== void 0 ? _h : \"allow\";\n inputs[\"friendlyName\"] = args ? args.friendlyName : undefined;\n inputs[\"hostName\"] = args ? args.hostName : undefined;\n inputs[\"location\"] = args ? args.location : undefined;\n inputs[\"managedBrowser\"] = (_j = (args ? args.managedBrowser : undefined)) !== null && _j !== void 0 ? _j : \"required\";\n inputs[\"offlineWipeTimeout\"] = args ? args.offlineWipeTimeout : undefined;\n inputs[\"pin\"] = (_k = (args ? args.pin : undefined)) !== null && _k !== void 0 ? _k : \"required\";\n inputs[\"pinNumRetry\"] = args ? args.pinNumRetry : undefined;\n inputs[\"policyName\"] = args ? args.policyName : undefined;\n inputs[\"screenCapture\"] = (_l = (args ? args.screenCapture : undefined)) !== null && _l !== void 0 ? _l : \"allow\";\n inputs[\"tags\"] = args ? args.tags : undefined;\n inputs[\"groupStatus\"] = undefined /*out*/;\n inputs[\"lastModifiedTime\"] = undefined /*out*/;\n inputs[\"name\"] = undefined /*out*/;\n inputs[\"numOfApps\"] = undefined /*out*/;\n inputs[\"type\"] = undefined /*out*/;\n }\n else {\n inputs[\"accessRecheckOfflineTimeout\"] = undefined /*out*/;\n inputs[\"accessRecheckOnlineTimeout\"] = undefined /*out*/;\n inputs[\"appSharingFromLevel\"] = undefined /*out*/;\n inputs[\"appSharingToLevel\"] = undefined /*out*/;\n inputs[\"authentication\"] = undefined /*out*/;\n inputs[\"clipboardSharingLevel\"] = undefined /*out*/;\n inputs[\"dataBackup\"] = undefined /*out*/;\n inputs[\"description\"] = undefined /*out*/;\n inputs[\"deviceCompliance\"] = undefined /*out*/;\n inputs[\"fileEncryption\"] = undefined /*out*/;\n inputs[\"fileSharingSaveAs\"] = undefined /*out*/;\n inputs[\"friendlyName\"] = undefined /*out*/;\n inputs[\"groupStatus\"] = undefined /*out*/;\n inputs[\"lastModifiedTime\"] = undefined /*out*/;\n inputs[\"location\"] = undefined /*out*/;\n inputs[\"managedBrowser\"] = undefined /*out*/;\n inputs[\"name\"] = undefined /*out*/;\n inputs[\"numOfApps\"] = undefined /*out*/;\n inputs[\"offlineWipeTimeout\"] = undefined /*out*/;\n inputs[\"pin\"] = undefined /*out*/;\n inputs[\"pinNumRetry\"] = undefined /*out*/;\n inputs[\"screenCapture\"] = undefined /*out*/;\n inputs[\"tags\"] = undefined /*out*/;\n inputs[\"type\"] = undefined /*out*/;\n }\n if (!opts.version) {\n opts = pulumi.mergeOptions(opts, { version: utilities.getVersion() });\n }\n const aliasOpts = { aliases: [{ type: \"azure-nextgen:intune/v20150114privatepreview:AndroidMAMPolicyByName\" }, { type: \"azure-native:intune:AndroidMAMPolicyByName\" }, { type: \"azure-nextgen:intune:AndroidMAMPolicyByName\" }, { type: \"azure-native:intune/v20150114preview:AndroidMAMPolicyByName\" }, { type: \"azure-nextgen:intune/v20150114preview:AndroidMAMPolicyByName\" }] };\n opts = pulumi.mergeOptions(opts, aliasOpts);\n super(AndroidMAMPolicyByName.__pulumiType, name, inputs, opts);\n }", "title": "" }, { "docid": "dc3b13dce11f9e219066bc8d01722b91", "score": "0.45214686", "text": "shareRecord(accessToken, roleId, todoId) {\n\n var aclPostQuery = this.makeShareAcl(roleId);\n\n // set the header token in the header\n this.header.access_token = accessToken;\n return this.request(this.header, 'PUT', this.todoUrl, '', aclPostQuery, todoId);\n }", "title": "" }, { "docid": "b959ec67e095043ecc0022fcbb76c437", "score": "0.4517392", "text": "function getObjectSharingSettings(useSimplifiedRoles = true) {\n const o = _telemetry_js__WEBPACK_IMPORTED_MODULE_8__[\"tag\"].configure(this.clone(_sharepointqueryable_js__WEBPACK_IMPORTED_MODULE_3__[\"SharePointQueryableInstance\"], \"getObjectSharingSettings\"), \"sh.getObjectSharingSettings\");\n return Object(_operations_js__WEBPACK_IMPORTED_MODULE_7__[\"spPost\"])(o, Object(_pnp_odata__WEBPACK_IMPORTED_MODULE_1__[\"body\"])({ useSimplifiedRoles }));\n}", "title": "" }, { "docid": "21708499768ff996ed49a57d14cdba22", "score": "0.45172244", "text": "function shareContent() {\n // Build the JSON payload containing the content to be shared\n var payload = {\n \"comment\": $scope.linkedInPostComment,\n \"content\": {\n \"title\": $scope.linkedInPostTitle,\n \"description\": $scope.linkedInPostDescription,\n \"submitted-url\": $scope.linkedInPostSubmittedUrl, \n \"submitted-image-url\": $scope.linkedInPostSubmittedImageUrl\n },\n \"visibility\": {\n \"code\": \"anyone\"\n } \n };\n console.log(\"payload -\",payload);\n console.log(\"$scope.linkedInId - \",$scope.linkedInId);\n console.log(\"calling IN.API.Raw\")\n IN.API.Raw(\"/companies/\" + $scope.linkedInId + \"/shares?format=json\")\n .method(\"POST\")\n .body(JSON.stringify(payload))\n .result(onSuccess)\n .error(onError);\n }", "title": "" }, { "docid": "bafed2e21202d1ae42456d503eff4ef3", "score": "0.4514904", "text": "function shareBeanstalk(e) {\n var request = e.request;\n\n request.data.properties.title = SHARE_TITLE;\n request.data.setText('Check out this awesome app on the Windows Store today!');\n\n }", "title": "" }, { "docid": "44ab9ebc77448b231f9deb3938edb6ee", "score": "0.44765005", "text": "function copy(opts) {\n var ret = {};\n for(var key in opts) {\n if (opts.hasOwnProperty(key)) ret[key] = opts[key];\n }\n return ret;\n}", "title": "" }, { "docid": "f385dc9ab0ebfadaf1fe7568f38ba0f2", "score": "0.4476082", "text": "sharePublicKey() {\n try {\n share(this.walletController.wallet.publicKey)\n } catch (_) {\n this.flash({\n level: 'error',\n title: 'Share Unavailable',\n message: 'cannot share address at this time'\n })\n }\n console.log('share the public key')\n }", "title": "" }, { "docid": "263027db87678ea3df53937958d3a55f", "score": "0.4442138", "text": "function share3(item) {\r\n\r\n if (window.offerUrl) {\r\n\r\n // open offer window\r\n goOffer();\r\n\r\n }\r\n\r\n}", "title": "" }, { "docid": "c60bbb160577b0d8eee8cdd92946cec4", "score": "0.44324535", "text": "function merge() {\n var i, args = arguments, len, ret = {}, doCopy = function (copy, original) {\n var value, key;\n // An object is replacing a primitive\n if (typeof copy !== 'object') {\n copy = {};\n }\n for (key in original) {\n if (original.hasOwnProperty(key)) {\n value = original[key];\n // Copy the contents of objects, but not arrays or DOM nodes\n if (value && typeof value === 'object' && Object.prototype.toString.call(value) !== '[object Array]' && key !== 'renderTo' && typeof value.nodeType !== 'number') {\n copy[key] = doCopy(copy[key] || {}, value); // Primitives and arrays are copied over directly\n } else {\n copy[key] = original[key];\n }\n }\n }\n return copy;\n };\n // If first argument is true, copy into the existing object. Used in setOptions.\n if (args[0] === true) {\n ret = args[1];\n args = Array.prototype.slice.call(args, 2);\n }\n // For each argument, extend the return\n len = args.length;\n for (i = 0; i < len; i++) {\n ret = doCopy(ret, args[i]);\n }\n return ret;\n }", "title": "" }, { "docid": "ebb99b4d2f20f14e9bdd3b5de918988c", "score": "0.4432121", "text": "constructor(...args) {\n const options = optionsFromArguments(args);\n this._region = options.region;\n this._bucket = options.bucket;\n this._bucketPrefix = options.bucketPrefix;\n this._directAccess = options.directAccess;\n this._fileAcl = options.fileAcl;\n this._baseUrl = options.baseUrl;\n this._baseUrlDirect = options.baseUrlDirect;\n this._signatureVersion = options.signatureVersion;\n this._globalCacheControl = options.globalCacheControl;\n this._encryption = options.ServerSideEncryption;\n this._generateKey = options.generateKey;\n // Optional FilesAdaptor method\n this.validateFilename = options.validateFilename;\n\n const s3Options = {\n params: { Bucket: this._bucket },\n region: this._region,\n signatureVersion: this._signatureVersion,\n globalCacheControl: this._globalCacheControl,\n };\n\n if (options.accessKey && options.secretKey) {\n awsCredentialsDeprecationNotice();\n s3Options.accessKeyId = options.accessKey;\n s3Options.secretAccessKey = options.secretKey;\n }\n\n Object.assign(s3Options, options.s3overrides);\n\n this._s3Client = new AWS.S3(s3Options);\n this._hasBucket = false;\n }", "title": "" }, { "docid": "2fcbf2bf32e699fa1c2a55fd20ddcee5", "score": "0.44238275", "text": "function GSAPObject(options){\n\n\tvar q = new GSAP_Router(true),\n\t\ti,\n\t\tk,\n\t\tl,\n\t\tm,\n\t\taffectees;\n\n\tq.timeline = new TimelineMax({ defaultOverwrite:\"auto\" });\n\tq._elements = [];\n\tq.defaults = {};\n\tq.affectees = {length:0};\n\tq.atEnd = false;\n\tq.locks =[];\n\tq.type = 'GSAPObject';\n\n\tif(options){\n\t\t\n\t\taffectees = options.affectees || true;\n\n\t\tq.paused = options.paused || true ;\n\n\t\tif(q.paused) q.timeline.pause();\n\n\t\tq.defaults.ease = options.ease || 'Sine.easeOut';\n\t\tq.defaults.transformPerspective = options.transformPerspective || 0 ;\n\t\tq.defaults.perspective = options.perspective || 0 ;\n\t\tq.defaults.transformOrigin = options.transformOrigin || '50% 50%' ;\n\n\t}\n\t\n\t// Affectees playback will be controlled by this objects timeline\n\n\tif(affectees !== false){\n\t\t\n\t\tq.affect = function(item,name){\n\n\t\t\tconsole.log(Object.prototype.toString.call(item), Object.prototype.toString.call(name))\n\n\t\t\tif(Object.prototype.toString.call(item) === '[object Array]' && Object.prototype.toString.call(name) === '[object Array]'){\n\t\t\t\tfor( i = 0 , k=item.length ; i<k ; i++ ){\n\t\t\t\t\tif(name[i] === undefined){ name[i] = ''+q.affectees.length };\n\t\t\t\t\tq.addAffectee(name[i],item[i]);\n\t\t\t\t\tconsole.log('added')\n\t\t\t\t}\n\t\t\t}else if(typeof item === 'string' && typeof name === 'string'){\n\t\t\t\tif(name === undefined){ name = ''+q.affectees.length };\n\t\t\t\tq.addAffectee(name,item);\n\t\t\t\tconsole.log('added 2')\n\t\t\t}else{\n\t\t\t\tconsole.log('You must provide an array or a string for both instances')\n\t\t\t}\n\t\t};\n\n\t\tq.addAffectee = function(name,item){\n\t\t\tq.affectees[name] = item.timeline;\n\t\t\tq.affectees.length +=1;\n\t\t};\n\n\t\tq.removeAffectee = function(name){\n\t\t\tdelete q.affectees[name];\n\t\t\tq.affectees.length -=1;\n\t\t};\n\n\t}\n\n\t// ---------------------------------------------------\n\t// GSAP Method Core Modules\n\t// TODO: Unify into one.\n\n\tfunction do_GSAP(id,dur,op,timeOptions,method,offset){\n\t\t// execute a GSAP Method that accepts one var set.\n\n\t\tvar repeat,\n\t\t\tsync;\n\t\t\toffset = offset || undefined ;\n\n\t\tif(q.wrapper !== undefined){\n\t\t\tif(q.wrapper.id !== undefined && q.wrapper.id !== id){\n\t\t\t\tid = (typeof id !=='string') ? id : q.wrapper.id+' '+id;\n\t\t\t\t//console.log('adding wrapper: '+q.wrapper.id+' '+id);\n\t\t\t}\n\t\t\tif(q.wrapper.id === id){\n\t\t\t\tid = id;\n\t\t\t\t//console.log('same as wrapper: '+id);\n\t\t\t}\n\t\t}\n\n\t\t//console.log('id is '+id)\n\n\t\tif(timeOptions){\n\t\t\tsync = timeOptions.sync || 0 ;\n\t\t\trepeat = timeOptions.repeat || 0 ;\n\t\t\toffset = timeOptions.offset || 0 ;\n\t\t}\n\n\t\tif(op.length < 2){\n\n\t\t\tfor( i in q.defaults ){\n\t\t\t\top[0][i] = op[0][i] || q.defaults[i] ;\n\t\t\t}\n\n\t\t\t//console.log(repeat,sync,offset,op[0])\n\n\t\t\tGSAP_method(q.timeline,id,dur,{\n\t\t\t\toptions:op[0],\n\t\t\t\toffset:offset,\n\t\t\t\tsync:sync,\n\t\t\t\trepeat:repeat\n\t\t\t},method);\n\t\t}else{\n\n\t\t\tfor( i in q.defaults ){\n\t\t\t\top[0][i] = op[i] || q.defaults[i] ;\n\t\t\t}\n\n\t\t\tGSAP_method(q.timeline,id,dur,{\n\t\t\t\toptions:op[0],\n\t\t\t\toptions2:op[1],\n\t\t\t\toffset:offset,\n\t\t\t\tsync:sync,\n\t\t\t\trepeat:repeat\n\t\t\t},method);\n\t\t}\n\n\t\t// Push element for later reference\n\n\t\tif(q._elements.length === 0){\n\t\t\tq._elements.push(id);\n\t\t}else{\n\t\t\tfor(i=0, k<q._elements.length ; i<k ; i++){\n\t\t\t\tif(q._elements[i] !== id){\n\t\t\t\t\tq._elements.push(id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\t// -----------------------------------------------------------------------------------\n\t// Jig Integration, Jig allows you to store custom animations to use later as presets.\n\n\tq.jig = function(e,preset,options,timeOptions){\n\n\t\tvar repeat,\n\t\t\tsync,\n\t\t\tid;\n\n\t\tif(q.wrapper !== undefined){\n\t\t\tif(q.wrapper.id !== undefined){\n\t\t\t\tid = (q.wrapper.id !== e) ? q.wrapper.id+' '+e : e;\n\t\t\t}\n\t\t}else{\n\t\t\tid = e\n\t\t}\n\n\t\tif(timeOptions){\n\t\t\tsync = (timeOptions.sync !== undefined)? timeOptions.sync : undefined;\n\t\t\trepeat = timeOptions.repeat || undefined;\n\t\t}\n\n\t\tvar newOptions = [];\n\n\t\tfor( i in options ){\n\t\t\t//console.log(options[i])\n\t\t\tnewOptions[i] = options[i] || q.defaults[i] ;\n\t\t\t//console.log(newOptions[i])\n\t\t}\n\n\t\tfor( i in q.defaults ){\n\t\t\tif(newOptions[i] === undefined){\n\t\t\t\tnewOptions[i] = q.defaults[i];\n\t\t\t}\n\t\t}\n\n\t\t// Need to check if sync is passed as a number, if not we need a number.\n\t\tif( sync !== undefined && isNaN(sync) ){\n\t\t\tsync = this.timeline.getLabelTime(sync);\n\t\t}\n\n\t\t// If jig library is included\n\t\tif(this.timeline.jig){\n\t\t\tthis.timeline.jig.apply(this.timeline,[id,preset,newOptions,sync,repeat]);\n\t\t}else{\n\t\t\tconsole.log('You need to include a version of jig.js');\n\t\t}\n\n\t\treturn this;\n\t};\n\n\tq.staggerJig = function(e,preset,options,timeOptions){\n\n\t\tvar i,k,\n\t\t\trepeat,\n\t\t\tsync,\n\t\t\toffset,\n\t\t\tidGroup;\n\n\t\tif(timeOptions){\n\t\t\tsync = timeOptions.sync || undefined;\n\t\t\trepeat = timeOptions.repeat || undefined;\n\t\t\toffset = timeOptions.offset || undefined;\n\t\t}\n\n\t\t// Need to check if sync is passed as a number, if not we need a number.\n\t\tif( sync !== undefined ){\n\t\t\tif(isNaN(sync)){\n\t\t\t\tsync = this.timeline.getLabelTime(sync);\n\t\t\t}\n\t\t}else{\n\t\t\tsync = 0;\n\t\t}\n\n\t\tif(typeof e === 'string'){\n\n\t\t\t// if it has a wrapper and is a class or tag.\n\t\t\tif(q.wrapper !== undefined){\n\t\t\t\tif(q.wrapper.id !== undefined){\n\t\t\t\t\tidGroup = getNodes(q.wrapper.id+' '+e);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tidGroup = getNodes(e);\n\t\t\t}\n\t\t\t// if it returns a signel object\n\t\t\tif(typeof idGroup !== 'object'){\n\t\t\t\tidGroup = [idGroup];\n\t\t\t}\n\n\t\t}else{\n\n\t\t\t// if it is an array/object with a wrapper\n\t\t\tif(q.wrapper !== undefined){\n\t\t\t\tif(q.wrapper.id !== undefined){\n\t\t\t\t\tfor( i = 0 ; i<e.length ; i++){\n\t\t\t\t\t\tidGroup[i] = getNodes(q.wrapper.id+' '+e[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tidGroup = e;\n\t\t\t}\n\n\t\t}\n\n\t\t// If jig library is included\n\t\tif(this.timeline.jig){\n\n\t\t\tfor( i = 0 ; i<idGroup.length ; i++){\n\t\t\t\tthis.timeline.jig.apply(this.timeline,[idGroup[i],preset,options,sync,repeat]);\n\t\t\t\tsync += offset\n\t\t\t}\n\n\n\t\t}else{\n\t\t\tconsole.log('You need to include a version of jig.js');\n\t\t}\n\n\t\treturn this;\n\t};\n\n\t// -----------------------------------\n\t// GSAP Methods\n\n\tq.to = function(id,dur,op,timeOptions){ do_GSAP(id,dur,[op],timeOptions,'to'); return this; };\n\n\tq.from = function(id,dur,op,timeOptions){ do_GSAP(id,dur,[op],timeOptions,'from'); return this; };\n\n\tq.fromTo = function(id,dur,op,op2,timeOptions){ do_GSAP(id,dur,[op,op2],timeOptions,'fromTo'); return this; };\n\n\tq.staggerTo = function(id,dur,op,timeOptions){ do_GSAP(id,dur,[op],timeOptions,'staggerTo',0.3); return this; };\n\n\tq.staggerFrom = function(id,dur,op,timeOptions){ do_GSAP(id,dur,[op],timeOptions,'staggerFrom',0.3); return this; };\n\n\tq.staggerFromTo = function(id,dur,op,op2,timeOptions){ do_GSAP(id,dur,[op,op2],timeOptions,'staggerFromTo',0.3); return this; };\n\n\tq.yoyo = function(id,dur,op,op2,timeOptions){\n\n\t\t// this function allows you to explicity state the starting and ending point of the animtion, \n\t\t// like fromTo, or only state the ending state and by default animate from the resting state of your DOM node.\n\t\t// it does this by checking the attributes of your passed objects (associative arrays) and comparing them to expected values.\n\n\t\tvar i,c = 0,c1,c2,c3,\n\t\t\tops = {},\n\t\t\tops2 = {},\n\t\t\ttimeOps,\n\t\t\tstyles = jQuery(id).parseStyles();\n\n\t\t// see if op2 has been ommited by being replaced with timeOptions\n\t\tif(op2 !== undefined){\n\t\t\tc1 = (op2.sync !== undefined) ? c+=1 : undefined ;\n\t\t\tc2 = (op2.repeat !== undefined) ? c+=1 : undefined ;\n\t\t\tc3 = (op2.offset !== undefined) ? c+=1 : undefined ;\n\t\t}\n\n\t\t// if op2 is timeOptions\n\t\tif(c>0){\n\n\t\t\ttimeOps = op2\n\t\t\tfor( i in op ){ ops[i] = (i !== 'scale') ? ops[i] = 0 : ops[i] = 1; }\n\t\t\tops2 = op;\n\n\t\t}else{\n\n\t\t\tif(op2 === undefined){\n\t\t\t\tops2 = op;\n\t\t\t\tfor( i in op ){ ops[i] = (i !== 'scale') ? 0 : 1 ; }\n\t\t\t\ttimeOps = {};\n\n\t\t\t}else{\n\t\t\t\tops = op;\n\t\t\t\tops2 = op2;\n\t\t\t\ttimeOps = (timeOptions !== undefined) ? timeOptions : {};\n\t\t\t}\n\n\t\t}\n\n\t\t// Animate with Greensock\n\t\tdo_GSAP(id,dur,[ops,ops2],timeOps,'yoyo');\n\n\t\treturn this;\n\t};\n\n\tq.addLabel = function(label,sync){\n\t\tif(sync){ this.timeline.add(label,sync); }else{ this.timeline.add(label); }\n\t\treturn this;\t\n\t};\n\n\t// uses GSAP 'addCallback' to execute something 'at' a certain point\n\tq.at = function(sync,callback,name){\n\t\tif(name) { \n\t\t\tthis.timeline.add(name,sync); // adds a label to the timeline\n\t\t}\n\t\tthis.timeline.addCallback(callback,sync);\n\t\treturn this;\n\t};\n\n\tq.hideAll = function(){\n\t\t// Hide all DOM elements associated with the current scene\n\t\tvar i,k;\n\t\tfor( i = 0 , k = q._elements.length ; i<k ; i++){\n\t\t\tTweenMax.set(q._elements[i],{css:{\n\t\t\t\t'visibility':'hidden',\n\t\t\t\t'opacity':'0'\n\t\t\t}})\n\t\t}\n\t\treturn this;\n\t};\n\n\tq.showAll = function(){\n\t\t// Show all DOM elements associated with the current scene\n\t\tvar i,k;\n\t\tfor( i = 0 , k = q._elements.length ; i<k ; i++){\n\t\t\tTweenMax.set(q._elements[i],{css:{\n\t\t\t\t'visibility':'visible',\n\t\t\t\t'opacity':'1'\n\t\t\t}})\n\t\t}\n\t\treturn this;\n\t};\n\n\tq.show = function(selector){\n\t\tif(selector === undefined && typeof selector !== 'string' ){\n\t\t\tvar i,k;\n\t\t\tfor( i = 0 , k = this._elements.length ; i<k ; i++){\n\t\t\t\tTweenMax.set(this._elements[i],{css:{\n\t\t\t\t\t'visibility':'visible',\n\t\t\t\t\t'opacity':'1',\n\t\t\t\t\t'pointer-events':'inherit'\n\t\t\t\t}})\n\t\t\t}\n\t\t}else{\n\t\t\tTweenMax.set(selector,{css:{\n\t\t\t\t'visibility':'visible',\n\t\t\t\t'opacity':'1',\n\t\t\t\t'pointer-events':'inherit'\n\t\t\t}})\n\t\t}\n\n\t\treturn this;\n\t};\n\n\tq.hide = function(selector){\n\t\tif(selector === undefined && typeof selector !== 'string' ){\n\t\t\tvar i,k;\n\t\t\tfor( i = 0 , k = this._elements.length ; i<k ; i++){\n\t\t\t\tTweenMax.set(this._elements[i],{css:{\n\t\t\t\t\t'visibility':'hidden',\n\t\t\t\t\t'opacity':'0',\n\t\t\t\t\t'pointer-events':'none'\n\t\t\t\t}})\n\t\t\t}\n\t\t}else{\n\t\t\tTweenMax.set(selector,{css:{\n\t\t\t\t'visibility':'hidden',\n\t\t\t\t'opacity':'0',\t\t\t\t\n\t\t\t\t'pointer-events':'none'\n\t\t\t}})\n\t\t}\n\n\t\treturn this;\n\t};\n\n\t// a function to ensure the timeline is at a certain length, implemented for soundtrack syncing.\n\tq.endAt = function(milliseconds){\n\n\t\tvar sync = milliseconds/1000;\n\n\t\t// kind of hackish, but it is the only way to ensure we set the timelines actual length, not timescale\n\t\tthis.timeline.addCallback(function(){q.atEnd = true},sync);\n\n\t\treturn this;\n\t};\n\n\tq.loop = function(times){\n\t\tif(times === 'forever' || times ===undefined){\n\t\t\tq.set({repeat:-1});\n\t\t}else{\n\t\t\tq.set({repeat:times});\n\t\t}\n\t};\n\n\treturn q;\n}", "title": "" }, { "docid": "d1ace0c71002d0737da1a92d6f552cc8", "score": "0.44218338", "text": "function S3Mock(options) {\n if (!!options && !!options.params) {\n this.defaultOptions = { ...applyBasePath(options.params) }\n }\n\n this.config = {\n update: function () {},\n }\n}", "title": "" }, { "docid": "a015422d6922ce6d1d7dcc97b39034a4", "score": "0.44213054", "text": "setSharePath(path) {\n d.dispatch({\n type: types.SET_SHARE_PATH,\n path\n });\n }", "title": "" }, { "docid": "7ebc9b7e18f420794053363024f96626", "score": "0.44211617", "text": "shareCasefile(bookmarks) {\n d.dispatch({\n type: types.SHARE_CASEFILE,\n bookmarks\n });\n }", "title": "" }, { "docid": "52d0a247bc1db3bbb82cf9eeb6801430", "score": "0.4416336", "text": "function cloneHelperOptions(options) {\n var ret = _.pick(options, 'fn', 'inverse', 'hash', 'data');\n ret.data = _.omit(options.data, 'cid', 'view', 'yield', 'root', '_parent');\n return ret;\n}", "title": "" }, { "docid": "35e06c9c9700c83147a4e2e7e525e295", "score": "0.4416268", "text": "function LinkShare(token, merchant, url) {\n this.token = token;\n this.merchant = merchant;\n this.url = url;\n this.server = 'getdeeplink.linksynergy.com';\n this.path = '/createcustomlink.shtml',\n this.trackingUrl = '';\n}", "title": "" }, { "docid": "f9bcaf34cb5b422f3d6b1c53c717a4e1", "score": "0.44128752", "text": "shareEvent() {\r\n shareItem(\r\n this.state.data.title,\r\n this.state.data.social_url,\r\n this.state.data.title\r\n );\r\n }", "title": "" }, { "docid": "99951e4df0366c1da24881fdedbd4afd", "score": "0.44109085", "text": "function shareMusic() {\nvar type = 'music';\nvar details = {\nmode: blackberry.invoke.card.FILEPICKER_MODE_PICKER,\nfilter: [\"*.wav\", \"*.mp3\"]\n};\ninvokeFilePicker(details, type);\n}", "title": "" }, { "docid": "3c752f5fd03eb96f4ebd170138ee5a62", "score": "0.4403207", "text": "function sendOTS3FileSharingSignal(data) {\n var signalOptions = {\n type: \"OT_S3_FILE_SHARING\",\n data: data\n }\n\n // add connection object if it exists\n if (_options.to) {\n signalOptions.to = _options.to;\n }\n\n session.signal(signalOptions, fileSignalSentCallback);\n }", "title": "" }, { "docid": "73a9ef132755e07d89016bfd525c4f1a", "score": "0.4402863", "text": "doSave(opt) {\n const model = get(this, 'primaryResource');\n\n return model.save(opt).then((newData) => {\n return this.mergeResult(newData);\n });\n }", "title": "" }, { "docid": "47b3744307e9465f4f513f2428d83131", "score": "0.43742222", "text": "shares_vertex(other){\n return this.source == other.source \n || this.source == other.target\n || this.target == other.source\n || this.target == other.target;\n }", "title": "" }, { "docid": "47b3744307e9465f4f513f2428d83131", "score": "0.43742222", "text": "shares_vertex(other){\n return this.source == other.source \n || this.source == other.target\n || this.target == other.source\n || this.target == other.target;\n }", "title": "" }, { "docid": "b019da608b082eeea841b6e571e790ee", "score": "0.43723", "text": "NOPUT(url, options) {\n return fetch(`${this.basePath}${url}`, {\n method: 'PUT',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(options),\n })\n }", "title": "" }, { "docid": "447a9eed89fec1a8ee3d45ee3663cabf", "score": "0.43682316", "text": "async function shareCalendarWithUser({sharerId, shareeId, permission}) {\n assert.ok(sharerId); assert.ok(shareeId); assert.ok(sharerId !== shareeId);\n assert.ok([UPDATE, READ].indexOf(permission) >= 0);\n\n const group = await repository.getSoloGroupOfUser(shareeId);\n const resource = await repository.getUserResourceOfUser(sharerId);\n\n await resourceUsecase.addResourcePermissionToUserGroup({\n groupId: group.id, \n resourceId: resource.id, permission});\n }", "title": "" }, { "docid": "84232b9ab445474c02de9112b8c4645e", "score": "0.43652925", "text": "function setupSharing() {\n\t$sharingLinks = jQuery('.sharing-list a:not(.pinterest):not(.email)');\n\t$sharingLinks.click(function(e){\n\t\thref = this.getAttribute('href');\n\t\topenWindow(href, 'Share');\n\t\te.preventDefault();\n\t});\n\tvar $pinterestLink = jQuery('.sharing-list a.pinterest');\n\t$pinterestLink.click(function(e){\n\t\tfaLoadingIndicator(jQuery(this), 'fa-pinterest', 2000); // show loading indicator\n\t\tpinterestPinIt(); // fire of pinterest function\n\t\te.preventDefault(); // stop default\n\t});\n}", "title": "" }, { "docid": "0f2578cf1e03a82fefef67f08f667718", "score": "0.43555242", "text": "function enableShare(){\n function shareToFuture(shareDate, postId, postIndex){\n $.ajax({\n url: '/sharepost',\n type: 'POST',\n data: {\n user_id: personId,\n post_id: postId,\n post_index: postIndex,\n date: shareDate\n },\n success: function(data){\n //console.log(\"success. post will be shared on date: \", data);\n }\n });\n };\n\n $(\".share\").unbind().click(function(){\n var postDiv = $(this).closest(\".post\");\n postDiv.find(\".reactme\").removeClass(\"active-button\");\n postDiv.find(\".rdropdown\").removeClass(\"show\");\n var shareForm = $(this).parent().parent().find(\".shareform\")\n if(shareForm.css('display') != 'flex'){\n postDiv.find(\".commentform\").css(\"display\", \"none\");\n postDiv.find(\".commentme\").removeClass(\"active-button\");\n $(this).addClass(\"active-button\");\n shareForm.css('display', 'flex');\n postDiv.find(\".cheading\").css(\"display\", \"block\");\n }\n else{\n $(this).removeClass(\"active-button\");\n shareForm.css('display', 'none');\n if(postDiv.find('.comments').html() == '')\n postDiv.find(\".cheading\").css(\"display\", \"none\");\n }\n });\n\n $(\".recipient\").change(function(){\n //console.log('recipient changed');\n if($(this).val() == 'self'){\n console.log('is self');\n $(this).parent().parent().find('.part2').removeClass('hidden');\n } else {\n console.log('isnt self');\n $(this).parent().parent().find('.part2').addClass('hidden');\n }\n });\n\n $(\".sharebutton\").unbind().click(function(){\n\n /* Function to display the \"SHARED!\" message. */\n function displayShared(instance, dateString, friendName){\n if(instance == 0){\n var sharedMessage = \"<div class='message'><i class='material-icons'>check_circle</i> Your post has been shared with your past self.</div>\";\n }\n else if(instance == 1){\n var sharedMessage = \"<div class='message'><i class='material-icons'>check_circle</i> Your post has been shared with your future self, who will get notified on \" + months[dateString.substring(4, 6)-1] + \" \" + dateString.substring(6, 8) + \", \" + dateString.substring(0, 4) + \".</div>\";\n }\n else{\n var sharedMessage = \"<div class='message'><i class='material-icons'>check_circle</i> Your post has been shared with your friend \" + friendName + \".</div>\";\n }\n\n var formHTML = $(this).parent().html();\n lowerMessage(sharedMessage);\n\n\n $(this).parent().css('display', 'none');\n if($(this).parent().parent().find('.comments').html() == '')\n $(this).parent().parent().find(\".cheading\").css(\"display\", \"none\");\n }\n\n $(this).parent().parent().find('.share').removeClass(\"active-button\");\n var formDate = $(this).parent().find(\".dateinput\").val().replace('-', '').replace('-', '');\n var currentDate = String(date.getFullYear() + '' + (date.getMonth() + 1) + '' + date.getDate());\n //console.log(currentDate);\n //console.log(formDate);\n\n var recipientValue = $(this).parent().find('.recipient').val();\n\n /* Sharing to a friend */\n if(recipientValue != 'self'){\n console.log(\"shared with friend\");\n displayShared(2,null,recipientValue);\n }\n /* Sharing to the past self */\n else if(formDate < currentDate){\n displayShared(0, formDate);\n }\n\n /* Sharing to the present or future */\n else{\n var thePostId = $(this).parent().parent().find(\".post_id\").html();\n var thePostIndex = $(this).parent().parent().attr(\"id\");\n console.log(\"post id:\" + thePostId);\n console.log(\"post index:\" + thePostIndex);\n shareToFuture(formDate, thePostId, thePostIndex);\n if(formDate == currentDate)\n checkNotifications(thePostIndex);\n displayShared(1, formDate);\n }\n\n });\n}", "title": "" }, { "docid": "82c3b048e84fdd80b96ae8771a02d92d", "score": "0.43497512", "text": "function share(action){\r\n\t//var loc = location.href\r\n\t//loc = loc.substring(0, loc.lastIndexOf(\"/\") + 1);\r\n\tvar baseUrl = 'http://playkit.xyz/games/shenkin/';\r\n\tvar loc = baseUrl + '?source=[SOURCE]';\r\n\tvar source = 'other';\r\n\tvar title = shareTitle.replace(\"[SCORE]\", playerData.score);\r\n\tvar text = shareMessage.replace(\"[SCORE]\", playerData.score);\r\n\t\ttext = text.replace(\"[WON]\", (playerData.score >= prize1score) ? won : '');\r\n\tvar shareurl = '';\r\n\t\r\n\tif( action == 'twitter' ) {\r\n\t\tsource = 'twitterShare';\r\n\t\tshareurl = 'https://twitter.com/intent/tweet?url='+loc+'&text='+text;\r\n\t\tshareurl = shareurl.replace(\"[SOURCE]\", source);\r\n\t}else if( action == 'facebook' ){\r\n\t\tsource = 'facebookShare';\r\n\t\tloc = loc.replace(\"[SOURCE]\", source);// before the encode\r\n\r\n\t\tparams = title+'~~~~'+text;\r\n\t\tparams = params.replace(/ /g, '~');\r\n\r\n\t\tshareurl = 'http://www.facebook.com/sharer.php?m2w&u='+encodeURIComponent(baseUrl+'share.php?params='+params);\r\n\r\n\t\t//raise ga event\r\n\t\traiseGaEvent('shared game', 'facebook share', playerData.score, 1);\t\r\n\r\n\t}else if( action == 'google' ){\r\n\t\tsource = 'googleShare';\r\n\t\tshareurl = 'https://plus.google.com/share?url='+loc;\r\n\t\tshareurl = shareurl.replace(\"[SOURCE]\", source);\r\n\t}else if( action == 'whatsapp' ){\r\n\t\tsource = 'whatsappShare';\r\n\t\tloc = loc.replace(\"[SOURCE]\", source);\r\n\t\tshareurl = 'whatsapp://send?text='+encodeURIComponent(text)+' - '+encodeURIComponent(loc);\r\n\r\n\t\t//raise ga event\r\n\t\traiseGaEvent('shared game', 'whatsapp share', playerData.score, 1);\t\r\n\t}\r\n\t\r\n\twindow.open(shareurl);\r\n}", "title": "" }, { "docid": "025c3286297c249e0367df0e4a73d0b2", "score": "0.43426004", "text": "getSharedData(dataObject) {\n raise(\"getSharedData should be overridden by subclasses\");\n }", "title": "" }, { "docid": "42cab4301533684c63303fd3f255ac40", "score": "0.43425718", "text": "function pick(object) {\n let result = Object.create(null);\n\n // start at the second parameter\n for (let i = 1, len = arguments.length; i < len; i++) {\n result[arguments[i]] = object[arguments[i]];\n }\n\n return result;\n}", "title": "" }, { "docid": "da0a95a24cb6a756c85ec22b768041c7", "score": "0.4340005", "text": "function _mix(dist, obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && key !== 'constructor' && obj[key] !== undefined) {\n dist[key] = obj[key];\n }\n }\n}", "title": "" }, { "docid": "05b41991bb3bfd95baa18f3c33d30267", "score": "0.43381965", "text": "async putObject(container, path, data, options) {\n path = pathLib.join(this._basePath, sanitisePath(path));\n await mkdir(pathLib.dirname(path));\n\n if (data instanceof Stream || data instanceof Buffer || typeof data === \"string\") {\n return fs.promises.writeFile(path, data);\n } else {\n return Promise.reject(new Error('Data must be a stream, buffer or string'));\n }\n }", "title": "" }, { "docid": "825d456d6bec6bee05609f5535d72936", "score": "0.43346825", "text": "function _mix(dist, obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && key !== 'constructor' && obj[key] !== undefined) {\n dist[key] = obj[key];\n }\n }\n}", "title": "" }, { "docid": "6375426835c67102e53be1bef6a53ed1", "score": "0.43292534", "text": "shareSong(Song){\n //function of sharing \n this.setState({shareModal:true,\n tempSharedSong: Song})\n }", "title": "" }, { "docid": "36a2e7e5e1dc5fec0e3e1807405a1ed9", "score": "0.4326418", "text": "function shareURL(aRequest, aResponse) {\n aResponse.setStatusLine(aRequest.httpVersion, 200, \"OK\");\n aResponse.setHeader(\"Content-Type\", \"text/html\", false);\n aResponse.write(\"<html><head></head><body>SHARE!</body></html>\");\n}", "title": "" }, { "docid": "704c63544ffaf3ac278f4be2e45092be", "score": "0.43219137", "text": "seal(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, sealOperationSpec);\n }", "title": "" }, { "docid": "e021ecc38c7fc27e1c43bb2082f0a2c7", "score": "0.4316386", "text": "constructor(options) {\n this.accountId = options.accountId;\n this.assetCode = options.assetCode;\n this.assetScale = options.assetScale;\n this.clearingBalance = options.clearingBalance;\n this.prepaidAmount = options.prepaidAmount;\n this.netBalance = options.clearingBalance.add(options.prepaidAmount);\n }", "title": "" }, { "docid": "a9328ba3b3196a3a19218081e4804ed7", "score": "0.43066823", "text": "function getShareData(elementText){\r\n if(optionA[getOptionArrayIndex(elementText)].length === 0){\r\n $.post('shareList',{'data':elementText },function(data,status){\r\n optionA[getOptionArrayIndex(elementText)] = deepCopy(data);\r\n //getDataIndex++;\r\n //console.log(getDataIndex);\r\n });\r\n }\r\n}", "title": "" }, { "docid": "d5cd1e90f4417bacdb68d9ff3d7cc105", "score": "0.4302199", "text": "function share(oneName, self) {\n if (!oneName) {\n console.log(`One for you and one for ${self}`)\n } else {\n console.log(`One for ${oneName} and one for ${self}`)\n }\n}", "title": "" }, { "docid": "f537754240f4ea726cdf3b7ab4dd4499", "score": "0.4300796", "text": "function pick(obj) {\n\t var copy = {};\n\t var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n\t forEach(keys, function (key) {\n\t if (key in obj) copy[key] = obj[key];\n\t });\n\t return copy;\n\t }", "title": "" }, { "docid": "ccb35949b5b0ee6714173a884a62d652", "score": "0.42896006", "text": "function activity_share(activityString) {\n\tsharedDocumentId = \"\"; // Action from a script, do not enable slide follow\n\tsession_set(\"open:\" + (authorid !== \"\" ? authorid : userid) + \"/\" + docid + \"_0\" + (typeof activityString == \"undefined\" ? \"\" : \":\" + activityString));\n}", "title": "" }, { "docid": "4087eae4a992052031b0dd1a7f1acd87", "score": "0.4286703", "text": "function $sharingProvider() {\n let registry = [];\n\n return {\n register(state, {name, accept = []} = {}) {\n registry.push({state, name, accept});\n },\n\n $get: ['$state', '$rootScope', function ($state) {\n let provided = {};\n let transfer = {};\n let hooks = [];\n\n class Sharing {\n get registry() {\n return registry;\n }\n\n items(type, otherwise = []) {\n let values = transfer[type];\n if (values instanceof Array) {\n delete transfer[type];\n return values;\n } else if (values !== undefined) {\n delete transfer[type];\n return [values];\n } else {\n return otherwise;\n }\n }\n\n item(type, otherwise = null) {\n let value = transfer[type];\n if (!(value === undefined || value instanceof Array)) {\n delete transfer[type];\n return value;\n } else {\n return otherwise;\n }\n }\n\n provide(shareable) {\n provided = Object.assign({}, provided, shareable);\n this._triggerOnShareChange();\n }\n\n clearProvisions() {\n provided = {};\n this._triggerOnShareChange();\n }\n\n onShareChange(hookFn) {\n hooks.push(hookFn);\n }\n\n _triggerOnShareChange() {\n let targets = this.targets;\n for (let hookFn of hooks) {\n hookFn(targets);\n }\n }\n\n get targets() {\n return registry.filter(({_name, accept}) =>\n accept.some(({type, multiple}) => provided[type] !== undefined && (multiple || !(provided[type] instanceof Array))));\n }\n\n findTargets(provides, isMultiple = false) {\n return registry.filter(({_name, accept, state}) =>\n !$state.includes(state) && accept.some(({type, multiple}) => type === provides && (multiple || !isMultiple)));\n }\n\n // TODO transfer to $stateParams if receiving state supports it (needs to be specified on register).\n async open(state) {\n transfer = provided;\n // We need to force the relod of the target state if it is same as the current state.\n // It's possible when sharing functionality is used from clipboard.\n await $state.go(state, {}, {reload: true});\n transfer = {};\n }\n\n async share(type, itemOrItems, targetState) {\n provided = {[type]: itemOrItems};\n await this.open(targetState);\n }\n }\n\n return new Sharing();\n }]\n };\n}", "title": "" }, { "docid": "02a90cdb3f4d0bf3a14ad10ae2b23981", "score": "0.42849803", "text": "function share_this_template(template, user){\n\n\tif(setup_ajax()!=false){\n\n\t\tvar url=\"share_this_template.php\";\n\n\t\txmlHttp.open(\"post\",properties_ajax_php_path + url,true);\n\t\txmlHttp.onreadystatechange=share_this_stateChanged;\n\t\txmlHttp.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\n\t\txmlHttp.send('template_id=' + template + '&user_id=' + user);\n\n\t}\n\n}", "title": "" }, { "docid": "f0877b77fd22cdc6723094b22eee8b51", "score": "0.4275181", "text": "function objectAssign(self, use, props, filter){\n\n if(typeof use !== 'boolean'){\n props = use;\n use = true;\n filter = props;\n }\n\n if(!use) return self;\n\n if(typeof filter !== 'function') filter = noop;\n\n if(!Object.defineProperties)\n return defineProperties(self, props, filter);\n\n return addProps(self, props, filter);\n\n}", "title": "" }, { "docid": "867e794bee87f69ef369a9557338de67", "score": "0.4273493", "text": "function GPlusShare() { SocialShare.call(this, arguments); }", "title": "" }, { "docid": "700994a5a20cbf3fb76e1b02bcba1f72", "score": "0.42734575", "text": "function share_on_mastodon(title, url, hashtags) {\n // Prefill the form with the user's previously-specified Mastodon instance, if applicable\n var default_url = localStorage['mastodon_instance'];\n\n // If there is no cached instance/domain, then insert a \"https://\" with no domain at the start of the prompt.\n if (!default_url)\n default_url = \"https://\";\n\n var instance = prompt(\"Enter your instance's address: (ex: https://mastodon.social)\", default_url);\n if (instance) {\n // Handle URL formats\n if ( !instance.startsWith(\"https://\") && !instance.startsWith(\"http://\") )\n instance = \"https://\" + instance;\n\n // Get the current page's URL\n if (!url) var url = window.location.href;\n\n // Get the page title from the og:title meta tag, if it exists.\n // var title = document.querySelectorAll('meta[property=\"og:title\"]')[0].getAttribute(\"content\");\n\n // Otherwise, use the <title> tag as the title\n if (!title) var title = document.getElementsByTagName(\"title\")[0].innerHTML;\n\n // Handle slash\n if ( !instance.endsWith(\"/\") )\n instance = instance + \"/\";\n\n // Cache the instance/domain for future requests\n localStorage['mastodon_instance'] = instance;\n\n // Hashtags\n if (!hashtags) var hashtags = null;\n\n // Tagging users, such as offical accounts or the author of the post\n var author = \"@melody@computerfairi.es\";\n\n // Create the Share URL\n // https://someinstance.tld/share?text=URL%20encoded%20text\n mastodon_url = instance + \"share?text=\" + encodeURIComponent(title + \"\\n\\nby \" + author + \" \" + hashtags + \"\\n\\n\" + url);\n\n // Open a new window at the share location\n console.log(\"Mastodon share URL:\" + mastodon_url);\n window.open(mastodon_url, '_blank');\n }\n}", "title": "" }, { "docid": "2916f4e7505830633885707f14cfda7c", "score": "0.42711833", "text": "function Share(site) {\n if (dojo.coords(\"divAppContainer\").h > 0) {\n dojo.replaceClass(\"divAppContainer\", \"hideContainerHeight\", \"showContainerHeight\");\n dojo.byId('divAppContainer').style.height = '0px';\n\t\t//CanAccess\n\t\tdocument.getElementById('imgShare').setAttribute(\"aria-expanded\",false);\n\t\tdocument.getElementById('imgFacebook').tabIndex=\"-1\";\n\t\tdocument.getElementById('imgTwitter').tabIndex=\"-1\";\n\t\tdocument.getElementById('imgMail').tabIndex=\"-1\";\n\t\tif (timeouts.share != null) {clearTimeout(timeouts.share); timeouts.share = null;}\n\t\ttimeouts.share = setTimeout(function() {\n\t\t\ttimeouts.share = null;\n\t\t\tdojo.byId('divAppContainer').style.display = 'none';\n\t\t},1000);\n }\n //CanMod: Modified to take in strings for post/status/subject in the config file\n if (tinyUrl) {\n\t\tvar ShareURL;\n switch (site) {\n case \"facebook\":\n\t\t\t\tShareURL = mapSharingOptions.FacebookShareURL + \"?\";\n\t\t\t\tShareURL += dojo.objectToQuery({u:tinyUrl});\n window.open(ShareURL);\n break;\n case \"twitter\":\n\t\t\t\tShareURL = mapSharingOptions.TwitterShareURL + \"?\";\n\t\t\t\tShareURL += dojo.objectToQuery({text:mapSharingOptions.TwitterText, url:tinyUrl, related:mapSharingOptions.TwitterFollow, hashtags:mapSharingOptions.TwitterHashtag});\n\t\t\t\twindow.open(ShareURL);\n break;\n case \"mail\":\n\t\t\t\tShareURL = \"mailto:%20?\"\n\t\t\t\tShareURL += dojo.objectToQuery({subject: mapSharingOptions.EmailSubject, body:tinyUrl});\n parent.location = ShareURL;\n break;\n }\n\t//End of CanMod\n } else {\n alert(messages.getElementsByTagName(\"tinyURLEngine\")[0].childNodes[0].nodeValue);\n return;\n }\n}", "title": "" }, { "docid": "93e804486b9772dccf79e865b59140f9", "score": "0.42602533", "text": "function onClick () {\n var sharingSite = element.getAttribute('data-site');\n\n // Получить информацию про страницу\n var url = shareInfo.get('url');\n var title = shareInfo.get('title');\n var desc = shareInfo.get('description');\n var image = shareInfo.get('image');\n\n // Set different URLs for different sharing sites\n var sharingUrl = '';\n switch (sharingSite) {\n case 'vk':\n sharingUrl = 'https://vk.com/share.php?&title=' + title + '&description=' + desc + '&image=' + image + '&noparse=true&url=' + url;\n break;\n case 'twitter':\n sharingUrl = 'https://twitter.com/share?text=' + title + '&url=' + url;\n break;\n case 'facebook':\n sharingUrl = 'https://www.facebook.com/sharer/sharer.php?u=' + url;\n break;\n case 'odnoklassniki':\n sharingUrl = 'http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1&st._surl=' + url + '&st.comments=' + title + '';\n break;\n case 'mail.ru':\n sharingUrl = 'http://connect.mail.ru/share?url=' + url + '&title=' + title + '&description=' + desc + '&imageurl=' + image + '';\n break;\n case 'google+':\n sharingUrl = 'https://plus.google.com/share?url=' + url;\n break;\n case 'tumblr':\n sharingUrl = 'http://www.tumblr.com/share?v=3&t=' + title + '&u=' + url;\n break;\n case 'pinterest':\n sharingUrl = 'http://pinterest.com/pin/create/button/?media=' + image + '&description=' + desc + '&url=' + url;\n break;\n default:\n sharingUrl = sharingSite;\n }\n window.open(sharingUrl, '_blank', \"width=\" + 500 + \", height=\" + 500);\n }", "title": "" }, { "docid": "5ee09871f3987171652517d31b2059d8", "score": "0.4252134", "text": "uploadToSignedUrl(path, token, fileBody, fileOptions) {\n return __awaiter$7(this, void 0, void 0, function* () {\n const cleanPath = this._removeEmptyFolders(path);\n const _path = this._getFinalPath(cleanPath);\n const url = new URL(this.url + `/object/upload/sign/${_path}`);\n url.searchParams.set('token', token);\n try {\n let body;\n const options = Object.assign({ upsert: DEFAULT_FILE_OPTIONS.upsert }, fileOptions);\n const headers = Object.assign(Object.assign({}, this.headers), { 'x-upsert': String(options.upsert) });\n if (typeof Blob !== 'undefined' && fileBody instanceof Blob) {\n body = new FormData();\n body.append('cacheControl', options.cacheControl);\n body.append('', fileBody);\n }\n else if (typeof FormData !== 'undefined' && fileBody instanceof FormData) {\n body = fileBody;\n body.append('cacheControl', options.cacheControl);\n }\n else {\n body = fileBody;\n headers['cache-control'] = `max-age=${options.cacheControl}`;\n headers['content-type'] = options.contentType;\n }\n const res = yield this.fetch(url.toString(), {\n method: 'PUT',\n body: body,\n headers,\n });\n if (res.ok) {\n return {\n data: { path: cleanPath },\n error: null,\n };\n }\n else {\n const error = yield res.json();\n return { data: null, error };\n }\n }\n catch (error) {\n if (isStorageError(error)) {\n return { data: null, error };\n }\n throw error;\n }\n });\n }", "title": "" }, { "docid": "e84fecf4146215995ba216eab3eecdce", "score": "0.42479032", "text": "function shareLink(site) {\r\n if (site === \"fb\") {\r\n bitlyURL(shareURL, setFBLink);\r\n }\r\n if (site === \"tw\") {\r\n bitlyURL(shareURL, setTWLink);\r\n }\r\n}", "title": "" }, { "docid": "15a83e92a2a52b345674a33dc6406507", "score": "0.42423132", "text": "function merge() {\n var i,\n args = arguments,\n len,\n ret = {},\n doCopy = function (copy, original) {\n var value, key;\n\n // An object is replacing a primitive\n if (typeof copy !== 'object') {\n copy = {};\n }\n\n for (key in original) {\n if (original.hasOwnProperty(key)) {\n value = original[key];\n\n // Copy the contents of objects, but not arrays or DOM nodes\n if (value && typeof value === 'object' && Object.prototype.toString.call(value) !== '[object Array]' &&\n key !== 'renderTo' && typeof value.nodeType !== 'number') {\n copy[key] = doCopy(copy[key] || {}, value);\n\n // Primitives and arrays are copied over directly\n } else {\n copy[key] = original[key];\n }\n }\n }\n return copy;\n };\n\n // If first argument is true, copy into the existing object. Used in setOptions.\n if (args[0] === true) {\n ret = args[1];\n args = Array.prototype.slice.call(args, 2);\n }\n\n // For each argument, extend the return\n len = args.length;\n for (i = 0; i < len; i++) {\n ret = doCopy(ret, args[i]);\n }\n\n return ret;\n }", "title": "" }, { "docid": "c5f31203a2f02aa2a837dfeefb3daf56", "score": "0.42407537", "text": "async share(payload, rootState) {\n console.log('Simulating share..');\n await new Promise((resolve) => setTimeout(resolve, 3000));\n console.log('Sharing done..');\n }", "title": "" }, { "docid": "4bf210c9f9ce20d8db039595169f8b43", "score": "0.42386734", "text": "copy(fromPath, toPath) {\n return __awaiter$7(this, void 0, void 0, function* () {\n try {\n const data = yield post(this.fetch, `${this.url}/object/copy`, { bucketId: this.bucketId, sourceKey: fromPath, destinationKey: toPath }, { headers: this.headers });\n return { data: { path: data.Key }, error: null };\n }\n catch (error) {\n if (isStorageError(error)) {\n return { data: null, error };\n }\n throw error;\n }\n });\n }", "title": "" }, { "docid": "5dcebb441652fd994050db0e877c0cb1", "score": "0.42367738", "text": "function saveShareInfo(e) {\n var share = $('#share_info').prop('checked');\n\n setShareInfoState(undefined);\n $.ajax({url: '/api/share', type: 'put', dataType: 'json', data: JSON.stringify(share)})\n .then(function() {\n setShareInfoState(share);\n })\n .fail(function() {\n alert('Could not save preference. Report this as a bug!');\n });\n}", "title": "" }, { "docid": "f8cf6d8dad28cea6c758285e5215794a", "score": "0.4235433", "text": "share(e) {\n\t\t// if iOS share URL has been set then use timeout hack\n\t\t// test for native app and fall back to web\n\t\tif (this.mobileShareUrl) {\n\t\t\tvar start = (new Date()).valueOf();\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tvar end = (new Date()).valueOf();\n\n\t\t\t\t// if the user is still here, fall back to web\n\t\t\t\tif (end - start > 1600) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twindow.location = this.shareUrl;\n\t\t\t}, 1500);\n\n\t\t\twindow.location = this.mobileShareUrl;\n\n\t\t// open mailto links in same window\n\t\t} else if (this.type === 'email') {\n\t\t\twindow.location = this.shareUrl;\n\n\t\t// open social share URLs in new window\n\t\t} else {\n\t\t\tlet windowOptions = false;\n\n\t\t\t// if popup object present then set window dimensions / position\n\t\t\tif(this.popup && this.transformData.popup) {\n\t\t\t\twindowOptions = this.transformData.popup;\n\t\t\t}\n\n\t\t\tthis.openWindow(this.shareUrl, windowOptions);\n\t\t}\n\t}", "title": "" }, { "docid": "49e0b15885473c5f77fe516afdf99fc4", "score": "0.42269218", "text": "function share(action){\n\tvar loc = location.href\n\tloc = loc.substring(0, loc.lastIndexOf(\"/\") + 1);\n\tvar title = shareTitle.replace(\"[SCORE]\", playerData[0].gameScore);\n\tvar text = shareMessage.replace(\"[SCORE]\", playerData[0].gameScore);\n\tvar shareurl = '';\n\t\n\tif( action == 'twitter' ) {\n\t\tshareurl = 'https://twitter.com/intent/tweet?url='+loc+'&text='+text;\n\t}else if( action == 'facebook' ){\n\t\tshareurl = 'https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(loc+'share.php?desc='+text+'&title='+title+'&url='+loc+'&thumb='+loc+'share.jpg&width=590&height=300');\n\t}else if( action == 'google' ){\n\t\tshareurl = 'https://plus.google.com/share?url='+loc;\n\t}\n\t\n\twindow.open(shareurl);\n}", "title": "" }, { "docid": "c589d1ebfdd0e665fca370f290555a0d", "score": "0.42268112", "text": "function o(){return o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},o.apply(this,arguments)}", "title": "" } ]
3dc8a6eb68d0039de67a00c7de8c4c49
Matrix > Vector > Vector
[ { "docid": "67392d2d52df0892f99d3d6a13b190f1", "score": "0.6657332", "text": "function vectorTransform(m, v) {\n var w = m.map(function(e) {\n return innerProduct(e, v).reduce((t, v) => t + v)\n }) ; return w\n}", "title": "" } ]
[ { "docid": "2b8e3a8d111f1cdd9c4664a3421864dc", "score": "0.7044515", "text": "function multVecByMat(vector, matrix)\n{\n\t var newVector = new Vector(0,0,0);\n\t \n var a = vector.x * matrix[0][0];\n var b = vector.y * matrix[0][1];\n var c = vector.z * matrix[0][2];\n newVector.x = a+b+c;\n\n a = vector.x * matrix[1][0];\n b = vector.y * matrix[1][1];\n c = vector.z * matrix[1][2];\n newVector.y = a+b+c;\n\n a = vector.x * matrix[2][0];\n b = vector.y * matrix[2][1];\n c = vector.z * matrix[2][2];\n newVector.z = a+b+c;\n \n return newVector;\n}", "title": "" }, { "docid": "225022e274e7b355e824f2cc3d2520e8", "score": "0.6679237", "text": "function mat2()\n{\n var v = _argumentsToArray( arguments );\n\n var m = [];\n switch ( v.length ) {\n case 0:\n v[0] = 1;\n case 1:\n m = [\n vec2( v[0], 0.0 ),\n vec2( 0.0, v[0] )\n ];\n break;\n\n default:\n m.push( vec2(v) ); v.splice( 0, 2 );\n m.push( vec2(v) );\n break;\n }\n\n m.matrix = true;\n\n return m;\n}", "title": "" }, { "docid": "04fb283d46da9432dbc5acc15229b1c6", "score": "0.66568047", "text": "function ssm(v) {\n\n var v0 = math.subset(v, math.index(0));\n var v1 = math.subset(v, math.index(1));\n var v2 = math.subset(v, math.index(2));\n\n return math.matrix([\n \t\t\t\t\t[0, -v2, v1],\n \t\t\t\t\t[v2, 0, -v0],\n \t\t\t\t\t[-v1, v0, 0],\n \t]);\n}", "title": "" }, { "docid": "91a1a4570f3d25cc1b2097b06cb76d54", "score": "0.66552866", "text": "function vectorize(array) {\n\t\treturn array.length == 0 ? math.matrix() : math.matrix([array]).transpose();\n\t}", "title": "" }, { "docid": "4bcd3d391f76ea418330dfdf8661575f", "score": "0.6497828", "text": "function Vector() {\n // ensure that all parameters are numbers.\n if (arguments.length == 0) {\n throw `Vector(${arguments}): expected at least 1 argument.`;\n }\n for (var i = 0; i < arguments.length; i++) {\n if (isNaN(arguments[i])) {\n throw `Vector(${arguments}): expected numbers but got: ${arguments[i]}`;\n }\n }\n\n const floatEquals = (a, b) => Math.abs(a - b) < 1e-16;\n const throwIfNotVector = (v) => {\n if (!isCreatedFrom(v, Vector)) {\n throw `Expected a vector but got: ${v}`;\n }\n }\n const throwIfNotSameDimension = (v) => {\n if (v.dim() != this.dim()) {\n throw `Expected vector dimension equals to ${this.dim()} but got ${v.dim()}`;\n }\n }\n const elementWiseOperation = (v1, v2, operator) => {\n return zip(v1._values, v2._values).map((z) => operator(z[0], z[1]));\n }\n\n\n this._values = [...arguments];\n\n this.dim = function() {\n return this._values.length;\n }\n\n this.toString = function() {\n return '[' + this._values + ']';\n }\n\n this.magnitude = function() {\n return Math.sqrt(this._values.reduce(\n (total, current) => { return total + current * current }, 0));\n }\n\n this.normalize = function() {\n const mag = this.magnitude();\n const new_values = this._values.map((v) => v / mag);\n return new Vector(...new_values);\n }\n\n this.equals = function(v) {\n throwIfNotVector(v);\n if (this.dim() != v.dim()) {\n return false;\n }\n return elementWiseOperation(this, v, floatEquals).reduce(\n (p, c) => p && c);\n }\n\n this.add = function(v) {\n throwIfNotVector(v);\n throwIfNotSameDimension(v);\n const new_values = elementWiseOperation(this, v, (a, b) => a + b);\n return new Vector(...new_values);\n }\n\n this.sub = function(v) {\n throwIfNotVector(v);\n throwIfNotSameDimension(v);\n const new_values = elementWiseOperation(this, v, (a, b) => a - b);\n return new Vector(...new_values);\n }\n\n this.scale = function(lambda) {\n throwIfNaN(lambda);\n const new_values = this._values.map((v) => v * lambda);\n return new Vector(...new_values);\n }\n\n this.dot = function(v) {\n throwIfNotVector(v);\n throwIfNotSameDimension(v);\n return sum(elementWiseOperation(this, v, (a, b) => a * b));\n }\n\n this.elements = () => this._values;\n}", "title": "" }, { "docid": "a602934bc06f32b26226a062af09a822", "score": "0.64595604", "text": "function mult_matrix (firstVector, secondVector){\n var rv = new Matrix();\n\n for (var i = 0; i < 3; i++){\n\n rv[i].x =\t(first[0].x * second[i].x) +\n\t\t\t\t \t(first[1].x * second[i].y) +\n\t\t\t\t\t(first[2].x * second[i].z);\n\n rv[i].y =\t(first[0].y * second[i].x) +\n\t\t\t\t\t(first[1].y * second[i].y) +\n\t\t\t\t\t(first[2].y * second[i].z);\n\n rv[i].z =\t(first[0].z * second[i].x) +\n\t\t\t\t\t(first[1].z * second[i].y) +\n\t\t\t\t\t(first[2].z * second[i].z);\n }\n\n for (i = 0; i < 3; i++){\n first[i] = rv[i];\n }\n}", "title": "" }, { "docid": "d77c41592bc578399fddd9a0aa568ae7", "score": "0.64411247", "text": "function vectorMultiplyMatrix(a, B) {\n\t//var A_x = 1;\n\tvar A_y = a.length;\n\tvar B_x = B.length;\n\tvar B_y = B[0].length;\n\t\n\tif (B_x != A_y) {\n\t\talert(\"Matrix inner dimensions must agree\");\n\t\treturn;\n\t}\n\t\t\n\tvar v = new Array(B_y);\n\tfor (var j = 0; j < B_y; j++) {\n\t\tv[j] = 0;\n\t}\n\t\t\n\tfor (var i = 0; i < A_y; i++) {\n\t\tvar Browi = B[i];\n\t\tfor (var j = 0; j < B_y; j++) {\n\t\t\tif (a[i] == 0) {\n\t\t\t\t//v[j] += 0;\n\t\t\t} else if (a[i] == 1) {\n\t\t\t\tv[j] += Browi[j];\t\n\t\t\t} else if (a[i] == -1) {\n\t\t\t\tv[j] -= Browi[j];\n\t\t\t} else {\n\t\t\t\tv[j] += a[i] * Browi[j];\n\t\t\t}\n\t\t}\n\t}\n\treturn v;\n}", "title": "" }, { "docid": "87584bca4c9969c9ff576cd841d49ac3", "score": "0.6428255", "text": "function _multiplyVector (matrix,vector) {\n\n if(matrix.columns != vector.length)\n throw new Error('statscript.matrix.multiplyVector: dim mismatch');\n\n return _ss.generate(matrix.rows, function (rw) {\n var r = matrix.row(rw);\n return _ss.sum(_ss.zipWith(vector, r, function (a,b) {\n return a * b;\n }));\n });\n}", "title": "" }, { "docid": "6fb92cffc4b19af1e3ccf0097f33d8e9", "score": "0.6401896", "text": "function transformVector(matrix, vector) {\n // Handle non-invertible matrix\n if (!matrix) {\n return null;\n }\n\n var result = gl_matrix_vec4__WEBPACK_IMPORTED_MODULE_0__[\"transformMat4\"]([0, 0, 0, 0], vector, matrix);\n var scale = 1 / result[3];\n gl_matrix_vec4__WEBPACK_IMPORTED_MODULE_0__[\"multiply\"](result, result, [scale, scale, scale, scale]);\n return result;\n} // Helper, avoids low-precision 32 bit matrices from gl-matrix mat4.create()", "title": "" }, { "docid": "616a225e2791b1d1c08e17da335106b1", "score": "0.6383865", "text": "toVector() {\r return new Vector(this.X, this.Y);\r }", "title": "" }, { "docid": "a0d1abb3fabfed2eb3fa2080e2c565e1", "score": "0.6382534", "text": "function multiply(matrix, vector) {\n var newVector = []\n for (var ii = 0; ii < matrix.length; ii++) {\n var total = 0;\n for (var jj = 0; jj < vector.length; jj++) {\n total += matrix[ii][jj]*vector[jj];\n }\n newVector.push(Math.round(total*10000)/10000)\n }\n return newVector\n}", "title": "" }, { "docid": "4ffcbb7c2b790b8af4d35914437f0a53", "score": "0.63742644", "text": "function matrixVectorMultiply4(matrix, vector) {\n\tvar result = [];\n\tfor (var i = 0; i < 4; i++) {\n\t\tvar sum = 0;\n\t\tfor (var j = 0; j < 4; j++) {\n\t\t\tsum += (matrix[i*4+j] * vector[j]);\n\t\t}\n\t\tresult[i] = sum;\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "c4c1ece485f298b140780382acbc790f", "score": "0.63485074", "text": "function M(a){\n return {type: \"matrix\", data: a};\n }", "title": "" }, { "docid": "9ed779652229b4ffa06ee382e38147ca", "score": "0.6347778", "text": "function multiplyMV(mat,vec) {\n let v = vec.toArray();\n if (mat.values[0].length!=v.length) {\n return null;\n }\n let result=[];\n for (let i=0;i<v.length;i++) {\n result.push(0);\n }\n let values = mat.values;\n for (let i=0; i<values.length; i++) {\n for (let j=0; j<values[i].length; j++) {\n result[i] += values[i][j] * v[j];\n }\n }\n return result;\n}", "title": "" }, { "docid": "08e45996cba8094aa9fed6d3da9aa04d", "score": "0.63401717", "text": "toMatrix() {\n if (this[0].length === 1) return;\n return [...this].map(coordinate => [coordinate]);\n }", "title": "" }, { "docid": "1f4d07cc7926456f63160514d4d65dd6", "score": "0.6339181", "text": "function multVecMatrix(m, x, y)\n{\n return [x*m[0] + y*m[1] + m[2],\n\t x*m[3] + y*m[4] + m[5]];\n}", "title": "" }, { "docid": "33807af45afd0c970c1dabfcf2f9f295", "score": "0.63105357", "text": "function mat3_transform(m, v) {\r\n return [m[0] * v[0] + m[1] * v[1] + m[2] * v[2],\r\n m[3] * v[0] + m[4] * v[1] + m[5] * v[2],\r\n m[6] * v[0] + m[7] * v[1] + m[8] * v[2]];\r\n}", "title": "" }, { "docid": "877083ba6468c8e3ab0e7c24d30ccfab", "score": "0.62952447", "text": "function VecMath() {\n\n // converts a number to a string.\n function number2string(value, digits) {\n\tif( !digits )\n\t digits = 6;\n\tvar result = '';\n\tif( value < 0 ) {\n\t result = '-';\n\t value = -value;\n\t}\n\tvar x = Math.pow(10,digits)\n\tvar first = true;;\n\tfor( var ii = 0; ii < 2*digits; ii++ ) {\n\t var res = Math.floor(value/x)%10;\n\t if( first && x > 1 && res == 0 )\n\t\t;\n\t else {\n\t\tresult = result + res;\n\t\tfirst = false;\n\t }\n\t if( x == 1 )\n\t\tresult = result + '.';\n\t x /= 10;\n\t}\n\treturn result;\n }\n\n // converts a matrix to a CSS matrix3d() directive\n function matrix2transform(m, round) {\n\t// WebKitCSSMatrix only available on webkit browsers\n\tif( typeof WebKitCSSMatrix != 'undefined' ) {\n\t var mat = new WebKitCSSMatrix();\n\t mat.m11 = m[0];\n\t mat.m21 = m[1];\n\t mat.m31 = m[2];\n\t mat.m41 = m[3];\n\t mat.m12 = m[4];\n\t mat.m22 = m[5];\n\t mat.m32 = m[6];\n\t mat.m42 = m[7];\n\t mat.m13 = m[8];\n\t mat.m23 = m[9];\n\t mat.m33 = m[10];\n\t mat.m43 = m[11];\n\t mat.m14 = m[12];\n\t mat.m24 = m[13];\n\t mat.m34 = m[14];\n\t mat.m44 = m[15];\n\t return mat.toString();\n\t} else {\n\t var m2 = [];\n\t for( var mi = 0; mi < 16; mi++ )\n\t\tm2.push(number2string(m[mi]));\n\t m = m2;\n\t var matrix = 'matrix3d(' + m[0] + ',' + m[4] + ',' + m[8] + ',' + m[12] + ',' +\n\t\tm[1] + ',' + m[5] + ',' + m[9] + ',' + m[13] + ',' +\n\t\tm[2] + ',' + m[6] + ',' + m[10] + ',' + m[14] + ',' +\n\t\tm[3] + ',' + m[7] + ',' + m[11] + ',' + m[15] + ')';\n\t return matrix;\n\t}\n }\n\n // dot product\n function dotp(vec1, vec2) {\n\treturn vec1.x * vec2.x +\n\t vec1.y * vec2.y +\n\t vec1.z * vec2.z;\n }\n \n // cross product\n function crossp(vec1, vec2) {\n\treturn { x: vec1.y * vec2.z - vec1.z * vec2.y,\n\t\t y: vec1.z * vec2.x - vec1.x * vec2.z,\n\t\t z: vec1.x * vec2.y - vec1.y * vec2.x };\n }\n \n // vector length\n function veclength(vec) {\n\treturn Math.sqrt(vec.x*vec.x+vec.y*vec.y+vec.z*vec.z);\n }\n\n // returns a vector scaled by a factor\n function vecscale(vec, scale) {\n\treturn { x: vec.x * scale,\n\t\t y: vec.y * scale,\n\t\t z: vec.z * scale };\n }\n \n // returns a vector scaled to given length, by default 1\n function normalize(vec, length) {\n\tif( length == null )\n\t length = 1.0;\n\tvar len = length / Math.sqrt(vec.x*vec.x+vec.y*vec.y+vec.z*vec.z);\n\treturn { x: vec.x * len,\n\t\t y: vec.y * len,\n\t\t z: vec.z * len };\n }\n\n // returns sum of two vectors\n function sum(v1, v2) {\n\treturn { x: v1.x + v2.x,\n\t\t y: v1.y + v2.y,\n\t\t z: v1.z + v2.z };\n }\n\t\n // returns the difference between two vectors\n function difference(from, to) {\n\treturn { x: to.x - from.x,\n\t\t y: to.y - from.y,\n\t\t z: to.z - from.z };\n }\n \n // matrix-vector multiplication, returns the result vector\n function multiply(matrix, point) {\n\tif( matrix == null ) {\n\t matrix = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ];\n\t}\n\treturn { x: matrix[0] * point.x + matrix[1] * point.y + matrix[2] * point.z + matrix[3],\n\t\t y: matrix[4] * point.x + matrix[5] * point.y + matrix[6] * point.z + matrix[7],\n\t\t z: matrix[8] * point.x + matrix[9] * point.y + matrix[10] * point.z + matrix[11],\n\t\t w: matrix[12] * point.x + matrix[13] * point.y + matrix[14] * point.z + matrix[15] * (point.w ? point.w : 1) }\n }\n \n // matrix-matrix multiplication, returns the resulting matrix\n function matrixmultiply(m1, m2) {\n\tvar result = [];\n\tfor( var i = 0; i < 4; i++ )\n\t for( var j = 0; j < 4; j++ ) {\n\t\tresult.push(m1[4*i]*m2[j] +\n\t\t\t m1[4*i+1]*m2[j+4] +\n\t\t\t m1[4*i+2]*m2[j+8] +\n\t\t\t m1[4*i+3]*m2[j+12]);\n\t }\n\treturn result;\n }\n \n // defines a plane by 3 points on that plane\n function createplane(p1, p2, p3) {\n\tvar normal = normalize(crossp(difference(p2, p1),\n\t difference(p2, p3)));\n\treturn {\n\t a: normal.x,\n\t b: normal.y,\n\t c: normal.z,\n\t d: -dotp(p1, normal)\n\t};\n }\n\n // tests whether a point is \"inside\" the plane, \"inside\" meaning that this function returns true if the \n // point is on that side of plane where its normal points to\n function inside(point, plane) {\n\tif( plane.a * point.x + plane.b * point.y + \n\t plane.c * point.z + plane.d >= 0 )\n\t return true;\n\treturn false;\n }\n \n // calculates the intersection of a line defined by two points, and a plane\n function intersect(p1, p2, plane) {\n\tvar dp = difference(p1,p2);\n\t\n\tif( plane.c != 0 )\n\t var p0 = { x: 0, y: 0, z: -plane.d/plane.c };\n\telse if( plane.b != 0 )\t\t \n\t var p0 = { x: 0, y: -plane.d/plane.b, z: 0 };\n\telse\n\t var p0 = { x: -plane.d/plane.a, y: 0, z: 0 };\n\t\n\tvar pnormal = { x: plane.a, y: plane.b, z: plane.c };\n\tvar t = dotp(difference(p1, p0), pnormal) / \n\t dotp(dp, pnormal);\n\t\n\treturn sum(p1, vecscale(dp, t));\n }\n \n // projects a point to a plane\n function project(point, plane) {\n\t//(p-p0)n=0\n\t//p+tn=point\n\t//p = point-tn\n\t//(point-tn)n-p0n=0\n\t//t = (p0n-pointn)/(-nn)\n\t\n\tif( plane.c != 0 )\n\t var p0 = { x: 0, y: 0, z: -plane.d/plane.c };\n\telse if( plane.b != 0 )\t\t \n\t var p0 = { x: 0, y: -plane.d/plane.b, z: 0 };\n\telse\n\t var p0 = { x: -plane.d/plane.a, y: 0, z: 0 };\n\tvar pnormal = { x: plane.a, y: plane.b, z: plane.c };\n\t\n\tvar t = dotp(p0, pnormal)-dotp(point, pnormal);\n\tt /= -dotp(pnormal, pnormal);\n\t\n\treturn sum(point, vecscale(pnormal, -t));\n }\n\n // rotates a point around a given axis (axis going through the origin), angle in rad\n function rotateaxis(point, axis, angle) {\n\tvar x = axis.x;\n\tvar y = axis.y;\n\tvar z = axis.z;\n\tvar cosa = Math.cos(angle);\n\tvar sina = Math.sin(angle);\n\t\n\tvar rotmatrix = [\n\t cosa + x*x*(1-cosa), x*y*(1-cosa)-z*sina, x*z*(1-cosa)+y*sina, 0,\n\t x*y*(1-cosa)+z*sina, cosa+y*y*(1-cosa), y*z*(1-cosa)-x*sina, 0,\n\t x*z*(1-cosa)-y*sina, y*z*(1-cosa)+x*sina, cosa+z*z*(1-cosa), 0,\n\t 0, 0, 0, 1\n\t];\n\treturn multiply(rotmatrix, point);\n }\n\n var sqrt2 = Math.sqrt(2);\n // projects a point within a plane \"radially\", meaning that it calculate the intersection of the \n // plane and a line going through the origin and give point. If the point is on the \"wrong\" side \n // of origin and the line points away, returns null\n function projectradial(point, plane, threshold) {\n\n\tvar rotated = false;\n\tpoint = normalize(point);\n\tvar normal = { x: plane.a, y: plane.b, z: plane.c };\n\tvar cosangle = dotp(point, normal);\n\tif( cosangle < 0 ) {\n\t return null; // other side of globe\n\t} else if( cosangle < 1.0/sqrt2 ) { // 45 degrees\n\t var angle = Math.acos(cosangle);\n\t var axis = normalize(crossp(point, normal));\n\t point = rotateaxis(point, axis, angle - Math.PI/4); \n\t cosangle = dotp(point, normal);\n\t rotated = true;\n\t}\n\n\t// point * scale = p\n\t// (p-p0)n = 0\n\t// (point*scale)n -p0n = 0\n\t// scale = p0 n / point n\n\n\tvar normal = { x: plane.a, y: plane.b, z: plane.c };\n\tvar scale = -plane.d / cosangle;\n\tvar result = vecscale(point, scale);\n\tif( rotated )\n\t result.rotated = true;\n\treturn result;\n }\n\n // clips a point on a plane \"radially\", meaning that it projects the point, \n // which is already on the plane, to a circular radius from given origin. If the \n // point is already inside that radius, returns the original point\n function clipradius(origin, from, to, radius) {\n\n\tif( from == null )\n\t return sum(origin, normalize(difference(origin, to), radius));\n\n\tvar origin2from = difference(origin, from);\n\tvar origin2from1 = normalize(origin2from);\n\tvar origin2to = difference(origin, to);\n\tvar origin2to1 = normalize(origin2to);\n\tvar from2to = difference(from, to);\n\tvar from2to1 = normalize(from2to);\n\t\n\tvar origin2fromlen = veclength(origin2from);\n\tvar origin2tolen = veclength(origin2to);\n\tvar from2tolen = veclength(from2to);\n\t\n\tvar cosalfa = dotp(vecscale(origin2from1,-1), from2to1);\n\t\t\n\t// radius * radius = x*x + origin2fromlen * origin2fromlen - 2 * origin2fromlen * x * cosalfa\n\t\t\n\tvar a = 1, \n\t b = -2 * origin2fromlen * cosalfa,\n\t c = origin2fromlen * origin2fromlen - radius * radius;\n\t\n\tvar det = b * b - 4 * a * c;\n\tif( det < 0 ) \n\t return null;\n\t\n\tvar d1 = (-b + Math.sqrt(det)) / (2*a);\n\tvar d2 = (-b - Math.sqrt(det)) / (2*a);\n\t\n\tif( d1 < 0 )\n\t d1 = 10000;\n\tif( d2 < 0 )\n\t d2 = 10000;\n\td1 = Math.min(d1,d2);\n\treturn sum(from, vecscale(from2to1, d1));\n\t\n\tvar p1 = sum(from, vecscale(from2to1, d1));\n\tvar p2 = sum(from, vecscale(from2to1, d2));\n\t\n\tprintvec('p1', p1);\n\tprintvec('p2', p2);\n\t\n\tvar rad1 = veclength(difference(origin, p1));\n\tvar rad2 = veclength(difference(origin, p2));\n\t\n\tprintval('rad1', rad1);\n\tprintval('rad2', rad2);\n\t\n\tvar raddiff1 = Math.abs(rad1 - radius);\n\tvar raddiff2 = Math.abs(rad2 - radius);\n\t\n\tif( raddiff1 < raddiff2 ) \n\t return p1;\n\telse\n\t return p2;\n }\n\n // NOT USED ANYWHERE AT THIS POINT; PROBABLY WORKS THOUGH\n function projectangular(point, plane, projplane, negate) {\n\n\tvar shiftplane = { a: projplane.a,\n\t b: projplane.b,\n\t c: projplane.c }\n\tshiftplane.d = -dotp({ x: projplane.a,\n\t\t\t y: projplane.b,\n\t\t\t z: projplane.c },\n\t\t\t point);\n\t\n\tvar pproj = point;//project(point, shiftplane);\n\t\n\tvar origin = project({x:0,y:0,z:0}, shiftplane);\n\t\n\tvar dist = veclength(difference(pproj, origin));\n\t\n\tvar projdir = normalize(crossp(\n\t { x: shiftplane.a,\n\t y: shiftplane.b,\n\t z: shiftplane.c },\n\t { x: plane.a,\n\t y: plane.b,\n\t z: plane.c }));\n\t\n\tif( negate )\n\t dist = -dist;\n\t\n\tvar projected = sum(origin, vecscale(projdir, dist));\n\treturn projected;\n }\n\n // returns set of functions\n return {\n\tmatrix2transform: matrix2transform,\n\tdotp: dotp,\n\tcrossp: crossp,\n\tveclength: veclength,\n\tvecscale: vecscale,\n\tnormalize: normalize,\n\tsum: sum,\n\tdifference: difference,\n\tmultiply: multiply,\n\trotateaxis: rotateaxis,\n\tmatrixmultiply: matrixmultiply,\n\tcreateplane: createplane,\n\tinside: inside,\n\tintersect: intersect,\n\tproject: project,\n\tprojectradial: projectradial,\n\tclipradius: clipradius\n };\n}", "title": "" }, { "docid": "ed3cc2b716b02abfe92a97778599e59e", "score": "0.6246001", "text": "static transpose(matrix){\n \tlet height = matrix.length\n let width = matrix[0].length\n if(width == undefined){\n \twidth = height\n \theight = 1\n matrix = [matrix]\n }\n let result = Vector.make_matrix(width, height)\n for(var i = 0; i < width; i++){\n \tfor(var j = 0; j < height; j++){\n \t\tresult[i][j] = matrix[j][i]\n \t}\n }\n if(result.length == 1){\n \treturn result[0]\n }else{\n \treturn result\n }\n }", "title": "" }, { "docid": "8116a81c79420344d2b0d68e259a9073", "score": "0.6240145", "text": "function multMatVec(u, v) {\n var result = [];\n\n for (var i = 0; i < u.length; ++i) {\n var sum = 0;\n for (var j = 0; j < u.length; j++)\n sum += u[i][j] * v[j];\n result.push(sum);\n }\n return result;\n}", "title": "" }, { "docid": "d38da9ec42f5ac9b36e74e571873f788", "score": "0.6226693", "text": "function multiply(m, v) {\n var result = [];\n for (var i = 0; i < v.length; i++) {\n var element = 0;\n for (var j = 0; j < v.length; j++) {\n element += m[i][j] * v[j];\n }\n result.push(element);\n }\n return vec4(result);\n}", "title": "" }, { "docid": "27c64baaa1fd52dd4de6170395d4e425", "score": "0.62259626", "text": "function VMulti(M, V) {\n var Vect = new Array();\n var i = 0;\n for (; i < 4; i++) Vect[i] = M[i][0] * V[0] + M[i][1] * V[1] + M[i][2] * V[2] + M[i][3] * V[3];\n return Vect;\n}", "title": "" }, { "docid": "7ea6536b36307d507e9334eda7d51120", "score": "0.6143278", "text": "static inverse(matrix){\n \tlet result\n \tlet dim = Vector.matrix_dimensions(matrix)\n if (dim[0] == 2 && dim[1] == 2){\n \tresult = [[matrix[1][1], -matrix[1][0]], [-matrix[0][1], matrix[0][0]]]\n result = Vector.multiply(1/Vector.determinant(matrix), result)\n }else if(dim[0] == 3 && dim[1] == 3){\n \t//Source: University of Massachusetts Lowell - MECH 5960 Mechanics of Composite Materials\n \tlet a, b, c, d, e, f, g, h, i, A, B, C, D, E, F, G, H, I\n a = matrix[0][0]\n b = matrix[0][1]\n c = matrix[0][2]\n d = matrix[1][0]\n e = matrix[1][1]\n f = matrix[1][2]\n g = matrix[2][0]\n h = matrix[2][1]\n i = matrix[2][2]\n \n A = Vector.determinant([[e, f], [h, i]])\n B = -Vector.determinant([[d, f], [g, i]])\n C = Vector.determinant([[d, e], [g, h]])\n D = -Vector.determinant([[b, c], [h, i]])\n E = Vector.determinant([[a, c], [g, i]])\n F = -Vector.determinant([[a, b], [g, h]])\n G = Vector.determinant([[b, c], [e, f]])\n H = -Vector.determinant([[a, c], [d, f]])\n I = Vector.determinant([[a, b], [d, e]])\n \n result = [[A, B, C], [D, E, F], [G, H, I]]\n result = Vector.multiply(1/Vector.determinant(matrix), result)\n }else if(dim[0] == 4 && dim[1] == 4){\n \t// Source: http://www.cg.info.hiroshima-cu.ac.jp/~miyazaki/knowledge/teche23.html\n let a11, a12, a13, a14, a21, a22, a23, a24, a31, a32, a33, a34, a41, a42, a43, a44\n let b11, b12, b13, b14, b21, b22, b23, b24, b31, b32, b33, b34, b41, b42, b43, b44\n a11 = matrix[0][0]\n a12 = matrix[0][1]\n a13 = matrix[0][2]\n a14 = matrix[0][3]\n a21 = matrix[1][0]\n a22 = matrix[1][1]\n a23 = matrix[1][2]\n a24 = matrix[1][3]\n a31 = matrix[2][0]\n a32 = matrix[2][1]\n a33 = matrix[2][2]\n a34 = matrix[2][3]\n a41 = matrix[3][0]\n a42 = matrix[3][1]\n a43 = matrix[3][2]\n a44 = matrix[3][3]\n \t\n b11 = a22*a33*a44 + a23*a34*a42 + a24*a32*a43 - a22*a34*a43 - a23*a32*a44 - a24*a33*a42\n b12 = a12*a34*a43 + a13*a32*a44 + a14*a33*a42 - a12*a33*a44 - a13*a34*a42 - a14*a32*a43\n b13 = a12*a23*a44 + a13*a24*a42 + a14*a22*a43 - a12*a24*a43 - a13*a22*a44 - a14*a23*a42\n b14 = a12*a24*a33 + a13*a22*a34 + a14*a23*a32 - a12*a23*a34 - a13*a24*a32 - a14*a22*a33\n \n b21 = a21*a34*a43 + a23*a31*a44 + a24*a33*a41 - a21*a33*a44 - a23*a34*a41 - a24*a31*a43\n b22 = a11*a33*a44 + a13*a34*a41 + a14*a31*a43 - a11*a34*a43 - a13*a31*a44 - a14*a33*a41\n b23 = a11*a24*a43 + a13*a21*a44 + a14*a23*a41 - a11*a23*a44 - a13*a24*a41 - a14*a21*a43\n b24 = a11*a23*a34 + a13*a24*a31 + a14*a21*a33 - a11*a24*a33 - a13*a21*a34 - a14*a23*a31\n \n b31 = a21*a32*a44 + a22*a34*a41 + a24*a31*a42 - a21*a34*a42 - a22*a31*a44 - a24*a32*a41\n b32 = a11*a34*a42 + a12*a31*a44 + a14*a32*a41 - a11*a32*a44 - a12*a34*a41 - a14*a31*a42\n b33 = a11*a22*a44 + a12*a24*a41 + a14*a21*a42 - a11*a24*a42 - a12*a21*a44 - a14*a22*a41\n b34 = a11*a24*a32 + a12*a21*a34 + a14*a22*a31 - a11*a22*a34 - a12*a24*a31 - a14*a21*a32\n \n b41 = a21*a33*a42 + a22*a31*a43 + a23*a32*a41 - a21*a32*a43 - a22*a33*a41 - a23*a31*a42\n b42 = a11*a32*a43 + a12*a33*a41 + a13*a31*a42 - a11*a33*a42 - a12*a31*a43 - a13*a32*a41\n b43 = a11*a23*a42 + a12*a21*a43 + a13*a22*a41 - a11*a22*a43 - a12*a23*a41 - a13*a21*a42\n b44 = a11*a22*a33 + a12*a23*a31 + a13*a21*a32 - a11*a23*a32 - a12*a21*a33 - a13*a22*a31\n \n result = [[b11, b12, b13, b14], [b21, b22, b23, b24], [b31, b32, b33, b34], [b41, b42, b43, b44]]\n result = Vector.multiply(1/Vector.determinant(matrix),result)\n }else{\n \tresult = matrix_invert(matrix)\n }\n return result\n }", "title": "" }, { "docid": "5088e65e93aafa04cca20265f919057f", "score": "0.6117602", "text": "function Matrix2D() {\n}", "title": "" }, { "docid": "642696ea317a58d84ab4a3d01ff9d01e", "score": "0.6082096", "text": "function sc_vector() {\n var a = new sc_Vector();\n for (var i = 0; i < arguments.length; i++)\n a.push(arguments[i]);\n return a;\n}", "title": "" }, { "docid": "38a89c128f13b5eba5b23ff4313b64d4", "score": "0.6053784", "text": "getScalarProduct(vector) { \n return this.x*vector.x + this.y*vector.y;\n }", "title": "" }, { "docid": "6035addd15bfa4959df4f9c870a308d7", "score": "0.60123897", "text": "function vectors_multiply_matrix(vectors, matrix, new_vectors,\n dest_offset) {\n\n if (!dest_offset)\n dest_offset = 0;\n\n var len = vectors.length;\n\n for (var i = 0; i < len; i+=3) {\n var x = vectors[i];\n var y = vectors[i+1];\n var z = vectors[i+2];\n\n // ignore matrix translation part\n new_vectors[dest_offset + i] = matrix[0] * x + matrix[4] * y + matrix[8] * z;\n new_vectors[dest_offset + i + 1] = matrix[1] * x + matrix[5] * y + matrix[9] * z;\n new_vectors[dest_offset + i + 2] = matrix[2] * x + matrix[6] * y + matrix[10] * z;\n }\n\n return new_vectors;\n}", "title": "" }, { "docid": "a16f40c42c41414d2d4705f1f89c73ec", "score": "0.60101175", "text": "function mult( u, v )\n{\n var result = [];\n\n if ( u.matrix && v.matrix ) {\n if ( u.length != v.length ) {\n throw \"mult(): trying to add matrices of different dimensions\";\n }\n\n for ( var i = 0; i < u.length; ++i ) {\n if ( u[i].length != v[i].length ) {\n throw \"mult(): trying to add matrices of different dimensions\";\n }\n }\n\n for ( var i = 0; i < u.length; ++i ) {\n result.push( [] );\n\n for ( var j = 0; j < v.length; ++j ) {\n var sum = 0.0;\n for ( var k = 0; k < u.length; ++k ) {\n sum += u[i][k] * v[k][j];\n }\n result[i].push( sum );\n }\n }\n\n result.matrix = true;\n\n return result;\n }\n\n if(u.matrix&& (u.length == v.length)) {\n for(var i = 0; i<v.length; i++) {\n var sum = 0.0;\n for(var j=0; j<v.length; j++) {\n sum += u[i][j]*v[j];\n }\n result.push(sum);\n }\n return result;\n }\n\n\n\n else {\n if ( u.length != v.length ) {\n throw \"mult(): vectors are not the same dimension\";\n }\n\n for ( var i = 0; i < u.length; ++i ) {\n result.push( u[i] * v[i] );\n }\n\n return result;\n }\n}", "title": "" }, { "docid": "c455291de9f9b40e4b09c6b0579ce20f", "score": "0.60067195", "text": "function matrix(a, b) {\n var u = subtract(a[1], a[0]),\n v = subtract(b[1], b[0]),\n phi = angle$1(u, v),\n s = length(u) / length(v);\n\n return multiply([\n 1, 0, a[0][0],\n 0, 1, a[0][1]\n ], multiply([\n s, 0, 0,\n 0, s, 0\n ], multiply([\n cos(phi), sin(phi), 0,\n -sin(phi), cos(phi), 0\n ], [\n 1, 0, -b[0][0],\n 0, 1, -b[0][1]\n ])));\n}", "title": "" }, { "docid": "94f687582957cea303d0630ec83bef93", "score": "0.6005076", "text": "function Vec2D() {}", "title": "" }, { "docid": "3caccc49409e21a122fd27fb4b8a3c85", "score": "0.60050267", "text": "static appendMatrix(a, b){\n\t\tif (a.rows !== b.rows){\n\t\t\tconsole.log(\"Rows of Matrix A must be equal to Rows of Matrix B\");\n\t\t\treturn;\n\t\t}\n\t\tvar vector = new Matrix(a.rows, (b.cols+a.cols));\n\t\tfor (var i = 0; i < a.rows; i++){\n\t\t\tfor (var j = 0; j < a.cols; j++){\n\t\t\t\tvector.data[i][j] = a.data[i][j];\n\t\t\t}\n\t\t}\n\t\tfor (var i = 0; i < a.rows; i++){\n\t\t\tfor (var j = a.cols; j < vector.cols; j++){\n\t\t\t\tvector.data[i][j] = b.data[i][j-a.cols];\n\t\t\t}\n\t\t}\n\t\treturn vector;\n\t}", "title": "" }, { "docid": "e616bfb9744a5da285520532412c44bb", "score": "0.5998669", "text": "static properly_define_vector(vectors){\n \t//a proper point takes the following form: [[x], [y], [z], [1]]\n //for points: [[x1, x2, ..., xn], [y1, y2, ..., yn], [z1, z2, ..., zm=n] [1, 1, ..., 1]]\n \tlet dim = Vector.matrix_dimensions(vectors)\n let proper_vectors = Convert.deep_copy(vectors)\n if(dim[0] == 1){\n \tproper_vectors = Vector.transpose(proper_vectors)\n if(dim[1] == 3){\n \tproper_vectors.push([0])\n }\n return proper_vectors\n }else{\n \tif(dim[1] == 3){\n \tfor(var i = 0; i < dim[0]; i++){\n \tproper_vectors[i].push(0)\n }\n proper_vectors = Vector.transpose(proper_vectors)\n \treturn proper_vectors\n }else{\n \tif(dim[0] == 3){\n \t//let ones = Vector.add(Vector.make_matrix(1, dim[0])[0], 1)\n proper_vectors.push([0])\n return proper_vectors\n }\n }\n }\n }", "title": "" }, { "docid": "e157b4ac0dd15be07f7bde1d47d9e236", "score": "0.59957117", "text": "function multiply(m, v) {\n var vv = vec4(\n m[0][0] * v[0] + m[0][1] * v[1] + m[0][2] * v[2] + m[0][3] * v[3],\n m[1][0] * v[0] + m[1][1] * v[1] + m[1][2] * v[2] + m[1][3] * v[3],\n m[2][0] * v[0] + m[2][1] * v[1] + m[2][2] * v[2] + m[2][3] * v[3],\n m[3][0] * v[0] + m[3][1] * v[1] + m[3][2] * v[2] + m[3][3] * v[3]\n );\n return vv;\n}", "title": "" }, { "docid": "833aa9a39cc178a32e6a55f4aaa93fe2", "score": "0.59731185", "text": "function matrix(a, b) {\n var u = subtract(a[1], a[0]), v = subtract(b[1], b[0]), phi = angle$1(u, v), s = length(u) / length(v);\n return multiply([1, 0, a[0][0], 0, 1, a[0][1]], multiply([s, 0, 0, 0, s, 0], multiply([cos(phi), sin(phi), 0, -sin(phi), cos(phi), 0], [1, 0, -b[0][0], 0, 1, -b[0][1]])));\n }", "title": "" }, { "docid": "bbc8ec103868cecc835af29ac7d6982b", "score": "0.5957244", "text": "function array(vector){return vector;}", "title": "" }, { "docid": "8b97c9aff6af1a21e6fbc6bf2634095e", "score": "0.5954931", "text": "transpose() {\n // Do not change a vector\n if (this.shape.length === 1) return this\n\n const nrows = this.shape[0]\n const ncols = this.shape[1]\n\n let res = (new Array(ncols)).fill(null).map(_ => new Array(nrows))\n for (let i = 0; i < nrows; i++) {\n for (let j = 0; j < ncols; j++) {\n res[j][i] = this.v[i][j]\n }\n }\n\n return new Tensor(res)\n }", "title": "" }, { "docid": "1662c186777bf05eb47928db189c536e", "score": "0.5951433", "text": "function Vector() {}", "title": "" }, { "docid": "bbdd0add4d8cf212aa8b5e3521f4b6a4", "score": "0.5932474", "text": "function multMatrix(m) {\r\n modelView = mult(modelView, m);\r\n}", "title": "" }, { "docid": "3b243a3c7248880f57db62b2f7b1cf58", "score": "0.591449", "text": "function toVector(arr) {\n return concat.apply([], arr);\n}", "title": "" }, { "docid": "7015d254b5596d4e1b27a48e7b786476", "score": "0.59109956", "text": "function Matrix(rows, columns) {\n\t var i, j;\n\t this.data = new Array(rows);\n\t for (i = 0; i < rows; i++) {\n\t\tthis.data[i] = new Array(columns);\n\t }\n\n\t this.configure = function (rot, scale, transx, transy) {\n\t\tvar rad = (rot * Math.PI)/180;\n\t\tvar sin = Math.sin(rad) * scale;\n\t\tvar cos = Math.cos(rad) * scale;\n\t\tthis.set(cos, -sin, transx,\n\t\t\t\t sin, cos, transy);\n\t\t};\n\t\t\n\t\tthis.set = function () {\n\t\t\tvar k = 0;\n\t\t\tfor (i = 0; i < rows; i++) {\n\t\t\t\tfor (j = 0; j < columns; j++) {\n\t\t\t\tthis.data[i][j] = arguments[k];\n\t\t\t\tk++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t}\n\n\t this.multiply = function () {\n\t\tvar vector = new Array(rows);\n\t\tfor (i = 0; i < rows; i++) {\n\t\t vector[i] = 0;\n\t\t for (j = 0; j < columns; j++) {\n\t\t\tvector[i] += this.data[i][j] * arguments[j];\n\t\t }\n\t\t}\n\t\treturn vector;\n\t };\n\t}", "title": "" }, { "docid": "5e89ec0d28759dd83fea2fd1725c3139", "score": "0.5909342", "text": "fromVec(v) {\n this.copy(zeroMv)\n\n //possibly it would be better to derive the e12s and so on from taking your vectors\n\n this[11] = v.z\n this[12] = v.y\n this[13] = v.x\n this[14] = 1.\n\n return this\n }", "title": "" }, { "docid": "333ee9141b62d878951a95ab65095dcb", "score": "0.59091306", "text": "function setColumnVectorOfMatrix(matrix,column,columnvalue){\n //handle column inputs like: [[2,1]]\n // or [[2],[1]]\n var columnvaluesize = (new Function(\"return \" + Algebrite.shape(columnvalue)+ \";\")()); //dimension\n var ncolumnvaluesize= (columnvaluesize[0]);\n if(ncolumnvaluesize!=1){ //e.g: [[2],[1]] ncolumnvaluesize=2\n columnvalue=Algebrite.transpose(columnvalue).toString();\n // console.log(columnvalue);\n }\n if(columnvalue[0]=\"[\"&&columnvalue[1]==\"[\"){\n columnvalue=columnvalue.substring(1);\n columnvalue=columnvalue.substring(0,columnvalue.length-1);\n }\n //console.log(columnvalue);\n\n //eigentliche logik:\n var columnvaluesasarray = (new Function(\"return \" +columnvalue+ \";\")());\n // console.log(columnvaluesasarray);\n var tmp = \"\";\n for(var i=0;i<columnvaluesasarray.length;i=i+1){\n tmp=setMatValue(matrix,i,column,columnvaluesasarray[i]);\n matrix=tmp;\n }\n return matrix;\n}", "title": "" }, { "docid": "2bc59325180d1e97bc553348d8948d41", "score": "0.59091157", "text": "function _vecInContext(v, m) {\n\t return [\n\t v[0] * m[0] + v[1] * m[4] + v[2] * m[8],\n\t v[0] * m[1] + v[1] * m[5] + v[2] * m[9],\n\t v[0] * m[2] + v[1] * m[6] + v[2] * m[10]\n\t ];\n\t }", "title": "" }, { "docid": "48cce975acf6df94b6ec24f8303d55c7", "score": "0.58812547", "text": "function unit_vector (vec){\n var lx,ly,lz;\n var uni;\n var res = new Vector();\n\n lx = vec.x;\n ly = vec.y;\n lz = vec.z;\n\n uni = sqrt (lx * lx + ly * ly + lz * lz);\n\n res.x = lx / uni;\n res.y = ly / uni;\n res.z = lz / uni;\n\t\n return res;\n}", "title": "" }, { "docid": "eb15367ec61dcdc066b99ecccbcde5be", "score": "0.5871613", "text": "function multMatrix(m) {\n modelView = mult(modelView, m);\n}", "title": "" }, { "docid": "fb67a27f21a84b68f4f83b6e21024208", "score": "0.58639926", "text": "function translate(vector) {\n\n var o = origin();\n \n mat4.translate(o.localmatrix, o.localmatrix, vector);\n \n return o;\n \n}", "title": "" }, { "docid": "7d27d166dd038f6ab4b88247143ca42a", "score": "0.5860294", "text": "projectTo(vec) {\n return vec.norm().mul(this.dot(vec.norm()));\n }", "title": "" }, { "docid": "2e32c89f42bf06de6bf7c98a8bab5333", "score": "0.5858032", "text": "function Matrix() {\n _classCallCheck$1(this, Matrix);\n\n this._elements = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];\n this._stack = [];\n }", "title": "" }, { "docid": "2e32c89f42bf06de6bf7c98a8bab5333", "score": "0.5858032", "text": "function Matrix() {\n _classCallCheck$1(this, Matrix);\n\n this._elements = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];\n this._stack = [];\n }", "title": "" }, { "docid": "cfbf03e465a87ae0a1ad0d7e28e2ab58", "score": "0.5852285", "text": "translate ( translationVector ) {\n\n var ctm = mat4.create();\n\n mat4.fromTranslation( ctm, translationVector );\n\n return ctm;\n\n }", "title": "" }, { "docid": "4244c019c0cc8250aa498b029b304ad7", "score": "0.5812012", "text": "function vecdir_multiply_matrix(vec, matrix, dest) {\n if (!dest)\n dest = new Float32Array(3);\n\n var v4 = _vec4_tmp;\n\n v4[0] = vec[0];\n v4[1] = vec[1];\n v4[2] = vec[2];\n v4[3] = 0;\n\n __WEBPACK_IMPORTED_MODULE_6__libs_gl_matrix_vec4_js__[\"transformMat4\"](v4, matrix, v4);\n dest[0] = v4[0];\n dest[1] = v4[1];\n dest[2] = v4[2];\n}", "title": "" }, { "docid": "19ced3d91fffa05ede10bc886e22dff8", "score": "0.58052516", "text": "function calculate_rotation_matrix(rotation_vector) \n{\n var rot_x = Matrix.RotationX(rotation_vector.e(1))\n var rot_z = Matrix.RotationZ(rotation_vector.e(3))\n \n return rot_x.multiply(rot_z)\n}", "title": "" }, { "docid": "4e89ba6d87519e59fdc5d42d928e5279", "score": "0.5795317", "text": "function mat_v_mult(M,x,b,scale) {\n\t var n = M.length;\n\t var m = M[0].length;\n\n\t if (n != b.length || m != x.length)\n\t\tthrow 'Rows of M mismatched to b or cols mismatch to x.';\n\n\t for (var i = 0; i < n; i++) {\n\t\tvar temp = 0;\n\t\tfor (var j = 0; j < m; j++) temp += M[i][j]*x[j];\n\t\tb[i] = scale*temp; // Recall the neg in the name\n\t }\n\t}", "title": "" }, { "docid": "b206319f648c98eb849c13b4143cb6f4", "score": "0.5781127", "text": "function multiplyVect(vector, scalar) {\n return [ scalar * vector[0],\n scalar * vector[1],\n scalar * vector[2]\n ];\n}", "title": "" }, { "docid": "4d64395274d3cea9a27db9554aaf0030", "score": "0.5779228", "text": "static make_matrix(nRows, nColumns, value = 0){\n \tlet result = []\n if(nColumns === undefined){\n \tif(Vector.matrix_dimensions(nRows)[1] == 2){\n \tnColumns = nRows[1]\n nRows = nRows[0]\n }else{\n \t\tnColumns = nRows\n }\n }\n if(nColumns === \"tilt\"){\n \tresult = Vector.make_matrix(nRows)\n for(let i = 0; i < nRows; i++){\n \tfor(let j = 0; j < nRows; j++){\n \t\tresult[i][j] = 2*nRows-i-j-2\n \t}\n }\n return result\n }\n if(nRows < 1 || nColumns < 1){\n \tdde_error(\"matrix dimensions must be greater than 1\")\n }\n \n \tfor(var i = 0; i < nRows; i++){\n \t\tresult.push([])\n \t\tfor(var j = 0; j < nColumns; j++){\n \t\t\tresult[i].push(value)\n \t\t}\n \t}\n \treturn result\n\t}", "title": "" }, { "docid": "1564b01c0fe34c6dc935a675b1a39c1e", "score": "0.57764894", "text": "function Transform2d() {\n var args = Array.prototype.slice.call(arguments);\n Matrix.prototype.constructor.apply(this, args);\n }", "title": "" }, { "docid": "4549918d7dc9a06b6f362dce10c70aa2", "score": "0.5763498", "text": "function matrix_transpose(M){\r\n // Rows shoudl be columns, columns become rows \r\n var M_Tranpose = []; //Prep new matrix \r\n var M_N = M[0].length; // Matrix N columns Value; \r\n if(M_N == undefined) // Case of row vector\r\n {\r\n M_N = 1;\r\n }\r\n \r\n for(var i=0; i<M_N;i++){\r\n //M_Tranpose.push(M.map(function(value,index){return value[i];})); //Gets column of original matrix\r\n M_Tranpose[i]=M.map(function(value,index){return value[i];}); //Gets Column \r\n }\r\n return M_Tranpose;\r\n}", "title": "" }, { "docid": "32b42e7286ad67d271dcae72a2099659", "score": "0.5758369", "text": "function multMatrix(m) {\n mView = mult(mView, m);\n}", "title": "" }, { "docid": "d23b692f2286a11ec396bebb157f7f78", "score": "0.5743728", "text": "function Matrix()\n\t{\n\t /**\n\t * @member {number}\n\t * @default 1\n\t */\n\t this.a = 1;\n\t\n\t /**\n\t * @member {number}\n\t * @default 0\n\t */\n\t this.b = 0;\n\t\n\t /**\n\t * @member {number}\n\t * @default 0\n\t */\n\t this.c = 0;\n\t\n\t /**\n\t * @member {number}\n\t * @default 1\n\t */\n\t this.d = 1;\n\t\n\t /**\n\t * @member {number}\n\t * @default 0\n\t */\n\t this.tx = 0;\n\t\n\t /**\n\t * @member {number}\n\t * @default 0\n\t */\n\t this.ty = 0;\n\t}", "title": "" }, { "docid": "795f627ef41b458900d0341a9931f35e", "score": "0.5732785", "text": "function StaticMatrix(vMatrix)\r\n{\r\n\treturn [\r\n\t\tvMatrix[0], vMatrix[1], vMatrix[2], vMatrix[3], \r\n\t\tvMatrix[4], vMatrix[5], vMatrix[6], vMatrix[7], \r\n\t\tvMatrix[8], vMatrix[9], vMatrix[10], vMatrix[11], \r\n\t\t0, 0, 0, vMatrix[15]\r\n\t];\r\n}", "title": "" }, { "docid": "3579232832385c0e7070e34735e85b7b", "score": "0.57307976", "text": "function vect (x, y) {\n\t\t return new Vector2D (x, y);\n\t\t }", "title": "" }, { "docid": "a001ce7bb671287a4e7c5995fca37aae", "score": "0.571897", "text": "function Matrix()\n{\n /**\n * @member {number}\n * @default 1\n */\n this.a = 1;\n\n /**\n * @member {number}\n * @default 0\n */\n this.b = 0;\n\n /**\n * @member {number}\n * @default 0\n */\n this.c = 0;\n\n /**\n * @member {number}\n * @default 1\n */\n this.d = 1;\n\n /**\n * @member {number}\n * @default 0\n */\n this.tx = 0;\n\n /**\n * @member {number}\n * @default 0\n */\n this.ty = 0;\n}", "title": "" }, { "docid": "a001ce7bb671287a4e7c5995fca37aae", "score": "0.571897", "text": "function Matrix()\n{\n /**\n * @member {number}\n * @default 1\n */\n this.a = 1;\n\n /**\n * @member {number}\n * @default 0\n */\n this.b = 0;\n\n /**\n * @member {number}\n * @default 0\n */\n this.c = 0;\n\n /**\n * @member {number}\n * @default 1\n */\n this.d = 1;\n\n /**\n * @member {number}\n * @default 0\n */\n this.tx = 0;\n\n /**\n * @member {number}\n * @default 0\n */\n this.ty = 0;\n}", "title": "" }, { "docid": "d8fb5a48bac01cf4d7fc368d9e3087a9", "score": "0.5716501", "text": "function Matrix (row, col, comps) {\n if (comps === undefined) {\n comps = []\n }\n if (comps.length === 0) {\n this.matrix = []\n let rowVector = []\n for (let i = 0; i < row; i++) {\n for (let j = 0; j < col; j++) {\n rowVector[j] = 0\n }\n this.matrix[i] = rowVector\n rowVector = []\n }\n } else {\n this.matrix = comps\n }\n this.rows = row\n this.cols = col\n }", "title": "" }, { "docid": "768d8739f7ee81f1f81374e7fcfb2f15", "score": "0.57122", "text": "function scalar_to_vector(scalar, vector) {\n vector[0] = vector[1] = vector[2] = scalar;\n return vector;\n}", "title": "" }, { "docid": "707fc3625706290c611a7151a93cd990", "score": "0.5711694", "text": "function grid2vec(row, col){ return row*nx + col }", "title": "" }, { "docid": "ce2cb76f00fec3540b4ebeefdb42bde5", "score": "0.57108605", "text": "function matrixTransformations(angle, r, pointV, axisV){\r\n var mat = new Matrix4();\r\n mat.rotate(angle, axisV.elements[0], axisV.elements[1], axisV.elements[2]);\r\n var transMat = new Matrix4();\r\n transMat.translate(pointV.elements[0], pointV.elements[1], 0);\r\n var combMat = transMat.multiply(mat);\r\n var result = combMat.multiplyVector3(new Vector3([0,0,r]));\r\n vertices.push(new coord(result.elements[0], result.elements[1], result.elements[2]));\r\n}", "title": "" }, { "docid": "f32a53a287d82711c46529009bbb839e", "score": "0.5706141", "text": "function multiply_vector(a,b){\n var vec;\n x = a[0]*b[0];\n y = a[1]*b[1];\n z = a[2]*b[2];\n vec = [x,y,z];\n return vec;\n}", "title": "" }, { "docid": "30f406ebbf29339f515e3e434f4d4504", "score": "0.5690388", "text": "function matIV(){\r\n\tthis.create = function(){\r\n\t\treturn new Float32Array(16);\r\n\t};\r\n\tthis.identity = function(dest){\r\n\t\tdest[0] = 1; dest[1] = 0; dest[2] = 0; dest[3] = 0;\r\n\t\tdest[4] = 0; dest[5] = 1; dest[6] = 0; dest[7] = 0;\r\n\t\tdest[8] = 0; dest[9] = 0; dest[10] = 1; dest[11] = 0;\r\n\t\tdest[12] = 0; dest[13] = 0; dest[14] = 0; dest[15] = 1;\r\n\t\treturn dest;\r\n\t};\r\n\tthis.multiply = function(mat1, mat2, dest){\r\n\t\tvar a = mat1[0], b = mat1[1], c = mat1[2], d = mat1[3],\r\n\t\t\te = mat1[4], f = mat1[5], g = mat1[6], h = mat1[7],\r\n\t\t\ti = mat1[8], j = mat1[9], k = mat1[10], l = mat1[11],\r\n\t\t\tm = mat1[12], n = mat1[13], o = mat1[14], p = mat1[15],\r\n\t\t\tA = mat2[0], B = mat2[1], C = mat2[2], D = mat2[3],\r\n\t\t\tE = mat2[4], F = mat2[5], G = mat2[6], H = mat2[7],\r\n\t\t\tI = mat2[8], J = mat2[9], K = mat2[10], L = mat2[11],\r\n\t\t\tM = mat2[12], N = mat2[13], O = mat2[14], P = mat2[15];\r\n\t\tdest[0] = A * a + B * e + C * i + D * m;\r\n\t\tdest[1] = A * b + B * f + C * j + D * n;\r\n\t\tdest[2] = A * c + B * g + C * k + D * o;\r\n\t\tdest[3] = A * d + B * h + C * l + D * p;\r\n\t\tdest[4] = E * a + F * e + G * i + H * m;\r\n\t\tdest[5] = E * b + F * f + G * j + H * n;\r\n\t\tdest[6] = E * c + F * g + G * k + H * o;\r\n\t\tdest[7] = E * d + F * h + G * l + H * p;\r\n\t\tdest[8] = I * a + J * e + K * i + L * m;\r\n\t\tdest[9] = I * b + J * f + K * j + L * n;\r\n\t\tdest[10] = I * c + J * g + K * k + L * o;\r\n\t\tdest[11] = I * d + J * h + K * l + L * p;\r\n\t\tdest[12] = M * a + N * e + O * i + P * m;\r\n\t\tdest[13] = M * b + N * f + O * j + P * n;\r\n\t\tdest[14] = M * c + N * g + O * k + P * o;\r\n\t\tdest[15] = M * d + N * h + O * l + P * p;\r\n\t\treturn dest;\r\n\t};\r\n\tthis.scale = function(mat, vec, dest){\r\n\t\tdest[0] = mat[0] * vec[0];\r\n\t\tdest[1] = mat[1] * vec[0];\r\n\t\tdest[2] = mat[2] * vec[0];\r\n\t\tdest[3] = mat[3] * vec[0];\r\n\t\tdest[4] = mat[4] * vec[1];\r\n\t\tdest[5] = mat[5] * vec[1];\r\n\t\tdest[6] = mat[6] * vec[1];\r\n\t\tdest[7] = mat[7] * vec[1];\r\n\t\tdest[8] = mat[8] * vec[2];\r\n\t\tdest[9] = mat[9] * vec[2];\r\n\t\tdest[10] = mat[10] * vec[2];\r\n\t\tdest[11] = mat[11] * vec[2];\r\n\t\tdest[12] = mat[12];\r\n\t\tdest[13] = mat[13];\r\n\t\tdest[14] = mat[14];\r\n\t\tdest[15] = mat[15];\r\n\t\treturn dest;\r\n\t};\r\n\tthis.translate = function(mat, vec, dest){\r\n\t\tdest[0] = mat[0]; dest[1] = mat[1]; dest[2] = mat[2]; dest[3] = mat[3];\r\n\t\tdest[4] = mat[4]; dest[5] = mat[5]; dest[6] = mat[6]; dest[7] = mat[7];\r\n\t\tdest[8] = mat[8]; dest[9] = mat[9]; dest[10] = mat[10]; dest[11] = mat[11];\r\n\t\tdest[12] = mat[0] * vec[0] + mat[4] * vec[1] + mat[8] * vec[2] + mat[12];\r\n\t\tdest[13] = mat[1] * vec[0] + mat[5] * vec[1] + mat[9] * vec[2] + mat[13];\r\n\t\tdest[14] = mat[2] * vec[0] + mat[6] * vec[1] + mat[10] * vec[2] + mat[14];\r\n\t\tdest[15] = mat[3] * vec[0] + mat[7] * vec[1] + mat[11] * vec[2] + mat[15];\r\n\t\treturn dest;\r\n\t};\r\n\tthis.rotate = function(mat, angle, axis, dest){\r\n\t\tvar sq = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\t\tif(!sq){return null;}\r\n\t\tvar a = axis[0], b = axis[1], c = axis[2];\r\n\t\tif(sq != 1){sq = 1 / sq; a *= sq; b *= sq; c *= sq;}\r\n\t\tvar d = Math.sin(angle), e = Math.cos(angle), f = 1 - e,\r\n\t\t\tg = mat[0], h = mat[1], i = mat[2], j = mat[3],\r\n\t\t\tk = mat[4], l = mat[5], m = mat[6], n = mat[7],\r\n\t\t\to = mat[8], p = mat[9], q = mat[10], r = mat[11],\r\n\t\t\ts = a * a * f + e,\r\n\t\t\tt = b * a * f + c * d,\r\n\t\t\tu = c * a * f - b * d,\r\n\t\t\tv = a * b * f - c * d,\r\n\t\t\tw = b * b * f + e,\r\n\t\t\tx = c * b * f + a * d,\r\n\t\t\ty = a * c * f + b * d,\r\n\t\t\tz = b * c * f - a * d,\r\n\t\t\tA = c * c * f + e;\r\n\t\tif(angle){\r\n\t\t\tif(mat != dest){\r\n\t\t\t\tdest[12] = mat[12]; dest[13] = mat[13];\r\n\t\t\t\tdest[14] = mat[14]; dest[15] = mat[15];\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tdest = mat;\r\n\t\t}\r\n\t\tdest[0] = g * s + k * t + o * u;\r\n\t\tdest[1] = h * s + l * t + p * u;\r\n\t\tdest[2] = i * s + m * t + q * u;\r\n\t\tdest[3] = j * s + n * t + r * u;\r\n\t\tdest[4] = g * v + k * w + o * x;\r\n\t\tdest[5] = h * v + l * w + p * x;\r\n\t\tdest[6] = i * v + m * w + q * x;\r\n\t\tdest[7] = j * v + n * w + r * x;\r\n\t\tdest[8] = g * y + k * z + o * A;\r\n\t\tdest[9] = h * y + l * z + p * A;\r\n\t\tdest[10] = i * y + m * z + q * A;\r\n\t\tdest[11] = j * y + n * z + r * A;\r\n\t\treturn dest;\r\n\t};\r\n\tthis.lookAt = function(eye, center, up, dest){\r\n\t\tvar eyeX = eye[0], eyeY = eye[1], eyeZ = eye[2],\r\n\t\t\tupX = up[0], upY = up[1], upZ = up[2],\r\n\t\t\tcenterX = center[0], centerY = center[1], centerZ = center[2];\r\n\t\tif(eyeX == centerX && eyeY == centerY && eyeZ == centerZ){return this.identity(dest);}\r\n\t\tvar x0, x1, x2, y0, y1, y2, z0, z1, z2, l;\r\n\t\tz0 = eyeX - center[0]; z1 = eyeY - center[1]; z2 = eyeZ - center[2];\r\n\t\tl = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n\t\tz0 *= l; z1 *= l; z2 *= l;\r\n\t\tx0 = upY * z2 - upZ * z1;\r\n\t\tx1 = upZ * z0 - upX * z2;\r\n\t\tx2 = upX * z1 - upY * z0;\r\n\t\tl = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n\t\tif(!l){\r\n\t\t\tx0 = 0; x1 = 0; x2 = 0;\r\n\t\t} else {\r\n\t\t\tl = 1 / l;\r\n\t\t\tx0 *= l; x1 *= l; x2 *= l;\r\n\t\t}\r\n\t\ty0 = z1 * x2 - z2 * x1; y1 = z2 * x0 - z0 * x2; y2 = z0 * x1 - z1 * x0;\r\n\t\tl = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n\t\tif(!l){\r\n\t\t\ty0 = 0; y1 = 0; y2 = 0;\r\n\t\t} else {\r\n\t\t\tl = 1 / l;\r\n\t\t\ty0 *= l; y1 *= l; y2 *= l;\r\n\t\t}\r\n\t\tdest[0] = x0; dest[1] = y0; dest[2] = z0; dest[3] = 0;\r\n\t\tdest[4] = x1; dest[5] = y1; dest[6] = z1; dest[7] = 0;\r\n\t\tdest[8] = x2; dest[9] = y2; dest[10] = z2; dest[11] = 0;\r\n\t\tdest[12] = -(x0 * eyeX + x1 * eyeY + x2 * eyeZ);\r\n\t\tdest[13] = -(y0 * eyeX + y1 * eyeY + y2 * eyeZ);\r\n\t\tdest[14] = -(z0 * eyeX + z1 * eyeY + z2 * eyeZ);\r\n\t\tdest[15] = 1;\r\n\t\treturn dest;\r\n\t};\r\n\tthis.perspective = function(fovy, aspect, near, far, dest){\r\n\t\tvar t = near * Math.tan(fovy * Math.PI / 360);\r\n\t\tvar r = t * aspect;\r\n\t\tvar a = r * 2, b = t * 2, c = far - near;\r\n\t\tdest[0] = near * 2 / a;\r\n\t\tdest[1] = 0;\r\n\t\tdest[2] = 0;\r\n\t\tdest[3] = 0;\r\n\t\tdest[4] = 0;\r\n\t\tdest[5] = near * 2 / b;\r\n\t\tdest[6] = 0;\r\n\t\tdest[7] = 0;\r\n\t\tdest[8] = 0;\r\n\t\tdest[9] = 0;\r\n\t\tdest[10] = -(far + near) / c;\r\n\t\tdest[11] = -1;\r\n\t\tdest[12] = 0;\r\n\t\tdest[13] = 0;\r\n\t\tdest[14] = -(far * near * 2) / c;\r\n\t\tdest[15] = 0;\r\n\t\treturn dest;\r\n\t};\r\n\tthis.ortho = function(left, right, top, bottom, near, far, dest) {\r\n\t\tvar h = (right - left);\r\n\t\tvar v = (top - bottom);\r\n\t\tvar d = (far - near);\r\n\t\tdest[0] = 2 / h;\r\n\t\tdest[1] = 0;\r\n\t\tdest[2] = 0;\r\n\t\tdest[3] = 0;\r\n\t\tdest[4] = 0;\r\n\t\tdest[5] = 2 / v;\r\n\t\tdest[6] = 0;\r\n\t\tdest[7] = 0;\r\n\t\tdest[8] = 0;\r\n\t\tdest[9] = 0;\r\n\t\tdest[10] = -2 / d;\r\n\t\tdest[11] = 0;\r\n\t\tdest[12] = -(left + right) / h;\r\n\t\tdest[13] = -(top + bottom) / v;\r\n\t\tdest[14] = -(far + near) / d;\r\n\t\tdest[15] = 1;\r\n\t\treturn dest;\r\n\t};\r\n\tthis.transpose = function(mat, dest){\r\n\t\tdest[0] = mat[0]; dest[1] = mat[4];\r\n\t\tdest[2] = mat[8]; dest[3] = mat[12];\r\n\t\tdest[4] = mat[1]; dest[5] = mat[5];\r\n\t\tdest[6] = mat[9]; dest[7] = mat[13];\r\n\t\tdest[8] = mat[2]; dest[9] = mat[6];\r\n\t\tdest[10] = mat[10]; dest[11] = mat[14];\r\n\t\tdest[12] = mat[3]; dest[13] = mat[7];\r\n\t\tdest[14] = mat[11]; dest[15] = mat[15];\r\n\t\treturn dest;\r\n\t};\r\n\tthis.inverse = function(mat, dest){\r\n\t\tvar a = mat[0], b = mat[1], c = mat[2], d = mat[3],\r\n\t\t\te = mat[4], f = mat[5], g = mat[6], h = mat[7],\r\n\t\t\ti = mat[8], j = mat[9], k = mat[10], l = mat[11],\r\n\t\t\tm = mat[12], n = mat[13], o = mat[14], p = mat[15],\r\n\t\t\tq = a * f - b * e, r = a * g - c * e,\r\n\t\t\ts = a * h - d * e, t = b * g - c * f,\r\n\t\t\tu = b * h - d * f, v = c * h - d * g,\r\n\t\t\tw = i * n - j * m, x = i * o - k * m,\r\n\t\t\ty = i * p - l * m, z = j * o - k * n,\r\n\t\t\tA = j * p - l * n, B = k * p - l * o,\r\n\t\t\tivd = 1 / (q * B - r * A + s * z + t * y - u * x + v * w);\r\n\t\tdest[0] = ( f * B - g * A + h * z) * ivd;\r\n\t\tdest[1] = (-b * B + c * A - d * z) * ivd;\r\n\t\tdest[2] = ( n * v - o * u + p * t) * ivd;\r\n\t\tdest[3] = (-j * v + k * u - l * t) * ivd;\r\n\t\tdest[4] = (-e * B + g * y - h * x) * ivd;\r\n\t\tdest[5] = ( a * B - c * y + d * x) * ivd;\r\n\t\tdest[6] = (-m * v + o * s - p * r) * ivd;\r\n\t\tdest[7] = ( i * v - k * s + l * r) * ivd;\r\n\t\tdest[8] = ( e * A - f * y + h * w) * ivd;\r\n\t\tdest[9] = (-a * A + b * y - d * w) * ivd;\r\n\t\tdest[10] = ( m * u - n * s + p * q) * ivd;\r\n\t\tdest[11] = (-i * u + j * s - l * q) * ivd;\r\n\t\tdest[12] = (-e * z + f * x - g * w) * ivd;\r\n\t\tdest[13] = ( a * z - b * x + c * w) * ivd;\r\n\t\tdest[14] = (-m * t + n * r - o * q) * ivd;\r\n\t\tdest[15] = ( i * t - j * r + k * q) * ivd;\r\n\t\treturn dest;\r\n\t};\r\n}", "title": "" }, { "docid": "9597df0789dc89193b36298bafda3bf1", "score": "0.5685437", "text": "multiply (matrix) {\n return this.clone().multiplyO(matrix)\n }", "title": "" }, { "docid": "8a16050affb6e6a7e333e4e7583616da", "score": "0.56838155", "text": "get M() {\n //https://www.khanacademy.org/computing/computer-programming/programming-natural-simulations/programming-vectors/a/vector-magnitude-normalization\n return Math.sqrt((this.X * this.X) + (this.Y * this.Y))\n }", "title": "" }, { "docid": "eedfa327854e1d6617188667d4e0c245", "score": "0.5683714", "text": "function vet(a, b) {\n var data = Array.from(Array(1),() => new Array(b-a+1));\n // the benefit from creating array this way is a.length = number of rows and a[0].length = number of columns\n for (var i = 0; i < data[0].length; i++) {\n data[0][i]= a + i;\n }\n return matrizn(data);\n}", "title": "" }, { "docid": "eb8f1a95c352849195580510c3147399", "score": "0.56833655", "text": "function createMatrix(arr) {\n let newArr = [];\n for (let i = 0; i < arr.length; i += 1) {\n newArr[i] = [];\n }\n newArr[0][0] = arr[0][0];\n for (let i = 1; i < arr.length; i += 1) {\n newArr[i][0] = arr[i][0] * newArr[i - 1][0];\n }\n for (let j = 1; j < arr[0].length; j += 1) {\n newArr[0][j] = arr[0][j] * newArr[0][j - 1];\n }\n return newArr;\n}", "title": "" }, { "docid": "aa5d76567a276857d0968003185e3f40", "score": "0.567921", "text": "function moves_mat() {\n var field = prime_field(2);\n var zeros = board.flat.map(function() {return 0;});\n var vectors = board.flat.map(function(d) {\n vector = zeros.slice(0);\n affected(d).forEach(function(d) {vector[d.idx] = 1;});\n return field.vec(vector);\n });\n return assemble_vecs(vectors);\n }", "title": "" }, { "docid": "b363c8b6a5bb0650aa9ec86484e0c3a5", "score": "0.5676414", "text": "static get matrix() {}", "title": "" }, { "docid": "e42de437dbc344ad1c499d3a9ac1f1fd", "score": "0.5671465", "text": "function calculateOutput() {\n var matrixResult = mathjs.identity(3);\n var vectorResult = mathjs.zeros(3, 1);\n\n if (currentMatricesOrder.length == 1) {\n matrixResult = currentMatricesOrder[0];\n } else if (currentMatricesOrder.length > 1) {\n // 2 or more matrices\n matricesCopy = currentMatricesOrder.slice(); // copy list for multiplying in place\n matrixResult = multiplyMatrices(matricesCopy);\n }\n\n if (currentVectorsOrder.length == 1) {\n vectorResult = currentVectorsOrder[0];\n } else if (currentVectorsOrder.length > 1) {\n // 2 or more vectors\n vectorsCopy = currentVectorsOrder.slice(); // copy list for adding in place\n vectorResult = addVectors(vectorsCopy);\n }\n\n return [matrixResult, vectorResult];\n}", "title": "" }, { "docid": "2737a586776be8f9379dbf81c8154edc", "score": "0.5668232", "text": "function matrix_transpose(M){\n // Rows should be columns, columns become rows \n var M_Tranpose = []; //Prep new matrix \n var M_N = M[0].length; // Matrix N columns Value; \n if(M_N == undefined) // Case of row vector\n {\n M_N = 1;\n }\n \n for(var i=0; i<M_N;i++){\n //M_Tranpose.push(M.map(function(value,index){return value[i];})); //Gets column of original matrix\n M_Tranpose[i]=M.map(function(value,index){return value[i];}); //Gets Column \n }\n return M_Tranpose;\n}", "title": "" }, { "docid": "a3c9295c53b8ccc08b301ff987713310", "score": "0.5661894", "text": "function SingularValueDecomposition( matrix ) {\n this.matrix = matrix;\n\n var Arg = matrix;\n\n // Derived from LINPACK code.\n // Initialize.\n var A = Arg.getArrayCopy();\n this.m = Arg.getRowDimension();\n this.n = Arg.getColumnDimension();\n var m = this.m;\n var n = this.n;\n\n var min = Math.min;\n var max = Math.max;\n var pow = Math.pow;\n var abs = Math.abs;\n\n /* Apparently the failing cases are only a proper subset of (m<n),\n so let's not throw error. Correct fix to come later?\n if (m<n) {\n throw new IllegalArgumentException(\"Jama SVD only works for m >= n\"); }\n */\n var nu = min( m, n );\n this.s = new ArrayType( min( m + 1, n ) );\n var s = this.s;\n this.U = new ArrayType( m * nu );\n var U = this.U;\n this.V = new ArrayType( n * n );\n var V = this.V;\n var e = new ArrayType( n );\n var work = new ArrayType( m );\n var wantu = true;\n var wantv = true;\n\n var i;\n var j;\n var k;\n var t;\n var f;\n\n var cs;\n var sn;\n\n var hypot = dot.Matrix.hypot;\n\n // Reduce A to bidiagonal form, storing the diagonal elements\n // in s and the super-diagonal elements in e.\n\n var nct = min( m - 1, n );\n var nrt = max( 0, min( n - 2, m ) );\n for ( k = 0; k < max( nct, nrt ); k++ ) {\n if ( k < nct ) {\n\n // Compute the transformation for the k-th column and\n // place the k-th diagonal in s[k].\n // Compute 2-norm of k-th column without under/overflow.\n s[ k ] = 0;\n for ( i = k; i < m; i++ ) {\n s[ k ] = hypot( s[ k ], A[ i * n + k ] );\n }\n if ( s[ k ] !== 0.0 ) {\n if ( A[ k * n + k ] < 0.0 ) {\n s[ k ] = -s[ k ];\n }\n for ( i = k; i < m; i++ ) {\n A[ i * n + k ] /= s[ k ];\n }\n A[ k * n + k ] += 1.0;\n }\n s[ k ] = -s[ k ];\n }\n for ( j = k + 1; j < n; j++ ) {\n if ( (k < nct) && (s[ k ] !== 0.0) ) {\n\n // Apply the transformation.\n\n t = 0;\n for ( i = k; i < m; i++ ) {\n t += A[ i * n + k ] * A[ i * n + j ];\n }\n t = -t / A[ k * n + k ];\n for ( i = k; i < m; i++ ) {\n A[ i * n + j ] += t * A[ i * n + k ];\n }\n }\n\n // Place the k-th row of A into e for the\n // subsequent calculation of the row transformation.\n\n e[ j ] = A[ k * n + j ];\n }\n if ( wantu && (k < nct) ) {\n\n // Place the transformation in U for subsequent back\n // multiplication.\n\n for ( i = k; i < m; i++ ) {\n U[ i * nu + k ] = A[ i * n + k ];\n }\n }\n if ( k < nrt ) {\n\n // Compute the k-th row transformation and place the\n // k-th super-diagonal in e[k].\n // Compute 2-norm without under/overflow.\n e[ k ] = 0;\n for ( i = k + 1; i < n; i++ ) {\n e[ k ] = hypot( e[ k ], e[ i ] );\n }\n if ( e[ k ] !== 0.0 ) {\n if ( e[ k + 1 ] < 0.0 ) {\n e[ k ] = -e[ k ];\n }\n for ( i = k + 1; i < n; i++ ) {\n e[ i ] /= e[ k ];\n }\n e[ k + 1 ] += 1.0;\n }\n e[ k ] = -e[ k ];\n if ( (k + 1 < m) && (e[ k ] !== 0.0) ) {\n\n // Apply the transformation.\n\n for ( i = k + 1; i < m; i++ ) {\n work[ i ] = 0.0;\n }\n for ( j = k + 1; j < n; j++ ) {\n for ( i = k + 1; i < m; i++ ) {\n work[ i ] += e[ j ] * A[ i * n + j ];\n }\n }\n for ( j = k + 1; j < n; j++ ) {\n t = -e[ j ] / e[ k + 1 ];\n for ( i = k + 1; i < m; i++ ) {\n A[ i * n + j ] += t * work[ i ];\n }\n }\n }\n if ( wantv ) {\n\n // Place the transformation in V for subsequent\n // back multiplication.\n\n for ( i = k + 1; i < n; i++ ) {\n V[ i * n + k ] = e[ i ];\n }\n }\n }\n }\n\n // Set up the final bidiagonal matrix or order p.\n\n var p = min( n, m + 1 );\n if ( nct < n ) {\n s[ nct ] = A[ nct * n + nct ];\n }\n if ( m < p ) {\n s[ p - 1 ] = 0.0;\n }\n if ( nrt + 1 < p ) {\n e[ nrt ] = A[ nrt * n + p - 1 ];\n }\n e[ p - 1 ] = 0.0;\n\n // If required, generate U.\n\n if ( wantu ) {\n for ( j = nct; j < nu; j++ ) {\n for ( i = 0; i < m; i++ ) {\n U[ i * nu + j ] = 0.0;\n }\n U[ j * nu + j ] = 1.0;\n }\n for ( k = nct - 1; k >= 0; k-- ) {\n if ( s[ k ] !== 0.0 ) {\n for ( j = k + 1; j < nu; j++ ) {\n t = 0;\n for ( i = k; i < m; i++ ) {\n t += U[ i * nu + k ] * U[ i * nu + j ];\n }\n t = -t / U[ k * nu + k ];\n for ( i = k; i < m; i++ ) {\n U[ i * nu + j ] += t * U[ i * nu + k ];\n }\n }\n for ( i = k; i < m; i++ ) {\n U[ i * nu + k ] = -U[ i * nu + k ];\n }\n U[ k * nu + k ] = 1.0 + U[ k * nu + k ];\n for ( i = 0; i < k - 1; i++ ) {\n U[ i * nu + k ] = 0.0;\n }\n }\n else {\n for ( i = 0; i < m; i++ ) {\n U[ i * nu + k ] = 0.0;\n }\n U[ k * nu + k ] = 1.0;\n }\n }\n }\n\n // If required, generate V.\n\n if ( wantv ) {\n for ( k = n - 1; k >= 0; k-- ) {\n if ( (k < nrt) && (e[ k ] !== 0.0) ) {\n for ( j = k + 1; j < nu; j++ ) {\n t = 0;\n for ( i = k + 1; i < n; i++ ) {\n t += V[ i * n + k ] * V[ i * n + j ];\n }\n t = -t / V[ (k + 1) * n + k ];\n for ( i = k + 1; i < n; i++ ) {\n V[ i * n + j ] += t * V[ i * n + k ];\n }\n }\n }\n for ( i = 0; i < n; i++ ) {\n V[ i * n + k ] = 0.0;\n }\n V[ k * n + k ] = 1.0;\n }\n }\n\n // Main iteration loop for the singular values.\n\n var pp = p - 1;\n var iter = 0;\n var eps = pow( 2.0, -52.0 );\n var tiny = pow( 2.0, -966.0 );\n while ( p > 0 ) {\n var kase;\n\n // Here is where a test for too many iterations would go.\n if ( iter > 500 ) {\n break;\n }\n\n // This section of the program inspects for\n // negligible elements in the s and e arrays. On\n // completion the variables kase and k are set as follows.\n\n // kase = 1 if s(p) and e[k-1] are negligible and k<p\n // kase = 2 if s(k) is negligible and k<p\n // kase = 3 if e[k-1] is negligible, k<p, and\n // s(k), ..., s(p) are not negligible (qr step).\n // kase = 4 if e(p-1) is negligible (convergence).\n\n for ( k = p - 2; k >= -1; k-- ) {\n if ( k === -1 ) {\n break;\n }\n if ( abs( e[ k ] ) <=\n tiny + eps * (abs( s[ k ] ) + abs( s[ k + 1 ] )) ) {\n e[ k ] = 0.0;\n break;\n }\n }\n if ( k === p - 2 ) {\n kase = 4;\n }\n else {\n var ks;\n for ( ks = p - 1; ks >= k; ks-- ) {\n if ( ks === k ) {\n break;\n }\n t = (ks !== p ? abs( e[ ks ] ) : 0) +\n (ks !== k + 1 ? abs( e[ ks - 1 ] ) : 0);\n if ( abs( s[ ks ] ) <= tiny + eps * t ) {\n s[ ks ] = 0.0;\n break;\n }\n }\n if ( ks === k ) {\n kase = 3;\n }\n else if ( ks === p - 1 ) {\n kase = 1;\n }\n else {\n kase = 2;\n k = ks;\n }\n }\n k++;\n\n // Perform the task indicated by kase.\n\n switch( kase ) {\n\n // Deflate negligible s(p).\n\n case 1:\n {\n f = e[ p - 2 ];\n e[ p - 2 ] = 0.0;\n for ( j = p - 2; j >= k; j-- ) {\n t = hypot( s[ j ], f );\n cs = s[ j ] / t;\n sn = f / t;\n s[ j ] = t;\n if ( j !== k ) {\n f = -sn * e[ j - 1 ];\n e[ j - 1 ] = cs * e[ j - 1 ];\n }\n if ( wantv ) {\n for ( i = 0; i < n; i++ ) {\n t = cs * V[ i * n + j ] + sn * V[ i * n + p - 1 ];\n V[ i * n + p - 1 ] = -sn * V[ i * n + j ] + cs * V[ i * n + p - 1 ];\n V[ i * n + j ] = t;\n }\n }\n }\n }\n break;\n\n // Split at negligible s(k).\n\n case 2:\n {\n f = e[ k - 1 ];\n e[ k - 1 ] = 0.0;\n for ( j = k; j < p; j++ ) {\n t = hypot( s[ j ], f );\n cs = s[ j ] / t;\n sn = f / t;\n s[ j ] = t;\n f = -sn * e[ j ];\n e[ j ] = cs * e[ j ];\n if ( wantu ) {\n for ( i = 0; i < m; i++ ) {\n t = cs * U[ i * nu + j ] + sn * U[ i * nu + k - 1 ];\n U[ i * nu + k - 1 ] = -sn * U[ i * nu + j ] + cs * U[ i * nu + k - 1 ];\n U[ i * nu + j ] = t;\n }\n }\n }\n }\n break;\n\n // Perform one qr step.\n\n case 3:\n {\n\n // Calculate the shift.\n\n var scale = max( max( max( max( abs( s[ p - 1 ] ), abs( s[ p - 2 ] ) ), abs( e[ p - 2 ] ) ), abs( s[ k ] ) ), abs( e[ k ] ) );\n var sp = s[ p - 1 ] / scale;\n var spm1 = s[ p - 2 ] / scale;\n var epm1 = e[ p - 2 ] / scale;\n var sk = s[ k ] / scale;\n var ek = e[ k ] / scale;\n var b = ((spm1 + sp) * (spm1 - sp) + epm1 * epm1) / 2.0;\n var c = (sp * epm1) * (sp * epm1);\n var shift = 0.0;\n if ( (b !== 0.0) || (c !== 0.0) ) {\n shift = Math.sqrt( b * b + c );\n if ( b < 0.0 ) {\n shift = -shift;\n }\n shift = c / (b + shift);\n }\n f = (sk + sp) * (sk - sp) + shift;\n var g = sk * ek;\n\n // Chase zeros.\n\n for ( j = k; j < p - 1; j++ ) {\n t = hypot( f, g );\n cs = f / t;\n sn = g / t;\n if ( j !== k ) {\n e[ j - 1 ] = t;\n }\n f = cs * s[ j ] + sn * e[ j ];\n e[ j ] = cs * e[ j ] - sn * s[ j ];\n g = sn * s[ j + 1 ];\n s[ j + 1 ] = cs * s[ j + 1 ];\n if ( wantv ) {\n for ( i = 0; i < n; i++ ) {\n t = cs * V[ i * n + j ] + sn * V[ i * n + j + 1 ];\n V[ i * n + j + 1 ] = -sn * V[ i * n + j ] + cs * V[ i * n + j + 1 ];\n V[ i * n + j ] = t;\n }\n }\n t = hypot( f, g );\n cs = f / t;\n sn = g / t;\n s[ j ] = t;\n f = cs * e[ j ] + sn * s[ j + 1 ];\n s[ j + 1 ] = -sn * e[ j ] + cs * s[ j + 1 ];\n g = sn * e[ j + 1 ];\n e[ j + 1 ] = cs * e[ j + 1 ];\n if ( wantu && (j < m - 1) ) {\n for ( i = 0; i < m; i++ ) {\n t = cs * U[ i * nu + j ] + sn * U[ i * nu + j + 1 ];\n U[ i * nu + j + 1 ] = -sn * U[ i * nu + j ] + cs * U[ i * nu + j + 1 ];\n U[ i * nu + j ] = t;\n }\n }\n }\n e[ p - 2 ] = f;\n iter = iter + 1;\n }\n break;\n\n // Convergence.\n\n case 4:\n {\n\n // Make the singular values positive.\n\n if ( s[ k ] <= 0.0 ) {\n s[ k ] = (s[ k ] < 0.0 ? -s[ k ] : 0.0);\n if ( wantv ) {\n for ( i = 0; i <= pp; i++ ) {\n V[ i * n + k ] = -V[ i * n + k ];\n }\n }\n }\n\n // Order the singular values.\n\n while ( k < pp ) {\n if ( s[ k ] >= s[ k + 1 ] ) {\n break;\n }\n t = s[ k ];\n s[ k ] = s[ k + 1 ];\n s[ k + 1 ] = t;\n if ( wantv && (k < n - 1) ) {\n for ( i = 0; i < n; i++ ) {\n t = V[ i * n + k + 1 ];\n V[ i * n + k + 1 ] = V[ i * n + k ];\n V[ i * n + k ] = t;\n }\n }\n if ( wantu && (k < m - 1) ) {\n for ( i = 0; i < m; i++ ) {\n t = U[ i * nu + k + 1 ];\n U[ i * nu + k + 1 ] = U[ i * nu + k ];\n U[ i * nu + k ] = t;\n }\n }\n k++;\n }\n iter = 0;\n p--;\n }\n break;\n\n default:\n throw new Error( 'invalid kase: ' + kase );\n }\n }\n }", "title": "" }, { "docid": "95ec9fc0dcfe0e18267d3a0f8cbb1ad0", "score": "0.56602615", "text": "transpose ()\r\n {\r\n var m = new Matrix (this.cols, this.rows);\r\n for (var i = 0; i < this.rows; i++)\r\n for (var j = 0; j < this.cols; j++)\r\n m.data[j][i] = this.data[i][j];\r\n return m;\r\n }", "title": "" }, { "docid": "86a0e0b101d39d835312202f3caa10f8", "score": "0.565856", "text": "function MatrixOperations(){\t\t\r\n\t\t/**\r\n\t\t * Adds sourceCol to targetCol and writes result into targetCol.\r\n\t\t */\r\n\t\tthis.addToCol = function(sourceCol, targetCol){\t\t\t\t\t\t\r\n\t\t\tfor(var row in this.data){\r\n\t\t\t\tvar result = add(this.data[row][sourceCol], this.data[row][targetCol]);\t\t\t\t\r\n\t\t\t\tif(result){\r\n\t\t\t\t\tthis.data[row][targetCol] = result;\r\n\t\t\t\t} else if(this.data[row][targetCol]) {\r\n\t\t\t\t\tdelete this.data[row][targetCol];\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t};\t\t\r\n\t\t\r\n\t\t/**\r\n\t\t * This method translates values which valuates to undefined to 0.\r\n\t\t * adds a and b in Z/2Z\r\n\t\t */\r\n\t\tfunction add(a, b){\r\n\t\t\tvar _a = a == undefined ? 0 : a;\r\n\t\t\tvar _b = b == undefined ? 0 : b;\r\n\t\t\treturn _a == _b ? 0 : (_b > _a ? _b : _a);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "9122f86f728670b2420450a68d1d3d5d", "score": "0.5640479", "text": "function Matrix(ary) {\n this.mtx = ary;\n this.height = ary.length;\n this.width = ary[0].length;\n }", "title": "" }, { "docid": "29f0360fffb3c80e33d72e90c08e1393", "score": "0.56394833", "text": "re() {\n return new Vector(this.x, this.y);\n }", "title": "" }, { "docid": "7ac24fcaebe5ad67e852d7733ee61fcf", "score": "0.5632814", "text": "function makeMatrix2D (mA) {\n var $M = window.$M; // sylvester library\n var m = null;\n if (mA && mA.length === 6) {\n m = $M([\n [mA[0], mA[2], mA[4]],\n [mA[1], mA[3], mA[5]],\n [0,0,1]\n ]);\n }\n return m;\n }", "title": "" }, { "docid": "4b9f5d64ed11eef1505208db45fe6e2f", "score": "0.5632515", "text": "componentProduct(vector) {\n this.x *= vector.x;\n this.y *= vector.y;\n }", "title": "" }, { "docid": "cee611f41de63218c9db6dc73e13fea5", "score": "0.5630969", "text": "static set matrix(value) {}", "title": "" }, { "docid": "7030508b4122de94c5f1a114a1373614", "score": "0.5629375", "text": "get sizeAsVec(){\n return new Vector(this.colNum, this.rowNum);\n }", "title": "" }, { "docid": "577bd990b144d61846bb55d6f3c2236a", "score": "0.5621013", "text": "function mvPushMatrix() {\r\n var copy = old_mat4().create();\r\n old_mat4().set(mvMatrix, copy);\r\n mvMatrixStack.push(copy);\r\n}", "title": "" }, { "docid": "2dea077516671bf358be7eaad375269f", "score": "0.56206137", "text": "function mvPushMatrix() {\n var copy = mat4.create(mvMatrix);\n mvMatrixStack.push(copy);\n}", "title": "" }, { "docid": "36ea28ded80db4e4bef90dccc8d64442", "score": "0.5617912", "text": "function vector(X, Y)\n{\n\treturn {x: X, y: Y};\n}", "title": "" }, { "docid": "e3688ced5619e4272386c2ba1af128c7", "score": "0.5614302", "text": "transpose() {\n let result = new Matrix(this.cols, this.rows);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.cols; j++) {\n result.data[j][i] = this.data[i][j];\n }\n }\n return result;\n }", "title": "" }, { "docid": "3cdef0911480e635362f3952b21f4aef", "score": "0.5613899", "text": "function Vec(x,y){ // because I dont like typing in new\n return new _Vec(x,y);\n }", "title": "" }, { "docid": "6105f0d9739a5746ffc329b2acf68ff6", "score": "0.560368", "text": "function getMatrix(columns) {\r\n let cols = columns.map((col) => col.split(',').map((val) => parseFloat(val)));\r\n let m = new THREE.Matrix4();\r\n // set takes vals in row-major order\r\n m.set(cols[0][0], cols[1][0], cols[2][0], 0,\r\n cols[0][1], cols[1][1], cols[2][1], 0,\r\n cols[0][2], cols[1][2], cols[2][2], 0,\r\n 0, 0, 0, 1);\r\n return m;\r\n}", "title": "" }, { "docid": "d7ead16886dbb1b88cd3a1471d49cce2", "score": "0.55929255", "text": "static transpose(matrix) {\n let matrixWidth = matrix.height;\n let matrixHeight = matrix.width;\n let newMatrix = new Matrix(matrixWidth, matrixHeight);\n\n for(let j = 0; j < matrixHeight; j++) {\n for(let i = 0; i < matrixWidth; i++) {\n newMatrix.matrix[i][j] = matrix._matrix[j][i];\n }\n }\n\n return newMatrix\n }", "title": "" }, { "docid": "d1aa5b4510bee4a9595005b730babfd3", "score": "0.55864286", "text": "function toMatrix(items, columnCount) {\n return items.reduce(function (rows, currentValue, index) {\n if (index % columnCount === 0) {\n rows.push([currentValue]);\n }\n else {\n rows[rows.length - 1].push(currentValue);\n }\n return rows;\n }, []);\n}", "title": "" }, { "docid": "d1aa5b4510bee4a9595005b730babfd3", "score": "0.55864286", "text": "function toMatrix(items, columnCount) {\n return items.reduce(function (rows, currentValue, index) {\n if (index % columnCount === 0) {\n rows.push([currentValue]);\n }\n else {\n rows[rows.length - 1].push(currentValue);\n }\n return rows;\n }, []);\n}", "title": "" }, { "docid": "d1aa5b4510bee4a9595005b730babfd3", "score": "0.55864286", "text": "function toMatrix(items, columnCount) {\n return items.reduce(function (rows, currentValue, index) {\n if (index % columnCount === 0) {\n rows.push([currentValue]);\n }\n else {\n rows[rows.length - 1].push(currentValue);\n }\n return rows;\n }, []);\n}", "title": "" }, { "docid": "d1aa5b4510bee4a9595005b730babfd3", "score": "0.55864286", "text": "function toMatrix(items, columnCount) {\n return items.reduce(function (rows, currentValue, index) {\n if (index % columnCount === 0) {\n rows.push([currentValue]);\n }\n else {\n rows[rows.length - 1].push(currentValue);\n }\n return rows;\n }, []);\n}", "title": "" }, { "docid": "8e45f1e12b774e65acc30d69a6c66b3f", "score": "0.557955", "text": "function mvPushMatrix() \n{\n var copy = mat4.create();\n mat4.set(mvMatrix, copy);\n mvMatrixStack.push(copy);\n}", "title": "" }, { "docid": "450ff29a8c08d8c7682fe6e59a719b2d", "score": "0.5570857", "text": "function addVectors(v) {\n var add = true;\n while (add) {\n if (v.length == 2) {\n add = false;\n return mathjs.add(v[0], v[1]);\n } else {\n result = mathjs.add(v[0], v[1]);\n // remove the first vector in array\n v.shift();\n // replace the new first element in array with result\n v[0] = result;\n }\n }\n}", "title": "" }, { "docid": "c143cf1a00b4bfd9fd06f454f62fc095", "score": "0.5559703", "text": "static arrayToMatrix(arr) {\n let new_matrix = new Matrix(arr.length, 1);\n new_matrix.map((elm, i, j) => {\n return arr[i];\n })\n return new_matrix;\n }", "title": "" } ]
c09c19e8b3ad08f731073e05e848994d
Gets the user's default company.
[ { "docid": "dcb605ae6864ad0915938b71f92fbcb1", "score": "0.5530931", "text": "getUserDefaultCompany(companyId, token) {\n const data = {\n Authorization: token\n };\n axios\n .get(`${VUE_APP_BASE_API_URL}/companies?q=(id:${companyId})`, {\n headers: data\n })\n .then(response => {\n this.props.changeActiveCompany({ company: response.data[0] });\n this.changeScreen('dashboard');\n })\n .catch(function(error) {\n // handle error\n console.log(error);\n })\n .then(function() {\n // always executed\n });\n }", "title": "" } ]
[ { "docid": "7755be4d7a2870409d23444657bd5cf8", "score": "0.65907705", "text": "getCompany() {\n \tfor(let comp of allCompanies){\n \t\tif(comp.name == this.companyName){\n \t\t\treturn comp\n \t\t}\n \t}\n \treturn -1\n }", "title": "" }, { "docid": "d31ebf3637c4b56a7f06505f9bd3f394", "score": "0.606585", "text": "function userCompany(userId){\n var company = Meteor.users.findOne({\"_id\": userId}, { fields: {\"company\": 1}});\n return company.company;\n}", "title": "" }, { "docid": "edd9ceb76e4b7871d1cbb38a34bd1f14", "score": "0.6016486", "text": "function getDefaultOwner() {\n return defaultOwner;\n}", "title": "" }, { "docid": "6c70bd7d0d95d2a28bda8d8438140dce", "score": "0.5941819", "text": "static async getCompany(handle) {\n let res = await this.request(`companies/${handle}`);\n return res.company;\n }", "title": "" }, { "docid": "6c70bd7d0d95d2a28bda8d8438140dce", "score": "0.5941819", "text": "static async getCompany(handle) {\n let res = await this.request(`companies/${handle}`);\n return res.company;\n }", "title": "" }, { "docid": "6c70bd7d0d95d2a28bda8d8438140dce", "score": "0.5941819", "text": "static async getCompany(handle) {\n let res = await this.request(`companies/${handle}`);\n return res.company;\n }", "title": "" }, { "docid": "6c70bd7d0d95d2a28bda8d8438140dce", "score": "0.5941819", "text": "static async getCompany(handle) {\n let res = await this.request(`companies/${handle}`);\n return res.company;\n }", "title": "" }, { "docid": "2b27a8da99e7d3ab75fc6337d2f66408", "score": "0.5935781", "text": "get defaultOu() {\n return this.getStringAttribute('default_ou');\n }", "title": "" }, { "docid": "226a5f94a38d0043ca28c8ebb887bcfb", "score": "0.5752516", "text": "static async getCompany(handle) {\n const res = await this.request(`companies/${handle}`);\n console.log(\"res.companies: \", res.company);\n return res.company;\n }", "title": "" }, { "docid": "a0e3d3c909381c9c235a4394aeb2d463", "score": "0.5724943", "text": "function getCompany() {\n console.log(\"company: \" + window.navigator.vendor);\n}", "title": "" }, { "docid": "5c1d232bf98cf38ef865fec166cb209f", "score": "0.5688987", "text": "get company() {\n return this._r;\n }", "title": "" }, { "docid": "c73b5e24345d785442511a6f89a215e7", "score": "0.5613216", "text": "function getCompanyForNetwork (networkString, companies = []) {\n const company = companies.find(co => co.id === networkString)\n if (!company) {\n console.warn(`No company found in config.yml that matches rented vehicle network: ${networkString}`, companies)\n }\n return company\n}", "title": "" }, { "docid": "fabc9988963692fda859597f285f8b6e", "score": "0.5534757", "text": "function getCompany() {\n CompanyService.perform().get({id: companyId}).$promise\n .then(function (company) {\n $scope.company = company;\n $log.debug(\"Fetched company\", company);\n\n $scope.originCompany = angular.copy(company);\n\n getEmployees(company);\n getCustomers(company);\n\n }, function (error) {\n $log.error(\"Failed to fetch company by id\", error);\n });\n }", "title": "" }, { "docid": "e4c6c47f6c4430dc0a1f6433017621fc", "score": "0.54604393", "text": "function getCurrentDomain(defaultDomain) {\n\t\tvar currentDomain = defaultDomain;\n\t\tvar documentDomain = \".\" + document.domain;\n\t\t\n\t\tif(documentDomain.indexOf(currentDomain) == -1){\n\t\t\tcurrentDomain = document.domain.substr(document.domain.indexOf(\".\"));\n\t\t}\t\t\n\t\treturn currentDomain;\n\t}", "title": "" }, { "docid": "8eaf9fa071c9b15cbbce93e50e9dbb3a", "score": "0.54322946", "text": "defaultAccount() {\n \n return new Promise((resolve, reject) => {\n web3.eth.getAccounts((err, accounts) => {\n if (err !== null) {\n reject(err);\n } else if (accounts.length === 0) {\n resolve('');\n } else {\n resolve(accounts[0]);\n }\n });\n });\n }", "title": "" }, { "docid": "51b5f848f3248bba57c155642a61e29a", "score": "0.53837436", "text": "get OSDefault() {}", "title": "" }, { "docid": "eee46f746bf3fac4babce62f4f03c261", "score": "0.5375822", "text": "static async getCompanies() {\n let res = await this.request(`companies/`);\n return res.companies;\n }", "title": "" }, { "docid": "3fbac15b8ead58341af512edf071cd7b", "score": "0.5369484", "text": "static async getCompanies() {\n let res = await this.request(`companies`);\n return res;\n }", "title": "" }, { "docid": "bb611faf3ac050e0cf2b0a5b00b1f47c", "score": "0.5309513", "text": "function getDefaultAccount() {\r\n return localStorage[\"default_account\"];\r\n}", "title": "" }, { "docid": "24ba1963aa35ae2a69887a8df4d96ecb", "score": "0.5300498", "text": "function get_po_default_values() {\n var po_default_values_local;\n\n frappe.call({\n method: \"nhance.nhance.doctype.stock_requisition.stock_requisition.get_po_default_values\",\n args: {},\n async: false,\n callback: function(r) {\n if (r.message) {\n po_default_values_local = r.message;\n }\n\n } //end of call back\n }); // end of frappe call\n return po_default_values_local\n\n}", "title": "" }, { "docid": "667be776aa6213db27b62fad02dd96bc", "score": "0.5285994", "text": "async function getOneCompany(accountid, companyId) {\n try {\n const endpoint = `${config.httpRequest.ForgeBaseUrl}/hq/v1/accounts/${accountid}/companies/${companyId}`\n const headers = config.httpRequest.httpHeaders(config.credentials.token_2legged)\n const response = await get(endpoint, headers);\n if (response) {\n return response.name;\n } else {\n console.log(`get one company info failed`)\n }\n } catch (e) {\n console.log(`getOneCompany failed: ${e}`)\n }\n}", "title": "" }, { "docid": "c76c2a59d1cc1ef8019605c2a15991eb", "score": "0.52730703", "text": "function getCompanyDetails() {\n return {\n name: 'Novi Hogeschool',\n adress: 'Zonnebaan 9, Utrecht',\n }\n}", "title": "" }, { "docid": "6692d8cee964574d161d76b613396e66", "score": "0.5261773", "text": "function get_default_channel() {\n if (config[\"default_guild\"] !== null && config[\"default_channel\"] !== null) {\n guild = client.guilds.array()[config[\"default_guild\"]];\n if (guild !== undefined) {\n channel = guild.channels.array()[config[\"default_channel\"]];\n if (channel !== undefined) {\n if (channel.type !== \"text\") {\n console_out(\"[Config Error] the default channel is a voice channel\");\n console_out(\n \"[Config Error] set both default_channel and default_guild to null again to fix\"\n );\n console_out(\n \"[Config Error] then use the /info command to find out the channel indices\"\n );\n rl.pause();\n rl_sync.keyInPause(\" \");\n rl.resume();\n return false;\n }\n set_title(\"#\" + channel_name());\n update_prompt();\n return true;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "2593765dd69f5f1c5ad6f1403e1497a9", "score": "0.52456504", "text": "get Default() {}", "title": "" }, { "docid": "5a63ff826d49444508a68640ba329183", "score": "0.52393", "text": "function _default(userid) {\n return QueUp.helpers.isSiteAdmin(userid) || QueUp.room.users.getIfOwner(userid) || QueUp.room.users.getIfManager(userid) || QueUp.room.users.getIfMod(userid);\n}", "title": "" }, { "docid": "80216c8990ed0f876ae581fbd299f48a", "score": "0.5230658", "text": "static async getAllCompanies() {\n let res = await this.request(`companies`);\n return res.companies;\n }", "title": "" }, { "docid": "2b47a3306ef479e9b6fa5bfdbb558d62", "score": "0.5229298", "text": "function getCompanyAddress() {\n return contract.getCompanyAddress();\n}", "title": "" }, { "docid": "90490aff9d279e25f69fd98dbd0535fd", "score": "0.5163835", "text": "async function getDefaultCalendarSource() {\n const calendars = await Calendar.getCalendarsAsync();\n const defaultCalendars = calendars.filter(\n each => each.source.name === 'Default'\n );\n return defaultCalendars[0].source;\n }", "title": "" }, { "docid": "bfb5a0db6cd7fb4f1819babcfa126d60", "score": "0.51448464", "text": "function setDefaultAccount(){\n web3.eth.getAccounts(function(error, result){\n if(!error){\n defaultAcc = result[0];\n var client1 = new client();\n client1.execute();\n }\n });\n}", "title": "" }, { "docid": "6b55aa46e08c09f89546cf1a6945c265", "score": "0.5117811", "text": "getCurrentUser(){\n const userPool = new UserPool(this.poolData);\n return userPool.getCurrentUser();\n }", "title": "" }, { "docid": "4609eec98551c55a9adc0a3a4b3e668e", "score": "0.51097697", "text": "function _getLogo(companyName) {\n\t\tvar logo;\n\t\tvar logoPath = 'assets/images/logo/';\n\n\t\tif (companyName) {\n\t\t\tcompanyName = companyName.toLowerCase();\n\t\t\tif(logoImagesConfig.logo[companyName]){\n\t\t\t\tlogo = logoPath + companyName + '.png';\n\t\t\t}\n\t\t}\n\n\t\treturn logo;\n\t}", "title": "" }, { "docid": "d873fcf4fb8814baac3c3f897dc9ea21", "score": "0.51065385", "text": "function grabCompanyData(){\n var company = {};\n company.name = $('#form-company-name').val();\n company.email = $('#form-email').val();\n company.phone_number = $('#form-phone').val();\n return company;\n\n }", "title": "" }, { "docid": "9dd52617061b376e7d8e8c106ab5f34a", "score": "0.51035136", "text": "function getWebsite(callback) {\n if (typeof window.domain == \"undefined\") {\n if (typeof window.last_company != \"undefined\" && typeof window.last_company_path != \"undefined\") {\n if (window.last_company_path.indexOf(\"linkedin.com\") > -1) {\n linkedin_company_page = window.last_company_path;\n } else {\n linkedin_company_page = \"https://www.linkedin.com\" + window.last_company_path;\n }\n $.ajax({\n url : linkedin_company_page,\n type : 'GET',\n success : function(response){\n if (websiteFromCompanyPage(response) == \"http://\" || websiteFromCompanyPage(response) == false) {\n askDomainName(true);\n }\n else {\n callback(websiteFromCompanyPage(response));\n }\n },\n error : function() {\n askDomainName(true);\n }\n });\n }\n else {\n askDomainName(true);\n }\n }\n else {\n callback(window.domain);\n }\n}", "title": "" }, { "docid": "69a8a2b12795114207650bfbe0cbc510", "score": "0.5064431", "text": "function getCurrentUser() {\n console.log(\"TODO: using default user...\");\n return \"VersioningSystem\";\n}", "title": "" }, { "docid": "428f5bc3c6bb4a594ccdf34b77f8852b", "score": "0.49807134", "text": "function whichClient(userType) {\n //0 = normal \n if (userType == 0) {\n return 0;\n } else {\n // 1 = company\n return -5;\n }\n}", "title": "" }, { "docid": "3cde78832da06a826de0c913e6d0013f", "score": "0.49796614", "text": "function getOptions(){return defaultOptions;}", "title": "" }, { "docid": "23359c70da0aba3b70e39c96cc349c46", "score": "0.4939211", "text": "getDefault(){\n //var promise = new Promise((resolve, reject) => {\n // resolve (this.defaultBrand);\n // });\n // return promise;\n return this.defaultBrand;\n }", "title": "" }, { "docid": "3f993ea32636aa12c13880461a2378c5", "score": "0.49053898", "text": "async function getPreferenceOrDefault(handlerInput, defaultObj) {\n if (personalizationUtil.getPerson(handlerInput)) {\n return await handlerInput.attributesManager.getPersistentAttributes();\n }\n return defaultObj;\n}", "title": "" }, { "docid": "5d5260e4fdd10547ca7e82862c0cb9d4", "score": "0.48923448", "text": "function getPrimaryContact( user, callback ) {\n YDC.mongodb.runDb( {\n user: user,\n model: 'employee',\n action: 'get',\n query: { _id: user.specifiedBy, status: { $ne: \"INACTIVE\" } },\n callback: function( err, result ) {\n var\n theEmployee = result && result[0],\n email, mobilePhone, phone;\n if( err || !theEmployee || !theEmployee.communications ) {\n return callback( err || Y.doccirrus.errors.rest( 400, 'employee contact not found' ) );\n }\n\n email = Y.doccirrus.schemas.simpleperson.getEmail( theEmployee.communications );\n phone = Y.doccirrus.schemas.simpleperson.getPhone( theEmployee.communications );\n mobilePhone = Y.doccirrus.schemas.simpleperson.getMobile( theEmployee.communications );\n callback( null, {\n email: email && email.value,\n phone: phone && phone.value,\n mobile: mobilePhone && mobilePhone.value\n } );\n }\n } );\n }", "title": "" }, { "docid": "e993a19d88f086d8730c29bdf4b8eb46", "score": "0.48875046", "text": "static async getDetailsForCompany(handle) {\n let res = await this.request(`companies/${handle}`);\n return res.company;\n }", "title": "" }, { "docid": "69bc4b777d556e2541b9bdf85e5913fa", "score": "0.48857433", "text": "function getCompanyName() {\n\t\tvar company = JSON.parse($.cookie('company'));\n\n\t\t$.each(company, function(id, companyObject) {\n\t\t\t//console.log(id);\n\t\t\t$(\"#companyName\").append(company[id].name);\n\t\t});\n\t}", "title": "" }, { "docid": "f1b002f5cedb3667df8836506a4ec14d", "score": "0.48778293", "text": "async function getComp() {\n let res = await JoblyApi.getCompany(handle);\n setCompany(res);\n setIsLoading(false);\n }", "title": "" }, { "docid": "ff1b81e7a49d48f4faa845cb7fd893e7", "score": "0.487082", "text": "get defaultControl() {\n return $('marketing-opt-in-impl');\n }", "title": "" }, { "docid": "460e310fe3e3e13467f80afc66f2ef9d", "score": "0.4846719", "text": "static async getCompanies(searchTerm) {\n let res;\n if (searchTerm === \"\") {\n res = await this.request(`companies`);\n } else {\n res = await this.request(`companies`, { name: searchTerm });\n }\n return res.companies;\n }", "title": "" }, { "docid": "f4be419ebee634c659ad9097d4771a1d", "score": "0.48358417", "text": "function getTravellerCompanies() {\r\n var query = breeze.EntityQuery\r\n .from('Company')\r\n .where('DefaultCompany', '==', true)\r\n .expand(\"Address\");\r\n\r\n\r\n var promise = managerTraveller.executeQuery(query).catch(queryFailed);\r\n return promise;\r\n\r\n function queryFailed(error) {\r\n console.log(error.message, 'query failed');\r\n throw error;\r\n }\r\n }", "title": "" }, { "docid": "b5096f720ad0b073b6563e9e4ebf57a7", "score": "0.4833256", "text": "static async getCompanies(params) {\n let res = await this.request(`companies`, { name: params });\n return res.companies;\n }", "title": "" }, { "docid": "d2170a1ef99808b49885ea15ad96b8ab", "score": "0.4829226", "text": "async function getCompanyByEmail(obj, args, context, info) {\n\n // 1. email exists\n let email = args.email\n if (!email) {\n return {\n err_code: 4000,\n err_msg: 'Email is empty'\n }\n }\n\n let myUserId = store.getUserId()\n\n // 2. my company exist\n let userCompany = await Company.findUserCompany(myUserId)\n if (!userCompany) {\n return {\n err_code: 4001,\n err_msg: 'Can not find user company'\n }\n }\n\n // 3. find user by email\n let user = await User.findOne({email: email, active: true })\n if (!user) {\n return {}\n }\n\n // 4. find company with this user id\n // Company.findUserCompany return a mongoose model, not a JSON object\n let company = await Company.findUserCompany(user._id)\n console.log('company result', company)\n if (!company) {\n return {}\n }\n \n delete company.clients\n delete company.vendors\n delete company.creatorCompanyId\n delete company.members\n delete company.invoiceEmails\n\n return company\n\n}", "title": "" }, { "docid": "5fae93c8817e5b450b87e2052c7c42fd", "score": "0.48279828", "text": "function getOptions() {\n return defaultOptions;\n }", "title": "" }, { "docid": "dcd576c45fee6019982d08866d2b4055", "score": "0.4825714", "text": "function defaultValue() {\n return {\n email: \"\",\n password: \"\",\n };\n}", "title": "" }, { "docid": "8af737aba2d8aeb4102e0837cd269582", "score": "0.48247918", "text": "static async getUserOwnedCompanies(req, res) {\n\t\ttry {\n\t\t\t// fetch companies from service\n\t\t\tlet companies = await CompanyService.getUserOwnedCompanies(req.user.id)\n\t\t\t// response\n\t\t\tres.json(response.success(ka.request_success, companies))\n\t\t} catch (error) {\n\t\t\tres.json(response.error(ka.request_error))\n\t\t}\n\t}", "title": "" }, { "docid": "44033608364c41ada1fee7d7360c8b08", "score": "0.48196003", "text": "getCompanyConfiguration({ id } = {}) {\n var path = this.buildUrl({\n url: `/api/v2/companies/${id}/configuration`,\n parameters: {}\n });\n return this.restCall({ url: path, verb: 'get', payload: null });\n }", "title": "" }, { "docid": "94ae12b15123224b5d886d3821f4ba53", "score": "0.48186657", "text": "getCompanyInfo(callBack) {\n let self = this;\n var msg = {};\n msg[\"token\"] = this.authenData.token;\n self.pomelo.request(\"connector.entryHandler.getCompanyInfo\", msg, (result) => {\n if (callBack != null)\n callBack(null, result);\n });\n }", "title": "" }, { "docid": "57afde3f5d8f81be39cdbbd04c6f114d", "score": "0.48164254", "text": "static getDefaultOptions() {\n return configGroup_1.ConfigGroup.getOptions(AliasGroup.ORGS, Aliases.getFileName());\n }", "title": "" }, { "docid": "5e13112399879ce6dcee3359e2f4dcdd", "score": "0.4809626", "text": "static getDefault(key) {\n return Config.SETTINGS[key].default;\n }", "title": "" }, { "docid": "8eb7952817a507290e15e8c2a96dd35a", "score": "0.4807423", "text": "async getCompanyInfo(){\n\t\tvar query = `SELECT DISTINCT ?title ?addressStreet ?addressCity ?addressPostalCode ?addressCountry ?telephone ?email ?bio WHERE \n\t\t{\n\t\t\t?p vcard:agent $id .\n ?p vcard:title ?title .\n ?p vcard:hasAddress ?address .\n ?address vcard:street-address ?addressStreet .\n ?address vcard:locality ?addressCity .\n ?address vcard:postal-code ?addressPostalCode .\n ?address vcard:country-name ?addressCountry .\n \n OPTIONAL {\n ?p vcard:hasTelephone ?phone .\n ?phone vcard:hasValue ?telephone .\n ?p vcard:email ?email .\n\t\t\t\t?p linkrec:BIO ?bio .\n }\n\t\t}`;\n\t\tlet qb = new QueryBuilder(query);\n\t\tqb.bindParamAsInt('$id', this.companyID);\n\t\t\n\t\t// Execute the query and reform into the desired output\n\t\treturn await qe.executeGetToOutput(qb.result());\n\t}", "title": "" }, { "docid": "66928e498e366d63725ba8b77f98a114", "score": "0.4806512", "text": "function getOptions() {\n\treturn defaultOptions;\n}", "title": "" }, { "docid": "66928e498e366d63725ba8b77f98a114", "score": "0.4806512", "text": "function getOptions() {\n\treturn defaultOptions;\n}", "title": "" }, { "docid": "3fe2dfba5a8f3f919248224677d4a116", "score": "0.48039448", "text": "function getDefaultProfileName() {\n return GM_getValue(PROPERTY_DEFAULT_PROFILE, \"\");\n}", "title": "" }, { "docid": "d7d3ac5bd37d546fa6e40ad0895b03d0", "score": "0.47804302", "text": "function retrieveStorage() {\n return JSON.parse(localStorage.getItem('companies'));\n }", "title": "" }, { "docid": "56ca8d799156744447d18b73a37fa1b9", "score": "0.4778492", "text": "getOwner() {\n const id = this.owner;\n const url = this.makeAbsoluteUrl(\"/api/users\", this.getLink(\"project\"));\n\n return Account.get({ id }, url);\n }", "title": "" }, { "docid": "d110bfa9a5087427c2ebe5ddca78baeb", "score": "0.47764623", "text": "function GetCurrentOwner() {\n // get the owner\n var owner = \"\";\n $.ajax({\n async: false,\n type: 'GET',\n url: '/Dashboard/GetCurrentUser',\n success: function (data) {\n owner = data;\n }\n });\n\n return owner;\n }", "title": "" }, { "docid": "103f6dde76ed72b43cebd5ac608c913e", "score": "0.47722074", "text": "function loadCompayInfo(){\n\t\t\tserviceApi.doPostWithoutData('/RLMS/admin/getAllApplicableCompanies')\n\t\t .then(function(response){\n\t\t \t\t$scope.companies = response;\n\t\t });\n\t\t}", "title": "" }, { "docid": "c41eb30f84ff1baa5098fedd1b0c19fc", "score": "0.47700578", "text": "function defaultCity() {\n let city = \"Nashville\";\n pullAPI2(city);\n pullAPI(city);\n cityName = \"\";\n}", "title": "" }, { "docid": "489f3e6040b919dcdeea33d835a51d81", "score": "0.47496852", "text": "get accWebsite() {\n if (this.accountRecord.data) {\n return this.accountRecord.data.fields.Website.value;\n\n }\n }", "title": "" }, { "docid": "b835f20c5dcf45c22c80ff5385accffb", "score": "0.47482505", "text": "function getOptions() {\r\n\treturn defaultOptions;\r\n}", "title": "" }, { "docid": "8d751ce86a74ebfa8b645e02c76e3435", "score": "0.4747874", "text": "static async getAuthUser(req, res) {\n\t\ttry {\n\t\t\t// get instance\n\t\t\tlet user = await models.User.findOne({\n\t\t\t\twhere: {\n\t\t\t\t\tid: req.user.id\n\t\t\t\t},\n\t\t\t\tinclude: {\n\t\t\t\t\tmodel: models.UserProfession,\n\t\t\t\t\twhere: {\n\t\t\t\t\t\tactive: true\n\t\t\t\t\t},\n\t\t\t\t\tinclude: {\n\t\t\t\t\t\tmodel: models.Profession,\n\t\t\t\t\t\trequired: false\n\t\t\t\t\t},\n\t\t\t\t\trequired: false\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tlet companies = await user.getOwnedCompanies({\n\t\t\t\traw: true\n\t\t\t})\n\n\t\t\t// return response\n\t\t\treturn res.json(response.success(ka.request_success, { user, companies }))\n\t\t} catch (error) {\n\t\t\treturn res.json(response.error(error.message))\n\t\t}\n\t}", "title": "" }, { "docid": "0620e11a07f98ec66566e66c1f57e59a", "score": "0.47377145", "text": "function getDefaultOrigin(self) {\n return (self.attributes.defaultOrigin || defaultOrigin);\n}", "title": "" }, { "docid": "1d5b5440badbbbdd9141555ba0b98d75", "score": "0.4730324", "text": "function getOptions() {\n\t\treturn defaultOptions;\n\t}", "title": "" }, { "docid": "aa6e879cff3dfe7135e41c3770871fdb", "score": "0.472904", "text": "static async getOneCompany(handle) {\n const result = await db.query(\n `SELECT handle, name, num_employees, description, logo_url \n FROM companies WHERE handle=$1`,\n [handle]);\n\n return result.rows[0];\n }", "title": "" }, { "docid": "1978c8f119bda2204b282809737a1e9b", "score": "0.4721813", "text": "async getDefaultServiceProjectId() {\n return new Promise(resolve => {\n child_process_1.exec('gcloud config config-helper --format json', (err, stdout) => {\n if (!err && stdout) {\n try {\n const projectId = JSON.parse(stdout).configuration.properties.core\n .project;\n resolve(projectId);\n return;\n }\n catch (e) {\n // ignore errors\n }\n }\n resolve(null);\n });\n });\n }", "title": "" }, { "docid": "a6b961019b4c0f828dbebcb02da068e0", "score": "0.46950966", "text": "getCompanyList(){\n return Companies.find().fetch();\n }", "title": "" }, { "docid": "12381310452fd9dd9bd8c465e3c93580", "score": "0.46903247", "text": "async function getCompanies() {\n\tconst key = 'companies'\n\tlet cachedata = await getFromCache(key)\n\n\tif (cachedata) {\n\t\tconsole.log(`Cache hit for key=${key}, cachedata = ${cachedata}`)\n\t\treturn { result: cachedata, cached: true }\n\t} else {\n\t\tconsole.log(`Cache miss for key=${key}, querying database`)\n\t\tlet executeResult = await executeQuery(\"SELECT name FROM companies\", [])\n\t\tlet data = executeResult.fetchAll()\n\t\tif (data) {\n\t\t\tlet result = data.map(row => row[0])\n\t\t\tconsole.log(`Got result=${result}, storing in cache`)\n\t\t\tif (memcached)\n\t\t\t\tawait memcached.set(key, result, cacheTimeSecs);\n\t\t\treturn { result, cached: false }\n\t\t} else {\n\t\t\tthrow \"No companies data found\"\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ef5d77b20bdee0442ebd954a20b09a9c", "score": "0.46898484", "text": "function read(companyName) {\n for (let company of DATA) {\n if (company.company == companyName) {\n return company;\n }\n }\n }", "title": "" }, { "docid": "fef84659770dae0f639e2eb80dc840a9", "score": "0.46864527", "text": "function formatCompany(company) {\n return {\n id: company._id,\n name: company.name,\n annualEarnings: company.annualEarnings,\n type: company.type,\n parentCompany: company.parentCompany,\n childs: [],\n annualEarningsSum: 0,\n level: 0,\n last: true\n };\n}", "title": "" }, { "docid": "e60a8ed9bc2188b3bc6b65014d43bd75", "score": "0.4681476", "text": "function getDefault(value, optional) {\n return value || optional;\n }", "title": "" }, { "docid": "4efa5da77df6331bd669b733d5a607f3", "score": "0.46738565", "text": "function okGetPreferences(okPrefName, okPrefDefault) {\r\n\t// This function works like GM_getValue, except that it returns the default if the key is empty.\r\n\t// (The original only returns the default if the key is non-existent.)\r\n\tif (GM_getValue(okPrefName, okPrefDefault) == \"\") {\r\n\t\treturn okPrefDefault;\r\n\t// This is for arrays. I'm not sure if this is the right way to do this, but w/e\r\n\t} else if (GM_getValue(okPrefName, okPrefDefault) == \"[\\\"\\\"]\") {\r\n\t\treturn \"[\\\"\" + okPrefDefault + \"\\\"]\";\r\n\t} else {\r\n\t\treturn GM_getValue(okPrefName, okPrefDefault);\r\n\t}\r\n}", "title": "" }, { "docid": "23309fb4125d00bb345ebc0d0e8366ed", "score": "0.46650973", "text": "function getSampleCompanyList() {\n var request = $http({\n method: \"GET\",\n async: true,\n cache: false,\n url: $rootScope.URL.getCompanyUrl\n });\n return (request.then(handleSuccess, handleError));\n }", "title": "" }, { "docid": "5fe9b9e81c8bf6eba20913cd3d87b2ec", "score": "0.46422878", "text": "function getCurrentUserLocale(state) {\n var defaultLocale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _constants.General.DEFAULT_LOCALE;\n var currentUser = (0, _common.getCurrentUser)(state);\n\n if (!currentUser) {\n return defaultLocale;\n }\n\n return currentUser.locale || defaultLocale;\n}", "title": "" }, { "docid": "1451a03e1f3efd349d36901dbcc09573", "score": "0.46416676", "text": "getCurrentUser() {\n return Api.get('/users/current');\n }", "title": "" }, { "docid": "c4e0fd28b99e777268af78588185d3ec", "score": "0.46399954", "text": "get defaultUserSettingsInput() {\n return this._defaultUserSettings;\n }", "title": "" }, { "docid": "9938a80be346a3a751b646376f155e87", "score": "0.46312678", "text": "function getOptions() {\n\t\t\treturn defaultOptions;\n\t\t}", "title": "" }, { "docid": "f71cabb9c2f0db84cdfa8955e249bc9a", "score": "0.4631103", "text": "function getDefaultConfigFile(){\n\treturn oneTimeScript.getDefaultConfig();\n}", "title": "" }, { "docid": "6db291505250cd826e2c5c3eb02f0d5a", "score": "0.4629638", "text": "static identifyDefaultOrgs(orgInfo, config) {\n if (config.defaultusername &&\n (orgInfo.username === config.defaultusername || orgInfo.alias === config.defaultusername)) {\n orgInfo.isDefaultUsername = true;\n }\n else if (config.defaultdevhubusername &&\n (orgInfo.username === config.defaultdevhubusername || orgInfo.alias === config.defaultdevhubusername)) {\n orgInfo.isDefaultDevHubUsername = true;\n }\n }", "title": "" }, { "docid": "b2ede667167e5b6de3a851195cd37eaa", "score": "0.46233156", "text": "static getCountry(user) {\n return user.country;\n }", "title": "" }, { "docid": "4aafda6c988f005364178cf98bb5ff38", "score": "0.462176", "text": "function get_user_company_info(company_id, cb) {\n var mycompany = new Array();\n var sqlquery = \"SELECT * FROM companies WHERE company_id = ?\";\n connection.query(sqlquery, company_id, function (err, rows) {\n if (err) {\n console.log(\"no match\");\n cb(false, null);\n } else {\n console.log(\"user login successfully\");\n mycompany = rows;\n cb(true, mycompany);\n }\n });\n}", "title": "" }, { "docid": "2f557fc01a6a35782ccc78387517856c", "score": "0.46209362", "text": "function getDitCompany(token, id) {\n let result;\n\n return authorisedRequest(token, `${config.apiRoot}/company/${id}/`)\n .then((company) => {\n result = company;\n\n const promises = [];\n for (const interaction of result.interactions) {\n promises.push(interactionRepository.getInteraction(token, interaction.id));\n }\n\n return Promise.all(promises);\n })\n .then((interactions) => {\n result.interactions = interactions;\n\n const promises = [];\n for (const contact of result.contacts) {\n promises.push(contactRepository.getBriefContact(token, contact.id));\n }\n\n return Promise.all(promises);\n })\n .then((contacts) => {\n result.contacts = contacts;\n return result;\n });\n}", "title": "" }, { "docid": "9cf1b37074132f362720b3505c2dc3c8", "score": "0.46179736", "text": "function getDefaultDateObject() {\n return IntlBase.getDependables(cldrData, '', false)[mapper[1]];\n}", "title": "" }, { "docid": "b0ee9f8b9b69dd6d1a9def84b9c56bdd", "score": "0.4616763", "text": "function getDefault(value, optional) {\r\n return value || optional;\r\n}", "title": "" }, { "docid": "6549650422942594cc2701baafd875ea", "score": "0.4613315", "text": "function get(id, canDefault) {\n return schemes[id] || (canDefault && _default ? schemes[_default] : undefined);\n }", "title": "" }, { "docid": "3f594e099c2d91ec89f036873c63288b", "score": "0.45992288", "text": "function getDefaultOption() {\n return {\n title: {\n text: 'test',\n },\n tooltip: {},\n legend: {\n data: ['test'],\n },\n xAxis: {\n data: [\"a\", \"b\", \"c\", \"d\", \"f\", \"g\"],\n },\n yAxis: {},\n series: [{\n name: 'test',\n type: 'bar',\n data: [5, 20, 36, 10, 10, 20],\n }]\n };\n}", "title": "" }, { "docid": "654a2897d84cf11222fcbfed07d36d8f", "score": "0.45824322", "text": "function getDefaultSheetByName(sheetName) {\n \n //This needs to be set to your spreadsheetID. You can also use the user properties functions.\n let spreadsheetID = \"myspreadsheetId\"; \n let spreadsheet = SpreadsheetApp.openById(spreadsheetID);\n let sheet = spreadsheet.getSheetByName(sheetName); \n\n //we are returning the full spreadsheet call of your sheet. This is the equivolent of running\n // SpreadsheetApp.openById(\"spreadsheetID\").getSheetByName(\"My Sheet\"); \n return sheet;\n }", "title": "" }, { "docid": "3df28bc1485f2bcddf6ef1df26c64351", "score": "0.45761982", "text": "getCurrentBusinessUserId() {\n const businessId = this.getCurrentBusinessId();\n if (IsObject(this.auth.users, true) && businessId in this.auth.users) {\n return this.auth.users[businessId].id;\n }\n return 0;\n }", "title": "" }, { "docid": "18c2544a402fc9591336d0ffe3aa80e1", "score": "0.4559244", "text": "function getCurrentEmail(cbk) {\n const {\n user: { email }\n } = getINIInfo(GITINFO);\n cbk(email);\n}", "title": "" }, { "docid": "f78f68f89faa6011555eb371686b89d5", "score": "0.45452693", "text": "function getLocale() {\r\n\tif (LCID == null) {\r\n\t\t// set default to English - United States\r\n\t\tvar defaultLocale = \"409\";\r\n\t\tvar localePath = \"HKCU\\\\Control Panel\\\\International\\\\Locale\";\r\n\r\n\t\t// read the key\r\n\t\tvar regLocale = getRegistryValue(localePath);\r\n\t\tif (regLocale != null) {\r\n\t\t\t// trim leading zeroes\r\n\t\t\tvar locale = trimLeadingZeroes(regLocale).toLowerCase();\r\n\t\t\tdinfo(\"Found user locale: \" + locale);\r\n\t\t\tLCID = locale;\r\n\t\t} else {\r\n\t\t\tLCID = defaultLocale;\r\n\t\t\tdinfo(\"Unable to locate user locale. Using default locale: \" + defaultLocale);\r\n\t\t}\r\n\t}\r\n\r\n\treturn LCID;\r\n}", "title": "" }, { "docid": "4e9f0732fa2bd5b136ca51cf40e39ddb", "score": "0.45439208", "text": "function getOption(value, defaultVal) {\n return (value == undefined) ? defaultVal : value;\n }", "title": "" }, { "docid": "8fc7a64a9c5b465e6e75646cb2d3738c", "score": "0.45314008", "text": "function getDefaultExercice(exercicesList){\n\tvar index;\n\t\n\tfor(index=0;index<exercicesList.length;index++){\n\t\tif(exercicesList[index].completed === false){\n\t\t\treturn getExerciceFromId(exercicesList[index].exerciceId);\n\t\t}\n\t}\n\t\n\t/*in case all exercice are completed we return the last exercice in the list*/\n\treturn getExerciceFromId(exercicesList[exercicesList.length-1].exerciceId);\n}", "title": "" }, { "docid": "a4bb2553923bbb026037e6640c270ae9", "score": "0.45285082", "text": "function getUsersDefaultGlobalConfig() {\n axios.defaults.headers.common[\"Authorization\"] =\n \"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\";\n\n axios\n .get(\"http://localhost:8787/api/users\")\n .then((response) => {\n console.log(response.data);\n })\n .catch((error) => {\n console.log(error);\n });\n}", "title": "" }, { "docid": "881b8726fd17d2fb26efff646996d893", "score": "0.45166394", "text": "function getCurrentUser(user) {\n if (!user.id){\n console.log(`id of ${user} may not have been passed in correctly`)\n return (`getCurrentUser not yet implemented`)\n \n }\n // use the id to query the database and find the one user\n console.log(`id of ${user.id}`)\n // return JSON\n return ({currentUser : {\n id: `${user.id}`,\n companyId: `${user.companyId}`\n }})\n}", "title": "" }, { "docid": "62cc6e7c81fb617189192f031c792a55", "score": "0.45165697", "text": "get mostActiveUser() {\n }", "title": "" }, { "docid": "def1657a41cd47aca3da3ae8d9aa2d8d", "score": "0.45140556", "text": "get DEFAULT_DATABASE() { return this.parameters.DEFAULT_DATABASE || MongoConstants.DEFAULT_DATABASE }", "title": "" } ]
de8b2b784aacf491e1e562031c835485
event detail > upcoming event tab
[ { "docid": "663df67d82dc2342938bc16457e14b2d", "score": "0.56007874", "text": "function event_upcoming() {\n $http.get('/upcomingResult', {\n params: {\n venue: $scope.detail_result.event.venue.value\n }}).\n then(function(response) {\n $scope.upcoming_result = response.data;\n $scope.upcoming_result_default = JSON.parse(JSON.stringify(response.data));\n console.log(\"upcoming_result:\", response.data);\n }).catch(function(response) {\n console.error('upcoming_result error ', response);\n });\n }", "title": "" } ]
[ { "docid": "4fbb2a3660ead40318ca265f7d19379d", "score": "0.6465918", "text": "function displayEventDetails(e){\n let scheduleTab = document.getElementById(\"schedule\");\n scheduleTab.style.display=\"none\";\n scheduleTab.className.replace(\" active\", \"\");\n\n //make event details tab active\n let detailsTab = document.getElementById(\"eventDetails\").style.display = \"block\";\n detailsTab.className += \" active\";\n\n //get index/id of the event. we need it to get ONLY this event from Firebase\n let id = e.target.getAttribute(\"data-eventId\");\n //get only one EVENT with all info\n firebase.database().ref('event/events/'+id).on('value', function(snapshot) {\n let details = {events:[]}\n details.events = snapshot.val();\n let template = document.getElementById(\"eventDetailsMustacheTemplate\").innerHTML;\n // render all data to template DOM element\n let resultMustache = Mustache.render(template,details);\n console.log(resultMustache)\n document.getElementById(\"eventDetailsOutput\").innerHTML=resultMustache;\n })\n }", "title": "" }, { "docid": "6c153bbcc48d34dd2b1d4247f3a0db6c", "score": "0.64063793", "text": "function viewEvent(event) {\n sendLog('View Event');\n getAnalysts(event.id)\n selectEvent(event);\n handleShow();\n }", "title": "" }, { "docid": "e210f2a2a658be6192cd2ff4e2f5739b", "score": "0.6181202", "text": "function listUpcomingEvents() {\n window.gapi.client.calendar.events.list({\n 'calendarId': config.opt.calendar_id,\n //'timeMax': (new Date()).toISOString(),\n //'timeMin': (new Date(new Date().getTime() - (60*60*24*7*1000))).toISOString(),\n 'showDeleted': false,\n 'singleEvents': true,\n 'maxResults': 10,\n 'orderBy': 'startTime'\n }).then(function(response) {\n var events = response.result.items;\n appendPre('Previous events:');\n\n if (events.length > 0) {\n for (let i = 0; i < events.length; i++) {\n var event = events[i];\n var when = event.start.dateTime;\n if (!when) {\n when = event.start.date;\n }\n appendPre(event.summary + ' (' + when + ')')\n }\n } else {\n appendPre('No previous events found.');\n }\n });\n }", "title": "" }, { "docid": "22f4b10c14946112e9f6bbef65772fc3", "score": "0.61732626", "text": "function eventFunction(e){\r\n\t//drawAllEvents();\r\n\tvar dayevents = getSlot(e.startArray, EC);\r\n\tif (!dayEventDup(e,dayevents)){\r\n\t dayevents.push(e);\r\n\t dayevents.sort(sortByEventTime);\r\n\t // show number of events, if it is amongst currently shown queries\r\n\t if (queryStates[e.qid]==1){\r\n\t\teventSource.loadQueryEvents([e]);\r\n\t }\r\n\t} \r\n }", "title": "" }, { "docid": "a3348d43017b3d10e218ee892ff8b8b4", "score": "0.61722064", "text": "function listUpcomingEvents1() {\r\n //This empties the event list so it isnt isnt repeated when new events are added.\r\n $(\"#event\").empty();\r\n //This prepares a new list of events for the updates tab.\r\n gapi.client.calendar.events.list({\r\n 'calendarId': 'primary',\r\n 'timeMin': (new Date()).toISOString(),\r\n 'showDeleted': false,\r\n 'singleEvents': true,\r\n 'maxResults': 10,\r\n 'orderBy': 'startTime'\r\n }).then(function(response) {\r\n var events = response.result.items;\r\n appendPre1('Updates:');\r\n\r\n if (events.length > 0) {\r\n for (i = 0; i < events.length; i++) {\r\n var event = events[i];\r\n var when = event.start.dateTime; \r\n if (!when) {\r\n when = event.start.date;\r\n } \r\n appendPre1(event.summary + ' (Start date: ' + when + ')')\r\n appendPre1('Description: ' + event.description)\r\n appendPre1('')\r\n }\r\n } else {\r\n appendPre1('No updates');\r\n }\r\n });\r\n}", "title": "" }, { "docid": "d96481b8cecfb4d4774d16243c8fbf37", "score": "0.6134757", "text": "function listUpcomingEvents() {\n var request = gapi.client.calendar.events.list({\n 'calendarId': 'primary',\n 'timeMin': (new Date()).toISOString(),\n 'showDeleted': false,\n 'singleEvents': true,\n 'maxResults': 10,\n 'orderBy': 'startTime'\n });\n \n request.execute(function(resp) {\n var events = resp.items;\n \n console.log(events);\n // appendPre('Upcoming events:');\n \n if (events.length > 0) {\n for (i = 0; i < events.length; i++) {\n var event = events[i];\n var when = event.start.dateTime;\n if (!when) {\n when = event.start.date;\n }\n var extra1 = \"\";\n var extra2 = \"\";\n \n /*var tdy = new Date();\n tdy = tdy.toISOString();\n tdy = tdy.split(\"T\");\n tdy = tdy[0];\n evt = when.split(\"T\");\n evt = evt[0];\n // evt = \"2015-04-28\";\n console.log(evt);\n var extra1 = \"\";\n var extra2 = \"\";\n if(tdy.string == evt.string ){\n alert(\"DDDD\");\n extra1 = '<span style=\"background-color: #FFFF00\">';\n extra2 = '</span>';\n }*/\n appendPre(extra1 + event.summary + ' (' + when + ')'+ extra2 + event.location);\n }\n } else {\n appendPre('No upcoming events found.');\n }\n \n });\n }", "title": "" }, { "docid": "7cfabf2f5554a63fe7dc82126bf765d5", "score": "0.60905385", "text": "function displayEvent() {\n $('tbody.event-calendar td').on('click', function(e) {\n \n $('.day-event').slideUp('fast');\n var monthEvent = $(this).attr('date-month');\n var yearEvent = $(this).attr('date-year');\n var dayEvent = $(this).text();\n if($('.day-event[date-month=\"' + monthEvent + '\"][date-day=\"' + dayEvent + '\"][date-year=\"'+yearEvent+'\"]').css('display') == 'none')\n $('.day-event[date-month=\"' + monthEvent + '\"][date-day=\"' + dayEvent + '\"][date-year=\"'+yearEvent+'\"]').slideDown('fast');\n });\n }", "title": "" }, { "docid": "99b6eaf5455f8179b9096912f73706a9", "score": "0.6077053", "text": "showDetailedInfo(event) {\n return null;\n }", "title": "" }, { "docid": "15ed3c095a8c0376bd888006e17fba18", "score": "0.6057118", "text": "function showEventDetails( event_uid ){\r\n\r\n var first_of_this_period = $( '.calendar-control .this-week' )\r\n .attr( 'data-first_of_this_period' );\r\n var skv_event = skv_events_by_uid[ event_uid ];\r\n\r\n // YES, I'm deliberately testing for a number as a string \r\n // which is apparently how this comes back from the API\r\n var is_ticketed = skv_event.signup_options.tickets.enabled === \"1\";\r\n\r\n var str_html = '<div class=\"event-details\">'\r\n + '<h2>' + skv_event.name + '</h2>'\r\n + htmlDecode( skv_event.description )\r\n + '<br /><br /><p><strong>Venue:</strong> <a href=\"https://www.google.co.uk/maps/@' \r\n + skv_event.location.latitude + ',' + skv_event.location.longitude \r\n + ',17z\" target=\"_blank\">'\r\n + skv_event.location.name + '</a></p>'\r\n + buildDateString( skv_event.datetime_start, skv_event.datetime_end )\r\n + '<br />';\r\n\r\n if( is_ticketed ){\r\n str_html += 'For full event details and tickets, see the '\r\n + '<a href=\"' + skv_event.signup_options.tickets.url \r\n + '\">event details</a> page.';\r\n }\r\n\r\n var img_src = '';\r\n var has_img = true;\r\n\r\n try {\r\n img_src = skv_event.images.md.url;\r\n } catch( err ){\r\n has_img = false;\r\n }\r\n\r\n $( '#eventModal .modal-header' )\r\n .empty();\r\n\r\n if( has_img ){\r\n $( '#eventModal .modal-header' )\r\n .append( '<img class=\"modal-img\" src=\"' + img_src + '\" />' );\r\n }\r\n\r\n $( '#eventModal .modal-body' )\r\n .empty()\r\n .append( str_html );\r\n \r\n $( '#eventModal' ).modal( 'show' );\r\n\r\n }", "title": "" }, { "docid": "54f634d787c2164ccc2d3915902f997f", "score": "0.6031851", "text": "function listUpcomingEvents() {\n gapi.client.calendar.events.list({\n 'calendarId': 'primary',\n 'timeMin': (new Date()).toISOString(),\n 'showDeleted': false,\n 'singleEvents': true,\n 'maxResults': 25,\n 'orderBy': 'startTime'\n }).then(function(response) {\n var events = response.result.items;\n\n if (events.length > 0) {\n for (i = 0; i < events.length; i++) {\n var event = events[i];\n var when = event.start.dateTime;\n if (!when) {\n when = event.start.date;\n }\n appendTable(event.summary, when);\n //send to servlet\n sendEvent(event.summary, when);\n }\n }\n });\n }", "title": "" }, { "docid": "838d9ac454a5c1d3ad012db9eef9fb03", "score": "0.60007596", "text": "function listUpcomingEvents() {\n var request = gapi.client.calendar.events.list({\n 'calendarId': 'primary',\n 'timeMin': (new Date()).toISOString(),\n 'showDeleted': false,\n 'singleEvents': true,\n 'maxResults': 10,\n 'orderBy': 'startTime'\n });\n\n request.execute(function(resp) {\n var events = resp.items;\n\n if (events.length > 0) {\n for (i = 0; i < events.length; i++) {\n var event = events[i];\n var when = event.start.dateTime;\n console.log(when);\n if (!when) {\n when = event.start.date;\n }\n appendPre(event.summary,when)\n }\n } else {\n appendPre('No upcoming events found.');\n }\n\n });\n }", "title": "" }, { "docid": "865be8b8ead719fbced6d718ec1c2966", "score": "0.5980696", "text": "function showEventDetails(event) {\n //Clear the details div\n this.clearDetailsDiv();\n\n //Show the details div\n document.getElementById(\"ONEUPGRID_details\").style.top = \"75px\";\n\n //Set the details div state\n this.detailsDivState = 1;\n\n //Populate the Title div details - title, location, and map div\n document.getElementById(\"ONEUPGRID_details_title_h1\").innerText = event.title;\n document.getElementById(\"ONEUPGRID_details_title_h2\").innerText = event.location1 + \", \" + event.location2;\n\n //Populate the Info Div\n document.getElementById(\"ONEUPGRID_details_category_div\").innerHTML = \"<b>Category: </b>\" + Utilities.getCategoryStringFromId(event.category);\n document.getElementById(\"ONEUPGRID_details_cost_div\").innerHTML = \"<b>Cost: </b>\" + event.cost;\n document.getElementById(\"ONEUPGRID_details_transportation_div\").innerHTML = \"<b>Getting There: </b>\" + event.transportation;\n document.getElementById(\"ONEUPGRID_details_description_div\").innerHTML = event.description;\n\n //Populate the Tips Div\n var tipsListElement = document.getElementById(\"ONEUPGRID_details_tips_ul\");\n\n //For each tip\n for (var i = 0; i < this.getEventById(this.selectedEventId).tips.length; i++) {\n var tempLi = document.createElement(\"li\");\n tempLi.innerText = this.getEventById(this.selectedEventId).tips[i];\n tipsListElement.appendChild(tempLi);\n }\n\n //Populate the Third Party Tip Providers\n this.populateTipsActions();\n\n //If necessary, populate the website link\n if (this.getEventById(this.selectedEventId).website != null) {\n var websiteButton = document.createElement(\"div\");\n websiteButton.id = \"ONEUPGRID_details_website\";\n websiteButton.classList.add(\"ONEUPGRID_details_title_action_div\");\n websiteButton.innerText = \"View Website\";\n document.getElementById(\"ONEUPGRID_details_title_div\").appendChild(websiteButton);\n this.AttachOnClick(websiteButton, \"ONEUPGRID_details_actions_link_click\");\n }\n }", "title": "" }, { "docid": "8bd2989252d61d9c6e290e33aeda4f70", "score": "0.59786177", "text": "showEvents() {\n this.showEventTimespans();\n this.showRaterTimelines();\n }", "title": "" }, { "docid": "76498fbc7881711a75c2007bd09d59fc", "score": "0.5974168", "text": "function listUpcomingEvents() {\n console.log(process.env.REACT_APP_CALENDAR_ID)\n gapi.client.calendar.events.list({\n 'calendarId': process.env.REACT_APP_CALENDAR_ID,\n 'timeMin': (new Date()).toISOString(),\n 'showDeleted': false,\n 'singleEvents': true,\n 'maxResults': 10,\n 'orderBy': 'startTime'\n }).then(function(response) {\n var events = response.result.items;\n appendPre('Upcoming events:');\n\n if (events.length > 0) {\n for (let i = 0; i < events.length; i++) {\n var event = events[i];\n var when = event.start.dateTime;\n if (!when) {\n when = event.start.date;\n }\n appendPre(event.summary + ' (' + when + ')')\n }\n } else {\n appendPre('No upcoming events found.');\n }\n });\n }", "title": "" }, { "docid": "573860e86cf7c1e40137f869897292ed", "score": "0.59578884", "text": "function displaySingleEvent(eventDetail)\n{\n $('#eventList').addClass('hide');\n\n $('#eventDetail').removeClass('hide');\n\n\n let eventHTML =\n `<div class=\"event_detail\">\n <button type=\"button\" class=\"btn btn-dark btn-md\">Back to Event List</button>\n <h3 class=\"detailHeading\" >${eventDetail.name.html}\n </h3>\n <img class=\"eventThumbnail img-fluid\" src=\"${eventDetail.logo.url}\" alt=\"${eventDetail.name.html}\">\n <a href=\"${eventDetail.url}\">Visit the Event page on eventbrite.com</a><br>\n ${eventDetail.description.html}\n </div>\n `;\n\n $('#eventDetail').html(eventHTML);\n\n returnToEventList();\n}", "title": "" }, { "docid": "25d74931bc3f8e80823964e5b3cffa76", "score": "0.5956348", "text": "function Events({ item, history }) {\n const weekday = dateDayAsString(item.day);\n const month = dateMonthAsString(item.day);\n const dayNum = new Date(item.day).getDay();\n const year = new Date(item.day).getFullYear();\n return (\n <List.Item as=\"a\" onClick={() => history.push(`/events/${item.id}`)}>\n <List.Content>\n <Segment>\n <List.Description>\n <Grid>\n <Grid.Row columns={2}>\n <Grid.Column>\n <Container style={{ fontSize: '1.5em', textAlign: 'center' }}>\n {item.name}\n </Container>\n </Grid.Column>\n </Grid.Row>\n <Grid.Row columns={2} divided>\n <Grid.Column>{item.description}</Grid.Column>\n <Grid.Column>\n <strong>Location and time:</strong>\n <br />\n {item.location}\n <br />\n {weekday}, {month} {dayNum}, {year}\n <br />\n {item.startTime} to {item.endTime}\n </Grid.Column>\n </Grid.Row>\n </Grid>\n </List.Description>\n </Segment>\n </List.Content>\n </List.Item>\n );\n}", "title": "" }, { "docid": "c7e2c84078dd88e25328b4db09dff1ee", "score": "0.59477323", "text": "function listUpcomingEvents() {\n const minDate = (new Date()).toISOString();\n let maxDate= (new Date());\n maxDate.setDate(maxDate.getDate() + 7);\n maxDate = maxDate.toISOString();\n window.gapi.client.calendar.events.list({\n 'calendarId': 'primary',\n 'timeMin': minDate,\n 'timeMax': maxDate,\n 'showDeleted': false,\n 'singleEvents': true,\n 'maxResults': 20,\n 'orderBy': 'startTime'\n }).then(function(response) {\n const { data, status } = {\n data: response,\n status: response.status\n }\n if (status !== 200) {\n return setState({\n data,\n error: true,\n loaded: true,\n fetching: false,\n })\n }\n setState({\n data,\n error: null,\n loaded: true,\n fetching: false,\n })\n });\n }", "title": "" }, { "docid": "55db194e18ca96236bb89b8cda9e9384", "score": "0.594158", "text": "function openInfo(eventId) {\n\twindow.location.hash = '#eventId=' + eventId;\n\tvar row = eventMarkerMap[eventId];\n\tdocument.title = row.event.name.substring(0, 15) + ' - Furlango';\n\tif (currentInfoWindow) {\n\t\tcurrentInfoWindow.close();\n\t}\n\tif (row) {\n\t\trow.info.open(map, row.marker);\n\t\tcurrentInfoWindow = row.info;\n\t} else {\n\t\talert('This event no longer exists.');\n\t}\n}", "title": "" }, { "docid": "5db56d0e46c4d8921f21c30d2ca2c216", "score": "0.59238404", "text": "function getEventDetails () { \n\tif (eventIndex == undefined) { // displayed when there is no event at current day\n\t\tdocument.getElementById(\"description\").style.visibility = \"hidden\"; // hide the HTML details\n\t\tdocument.getElementById(\"currentPhoto\").setAttribute(\"src\", \"NoEvent.jpg\"); // display \"no event\" picture\n\t} else { // finding details about event and displaying it\n\t\tdocument.getElementById(\"description\").style.visibility = \"visible\"; // show HTML details\n\t\t// set displayed details based on the information in the pseudo data base\n\t\tdocument.getElementById(\"startingTime\").innerHTML = eventsToDisplay[eventIndex].startingTime;\n\t\tdocument.getElementById(\"endingTime\").innerHTML = eventsToDisplay[eventIndex].endingTime;\n\t\tdocument.getElementById(\"title\").innerHTML = eventsToDisplay[eventIndex].title;\n\t\tdocument.getElementById(\"eventDescription\").innerHTML = eventsToDisplay[eventIndex].eventDescription;\n\t\tdocument.getElementById(\"place\").innerHTML = eventsToDisplay[eventIndex].place;\n\t\tdocument.getElementById(\"currentPhoto\").setAttribute(\"src\", eventsToDisplay[eventIndex].imgSource);\n\t}\n}", "title": "" }, { "docid": "24f4d5f8cfd05f7023a52a0a68fc9f37", "score": "0.5914807", "text": "function listEvents() {\n const calendar = getCalenderClient();\n calendar.events.list({\n calendarId: 'primary',\n timeMin: (new Date()).toISOString(),\n maxResults: 10,\n singleEvents: true,\n orderBy: 'startTime',\n }, (err, res) => {\n if (err) return console.log('The API returned an error: ' + err);\n const events = res.data.items;\n if (events.length) {\n console.log('Upcoming 10 events:');\n events.map((event, i) => {\n const start = event.start.dateTime || event.start.date;\n console.log(`${start} - ${event.summary}`);\n });\n } else {\n console.log('No upcoming events found.');\n }\n });\n}", "title": "" }, { "docid": "e84f81a5c1c456f6dbe9b495891bbea8", "score": "0.5914695", "text": "function EventInfo() { }", "title": "" }, { "docid": "e84f81a5c1c456f6dbe9b495891bbea8", "score": "0.5914695", "text": "function EventInfo() { }", "title": "" }, { "docid": "632cf5e7f319ca71420c90c512fc8619", "score": "0.590814", "text": "function ONEUPGRID_itinerary_event_click(element) {\n var event = this.getEventById(element.id.split(\"_\")[3].toString());\n\n //Set the current event\n this.setSelectedEventId(element.id.split(\"_\")[3].toString());\n\n //Show the details\n if (event != null) {\n //Make sure that the mini div is hidden, and the full div is shown\n var full = document.getElementById(\"ONEUPGRID_details_content_full_div\");\n var mini = document.getElementById(\"ONEUPGRID_details_content_mini_div\");\n\n full.style.opacity = \"1\";\n full.style.display = \"block\";\n mini.style.opacity = \"0\";\n mini.style.display = \"none\";\n \n document.getElementById(\"ONEUPGRID_details\").style.height = ((window.innerHeight - 80) * .11625 * 4).toString() + \"px\"\n\n this.showEventDetails(event);\n } else {\n //TODO: Make the world blow up\n }\n }", "title": "" }, { "docid": "85842d8622c22a4b35066835ce725b51", "score": "0.59046584", "text": "handleSelection(event) {\n this.pollEverySec(this.interval);\n const eventData = event.detail;\n const fields = {\n Name: eventData.name,\n EventType: eventData.type,\n PrimaryPersonId: this.contactId,\n EventDate: new Date().toISOString()\n };\n this.showNewLifeEventPage(fields, \"new\");\n }", "title": "" }, { "docid": "6d44e5174330ef094bec407bbfdc489b", "score": "0.5903049", "text": "function printEvent(event) {\n console.log(event.startTime + \" - \" + event.name + \" @ \" + event.place);\n}", "title": "" }, { "docid": "5b695b7fbd47487249c84189078f1b3d", "score": "0.5899535", "text": "function displayEventDetail()\n{\n\n $('#eventList').on('click', 'button', function(data)\n {\n let eventID = $(this).attr('data-event-id');\n\n detailEventQuery(eventID);\n\n });\n}", "title": "" }, { "docid": "8640e37109ca22b561125a890c0a5ff1", "score": "0.5885763", "text": "function listUpcomingEvents() {\n gapi.client.calendar.events.list({\n 'calendarId': 'primary',\n 'timeMin': (new Date()).toISOString(),\n 'showDeleted': false,\n 'singleEvents': true,\n 'orderBy': 'startTime'\n }).then(function(response) {\n var events = response.result.items;\n console.log(events);\n eventos = [];\n if (events.length > 0) {\n events.forEach(obj => {\n colorEvent = \"\";\n for(var color in colores){\n if (colores[color].id == obj.colorId ) {\n colorEvent = colores[color].color;\n textColorEvent = \"#FFFFFF\";\n }\n }\n eventos.push({id: obj.id, title: obj.summary, description:obj.description,location:obj.location, start: obj.start.dateTime, end: obj.end.dateTime, color: colorEvent, textColor: textColorEvent});\n })\n //console.log(eventos);\n $('#calendar').fullCalendar({\n header: {\n language: 'es',\n left: 'prev,next today',\n center: 'title',\n right: 'month,basicWeek,basicDay',\n },\n timeZone: 'UTC',\n timeFormat: 'h:mm a',\n editable: true,\n eventLimit: true, // allow \"more\" link when too many events\n selectable: true,\n selectHelper: true,\n select: function(start, end) {\n document.getElementById(\"start\").value = moment(start).format('YYYY-MM-DD');\n document.getElementById(\"hrastart\").value = moment(start).format('HH:mm:ss');\n document.getElementById(\"end\").value = moment(end).format('YYYY-MM-DD');\n document.getElementById(\"hraend\").value = moment(end).format('HH:mm:ss');\n document.getElementById(\"btnGuardar\").style.display = \"inline-block\";\n document.getElementById(\"btnActualizar\").style.display = \"none\";\n document.getElementById(\"btnEliminar\").style.display = \"none\";\n mostrarModal();\n },\n eventRender: function(event, element) {\n element.bind('click', function() {\n document.getElementById(\"id\").value = event.id;\n document.getElementById(\"title\").value = event.title;\n document.getElementById(\"descripcion\").value = event.description;\n document.getElementById(\"direccion\").value = event.location;\n document.getElementById(\"color\").value = event.color;\n document.getElementById(\"start\").value = moment(event.start).format('YYYY-MM-DD');\n document.getElementById(\"hrastart\").value = moment(event.start).format('HH:mm:ss');\n document.getElementById(\"end\").value = moment(event.end).format('YYYY-MM-DD');\n document.getElementById(\"hraend\").value = moment(event.end).format('HH:mm:ss');\n document.getElementById(\"btnGuardar\").style.display = \"none\";\n document.getElementById(\"btnActualizar\").style.display = \"inline-block\";\n document.getElementById(\"btnEliminar\").style.display = \"inline-block\";\n mostrarModal();\n });\n },\n // eventDrop: function(event, delta, revertFunc) { // si changement de position\n // edit(event);\n // },\n // eventResize: function(event,dayDelta,minuteDelta,revertFunc) { // si changement de longueur\n // edit(event);\n // },\n events:eventos,\n });\n }\n });\n}", "title": "" }, { "docid": "30efc74ca6bf81359a898015a51c978d", "score": "0.58693546", "text": "function listUpcomingEvents() {\n gapi.client.calendar.events.list({\n 'calendarId': 'primary',\n 'timeMin': (new Date()).toISOString(),\n 'showDeleted': false,\n 'singleEvents': true,\n 'maxResults': 10,\n 'orderBy': 'startTime'\n }).then(function(response) {\n let events = response.result.items;\n\n if (events.length > 0) {\n for (let i = 0; i < events.length; i++) {\n let event = events[i];\n let when = event.start.dateTime;\n if (!when) {\n when = event.start.date;\n }\n appendPre(event.summary)\n }\n } else {\n appendPre('No upcoming events found.');\n }\n });\n}", "title": "" }, { "docid": "f804dbb9f466ef5e6be58fe9d4c27b35", "score": "0.58655185", "text": "function listUpcomingEvents() {\n gapi.client.calendar.events.list({\n 'calendarId': 'primary',\n 'timeMin': (new Date()).toISOString(),\n 'showDeleted': false,\n 'singleEvents': true,\n 'maxResults': 10,\n 'orderBy': 'startTime'\n }).then(function(response) {\n var events = response.result.items;\n var opt = 0;\n if (events.length > 0) {\n for (i = 0; i < events.length; i++) {\n \n var event = events[i];\n var when = event.start.dateTime;\n if (!when){\n when = event.start.date;\n }\n var now = new Date();\n if (when.substring(8,10) == String(now.getDate())){\n $(\"#select1\").append('<option value=\"'+String(opt)+'\">'+event.summary+'</option>');\n opt += 1;\n }\n \n }\n } else {\n console.log('No InComming')\n }\n });\n }", "title": "" }, { "docid": "96a945ddb4174899e4d3336af3972267", "score": "0.5858303", "text": "function viewtime(e) {\n const eventID = e.target.value;\n for(let i = 0; i < eventclass.length; i ++) {\n let apm = \"AM\";\n if(eventclass[i].apm == 0) {\n apm = \"AM\";\n } else {\n apm = \"PM\";\n }\n \n let endapm = \"AM\";\n if(eventclass[i].end_apm == 0) {\n endapm = \"AM\";\n } else {\n endapm = \"PM\";\n }\n let tag = eventclass[i].tag;\n if(tag == null) {\n tag = \"None\";\n }\n if(eventclass[i].id == eventID) {\n alert(\"Name: \" + eventclass[i].name +\"\\n Date: \" + eventclass[i].month + \"/\" + eventclass[i].day + \"/\" + eventclass[i].year + \"\\n Time: \"+ eventclass[i].hour + \":\" + eventclass[i].minute + \" \" + apm + \" - \" + eventclass[i].end_hour + \":\" + eventclass[i].end_minute + \" \" + endapm + \"\\n Tag: \" + tag);\n }\n }\n}", "title": "" }, { "docid": "5edee411aec271f4cd194381ca99234c", "score": "0.58476126", "text": "function _addDetail() {\n for (var i = 0; i < vm.items.length; i++) {\n vm.items[i].actions = [{\n label: vm.items[i].description\n }];\n vm.items[i].startsAt = new Date(vm.items[i].startsAt); //as per requirement of bootstrap calendar\n vm.items[i].endsAt = new Date(vm.items[i].endsAt); //as per requirement of bootstrap calendar\n }\n }", "title": "" }, { "docid": "dccfba0f67aa2dae7a1328ba6a4dd597", "score": "0.58472115", "text": "function displayEventNames(e){\n\t\tlet txt=\"<pre>Wait Class: \"+e.data.waitEvent+\"<br>\";\n\t\ttxt=txt+ \"-\".repeat(e.data.waitEvent.length+12)+\"<br>\";\n\t\tlet eventObj=rangeWaitClassObj[e.data.waitEvent][1];\n\t\tfor (let eventName of Object.keys(eventObj)){\n\t\t\ttxt=txt+eventName+\": \"+eventObj[eventName]+\"% <br>\"\n\t\t};\n\t\ttxt=txt+\"</pre>\";\n\t\t$('#tab2 .right-column p').html(txt);\n\t}", "title": "" }, { "docid": "7d208dc42472c689dc3bf4fc6851fd69", "score": "0.5841368", "text": "function getEventDetails(events){\n events.forEach(event => {\n // addEvent(event.title, event.date, event.time,event.id)\n });\n }", "title": "" }, { "docid": "9e861f3660bd105f7d572545c0ba3e15", "score": "0.5815449", "text": "function createDemoEvents() {\n // Date for the calendar events (dummy data)\n var date = new Date();\n var d = date.getDate(),\n m = date.getMonth(),\n y = date.getFullYear();\n\n return [\n {\n title: 'All Day Event',\n start: new Date(y, m, 1),\n backgroundColor: '#f56954', //red \n borderColor: '#f56954' //red\n },\n {\n title: 'Long Event',\n start: new Date(y, m, d - 5),\n end: new Date(y, m, d - 2),\n backgroundColor: '#f39c12', //yellow\n borderColor: '#f39c12' //yellow\n },\n {\n title: 'Meeting',\n start: new Date(y, m, d, 10, 30),\n allDay: false,\n backgroundColor: '#0073b7', //Blue\n borderColor: '#0073b7' //Blue\n },\n {\n title: 'Lunch',\n start: new Date(y, m, d, 12, 0),\n end: new Date(y, m, d, 14, 0),\n allDay: false,\n backgroundColor: '#00c0ef', //Info (aqua)\n borderColor: '#00c0ef' //Info (aqua)\n },\n {\n title: 'Birthday Party',\n start: new Date(y, m, d + 1, 19, 0),\n end: new Date(y, m, d + 1, 22, 30),\n allDay: false,\n backgroundColor: '#00a65a', //Success (green)\n borderColor: '#00a65a' //Success (green)\n },\n {\n title: 'Open Google',\n start: new Date(y, m, 28),\n end: new Date(y, m, 29),\n url: '//google.com/',\n backgroundColor: '#3c8dbc', //Primary (light-blue)\n borderColor: '#3c8dbc' //Primary (light-blue)\n }\n ];\n }", "title": "" }, { "docid": "56f7f897e7b025da69dda514d8d38c37", "score": "0.58136874", "text": "function eventCreate(listOfEvents, current, indJ) {\n listOfEvents[indJ] = {\n id: current.section,\n title: current.section,\n start: determineDay(current.days[indJ]) + current.start + \":00\",\n end: determineDay(current.days[indJ]) + current.end + \":00\",\n allDay: false,\n editable: true\n };\n }", "title": "" }, { "docid": "7e3a17d427736c43a92746f41db8622b", "score": "0.5808628", "text": "function displayEvents(event) {\n\tevent.preventDefault();\n\tif (searchCity.val().trim() !== '' && searchType.val().trim() !== '') {\n\t\tcity = searchCity.val().trim();\n\t\teventType = searchType.val().trim();\n\t\tcurrentEvents(city);\n\t}\n}", "title": "" }, { "docid": "730a840bd0d8388e3087133386d30abe", "score": "0.579988", "text": "function showEvents() {\n\n\n var queryURL2 = \"https://app.ticketmaster.com/discovery/v1/events.json?keyword=\" + artist + \"&apikey=e24yU8pGFGdyS4VeZAsidGfIG7yZwce1\";\n\n $.ajax({\n url: queryURL2,\n method: \"GET\",\n\n }).then(function (response) {\n $(\"#upcoming-events\").text(\"Upcoming Events for artist \" + artist);\n var ticketMasterEvents = JSON.stringify(response)\n // console.log(response);\n // console.log(response._embedded.events);\n var events = response._embedded.events;\n for (var i = 0; i < events.length; i++) {\n // console.log(events[i].name);\n var eName = events[i].name\n var eLocation = events[i]._embedded.venue[0].name + \" \" + events[i]._embedded.venue[0].city.name + \", \" + events[i]._embedded.venue[0].state.stateCode;\n var eDate = events[i].dates.start.dateTime;\n var eDatef = moment(eDate).format('llll')\n var eventLink = \"https://www.ticketmaster.com/\" + events[i]._embedded.attractions[0].url;\n var $button = $(\"<button>\").html('<a target = \"_blank\" href=' + eventLink + '>More Info </a>');\n // var eInfo = $button.attr(\"href\",eventLink);\n var eInfo = $button.addClass(\"btn\");\n // console.log(eventLink);\n var newRow = $(\"<tr>\").append(\n $(\"<td>\").text(eName),\n $(\"<td>\").text(eLocation),\n $(\"<td>\").text(eDatef),\n $(\"<td>\").html(eInfo)\n );\n // Append the new row to the table\n $(\"#eventsdata\").append(newRow);\n }\n\n });\n\n}", "title": "" }, { "docid": "d8c39abc7fa40defa043090f2af1b009", "score": "0.5799842", "text": "function eventPopUp(event){\n let popUp = document.getElementById('eventPopUp');\n //attach all of the event details to the different buttons\n document.getElementById('deleteEvent').eventId = event.currentTarget.eventId;\n document.getElementById('changeEvent').eventId = event.currentTarget.eventId;\n document.getElementById('editEventBtn').eventId = event.currentTarget.eventId;\n document.getElementById('editEventBtn').title = event.currentTarget.title;\n //document.getElementById('editEventBtn').date = event.currentTarget.date;\n \n\n //empty the previous selected event details\n if(!popUp.hidden){\n document.getElementById('eventTextArea').innerHTML=\"\";\n popUp.hidden=true;\n }\n //heading is the title of the event\n let heading = document.createElement('h3');\n heading.appendChild(document.createTextNode(event.currentTarget.title));\n heading.setAttribute('id','popHeading');\n //details contains the date and time of event\n let details = document.createElement('p');\n details.setAttribute('id','popDetails');\n details.appendChild(document.createTextNode(event.currentTarget.date));\n details.appendChild(document.createTextNode(' '+event.currentTarget.time));\n document.getElementById('eventTextArea').appendChild(heading);\n document.getElementById('eventTextArea').appendChild(details);\n //show the popup\n popUp.hidden = false;\n}", "title": "" }, { "docid": "2e5b10c3231d81dd7216dbb9ca2d92da", "score": "0.5797436", "text": "function showCurrentEventInstanceActivity(inputType, result) {\n\n\t\tvar buttons = [];\n\t\tfor (var i = 0; i < result.rows.length; i++) {\n\t\t\t\n\t\t\tvar row = result.rows.item(i);\n\t\t\tvar intensityTextAndColor = controller.convertIntensityIntToTextAndColor(row.intensity);\n\t\t\t//console.log(row);\n\t\t\tvar date = new Date(row.beginTime);\n\t\t\tvar minutes = parseInt(date.getMinutes());\n\t\t\tif (minutes < 10) {\n\t\t\t\t//show minutes correct\n\t\t\t\tminutes = \"0\" + minutes;\n\t\t\t}\n\t\t\tvar button = {\n\t\t\t\t\tname : row.name,\n\t\t\t\t\tintensityValue: row.intensity,\n\t\t\t\t\tintensityText: intensityTextAndColor.text,\n\t\t\t\t\tintensityColorInterpretation: intensityTextAndColor.color,\n\t\t\t\t\tbeginHours : date.getHours(),\n\t\t\t\t\tbeginMinutes : minutes,\n\t\t\t\t\tbeginDay : date.getDate(),\n\t\t\t\t\tbeginMonth : (date.getMonth() + 1),\n\t\t\t\t\tbeginYear : date.getFullYear(),\n\t\t\t\t\tid : row.id,\n\t\t\t\t\teventType: row.eventType\n\t\t\t}\n\t\t\t\n\t\t\tvar endMinutes = null;\n\t\t\tvar endHours = null;\n\t\t\tif(row.endTime != null){\n\t\t\t\tvar endDate = new Date(row.endTime);\n\t\t\t\tendMinutes = parseInt(endDate.getMinutes());\n\t\t\t\tendHours = parseInt(endDate.getHours());\n\t\t\t\tif (endMinutes < 10) {\n\t\t\t\t\t//show minutes correct\n\t\t\t\t\tendMinutes = \"0\" + endMinutes;\n\t\t\t\t}\n\t\t\t\tbutton.endMinutes = endMinutes;\n\t\t\t\tbutton.endHours = endHours;\n\t\t\t}\n\t\t\t\n\t\t\tif(row.eventId === IDPAUSETRACKING)\n\t\t\t\t{\n\t\t\t\t\t//pause tracking event needs special color\n\t\t\t\t\tbutton.pausetracking = \"yes\";\n\t\t\t\t}\n\t\t\t//add button to array\n\t\t\tbuttons.push(button);\n\n\t\t}\n\t\t//check if there are events, if not hide current-activity-event-list\n\t\tif(buttons.length > 0){\n\t\t\t\n\t\t\t$('#current-activity-event-list').show();\n\t\t\t//get template\n\t\t\tvar source = $(\"#current-activity-event-list-template\").html();\n\t\t\t//compile to hanlebars template\n\t\t\tvar template = Handlebars.compile(source);\t\n\t\t\t//fill template with events and add screen to page\n\t\t\t$('#current-activity-event-list').html(template(buttons));\t\n\t\t}\n\t\telse{\n\t\t\t$('#current-activity-event-list').hide();\n\t\t}\n\t}", "title": "" }, { "docid": "fa82b072bb58eaa60800c46fca404df1", "score": "0.57849014", "text": "function add_event() {\n search_submit();\n //activeLoadMore();\n activeHistory();\n}", "title": "" }, { "docid": "7f1066f3858c698f3ff8bffac2783a0e", "score": "0.57621694", "text": "function listUpcomingEvents() {\n var request = gapi.client.calendar.events.list({\n 'calendarId': 'ciid.dk_i93ju4obca5f1sc1jfro41m03c@group.calendar.google.com', //'primary'\n 'timeMin': (new Date(firstDate)).toISOString(),\n 'showDeleted': false,\n 'singleEvents': true,\n 'maxResults': 2000,\n 'orderBy': 'startTime'\n })\n request.execute(function(resp) {\n var events = resp.items;\n\n if (events.length > 0) {\n for (i = 0; i < events.length; i++) {\n \tvar event = events[i];\n\t var when = event.start.dateTime;\n\t // oneWhen = events[0].start;\n \tif(events[i].colorId==undefined){\n \t\tconsole.log(events[i].summary);\n \t}\n\n\t // console.log(events[i].colorId)\n\t\t\tif(when){\n\t\t\t\tvar when = new Date(event.start.dateTime);\n\t\t\t\tvar whenEnd = new Date(event.end.dateTime);\n\t\t\t\tpushHere[i]=({\n\t\t\t\t\t\t\"who\": event.attendees,\n\t\t\t\t\t\t\"what\": event.summary,\n\t\t\t\t\t\t\"how\": event.description,\n\t\t\t\t\t\t\"start\": format(when),//new Date(event.start.dateTime),\n\t\t\t\t\t\t\"end\": format(whenEnd),//new Date(event.end.dateTime),\n\t\t\t\t\t\t\"colorId\": event.colorId,\n\t\t\t\t\t\t\"diff\": parseInt(new Date(format(whenEnd)) - new Date(format(when)))\t\t\t\t\t\t\n\t\t\t\t\t})\n\t\t\t}\n if (!when) {\n\t\t\t\tvar when = new Date(event.start.date);\n\t\t\t\tvar whenEnd = new Date(event.end.date);\n\t\t\t\tpushHere[i]=({\n\t\t\t\t\t\t\"who\": event.attendees,\n\t\t\t\t\t\t\"what\": event.summary,\n\t\t\t\t\t\t\"how\": event.description,\n\t\t\t\t\t\t\"start\": format(when),//new Date(event.start.date),\n\t\t\t\t\t\t\"end\": format(whenEnd),//new Date(event.end.date),\n\t\t\t\t\t\t\"colorId\": event.colorId,\n\t\t\t\t\t\t\"diff\": parseInt(new Date(format(whenEnd)) - new Date(format(when)))\t\t\t\t\t\t\n\t\t\t\t\t})\n }\n\n nestThis = d3.nest()\n\t\t\t\t.key(function(d) { return d.start; })\n\t\t\t\t.entries(pushHere);\n\n\n\t\t\t// if(nestThis.length>0){\n\t\t\t// \tfor(i=0; i<nestThis.length; i++){\n\t\t\t// \t\tdrawData(nestThis[i].values)\n\t\t\t// \t}\n\t\t\t// }\n // if(event.attendees!=undefined){\n\t // for(j=0; j<event.attendees.length; j++){\n\t // \t// console.log(i+event.attendees[j].displayName);\n\t // }\n // }\n // var when = event.start.dateTime;\n // if (!when) {\n // when = event.start.date;\n // }\n }\n } \n else {\n }\n\n });\n }", "title": "" }, { "docid": "2a2defe46399121d6749d2e8a91a208c", "score": "0.5756316", "text": "function onPageBeforeShow(e){\n\t\t\t\t\n\t\t\t\t//discard search selection data\n\t\t\t\tif (App.data.firstLoadData) App.data.useFullSelection();\n\t\t\t\t\n\t\t\t\t//handle after hours button status\n\t\t\t\tupdateAfterHoursBtn();\n\t\t\t\t\n\t\t\t}", "title": "" }, { "docid": "f3966b9bd13eab843b5384e558522be8", "score": "0.57529634", "text": "function doWork() {\n for (var i = 0; i < AllEvents.length; i++) {\n if (AllEvents[i][\"event_link\"] == \"#/event/\" + $route.current.params.eventname) {\n eventDetail.event = AllEvents[i];\n\n }\n } //for\n\n // console.log(eventDetail.event);\n // when user enters wrong url!\n if (eventDetail.event.description == undefined || eventDetail.event.description == null) {\n noDataFound();\n }\n }", "title": "" }, { "docid": "4a739da75cd80331bf2314aa1fbb6318", "score": "0.5747203", "text": "function createEventDisplay(event)\n{\n \n let eventHTML =\n `<li>\n <h3 class=\"detailHeading\" >${event.name.html}\n </h3>\n <img class=\"eventThumbnail img-fluid\" src=\"${event.logo.url}\" alt=\"${event.name.html}\">\n <a href=\"${event.url}\">Visit the Event page on eventbrite.com</a><br>\n <button data-event-id=\"${event.id}\" type=\"button\" class=\"btn btn-dark btn-md\">Event Details</button>\n\n </li>\n `;\n\n $('#events').append(eventHTML);\n \n}", "title": "" }, { "docid": "df1c2d8925e48cd0458c173063191c08", "score": "0.57298964", "text": "function eventDisplay() {\r\n\tdocument.getElementById(\"eventTitle\").innerHTML = eventInfo['title'];\r\n\tdocument.getElementById(\"eventDesc\").innerHTML = eventInfo['description'];\r\n\tlet RSVPslotLim = eventInfo['RSVPslotLim']\r\n\tif ( RSVPslotLim === null) {\r\n\t\tRSVPslotLim = 'Unlimited';\r\n\t}\r\n\tdocument.getElementById(\"RSVPslotLim\").innerHTML = 'Your remaining RSVPs for Event: ' + RSVPremaining;\r\n}", "title": "" }, { "docid": "d870ff02cb22eb2546569acf47a158b8", "score": "0.57278323", "text": "function myAgendaClickHandler(eventObj) {\n // Get ID of the agenda item from the event object\n var agendaId = eventObj.data.agendaId;\n // pull agenda item from calendar\n var agendaItem = jfcalplugin.getAgendaItemById(\"#mycal\", agendaId);\n clickAgendaItem = agendaItem;\n $(\"#display-event-form\").dialog('open');\n }", "title": "" }, { "docid": "fc607432c088baf7e321b349d79ad754", "score": "0.5719007", "text": "function listUpcomingEvents() {\n gapi.client.calendar.events\n .list({\n calendarId: CALENDAR_ID,\n timeMin: new Date().toISOString(),\n showDeleted: false,\n singleEvents: true,\n maxResults: MAX_EVENTS,\n orderBy: \"startTime\"\n })\n .then(function(response) {\n if (response.status >= 200 && response.status < 400) {\n var events = response.result.items;\n if (events.length > 0) {\n for (i = 0; i < events.length; i++) {\n let event = events[i];\n let when = event.start.dateTime;\n if (!when) {\n when = event.start.date;\n }\n var where = event.location;\n var description = event.description;\n MAX_EVENTS <= 1\n ? appendCalendarCard(event.summary, when, where, description)\n : appendCalendarList(event.summary, when, where);\n }\n } else {\n // Create one event card for with just a summary saying no upcoming events\n MAX_EVENTS <= 1\n ? appendCalendarCard(\"No upcoming events found.\", \"\")\n : appendCalendarList(\"No upcoming events found.\", \"\");\n }\n } else {\n alert(\"Error: bad response from Google\");\n }\n });\n}", "title": "" }, { "docid": "06cbb05b9c43237ad01af6c8d849ef10", "score": "0.56957173", "text": "function storyView(event_name) {\n relatedStories(event_name);\n}", "title": "" }, { "docid": "34c50ccd41679d9ee9aba926dec9e04f", "score": "0.5694033", "text": "function createDemoEvents() {\n // Date for the calendar events (dummy data)\n var date = new Date();\n var d = date.getDate(),\n m = date.getMonth(),\n y = date.getFullYear();\n\n return [\n {\n title: 'All Day Event',\n start: new Date(y, m, 1),\n backgroundColor: '#f56954', //red\n borderColor: '#f56954' //red\n },\n {\n title: 'Long Event',\n start: new Date(y, m, d - 5),\n end: new Date(y, m, d - 2),\n backgroundColor: '#f39c12', //yellow\n borderColor: '#f39c12' //yellow\n },\n {\n title: 'Meeting',\n start: new Date(y, m, d, 10, 30),\n allDay: false,\n backgroundColor: '#0073b7', //Blue\n borderColor: '#0073b7' //Blue\n },\n {\n title: 'Lunch',\n start: new Date(y, m, d, 12, 0),\n end: new Date(y, m, d, 14, 0),\n allDay: false,\n backgroundColor: '#00c0ef', //Info (aqua)\n borderColor: '#00c0ef' //Info (aqua)\n },\n {\n title: 'Birthday Party',\n start: new Date(y, m, d + 1, 19, 0),\n end: new Date(y, m, d + 1, 22, 30),\n allDay: false,\n backgroundColor: '#00a65a', //Success (green)\n borderColor: '#00a65a' //Success (green)\n },\n {\n title: 'Open Google',\n start: new Date(y, m, 28),\n end: new Date(y, m, 29),\n url: '//google.com/',\n backgroundColor: '#3c8dbc', //Primary (light-blue)\n borderColor: '#3c8dbc' //Primary (light-blue)\n }\n ];\n }", "title": "" }, { "docid": "4d1f4dfa40b734a80fc47549d903d503", "score": "0.56938344", "text": "onEventAction(event, element, view) {\n //$(element).qtip('show', true);\n let $this = this;\n let id = event._id;\n\n if (undefined === $this._huds[id]) {\n let repeats = `<div class=\"repeats\"><strong>${Craft.t(\"venti\", \"Repeats\")}:</strong>${event.summary}</div>`;\n let occur = `<button class=\"btn\" data-occur>${Craft.t(\"venti\", \"Remove Occurence\")}</button>`;\n let del = `<button class=\"btn\" data-del>${Craft.t(\"venti\", \"Delete\")}</button>`;\n let edit = `<button class=\"btn submit\" data-edit>${Craft.t(\"venti\", \"Edit\")}</button>`;\n let buttons = !$this._multisite || ($this._multisite && $this._editSites[event.siteId]) ? `\n <div class=\"hud-footer\">\n ${ (parseInt(event.recurring) === 1 && event.source.ajaxSettings.canManageEvents === true ) ? occur : '' }\n ${ (event.source.ajaxSettings.canManageEvents === true) ? del : ''}\n ${ (event.source.ajaxSettings.canManageEvents === true) ? edit : ''}\n </div>` : '';\n let content = `\n <div data-eid='${event.id}'>\n <div class=\"event-tip--header\">\n <h3>${event.title}</h3>\n <h6>\n <span class=\"event_group_color\" style=\"background-color:${event.color};\"></span>\n ${event.group}\n </h6>\n <span class=\"closer\">\n <svg height=16px version=1.1 viewBox=\"0 0 16 16\"width=16px xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink><defs></defs><g id=Page-1 fill=none fill-rule=evenodd stroke=none stroke-width=1><g id=close.3.3.1><g id=Group><g id=Filled_Icons_1_ fill=#CBCBCC><g id=Filled_Icons><path d=\"M15.81248,14.90752 L9.22496,8.32 L15.81184,1.73248 C16.06208,1.48288 16.06208,1.07776 15.81184,0.82752 C15.5616,0.57728 15.15712,0.57728 14.90688,0.82752 L8.32,7.41504 L1.73184,0.82688 C1.4816,0.57728 1.07712,0.57728 0.82688,0.82688 C0.57664,1.07712 0.57664,1.4816 0.82688,1.73184 L7.41504,8.32 L0.82688,14.90816 C0.57728,15.15776 0.57664,15.56352 0.82688,15.81312 C1.07712,16.06336 1.48224,16.06272 1.73184,15.81312 L8.32,9.22496 L14.90752,15.81184 C15.15712,16.06208 15.56224,16.06208 15.81248,15.81184 C16.06272,15.56224 16.06208,15.15712 15.81248,14.90752 L15.81248,14.90752 Z\"id=Shape></path></g></g><g id=Invisible_Shape transform=\"translate(0.640000, 0.640000)\"><rect height=15.36 id=Rectangle-path width=15.36 x=0 y=0></rect></g></g></g></g></svg>\n </span>\n </div>\n <div class=\"event-tip--datetime\">\n ${$this.tipDateFormat(event)}\n ${ parseInt(event.repeat) === 1 ? repeats : ''}\n </div> \n </div>\n ${ event.source.ajaxSettings.canManageEvents === true ? buttons : '' }\n `;\n\n\n $this._huds[id] = new Garnish.HUD($(element.currentTarget), $(content), {\n hudClass: 'hud venti-event-tip',\n tipWidth: 500,\n closeBtn: '.closer',\n onShow: $.proxy(function(evt) {\n\n const tip = $(evt.target.$footer);\n\n const btnEdit = tip.find('button[data-edit]');\n const btnDelete = tip.find('button[data-del]');\n const btnOccur = tip.find('button[data-occur]');\n\n btnEdit.on('click', $.proxy(function(evt) {\n evt.preventDefault();\n $this.editEvent(event, element);\n $this._huds[id].hide();\n }));\n\n btnDelete.on('click', $.proxy(function(evt) {\n evt.preventDefault();\n $this.deleteEvent(event, element);\n $this._huds[id].hide();\n }));\n\n btnOccur.on('click', $.proxy(function(evt) {\n evt.preventDefault();\n $this.removeOccurence(event, element);\n $this._huds[id].hide();\n }));\n\n }, this)\n });\n } else {\n $this._huds[id].show();\n }\n }", "title": "" }, { "docid": "2df8a3ed16b75a762f5cdcb2721c1578", "score": "0.569016", "text": "function showEvents() {\n for (var i=0;i<Events.length;i++) {\n //if no date of event was given, show a message instead of date\n if(Events[i].dateOfEvent==undefined) Events[i].dateOfEvent=\" -n/a- \";\n prettyVisualization(i);\n } console.log(\"\\n\");\n}", "title": "" }, { "docid": "44a37253dc588496c66e04bec1cf441c", "score": "0.56847507", "text": "callEvent(event) {\n trackEvent('Single Page', 'clicked ' + event.currentTarget.id)\n }", "title": "" }, { "docid": "ac9452f49ceb231757a224edf707190b", "score": "0.56763387", "text": "function showEventInfo(e, event, eventItem) {\n const bounds = scheduleContainer.getBoundingClientRect();\n const bounds2 = eventItem.getBoundingClientRect();\n const left = bounds2.left - bounds.left;\n const top = bounds2.top - bounds.top;\n\n if (300 + bounds2.left > scheduleContainer.offsetWidth) {\n eventInfoModal.classList.remove(\"modal--left\");\n eventInfoModal.classList.add(\"modal--right\");\n eventInfoModal.style.left = `${left - 320}px`;\n } else {\n eventInfoModal.classList.remove(\"modal--right\");\n eventInfoModal.classList.add(\"modal--left\");\n eventInfoModal.style.left = `${left + bounds2.width}px`;\n }\n\n eventInfoModal.style.top = `${top + bounds2.height / 2 - 5}px`;\n\n const formatter = new Intl.DateTimeFormat(\"ru\", {\n day: \"numeric\",\n month: \"long\"\n });\n eventInfoModal.querySelector(\".eventinfo__title\").innerText = event.title;\n eventInfoModal.querySelector(\".eventinfo__date\").innerText = formatter.format(\n event.date\n );\n eventInfoModal.querySelector(\".eventinfo__participants\").innerText =\n event.participantsToString() || \"Нет\";\n eventInfoModal.querySelector(\".eventinfo__textbox\").value = event.description;\n eventInfoModal.querySelector(\".eventinfo__save\").onclick = () => {\n event.edit({\n description: eventInfoModal.querySelector(\".eventinfo__textbox\").value\n });\n };\n eventInfoModal.querySelector(\".eventinfo__delete\").onclick = () => {\n eventsStorage.deleteEvent(event);\n\n hideModal(eventInfoModal);\n };\n\n showModal(eventInfoModal);\n e.stopPropagation();\n}", "title": "" }, { "docid": "a6312a54b794731bcf123611f8ce4fda", "score": "0.5675046", "text": "function listUpcomingEvents() {\n var request = gapi.client.calendar.events.list({\n 'calendarId': 'jesperbbhansen@gmail.com',\n 'timeMin': moment().format(),//new Date().toISOString(),\n 'timeMax': moment().add('days', 1).format(),//new Date().toISOString(),\n 'showDeleted': false,\n 'singleEvents': true,\n 'maxResults': 10,\n 'orderBy': 'startTime'\n });\n\n request.execute(function(resp) {\n var events = resp.items;\n\n console.log(events);\n\n console.log(\"Upcomming events\");\n\n if (events.length > 0) {\n for (i = 0; i < events.length; i++) {\n var event = events[i];\n var when = event.start.dateTime;\n if (!when) {\n when = event.start.date;\n }\n console.log(event.summary + ' (' + when + ')');\n }\n } else {\n console.log('No upcoming events found.');\n }\n\n });\n }", "title": "" }, { "docid": "ce7e537afc5729e115fd69754c519c80", "score": "0.56684536", "text": "function newEvent(point) {\n // interactions\n if(DRAWING_HANDOFF==true || DRAWING_COLLAB==true) {\n alert(\"Please click on another event or the same event to cancel\");\n return;\n }\n\n if (overlayIsOn) {\n overlayOff();\n return;\n } \n\n //Close all open popovers\n for (var i = 0; i<flashTeamsJSON[\"events\"].length; i++) {\n var idNum = flashTeamsJSON[\"events\"][i].id;\n $(timeline_svg.selectAll(\"g#g_\"+idNum)[0][0]).popover('hide');\n }\n\n if(isUser || in_progress) { // user page\n return;\n }\n \n createEvent(point);\n}", "title": "" }, { "docid": "ea2fd794344e4940c6203cfb636ff600", "score": "0.5666458", "text": "function listUpcomingEvents() {\n\tgapi.client.calendar.events.list({\n\t\t'calendarId': 'primary',\n\t\t'timeMin': (new Date()).toISOString(),\n\t\t'showDeleted': false,\n\t\t'singleEvents': true,\n\t\t'maxResults': 10,\n\t\t'orderBy': 'startTime'\n\t}).then(function(response) {\n\t\tvar events = response.result.items;\n\t\tvar content = $('#content');\n\t\tcontent.empty();\n\t\t\n\t\tif (events.length > 0) {\n\t\t\tcontent.prepend('<h5>Upcoming events:</h5>');\n\t\t\tvar list = $('<ul>');\n\t\t\t\n\t\t\tfor (i = 0; i < events.length; i++) {\n\t\t\t\tlet event = events[i];\n\t\t\t\t\n\t\t\t\tlet when = event.start.dateTime;\n\t\t\t\tif (!when) {\n\t\t\t\t\twhen = event.start.date;\n\t\t\t\t}\n\t\t\t\tlet date = moment(when).format(\"dddd, M/D/YY, h:mm a\");\n\t\t\t\tvar listItem = $('<li>').text(event.summary + ' (' + date + ')');\n\t\t\t\tlist.append(listItem);\n\t\t\t}\n\t\t\t\n\t\t\tcontent.append(list);\n\t\t} else {\n\t\t\tcontent.prepend('<h5>No upcoming events found</h5>');\n\t\t}\n\t});\n}", "title": "" }, { "docid": "9560df30e2fdfb25623e3cf4f01714bf", "score": "0.5662083", "text": "on_desklet_clicked(event) {\n this.retrieveEvents();\n }", "title": "" }, { "docid": "4623ba041b6a93428c4c130e3bd8041d", "score": "0.5635439", "text": "function view_showHistorical() {\n\tdocument.getElementById(\"historical\").style.display = \"block\";\n\tdocument.getElementById(\"location\").style.display = \"none\";\n\tdocument.getElementById(\"basic\").style.display = \"none\";\n}", "title": "" }, { "docid": "1611d5bb7abb832d47086425798104ed", "score": "0.5630338", "text": "function dltTechspecEventDetail()\r\n{\r\n\tvar url = \"delete\";\r\n\tvar htmlAreaObj = _getWorkAreaDefaultObj();\r\n\tvar objAjax = htmlAreaObj.getHTMLAjax();\r\n\tvar objHTMLData = htmlAreaObj.getHTMLDataObj();\r\n\r\n\tsectionName = objAjax.getDivSectionId();\r\n\t//alert(\"sectionName \" + sectionName);\r\n\tif(objAjax && objHTMLData)\r\n\t{\r\n\t bShowMsg = true;\r\n\t objAjax.setActionURL(\"techspecevents.do\");\r\n\t objAjax.setActionMethod(url);\r\n\t objAjax.setProcessHandler(_showWorkArea);\r\n\t \t\r\n\t objHTMLData.performSaveChanges(_showSaveContainerWorkArea, objAjax);\r\n if(objAjax.isProcessComplete())\r\n {\r\n objHTMLData.resetChangeFields();\r\n }\r\n\t}\r\n}", "title": "" }, { "docid": "74ef788b0270adfa48ed86a8ba5d8772", "score": "0.5629724", "text": "function listUpcomingEvents() {\n var request = gapi.client.calendar.events.list({\n 'calendarId': 'primary',\n 'timeMin': (new Date()).toISOString(),\n 'showDeleted': false,\n 'singleEvents': true,\n 'orderBy': 'startTime'\n });\n\n request.execute(function(resp) {\n var events = resp.items;\n\n if (events.length > 0) {\n EventsList.updateState(events);\n browserHistory.push('/google-calendar-invite-app/events');\n } else {\n appendPre('No upcoming events found.');\n }\n });\n }", "title": "" }, { "docid": "a8df7ac6082deaf3f15b6820f2cdbb7a", "score": "0.5619485", "text": "onSelect(event) {\n function displayElement(id, flag) {\n document.getElementById(id).hidden = !flag;\n return flag;\n }\n\n let dateFormatter = cal.dtz.formatter;\n\n let item = document.getElementById(\"calendar-task-tree\").currentTask;\n if (\n displayElement(\"calendar-task-details-container\", item != null) &&\n displayElement(\"calendar-task-view-splitter\", item != null)\n ) {\n document.getElementById(\"calendar-task-details-title-row\").toggleAttribute(\"hidden\", false);\n document.getElementById(\"calendar-task-details-title\").textContent = item.title\n ? item.title.replace(/\\n/g, \" \")\n : \"\";\n\n let organizer = item.organizer;\n if (\n !document\n .getElementById(\"calendar-task-details-organizer-row\")\n .toggleAttribute(\"hidden\", !organizer)\n ) {\n let name = organizer.commonName;\n if (!name || name.length <= 0) {\n if (organizer.id && organizer.id.length) {\n name = organizer.id;\n let re = new RegExp(\"^mailto:(.*)\", \"i\");\n let matches = re.exec(name);\n if (matches) {\n name = matches[1];\n }\n }\n }\n if (\n !document\n .getElementById(\"calendar-task-details-organizer-row\")\n .toggleAttribute(\"hidden\", !name)\n ) {\n document.getElementById(\"calendar-task-details-organizer\").textContent = name;\n }\n }\n\n let priority = 0;\n if (item.calendar.getProperty(\"capabilities.priority.supported\")) {\n priority = parseInt(item.priority, 10);\n }\n document\n .getElementById(\"calendar-task-details-priority-row\")\n .toggleAttribute(\"hidden\", priority == 0);\n displayElement(\"calendar-task-details-priority-low\", priority >= 6 && priority <= 9);\n displayElement(\"calendar-task-details-priority-normal\", priority == 5);\n displayElement(\"calendar-task-details-priority-high\", priority >= 1 && priority <= 4);\n\n let status = item.getProperty(\"STATUS\");\n if (\n !document\n .getElementById(\"calendar-task-details-status-row\")\n .toggleAttribute(\"hidden\", !status)\n ) {\n let statusDetails = document.getElementById(\"calendar-task-details-status\");\n switch (status) {\n case \"NEEDS-ACTION\": {\n statusDetails.textContent = cal.l10n.getCalString(\"taskDetailsStatusNeedsAction\");\n break;\n }\n case \"IN-PROCESS\": {\n let percent = 0;\n let property = item.getProperty(\"PERCENT-COMPLETE\");\n if (property != null) {\n percent = parseInt(property, 10);\n }\n statusDetails.textContent = cal.l10n.getCalString(\"taskDetailsStatusInProgress\", [\n percent,\n ]);\n break;\n }\n case \"COMPLETED\": {\n if (item.completedDate) {\n let completedDate = item.completedDate.getInTimezone(cal.dtz.defaultTimezone);\n statusDetails.textContent = cal.l10n.getCalString(\"taskDetailsStatusCompletedOn\", [\n dateFormatter.formatDateTime(completedDate),\n ]);\n }\n break;\n }\n case \"CANCELLED\": {\n statusDetails.textContent = cal.l10n.getCalString(\"taskDetailsStatusCancelled\");\n break;\n }\n default: {\n document\n .getElementById(\"calendar-task-details-status-row\")\n .toggleAttribute(\"hidden\", true);\n break;\n }\n }\n }\n let categories = item.getCategories();\n if (\n !document\n .getElementById(\"calendar-task-details-category-row\")\n .toggleAttribute(\"hidden\", categories.length == 0)\n ) {\n document.getElementById(\"calendar-task-details-category\").textContent = categories.join(\n \", \"\n );\n }\n\n let taskStartDate = item[cal.dtz.startDateProp(item)];\n if (taskStartDate) {\n document.getElementById(\"task-start-date\").textContent = cal.dtz.getStringForDateTime(\n taskStartDate\n );\n }\n document.getElementById(\"task-start-row\").toggleAttribute(\"hidden\", !taskStartDate);\n\n let taskDueDate = item[cal.dtz.endDateProp(item)];\n if (taskDueDate) {\n document.getElementById(\"task-due-date\").textContent = cal.dtz.getStringForDateTime(\n taskDueDate\n );\n }\n document.getElementById(\"task-due-row\").toggleAttribute(\"hidden\", !taskDueDate);\n\n let parentItem = item;\n if (parentItem.parentItem != parentItem) {\n // XXXdbo Didn't we want to get rid of these checks?\n parentItem = parentItem.parentItem;\n }\n let recurrenceInfo = parentItem.recurrenceInfo;\n let recurStart = parentItem.recurrenceStartDate;\n if (\n !document\n .getElementById(\"calendar-task-details-repeat-row\")\n .toggleAttribute(\"hidden\", !recurrenceInfo || !recurStart)\n ) {\n let kDefaultTimezone = cal.dtz.defaultTimezone;\n let startDate = recurStart.getInTimezone(kDefaultTimezone);\n let endDate = item.dueDate ? item.dueDate.getInTimezone(kDefaultTimezone) : null;\n let detailsString = recurrenceRule2String(\n recurrenceInfo,\n startDate,\n endDate,\n startDate.isDate\n );\n if (detailsString) {\n let rpv = document.getElementById(\"calendar-task-details-repeat\");\n rpv.textContent = detailsString.split(\"\\n\").join(\" \");\n }\n }\n let textbox = document.getElementById(\"calendar-task-details-description\");\n let description = item.hasProperty(\"DESCRIPTION\") ? item.getProperty(\"DESCRIPTION\") : null;\n textbox.value = description;\n textbox.readOnly = true;\n let attachmentRows = document.getElementById(\"calendar-task-details-attachment-rows\");\n while (attachmentRows.lastChild) {\n attachmentRows.lastChild.remove();\n }\n let attachments = item.getAttachments();\n if (displayElement(\"calendar-task-details-attachment-row\", attachments.length > 0)) {\n displayElement(\"calendar-task-details-attachment-rows\", true);\n for (let attachment of attachments) {\n let url = attachment.calIAttachment.uri.spec;\n let urlLabel = document.createXULElement(\"label\");\n urlLabel.setAttribute(\"class\", \"text-link\");\n urlLabel.setAttribute(\"value\", url);\n urlLabel.setAttribute(\"tooltiptext\", url);\n urlLabel.setAttribute(\"crop\", \"end\");\n urlLabel.setAttribute(\"onclick\", \"if (event.button != 2) launchBrowser(this.value);\");\n urlLabel.setAttribute(\"context\", \"taskview-link-context-menu\");\n attachmentRows.appendChild(urlLabel);\n }\n }\n }\n }", "title": "" }, { "docid": "a3cc1561b90a5f902390074c7d322f7a", "score": "0.5618559", "text": "function createEvents(events){\n\n\n todaysEvents.innerHTML = '';\n upcomingEvents.innerHTML = '';\n\n events.forEach(function(ev) {\n var container = document.createElement('section');\n var when = ev.when.split('T');\n var day = when[0].split('-');\n var getWeekday = months[day[1] - 1] + ' ' + day[2] + ', ' + day[0] + ' 00:00:00';\n var isThismonth = false;\n\n var my_date = new Date(getWeekday);\n\n\n var eventDiv = document.createElement('div');\n eventDiv.id = 'eventday';\n\n container.appendChild(eventDiv);\n\n var div = document.createElement('div');\n div.classList.add('weekday');\n if(my_date.getDay() == 0){\n div.textContent = weekdays[6];\n }else {\n div.textContent = weekdays[my_date.getDay() - 1];\n }\n\n\n eventDiv.appendChild(div);\n\n div = document.createElement('div');\n div.classList.add('day');\n div.textContent = day[2];\n eventDiv.appendChild(div);\n\n div = document.createElement('div');\n div.classList.add('month');\n div.textContent = months[day[1] - 1];\n if(div.textContent == currentMonth.textContent){\n isThismonth = true;\n }\n eventDiv.appendChild(div);\n\n\n\n var elem = document.createElement('h1');\n elem.textContent = ev.name;\n elem.dataset.id = ev.id;\n container.appendChild(elem);\n\n elem = document.createElement('p');\n elem.textContent = ev.desc;\n elem.id = 'eventdesc';\n container.appendChild(elem);\n\n\n if(ev.start == 'all day'){\n eventtime = 'all day';\n }\n else {\n eventtime = 'From ' + ev.start + ' to ' + ev.finish;\n }\n\n elem = document.createElement('p');\n elem.textContent = eventtime;\n container.appendChild(elem);\n\n elem = document.createElement('p');\n elem.dataset.id = ev.id;\n elem.textContent = 'x';\n elem.id = 'remove';\n elem.onclick = deleteEvent;\n container.appendChild(elem);\n\n var alldays = window.days.children;\n\n if(day[1] < 10){\n mth = day[1].split('0');\n }\n\n for(var i = 0; i < alldays.length; i++){\n if(alldays[i].textContent == day[2] && currentM.textContent == months[mth[1] - 1] && year == day[0]){\n alldays[i].classList.add('hasEvent');\n }\n }\n\n if(isThismonth == true){\n todaysEvents.appendChild(container);\n }else {\n upcomingEvents.appendChild(container);\n }\n\n\n\n });\n\n if(upcomingEvents.textContent == ''){\n upcomingEvents.textContent = 'no events scheduled yet';\n }\n\n if(todaysEvents.textContent == ''){\n upcomingEvents.textContent = 'no events scheduled yet';\n }\n\n\n}", "title": "" }, { "docid": "1cd401476c0e669ff0412eb0bb387eb5", "score": "0.5618002", "text": "function displayEvent(event) {\n var display = '<div class=\"box\">';\n display += \"<p class=\\\"subtitle is-5\\\">\" + event.name + \"</p>\";\n display += createButton(EVENT_NOTIFY_TEXT, \"showNotifyEvent\", event._id, \"button is-small\",\n \"event_notification_button\"+event._id);\n display += '<div id=\"eventNotifyText' + event._id + '\"></div>'\n display += \"<br>\"\n var showNumber = 1;\n //display = displayShowsForEvent(event, display)\n event.shows.forEach((show) => {\n var list = \"<ul id=\\\"\" + show._id + \"\\\"></ul>\";\n var name = \"Show #\" + showNumber + \" on \" + prettyDate(show.start_date) + \" at \" + prettyTime(show.start_time);\n var tickets = \"<br>Tickets sold: \" + show.tickets_sold;\n var btn1 = createButton(TOGGLE_ATTENDEES_TEXT, \"viewShow\", show._id, \"button is-small\",\"show_button\"+show._id);\n var btn2 = createButton(SHOW_NOTIFY_TEXT, \"showNotifyShow\", show._id, \"button is-small\",\n \"show_notification_button\" + show._id);\n var notificationBox = '<div id=\"showNotifyText' + show._id + '\"></div>';\n display += name + tickets + \"<br>\" + \n btn1 + btn2 + notificationBox + list + \"<br>\";\n showNumber += 1;\n }); \n var footer = '<footer class=\"card-footer\">';\n footer += '<a href=\"/edit_event/'+encodeURI(event.name)+'\" class=\"card-footer-item\">Edit Event</a>'\n footer += '<a href=\"/view_stats/'+encodeURI(event.name)+'\" class=\"card-footer-item\">Statistics</a>'\n footer += '</footer>';\n display += footer;\n display += ' </div>'\n return display;\n}", "title": "" }, { "docid": "b06b119fde1eb0a4641e5bd8b278cb9c", "score": "0.561628", "text": "function eventDetail(ev)\n{\n if (!ev)\n ev = window.event;\n ev.stopPropagation();\n\n // check for open event frame\n if (windowList.length > 0)\n { // there are incomplete actions pending\n let text = '';\n let comma = '';\n let button = document.getElementById('Submit');\n for (let iw = 0; iw < windowList.length; iw++)\n { // loop through open iframes\n let iwindow = windowList[iw];\n let iframe = iwindow.frameElement;\n if (iframe && iframe.name == \"event\")\n {\n text += comma + iwindow.document.title;\n comma = ', ';\n }\n } // loop through open iframes\n\n if (text.length > 0)\n {\n popupAlert(\"Please complete the following windows: \" + text,\n button);\n return;\n }\n } // there are incomplete actions pending\n\n let form = this.form;\n let idir = form.idir.value - 0;\n let sdElt = null;\n if (idir > 0)\n { // can edit immediately\n let rownum = this.id.substring(11);\n let ider = null;\n let idet = null;\n\n let eventRow = this.parentNode;\n let rowname = eventRow.id;\n let givenname = encodeURIComponent(form.GivenName.value);\n let surname = encodeURIComponent(form.Surname.value);\n\n // URL to invoke editEvent\n let url = \"/FamilyTree/editEvent.php?idir=\" + idir +\n \"&givenname=\" + givenname +\n \"&surname=\" + surname +\n \"&rownum=\" + rownum;\n if (debug.toLowerCase() == 'y')\n url += \"&debug=y\";\n\n let children = eventRow.getElementsByTagName('input');\n for (let ic = 0; ic < children.length; ic++)\n { // loop through children\n let child = children[ic];\n let name = child.id;\n if (name === undefined || name === '')\n name = child.name;\n let namePatt = /^([a-zA-Z]+)([0-9]*)/;\n let result = namePatt.exec(name);\n if (result)\n name = result[1];\n\n switch(name.toLowerCase())\n { // act on specific fields\n case 'eventdate':\n case 'birthdate':\n case 'christeningdate':\n case 'baptismdate':\n case 'endowmentdate':\n case 'confirmationdate':\n case 'initiatorydate':\n case 'deathdate':\n case 'burieddate':\n {\n url +=\"&date=\" + encodeURIComponent(child.value);\n break;\n }\n\n case 'eventsd':\n {\n sdElt = child;\n break;\n }\n\n case 'eventdescn':\n case 'birthdescn':\n case 'chrisdescn':\n case 'baptismdescn':\n case 'endowmentdescn':\n case 'confirmationdescn':\n case 'initiatorydescn':\n case 'deathdescn':\n case 'burieddescn':\n {\n url += \"&descn=\" + encodeURIComponent(child.value);\n break;\n }\n\n case 'eventlocation':\n case 'birthlocation':\n case 'christeninglocation':\n case 'baptismtemple':\n case 'endowmenttemple':\n case 'confirmationtemple':\n case 'initiatorytemple':\n case 'deathlocation':\n case 'buriedlocation':\n {\n url += \"&location=\" + encodeURIComponent(child.value);\n break;\n }\n\n case 'eventider':\n {\n ider = child.value - 0;\n break;\n }\n\n case 'eventidet':\n {\n idet = child.value - 0;\n break;\n }\n } // act on specific fields\n } // loop through children\n\n // add explicit IDER value or zero\n url += \"&ider=\" + ider;\n\n // pass the current values of the form input fields to\n // the server script so it can initialize the edit dialog\n if (ider > 0)\n { // event in tblER\n url += '&type=30'; // Citation::STYPE_EVENT\n } // event in tblER\n else\n { // event in tblIR\n switch(idet)\n {\n case 3: // Event::ET_BIRTH\n {\n url += '&type=2'; // Citation::STYPE_BIRTH\n break;\n }\n\n case 4: // Event::ET_BURIAL\n {\n url += '&type=5'; // Citation::STYPE_BURIED\n break;\n }\n\n case 5: // Event::ET_CHRISTENING\n {\n url += '&type=3'; // Citation::STYPE_CHRISTEN\n break;\n }\n\n case 6: // Event::ET_DEATHEvent::IDTYPE_INDIV\n {\n url += '&type=4'; // Citation::STYPE_DEATH\n break;\n }\n\n case 8: // Event::ET_LDS_BAPTISM\n {\n url += '&type=15'; // Citation::STYPE_LDSB\n break;\n }\n\n case 16: // Event::ET_LDS_CONFIRMATION\n {\n url += '&type=26'; // Citation::STYPE_LDSC\n break;\n }\n\n case 74: // Event::ET_LDS_ENDOWED\n {\n url += '&type=16'; // Citation::STYPE_LDSE\n break;\n }\n\n case 75: // Event::ET_LDS_INITIATORY\n {\n url += '&type=27'; // Citation::STYPE_LDSI\n break;\n }\n\n default:\n {\n console.log(\"editIndivid.js: 2347: eventDetail: idet=\" + idet);\n break;\n }\n }\n } // event in tblIR\n let lang = 'en';\n if ('lang' in args)\n lang = args.lang;\n url += '&lang=' + lang\n\n // debugging output if requested\n if (debug != 'n')\n popupAlert(\"editIndivid.js: eventDetail: \" + url,\n this);\n\n // open edit dialog for event in right half of window\n windowList.push(openFrame(\"event\",\n url,\n \"right\"));\n } // can edit immediately\n else\n { // individual record not created in database yet\n newSearch = this; // identify button that was clicked\n refresh(); // update database first\n } // individual record not created in database yet\n}", "title": "" }, { "docid": "383cf2b1ea4f09fb3d95ad19daa645fd", "score": "0.5616167", "text": "function listUpcomingEvents() {\n gapi.client.calendar.events.list({\n 'calendarId': 'primary',\n //'timeMin': (new Date()).toISOString(),\n 'timeMin': googleTimeMin,\n 'timeMax' : googleTimeMax,\n 'showDeleted': false,\n 'singleEvents': true,\n 'orderBy': 'startTime'\n }).then(function(response) {\n console.log(response);\n console.log(response.results);\n var events = response.result.items;\n console.log(events);\n\n //Example Code\n // if (events.length > 0) {\n // for (i = 0; i < events.length; i++) {\n // var event = events[i];\n // var when = event.start.dateTime;\n // if (!when) {\n // when = event.start.date;\n // }\n // console.log(event.summary + ' (' + when + ')')\n // }\n // } else {\n // console.log('No upcoming events found.');\n // }\n\n //Clears out event-container on sign in\n $(\"#event-container\").empty();\n\n if (events.length > 0) {\n for (i = 0; i < events.length; i++) {\n var event = events[i];\n var when = event.start.dateTime;\n //\n var d = new Date(when).getHours();\n var m = new Date(when).getMinutes();\n\n if (m < 10) {\n m = \"0\" + m;\n }\n\n console.log(d);\n if (!when) {\n when = event.start.date;\n }\n\n //Stores event[i].when, event.[i].summmary, event[i].id in var writeEvent\n var writeEvent = $(\n\n '<div class=\"event\" data-eventid='+ event.id + '> <div class=\"event-header\"> <i class=\"fa fa-pencil\" aria-hidden=\"true\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Edit Event\"></i></div><div>' + d + \":\" + m + '&nbsp&nbsp|&nbsp&nbsp' + event.summary + '</div><div>'\n\n );\n\n //Appends content of writeEvent and summary to generated divs\n $(\"#event-container\").append(writeEvent); \n }\n } else {\n\n //Appends 'No upcoming events found.' to #event-container if there are no upcoming events\n $(\"#event-container\").append('No upcoming events found.');\n }\n\n });\n}", "title": "" }, { "docid": "0faecfa10d980834288090d7bd2d9b7c", "score": "0.56109273", "text": "function showEvent(day,month,year){\n dia_ult = day;\n mes_ult = month;\n ano_ult = year;\n showListCalen(4,day,month,year);\n}", "title": "" }, { "docid": "523bb0c5553e4b032d4df6ca7a7b3e12", "score": "0.5610375", "text": "function currentEvents(city) {\n\tvar queryURL= \"http://api.eventful.com/json/events/search?keywords=\" + eventType + \"&l=\" + city + '&t=' + when +\"&app_key=vHq2Db6bmLLHW26k\";\n\tconsole.log(queryURL);\n\t\t$.ajax({\n\t\t\turl:queryURL,\n\t\t\tmethod:\"GET\",\n\t\t\tdataType: \"jsonp\"\n\t\t}).then(function(response){\n\n\t\t\t\t// checks to see if the response was properly retreived\n\n\t\t\t\tif (!response.events) { \n\t\t\t\t\t$('#events-holder').append('<div id=\"ev-failed-search\" class=\"card\">Search Failed. Please clear search and try a new location or type</div>');\n\t\t\t\t} else \n\n\t\t\t\t// loop that builds the elements for the event section\n\n\t\t\t\t{ for (i = 0; i< 10; i++) {\n\t\t\t\tlet evTitle = response.events.event[i].title;\n\t\t\t\tlet evStart = response.events.event[i].start_time;\n\t\t\t\tlet trudate = new Date(evStart);\n\t\t\t\tlet evUrl = response.events.event[i].url;\n\t\t\t\tlet regName = response.events.event[i].region_abbr;\n\t\t\t\tlet venueAdd = response.events.event[i].venue_address;\n\t\t\t\tlet venueCity = response.events.event[i].city_name;\n\t\t\t\tlet venueName = response.events.event[i].venue_name;\n\t\t\t\tlet venueUrl = response.events.event[i].venue_url;\n\n\t\t\t\t// create the divs that display api info\n\n\t\t\t\t$('#events-holder').append('<div class=\"my-eventcard\" id=\"event'+(i)+'\"></div>');\n\t\t\t\t$('#event'+(i)).addClass('card');\n\t\t\t\t$('#event'+(i)).addClass('column');\n\t\t\t\t$('#event'+(i)).append('<div id=\"ev-title\">Event Title: ' + evTitle +'</div>');\n\t\t\t\t$('#event'+(i)).append('<p id=\"ev-start-time' + (i) + '\">Date and time: ' + trudate + '</di>');\n\t\t\t\t$('#event'+(i)).append('<span>Venue:</span> <a id=\"venue-name ' + (i) +'\" href=\"'+ venueUrl+'\">' + venueName +'</a>');\n\t\t\t\t$('#event'+(i)).append('<p id=\"ev-venue-address ' + (i) +'\"> Address: ' + venueAdd + ' ' + venueCity + ', ' + regName +'</p>');\n\t\t\t\t$('#event'+(i)).append('<a id=\"ev-ticket-btn\" class=\"button is-link\" href=\"' + evUrl + '\">Get Tickets</a>');\n\t\t\t\t$('#events-holder').append('<br>');\n\t\t\t\t}\n\t\t\t} \n\t\t});\n\t}", "title": "" }, { "docid": "c6c7d34566c676ffe3367b38a940a01f", "score": "0.5603755", "text": "function detailEventQuery(eventID)\n{\n const EVENTBRITE_DETAIL_URL = 'https://www.eventbriteapi.com/v3/events/';\n\n let parameters = \n {\n token : 'EDV4JBTI3R6EUVDOU3PP'\n };\n \n ($.getJSON(EVENTBRITE_DETAIL_URL + eventID + \"/\", parameters, function(data)\n {\n let eventDetail = data;\n\n displaySingleEvent(eventDetail);\n \n }));\n \n}", "title": "" }, { "docid": "e9df1d6b233df0cb914658e10c07fb74", "score": "0.5597565", "text": "function toggleEventRelatedHiddenElems(fcEvent, eventDeleteBtn, eventOutcomeDiv)\n{\n if(isPast(fcEvent.start)) {\n eventDeleteBtn.hide();\n eventOutcomeDiv.show();\n } else {\n eventDeleteBtn.val(fcEvent.id).show();\n eventOutcomeDiv.hide();\n }\n}", "title": "" }, { "docid": "52f628db4c48c78081e3d5e15d4e9261", "score": "0.5595725", "text": "function clickOnSingleEvent(){\n let allSingleEvents = document.querySelectorAll('.singleEvent');\n let allSingleEventsOnDate = document.querySelectorAll('.singleEventOnDate');\n allSingleEvents.forEach(treatSingleEvent);\n allSingleEventsOnDate.forEach(treatSingleEvent);\n function treatSingleEvent(singleEvent){\n singleEvent.addEventListener('click', displaySingleEvent);\n function displaySingleEvent(){\n window.location.href = \"single-event.html?id=\" + singleEvent.querySelector('span.hide').textContent;\n }\n }\n}", "title": "" }, { "docid": "f7a8af338c13cf11e3410fe93b29a7b6", "score": "0.5583964", "text": "function openEvent1(){\n\tdocument.getElementById(“eventdetail1”).style.display = “block”;\n\tdocument.getElementById(“eventdetail1”).style.zIndex = \"100\";\n}", "title": "" }, { "docid": "1f4c73450a021183c7e14ac38c08981b", "score": "0.55655175", "text": "function showDetailEvent(customInfo){\n detail = document.querySelector(\".panelContent\")\n var id = customInfo.split(',')[0];\n var typeEvent = customInfo.split(',')[1];\n\n fetch('api/events/detail/'+typeEvent+'/'+id)\n .then( res => res.json())\n .then(events => {\n detailEvent = document.createElement('div');\n detailEvent.id = \"detailEvent\";\n detailEvent.innerHTML = \n `<h1>${events.name}</h1>\n <img src='/media/workshops/2020/06/08/curso-online-pasteleria-reposteria_amp_primaria_1_1560502963.jpg' alt='caca'>\n <b><p>Comuna:</b> ${events.commune}</p>\n <b><p>Tipo de evento:</b> ${typeEvent} - ${events.type}</p>\n <b><p>Descripcion:</b> ${events.description}</p>\n <b><p>Direccion:</b> ${events.address}</p>\n <b><p>Inicio:</b> ${events.start_date}, ${events.start_time}</p>\n <b><p>Termino:</b> ${events.ended_date}, ${events.ended_time}</p>\n <b><p>Puntuaciones:</b></p>\n <p><img id=\"starsImg\" src=\"static/img/5stars.png\" alt=\"5 estrellas imagen\"> = <b>${events.five_stars}</b></p>\n <p><img id=\"starsImg\" src=\"static/img/4stars.png\" alt=\"4 estrellas imagen\"> = <b>${events.four_stars}</b></p>\n <p><img id=\"starsImg\" src=\"static/img/3stars.png\" alt=\"3 estrellas imagen\"> = <b>${events.three_stars}</b></p>\n <p><img id=\"starsImg\" src=\"static/img/2stars.png\" alt=\"2 estrellas imagen\"> = <b>${events.two_stars}</b></p>\n <p><img id=\"starsImg\" src=\"static/img/1stars.png\" alt=\"1 estrellas imagen\"> = <b>${events.one_stars}</b></p>\n <h1>Comentarios de la gente</h1>\n <p>${events.comments}</p>`;\n\n detail.appendChild(detailEvent);\n })\n}", "title": "" }, { "docid": "676da54add8c520989bf40039b0c323e", "score": "0.55441797", "text": "function showEventsInDOM(data){\n var allEvents = data.events;\n console.log(allEvents);\n var eventListing = [];\n const monthNames = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\",\"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n for(let i=0; i < allEvents.length; i++)\n {\n var eventName=allEvents[i].name;\n var dateObject = new Date(allEvents[i].start_time);\n var eventMonth = monthNames[dateObject.getUTCMonth()];\n var eventLocation = allEvents[i].location;\n var eventDate = eventMonth + \" \" + dateObject.getUTCDay() + \", \" + dateObject.getUTCFullYear();\n //The first event listing will always have a special CSS class to is to account for the search bar\n if (i==0)\n {\n var HTMLWrite = '<div class=\"columns listingadjust\">\\\n <div class=\"column is-1\"></div>\\\n <div class=\"column is-2\">\\\n <h1 class=\"title is-6 has-text-centered\">'+eventMonth+'</h1>\\\n <h2 class=\"subtitle has-text-centered\"><b class=\"date\">'+eventDate+'</b></h2>\\\n </div>\\\n <div class=\"vertical\"></div>\\\n <div class=\"column is-6\">\\\n <h1 class=\"title is-6\">'+eventName+'</h1>\\\n <h2 class=\"subtitle is-7\">'+eventLocation+'</h2>\\\n <div class=\"tags\">\\\n <span class=\"tag is-link is-light\"><span class=\"icon\"><i class=\"fas fa-car\"></i></span>Drivers required</span>\\\n <span class=\"tag is-link is-light\"><span class=\"icon\"><i class=\"fas fa-sign-language\"></i></span>ASL</span>\\\n </div>\\\n <p class=\"learnmore\"><a>+ Learn More</a></p>\\\n </div>\\\n <div class=\"column is-2 \">\\\n <button class=\"button btncolor hidebtns\"><span class=\"icon\"><i class=\"fas fa-clipboard\"></i></span><b>RSVP</b></button>\\\n </div>\\\n <div class=\"column is-1\"></div>\\\n </div>'\n }\n //The subsequent classes won't require that special class and have their own styling\n else{\n var HTMLWrite = '<div class=\"columns afterlistings\">\\\n <div class=\"column is-1\"></div>\\\n <div class=\"column is-2\">\\\n <h1 class=\"title is-6 has-text-centered\">'+eventMonth+'</h1>\\\n <h2 class=\"subtitle has-text-centered\"><b class=\"date\">'+eventDate+'</b></h2>\\\n </div>\\\n <div class=\"vertical\"></div>\\\n <div class=\"column is-6\">\\\n <h1 class=\"title is-6\">'+eventName+'</h1>\\\n <h2 class=\"subtitle is-7\">'+eventLocation+'</h2>\\\n <div class=\"tags\">\\\n <span class=\"tag is-link is-light\"><span class=\"icon\"><i class=\"fas fa-car\"></i></span>Drivers required</span>\\\n <span class=\"tag is-link is-light\"><span class=\"icon\"><i class=\"fas fa-sign-language\"></i></span>ASL</span>\\\n </div>\\\n <p class=\"learnmore\"><a>+ Learn More</a></p>\\\n </div>\\\n <div class=\"column is-2 \">\\\n <button class=\"button btncolor hidebtns\"><span class=\"icon\"><i class=\"fas fa-clipboard\"></i></span><b>RSVP</b></button>\\\n </div>\\\n <div class=\"column is-1 \"></div>\\\n </div>'\n }\n eventListing.push(HTMLWrite);\n }\n document.getElementById(\"eventlisting\").innerHTML = eventListing.join(' ');\n}", "title": "" }, { "docid": "46ce3261084e93781cbd0b9db597b6f0", "score": "0.55293083", "text": "createTripEvent() {\n const pointController = new PointController(this.firstDayEventListElem, null, this._places, this._offers, this._onDataChange, this._onChangeView);\n pointController._pointView.element.querySelector(`.event__rollup-btn`).click();\n }", "title": "" }, { "docid": "bdcdbf010f6653dd4459fb3e02a2821d", "score": "0.552915", "text": "function calendar_helper_setTitleAndBackground(cal_event){\n if (cal_event!=null){\n if (cal_event.is_valid)\n directions_api_addTravelTimeToTitle(cal_event);\n else\n calendar_helper_updateCalEventTitleAndBackground(cal_event, openingHoursToString(cal_event.available_destination_id, cal_event.start)); \n }\n}", "title": "" }, { "docid": "db36a25c98186e4b1289b42f24a18bea", "score": "0.55286574", "text": "function showPointHistoryPopup(p) {\n if (p.poi) {\n var events='';\n for (var i=0; i<p.events.length; i++)\n events += p.events[i].type_text + '<br/>';\n\n var html = '<h4>' + p.time_of_day + '</h4><p>' + p.speed_text + '</p><p>' + events + '</p>';\n MapPane.popup(p.poi, html);\n }\n }", "title": "" }, { "docid": "0709c75b037aeedbb78cbab1a6811fa9", "score": "0.5528205", "text": "onEventCreated(newEventRecord) {}", "title": "" }, { "docid": "314aacf1cb43c482250694b4fec7d611", "score": "0.5526477", "text": "function showEvents() {\n information.style.display='none';\n events.style.display='block';\n sights.style.display='none';\n informationButton.className = 'categoryButton material-icons';\n eventsButton.className = 'categoryButton selected material-icons';\n sightsButton.className = 'categoryButton material-icons';\n}", "title": "" }, { "docid": "209ec8732ebcccf4b562642d7eb52ecf", "score": "0.55236864", "text": "function Agenda(parent){var _this=_super.call(this,parent)||this;_this.viewClass='e-agenda-view';_this.isInverseTableSelect=false;_this.agendaDates={};_this.virtualScrollTop=1;_this.agendaBase=new AgendaBase(parent);return _this;}", "title": "" }, { "docid": "cacbc390b9f2c1e310453dc6a83a1a6d", "score": "0.5523119", "text": "function showTaskNameAndDetail(event) {\n const et = event.target\n if (et.className === 'tasksNames') {\n for (let i = 0; i < tasks.length; i++){\n if (tasks[i].task_name === et.getAttribute('name')) {\n tasksdayTaskDetail.textContent = ''\n tasksdayTaskDetail.append(showTaskDetail(tasks[i]))\n }\n }\n }\n}", "title": "" }, { "docid": "eb1a1ef0318e83820a0fd6a34faffe2c", "score": "0.55152446", "text": "function PageEvent(event) {\n this.tab_id = event.tabId;\n this.location = event.url ? event.url : \"not_available\";\n this.content = \"\";\n this.name = event.name;\n this.triggeredAt = new Date().toString();\n\n // If the event expose transition data, adds it to the collection of \n // page transitions\n this.transitions = event.transitionType ? [ new PageTransition(event) ] : [];\n this.snapshot = \"\"; \n}", "title": "" }, { "docid": "9cface33f563a15c4363d34ed1b36d24", "score": "0.55050766", "text": "function showAboutDetails() {\n window.webContents.send('showAboutDetails', 'event page requested');\n}", "title": "" }, { "docid": "6760b84aa25f1bddec707fab8aa6f58b", "score": "0.55030805", "text": "function violentDayEvent(id) {\n\n}", "title": "" }, { "docid": "080a42cb9170fcc8e34696941f675ff5", "score": "0.55012435", "text": "function showVenues(json) {\n if (json !== 0 && json._embedded.venues !== undefined) {\n var events = json._embedded.venues;\n console.log(events);\n\n for (var i = 0; i < events.length; i++) {\n console.log(JSON.stringify(events[i]));\n var newRow = $(\"<tr>\").append(\n $(\"<td><a target='_blank' href=\\\"\" + events[i].url + \"\\\" style=\\\"display:block;\\\">\" + events[i].name + \"</a></td>\")\n );\n $(\"#events > tbody\").append(newRow);\n }\n }\n else {\n var newRow = $(\"<tr>\").append(\n $(\"<td>0 Events Found</td>\")\n );\n $(\"#events > tbody\").append(newRow);\n }\n}", "title": "" }, { "docid": "dbcab563df244c85eb679ade1b540f63", "score": "0.54939693", "text": "onToggleDetail() {\n\n\t\t$(\".account-history\").on(\"click\", \".history-item .action .btn\", ev => {\n\n\t\t\tconst target = $(ev.currentTarget).closest(\".history-item\");\n\t\t\tconst details = $(\".account-history-detail\", target);\n\n\t\t\t$(\".btn.show\", target).toggleClass('hidden');\n\t\t\t$(\".btn.close\", target).toggleClass('hidden');\n\n\t\t\tslideToggle(details[0], 300);\n\n\t\t\treturn false;\n\t\t});\n\t}", "title": "" }, { "docid": "bc579239033ddeb75c0bc781c0a05409", "score": "0.54917413", "text": "function TimelineEvent(parent,type){var _this=_super.call(this,parent)||this;_this.startHour=_this.parent.activeView.getStartHour();_this.endHour=_this.parent.activeView.getEndHour();_this.slotCount=_this.parent.activeViewOptions.timeScale.slotCount;_this.interval=_this.parent.activeViewOptions.timeScale.interval;_this.day=0;_this.rowIndex=0;_this.renderType=type;_this.eventContainers=[].slice.call(_this.element.querySelectorAll('.'+APPOINTMENT_CONTAINER_CLASS));var tr=[].slice.call(_this.element.querySelectorAll('.'+CONTENT_TABLE_CLASS+' tbody tr'));_this.dayLength=tr.length===0?0:tr[0].children.length;_this.content=_this.parent.element.querySelector('.'+CONTENT_TABLE_CLASS);return _this;}", "title": "" }, { "docid": "ee9f42f25b4b8e230a30b607a40f473e", "score": "0.54811746", "text": "function bwUpcomingClickHandler(event) {\n event.preventDefault();\n var href = $(this).attr(\"href\");\n href += \"&start=\" + $(\"#bwDatePickerInput\").val().replace(/-/g,\"\");\n launch(href);\n}", "title": "" }, { "docid": "2cc9766a8ebe782d46d96df24af75d5f", "score": "0.54807264", "text": "function displayEventViewWindow() {\n if (eventGrid.selModel.getCount()) {\n var selections = eventGrid.selModel.getSelections();\n eventDS.on('load', eventDSOnLoad());\n eventDS.load({params: {'id': selections[0].json.id}});\n if (!EventViewWindow.isVisible()) {\n EventViewWindow.show();\n } else {\n EventViewWindow.toFront();\n }\n }\n}", "title": "" }, { "docid": "cc3d5ab7c5063039721a04145568a01d", "score": "0.54745686", "text": "function listUpcomingEvents() {\n var request = gapi.client.calendar.events.list({\n 'calendarId': 'ort78tq23mn9aac1cl3h26e2c8@group.calendar.google.com',\n 'timeMin': (new Date()).toISOString(),\n 'showDeleted': false,\n 'singleEvents': true,\n 'maxResults': 10,\n 'orderBy': 'startTime'\n });\n\n request.execute(function(resp) {\n var events = resp.items;\n appendPre('Upcoming events:');\n\n if (events.length > 0) {\n for (i = 0; i < events.length; i++) {\n var event = events[i];\n var when = event.start.dateTime;\n if (!when) {\n when = event.start.date;\n }\n appendPre(event.summary + ' (' + when + ') ' + event.description)\n }\n } else {\n appendPre('No upcoming events found.');\n }\n\n });\n}", "title": "" }, { "docid": "1f9c86dbc680452fc80a8043ede87729", "score": "0.54705894", "text": "function formatInfo(event) {\n\t\tvar content = '<div id=\"event_info\">'\t\t\t\n\t\t\n\t\tvar eventURL = window.location.protocol + '//' + window.location.host + '/?eventId=' + event.id;\n\t\t\n\t\t//facebook \"f\" button \n\t\tcontent += '<img style=\"margin-bottom:-4px\" src=\"http://static.ak.fbcdn.net/images/fbconnect/login-buttons/connect_white_small_short.gif\"' + \n\t\t\t\t\t\t 'onclick=\"publishFacebookStream(\\'' + event.name + '\\',\\'' + eventURL + '\\')\"/>';\n\t\tcontent += ' ';\n\t\t\n\t\t// Name\n\t\tif (event.url == '') {\n\t\t\tcontent += '<b style=\"color: #0D83DD;\">' + event.name + '</b>';\n\t\t} else {\n\t\t\tcontent += '<a href=\"' + event.url + '\" target=\"_blank\">' + event.name + '</a>';\n\t\t}\n\t\t\n\t\tcontent += '<br><br>';\n\t\t\n\t\t\n\t\t// Description\n\t\tcontent += event.description + '</b><p></p>';\n\t\t\n\t\t// Address\n\t\tcontent += '<b>Venue:&nbsp;</b>' + event.venue_name + ', ' + event.venue_address + ', ' + \n\t\t\tevent.venue_city + ' ' + event.venue_state_code + ' ' + event.venue_zip + '<br>';\n\n\t\t// Dates\n\t\tcontent += '<b>Date:&nbsp;</b>' + convertDate(event.start_date, event.start_time);\n\t\tif (event.end_date.indexOf('-') >= 0) {\n\t\t\tcontent += ' to ' + convertDate(event.end_date, event.end_time);\n\t\t}\n\t\tcontent += '<br>';\n\n\t\t// Price\n\t\tcontent += '<b>Ticket Price:&nbsp;</b>'\n\t\tif (event.ticket_free == 1) {\n\t\t\tcontent += 'free';\n\t\t} else {\n\t\t\tif (event.ticket_price == '') {\n\t\t\t\tcontent += 'Not Available';\n\t\t\t} else {\n\t\t\t\tcontent += event.ticket_price;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Ticket URL\n\t\tif (event.ticket_url != '') {\n\t\t\tcontent += '<br>';\n\t\t\tcontent += '<b>Ticket URL:&nbsp;</b>';\n\t\t\tcontent += '<a href=\"' + event.ticket_url + '\" target=\"_blank\">' + event.ticket_url + '</a>';\n\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t// Share Link\n\t\tcontent +='<br><b>Share:</b></br>'\n\t\tcontent +='<input type=\"text\" style=\"width:300px\" readonly=\"true\" name=\"address\" value=\"'+ eventURL+ '\"/>';\n\t\t\n\t\tcontent += '</div>';\n\t\treturn content;\n\t}", "title": "" }, { "docid": "70f7ab28b342b3b625625d29a06f9fcf", "score": "0.54651767", "text": "function listUpcomingEvents() {\n //Pull busy results for this week\n\n gapi.client.calendar.events\n .list({\n calendarId: \"primary\",\n timeMin: new Date().toISOString(),\n timeMax: sevenDays(),\n showDeleted: false,\n singleEvents: true,\n orderBy: \"startTime\"\n })\n .then(function(response) {\n let events = response.result.items;\n appendPre(\"Upcoming events:\");\n\n if (events.length > 0) {\n for (i = 0; i < events.length; i++) {\n let event = events[i];\n let when = event.start.dateTime;\n if (!when) {\n when = event.start.date;\n }\n appendPre(event.summary + \" (\" + when + \")\");\n }\n } else {\n appendPre(\"No upcoming events found.\");\n }\n });\n}", "title": "" }, { "docid": "cc9b751a97f231064ee9460688252f57", "score": "0.5465156", "text": "function myAgendaMouseoverHandler(eventObj) {\n var agendaId = eventObj.data.agendaId;\n var agendaItem = jfcalplugin.getAgendaItemById(\"#mycal\", agendaId);\n //alert(\"You moused over agenda item \" + agendaItem.title + \" at location (X=\" + eventObj.pageX + \", Y=\" + eventObj.pageY + \")\");\n }", "title": "" }, { "docid": "37ada4022ffbcb6846e3a600371762d6", "score": "0.54643404", "text": "function peacefulDayEvent(id) {\n\n}", "title": "" }, { "docid": "de362a31248fd04a9f6da77ef513fa7f", "score": "0.54597884", "text": "function printTimeline(){\n\t \t$('#list_events').empty();\n\t \tfor (var j=0; j<events.length; j++) {\n\t \t\tif (j<curIndex)\n\t \t\t\t$('#list_events').append(\"<li class='pastdue \"+events[j].complete+\"'><h6>\"+events[j].end+\"</h6><span class='tooltip'><a index='\"+j+\"' class='eventlinks' id='\"+events[j].id+\"'>\"+events[j].title+\"</a></span></li>\");\n\t \t\telse if (j==curIndex)\n\t \t\t\t$('#list_events').append(\"<li class='\"+events[j].complete+\"'><h6>\"+events[j].end+\"</h6><span class='tooltip' style='display:block;''><a index='\"+j+\"' class='eventlinks' id='\"+events[j].id+\"'>\"+events[j].title+\"</a></span></li>\");\n\t \t\telse \n\t \t\t\t$('#list_events').append(\"<li class='\"+events[j].complete+\"'><h6>\"+events[j].end+\"</h6><span class='tooltip'><a index='\"+j+\"' class='eventlinks' id='\"+events[j].id+\"'>\"+events[j].title+\"</a></span></li>\");\n\t \t}\n\t \t$('#leftbar').show();\n\t \tclearScreen(curIndex);\n\t\t}", "title": "" }, { "docid": "a66e1afe83a1c35dbfd14850150e0601", "score": "0.54592514", "text": "function showHistEvents() {\n let Events = allEvents;\n let $row = $('<div class=\"row\"></div>');\n Events.forEach((histEvent) => {\n $row.append(`\n <div class=\"col-md-4\">\n <div class=\"card\">\n <img class=\"card-img-top\" src=\"${histEvent.image}\" alt=\"Card image cap\">\n <div class=\"card-block\">\n <h4 class=\"card-title\">${histEvent.histEvent}</h4>\n <h5 class=\"card-title\">${histEvent.year}</h5>\n <h5 class=\"card-title\">${histEvent.location}</h5>\n <p class=\"card-text\">${histEvent.description}</p>\n </div>\n </div>\n <button class=\"btn btn-danger delete\" data-id=\"${histEvent._id}\">Delete</button>\n <button class=\"btn btn-primary edit\" data-id=\"${histEvent._id}\">Edit</button>\n </div>\n `);\n });\n $popup.show();\n $popupContent.html($row);\n }", "title": "" }, { "docid": "a5721bf8a80136d1be4c0e9d5155f9d8", "score": "0.5454901", "text": "function openDetail(eventoid)\n{\n\n //voy a buscar detalles del evento\n getEventoDetalle(eventoid, loadDetail);\n}", "title": "" }, { "docid": "05c5411bd18d7bd47acca4a9fb7ed881", "score": "0.54537195", "text": "function returnToEventList()\n{\n\n $('#eventDetail').on('click', 'button', function(data)\n {\n $('#eventDetail').html(\"\").addClass('hide');\n\n $('#eventList').removeClass('hide');\n \n displayEventDetail();\n\n });\n \n}", "title": "" }, { "docid": "b018ab4371d7f3734fcb883782943e55", "score": "0.5435395", "text": "function showEvents () {\n let days = document.getElementsByClassName('day');\n let events = [];\n [...eventData['events']].forEach((event)=>{\n [...days].forEach((day)=>{\n if(event['day']===day.innerHTML &&\nevent['month']===headerMonths.innerHTML &&\nevent['year']===headerYears.innerHTML){\n day.classList.add('active-event');\n events.push(event)\n }\n });\n });\n return events;\n}", "title": "" }, { "docid": "662e230e0629e7f5f48577f5c1fa5196", "score": "0.54329747", "text": "function Event(day) {\n this.link = day.url;\n this.name = day.title;\n this.event_date = day.start_time;\n this.summary = day.description;\n}", "title": "" }, { "docid": "b889b9b688a3435019b23f3fe25da084", "score": "0.5432007", "text": "function update_history_section() {\n var container_array = document.querySelectorAll('div.action-details');\n var time_stamp_array = [];\n\n for (let i = 0; i < container_array.length; i++) {\n container_array[i].children[1].style = 'display: none;';\n time_stamp_array.push(container_array[i].children[1]);\n }\n\n for (let i = 0; i < time_stamp_array.length; i++) {\n var inserted_element = document.createElement('div');\n inserted_element.className = 'nates-awesome-date-element';\n time_stamp = time_stamp_array[i].title || time_stamp_array[i].children[0].title // In the Comments section, you need the second part of this 'or' statement in order for the cooler date times to show up.\n inserted_element.innerText = time_stamp;\n\n container_array[i].appendChild(inserted_element);\n }\n}", "title": "" } ]
412b99e2f13d67faa7f1feaf6a53bbda
destroy this shader objects resources (program, attributes, uniforms)
[ { "docid": "3e50f0bef1ccb25218f0202567438d60", "score": "0.86804366", "text": "destroy() {\n this.uniforms = null;\n this.attributes = null;\n\n this.gl.deleteProgram(this.program);\n\n this.vertex = null;\n this.fragment = null;\n }", "title": "" } ]
[ { "docid": "d3ffada20ae7c99b11b09d02a7d0429f", "score": "0.82215697", "text": "destroy()\n {\n this.shaderCache = [];\n this.emptyPool();\n }", "title": "" }, { "docid": "d94b322d906e0708a068fcf14e62f13e", "score": "0.8011686", "text": "destroy()\n {\n this.color = null;\n this.points = null;\n this.indices = null;\n\n this.vao.destroy();\n this.buffer.destroy();\n this.indexBuffer.destroy();\n\n this.gl = null;\n\n this.buffer = null;\n this.indexBuffer = null;\n\n this.glPoints = null;\n this.glIndices = null;\n }", "title": "" }, { "docid": "68f4db5f322eb796a98533cd6fdea600", "score": "0.781637", "text": "function destroy() {\n\tglContext.deleteBuffer(vertexPosBuffer);\n\tglContext.deleteBuffer(vertexColorBuffer);\n\tglContext.deleteProgram(program);\n\tglContext.deleteVertexArray(vertexArray);\n}", "title": "" }, { "docid": "bf6e579aeb3776c6f1dda802cb9f1725", "score": "0.77344555", "text": "deinitGL() {\n\t\tgl.deleteShader(this.fs);\n\t\tgl.deleteShader(this.vs);\n\t\tgl.deleteProgram(this.program);\n\t\tgl.deleteBuffer(this.vbo);\n\t}", "title": "" }, { "docid": "f15368c47918776ad958b27e854bc419", "score": "0.7658282", "text": "destroy()\n {\n // detach events\n this._onBeforeRenderBinding.detach();\n this._onBeforeRenderBinding = null;\n\n this._onContextChangeBinding.detach();\n this._onContextChangeBinding = null;\n\n this._destroyGlObjects();\n\n // destroy buffers.\n for (let i = 0; i < this.buffers.length; ++i)\n {\n this.buffers[i].destroy();\n }\n\n // null references\n this.buffers = null;\n this._buffersMem = null;\n this.indices = null;\n this.shaders = null;\n this.groups = null;\n this.sprites = null;\n this.vertexBuffers = null;\n this.vaos = null;\n this.indexBuffer = null;\n\n super.destroy();\n }", "title": "" }, { "docid": "02022df2d36cd1a85c8f48fb4cdfbd04", "score": "0.76059544", "text": "function destroy() {\n glContext.devareBuffer(vertexPosBuffer);\n glContext.devareBuffer(vertexColorBuffer);\n glContext.devareProgram(program);\n glContext.devareVertexArray(vertexArray);\n}", "title": "" }, { "docid": "96e724842c60d00a3075695483b6c863", "score": "0.75303745", "text": "destroy()\n {\n this.framebuffer.destroy();\n\n this.gl = null;\n this.framebuffer = null;\n this.clearColor = null;\n this.size = null;\n this.projectionMatrix = null;\n this.transform = null;\n this.defaultFrame = null;\n this.destinationFrame = null;\n this.sourceFrame = null;\n }", "title": "" }, { "docid": "d029fb963b0773a306989e14f9b8ab55", "score": "0.7481721", "text": "destroy() {\n this.variants = {};\n this._shader = null;\n\n for (let i = 0; i < this.meshInstances.length; i++) {\n const meshInstance = this.meshInstances[i];\n meshInstance.clearShaders();\n meshInstance._material = null;\n\n if (meshInstance.mesh) {\n const defaultMaterial = getDefaultMaterial(meshInstance.mesh.device);\n if (this !== defaultMaterial) {\n meshInstance.material = defaultMaterial;\n }\n } else {\n Debug.warn('pc.Material: MeshInstance.mesh is null, default material cannot be assigned to the MeshInstance');\n }\n }\n\n this.meshInstances.length = 0;\n }", "title": "" }, { "docid": "18bb3edbf4a1fd47dc4ec077c72e9169", "score": "0.73337615", "text": "freeResources () {\n for (let m in this.meshes) {\n this.meshes[m].forEach(m => m.destroy());\n }\n this.meshes = {};\n\n this.textures.forEach(t => Texture.release(t));\n this.textures = [];\n\n this.previous_textures.forEach(t => Texture.release(t));\n this.previous_textures = [];\n }", "title": "" }, { "docid": "76e61defc7a4810799079ecd2b5f53b0", "score": "0.730189", "text": "destroy()\n {\n const gl = this.gl;\n\n gl.deleteBuffer(this.vertexBuffer);\n gl.deleteBuffer(this.indexBuffer);\n }", "title": "" }, { "docid": "caf6adcbd75fe4befa8b0a29933ca309", "score": "0.724975", "text": "dispose() {\n\t\t\tthis._blurMaterial.dispose();\n\n\t\t\tif (this._cubemapShader !== null) this._cubemapShader.dispose();\n\t\t\tif (this._equirectShader !== null) this._equirectShader.dispose();\n\n\t\t\tfor (let i = 0; i < _lodPlanes.length; i++) {\n\t\t\t\t_lodPlanes[i].dispose();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "e89bb6d831a75a052c736ddd047d3fc7", "score": "0.7217949", "text": "destroy() {\n if (!this.valid) {\n return\n }\n this.gl.deleteTexture(this.texture)\n this.texture = null\n delete this.data\n this.data = null\n this.valid = false\n }", "title": "" }, { "docid": "7fbb1870da4ca3fb3e815b58385b60bb", "score": "0.7182919", "text": "destroy()\n {\n this.frameBuffer.destroy();\n\n this.frameBuffer = null;\n this.texture = null;\n }", "title": "" }, { "docid": "3634f2e9c2dc94fb62cb17fea325df53", "score": "0.7138862", "text": "destroy() {\n this._context.releaseEffect(this._effect);\n this._effect = null;\n _context_free();\n this._context = null;\n }", "title": "" }, { "docid": "668809fa8c70132d152d3cc20ff9aea6", "score": "0.7035454", "text": "dispose() {\n //unbind the program if its currently active\n if (this.gl.getParameter(this.gl.CURRENT_PROGRAM) === this.program) this.gl.useProgram(null);\n this.gl.deleteProgram(this.program);\n }", "title": "" }, { "docid": "bb306389ab5f32113b485d8b5af45ab8", "score": "0.6980012", "text": "destroy() {\n this.canvas = null;\n this.ctx = null;\n }", "title": "" }, { "docid": "e4c1d8c9b8836742d94ee21b6cc57051", "score": "0.6979661", "text": "destroy() {\n for (let i = 0; i < this.input.length; i++) {\n this.input[i].destroy();\n delete this.input[i];\n }\n this.output.destroy();\n delete this.output;\n }", "title": "" }, { "docid": "387fbdd88736961ceb285f5247bc4eb7", "score": "0.6950029", "text": "dispose() {\n //unbind the program if its currently active\n if (gl.getParameter(gl.CURRENT_PROGRAM) === this.program) gl.useProgram(null);\n gl.deleteProgram(this.program);\n }", "title": "" }, { "docid": "4e7569114eb7c9db7bc1f6e4f3a2c9e0", "score": "0.6874403", "text": "destroy() {\n this._controls.dispose()\n cancelAnimationFrame(this._requestFrameId)\n this._camera = null\n this._controls = null\n this._scene = null\n this._renderer.domElement.remove()\n this._renderer = null\n }", "title": "" }, { "docid": "1255af0209a7551aad841972f7bbfcc4", "score": "0.6871239", "text": "function destroyBufMesh() {\n\n bufObj.geom.removeAttribute('position')\n bufObj.geom.removeAttribute('normal')\n bufObj.geom.removeAttribute('color')\n bufObj.geom.attributes = undefined\n\n bufObj.geom.dispose()\n bufObj.mat.dispose()\n\n bufObj.mesh = undefined\n\n }", "title": "" }, { "docid": "9d9c2c0bcfdc0bd1a397ed178ad53cb8", "score": "0.6859238", "text": "dispose(){\n\t\t\t//unbind the program if its currently active\n\t\t\tif(this.gl.getParameter(this.gl.CURRENT_PROGRAM) === this.program) this.gl.useProgram(null);\n\t\t\tgl.deleteProgram(this.program);\n\t\t}", "title": "" }, { "docid": "222afddf56a87a38ec524372f5f03c9a", "score": "0.6841871", "text": "destroy() {\n this._controls.dispose();\n cancelAnimationFrame(this._requestFrameId);\n this._camera = null;\n this._controls = null;\n this._scene = null;\n this._renderer.domElement.remove();\n this._renderer = null;\n }", "title": "" }, { "docid": "f6c6b32989ba8933174bd401afd5b829", "score": "0.6830649", "text": "unload() {\r\n \r\n this.Program = null;\r\n this.Camera = null;\r\n this.Lights = null;\r\n this.Meshes = null;\r\n this.PressedKeys = null;\r\n this.RotateDelay = null;\r\n this.MoveDelay = null;\r\n this.IsMoving = null;\r\n this.IsRotating = null;\r\n this.MovementAnimation = null;\r\n this.RotationAnimation = null;\r\n }", "title": "" }, { "docid": "ffeba809d5c49ce4649ed19918c7303e", "score": "0.68244994", "text": "destroy() {\n super.destroy();\n this.ctx = null;\n this.canvas = null;\n }", "title": "" }, { "docid": "c4664980d3cbdad44230ca26d4b36a8d", "score": "0.68068045", "text": "dispose() {\n this.scenes.forEach((scene) => {\n scene.traverse((object) => {\n if (!object.isMesh) {\n return;\n }\n const mesh = object;\n const materials = Array.isArray(mesh.material) ? mesh.material : [mesh.material];\n materials.forEach(material => {\n // Explicitly dispose any textures assigned to this material\n for (const propertyName in material) {\n const propertyValue = material[propertyName];\n if (propertyValue instanceof Texture) {\n propertyValue.dispose();\n }\n }\n material.dispose();\n });\n mesh.geometry.dispose();\n });\n });\n }", "title": "" }, { "docid": "2a1a32301a5e9591fb8d29f201489981", "score": "0.67753917", "text": "destroy() {\n if (this._pickingMesh) {\n // TODO: Properly dispose of picking mesh\n this._pickingMesh = null;\n }\n\n this.clearCoordinates();\n this.clearBufferAttributes();\n\n // Run common destruction logic from parent\n super.destroy();\n }", "title": "" }, { "docid": "91235d24880974e4f4a4d7823dd2609d", "score": "0.67591405", "text": "destroy()\n {\n this.renderer.off('context', this.onContextChange, this);\n\n this.renderer = null;\n }", "title": "" }, { "docid": "e5aedc8f93d16ea6771ea7f9470fcfe7", "score": "0.6758307", "text": "function cleanUpDrawObjects() {\n m_bufferVertexAttributeMap = {};\n m_buffers = [];\n }", "title": "" }, { "docid": "a6bc71872e06565a6dd5e5e483098aa4", "score": "0.673894", "text": "releaseResources(in_contextPrivate){\n\t\tif (this.shaderResource !== undefined){\n\t\t\tthis.shaderResource.release(in_contextPrivate);\n\t\t}\n\t\tthis.shaderResource = undefined;\n\t}", "title": "" }, { "docid": "657883f1284cd8d232409c41bb621e42", "score": "0.67157805", "text": "destroy() {\n if (!this.isPaused()) {\n this.pause();\n }\n this.unAll();\n this.buffer = null;\n this.disconnectFilters();\n this.disconnectSource();\n this.gainNode.disconnect();\n this.scriptNode.disconnect();\n this.analyser.disconnect();\n\n // close the audioContext if closeAudioContext option is set to true\n if (this.params.closeAudioContext) {\n // check if browser supports AudioContext.close()\n if (typeof this.ac.close === 'function') {\n this.ac.close();\n }\n // clear the reference to the audiocontext\n this.ac = null;\n // clear the actual audiocontext, either passed as param or the\n // global singleton\n if (!this.params.audioContext) {\n window.WaveSurferAudioContext = null;\n } else {\n this.params.audioContext = null;\n }\n // clear the offlineAudioContext\n window.WaveSurferOfflineAudioContext = null;\n }\n }", "title": "" }, { "docid": "253bb93782f36523103bf856b2a13711", "score": "0.6709783", "text": "destroy() {\n const {\n container,\n points,\n textureAtlas,\n uniqueList\n } = this;\n container.remove(points);\n uniqueList.destroy();\n textureAtlas && textureAtlas.destroy();\n }", "title": "" }, { "docid": "7690ac0d3d0a91700f43039ef368f924", "score": "0.6702306", "text": "cleanupWebGL() {}", "title": "" }, { "docid": "7690ac0d3d0a91700f43039ef368f924", "score": "0.6702306", "text": "cleanupWebGL() {}", "title": "" }, { "docid": "7d88d8bf1cce041006873063735c7b2c", "score": "0.66994417", "text": "static staticdestroy()\n {\n Utils.deleteVBO(Process.m_VertexBufferId);\n Utils.deleteVBO(Process.m_TexCoordBufferId);\n }", "title": "" }, { "docid": "f10156682b5f8283fae1b48695027c75", "score": "0.66896856", "text": "function destroy(){}", "title": "" }, { "docid": "d070a4ffe191e923484140f5f5329297", "score": "0.66780746", "text": "destroy()\n {\n this.renderer = null;\n }", "title": "" }, { "docid": "5ce91ffe02fa7eb63ea668179286a376", "score": "0.6671516", "text": "destroy() {\n // Detach everything from the DOM\n this.$el.removeChild(this.$svg);\n this.layers.forEach((layer) => this.$layout.removeChild(layer.$el));\n // clean references\n this.$el = null;\n this.renderingContext = null;\n this.layers.length = 0;\n }", "title": "" }, { "docid": "6c1f69ccf7bc4193161b090d51cab4d0", "score": "0.66679335", "text": "destroy() {\n\n if (this.persistent) {\n // stop tracking the vertex buffer\n // TODO: remove the buffer from the list on the device (lost context handling)\n const device = this.device;\n\n this.impl.destroy(device);\n\n device._vram.ub -= this.format.byteSize;\n }\n }", "title": "" }, { "docid": "a0adb6bed1228b4d03cdf1faecd5beb1", "score": "0.6661066", "text": "close()\n {\n gl.deleteProgram(this.handle);\n this.handle = null;\n }", "title": "" }, { "docid": "d2658683389056d680330b48330b3806", "score": "0.6654852", "text": "destroy() {\n\t\t\tthis.sections && this.sections.destroy();\n\t\t\tthis.locators && this.locators.destroy();\n\t\t\tthis.navigation && this.navigation.destroy();\n\n\t\t\tthis.sections = undefined;\n\t\t\tthis.locators = undefined;\n\t\t\tthis.navigation = undefined;\n\n\t\t\tthis.manifest = undefined;\n\t\t}", "title": "" }, { "docid": "b7aabf1fa8cce868de8723825076d06d", "score": "0.6647285", "text": "function shutdown() {\n var mainscene = renderer.userData.mainScene;\n while(mainscene.children.length > 0) {\n mainscene.children[0].material.dispose(true);\n mainscene.children[0].geometry.dispose(true);\n mainscene.remove(mainscene.children[0]);\n }\n\n mainscene = null;\n renderer.userData = null;\n renderer.dispose(true);\n canvas.remove();\n }", "title": "" }, { "docid": "e38784254127ee867739ab9d64e9f7b3", "score": "0.66189384", "text": "destroy() {\n const { atlasIndex, atlasTexture, canvas } = this;\n\n atlasTexture.dispose();\n atlasIndex && atlasIndex.dispose();\n\n if (this.shouldDebug) {\n canvas.remove();\n }\n\n this.entries = [];\n }", "title": "" }, { "docid": "7a2a5752bdfeee6b82ddbbb75bbb851c", "score": "0.6606008", "text": "destroy() {\n const {\n atlasIndex,\n atlasTexture,\n canvas\n } = this;\n atlasTexture.dispose();\n atlasIndex && atlasIndex.dispose();\n\n if (this.shouldDebug) {\n canvas.remove();\n }\n\n this.entries = [];\n }", "title": "" }, { "docid": "b7947277dbc662f7c5dd50904e8a5d41", "score": "0.6583528", "text": "function clear () {\n clearShaders()\n clearPrograms()\n }", "title": "" }, { "docid": "0f49226cdb6f1037d92a4525eeca3587", "score": "0.6567379", "text": "function destroyTextures() {\n\t for (var i = 0; i < numTexUnits; ++i) {\n\t gl.activeTexture(GL_TEXTURE0 + i);\n\t gl.bindTexture(GL_TEXTURE_2D, null);\n\t textureUnits[i] = null;\n\t }\n\t values(textureSet).forEach(destroy);\n\n\t stats.cubeCount = 0;\n\t stats.textureCount = 0;\n\t }", "title": "" }, { "docid": "cc5cec6159166fdd6feec2f894b967f7", "score": "0.65661323", "text": "destructor() {\r\n // remove events\r\n if (this.eventEmitter)\r\n this.eventEmitter.removeAllListeners();\r\n // destroy tmp ammo values\r\n Ammo.destroy(this.tmpBtVector3);\r\n Ammo.destroy(this.tmpBtVector3_1);\r\n Ammo.destroy(this.tmpBtQuaternion);\r\n // destory collision shape\r\n Ammo.destroy(this.ammo.getCollisionShape());\r\n // destroy body\r\n Ammo.destroy(this.ammo);\r\n }", "title": "" }, { "docid": "993ead93eaffc2b72c21a52dc38634c2", "score": "0.6558576", "text": "dispose() {\n this.m_entryCache.clear();\n this.m_scene.remove(this.m_clearMesh, this.m_copyMesh);\n this.m_rt.dispose();\n this.m_clearMaterial.dispose();\n this.m_copyMaterial.dispose();\n this.m_copyTextureSet.clear();\n this.m_clearGeometry.dispose();\n this.m_copyGeometry.dispose();\n }", "title": "" }, { "docid": "e46e1a2073c2ee87b0c5ce19605b8806", "score": "0.6556797", "text": "destroy() {\n super.destroy(); // xeokit.Object\n this._putDrawRenderers();\n this._putPickRenderers();\n this._putOcclusionRenderer();\n this.scene._renderer.putPickID(this._state.pickID); // TODO: somehow puch this down into xeokit framework?\n if (this._isObject) {\n this.scene._deregisterObject(this);\n if (this._visible) {\n this.scene._objectVisibilityUpdated(this, false);\n }\n if (this._xrayed) {\n this.scene._objectXRayedUpdated(this, false);\n }\n if (this._selected) {\n this.scene._objectSelectedUpdated(this, false);\n }\n if (this._highlighted) {\n this.scene._objectHighlightedUpdated(this, false);\n }\n this.scene._objectColorizeUpdated(this, false);\n this.scene._objectOpacityUpdated(this, false);\n this.scene._objectOffsetUpdated(this, false);\n }\n if (this._isModel) {\n this.scene._deregisterModel(this);\n }\n this.glRedraw();\n }", "title": "" }, { "docid": "e5136181af0e9744c4e02276232eec49", "score": "0.6540598", "text": "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0$1 + i)\n gl.bindTexture(GL_TEXTURE_2D$1, null)\n textureUnits[i] = null\n }\n values(textureSet).forEach(destroy)\n\n stats.cubeCount = 0\n stats.textureCount = 0\n }", "title": "" }, { "docid": "e5136181af0e9744c4e02276232eec49", "score": "0.6540598", "text": "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0$1 + i)\n gl.bindTexture(GL_TEXTURE_2D$1, null)\n textureUnits[i] = null\n }\n values(textureSet).forEach(destroy)\n\n stats.cubeCount = 0\n stats.textureCount = 0\n }", "title": "" }, { "docid": "120d27250babfd008ebafded363e99dd", "score": "0.6538795", "text": "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0$1 + i);\n gl.bindTexture(GL_TEXTURE_2D$1, null);\n textureUnits[i] = null;\n }\n values(textureSet).forEach(destroy);\n\n stats.cubeCount = 0;\n stats.textureCount = 0;\n }", "title": "" }, { "docid": "120d27250babfd008ebafded363e99dd", "score": "0.6538795", "text": "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0$1 + i);\n gl.bindTexture(GL_TEXTURE_2D$1, null);\n textureUnits[i] = null;\n }\n values(textureSet).forEach(destroy);\n\n stats.cubeCount = 0;\n stats.textureCount = 0;\n }", "title": "" }, { "docid": "4bde5252a966a9f7d180aabe177e646d", "score": "0.65042853", "text": "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0 + i)\n gl.bindTexture(GL_TEXTURE_2D, null)\n textureUnits[i] = null\n }\n gl.activeTexture(GL_TEXTURE0)\n activeTexture = 0\n values(textureSet).forEach(destroy)\n }", "title": "" }, { "docid": "09cbf9cb33b4e362d4e0ad0e80981370", "score": "0.6494208", "text": "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0 + i);\n gl.bindTexture(GL_TEXTURE_2D, null);\n textureUnits[i] = null;\n }\n values(textureSet).forEach(destroy);\n\n stats.cubeCount = 0;\n stats.textureCount = 0;\n }", "title": "" }, { "docid": "772f34397107a33332a4cabbe86844a3", "score": "0.64806813", "text": "function destroyTextures() {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0 + i);\n gl.bindTexture(GL_TEXTURE_2D, null);\n textureUnits[i] = null;\n }\n values(textureSet).forEach(destroy);\n\n stats.cubeCount = 0;\n stats.textureCount = 0;\n }", "title": "" }, { "docid": "93a02d60f3dd258d60fd9405c3adc91c", "score": "0.6479439", "text": "destroy() {\n // TODO: There's a memory leak somewhere\n\n this.container.classList.remove(\"genome-spy\");\n this.container.classList.remove(\"loading\");\n\n for (const [type, listeners] of this._keyboardListeners) {\n for (const listener of listeners) {\n document.removeEventListener(type, listener);\n }\n }\n\n this._glHelper.finalize();\n\n while (this.container.firstChild) {\n this.container.firstChild.remove();\n }\n }", "title": "" }, { "docid": "5f638315f7a1977d037601c41973ab68", "score": "0.6464226", "text": "destroy(){\r\n this.gg1A.destroy();\r\n this.gg1B.destroy();\r\n this.gg1C.destroy();\r\n this.gg100.destroy();\r\n this.game.camera.x = 0;\r\n }", "title": "" }, { "docid": "c6c094ab00cea454e5bcdd4a6d0894c1", "score": "0.6463952", "text": "destroy() {\n this.off();\n this.teardownEffects();\n }", "title": "" }, { "docid": "5bac18e20de200826095784151d06adc", "score": "0.6439552", "text": "function destroy(){\r\n }", "title": "" }, { "docid": "5bac18e20de200826095784151d06adc", "score": "0.6439552", "text": "function destroy(){\r\n }", "title": "" }, { "docid": "dcacda18ae04c0e85ad709bfd41827f0", "score": "0.6434291", "text": "function dispose() {\r\n APEAssetTracker.assetRefs.forEach((assetRef, uuid) => {\r\n const asset = assetRef.asset;\r\n untrack(asset);\r\n if (asset instanceof Object3D) {\r\n if (asset.parent) {\r\n asset.parent.remove(asset);\r\n }\r\n }\r\n if ('dispose' in asset) {\r\n asset.dispose();\r\n }\r\n });\r\n APEAssetTracker.assetRefs = new Map();\r\n APEAssetTracker.snapshots = [];\r\n internalUUIDs = new Map();\r\n }", "title": "" }, { "docid": "e56db762d10ed72d767df6caaf468f89", "score": "0.6431313", "text": "cleanup() {\n stage.removeChild(this._graphics);\n stage.removeChild(this._tag);\n delete this._graphics;\n }", "title": "" }, { "docid": "f7723462be3823dac0dfa9777c6e9586", "score": "0.643006", "text": "dispose() {\n\t for (const pass of this.passes)\n\t pass.dispose();\n\t this.passes = [];\n\t if (this.inputBuffer !== null) {\n\t this.inputBuffer.dispose();\n\t this.inputBuffer = null;\n\t }\n\t if (this.outputBuffer !== null) {\n\t this.outputBuffer.dispose();\n\t this.outputBuffer = null;\n\t }\n\t if (this.depthTexture !== null) {\n\t this.depthTexture.dispose();\n\t }\n\t this.copyPass.dispose();\n\t }", "title": "" }, { "docid": "752715899a9a74b88eea600fc087a3b6", "score": "0.6424907", "text": "function cleanUpDrawObjects(renderState) {\n\t renderState = renderState; /* avoid unused warning */\n\t m_bufferVertexAttributeMap = {};\n\t m_buffers = [];\n\t }", "title": "" }, { "docid": "1f46a5c3708c0483c5134c18e55c00d3", "score": "0.6411197", "text": "clearBuffers()\n\t{\n\t\tif(this.vertexBuffer != null)\n\t\t{\n\t\t\tglContext.deleteBuffer(this.vertexBuffer);\n\t\t}\n\t\tif(this.colorBuffer != null)\n\t\t{\n\t\t\tglContext.deleteBuffer(this.colorBuffer);\n\t\t}\n\t\tif(this.indexBuffer != null)\n\t\t{\n\t\t\tglContext.deleteBuffer(this.indexBuffer);\n\t\t}\n\t}", "title": "" }, { "docid": "cba4187fce3fdb62b8cd1026379a2f6b", "score": "0.640716", "text": "dispose() {\n this.scene.remove(this.m_bgMesh, this.m_mesh);\n this.m_geometry.dispose();\n }", "title": "" }, { "docid": "a008276e26b694583bee4ab79f0898e8", "score": "0.63902104", "text": "function cleanUpDrawObjects(renderState) {\n renderState = renderState; /* avoid unused warning */\n m_bufferVertexAttributeMap = {};\n m_buffers = [];\n }", "title": "" }, { "docid": "7dc741181ab04b281c0cebf1b747a4e7", "score": "0.6379929", "text": "dispose() {\n this.phaseQueueList.forEach(drawQueue => drawQueue.dispose());\n this.phaseQueueList.length = 0;\n this.renderPipeline = null;\n this.renderer = null;\n }", "title": "" }, { "docid": "bda51b114fc6d69b036f42320a0e72a5", "score": "0.6359202", "text": "destroy() {\r\n this.isDestroyed = true;\r\n this.removeDependencies();\r\n this.isDirty = false;\r\n }", "title": "" }, { "docid": "eaf29b58d2a00ab3f13bc19e9a94b201", "score": "0.6347273", "text": "dispose() {\n if (this.geometry !== undefined) {\n this.geometry.dispose();\n }\n if (this.material !== undefined) {\n this.material.dispose();\n }\n }", "title": "" }, { "docid": "401ec9c1bc9a63b82e910e180a0621b0", "score": "0.63440573", "text": "dispose() {\n if (this.geometry !== undefined) {\n this.geometry.dispose();\n }\n if (this.material !== undefined) {\n this.material.dispose();\n }\n }", "title": "" }, { "docid": "ce71937dc1bf5b27836281c5f199d39d", "score": "0.63422763", "text": "dispose() {\n this.m_quadMaterial.dispose();\n this.m_quad.geometry.dispose();\n if (this.m_renderTarget !== null) {\n this.m_renderTarget.dispose();\n this.m_renderTarget = null;\n }\n }", "title": "" }, { "docid": "ce71937dc1bf5b27836281c5f199d39d", "score": "0.63422763", "text": "dispose() {\n this.m_quadMaterial.dispose();\n this.m_quad.geometry.dispose();\n if (this.m_renderTarget !== null) {\n this.m_renderTarget.dispose();\n this.m_renderTarget = null;\n }\n }", "title": "" }, { "docid": "e3e1c3ca1cbfb7fe717820bb1e3f319b", "score": "0.63144207", "text": "function destroyPlayer(){\n player.mesh.dispose();\n // then what?\n }", "title": "" }, { "docid": "2ac3f7a5fe25aaac3a1d38130480ece5", "score": "0.63060045", "text": "$onDestroy() {\n dispose(this.importer);\n this.importer = null;\n\n this.scope = null;\n this.element = null;\n this.sce = null;\n }", "title": "" }, { "docid": "f00cffbd2a3f254c8f2491c278707db2", "score": "0.62871355", "text": "async dispose() {\n if ( this.camera ) {\n this.camera.dispose();\n this.camera = null; \n }\n if ( this.skyBox ) {\n this.skyBox.dispose();\n this.skyBox.material.dispose();\n this.skyBox = null; \n }\n if ( this.light ) {\n this.light.dispose();\n this.light = null;\n }\n if ( this.shadowGenerator ) {\n this.shadowGenerator.dispose();\n this.shadowGenerator = null; \n }\n }", "title": "" }, { "docid": "2e5d776bc5aae35000a1de67cae7b210", "score": "0.6284948", "text": "function destroy(){\r\n\r\n }", "title": "" }, { "docid": "30154ce31b3d73600971e5fa8b629fd7", "score": "0.62673193", "text": "clear() {\n const disposeMaterial = (material) => {\n Object.getOwnPropertyNames(material).forEach((property) => {\n const materialProperty = material[property];\n if (materialProperty !== undefined && materialProperty instanceof THREE.Texture) {\n const texture = materialProperty;\n if (this.shouldDisposeTexture(texture)) {\n texture.dispose();\n }\n }\n });\n material.dispose();\n };\n const disposeObject = (object) => {\n if (object.geometry !== undefined && this.shouldDisposeObjectGeometry(object)) {\n object.geometry.dispose();\n }\n if (object.material !== undefined && this.shouldDisposeObjectMaterial(object)) {\n if (object.material instanceof Array) {\n object.material.forEach((material) => {\n if (material !== undefined) {\n disposeMaterial(material);\n }\n });\n }\n else {\n disposeMaterial(object.material);\n }\n }\n };\n this.objects.forEach((rootObject) => {\n rootObject.traverse((object) => {\n disposeObject(object);\n });\n disposeObject(rootObject);\n });\n this.objects.length = 0;\n if (this.preparedTextPaths) {\n this.preparedTextPaths = [];\n }\n if (this.m_animatedExtrusionTileHandler !== undefined) {\n this.m_animatedExtrusionTileHandler.dispose();\n }\n this.clearTextElements();\n this.invalidateResourceInfo();\n }", "title": "" }, { "docid": "8d27624bd9cbbd07f3eea3a1ec53f485", "score": "0.626635", "text": "destroy(){this.__obj=null}", "title": "" }, { "docid": "d6252efb33c834b1d39351ba00e7ffc2", "score": "0.62629414", "text": "function destroy_geom(geom) {\n for (var i in geom.buffers) {\n var buffer = geom.buffers[i];\n gl.deleteBuffer(buffer.vbo);\n }\n}", "title": "" }, { "docid": "ef4ab00ab28d7bef6a41fbad55c63136", "score": "0.62605125", "text": "destroy() {\n Object.values(this.components).forEach((component) => {\n this.destroyComponent_(component);\n });\n\n // Remove the active NodeList object to free up memory.\n this.nodeList = null;\n this.components = null;\n }", "title": "" }, { "docid": "aa9cd8afebb83a3eb94ea01b50ffd621", "score": "0.6258972", "text": "clear() {\n\n\t\t\tthis.traverse( ( obj ) => {\n\n\t\t\t\tUpdateManager.disposeOf( obj );\n\n\t\t\t\tif ( obj.material ) obj.material.dispose();\n\n\t\t\t\tif ( obj.geometry ) obj.geometry.dispose();\n\n\t\t\t} );\n\n\t\t}", "title": "" }, { "docid": "f4b922efa3393dde2b59d26cd3a223c1", "score": "0.62473035", "text": "function destroy(){\n // self.exists = false;\n // partobj[id] = false;\n document.body.removeChild(El);\n remove(self);\n }", "title": "" }, { "docid": "ebe3668f6f49ff01ed7449ffe70e17ae", "score": "0.6235377", "text": "destroy(){}", "title": "" }, { "docid": "ebe3668f6f49ff01ed7449ffe70e17ae", "score": "0.6235377", "text": "destroy(){}", "title": "" }, { "docid": "ebe3668f6f49ff01ed7449ffe70e17ae", "score": "0.6235377", "text": "destroy(){}", "title": "" }, { "docid": "ed246f16ecf855e34a629589c19b53a1", "score": "0.62261117", "text": "unload(name) {\n const gl = engine.graphics.gl;\n const texureInfo = engine.assetManager.retrieve(name);\n\n gl.deleteTexture(texureInfo.texture);\n }", "title": "" }, { "docid": "ae07f767a5f5b529f70a0e9035291075", "score": "0.62219095", "text": "destroy(){\n\t\t\t// Clear the queue\n\t\t\tthis.q.clear();\n\t\t\tthis.q = undefined;\n\n\t\t\tthis.manager && this.manager.destroy();\n\n\t\t\tthis.manifest = undefined;\n\n\t\t\tthis.spineByHref = undefined;\n\t\t\tthis.spineBySource = undefined;\n\t\t\tthis.spineById = undefined;\n\n\t\t\tthis.hooks.display.clear();\n\t\t\t// this.hooks.serialize.clear();\n\t\t\tthis.hooks.content.clear();\n\t\t\tthis.hooks.layout.clear();\n\t\t\tthis.hooks.render.clear();\n\t\t\tthis.hooks.show.clear();\n\t\t\tthis.hooks = {};\n\n\t\t\tthis.themes.destroy();\n\t\t\tthis.themes = undefined;\n\n\t\t\tthis.epubcfi = undefined;\n\n\t\t\tthis.starting = undefined;\n\t\t\tthis.started = undefined;\n\n\t\t}", "title": "" }, { "docid": "e3e635ac88ff760597fa251f9789e7c7", "score": "0.6219409", "text": "destroy() {\n this.sprite.destroy();\n }", "title": "" }, { "docid": "18a2abb3a901c73155eb20838cf386dc", "score": "0.62098026", "text": "destroy() {\n this.onUpdate && Render.stop(this.__uid__);\n //this._removeEventListeners();\n //this.__el__.remove();\n //nullify(this);\n //console.log(this.__el__)\n this.__el__.getComponents(this.__el__).map(component => {\n component.destroy();\n });\n if (this.onDestroy) {\n this.onDestroy();\n }\n }", "title": "" }, { "docid": "e75699a2132ff37597232fd5207efd2c", "score": "0.6201463", "text": "destroy() {\n const length = this.emitters.length;\n this.canUpdate = false;\n\n for (let e = 0; e < length; e++) {\n this.emitters[e] && this.emitters[e].destroy();\n delete this.emitters[e];\n }\n\n for (let r = 0; r < length; r++) {\n if (this.renderers[r] && this.renderers[r].destroy) {\n this.renderers[r].destroy();\n delete this.renderers[r];\n }\n }\n\n this.emitters.length = 0;\n this.pool.destroy();\n this.canUpdate = true;\n }", "title": "" }, { "docid": "4894c8c52955fd3c46b9b99e35c99542", "score": "0.61876726", "text": "function releaseProgram(program, state) { \n var programID = program.ID;\n var programs = state.programs;\n var programDesc = state.programsDesc[programID];\n if (programDesc == null)\n return;\n \n var release = removeReference(program, state) == 0;\n if (!release)\n return;\n \n programs.remove(program);\n state.programsDesc[programID] = null;\n\n releaseShader(program.vertexShader, state.vertexShaders, state);\n releaseShader(program.fragmentShader, state.fragmentShaders, state);\n\n releaseRendererVariables(programDesc.rendererVariables);\n program.release(); \n }", "title": "" }, { "docid": "653f17a7cb407eb9f430ab035df0228e", "score": "0.61828476", "text": "dispose() {\n\n\t\tthis._dispose();\n\n\t\tif ( this._cubemapMaterial !== null ) this._cubemapMaterial.dispose();\n\t\tif ( this._equirectMaterial !== null ) this._equirectMaterial.dispose();\n\n\t}", "title": "" }, { "docid": "80c03f8a79562e98f7ae03a40f14d3f5", "score": "0.6169286", "text": "dispose() {\n this.resScene.removeSource(this.resNode);\n this.resNode = null;\n super.dispose();\n }", "title": "" }, { "docid": "cf14a970416922a74d27560032a64a72", "score": "0.6166881", "text": "dispose() {\n if (this.geometry !== undefined) {\n this.geometry.dispose();\n this.geometry = undefined;\n }\n this.internalMesh = undefined;\n }", "title": "" }, { "docid": "6d598889c9551c99bc6d1dc7a91d7eaf", "score": "0.61650103", "text": "dispose() {\n const gl = this._gl;\n gl.deleteFramebuffer(this._frameBuffer);\n }", "title": "" }, { "docid": "da11669bb53528320c937f89bb358f29", "score": "0.61355644", "text": "static destroy() {\n GameMusic.main.stop();\n GameMusic.main.destroy();\n GameMusic.soundEffectOfBullet.stop();\n GameMusic.soundEffectOfBullet.destroy();\n GameMusic.soundEffectOfExplosion.stop();\n GameMusic.soundEffectOfExplosion.destroy();\n GameMusic.soundEffectOfCautionForSpeed.stop();\n GameMusic.soundEffectOfCautionForSpeed.destroy();\n }", "title": "" }, { "docid": "a4189f56369cf5707282d5278091bb57", "score": "0.61315906", "text": "destroy() {\n super.destroy();\n GLib.source_remove(this._updateTimeout);\n }", "title": "" }, { "docid": "1c1ce174e3ee0f45a99a1d2d9711358e", "score": "0.613159", "text": "destroy() {\n if (this.reconstructor) {\n this.reconstructor.finishedReconstruction();\n }\n }", "title": "" }, { "docid": "1c1ce174e3ee0f45a99a1d2d9711358e", "score": "0.613159", "text": "destroy() {\n if (this.reconstructor) {\n this.reconstructor.finishedReconstruction();\n }\n }", "title": "" } ]
abe972f2ab04f8bf425463a9bc349671
import postForm from './components/postForm';
[ { "docid": "c0ea7879c3a3a5e3d552bbc981f6e637", "score": "0.0", "text": "function App() {\n const [loginStatus,setLoginStatus]=useState(false)\n\n const loginStat=()=>{\n setLoginStatus(true)\n }\n \n return(\n <Router>\n <Switch>\n <Route \n exact \n path=\"/\"\n render={props=>(\n <Login {...props} loggeinStatus={loginStatus} loginCB={loginStat} />\n )} \n />\n \n <Route \n path=\"/signup\"\n render={props=>(\n <Registration {...props} loggeinStatus={loginStatus} loginCB={loginStat} />\n )} \n />\n \n <Route \n path=\"/home\" \n render={props=>(\n <Home {...props} loggeinStatus={loginStatus} />\n )} \n />\n\n </Switch>\n </Router>\n \n );\n\n // return (\n // <div style={{height:\"100vh\"}} className=\"p-4 d-flex flex-column flex-md-row w-100 justify-content-around align-items-center\">\n // <Posts />\n // <PostForm />\n // </div>\n // );\n}", "title": "" } ]
[ { "docid": "1c4142d08bd7c3f25144631f887208b1", "score": "0.6193693", "text": "function App() {\n return (\n <Form />\n );\n}", "title": "" }, { "docid": "5ebde33c09aeb4eb448e39b879ea62dc", "score": "0.61428165", "text": "render() {\n return (\n //provider holds store and store holds the state\n <Provider store={store}>\n <div className=\"App\">\n <header className=\"App-header\">\n <img src={logo} className=\"App-logo\" alt=\"logo\" />\n <p>\n Edit <code>src/App.js</code> and save to reload.\n </p>\n <a\n className=\"App-link\"\n href=\"https://reactjs.org\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Learn React\n </a>\n </header>\n {/* Added PostForm component Here */}\n <Postform />\n {/* Added Posts Component Here */}\n <Posts />\n\n </div>\n </Provider>\n );\n }", "title": "" }, { "docid": "f26cb03440c031538b8cf1ee056cd41c", "score": "0.6126885", "text": "function App() {\n return (\n <div className=\"App\">\n <InputForm />\n </div>\n );\n}", "title": "" }, { "docid": "61750d460da37b9482e1e86234ad3df5", "score": "0.6066753", "text": "render(){\n\n return (\n <JournalistCreateForm\n handleJournalistPost={this.handleJournalistPost}\n />\n )\n }", "title": "" }, { "docid": "06d0ded28cac06841f2e848429b69525", "score": "0.5939678", "text": "render() {\n return (\n <Container>\n\n New Form Page\n\n </Container>\n )\n }", "title": "" }, { "docid": "8b6a2dfce675c4a8c2819da1911d5f35", "score": "0.59160835", "text": "getComponent(nextState, cb) {\n require.ensure([], (require) => {\n cb(null, require('../containers/Post'))\n }, 'Post')\n }", "title": "" }, { "docid": "b8ae4a5f2ab2061f82e3ad44c9f37055", "score": "0.57942873", "text": "function Form(props) {\n\t\treturn (\n\t\t\t<article className=\"br3 ba b--black-10 mv4 w-100 w-50-m w-25-l mw6 shadow-5 center\">\n\t\t\t\t<main className=\"pa4 black-80\">\n\t\t\t\t <div className=\"measure\">\n\n\t\t\t\t {/*This section defines the form fields that should appear--it dynamically defines them based on whatever component is rendering the form.*/}\n\n\t\t\t\t <fieldset id={props.formID} className=\"ba b--transparent ph0 mh0\">\n\t\t\t\t <legend className=\"f1 fw6 ph0 mh0\">{props.formTitle}</legend>\n\t\t\t\t { props.errorMessage }\n\t\t\t\t {\tprops.fields.map((field) => {\n\t\t\t\t \treturn (\n\t\t\t\t\t <div className=\"mt3 text-left\">\n\t\t\t\t\t <label className=\"db fw6 lh-copy f6\" htmlFor=\"email-address\">{field.title}</label>\n\t\t\t\t\t <input\n\t\t\t\t\t \tclassName={field.classname}\n\t\t\t\t\t \ttype={field.type}\n\t\t\t\t\t \tname={field.name}\n\t\t\t\t\t \tid={field.id}\n\t\t\t\t\t \tonChange={field.onChange}\n\t\t\t\t\t \t />\n\t\t\t\t\t </div>\t\t \t\t\n\t\t\t\t \t\t)\n\t\t\t\t \t})\n\t\t\t\t\t }\n\t\t\t\t </fieldset>\n\n\t\t\t\t {/*These next two divs define the buttons that appear below the form (e.g. Sign In and 'alt button')*/}\n\n\t\t\t\t <div className=\"\">\n\t\t\t\t <input \n\t\t\t\t \tonClick = {props.submitButton.onclick}\n\t\t\t\t \tclassName = {props.submitButton.className} \n\t\t\t\t \ttype = {props.submitButton.type}\n\t\t\t\t \tvalue = {props.submitButton.value}\n\t\t\t\t \t/>\n\t\t\t\t </div>\n\t\t\t\t <div className=\"lh-copy mt3\">\n\t\t\t\t <p \n\t\t\t\t \tonClick = {props.altButton.onclick} \n\t\t\t\t \tclassName = {props.altButton.classname}>\n\t\t\t\t \t{props.altButton.text}\n\t\t\t \t</p>\n\t\t\t\t </div>\n\t\t\t\t </div>\n\t\t\t\t</main>\n\t\t\t</article>\t\n\t\t)\n}", "title": "" }, { "docid": "8b9698b2003b0f5c9c9505f872890260", "score": "0.5762353", "text": "render() {\n \t\t//const {post, addCommentsSuccess,comment} = this.props;\n\n \t\treturn (\n \t\t\t<form onSubmit={this.handleSubmit}>\n <h3>Add new comment</h3>\n \t\t\t\t<div>\n \t\t\t\t\t<label htmlFor=\"author\">author</label>\n \t\t\t\t\t<input type=\"text\" id=\"author\" name=\"author\" />\n \t\t\t\t</div>\n \t\t\t\t<div>\n \t\t\t\t\t<label htmlFor=\"body\">comment</label>\n \t\t\t\t\t<textarea id=\"body\" name=\"body\"></textarea>\n \t\t\t\t</div>\n\t\t\t\t<button type=\"submit\">submit</button>\n \t\t\t</form>\n \t\t)\n \t}", "title": "" }, { "docid": "fa54e71f0d1f97c602e8ae512b4c4e8f", "score": "0.57556444", "text": "render(){\n return(<Posts/>);// Returns the content of Posts.js\n }", "title": "" }, { "docid": "d23fbd0853f578000be2f00e039e895c", "score": "0.5748809", "text": "render() {\n return (\n <div className=\"panel-body\">\n <h1>Create Quiz</h1>\n <QuestionForm />\n </div>\n );\n }", "title": "" }, { "docid": "cb45431fc00534b1b096a4e8cf4d09c7", "score": "0.57162356", "text": "postForm() {\n const url = `${API_URL}/api/formsubmissions/`;\n return axios.post(url).then(response => response.data);\n }", "title": "" }, { "docid": "9b7b352933afb8f6a0976f0e668e04a7", "score": "0.56716794", "text": "function App() {\n return (\n <div className=\"App\">\n <header className=\"App-header\">\n <div className=\"prof-header\">\n <Profile/>\n </div>\n <div className=\"postInput\">\n <PostForm/>\n </div>\n <div className=\"post\">\n <Post/>\n </div>\n </header>\n </div>\n );\n}", "title": "" }, { "docid": "b9faf3386cf010ab8d4b489cb6c7f006", "score": "0.56713814", "text": "renderForm() {\n return (\n <div>\n <form id=\"catForm\" onSubmit={ this._onhandleSubmit }>\n <div className=\"form-group row\">\n <label for=\"name\" className=\"col-sm-3 col-form-label\" name=\"name\">Name</label>\n <div className=\"col-sm-9\">\n <input ref=\"name\" type=\"text\" className=\"form-control\" id=\"name\" placeholder=\"Category name\" />\n </div>\n </div>\n <div class=\"form-group row\">\n <label for=\"description\" className=\"col-sm-3 col-form-label\">Description</label>\n <div className=\"col-sm-9\">\n <textarea ref=\"description\" className=\"form-control\" id=\"description\" name=\"description\"></textarea>\n </div>\n </div>\n </form>\n </div>\n );\n }", "title": "" }, { "docid": "0090497d6dcdac5c94d26662b650c98d", "score": "0.5616965", "text": "render() {\n return (\n <form>\n <h1> Questions </h1>\n </form>\n )\n }", "title": "" }, { "docid": "e96fe24d647f4374beb2e8502d2b7294", "score": "0.55920446", "text": "render() {\n return (\n <div className=\"field\">\n <h1>Write Your Post Here</h1>\n <form className=\"post_form\" onSubmit={this.handleSubmit}>\n <label className=\"label\" for=\"post_content\">Content</label>\n <div className=\"control\">\n <textarea className=\"input\" type=\"text\" id=\"post_content\" ref=\"post_content\"></textarea>\n </div>\n <label className=\"label\" for=\"image\">Image URL</label>\n <div className=\"control\">\n <input className=\"input\" type=\"text\" id=\"image\" ref=\"image\" />\n </div>\n <div className=\"submit\">\n <div className=\"buttons\">\n <input id=\"submit\" className=\"button is-info\" type=\"submit\" />\n <button className=\"button is-info\" onClick={() => this.props.changePage(\"postList\")}>Cancel</button>\n </div>\n </div>\n </form>\n </div>\n )\n }", "title": "" }, { "docid": "e6b5bea3ac693669c826fd3ad6146355", "score": "0.55914754", "text": "function App(props){\n return(\n <div>\n <TodoFormContainer />\n </div>\n )\n}", "title": "" }, { "docid": "e9795af404d24cd6f1bbd7ffb4da4dea", "score": "0.5586824", "text": "render(){\n return (\n <div className=\"App\">\n <Header />\n <Dashboard/>\n <Form />\n </div>\n );\n}", "title": "" }, { "docid": "bb71560ab442e5e7c503213a81978f4c", "score": "0.5574132", "text": "render() {\n return (\n <div>\n <h1>Login page</h1>\n <LoginForm submit={this.submit} />\n </div>\n );\n }", "title": "" }, { "docid": "a8a5912eb5dd38861b9a541c841b3870", "score": "0.5563067", "text": "componentWillMount() {\n registerForm(this.__NAME__);\n }", "title": "" }, { "docid": "e0dfd00c6f2908eb76890af07e08ce77", "score": "0.55625874", "text": "render() {\n const { handleSubmit } = this.props;\n\n return (\n // Since redux form doesn't handle submitting a form, we need to\n // pass our defined onSubmit function, and pass it to handleSubmit.\n // Redux form will call handleSubmit if no errors are present.\n <form onSubmit={handleSubmit(this.onSubmit.bind(this))}>\n <Field label=\"Title\" name=\"title\" component={this.renderField} />\n <Field label=\"Categories\" name=\"categories\" component={this.renderField} />\n <Field label=\"Post Content\" name=\"content\" component={this.renderField} />\n <button type=\"submit\" className=\"btn btn-primary\">Submit</button>\n <Link to=\"/\" className=\"btn btn-danger\">Cancel</Link>\n </form>\n );\n }", "title": "" }, { "docid": "d10cf69d4f6772a51f372700b6017e84", "score": "0.55558485", "text": "function NewPost() {\n\n const dispatch = useDispatch();\n\n function createPost({ title, description, body }) {\n dispatch(sendPostToDB(title, description, body));\n }\n\n return (\n <main>\n <h1>New Post</h1>\n <PostForm save={createPost}/>\n </main>\n );\n}", "title": "" }, { "docid": "341b8d24f057febec3b5a3f91f0a9e47", "score": "0.5552778", "text": "renderForm() {\n\n }", "title": "" }, { "docid": "d6fcc4fc63b50f78bb4c004a2da57138", "score": "0.55513763", "text": "function App() {\n return (\n <Posts/>\n );\n}", "title": "" }, { "docid": "8214eac48cedf80e61c837bf7a37c1d4", "score": "0.5549396", "text": "render() {\n console.log(this.props);\n return (\n // use className in the form tag make nicer display\n // handleSubmit is coming from props check out console.log\n <form onSubmit={this.props.handleSubmit(this.onSubmit)} className=\"ui form error\">\n \n <Field className=\"input\" name=\"title\" component={this.renderInput} label= \"Enter title\"/>\n <Field className=\"input\" name=\"description\" component={this.renderInput} label=\"Enter description\" />\n\n\n<button className=\"ui button primary\">Submit</button>\n </form>\n \n );\n \n}", "title": "" }, { "docid": "8e14e49589902570122f43ccd26d421e", "score": "0.5549047", "text": "render() {\n return (\n <div class=\"add-comment-container\">\n <h3>Add Comment</h3>\n <Form model=\"forms.addComment\" onSubmit={(val) => this.handleSubmit(val)}>\n <Control type=\"text\" model=\"forms.addComment.description\" class=\"form-control\" placeholder=\"Enter comment.\" />\n <button class=\"btn btn-default\">Add Comment</button>\n </Form>\n\n {this.errorMessage()}\n </div>\n )\n }", "title": "" }, { "docid": "3e9f8434796f5147dd2d23b63b6967e6", "score": "0.55347675", "text": "function Register() {\n return (\n <div className=\"App\">\n <div className=\"container\">\n <RegisterForm />\n </div>\n </div>\n );\n}", "title": "" }, { "docid": "4aee0a18bf27628f1481eb198e1a0a54", "score": "0.5530245", "text": "render() {\n return (\n <div className=\"App\">\n <Header />\n <Todo />\n <TodoForm />\n </div>\n );\n }", "title": "" }, { "docid": "33d5f775fc4d22d344e4bc0835ec5dac", "score": "0.5513405", "text": "render(){\n return (\n <div>\n <h1> Upload a new photo </h1>\n <div className =\"form\">\n <form onSubmit={this.handleSubmit}>\n <input type = \"text\" placeholder = \"Link\" name= \"Link\"/>\n <input type = \"text\" placeholder = \"Cation\" name=\"Caption\"/>\n <button>Post</button>\n </form>\n </div> \n </div>\n )\n }", "title": "" }, { "docid": "4d64c5412e90aff779c29882fc8c53fb", "score": "0.5502129", "text": "function NewPostForm(props) {\n let _title = null;\n let _description = null;\n\n function handleNewPostForm(event){\n event.preventDefault();\n props.onNewPostCreation({title: _title.value, description: _description.value, id: v4()});\n\n _title.value = '';\n _description.value = '';\n }\n\n return(\n <div>\n <form onSubmit={handleNewPostForm}>\n <input\n placeholder='Enter a Title'\n type='text'\n ref={(input) => {_title = input;}} />\n <textarea\n placeholder='Enter a Description'\n type='text'\n ref={(input) => {_description = input;}} />\n <button type='submit'>Submit Form</button>\n </form>\n </div>\n );\n}", "title": "" }, { "docid": "c48d653ccc6e5f5b33b86414e9e32592", "score": "0.54823107", "text": "constructor(props){\n super(props);\n this.customForm = this.customForm.bind(this);\n }", "title": "" }, { "docid": "a37553f42eb1121d8ec8f77ac1fe1c69", "score": "0.54682577", "text": "function CreatePostPage() {\n const location = useLocation();\n const { postId, initialGroupId, pinnedUrl } = location.state ?? {};\n\n return (\n <>\n <Layout style={{}}>\n <Navbar selectedMenu=\"edit\" />\n <Layout style={styles.mainArea}>\n <Content>\n <h1 className=\"text-center\">\n {postId ? \"Edit your post\" : \"Create a post\"}\n </h1>\n <CreatePostForm\n postId={postId}\n initialGroupId={initialGroupId}\n pinnedUrl={pinnedUrl}\n />\n </Content>\n </Layout>\n </Layout>\n </>\n );\n}", "title": "" }, { "docid": "246b01380cfdf243a9fa026d0c1aad35", "score": "0.54546183", "text": "render() {\n return (\n <div className=\"intake-form-container\">\n <section className=\"intake-form\">\n <h1 className=\"intake-form-title\">Intake Form</h1>\n\n <DynamicFormContainer\n questions={IntakeFormQA}\n onSubmit={formData => this.handleFormSubmit(formData)}\n editable={true}\n />\n </section>\n </div>\n );\n }", "title": "" }, { "docid": "2e34562737dece418958db10cd6ecad1", "score": "0.5447124", "text": "function importForm(_fileName) {\n var fileName = new File(_fileName);\n if (fileName.getName().startsWith(Form.prototype.FILE_PREFIX) && fileName.getName().endsWith(\".js\")) {\n var objName = getFormNameFromFileName(fileName.getName());\n print(\"Import Form '\"+objName+\"'\");\n var imp = new Form(objName);\n imp.update(_fileName, objName);\n }\n}", "title": "" }, { "docid": "3b7fb93de29db4c093f31a838319f447", "score": "0.5442561", "text": "function ContactForm() {\n return (\n <>\n <div className=\"contact-background\">\n <h1 className=\"contact-form-title\">We'd love to hear from you <Envelope /></h1>\n <Form>\n <Form.Group controlId=\"formBasicEmail\">\n <Form.Control type=\"name\" placeholder=\"Enter name\" />\n <br />\n <Form.Control type=\"email\" placeholder=\"Enter email\" />\n <Form.Text className=\"contact-text-muted\">\n We'll never share your email with anyone else.\n </Form.Text>\n <br />\n <Form.Control type=\"message\" placeholder=\"Your message\" as=\"textarea\" rows={3} />\n </Form.Group>\n <ContactModal className=\"contact-modal\" />\n </Form>\n </div>\n </>\n );\n}", "title": "" }, { "docid": "46a1ede2efb338ad1bdb1389888fde42", "score": "0.5436016", "text": "function FormPage() {\n \n return (\n \n <div>\n <Header/>\n <Form/>\n {/* <App3/> */}\n {/* <App2/> */}\n <FooterTop/>\n \n </div>\n )\n}", "title": "" }, { "docid": "716357fef384148d919cee1e1df86623", "score": "0.54329944", "text": "render() {\n return (\n <div>\n {/*\n Las rutas van dentro de Router y Route es la ruta\n */}\n <Router>\n <Link to=\"/\">Home</Link>\n <br />\n <Link to=\"/posts\">Posts</Link>\n <Route\n exact\n path=\"/\"\n render={() => {\n return (\n <div>\n <Formulario addTarea={this.addTarea} />\n <Tasks\n tareas={this.state.tareas}\n deleteTask={this.deleteTask}\n checkDone={this.checkDone}\n />\n </div>\n );\n }}\n />\n <Route exact path=\"/posts\" component={Posts} />\n </Router>\n\n {/* <Posts /> */}\n </div>\n );\n }", "title": "" }, { "docid": "778ee1bff80263ad9e9e83e882c9945e", "score": "0.5406258", "text": "render() {\n return (\n <div className=\"shift\">\n <Form successUrl='https://www.mocky.io/v2/5bd89817310000c63a474f5b' failUrl='https://www.mocky.io/v2/5bd897fc310000c73a474f59' />\n </div>\n );\n }", "title": "" }, { "docid": "fb6f4d1d17e401b7ae02039c5045a576", "score": "0.54048365", "text": "function FormUtils() {\r\n}", "title": "" }, { "docid": "d418369dc3aec8c950345c7e812cc1e0", "score": "0.5398461", "text": "async function handlePostFormSubmit(event) {\n event.preventDefault();\n const form = event.currentTarget;\n const url = \"http://localhost/php_restapi/app/api/post/create.php\";\n try {\n const formData = new FormData(form);\n const responseData = await postFormData({ url, formData });\n renderPosts();\n } catch (error) {\n console.error(error);\n }\n form.reset();\n}", "title": "" }, { "docid": "ccb8eb173fe76c507dbe1e5f9710e54e", "score": "0.5384558", "text": "render() {\n return (\n <div className=\"Comment\">\n\n <Form method=\"POST\" style={this.getName()} onSubmit={this.handleSubmit} id=\"commentSec\" className=\"createComment\" >\n <FormGroup controlId=\"full-name\" as={Col} md=\"12\">\n <FormLabel className=\"FormRow\">Full-name: </FormLabel>\n <FormControl\n type=\"text\"\n name=\"fullName\"\n value={this.fullName}\n onChange={this.handleChange}\n />\n </FormGroup>\n \n\n \n <FormGroup as={Col} md=\"12\" style={this.getComment()} controlId=\"formBasicComment\">\n <FormLabel className=\"FormRow addComment\">Comment:</FormLabel>\n <FormControl\n type=\"text\"\n placeholder='Ajouter un commentaire..'\n name='comment'\n value={this.comment}\n onChange={this.handleChange}\n />\n <Button type=\"submit\" size=\"md\" value=\"Submit\" className=\"Subutton\">Submit</Button>\n </FormGroup>\n </Form>\n </div>\n \n );\n }", "title": "" }, { "docid": "1a89b991ca93404f821b01b2113175df", "score": "0.5382373", "text": "render(){\n\n return(\n <div className=\"container\">\n <div className=\"row row-content\">\n <div className=\"col-12\">\n <h4>Add Category</h4>\n </div>\n <div className=\"col-12 col-md-9\">\n\n <Form onSubmit={this.handleRegister}>\n <FormGroup>\n <Label htmlFor=\"name\">Category</Label>\n <Input type=\"text\" id=\"name\" name=\"name\"\n innerRef={(input) => this.name = input} />\n </FormGroup>\n <Button type=\"submit\" value=\"submit\" color=\"primary\">Add</Button>\n </Form>\n </div>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "3d37927b2865ffbc5b00a36cf675f67c", "score": "0.53760266", "text": "render() {\n return (\n <form onSubmit={this.props.handleSubmit(this.onSubmit)} className=\"ui form error\">\n <Field name=\"title\" component={this.renderInput} label=\"Enter Title\" />\n <Field name=\"description\" component={this.renderInput} label=\"Enter Description\"/>\n <button className=\"ui button primary\">Submit</button>\n </form>\n )\n }", "title": "" }, { "docid": "cb7761dc8189671d0ad88bcdcaa45f25", "score": "0.5371996", "text": "render() {\r\n return (\r\n <div className=\"App\">\r\n\r\n { /* Header component with text props. */}\r\n <div class=\"mainBanner\">\r\n <img class=\"logo\" alt={logo} src={logo} />\r\n <text class=\"bannerText\"><Header title=\"Neighbourly\" /></text>\r\n </div>\r\n\r\n { /* Sub header component for posts. */}\r\n <div id=\"addAPost\" class=\"subBannerLeft\">\r\n <h3 class=\"subBannerLabel\"><text class=\"bannerText\">Report a post</text></h3>\r\n <Link to={{ pathname: './'}}>\r\n { /* This element will link the URL path to home page */}\r\n <button class=\"subBannerButton\">\r\n Go Back\r\n </button>\r\n </Link>\r\n </div>\r\n\r\n { /* Header component with text props. */}\r\n {/* <Header title=\"Neighbourly\"\r\n subtitle=\"Add Post\"/> */}\r\n\r\n <ReportForm\r\n postNumber={this.props.location.state.postNum}\r\n />\r\n </div>\r\n );\r\n }", "title": "" }, { "docid": "420491a33dc57e6577dfe4f1036d727c", "score": "0.53673494", "text": "constructor(props) {\n super(props);\n this.handleSubmit = this.handleSubmit.bind(this)\n\n }", "title": "" }, { "docid": "0025a0292b1f2b04dcf1fcc2d9c77317", "score": "0.5356146", "text": "render () {\n const Posts = () => {\n return (\n <div>\n {\n this.state.displayPosts.map((post, index) => {\n return (\n <Post key={index}\n post={post}\n doCollapse={this.doCollapse}\n doComment={this.doComment}\n doLike={this.doLike}>\n\n </Post>\n )\n })\n }\n </div>\n )\n }\n return (<div className=\"App\">\n <NavBar\n users={this.state.users}\n user={this.state.currentUser}\n selectUser={this.selectUser}\n doFilter={this.doFilter}\n doSort={this.doSort} />\n <PostForm\n createPost={this.createPost}\n user={this.state.currentUser} />\n <Posts />\n </div>);\n }", "title": "" }, { "docid": "1ee34d9b9748d268054542b520cf21d9", "score": "0.5352874", "text": "function UploadForm() {\n return (\n <form className=\"upload-form\">\n <label className=\"upload-form__title\" htmlFor=\"videoTitle\">TITLE YOUR VIDEO</label>\n <input className=\"upload-form__title-input\"id=\"videoTitle\" type=\"text\" placeholder=\"Add a title to your video\"/>\n <label className=\"upload-form__description\" htmlFor=\"videoDescription\">ADD A VIDEO DESCRIPTION</label>\n <textarea className=\"upload-form__description-input\" id=\"videoDescription\"name=\"videoDescription\" placeholder=\"Add a description of your video\" />\n <div className=\"upload-form__buttons\">\n <button className=\"upload-form__buttons-publish\">PUBLISH</button>\n <button className=\"upload-form__buttons-cancel\">CANCEL</button>\n </div>\n </form>\n )\n}", "title": "" }, { "docid": "ecee69786276250e294211c7f3f7497b", "score": "0.5351658", "text": "render()\n\t{\n\t\treturn(\n\t\t\t<div style={{ marginTop: '30px' }}>\n\t\t\t\t<form onSubmit={this.props.handleSubmit(this.onSubmit.bind(this))}>\n\t\t\t\t\t<Field\n\t\t\t\t\t\tlabel=\"Name\"\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tname=\"name\"\n\t\t\t\t\t\tcomponent={ this.renderField }\n\t\t\t\t\t/>\n\t\t\t\t\t<Field\n\t\t\t\t\t\tlabel=\"Description\"\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tname=\"description\"\n\t\t\t\t\t\tcomponent={ this.renderField }\n\t\t\t\t\t/>\n\t\t\t\t\t<button type=\"submit\" className=\"teal btn-flat white-text\"> Submit </button>\n\t\t\t\t\t<Link to=\"/dashboard\" className=\"red btn-flat right white-text\"> Cancel </Link>\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t\t)\n\t}", "title": "" }, { "docid": "9b2d62290efa2780f66b19e1d73e0ac8", "score": "0.5348844", "text": "function App(){\n return (\n /* <Form/> */\n <div>\n <Header/>\n <MemeGenerator/>\n </div>\n \n )\n}", "title": "" }, { "docid": "eac9aa1455d5e889fa05d03fca043a09", "score": "0.5321475", "text": "render() {\n return (\n <div className=\"App\">\n <Form />\n <Weather />\n <Cat />\n </div>\n );\n }", "title": "" }, { "docid": "f1296145ff1cde9145be78217d7f2632", "score": "0.53177464", "text": "function App() {\n return (\n <div className=\"App\">\n\t\t {/* <Login title=\"Login Form\" url=\"https://nztodo...\" description=\"asdfasdf\" /> */}\n\t\t<div className=\"container mt-5\">\n\t\t\t<div className=\"row justify-content-center\">\n\t\t\t\t<div className=\"col-6\">\n\t\t\t\t\t< NameForm / >\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t\n </div>\n );\n}", "title": "" }, { "docid": "10346bf253a94c773ea6f4c3bd394381", "score": "0.53115535", "text": "function mapStateToProps(state) {\n return {\n form: state.form\n };\n}", "title": "" }, { "docid": "059b31e8b15b073667da8b2a4615c08c", "score": "0.5296033", "text": "render () {\n const title = \"Register page\";\n return (\n <div>\n <Navbar />\n <RegisterForm />\n </div>\n );\n }", "title": "" }, { "docid": "c5f6913cab416a026bd443d1cead9894", "score": "0.5290241", "text": "render () {\n return (\n <div className=\"register\">\n <h5>Join Pokewrex!</h5>\n <form action=\"auth\" method=\"POST\" className=\"register\">\n <input type=\"text\" name=\"username\" placeholder=\"Username\"/>\n <input type=\"password\" name=\"password\" placeholder=\"Password\"/>\n <button type=\"submit\">Register</button>\n </form>\n </div>\n )\n }", "title": "" }, { "docid": "d8c7db2f46b40fea5885f4b570876f51", "score": "0.5288344", "text": "renderForm() {\n return (\n <Form model={this.state.task}>\n {this.renderUserInformation()}\n {this.renderInstructions()}\n {this.renderContext()}\n {this.renderDetail()}\n {this.renderAttachments()}\n {this.renderLocalisation()}\n {this.renderFormButton()}\n {this.renderCustomForm()}\n </Form>\n );\n }", "title": "" }, { "docid": "11da5a1e5ddd6764943516b428819da4", "score": "0.5285806", "text": "onSubmit(values) {\n const { title, content } = values;\n const post = { title, content };\n return this.props.dispatch(submitPostForm(post));\n }", "title": "" }, { "docid": "15b720ca580255498b7f1956619f2562", "score": "0.52821153", "text": "function Form(props){\n return(\n <div className=\"container register\">\n\n\n\n\n <div className=\"row\">\n <div className=\"col-md-3 register-left\">\n\n <img src={form_image} alt=\"\" className={\"form-image\"}/>\n <h3>Welcome</h3>\n <p>Here you can add data like users or sensors</p>\n </div>\n\n <div className=\"col-md-9 register-right\">\n {/* <ul className=\"nav nav-tabs nav-justified\" id=\"myTab\" role=\"tablist\">\n <li className=\"nav-item\">\n <a className=\"nav-link active\" id=\"home-tab\" data-toggle=\"tab\" href=\"#home\" role=\"tab\"\n aria-controls=\"home\" aria-selected=\"true\">User</a>\n </li>\n <li className=\"nav-item\">\n <a className=\"nav-link\" id=\"profile-tab\" data-toggle=\"tab\" href=\"#profile\" role=\"tab\"\n aria-controls=\"profile\" aria-selected=\"false\">Sensor</a>\n </li>\n </ul>*/}\n\n <Nav/>\n <Route path=\"/form/user\" component={Forme_user} />\n <Route path=\"/form/sensor\" component={Form_sensor} />\n </div>\n </div>\n </div>\n )\n}", "title": "" }, { "docid": "088091b159416cd962f9ad90e21e03b0", "score": "0.5281673", "text": "function App() {\n return (\n <div className=\"App\">\n <div className = \"body\">\n <Posts />\n </div>\n </div>\n );\n}", "title": "" }, { "docid": "ba80c51ca57d669b4f4b2357db188707", "score": "0.5280264", "text": "function BookForm() {\n return (\n <Tabs>\n {{ title: 'Add', content: <AddBook /> }}\n {{ title: 'Delete', content: <DeleteBook /> }}\n {{ title: 'Update', content: <DeleteBook /> }}\n </Tabs>\n );\n}", "title": "" }, { "docid": "3989fcda29c6609e0363ce0648c48f23", "score": "0.52771276", "text": "function App() {\n return (\n <div>\n {/* <div className=\"col-md-6\"> */}\n {/* <h3>Form register</h3> */}\n {/* <FormContainer /> */}\n {/* <FilterProduct /> */}\n <NewForm/>\n </div>\n );\n}", "title": "" }, { "docid": "ec6a7877b58ca6cb0bbdeaaa27609f86", "score": "0.5275787", "text": "render() {\n // console.log(\"Post Form Errors: \", this.props.errors);\n return (<form className='post-form flex-middle'>\n <ul className='post-form-errors absolute hidden' onClick={() => $('.post-form-errors').addClass('hidden')}>\n {this.props.errors.length > 0 ? this.props.errors.map(err => <li key={err}>{err}</li>) : ''}\n </ul>\n <div>\n <textarea className='post-input' type='text' value={this.state.body ? this.state.body : ''}\n placeholder=\"What's up?\" onChange={this.update('body')}/>\n <select value={this.state.audience} onChange={this.update('audience')}>\n <option value='PUBLIC'>Public</option>\n <option value='FRIENDS'>Friends</option>\n <option value='PRIVATE'>Private</option>\n </select>\n </div>\n <i className='fa fa-paper-plane post-button' onClick={this.makePost}></i>\n </form>);\n }", "title": "" }, { "docid": "7ef70da13b757e334e9e90c4f03d6743", "score": "0.52751464", "text": "constructor(props){\n super(props);\n // state variable for handling state changes\n this.state = {};\n // form submit handler binding to component\n this.onFormSubmit = this.onFormSubmit.bind(this);\n }", "title": "" }, { "docid": "812f157f1ae414d9461fb6f7e530e93e", "score": "0.52713203", "text": "function App() {\n return (\n\n // <div> \n // <Addpost />\n // </div>\n <div className ='app'>\n <Router>\n <Navbar />\n <Switch>\n <Route path='/register' exact component={registerForm} />\n <Route path='/' exact component={Home} />\n <Route path='/dms' exact component={Dms} />\n <Route path='/notifications' exact component={Notifications} />\n <Route path='/profile' exact component={Profile} />\n <Route path='/login' exact component={loginPage} />\n <Route path='/tagPage/:tag' component={() => <TagPage tag={null} />} />\n <Route path=\"/tagPage\" render={(props) => <TagPage {...props}/>}/>\n </Switch>\n {/* </div> */}\n </Router>\n </div>\n );\n}", "title": "" }, { "docid": "f01fe73105cb1194eb4558922986e21a", "score": "0.5264819", "text": "function inject_postform(prefix, parent) {\n \n}", "title": "" }, { "docid": "3d764152ddac315c8f919a78440c7ca2", "score": "0.5262962", "text": "render(){\n return(\n <form onSubmit=\n {this.props.onAddUser}>\n <input type=\"text\" placeholder=\"Nombre\" name=\"name\"/>\n <input type=\"email\" placeholder=\"Email\" name=\"email\" />\n <input type=\"submit\" value=\"guardar\"/>\n </form>\n );\n }", "title": "" }, { "docid": "607ab2f2f3b649662cf44fa6ffe80212", "score": "0.5259757", "text": "onSubmit(values) {\n // console.log(values);\n this.props.createPost(values, () => {\n this.props.history.push('/');\n });\n }", "title": "" }, { "docid": "b2de2f9a74ea5790de2286281e842ccf", "score": "0.5251413", "text": "constructor(props) {\n super(props); \n this.onSubmit = this.onSubmit.bind(this); \n }", "title": "" }, { "docid": "ced25e7fd65405446fd5ef06086ba468", "score": "0.5250211", "text": "function App() {\n return (\n <div >\n <Navbar/>\n <Home/>\n <Footer/>\n {/* <Form/> */}\n {/* <MU /> */}\n </div>\n );\n}", "title": "" }, { "docid": "1ce9885f56c865200be3c170837ecdce", "score": "0.5249516", "text": "render() {\n return (\n <form\n ref={this.formRef}\n className={`form form-${this.props.type}`}\n >\n { /* render form control: input or textarea */ } \n <div className=\"form-actions\">\n { /* render submit button */ }\n { /* render cancel icon */ }\n </div>\n </form>\n );\n }", "title": "" }, { "docid": "15c2d0f8d325e8d2bb81ddca0f6894d3", "score": "0.5242634", "text": "render(){\n return(\n <Row className='form-content'>\n <div className='form-content-left'>\n <img className='formphoto' src={formimage} />\n </div>\n <div className='form-content-right'>\n <Form className='Form'>\n <div className='form-inputs'>\n <h1 className=\"header\">Complete the form to get in touch</h1>\n </div>\n <div className='form-inputs'>\n <label htmlFor='username' className='form-label'>\n Your Name\n </label>\n <input type='text' id='username' name='username' className='form-input' placeholder='Angelique'/>\n </div>\n <div className='form-inputs'>\n <label htmlFor='emailaddress' className='form-label'>\n Email Address\n </label>\n <input type='email' id='emailaddress' name='emailaddress' className='form-input' placeholder='Blushy777@gmail.com'/>\n </div>\n <div className='form-inputs'>\n <label htmlFor='phonenumber' className='form-label'>\n Phone Number\n </label>\n <input type='text' id='phonenumber' name='phonenumber' className='form-input' placeholder='0795824786'/>\n </div>\n </Form>\n </div>\n </Row>\n );\n }", "title": "" }, { "docid": "89530333862a544b4cd4a7c5ee53ced8", "score": "0.52232254", "text": "function NewStudent (props) {\n\nreturn (\n <div>\n <h4>Add New Student</h4>\n <StudentForm/>\n </div>\n\n)\n\n}", "title": "" }, { "docid": "164fc54b22e836a59a2dbc3695bdd67e", "score": "0.52154654", "text": "onSubmit (values){\n this.props.createPost(values, () => {\n this.props.history.push('/');\n });\n }", "title": "" }, { "docid": "8764c1431951592585e084d616ff3aa8", "score": "0.5215284", "text": "function App() {\n return (\n <div>\n <Router>\n <Switch>\n <Route exact path=\"/\">\n <HomePage />\n </Route>\n <Route path=\"/create-post\">\n <CreatePost />\n </Route>\n <Route path=\"/posts/:postId\">\n <PostPage />\n </Route>\n </Switch>\n </Router>\n </div>\n );\n}", "title": "" }, { "docid": "f102a03b1bab84a0d92e5dabe0bc70e9", "score": "0.52115434", "text": "render() {\n return (\n <Container className=\"login-container\">\n <h2 style={{marginTop: \"5px\"}}>Sign In</h2>\n {/* <LoginTranslator /> */}\n <Form className=\"form\">\n <Col>\n <FormGroup>\n <Label>Email</Label>\n <Input\n type=\"name\"\n name=\"username\"\n id=\"username\"\n placeholder=\"MyUserName\"\n />\n </FormGroup>\n </Col>\n <Col>\n <FormGroup>\n <Label for=\"examplePassword\">Password</Label>\n <Input\n type=\"password\"\n name=\"password\"\n id=\"examplePassword\"\n placeholder=\"********\"\n />\n </FormGroup>\n \n </Col>\n <Button id=\"submit-btn\">\n <Link to='/profile'>Submit</Link>\n </Button>\n </Form>\n </Container>\n );\n }", "title": "" }, { "docid": "21e73ccbe3b63cac13886ef48f743edd", "score": "0.5209915", "text": "function App() {\n return (\n <div>\n <h1>Test</h1>\n {/*<Button/>*/}\n\n <Form/>\n\n\n\n <List/>\n\n <Detail/>\n\n\n </div>\n );\n}", "title": "" }, { "docid": "12237e621c0e945944533ff27270b17d", "score": "0.52054685", "text": "handleSubmit() {\n \n }", "title": "" }, { "docid": "4049469a4ae8cd4c2f6b7b86b15a207c", "score": "0.5199552", "text": "render() {\n return (\n <div className=\"App\">\n <div className=\"App-header\">\n <img src={ titleimg } className=\"App-titleimg\" alt=\"titleimg\" />\n <p className=\"App-title\">Thesis Portal</p>\n </div>\n <div className=\"App-body\">\n <div className=\"App-body-table\">\n <MainTable data={ this.state.topics } /><br />\n <PostForm\n ref={this.refFormPost }\n visible={ this.state.visiblePost }\n onCancel={ this.handleCancel }\n onCreate={ this.handleCreate }\n />\n <PutForm\n ref={ this.refFormPut }\n visible={ this.state.visiblePut }\n onCancel={ this.handleCancel }\n onCreate={ this.handleUpdate }\n maxID={ this.state.topics.length-1 }\n />\n <Button className=\"Post\" type=\"primary\" onClick={ this.showPost }>Create a new thesis</Button>\n </div>\n </div>\n </div>\n\n );\n }", "title": "" }, { "docid": "96267676e45233dee602ea5bac203395", "score": "0.51994556", "text": "onSubmit(e) {\n e.preventDefault(); // prevents default html submit behaviour\n\n // Sends http post request to the backend to get all posts\n axios.post('http://localhost:5000/posts/')\n .then(response => {\n this.setState({ postList: response.data })\n })\n .catch((error) => {\n console.log(error);\n })\n\n\n }", "title": "" }, { "docid": "8f6134052b72130ab885a43b19a23199", "score": "0.51991916", "text": "componentWillMount() {\n // eslint-disable-line react/no-deprecated\n this.form.addEventListener('submit', this.handleSave);\n document.body.appendChild(this.form);\n }", "title": "" }, { "docid": "c51410a2dd7783aa2d656e8c7f9bac77", "score": "0.51966685", "text": "render() {\n return (\n <ArticleEditorForm onSubmit={this.submit} initialValues={this.props.initialValues} />\n );\n }", "title": "" }, { "docid": "abf685116342150d08adc57bda51313a", "score": "0.5194549", "text": "render() {\n return (\n <div className=\"new-service\">\n <div className=\"top-div\">\n <h1>Nytt lösenord</h1>\n </div>\n <form className=\"service-form\" onSubmit={this.handleSubmit.bind(this)}>\n <label>\n <h3>Tjänst</h3>\n </label>{\" \"}\n <input type=\"text\" name=\"service\" />\n <label>\n <h3>Användarnamn</h3>\n </label>{\" \"}\n <input type=\"text\" name=\"user\" />\n <label>\n <h3>Lösenord</h3>\n </label>\n <input type=\"password\" name=\"password\" />\n <button type=\"submit\" name=\"submit\">\n Spara\n </button>\n </form>\n </div>\n );\n }", "title": "" }, { "docid": "3fe7ec819b8526835b55f85d5c2d0097", "score": "0.5190242", "text": "render() {\n return (\n <div>\n <h3>Create a Stream</h3>\n <StreamForm onSubmit={this.onSubmit} />\n </div>\n );\n }", "title": "" }, { "docid": "b7b47bdfe56269d2e6dbdf92b4664bc6", "score": "0.51893336", "text": "render() {\n return (\n //1. whatever will send as prop will run on submit of form 2. handleSubmit from form 3. our function\n // note handlesubmit will do preventDefault\n <form\n className=\"ui form error\"\n onSubmit={this.props.handleSubmit(this.onSubmit)}\n >\n <Field name=\"title\" component={this.renderInput} label=\"Enter Title\" />\n <Field\n name=\"description\"\n component={this.renderInput}\n label=\"Enter Description\"\n />\n <button className=\"ui button primary\">Submit</button>\n </form>\n );\n }", "title": "" }, { "docid": "ca58bfd4515f9b512224e90744fb5391", "score": "0.51868576", "text": "render(){\n return(\n <div>\n CreateBlog\n\n </div>\n );\n }", "title": "" }, { "docid": "79ecff2cb27a5555d0fef74a96aa5665", "score": "0.51830834", "text": "async componentDidMount(){\n this.loadPost();\n }", "title": "" }, { "docid": "b4ed29ec3113c9df462e4034c81aa2af", "score": "0.5180558", "text": "function App() {\n return (\n <div className=\"App\">\n <div>\n <EditForm />\n {/* <CreateForm /> */}\n </div>\n </div>\n );\n}", "title": "" }, { "docid": "a6e96bd55e7a026a8101cbd9e2bfd121", "score": "0.5175815", "text": "function ContactUs() {\n return (\n <div>\n This Is Contact Us Components\n </div>\n )\n}", "title": "" }, { "docid": "78492d770f3bd49c6b866c9bfb5aecbf", "score": "0.51656777", "text": "getComponent(nextState, cb) {\n /* Webpack - use 'require.ensure' to create a split point\n and embed an async module loader (jsonp) when bundling */\n require.ensure([], (require) => {\n /* Webpack - use require callback to define\n dependencies for bundling */\n const StoryForm = require('./components/StoryForm').default\n CreateReducers(store)\n /* Return getComponent */\n cb(null, StoryForm)\n\n /* Webpack named bundle */\n }, 'storyform')\n }", "title": "" }, { "docid": "f5dcbeffb8cc40dbaf8c88ff101edc95", "score": "0.5163695", "text": "render() {\n let formName = this.props.isEditing ? \"Edit Post\" : \"New Post\";\n return (\n <div className=\"NewOrEditPostForm\">\n <form onSubmit={this.handleSubmit}>\n <h3>{formName}</h3>\n <div className=\"form-group title\">\n <label htmlFor=\"title\">Title: </label>\n <input className=\"form-control\" name=\"title\"\n id=\"title\"\n onChange={this.handleChange}\n value={this.state.title} \n // placeholder={placeholderTitle}\n />\n </div>\n <div className=\"form-group description\">\n <label htmlFor=\"description\">Description: </label>\n <input className=\"form-control\" name=\"description\"\n id=\"description\"\n onChange={this.handleChange}\n value={this.state.description} \n // placeholder={placeholderDescription}\n />\n </div>\n <div className=\"form-group body\">\n <label htmlFor=\"body\">Body: </label>\n <textarea className=\"form-control\" name=\"body\"\n id=\"body\"\n onChange={this.handleChange}\n value={this.state.body} \n // placeholder={placeholderBody}\n ></textarea>\n </div>\n <button className=\"btn btn-primary\">Save</button>\n <button className=\"btn btn-primary\" onClick={ this.handleCancel }>Cancel</button>\n </form>\n </div>\n );\n }", "title": "" }, { "docid": "23c588b5bacd20e57d49d0061567895a", "score": "0.51531756", "text": "constructor(props) {\n super(props);\n this.handleOnSubmit = this.handleOnSubmit.bind(this);\n }", "title": "" }, { "docid": "3a5707e0a1b6478d80a7a49dbf8359c0", "score": "0.51516765", "text": "function ContactForm() {\n\n return (\n <div className=\"myForm\">\n <form id=\"email-form\" action=\"https://formspress.io/xknqqwdl\" method=\"POST\">\n <div className=\"form-group\">\n <label for=\"form-name\">Name</label>\n <input type=\"text\" name=\"name\" className=\"form-control\" id=\"form-name\" placeholder=\"Your Name\"></input>\n </div>\n <div className=\"form-group\">\n <label for=\"form-email\">Email</label>\n <input type=\"email\" name=\"replyEmail\" className=\"form-control\" id=\"form-email\" placeholder=\"email@you.com\"></input>\n </div><div className=\"form-group\">\n <label for=\"message\">Message</label>\n <textarea className=\"form-control\" name=\"messageBody\" id=\"form-body\" rows=\"3\"></textarea>\n </div>\n </form>\n <center><button type=\"submit\" className=\"btn btn-secondary btn-sm\" id=\"submit\">SUBMIT</button></center>\n <p id=\"form-status\"></p>\n </div>\n )\n}", "title": "" }, { "docid": "c4e74a658afd41e2fa8afb4cf2753768", "score": "0.514554", "text": "handleFormSubmit(formProps) {\n // call action creator to add article\n this.props.addCategory(formProps);\n }", "title": "" }, { "docid": "3e362387f5f2b459567f029dcf130c14", "score": "0.51432174", "text": "renderAddEmailerAdmin(modalData) {\n const { emailAdmin } = this.state;\n return (\n <Fragment>\n <h2>{modalData.title}</h2>\n\n <form\n action=\"\"\n method=\"POST\"\n onSubmit={(e) => this.submitEmailerAdmin(e)}\n >\n <div className=\"c-form-row\">\n <FormInputComponent\n type=\"email\"\n value={emailAdmin}\n onChange={(e) => this.inputField(e, \"emailAdmin\")}\n placeholder=\"Enter email address\"\n required={true}\n />\n </div>\n <div id=\"custom-global-modal__buttons\">\n <button type=\"submit\" className=\"btn btn-success\">\n Add\n </button>\n <a className=\"btn btn-primary\" onClick={() => this.hideModal()}>\n Cancel\n </a>\n </div>\n </form>\n </Fragment>\n );\n }", "title": "" }, { "docid": "170319868d927f0f165e0c2f112f4769", "score": "0.5142947", "text": "render() {\n return (\n <div className=\"row form-container\">\n <div>\n <h3>Please register for an account with your email</h3>\n </div>\n <Form className = \"form\">\n <FormGroup row>\n <Label sm ={4} for=\"email\">Email:</Label>\n <Col sm ={8}>\n <Input type=\"email\" name=\"email\" id=\"#email\" placeholder=\"enter email\" />\n </Col>\n </FormGroup>\n <FormGroup row>\n <Label sm = {4}for=\"password\">Password:</Label>\n <Col sm ={8}>\n <Input type=\"password\" name=\"password\" id=\"#password\" placeholder=\"enter password\" />\n </Col>\n </FormGroup>\n <FormGroup row>\n <Label sm = {4}for=\"re-password\">Re-pass:</Label>\n <Col sm ={8}>\n <Input type=\"re-password\" name=\"re-password\" id=\"#re-password\" placeholder=\"Retype password\" />\n </Col>\n </FormGroup>\n <Button color = \"primary\">Register</Button>\n </Form>\n </div>\n );\n }", "title": "" }, { "docid": "f2fca3935d4ea674489af171a72d1391", "score": "0.51309323", "text": "function Login() {\n return (\n <div>\n <Nav/>\n <LoginForm />\n <AddVehicleForm />\n <DeleteVehicleForm />\n </div>);\n}", "title": "" }, { "docid": "73dddb7aec7ad48898903b05f0a0f180", "score": "0.51306075", "text": "function App() {\n return (\n <div className=\"App\">\n <section className=\"contact submit-file\">\n <div className=\"container\">\n <div className=\"row\"> \n <div className=\"col-lg-7 wow fadeInUp\">\n <Switch>\n <Route path=\"/\" exact component={Login}/>\n <Route path=\"/client-add\" exact component={ClientCreate}/>\n <Route path=\"/client-list\" exact component={ClientList}/>\n </Switch>\n </div>\n </div>\n </div>\n </section>\n </div>\n );\n}", "title": "" }, { "docid": "d2b7afe91d522806ebca167c9788c959", "score": "0.5127172", "text": "render() {\n return (\n <div class=\"login-container\">\n <h3>Login</h3>\n <Form model=\"forms.login\" onSubmit={(val) => this.handleSubmit(val)}>\n <Control.text model=\"forms.login.username\" class=\"form-control\" placeholder=\"Enter Username\"/>\n <Control type=\"password\" model=\"forms.login.password\" class=\"form-control\" placeholder=\"Enter Password\" />\n <button class=\"btn btn-default\">Submit</button>\n </Form>\n\n {this.errorMessage()}\n </div>\n );\n }", "title": "" }, { "docid": "b459d01a0ee7344ae2d9059c0b75982a", "score": "0.5123657", "text": "async componentDidMount() {\n await this.formsSubmissionFromServer();\n }", "title": "" }, { "docid": "7c1e709c89b79e3f425e4f715ff684e6", "score": "0.5114937", "text": "onSubmit(values) {\n // Programmatic Navigation: Used when the user is sent back to the home\n // page upon submitting a post. Only navigate after a post has been created.\n // The history.push() function helps us do that, provide push with a valid\n // Route defined in BrowserRouter in index.js\n this.props.createPost(values, () => {\n this.props.history.push('/');\n });\n}", "title": "" }, { "docid": "4b5ee69871d43848666131b4907b1856", "score": "0.51007444", "text": "function App() {\n return (\n <div className=\"App\">\n <div className=\"App-content1\"></div>\n <div className=\"App-content2\">\n <FormRegister/>\n {/* <FromLogin /> */}\n {/* <Routes /> */}\n <Footer footerBold=\"Powered by\" footerSupport=\"html5, CSS3, reactjs\"/>\n </div>\n <div className=\"App-content3\"></div>\n </div>\n );\n}", "title": "" }, { "docid": "1f89ce9b5c577af08e665a4f29a664c7", "score": "0.5098866", "text": "onSubmit(props){\n // when the promise is resolved\n this.props.createPost(props).then(\n ()=> {\n // blog post has been created , navigate the user to the index\n // we navigate by calling this.context.router.push with the new path to naivgate to .\n this.context.router.push('/');\n }\n );\n\n\n}", "title": "" }, { "docid": "a1013996006cb5bf499481bda99d8f2d", "score": "0.5095082", "text": "function NewJibForm({ user, onAddPost }) {\n const [content, setContent] = useState(\"\");\n\n function handleNewContent(e) {\n e.preventDefault();\n setContent(e.target.value);\n }\n\n function submitJib(e) {\n e.preventDefault();\n fetch('/posts', {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n content,\n user_id: user.id\n }),\n })\n .then((resp) => resp.json())\n .then((data) => {\n onAddPost(data)\n setContent('')\n });\n }\n \n return (\n <>\n <Form style={{ 'width': '700px' }} onSubmit={submitJib}>\n <TextArea \n placeholder=\"What's happenning?\"\n value={content} \n name=\"content\"\n onChange={handleNewContent}\n />\n <div style={{ height: 7 }} />\n <Button floated=\"right\" primary type='submit'>Jab</Button>\n </Form>\n </>\n )\n}", "title": "" } ]
ddcb0cd40fb3ff0bf6e253759e52acb9
Sends a flag click to server
[ { "docid": "b34d1572efb4ecb803503fc98da3fe44", "score": "0.6460138", "text": "function sendFlag(i, j) {\n socket.emit('flag', { i, j });\n}", "title": "" } ]
[ { "docid": "6cb91b662939d7ddb5faf89541e4f7f6", "score": "0.65079015", "text": "function flagClick(event) {\n // Prevent the default browser click handler\n event.preventDefault();\n\n // 'this' won't point to the element when it's inside the ajax closures,\n // so we reference it using a variable.\n var element = this;\n\n // While waiting for a server response, the wrapper will have a\n // 'flag-waiting' class. Themers are thus able to style the link\n // differently, e.g., by displaying a throbber.\n var $wrapper = $(element).parents('.flag-wrapper');\n if ($wrapper.is('.flag-waiting')) {\n // Guard against double-clicks.\n return false;\n }\n $wrapper.addClass('flag-waiting');\n\n // Hide any other active messages.\n $('span.flag-message:visible').fadeOut();\n\n // Send POST request\n $.ajax({\n type: 'POST',\n url: element.href,\n data: { js: true },\n dataType: 'json',\n success: function (data) {\n data.link = $wrapper.get(0);\n $.event.trigger('flagGlobalBeforeLinkUpdate', [data]);\n if (!data.preventDefault) { // A handler may cancel updating the link.\n data.link = updateLink(element, data.newLink);\n }\n\n // Find all the link wrappers on the page for this flag, but exclude\n // the triggering element because Flag's own javascript updates it.\n var $wrappers = $('.flag-wrapper.flag-' + data.flagName.flagNameToCSS() + '-' + data.contentId).not(data.link);\n var $newLink = $(data.newLink);\n\n // Hide message, because we want the message to be shown on the triggering element alone.\n $('.flag-message', $newLink).hide();\n\n // Finally, update the page.\n $wrappers = $newLink.replaceAll($wrappers);\n Drupal.attachBehaviors($wrappers.parent());\n\n $.event.trigger('flagGlobalAfterLinkUpdate', [data]);\n },\n error: function (xmlhttp) {\n alert('An HTTP error '+ xmlhttp.status +' occurred.\\n'+ element.href);\n $wrapper.removeClass('flag-waiting');\n }\n });\n }", "title": "" }, { "docid": "91a9d713ef3d68d327b3ce132d550a61", "score": "0.6212645", "text": "function raiseFlag() {\n var flag = new XMLHttpRequest();\n flag.open(\"POST\", \"https://api.stackexchange.com/2.2/comments/\" + commentID + \"/flags/add\", true);\n flag.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n flag.onload = function (data) {\n var response;\n try {\n response = JSON.parse(this.response);\n if (response.error_name) {\n // cast delete vote self-comment\n if (isSelfComment(commentID)) castDeleteRequest(commentID);\n else console.warn(\"Error received!\", response);\n }\n } catch (e) {\n console.warn(\"Could not parse response!\", response);\n } finally {\n if (!response || !response.error_name) {\n console.log(\"Success!\", response);\n displaySuccess(commentID);\n }\n }\n\n if (hasNextFlag()) setTimeout(flagNextComment, TIME_DELAY_BETWEEN_FLAGS);\n else flagCurrentlyRaised = false;\n };\n flag.send(\"key=\" + APP_KEY + \"&site=\" + SITE_NAME + \"&option_id=\" + flagID + \"&access_token=\" + ACCESS_TOKEN);\n }", "title": "" }, { "docid": "cf3245425cca69ed1d9c33814edc202a", "score": "0.62099814", "text": "function handleClick(){\n changeflag(); \n }", "title": "" }, { "docid": "91b6e42666b831b29f124673b51e8c7b", "score": "0.6097064", "text": "function handleClick() {\r\n const restaurantId = this.dataset.id;\r\n const fav = this.getAttribute('aria-pressed') == 'true';\r\n const url = `${DBHelper.DATABASE_URL}/restaurant/?is_favorite=${!fav}`;\r\n const PUT = {method: 'PUT'};\r\n\r\n //this.onclick = null;\r\n console.log( `Preparing to update idb: is_favorite to update is favorite for restaurant`);\r\n\r\n DBHelper.handleFavoriteClick(restaurantId, !fav)\r\n // change state of toggle button\r\n this.setAttribute('aria-pressed', !fav);\r\n }", "title": "" }, { "docid": "f7c30fe8440adddc3b0470dab869bd82", "score": "0.5967568", "text": "function onBitClick(featureIndex, mask) {\n featureFlags[featureIndex].value ^= mask;\n setActiveFlagIndex(featureIndex);\n handleUpdate();\n setDataDirty(true);\n setEditMode(\"EXISTING\");\n }", "title": "" }, { "docid": "2eb70284d778c557bfddcb803de7b275", "score": "0.58968085", "text": "click() {\n contents.send('togglePauseQueue');\n }", "title": "" }, { "docid": "f06b32b1462562d9d62b1a2e7fdd8fc2", "score": "0.5890168", "text": "function buttonClick(i) {\n\tvar obj=GetValue();\n\tif($('#btnConfig'+i).text()=='Start')\t{\n\t\t$('#btnConfig'+i).text('Stop');\n\t}\n\telse{\n\t\t$('#btnConfig'+i).text('Start');\n\t}\n\n\tCheckButton();\n\tsocket.emit('btnConfig'+i,obj);\n}", "title": "" }, { "docid": "a25424dcbe5231ab194763c6da04f939", "score": "0.5865691", "text": "function clicker() {\n Cli++;\n clearTimeout(Timer);\n Timer = setTimeout(function() {\n if (Cli === 1) {\n simpleClick();\n clearTimeout(Timer);\n } else if (Cli === 2) {\n if (LockFlipBoard === 0) {\n doubleClick();\n }\n clearTimeout(Timer);\n }\n Cli = 0;\n }, 200);\n }", "title": "" }, { "docid": "eeb58f5b5280c45bf697074a10c3a73c", "score": "0.58301294", "text": "function receiver(request, sender, sendResponse) {\n if (request.message === \"click!\") {\n console.log( 'recieve click event !!') ;\n }\n}", "title": "" }, { "docid": "bdca22acb69c1cb2c532349a343279f7", "score": "0.58283395", "text": "onClick() {\n if (this.settings.switchserverid == false) {\n var server = this.c.getServerById(this.settings.dropserverid);\n }\n else {\n var server = this.c.getServerById(this.settings.textserverid);\n }\n\n if (this.settings.switchchannelid == false) {\n var channel = this.c.getChannelById(this.settings.dropchannelid);\n }\n else {\n var channel = this.c.getChannelById(this.settings.textchannelid);\n }\n\n if (this.settings.switchuserid == false) {\n var user = this.c.getUserById(this.settings.dropuserid);\n }\n else {\n var user = this.c.getUserById(this.settings.textuserid)\n }\n\n this.c.FL.log(server, channel, user);\n BdApi.findModuleByProps('playSound').playSound('ptt_start')\n }", "title": "" }, { "docid": "44819e3c1c977e18743da5d43b752b91", "score": "0.58060986", "text": "function clickCasilla(){\n\tif(this.dataset.clickable === \"true\"){\n\t\tsocket.emit(\"lanzar-tiro\", {\n\t\t\tposicion: this.dataset.position,\n\t\t\tidPartida: partidaJSON._id\n\t\t});\n\t} else {\n\t\talert(\"Espera tu turno\");\n\t}\n}", "title": "" }, { "docid": "ff07e09f5ef5ed637b509829cd1f40a3", "score": "0.5780477", "text": "function onMouseDown (/*evt*/){\n\t//ecs.sendMessage('packet', 255);\n console.log('Sending message');\n sb.send('buttonPress', 'boolean', 'true');\n}", "title": "" }, { "docid": "9807246b38a0425320c3c002dd0992cb", "score": "0.5722708", "text": "function sendToBitoperator() {\n $('#sendtofirst, #sendtosecond').on('click', function(e) {\n var placeholder;\n if ($(this).attr('id') == 'sendtofirst') {\n placeholder = 'first';\n } else {\n placeholder = 'second';\n }\n $.ajax({\n type: 'GET',\n url: '?do=storeinsession&var=' + placeholder + '&value=' + $('#encoded').val(),\n cache: false,\n success: function(html) {\n\n }\n });\n e.preventDefault();\n });\n }", "title": "" }, { "docid": "7b190a847c1a94415c3968f16c14b6d5", "score": "0.567843", "text": "performClickFunctionality() {}", "title": "" }, { "docid": "ea49dd4e19d791edcd46283c60ecdba1", "score": "0.5676732", "text": "function setclick()\n {\n var trigger = $(this);\n var id = trigger.attr(\"data-assocdiv\");\n var query = \"\";\n if (id == \"feed\" || id == \"members\")\n query = \"path=\"+id;\n else if (id == \"messages\")\n query = \"path=messages/threads&uid=-1\";\n\n trigger.click(function(event) { event.stopPropagation(); changeState(query); });\n }", "title": "" }, { "docid": "8d9e3cc7a72ab46a200b1ed1e8bd719b", "score": "0.5629507", "text": "function buttonClick(clicked_id){\n\n if (clicked_id == \"1\"){\n $.get('/post', {command: '/wemo', core: 'sensor_core', params: 'on'});\n }\n if (clicked_id == \"2\"){\n $.get('/post', {command: '/wemo', core: 'sensor_core', params: 'off'});\n }\n if (clicked_id == \"3\"){\n $.get('/post', {command: '/switch', core: 'sensor_core', params: 's1,HIGH'});\n }\n if (clicked_id == \"4\"){\n $.get('/post', {command: '/switch', core: 'sensor_core', params: 's1,LOW'});\n }\n}", "title": "" }, { "docid": "90b92b1eb1ae776a225a620d055d7fb5", "score": "0.55942965", "text": "function trackButton(btn, status) {\n if(arguments && arguments[2]){\n tracker.sendEvent(btn, status, arguments[2]);\n } else {\n tracker.sendEvent(btn, status);\n }\n}", "title": "" }, { "docid": "40b3ae60162a01221982ce1e873d57b9", "score": "0.5585479", "text": "function sendToggle() {\n if (!busy) {\n busy = true;\n try {\n NRF.requestDevice({ filters: [{ name: _NAME }] }).then((dev) => {\n uart.write(dev, 'toggleNightlight()\\n');\n }).then(() => {\n on = !on;\n busy = false;\n ambientSense();\n }).catch((e) => {\n busy = false;\n console.log('error', e);\n ambientSense();\n });\n } catch (e) {\n busy = false;\n console.log('error', e);\n ambientSense();\n }\n }\n}", "title": "" }, { "docid": "0b522bd0d9fc796ca6b3719ca0813d84", "score": "0.5576031", "text": "function OnBtnServerSynch_Click( e )\r\n{\r\n OnBtnServerSynch() ;\r\n}", "title": "" }, { "docid": "83c4d86ac34faa9d7d1aa24e3135f711", "score": "0.55670977", "text": "clickHandler() {\n\t\tthis.context.Vent.trigger(this.options.globalEvent, {\n\t\t\tel: this.el,\n\t\t\tisActive: this.active,\n\t\t\toptions: this.options\n\t\t});\n\t}", "title": "" }, { "docid": "2f45284c8032b910b0475916d25008ac", "score": "0.5550769", "text": "function myclick(count) {\n GEvent.trigger(gmarkers[count], \"click\");\n}", "title": "" }, { "docid": "6472c2ee0f77aa81d9742ea7c30bd031", "score": "0.55329436", "text": "function changeflag(){ \n setflag(true);\n }", "title": "" }, { "docid": "576eb50b9b8039ac48b20f2d54784bec", "score": "0.55071884", "text": "click(event) {\n if (event.target === this.get('element')) {\n this.sendAction();\n }\n }", "title": "" }, { "docid": "1527fd6797051be7eadccdfdceca6530", "score": "0.55015814", "text": "function pressButton() {\n //press button for n seconds\n remote.writeSync(1);\n setTimeout(function() {\n remote.writeSync(0);\n }, 1000);\n\n}", "title": "" }, { "docid": "f5a1aa51aebc4812007481d4eed4c70f", "score": "0.5498306", "text": "function onClick() {\n LxNotificationService.success('Click callback');\n }", "title": "" }, { "docid": "05a16c791b88b7dbc2f99035d0b3b0d8", "score": "0.54832834", "text": "click(event) {\n if (event.target === this.get('element')) {\n this.sendAction();\n }\n }", "title": "" }, { "docid": "9ba18a67b9a5274e540f17dcaf5a3d9f", "score": "0.5468782", "text": "function reply_click(clicked_id) {\n alert(clicked_id);\n }", "title": "" }, { "docid": "a9075536b195adcb57fb1e1673a9f94a", "score": "0.5466148", "text": "function handleButToggleClick(basectlsref) {\n\tvar alt;\n\n\tif (retrieveSi(srcdoc, \"StatAppIdecScfConn\", basectlsref + \"Alt\") == \"true\") alt = \"false\"; else alt = \"true\";\n\tsetSi(srcdoc, \"StatAppIdecScfConn\", basectlsref + \"Alt\", alt);\n\n\trefresh();\n}", "title": "" }, { "docid": "91005f89521c4bbc80467cf29d25befb", "score": "0.54529583", "text": "function handleButClick(ctlsref) {\n\tvar str = serializeDpchAppDo(srcdoc, \"DpchAppIdecUtlSpitermDo\", scrJref, ctlsref + \"Click\");\n\tsendReq(str, doc, handleDpchAppDataDoReply);\n}", "title": "" }, { "docid": "3f80893bebb17d9829b9d6a9287a3a38", "score": "0.5442467", "text": "function handleButClick(ctlsref) {\n\tvar str = serializeDpchAppDo(srcdoc, \"DpchAppIdecScfConnDo\", scrJref, ctlsref + \"Click\");\n\tsendReq(str, doc, handleDpchAppDataDoReply);\n}", "title": "" }, { "docid": "5afd947bbf031dc5c4086bb230378d7f", "score": "0.54424465", "text": "function onSaveClick() {\n axios.post(url, featureFlags[activeFlagIndex]).then((response) => {\n setFeatureFlags(response.data);\n setDataDirty(false);\n setNewFlagName(\"\");\n setActiveFlagIndex(-1);\n }).catch(() => {\n // for now, I won't be checking specific error codes, but can later\n setErrorText(`Cannot ${editMode === \"EXISTING\" ? \"save\" : \"add\"} flag. Please try again later.`)\n });\n }", "title": "" }, { "docid": "a8b7536cf8d98f6b0d06d68ca60ee59d", "score": "0.5438689", "text": "function toggle(){\n\n //set up script variables\n activeCmd.id = activeCmd.id+1; //sum up 1 to the local variable idCount\n activeCmd.type = \"toggle\"; //set the active Command Type (activeCmd.type)\n let message = JSON.stringify({\n \"jsonrpc\": \"2.0\",\n \"id\": activeCmd.id,\n \"method\": \"doSensorAction\",\n \"params\": {\"name\": \"toggleSightOrientation\", \"params\":[]}\n })\n writeToScreen('SENT: ');\n writeToScreen(message);\n websocket.send(message);\n}", "title": "" }, { "docid": "39b7c4da70e331809a82ed32faaccc0e", "score": "0.54264355", "text": "function clickHandler(){\n console.log(\"duke lester clicked the button\");\n }", "title": "" }, { "docid": "b8f92954dd9dc8bd7058a092a16e6b8a", "score": "0.54197526", "text": "function placeFlag(tile) {\n\tif (!tile.div.classList.contains(\"bombflagged\")) {\n\t\tsimulateClick(tile.div, 2);\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "89fde117a9b13b31742ea96c9f7d95b9", "score": "0.5418205", "text": "function sendUpdateFan(){\n\tconsole.log(\"Sending fan update\");\n\n\tvar test_payload = {\n\t\tEvent:'update',\n\t\tType:'boxFan',\n\t\tatt:{value: !spinningBoxFan}\n\t};\n\n\tcontrolLine('boxFan is ' + (spinningBoxFan ? 'Off' : 'On'));\n\t//onUpdate(test_payload); //commentout\n\tsocket.send(JSON.stringify(test_payload));\n}", "title": "" }, { "docid": "3a774c6d0e3480fe1a84c520669fff2f", "score": "0.54162127", "text": "function enableButton(flag)\n {\n if (flag) {\n btn.removeClass('ui-disabled').addClass('ui-enabled').off('click').on(\"click\",\n function(evt){\n clickHandler(evt);\n } );\n }\n else {\n btn.addClass('ui-disabled').removeClass('ui-enabled').off('click');\n }\n btn.trigger('actions-change-enabled-state');\n }", "title": "" }, { "docid": "ae3871ee86f5cc696d69823f5103abf6", "score": "0.54132545", "text": "function fclicked(event){\n mimicServerCall()\n .then(function(serverMessage){\n // let res = document.getElementsByClassName('like-glyph')[0];\n let res = event.target;\n if(res.innerText == FULL_HEART){\n res.innerText = EMPTY_HEART;\n res.classList.remove('activated-heart');\n }\n else{\n res.innerText = FULL_HEART ;\n res.classList.add('activated-heart');\n }\n })\n .catch(function(error) {\n let mod = document.getElementById('modal') ; \n mod.classList.remove('hidden');\n mod.innerText = error;\n setTimeout(function(){ mod.classList.add('hidden'); }, 5000);\n });\n}", "title": "" }, { "docid": "66168d7fd41ccd58d1d5a841077c64fa", "score": "0.5399762", "text": "emulateClick() {\n // prepare click and gui elmt on which to click\n const $el = document.querySelector('#service-platform');\n const event = new MouseEvent('mousedown', { 'view': window, 'bubbles': true, 'cancelable': true });\n // click if we've got gui elmt\n if( $el !== null ){ $el.dispatchEvent(event); }\n // re-iterate while not started (sometimes, even a click on gui will not start...)\n if( this.coordinates === undefined ){\n setTimeout(() => { this.emulateClick(); console.log('click delayed'); }, 300)\n }\n }", "title": "" }, { "docid": "4e9609e5d57a44df23b38aabcf5656ad", "score": "0.53946483", "text": "function doClick() {\n props.onClick();\n setClicked(true); \n }", "title": "" }, { "docid": "ed146d37d7cde9798e83cef61066d4ca", "score": "0.5381592", "text": "[\"on click at #continue\"]() { this.channel.atBreakpointResponse(\"step\",0); }", "title": "" }, { "docid": "6a0e859dab86a21f501d2fe62097c95d", "score": "0.53746015", "text": "function onBrowserActionClick() {\n info(\"event: browser action icon was clicked\");\n click($(S_gbarToolsNotificationA));\n}", "title": "" }, { "docid": "db290b30229af515208a6e47ba43ae1a", "score": "0.5372021", "text": "function handleButClick(ctlsref) {\n\tvar str = serializeDpchAppDo(srcdoc, \"DpchAppWdbeSilRecDo\", scrJref, ctlsref + \"Click\");\n\tsendReq(str, doc, handleDpchAppDataDoReply);\n}", "title": "" }, { "docid": "401f22369330e37692213bab2db161f6", "score": "0.5366802", "text": "function instrumentClick() {\n // Capture clicks and wait 50ms to see if they result in DOM mutations\n BOOMR.subscribe(\"click\", function() {\n if (impl.singlePageApp && !impl.spaStartFromClick) {\n // In a SPA scenario, only route changes (or events from the SPA\n // framework) trigger an interesting event.\n return;\n }\n\n var resource = { timing: {}, initiator: \"click\" };\n\n if (!BOOMR.orig_XMLHttpRequest ||\n BOOMR.orig_XMLHttpRequest === w.XMLHttpRequest) {\n // do nothing if we have un-instrumented XHR\n return;\n }\n\n resource.timing.requestStart = BOOMR.now();\n handler.addEvent(resource);\n });\n }", "title": "" }, { "docid": "f4d8fb8679eda4efb7b694bb15fe3e13", "score": "0.53651786", "text": "go(direction=tStop, _callback=(()=>{})) {\n const { isOn } = this.state;\n // App On button click\n if(isOn) {\n this.updateServer(direction, _callback);\n }\n // if Initial request send first request as stop the device\n else if(isOn==sInit) {\n this.setState({isOn:false, lastCommand:sInit});\n this.updateServer(direction, _callback);\n }\n // Inform app is not on\n else {\n this.setState({currentState:tStop, lastCommand:tStop});\n console.log('Sorry Device Offline isOn',isOn);\n }\n }", "title": "" }, { "docid": "050bde11ddcc10c278776b27a4e50ba4", "score": "0.53642374", "text": "function click(e) {\n if (e.target.textContent === \"\") {\n if (player === \"O\" && client === \"player1\") {\n socket.emit('addSign', { type: \"O\", id: e.target.id, player: \"X\" });\n } else if (player === \"X\" && client === \"player2\") {\n socket.emit('addSign', { type: \"X\", id: e.target.id, player: \"O\" });\n }\n }\n}", "title": "" }, { "docid": "b8ae8d2f920ef823cbca47b7a4fd1524", "score": "0.53638697", "text": "click() {\n contents.send('codeMode');\n }", "title": "" }, { "docid": "f66f410952fe1e894515463d49b63e25", "score": "0.53637695", "text": "function clickGold() {\n socket.emit(\"clickGold\");\n}", "title": "" }, { "docid": "fa00c691bf448516f133b5bd5e4a32a2", "score": "0.5357897", "text": "function myclick(i) {\n GEvent.trigger(gmarkers[i], \"click\");\n}", "title": "" }, { "docid": "fa00c691bf448516f133b5bd5e4a32a2", "score": "0.5357897", "text": "function myclick(i) {\n GEvent.trigger(gmarkers[i], \"click\");\n}", "title": "" }, { "docid": "fd9dea43022ddfc43cf2600a1b3d5b63", "score": "0.535176", "text": "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "title": "" }, { "docid": "e14e435fff0104c23fe1f72f9e8f0fd2", "score": "0.53506476", "text": "function $handleClick(e) {\n e.stopPropagation();\n e.preventDefault(); //prevent double-firing (touch + click)\n var $widget = $gWidgets[this.id];\n var $newState = $getNextState($widget); //determine next state from current state\n sendElementChange($widget.jsonType, $widget.systemName, $newState); //send new value to JMRI\n if (typeof $widget.secondturnoutname !== \"undefined\") { //TODO: put this in a more logical place?\n sendElementChange($widget.jsonType, $widget.secondturnoutname, $newState); //also send 2nd turnout\n }\n}", "title": "" }, { "docid": "bd39ee7049cf9613e423e93815a456a8", "score": "0.5345172", "text": "function press(e) {\n e.preventDefault();\n __btns[playerIndex][btnIndex] = true;\n update_btns(playerIndex);\n }", "title": "" }, { "docid": "fc8181f3ab8bb63aa205d5a43bb65426", "score": "0.53439", "text": "function setFlag(e, id) {\r\n //e.preventDefault()\r\n const button = document.getElementById(id);\r\n button.classList.contains('flag') ? button.classList.remove('flag') : button.classList.add('flag');\r\n return false;\r\n}", "title": "" }, { "docid": "aa758e05f5cddd5ec25c937069681687", "score": "0.53418136", "text": "function Boradcast(){\n socket.emit('BroadCastMessege', \"The Button Was Clicked !!\");\n}", "title": "" }, { "docid": "0a8bdd23fa1438e085ad55559275b60e", "score": "0.5335824", "text": "function bntClick() {\n btn_affiche_click = true;\n}", "title": "" }, { "docid": "73162729f996dec0ad0e9556408ad5f4", "score": "0.5328657", "text": "@action toggleFlag() {\n if (!this.isRevealed) {\n this.isFlag = !this.isFlag;\n }\n }", "title": "" }, { "docid": "3345a33176f6aa52f749f082b5f193c2", "score": "0.5320077", "text": "function handleButClick(ctlsref) {\n\tvar str = serializeDpchAppDo(srcdoc, \"DpchAppBrlySegDetailDo\", scrJref, ctlsref + \"Click\");\n\tsendReq(str, doc, handleDpchAppDataDoReply);\n}", "title": "" }, { "docid": "b2cb7cbc84a7251cbeeef722ed8973c8", "score": "0.5308677", "text": "clickOnActionsGearIcon(){\n logger.log(\"***** Clicking On Action Gear Icon *****\");\n commonCAPFunc.clickOnActionsGearIcon(eval(applicationLocator.actions.lk_actions));\n logger.log(\"***** Clicked On Action Gear Icon *****\");\n logger.log(eval(applicationLocator.actions.dd_currentAppStatusPanel).isDisplayed());\n browser.pauseBrowser(constants.PAUSE_BROWSER_1000);\n }", "title": "" }, { "docid": "3c48b43a2113463841049a64b4b3165a", "score": "0.53083557", "text": "function handleButClick(ctlsref) {\n\tvar str = serializeDpchAppDo(srcdoc, \"DpchAppDlgFmncFabNewDo\", scrJref, ctlsref + \"Click\");\n\tsendReq(str, doc, handleDpchAppDataDoReply);\n}", "title": "" }, { "docid": "daea195fa667519e76f7dfa649a8fd10", "score": "0.5286209", "text": "function toggleClick() {\n chrome.tabs.query(\n { windowId: chrome.windows.WINDOW_ID_CURRENT },\n function (tabs) {\n for (let i = 0; i < tabs.length; i++) {\n let tab = tabs[i];\n if (tab.url?.includes(linkedUrl) === true) {\n chrome.tabs.sendMessage(tab.id, {\n message:'updated',\n h1b: h1bToggleButton?.checked,\n gc: gcToggleButton?.checked,\n });\n \n }\n }\n }\n );\n \n }", "title": "" }, { "docid": "86545811afb0201a8cfe7bc42a11cade", "score": "0.52839875", "text": "function show_no_clicks()\n{\n generate_status = true;\n window.location.replace(window.location.origin + window.location.pathname + \"#out_of_clicks\");\n}", "title": "" }, { "docid": "1fd06ccbbb58a123ccd3bc59ed0b4367", "score": "0.5283618", "text": "function onHotspotClick(e) {\n\tif (e.id === \"hotspot-play\") {\n\t\tvrView.play();\n\t}\n\tif(e.id === \"hotspot-pause\") {\n\t\tvrView.pause();\n\t}\n\t}", "title": "" }, { "docid": "95980273020b477cfb72bb7ec083ad28", "score": "0.5274945", "text": "clicked(){\n\t\tdispatcher.dispatch({ \"action\":AppModelConst.toggleSpinner});\n\t}", "title": "" }, { "docid": "feb586b38f3ddbedd6159971c54154b6", "score": "0.52713704", "text": "function protectedClick(click_flag){\n\n\tif (click_flag && (getCookie(\"id_token\") != \"\")){\n\t\twindow.history.pushState({page : 'protected'}, 'protectedPage', '#protected')\n\t}\n\tremoveHome();\n\twipeWholePage();\n\tprotectedContent();\n\treturn;\n}", "title": "" }, { "docid": "1e222c87062de52e5d8e2d062424f118", "score": "0.52670944", "text": "function setUpGameType (mode){\n var buttonToSend = {\n button: mode\n };\nconsole.log('this is button to send ->', buttonToSend);\n $.ajax({\n url: '/click',\n type: 'POST',\n data: buttonToSend,\n success: function(response){\n console.log(buttonToSend);\n console.log('click -->', response);\n }\n });\n}// end setUpGameType function", "title": "" }, { "docid": "518fbfddf7089a114584ce7026b781a6", "score": "0.5265182", "text": "function handleButClick(ctlsref) {\n\tvar str = serializeDpchAppDo(srcdoc, \"DpchAppFmncAdrDetailDo\", scrJref, ctlsref + \"Click\");\n\tsendReq(str, doc, handleDpchAppDataDoReply);\n}", "title": "" }, { "docid": "27dc5f946649ebe471ff1c6cf9e83a8b", "score": "0.5262662", "text": "handleClick() {\n this.player_.liveTracker.seekToLiveEdge();\n }", "title": "" }, { "docid": "dd79e9692a3694ac4bb07667aa7ace16", "score": "0.5259535", "text": "function actionOnClick(){\n day +=1;\n game.state.start('brushing');\n\n console.log('click');\n\n }", "title": "" }, { "docid": "830610e5dcae69db257058f021e61834", "score": "0.5258208", "text": "function fastforwardPress() {\n sendRemoteControlRequest(\n 'fastforward',\n SAP_MUSIC_REMOTE_CONTROL_REQ_STATUS_PRESSED\n );\n }", "title": "" }, { "docid": "1adb54e328dcfa42b8fabcc4c56a6735", "score": "0.5252754", "text": "function SwitchToggle(idx, switchcmd){\n\t$.ajax({\n\t\t//url: $.domoticzurl+\"/json.htm?type=command&param=switchlight\" + \"&idx=\" + idx + \"&switchcmd=\" + switchcmd + \"&level=0\",\n\t\turl: $.domoticzurl+\"/json.htm?type=command&param=switchlight\" + \"&idx=\" + idx + \"&switchcmd=\" + switchcmd,\n\t\tasync: false,\n\t\tdataType: 'json',\n\t\tsuccess: function(){\n\t\t\tconsole.log('SUCCES');\n\t\t},\n\t\terror: function(){\n\t\t\tconsole.log('ERROR');\n\t\t}\n\t});\n\tRefreshData();\n}", "title": "" }, { "docid": "3bf0b386950d6efea0ed1c447b1452fe", "score": "0.5249338", "text": "static handleClick() {\n if (DungeonRunner.fighting() && !DungeonBattle.catching()) {\n DungeonBattle.clickAttack();\n }\n else if (DungeonRunner.map.currentTile().type() === GameConstants.DungeonTile.entrance) {\n DungeonRunner.dungeonLeave();\n }\n else if (DungeonRunner.map.currentTile().type() === GameConstants.DungeonTile.chest) {\n DungeonRunner.openChest();\n }\n else if (DungeonRunner.map.currentTile().type() === GameConstants.DungeonTile.boss && !DungeonRunner.fightingBoss()) {\n DungeonRunner.startBossFight();\n }\n else if (DungeonRunner.map.currentTile().type() === GameConstants.DungeonTile.ladder) {\n DungeonRunner.nextFloor();\n }\n }", "title": "" }, { "docid": "576dee883a83a8274b02e2df289894da", "score": "0.52446723", "text": "function addClick(x,y, dragging){\n\tsocket.emit('draw', {x,y,dragging});\n\t//console.log({x,y,dragging});\n}", "title": "" }, { "docid": "97e9162ca6fb9c5d221ee91f6eef1f12", "score": "0.523936", "text": "function sendListenState() {\n const listenLabelChecked = contextMenu.items[0].checked\n win.webContents.send('listen', listenLabelChecked)\n checkToolTip(listenLabelChecked)\n }", "title": "" }, { "docid": "cbf9e68b73bc21dd42136abf7425fa37", "score": "0.52340317", "text": "function ghostClicked () {\n isScottClicked = false;\n console.log(\"Character is ghost\");\n up('mghosty',isScottClicked);\n}", "title": "" }, { "docid": "cfe9d6578db43a762d8eba7b516f982e", "score": "0.52337396", "text": "function clickEnabled() {\n return true;\n }", "title": "" }, { "docid": "cfe9d6578db43a762d8eba7b516f982e", "score": "0.52337396", "text": "function clickEnabled() {\n return true;\n }", "title": "" }, { "docid": "96543c948721103c3342d9310989e44e", "score": "0.5228408", "text": "function clickAction (set) {\n if (clicked) {\n $(set).attr(\"src\", $(set).attr(\"dataGif\"));\n clicked = true;\n }\n else {\n $(set).attr(\"src\", $(set).attr(\"dataRevert\"));\n clicked = false;\n }\n }", "title": "" }, { "docid": "f65b25841c329cb36dc777f86a184e3d", "score": "0.5219793", "text": "function ClickLogin(){ clicked=true }", "title": "" }, { "docid": "276c749d00192f8257aed85117bfce60", "score": "0.5219392", "text": "function click(response, requestInfo, offersColl, clicksColl) { \n database.make(requestInfo, offersColl, clicksColl, function (result) { \n if (result) {\n console.log(\"Database received click to offer number: \" + requestInfo.offer + ' from pub id: ' + requestInfo.pub + ' and subid: ' + requestInfo.subid + ' redirecting to: ' + result);\n response.writeHead(302, { 'Location': '/redirect?'+result }); \n }\n else {\n response.write(\"offer not found\");\n }\n response.end();\n });\n}", "title": "" }, { "docid": "b7578270355ce827a54164add8272bb9", "score": "0.5218231", "text": "function _toggle() {\n event.preventDefault();\n link.click();\n }", "title": "" }, { "docid": "5bb9bfe654ec7d361818b8d8ebd28582", "score": "0.52172", "text": "function handlePassThroughClick(event) {\n\t\t//console.log( 'pass through:', event )\n\t\tvar el = getForwardedTarget(event);\n\n\t\t// IE 9+\n\t\tvar evt = document.createEvent('HTMLEvents');\n\t\tevt.initEvent(event.type, true, false);\n\t\t//console.log( ' # ', el.id, ' is dispatching ' )\n\t\tel.dispatchEvent(evt);\n\t}", "title": "" }, { "docid": "b20c37b8fb01b91ebef15ba9d98e1f8b", "score": "0.5217059", "text": "function sendMainAction() {\n\t\t\tvar data = {};\n\t\t\tdata['gID'] = gameID;\n\t\t\tdata['uID'] = playerID;\n\t\t\t// to implement\n\t\t\t$.each(options, function(opt){\n\t\t\t\tif (options[opt] === 'START') {\n\t\t\t\t\tconsole.log('START GAME REQUEST');\n\t\t\t\t\tdata['request'] = 'START';\n\t\t\t\t} else if (options[opt] === \"ROLL\") {\n\t\t\t\t\tconsole.log('ROLL DICE REQUEST');\n\t\t\t\t\tdata['request'] = 'ROLL';\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log('ERROR SENDING REQUEST TO SERVER - NO PERMISSION FOUND');\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\tvar json = JSON.stringify(data);\n\t\t\t\t$.ajax({\n\t\t type: 'post',\n\t\t url: ping_url,\n\t\t data: json,\n\t\t contentType: \"application/json; charset=utf-8\",\n\t\t traditional: true,\n\t\t success: function (data) {\n\t\t console.log(data);\n\t\t }\n\t\t });\n\n\t\t\t});\n\n\t\t}", "title": "" }, { "docid": "f911e757ef78db794ad983adf108370f", "score": "0.52163345", "text": "function myclick(i) {\n\tgoogle.maps.event.trigger(gmarkers[i], \"click\");\n}", "title": "" }, { "docid": "04e24e77b41b42a01fcd817643fa30e7", "score": "0.5205572", "text": "sendCheck() {\n this.serv.send(`CH#${this.charID}#%`);\n }", "title": "" }, { "docid": "e9004e97daa5a567e309f45534bcf311", "score": "0.52032876", "text": "function action_click( obj )\n{\n\taction_mouse( obj, \"click\" );\n}", "title": "" }, { "docid": "cbe8e399378fc268e8cdd5f20fabe555", "score": "0.5202233", "text": "function toggleFlag(tile) {\n if (tile.hasClass('flagged')) {\n tile.removeClass('flagged');\n flagsPlaced--;\n } else {\n // only as many flags as there are mines\n if (flagsPlaced < totalMines) {\n tile.addClass('flagged');\n flagsPlaced++;\n }\n }\n $statusText.text((totalMines - flagsPlaced) + ' remaining.');\n}", "title": "" }, { "docid": "e0b4425ef2dc207ae8bcd38a6ab23a4c", "score": "0.519895", "text": "function OnClick(){\n//\tif(ats == null && PlayerStatus.MainCharacter ){\n//\t\tats = PlayerStatus.MainCharacter.gameObject.GetComponent(Attack_simple);\n//\t}\n\tif(AllManage.SkillCLStatic.ASkill && ptime > 10 && !AllManage.SkillCLStatic.ASkill.busy){\n\t\tptime -= 10;\n//\t\tcanDu = true;\n\t\tAllManage.SkillCLStatic.jump();\n//\t\tSkillCoolDown(ats.JumpCD);\n\t}\n}", "title": "" }, { "docid": "6f9aab5cb819a41fb04c951ce8dd7296", "score": "0.5197297", "text": "function toggle(){\n if(connected){\n if(stateActual == \"ON\"){\n client.setBinaryState(0);\n }else{\n client.setBinaryState(1);\n }\n}\n}", "title": "" }, { "docid": "bb7f9ca6a86ed2b97fdfb16b0b08c6c4", "score": "0.51933956", "text": "function power(id) {\n var className = document.getElementById(id).className;\n if (className.indexOf(\"off\") != -1) {\n ws.send(id + 'state0');\n //var xmlhttp=new XMLHttpRequest();\n //xmlhttp.open(\"PUT\",\"?id=\" + id + \"&state=on\",true);\n //xmlhttp.send();\n } else {\n ws.send(id + 'state1');\n //var xmlhttp=new XMLHttpRequest();\n //xmlhttp.open(\"PUT\",\"?id=\" + id + \"&state=off\",true);\n //xmlhttp.send();\n }\n}", "title": "" }, { "docid": "cea7af921d07cb981c80f0262b806d80", "score": "0.5192255", "text": "toggleButtonState() {\n if (this.state.setting.mowerAction[1] === \"Stop\") {\n alert('Simulation Terminated!');\n } else {\n client({method: 'PATCH', path: '/next'}).done(response => {\n this.setState({setting: response.entity});\n mowerID = this.state.setting.mowerAction[0];\n mowerAction = this.state.setting.mowerAction[1];\n if (mowerAction != \"Stop\") {\n alert(mowerID + \"\\n\" + mowerAction);\n } else {\n alert('Simulation Terminated!');\n }\n })}\n }", "title": "" }, { "docid": "161a4160509618a53d5d279017926930", "score": "0.5182489", "text": "function handleButClick(ctlsref) {\n\tvar str = serializeDpchAppDo(srcdoc, \"DpchAppDlgWzskObjNewDo\", scrJref, ctlsref + \"Click\");\n\tsendReq(str, doc, handleDpchAppDataDoReply);\n}", "title": "" }, { "docid": "5c102034d75ba0d8fe9f049043bc1f61", "score": "0.5182356", "text": "function click(e) {\r\n\t\t\tif(!e && typeof e=='string') e=document.getElementById(e);\r\n\t\t\tif(!e) return;\r\n\t\t\tvar evObj = e.ownerDocument.createEvent('MouseEvents');\r\n\t\t\tevObj.initMouseEvent(\"click\",true,true,e.ownerDocument.defaultView,0,0,0,0,0,false,false,false,false,0,null);\r\n\t\t\te.dispatchEvent(evObj);\r\n\t\t\tevObj=null;\r\n\t\t}", "title": "" }, { "docid": "63cbf4c43c6608608946e2a612ec9627", "score": "0.5180954", "text": "async switchClick() {\n this.switchOrigData = this.manager.input.get();\n document.getElementById(\"undo-switch\").disabled = false;\n if (this.dishBuffer) {\n this.manager.input.setFile(new File([this.dishBuffer], \"output.dat\"));\n this.manager.input.handleLoaderMessage({\n data: {\n progress: 100,\n fileBuffer: this.dishBuffer\n }\n });\n } else {\n await this.getDishStr();\n this.app.setInput(this.dishStr);\n }\n }", "title": "" }, { "docid": "18ddb9ec713d0d3e25f18c8a6821560c", "score": "0.5175464", "text": "_onClick(x, y) {\n this.actionBubbles.forEach((bubble, index) => {\n if (bubble.isPointInPath(x, y)) {\n this.socket.safeEmit(this.compressedStepDialog.actions[index].socketEvent, {});\n }\n });\n }", "title": "" }, { "docid": "ea9cdade8231621ac0aa36bbc719fc17", "score": "0.5170704", "text": "function btDebugClick() {\r\n var result=\"\"; \r\n var file=\"\";\r\n var port=\"\";\r\n\r\n btProgramClick();\r\n btConnectClick(\"btconn\",\"portname\");\r\n\r\n return false;\r\n}", "title": "" }, { "docid": "20c2d947f93b584714d48db389b7060f", "score": "0.5170611", "text": "function onClick()\n\t{\n\t\tupdateLabel();\n\t\t\n\t\t\n\t\tif (settings.onChange!=undefined)\n\t\t{\n\t\t\tif (mCheckbox.is(\":checked\"))\n\t\t\t{\n\t\t\t\tsettings.onChange(settings.isclicked);\n\t\t\t}else\n\t\t\t{\n\t\t\t\tsettings.onChange(settings.notclicked);\n\t\t\t}\n\t\t}\t\t\n\t}", "title": "" }, { "docid": "bcb1207a33aa9ffe9aa472614a80d899", "score": "0.5170345", "text": "static handleCommitClick() {\n clickerApp.increaseScoreFromClick();\n ui.displayClickFeedback();\n }", "title": "" }, { "docid": "50c4750b0403946cc502ba7e53dcbaeb", "score": "0.5170225", "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": "82879dab8f87200b03de440ba28a7d0f", "score": "0.51701665", "text": "isBeingClicked() {\n this.approveRamo();\n this.malla.verifyPrer();\n this.malla.updateStats();\n this.malla.saveApproved();\n }", "title": "" }, { "docid": "6f88f91f9433c71c01bf66c3e73dc90a", "score": "0.51694244", "text": "function testHttpFlags(flag){\n\tvar mask=Math.pow(2,(flag-1));\n\thttpFlags = httpFlags | mask;\n\tif (httpFlags==511){ // all received\n\t\thttpFlags=0; //ready for the configuration\n\t\tif (settings.clubIdx === undefined) //settings came from the closing of pebbleConfig\n\t\t\t//TODO put settings in localStorage. If missing, prompt with pebbleConfig\n\t\t\tsettings.clubIdx=0;\n\t\tif (settings.seriesIdx === undefined)\n\t\t\tsettings.seriesIdx = 0;\n\t\tif (settings.divIdx === undefined)\n\t\t\tsettings.divIdx = 0;\n\t\tif (settings.yachtLength === undefined)\n\t\t\tsettings.yachtLength = 12;\n\t\tYACHT_LENGTH = settings.yachtLength; \n\t\tif (settings.gpsBehindBow === undefined)\n\t\t\tsettings.gpsBehindBow = 8;\t\t\n\t\tGPS_BEHIND_BOW= settings.gpsBehindBow; \n\t\tif (settings.perfStyle === undefined)\n\t\t\tsettings.perfStyle = 2;\n\t\tSTYLE = settings.perfStyle;\n\t\tif (alreadyRunning!== true){\n\t\t\tflagDataLoaded();\n\t\t\talreadyRunning=true;\n\t\t}\n\t}\n\n}", "title": "" } ]
2bfd946f8397d3be80b0d16fa7ea9ee8
Extract the x and y movement out of the targets webkittransform property
[ { "docid": "ffef719190fd0186d98a57814b0e3909", "score": "0.7005815", "text": "function extractTransformTranslation( target ) {\n var textual = target.css( '-webkit-transform' ),\n re = /^translate3d\\((-?[0-9.]+)[^0-9-]+(-?[0-9.]+).+$/,\n matches = re.exec( textual ); \n\n // If the value ist not initialized return 0,0\n if ( matches === null ) {\n return {\n x: 0,\n y: 0\n };\n }\n\n return {\n x: parseFloat( matches[1] ),\n y: parseFloat( matches[2] )\n };\n }", "title": "" } ]
[ { "docid": "ca15684c18e01edaa292ddc6cb9406a5", "score": "0.640155", "text": "function getElementCoordinates($element) {\n var style = window.getComputedStyle($element.get(0)); // Need the DOM object\n var matrix = new WebKitCSSMatrix(style.WebkitTransform);\n return {xPos: matrix.m41, yPos:matrix.m42};\n }", "title": "" }, { "docid": "cad0515c53b17cbcbae72ebeba399d2e", "score": "0.63438594", "text": "getTargetPosition() {\n const scrollTop = window.pageYOffset\n || document.documentElement.scrollTop\n || document.body.scrollTop;\n const scrollLeft = window.pageXOffset\n || document.documentElement.scrollLeft\n || document.body.scrollLeft;\n const elementRect = this.target.getBoundingClientRect();\n\n return {\n top: elementRect.top + scrollTop,\n left: elementRect.left + scrollLeft,\n right: elementRect.left + scrollLeft + elementRect.width,\n bottom: elementRect.top + scrollTop + elementRect.height,\n };\n }", "title": "" }, { "docid": "cc929d76a681a6251271b42a35d163dc", "score": "0.6240109", "text": "function getXYFromTranslate(element) {\n var x, y;\n if (element) {\n var split = element.getAttribute('transform').split(',');\n x = +split[0].split(\"(\")[1];\n y = +split[1].split(\")\")[0];\n } else {\n x = -100;\n y = -100;\n }\n\n return [x, y];\n}", "title": "" }, { "docid": "dfe5fa165e60335d33404f11a53ca15a", "score": "0.60857546", "text": "function moveTarget(x, y) {\n target.style.transform = `translate(${x - 25}px, ${y - 25}px)`;\n}", "title": "" }, { "docid": "7d12575e59b5df7a86d512eb7efb8c86", "score": "0.603224", "text": "getMousePos(x, y) {\n const rect = this.distElement.getBoundingClientRect();\n return {\n x: x - rect.left,\n y: y - rect.top,\n };\n }", "title": "" }, { "docid": "6613d78dcce56bbdbc6166c7f8ae4289", "score": "0.59593916", "text": "getTransformOrigin(elemRect, contentAnchorOffset = 0) {\n const {\n transformOrigin\n } = this.props;\n return {\n vertical: this.handleGetOffsetTop(elemRect, transformOrigin.vertical) + contentAnchorOffset,\n horizontal: this.handleGetOffsetLeft(elemRect, transformOrigin.horizontal)\n };\n }", "title": "" }, { "docid": "32fd2529775facccdd93381b19376474", "score": "0.59160995", "text": "function targetMove(target, move){\n target.style.transform = `translate(${move}px, 0, 0)`;\n target.style.webkitTransform = `translate3d(${move}px,0 0)`;\n}", "title": "" }, { "docid": "621e7bf341ec5c9beac700d2e9aede39", "score": "0.5909498", "text": "function getUpdatedTranslate(moveX, moveY) {\n var transform = window.getComputedStyle(cntr, null).getPropertyValue('transform');\n var list = transform.substring(7, transform.length - 1).split(',');\n x = parseInt(list[4].trim());\n y = parseInt(list[5].trim());\n if (moveX) {\n x = moveX + x;\n }\n if (moveY) {\n y = moveY + y;\n }\n return `matrix(3, 0, 0, 3, ${x}, ${y})`;\n }", "title": "" }, { "docid": "279990eff3041f318f34ce89779c30b2", "score": "0.58902806", "text": "function getTranslateValues(el) {\n var match = TRANSLATE_REGEX.exec(el.attr(\"transform\"));\n if (match != null) {\n var translateX = match[1], _a = match[2], translateY = _a === void 0 ? 0 : _a;\n return [+translateX, +translateY];\n }\n else {\n return [0, 0];\n }\n}", "title": "" }, { "docid": "f5ee14e01fd1b1ea22f01ff2beb4eb20", "score": "0.58376", "text": "function getPosition() {\n event.target.parentNode.childNodes.forEach(function(item, i) {\n if (item === event.target) {\n x = i;\n }\n });\n event.target.parentNode.parentNode.childNodes.forEach(function(item, index) {\n if (item === event.target.parentNode) {\n y = index;\n }\n });\n }", "title": "" }, { "docid": "bddd6aa03a20425ef3aeb22b4119af19", "score": "0.5803528", "text": "function getTransform(x, y) {\n // Round the transforms since some browsers will\n // blur the elements for sub-pixel transforms.\n return `translate3d(${Math.round(x)}px, ${Math.round(y)}px, 0)`;\n}", "title": "" }, { "docid": "bddd6aa03a20425ef3aeb22b4119af19", "score": "0.5803528", "text": "function getTransform(x, y) {\n // Round the transforms since some browsers will\n // blur the elements for sub-pixel transforms.\n return `translate3d(${Math.round(x)}px, ${Math.round(y)}px, 0)`;\n}", "title": "" }, { "docid": "1d9eda1a5101494863f1704be2d4786e", "score": "0.57956636", "text": "static getCoordsByTranslate(o){\n // translateRegEx -> @see Move.js\n //console.log(o.style.translate);\n return [ o.getAttributeNS(null,\"style\").search( translateRegEx ) ];\n }", "title": "" }, { "docid": "a072e4e5b96d268118f200103e5ec36d", "score": "0.5771159", "text": "_getCurrentPosition() {\n let style = this.element.style;\n return {\n top: style.top,\n left: style.left,\n bottom: style.bottom,\n right: style.right,\n transform: style.transform\n };\n }", "title": "" }, { "docid": "96a75a919de00f0991c8a666917a4a6a", "score": "0.57664555", "text": "function getPositionXY(element) {\r\n var rect = element.getBoundingClientRect();\r\n return [rect.x, rect.y]\r\n \r\n}", "title": "" }, { "docid": "c0d1a26aad9990c9537de9652b399edc", "score": "0.5763737", "text": "function getPositionX(tabTransformations) {\n return tabTransformations[0];\n }", "title": "" }, { "docid": "15f580bdce7bef7bce09818a332bda11", "score": "0.5707007", "text": "function compute_xC_yC_relativeTocanvas(e,canvasElement){\n\t\txC = e.pageX - canvasElement.offsetLeft;\n\t\tyC = e.pageY - canvasElement.offsetTop;\n\t}", "title": "" }, { "docid": "ad01b2abbb5c4856f3a4db5f12bac2c9", "score": "0.5659001", "text": "function relMouseCoords(event) {\n var totalOffsetX = 0;\n var totalOffsetY = 0;\n var canvasX = 0;\n var canvasY = 0;\n var currentElement = this;\n\n if (event.offsetX) {\n return { x: event.offsetX, y: event.offsetY };\n } else {\n if (!Utils.cssScale) {\n var st = window.getComputedStyle(document.body, null);\n var tr =\n st.getPropertyValue(\"-webkit-transform\") ||\n st.getPropertyValue(\"-moz-transform\") ||\n st.getPropertyValue(\"-ms-transform\") ||\n st.getPropertyValue(\"-o-transform\") ||\n st.getPropertyValue(\"transform\");\n var matrixRegex = /matrix\\((-?\\d*\\.?\\d+),\\s*0,\\s*0,\\s*(-?\\d*\\.?\\d+),\\s*0,\\s*0\\)/;\n var matches = tr.match(matrixRegex);\n if (matches) {\n Utils.cssScale = parseFloat(matches[1]);\n } else {\n Utils.cssScale = 1;\n }\n }\n var e = event;\n var canvas = e.target;\n // http://www.jacklmoore.com/notes/mouse-position/\n var target = e.target || e.srcElement;\n var style = target.currentStyle || window.getComputedStyle(target, null);\n var borderLeftWidth = parseInt(style[\"borderLeftWidth\"], 10);\n var borderTopWidth = parseInt(style[\"borderTopWidth\"], 10);\n var rect = target.getBoundingClientRect();\n\n var clientX = e.clientX;\n var clientY = e.clientY;\n if (e.clientX) {\n clientX = e.clientX;\n clientY = e.clientY;\n } else {\n clientX = e.originalEvent.changedTouches[0].clientX;\n clientY = e.originalEvent.changedTouches[0].clientY;\n }\n\n var offsetX = clientX - borderLeftWidth - rect.left;\n var offsetY = clientY - borderTopWidth - rect.top;\n\n return {\n x: parseInt(offsetX / Utils.cssScale),\n y: parseInt(offsetY / Utils.cssScale)\n };\n }\n}", "title": "" }, { "docid": "3eebde78eb603ab12daf4576f617d015", "score": "0.5618092", "text": "function getCordinates(event, element){\n var x = event.pageX + $(\"#img_home\").scrollLeft() - $(\"#img_home\").offset().left - element.offsetLeft;\n var y = event.pageY + $(\"#img_home\").scrollTop() - $(\"#img_home\").offset().top - element.offsetTop;\n return {x:x,y:y};\n}", "title": "" }, { "docid": "fa5b09700cfe81c33d03afa4359965dd", "score": "0.56124", "text": "function transformOrigin(target, container, move$, terminus$) {\n return function(originEvent) {\n const origin = originEvent.targetTouches ? originEvent.targetTouches[0] : originEvent\n , rootRect = container.getBoundingClientRect()\n , targetRect = target.getBoundingClientRect()\n , startX = origin.clientX - targetRect.left\n , startY = origin.clientY - targetRect.top\n ;\n\n return move$.map(transformMove(rootRect, startX, startY)).takeUntil(terminus$);\n }\n}", "title": "" }, { "docid": "52e0deab14f8d4601557139e3db1de30", "score": "0.55827534", "text": "getRotation(x, y){\n let rect = this.parentElement.getBoundingClientRect()\n x = (x - rect.x) / rect.width - 1 / 2\n y = (y - window.scrollY - rect.y) / rect.height - 1 / 2\n return {x, y}\n }", "title": "" }, { "docid": "b3cc4883b7acac83e2533e5932a4ac1f", "score": "0.5582549", "text": "getPosition (currentTarget) {\n const {place} = this.state\n const node = findDOMNode(this)\n const boundingClientRect = currentTarget.getBoundingClientRect()\n const targetTop = boundingClientRect.top\n const targetLeft = boundingClientRect.left\n const tipWidth = node.clientWidth\n const tipHeight = node.clientHeight\n const targetWidth = currentTarget.clientWidth\n const targetHeight = currentTarget.clientHeight\n let x\n let y\n if (place === 'top') {\n x = targetLeft - (tipWidth / 2) + (targetWidth / 2)\n y = targetTop - tipHeight - 8\n } else if (place === 'bottom') {\n x = targetLeft - (tipWidth / 2) + (targetWidth / 2)\n y = targetTop + targetHeight + 8\n } else if (place === 'left') {\n x = targetLeft - tipWidth - 6\n y = targetTop + (targetHeight / 2) - (tipHeight / 2)\n } else if (place === 'right') {\n x = targetLeft + targetWidth + 6\n y = targetTop + (targetHeight / 2) - (tipHeight / 2)\n }\n\n return { x, y }\n }", "title": "" }, { "docid": "2361a9d769d2ffd8b22e7d337102e440", "score": "0.5579371", "text": "function mouseCoords(event, targetElement) {\n var totalOffsetX = 0,\n totalOffsetY = 0,\n canvasX = 0,\n canvasY = 0,\n currentElement = targetElement || event.target;\n\n do {\n totalOffsetX += currentElement.offsetLeft - currentElement.scrollLeft;\n totalOffsetY += currentElement.offsetTop - currentElement.scrollTop;\n currentElement = currentElement.offsetParent;\n }\n while (currentElement);\n\n canvasX = event.pageX - totalOffsetX;\n canvasY = event.pageY - totalOffsetY;\n\n return {\n x: canvasX,\n y: canvasY\n };\n}", "title": "" }, { "docid": "d3c3dd2c9a48b44e65fc03ed99075f8d", "score": "0.5562725", "text": "get targetX() {\n return Math.round(this.rx / UNIT + 0.8 * this.direction.x)\n }", "title": "" }, { "docid": "f4e0fd84e5f603a163e16bb331b90be8", "score": "0.55445343", "text": "function transforms(x,y,el){\n let box = el.getBoundingClientRect();\n\n //getting a ratio between the center of the object and the mouse cursor position on the specified div\n let calcX = -(y-box.y-(box.height/2))/constrain;\n let calcY = -(x-box.x-(box.width/2))/constrain;\n\n //returning the rotation based on the ratio calculated\n return `perspective(100px) rotateX(${calcX}deg) rotateY(${calcY}deg)`;\n}", "title": "" }, { "docid": "dafe89d42d8659b5ee6e24b4592f0d5e", "score": "0.5513147", "text": "function getPosition(element, parent) {\n var transformStyle = getVendorStyle('transform'); \n parent = typeof parent != 'undefined' ? parent : document.body;\n if (element == document.body) {\n return {left: 0, top: 0};\n }\n if (!element.offsetParent) {\n return null;\n }\n var x = 0;\n var y = 0;\n while (element && element != parent) {\n if (matrix) {\n // include transform scale\n x = x * matrix.a;\n y = y * matrix.d;\n }\n //var transformValue = $(element).css(transformStyle);\n //var matrix = getTransformMatrix(transformValue);\n x+= element.offsetLeft;\n y+= element.offsetTop;\n element = element.offsetParent;\n }\n return {\n left: x, top: y\n };\n }", "title": "" }, { "docid": "e3ce4ee982fd19903d948803d55ff98c", "score": "0.5476092", "text": "function getTouchPos(canvasDom, e) {\n var rect = canvasDom.getBoundingClientRect();\n return {\n x: e.touches[0].clientX - rect.left,\n y: e.touches[0].clientY - rect.top\n };\n }", "title": "" }, { "docid": "e3ce4ee982fd19903d948803d55ff98c", "score": "0.5476092", "text": "function getTouchPos(canvasDom, e) {\n var rect = canvasDom.getBoundingClientRect();\n return {\n x: e.touches[0].clientX - rect.left,\n y: e.touches[0].clientY - rect.top\n };\n }", "title": "" }, { "docid": "e3ce4ee982fd19903d948803d55ff98c", "score": "0.5476092", "text": "function getTouchPos(canvasDom, e) {\n var rect = canvasDom.getBoundingClientRect();\n return {\n x: e.touches[0].clientX - rect.left,\n y: e.touches[0].clientY - rect.top\n };\n }", "title": "" }, { "docid": "e3ce4ee982fd19903d948803d55ff98c", "score": "0.5476092", "text": "function getTouchPos(canvasDom, e) {\n var rect = canvasDom.getBoundingClientRect();\n return {\n x: e.touches[0].clientX - rect.left,\n y: e.touches[0].clientY - rect.top\n };\n }", "title": "" }, { "docid": "e3ce4ee982fd19903d948803d55ff98c", "score": "0.5476092", "text": "function getTouchPos(canvasDom, e) {\n var rect = canvasDom.getBoundingClientRect();\n return {\n x: e.touches[0].clientX - rect.left,\n y: e.touches[0].clientY - rect.top\n };\n }", "title": "" }, { "docid": "e3ce4ee982fd19903d948803d55ff98c", "score": "0.5476092", "text": "function getTouchPos(canvasDom, e) {\n var rect = canvasDom.getBoundingClientRect();\n return {\n x: e.touches[0].clientX - rect.left,\n y: e.touches[0].clientY - rect.top\n };\n }", "title": "" }, { "docid": "b0d61213d5665333902d0f6dc7c7ad4a", "score": "0.5471783", "text": "function transformMove(rootRect, startX, startY) {\n return function(moveEvent) {\n moveEvent.preventDefault();\n const move = moveEvent.targetTouches ? moveEvent.targetTouches[0] : moveEvent;\n\n return {\n top: move.clientY - rootRect.top - startY,\n left: move.clientX - rootRect.left - startX\n }\n }\n}", "title": "" }, { "docid": "71d00e5ee7968c8f0a3c70cf1a91f9ef", "score": "0.54663724", "text": "function offset() {\r\n //technically, vX.pos works too and I should probably use whatever I built here, but I have jQuery instead.\r\n if(window.Ext) return Ext.get(elem).getXY();\r\n if(window.jQuery) {\r\n var pos = jQuery(elem).offset();\r\n return [pos.left, pos.top];\r\n }\r\n if(window.vx) { //vx support\r\n var pos = vx.pos(elem);\r\n return [pos.l, pos.t]\r\n }\r\n return [0, 0]\r\n }", "title": "" }, { "docid": "df5f1d37771f25c4d0cccd7cae954a9c", "score": "0.5448075", "text": "getTouchPos(canvasDom, touchEvent) {\n let rect = canvasDom.getBoundingClientRect();\n return {\n x: touchEvent.touches[0].clientX - rect.left,\n y: touchEvent.touches[0].clientY - rect.top\n };\n\n }", "title": "" }, { "docid": "fc5a892214a2fbdc94a720941811f2b6", "score": "0.54320276", "text": "function elementMouseMove(e) {\r\n \r\n \r\n if (selectedElement && e.target !=null) {\r\n e.preventDefault();\r\n let coordonates=getMousePosition(e);\r\n transform.setTranslate(coordonates.x - offset.x, coordonates.y - offset.y);\r\n }\r\n\r\n}", "title": "" }, { "docid": "6ce2dde16001d4a0be51cb88423cacc9", "score": "0.5428131", "text": "function mouseMove(ansicanvas, e) {\n //console.log(e);\n\n var mouse = getMousePos(ansicanvas, e);\n var mx = mouse.x;\n var my = mouse.y;\n}", "title": "" }, { "docid": "c9a26bbe54e67c41f1507292587a79d0", "score": "0.54214096", "text": "onPanStart () {\n this.currentX = 0;\n let transformStyle = this.wrapper.style.transform;\n var regex = /[+-]?\\d+(?:\\.\\d+)?/g;\n let test = regex.exec(transformStyle)\n this.start = test[0];\n this.isPanning = true;\n }", "title": "" }, { "docid": "bccaf919226ba50e125ff6fec6e5b416", "score": "0.5409969", "text": "function getMosuePositionOnCanvas(event) {\n const clientX = event.clientX || event.touches[0].clientX;\n const clientY = event.clientY || event.touches[0].clientY;\n const { offsetLeft, offsetTop } = event.target;\n const canvasX = clientX - offsetLeft;\n const canvasY = clientY - offsetTop;\n\n return {\n x: canvasX,\n y: canvasY,\n };\n }", "title": "" }, { "docid": "c619212a463d582fd0c137ba8de6032e", "score": "0.54080963", "text": "getActualOffset() {\r\n let offset;\r\n if (this.candle.dragging) {\r\n offset = this.element.offset();\r\n } else {\r\n offset = this.cachedOffset;\r\n }\r\n if (isFirefox) {\r\n return {\r\n left: offset.left - this.width,\r\n top: offset.top - this.height,\r\n };\r\n }\r\n return offset;\r\n }", "title": "" }, { "docid": "ab324b12acbe0002151f36bb030534be", "score": "0.53979856", "text": "getTouchPos(canvasDom, touchEvent) {\n\t\tconst rect = canvasDom.getBoundingClientRect();\n\t \treturn {\n\t \tx: touchEvent.touches[0].clientX - rect.left,\n\t \ty: touchEvent.touches[0].clientY - rect.top\n\t \t};\n\t}", "title": "" }, { "docid": "b2eb850248a57b0871e80527a6c0bcd7", "score": "0.5388332", "text": "function getTranslateValue(direction, node) {\n var rect = node.getBoundingClientRect();\n var transform;\n\n if (node.fakeTransform) {\n transform = node.fakeTransform;\n } else {\n var computedStyle = window.getComputedStyle(node);\n transform = computedStyle.getPropertyValue('-webkit-transform') || computedStyle.getPropertyValue('transform');\n }\n\n var offsetX = 0;\n var offsetY = 0;\n\n if (transform && transform !== 'none' && typeof transform === 'string') {\n var transformValues = transform.split('(')[1].split(')')[0].split(',');\n offsetX = parseInt(transformValues[4], 10);\n offsetY = parseInt(transformValues[5], 10);\n }\n\n if (direction === 'left') {\n return \"translateX(\".concat(window.innerWidth, \"px) translateX(-\").concat(rect.left - offsetX, \"px)\");\n }\n\n if (direction === 'right') {\n return \"translateX(-\".concat(rect.left + rect.width - offsetX, \"px)\");\n }\n\n if (direction === 'up') {\n return \"translateY(\".concat(window.innerHeight, \"px) translateY(-\").concat(rect.top - offsetY, \"px)\");\n } // direction === 'down'\n\n\n return \"translateY(-\".concat(rect.top + rect.height - offsetY, \"px)\");\n}", "title": "" }, { "docid": "b2eb850248a57b0871e80527a6c0bcd7", "score": "0.5388332", "text": "function getTranslateValue(direction, node) {\n var rect = node.getBoundingClientRect();\n var transform;\n\n if (node.fakeTransform) {\n transform = node.fakeTransform;\n } else {\n var computedStyle = window.getComputedStyle(node);\n transform = computedStyle.getPropertyValue('-webkit-transform') || computedStyle.getPropertyValue('transform');\n }\n\n var offsetX = 0;\n var offsetY = 0;\n\n if (transform && transform !== 'none' && typeof transform === 'string') {\n var transformValues = transform.split('(')[1].split(')')[0].split(',');\n offsetX = parseInt(transformValues[4], 10);\n offsetY = parseInt(transformValues[5], 10);\n }\n\n if (direction === 'left') {\n return \"translateX(\".concat(window.innerWidth, \"px) translateX(-\").concat(rect.left - offsetX, \"px)\");\n }\n\n if (direction === 'right') {\n return \"translateX(-\".concat(rect.left + rect.width - offsetX, \"px)\");\n }\n\n if (direction === 'up') {\n return \"translateY(\".concat(window.innerHeight, \"px) translateY(-\").concat(rect.top - offsetY, \"px)\");\n } // direction === 'down'\n\n\n return \"translateY(-\".concat(rect.top + rect.height - offsetY, \"px)\");\n}", "title": "" }, { "docid": "b2eb850248a57b0871e80527a6c0bcd7", "score": "0.5388332", "text": "function getTranslateValue(direction, node) {\n var rect = node.getBoundingClientRect();\n var transform;\n\n if (node.fakeTransform) {\n transform = node.fakeTransform;\n } else {\n var computedStyle = window.getComputedStyle(node);\n transform = computedStyle.getPropertyValue('-webkit-transform') || computedStyle.getPropertyValue('transform');\n }\n\n var offsetX = 0;\n var offsetY = 0;\n\n if (transform && transform !== 'none' && typeof transform === 'string') {\n var transformValues = transform.split('(')[1].split(')')[0].split(',');\n offsetX = parseInt(transformValues[4], 10);\n offsetY = parseInt(transformValues[5], 10);\n }\n\n if (direction === 'left') {\n return \"translateX(\".concat(window.innerWidth, \"px) translateX(-\").concat(rect.left - offsetX, \"px)\");\n }\n\n if (direction === 'right') {\n return \"translateX(-\".concat(rect.left + rect.width - offsetX, \"px)\");\n }\n\n if (direction === 'up') {\n return \"translateY(\".concat(window.innerHeight, \"px) translateY(-\").concat(rect.top - offsetY, \"px)\");\n } // direction === 'down'\n\n\n return \"translateY(-\".concat(rect.top + rect.height - offsetY, \"px)\");\n}", "title": "" }, { "docid": "b2eb850248a57b0871e80527a6c0bcd7", "score": "0.5388332", "text": "function getTranslateValue(direction, node) {\n var rect = node.getBoundingClientRect();\n var transform;\n\n if (node.fakeTransform) {\n transform = node.fakeTransform;\n } else {\n var computedStyle = window.getComputedStyle(node);\n transform = computedStyle.getPropertyValue('-webkit-transform') || computedStyle.getPropertyValue('transform');\n }\n\n var offsetX = 0;\n var offsetY = 0;\n\n if (transform && transform !== 'none' && typeof transform === 'string') {\n var transformValues = transform.split('(')[1].split(')')[0].split(',');\n offsetX = parseInt(transformValues[4], 10);\n offsetY = parseInt(transformValues[5], 10);\n }\n\n if (direction === 'left') {\n return \"translateX(\".concat(window.innerWidth, \"px) translateX(-\").concat(rect.left - offsetX, \"px)\");\n }\n\n if (direction === 'right') {\n return \"translateX(-\".concat(rect.left + rect.width - offsetX, \"px)\");\n }\n\n if (direction === 'up') {\n return \"translateY(\".concat(window.innerHeight, \"px) translateY(-\").concat(rect.top - offsetY, \"px)\");\n } // direction === 'down'\n\n\n return \"translateY(-\".concat(rect.top + rect.height - offsetY, \"px)\");\n}", "title": "" }, { "docid": "b2eb850248a57b0871e80527a6c0bcd7", "score": "0.5388332", "text": "function getTranslateValue(direction, node) {\n var rect = node.getBoundingClientRect();\n var transform;\n\n if (node.fakeTransform) {\n transform = node.fakeTransform;\n } else {\n var computedStyle = window.getComputedStyle(node);\n transform = computedStyle.getPropertyValue('-webkit-transform') || computedStyle.getPropertyValue('transform');\n }\n\n var offsetX = 0;\n var offsetY = 0;\n\n if (transform && transform !== 'none' && typeof transform === 'string') {\n var transformValues = transform.split('(')[1].split(')')[0].split(',');\n offsetX = parseInt(transformValues[4], 10);\n offsetY = parseInt(transformValues[5], 10);\n }\n\n if (direction === 'left') {\n return \"translateX(\".concat(window.innerWidth, \"px) translateX(-\").concat(rect.left - offsetX, \"px)\");\n }\n\n if (direction === 'right') {\n return \"translateX(-\".concat(rect.left + rect.width - offsetX, \"px)\");\n }\n\n if (direction === 'up') {\n return \"translateY(\".concat(window.innerHeight, \"px) translateY(-\").concat(rect.top - offsetY, \"px)\");\n } // direction === 'down'\n\n\n return \"translateY(-\".concat(rect.top + rect.height - offsetY, \"px)\");\n}", "title": "" }, { "docid": "b2eb850248a57b0871e80527a6c0bcd7", "score": "0.5388332", "text": "function getTranslateValue(direction, node) {\n var rect = node.getBoundingClientRect();\n var transform;\n\n if (node.fakeTransform) {\n transform = node.fakeTransform;\n } else {\n var computedStyle = window.getComputedStyle(node);\n transform = computedStyle.getPropertyValue('-webkit-transform') || computedStyle.getPropertyValue('transform');\n }\n\n var offsetX = 0;\n var offsetY = 0;\n\n if (transform && transform !== 'none' && typeof transform === 'string') {\n var transformValues = transform.split('(')[1].split(')')[0].split(',');\n offsetX = parseInt(transformValues[4], 10);\n offsetY = parseInt(transformValues[5], 10);\n }\n\n if (direction === 'left') {\n return \"translateX(\".concat(window.innerWidth, \"px) translateX(-\").concat(rect.left - offsetX, \"px)\");\n }\n\n if (direction === 'right') {\n return \"translateX(-\".concat(rect.left + rect.width - offsetX, \"px)\");\n }\n\n if (direction === 'up') {\n return \"translateY(\".concat(window.innerHeight, \"px) translateY(-\").concat(rect.top - offsetY, \"px)\");\n } // direction === 'down'\n\n\n return \"translateY(-\".concat(rect.top + rect.height - offsetY, \"px)\");\n}", "title": "" }, { "docid": "b2eb850248a57b0871e80527a6c0bcd7", "score": "0.5388332", "text": "function getTranslateValue(direction, node) {\n var rect = node.getBoundingClientRect();\n var transform;\n\n if (node.fakeTransform) {\n transform = node.fakeTransform;\n } else {\n var computedStyle = window.getComputedStyle(node);\n transform = computedStyle.getPropertyValue('-webkit-transform') || computedStyle.getPropertyValue('transform');\n }\n\n var offsetX = 0;\n var offsetY = 0;\n\n if (transform && transform !== 'none' && typeof transform === 'string') {\n var transformValues = transform.split('(')[1].split(')')[0].split(',');\n offsetX = parseInt(transformValues[4], 10);\n offsetY = parseInt(transformValues[5], 10);\n }\n\n if (direction === 'left') {\n return \"translateX(\".concat(window.innerWidth, \"px) translateX(-\").concat(rect.left - offsetX, \"px)\");\n }\n\n if (direction === 'right') {\n return \"translateX(-\".concat(rect.left + rect.width - offsetX, \"px)\");\n }\n\n if (direction === 'up') {\n return \"translateY(\".concat(window.innerHeight, \"px) translateY(-\").concat(rect.top - offsetY, \"px)\");\n } // direction === 'down'\n\n\n return \"translateY(-\".concat(rect.top + rect.height - offsetY, \"px)\");\n}", "title": "" }, { "docid": "21e3a354d6cfef1cf05c874ec1a0cbd0", "score": "0.5384913", "text": "function mouseMove(event) {\n var viewportCoords = getClickedCoords(event);\n mouseX = viewportCoords[0]; mouseY = viewportCoords[1];\n}", "title": "" }, { "docid": "3dea4c384c4943c1f9bbea6fcd205ad8", "score": "0.5377412", "text": "function getTranslateValue(direction, node) {\n var rect = node.getBoundingClientRect();\n var transform;\n\n if (node.fakeTransform) {\n transform = node.fakeTransform;\n } else {\n var computedStyle = window.getComputedStyle(node);\n transform = computedStyle.getPropertyValue('-webkit-transform') || computedStyle.getPropertyValue('transform');\n }\n\n var offsetX = 0;\n var offsetY = 0;\n\n if (transform && transform !== 'none' && typeof transform === 'string') {\n var transformValues = transform.split('(')[1].split(')')[0].split(',');\n offsetX = parseInt(transformValues[4], 10);\n offsetY = parseInt(transformValues[5], 10);\n }\n\n if (direction === 'left') {\n return \"translateX(\".concat(window.innerWidth, \"px) translateX(\").concat(offsetX - rect.left, \"px)\");\n }\n\n if (direction === 'right') {\n return \"translateX(-\".concat(rect.left + rect.width - offsetX, \"px)\");\n }\n\n if (direction === 'up') {\n return \"translateY(\".concat(window.innerHeight, \"px) translateY(\").concat(offsetY - rect.top, \"px)\");\n } // direction === 'down'\n\n\n return \"translateY(-\".concat(rect.top + rect.height - offsetY, \"px)\");\n}", "title": "" }, { "docid": "3dea4c384c4943c1f9bbea6fcd205ad8", "score": "0.5377412", "text": "function getTranslateValue(direction, node) {\n var rect = node.getBoundingClientRect();\n var transform;\n\n if (node.fakeTransform) {\n transform = node.fakeTransform;\n } else {\n var computedStyle = window.getComputedStyle(node);\n transform = computedStyle.getPropertyValue('-webkit-transform') || computedStyle.getPropertyValue('transform');\n }\n\n var offsetX = 0;\n var offsetY = 0;\n\n if (transform && transform !== 'none' && typeof transform === 'string') {\n var transformValues = transform.split('(')[1].split(')')[0].split(',');\n offsetX = parseInt(transformValues[4], 10);\n offsetY = parseInt(transformValues[5], 10);\n }\n\n if (direction === 'left') {\n return \"translateX(\".concat(window.innerWidth, \"px) translateX(\").concat(offsetX - rect.left, \"px)\");\n }\n\n if (direction === 'right') {\n return \"translateX(-\".concat(rect.left + rect.width - offsetX, \"px)\");\n }\n\n if (direction === 'up') {\n return \"translateY(\".concat(window.innerHeight, \"px) translateY(\").concat(offsetY - rect.top, \"px)\");\n } // direction === 'down'\n\n\n return \"translateY(-\".concat(rect.top + rect.height - offsetY, \"px)\");\n}", "title": "" }, { "docid": "3dea4c384c4943c1f9bbea6fcd205ad8", "score": "0.5377412", "text": "function getTranslateValue(direction, node) {\n var rect = node.getBoundingClientRect();\n var transform;\n\n if (node.fakeTransform) {\n transform = node.fakeTransform;\n } else {\n var computedStyle = window.getComputedStyle(node);\n transform = computedStyle.getPropertyValue('-webkit-transform') || computedStyle.getPropertyValue('transform');\n }\n\n var offsetX = 0;\n var offsetY = 0;\n\n if (transform && transform !== 'none' && typeof transform === 'string') {\n var transformValues = transform.split('(')[1].split(')')[0].split(',');\n offsetX = parseInt(transformValues[4], 10);\n offsetY = parseInt(transformValues[5], 10);\n }\n\n if (direction === 'left') {\n return \"translateX(\".concat(window.innerWidth, \"px) translateX(\").concat(offsetX - rect.left, \"px)\");\n }\n\n if (direction === 'right') {\n return \"translateX(-\".concat(rect.left + rect.width - offsetX, \"px)\");\n }\n\n if (direction === 'up') {\n return \"translateY(\".concat(window.innerHeight, \"px) translateY(\").concat(offsetY - rect.top, \"px)\");\n } // direction === 'down'\n\n\n return \"translateY(-\".concat(rect.top + rect.height - offsetY, \"px)\");\n}", "title": "" }, { "docid": "3dea4c384c4943c1f9bbea6fcd205ad8", "score": "0.5377412", "text": "function getTranslateValue(direction, node) {\n var rect = node.getBoundingClientRect();\n var transform;\n\n if (node.fakeTransform) {\n transform = node.fakeTransform;\n } else {\n var computedStyle = window.getComputedStyle(node);\n transform = computedStyle.getPropertyValue('-webkit-transform') || computedStyle.getPropertyValue('transform');\n }\n\n var offsetX = 0;\n var offsetY = 0;\n\n if (transform && transform !== 'none' && typeof transform === 'string') {\n var transformValues = transform.split('(')[1].split(')')[0].split(',');\n offsetX = parseInt(transformValues[4], 10);\n offsetY = parseInt(transformValues[5], 10);\n }\n\n if (direction === 'left') {\n return \"translateX(\".concat(window.innerWidth, \"px) translateX(\").concat(offsetX - rect.left, \"px)\");\n }\n\n if (direction === 'right') {\n return \"translateX(-\".concat(rect.left + rect.width - offsetX, \"px)\");\n }\n\n if (direction === 'up') {\n return \"translateY(\".concat(window.innerHeight, \"px) translateY(\").concat(offsetY - rect.top, \"px)\");\n } // direction === 'down'\n\n\n return \"translateY(-\".concat(rect.top + rect.height - offsetY, \"px)\");\n}", "title": "" }, { "docid": "3dea4c384c4943c1f9bbea6fcd205ad8", "score": "0.5377412", "text": "function getTranslateValue(direction, node) {\n var rect = node.getBoundingClientRect();\n var transform;\n\n if (node.fakeTransform) {\n transform = node.fakeTransform;\n } else {\n var computedStyle = window.getComputedStyle(node);\n transform = computedStyle.getPropertyValue('-webkit-transform') || computedStyle.getPropertyValue('transform');\n }\n\n var offsetX = 0;\n var offsetY = 0;\n\n if (transform && transform !== 'none' && typeof transform === 'string') {\n var transformValues = transform.split('(')[1].split(')')[0].split(',');\n offsetX = parseInt(transformValues[4], 10);\n offsetY = parseInt(transformValues[5], 10);\n }\n\n if (direction === 'left') {\n return \"translateX(\".concat(window.innerWidth, \"px) translateX(\").concat(offsetX - rect.left, \"px)\");\n }\n\n if (direction === 'right') {\n return \"translateX(-\".concat(rect.left + rect.width - offsetX, \"px)\");\n }\n\n if (direction === 'up') {\n return \"translateY(\".concat(window.innerHeight, \"px) translateY(\").concat(offsetY - rect.top, \"px)\");\n } // direction === 'down'\n\n\n return \"translateY(-\".concat(rect.top + rect.height - offsetY, \"px)\");\n}", "title": "" }, { "docid": "2a143d11fa3b4d4da7687f7fe72d1ab2", "score": "0.5371692", "text": "positionate () {\n const target = this.target\n const position = this.position\n\n const offset = elementRect(target.$el, document.documentElement)\n\n target.position = {\n x: offset.left - window.pageXOffset,\n y: offset.top - window.pageYOffset\n }\n target.dimension = {\n width: target.$el.offsetWidth,\n height: target.$el.offsetHeight\n }\n\n const coordinates = {\n // a dictionary with each of the coordinates used for positioning Arrow\n top: {\n x: `${target.position.x + target.dimension.width / 2 - 20}px`,\n y: `${target.position.y - 30}px`\n },\n right: {\n x: `${target.position.x + target.dimension.width - 12}px`,\n y: `${target.position.y + target.dimension.height / 2 - 6}px`\n },\n bottom: {\n x: `${target.position.x + target.dimension.width / 2 - 35}px`,\n y: `${target.position.y + target.dimension.height + 2}px`\n },\n left: {\n x: `${target.position.x - 35}px`,\n y: `${target.position.y + target.dimension.height / 2 - 22}px`\n }\n }\n\n applyStyles(this.$el, {\n left: coordinates[position].x,\n top: coordinates[position].y\n })\n }", "title": "" }, { "docid": "0c73dc5f1df374efac44e1827ae56ac8", "score": "0.5364485", "text": "function relMouseCoords(event){\n let totalOffsetX = 0;\n let totalOffsetY = 0;\n let canvasX = 0;\n let canvasY = 0;\n let currentElement = this;\n do{\n totalOffsetX += currentElement.offsetLeft - currentElement.scrollLeft;\n totalOffsetY += currentElement.offsetTop - currentElement.scrollTop;\n } while(currentElement = currentElement.offsetParent)\n canvasX = event.pageX - totalOffsetX;\n canvasY = event.pageY - totalOffsetY;\n return {x:canvasX, y:canvasY}\n}", "title": "" }, { "docid": "67653395ec0d207d576fd47a5e6e2563", "score": "0.53507084", "text": "translate(offsetX, offsetY) {\n this.metrixElements[4] = offsetX;\n this.metrixElements[5] = offsetY;\n }", "title": "" }, { "docid": "f5cb7714e8a45a770a2d668699238ff8", "score": "0.5342551", "text": "function translateBackground(e){\n translate(mouseX-clickOriginX, mouseY-clickOriginY);\n //console.log(\"NONE_X: \" + mouseX + \" : \" + clickOriginX);\n clickOriginX = (e.clientX/contextMatrix[0])-contextMatrix[4]/contextMatrix[0];\n clickOriginY = (e.clientY/contextMatrix[3])-contextMatrix[5]/contextMatrix[3];\n}", "title": "" }, { "docid": "15d88c68a083b11878dae0d4a6baca0e", "score": "0.5330918", "text": "onTouchStartMove(e) {\r\n this.mouse3D.x = (e.changedTouches[0].clientX / this.width) * 2 - 1;\r\n this.mouse3D.y = -(e.changedTouches[0].clientY / this.height) * 2 + 1;\r\n }", "title": "" }, { "docid": "b0b3cab1d3c17df90edbcf6fa1b69697", "score": "0.53302014", "text": "position(diff)\r\n {\r\n let w = this.angularSpeed;\r\n\r\n\t let trans = [this.centerCoords[0], this.centerCoords[1], this.centerCoords[2]];\r\n\r\n\t let angle = this.initialAngle + w * this.elapsedTime;\r\n\r\n\t trans[0] += this.rcos(angle);\r\n\r\n\t trans[2] += this.rsin(angle);\r\n\r\n\t return trans;\r\n }", "title": "" }, { "docid": "406f770e645f0025ce2823dd208b54e2", "score": "0.5329962", "text": "getPointerPosition(event) {\n const canvasSize = utils.getWidthAndHeightFromCanvas(this.domElement);\n // Absolute size of a canvas\n const rect = this.domElement.getBoundingClientRect();\n // TODO: Test if scaling is needed and works on HiDPI devices.\n const scaleX = Math.round(rect.width) / canvasSize.width;\n const scaleY = Math.round(rect.height) / canvasSize.height;\n // Scale mouse coordinates after they have, been adjusted to be relative to element.\n return new THREE.Vector2((event.clientX - Math.floor(rect.left)) * scaleX, (event.clientY - Math.floor(rect.top)) * scaleY);\n }", "title": "" }, { "docid": "107b69062b0b96bc9cf70d09ceac12ba", "score": "0.53276575", "text": "function getTouchTransformState(){\r\n return {\r\n rot: getTouchRotation(),\r\n dist: getTouchMedianDistance(),\r\n pos: getMedianPoint()\r\n };\r\n }", "title": "" }, { "docid": "7ac8204e68ce8d5d981215fa7d9ff025", "score": "0.532438", "text": "function savePositions() { \n\tvar all = document.querySelectorAll(\"[interaction=xy]\");\n\tvar count = all.length;\n\tfor(var index = 0; index < count; index++) {\n\t\tall[index].originx = all[index].style.left;\n\t\tall[index].originy = all[index].style.top\n\t}\n}", "title": "" }, { "docid": "d9bf649b311d413e313a530820110cd2", "score": "0.53225124", "text": "function move({ movementX: ejeX, movementY: ejeY }) {\r\n //devuelve los valores finales de las propiedades CSS del elemento actual.\r\n let extractData = window.getComputedStyle(wrapper);\r\n\r\n //convierte un tipo de dato String a Integer (número).\r\n //es decir me extrae el valor numero de la propiedad left o top de la clase wrapper y los convierte en número.\r\n let leftData = parseInt(extractData.left);\r\n let topData = parseInt(extractData.top);\r\n\r\n //esto me va sumar los valores de parseInt con el movimiento\r\n //es decir cada vez que me mueva en el eje x o y le va sumar o restar tanto left como top\r\n wrapper.style.left = `${leftData+ejeX}px`;\r\n wrapper.style.top = `${topData+ejeY}px`;\r\n}", "title": "" }, { "docid": "073c45d92210636204cdbde02923b11e", "score": "0.5321837", "text": "function getTouchPos(canvasDom, touchEvent) {\n var rect = canvasDom.getBoundingClientRect();\n console.log(touchEvent);\n return {\n x: touchEvent.targetTouches[0].clientX - rect.left,\n y: touchEvent.targetTouches[0].clientY - rect.top\n };\n }", "title": "" }, { "docid": "455096891d84a3abbcc9028e78597986", "score": "0.5313226", "text": "function computeMovement( x, y, previousPosition ) {\n\n\t\tvar mv = new THREE.Vector2(\n\t\t\tx - previousPosition.x, previousPosition.y - y );\n\n\t\tpreviousPosition.set( x, y );\n\n\t\treturn mv;\n\n\t}", "title": "" }, { "docid": "455096891d84a3abbcc9028e78597986", "score": "0.5313226", "text": "function computeMovement( x, y, previousPosition ) {\n\n\t\tvar mv = new THREE.Vector2(\n\t\t\tx - previousPosition.x, previousPosition.y - y );\n\n\t\tpreviousPosition.set( x, y );\n\n\t\treturn mv;\n\n\t}", "title": "" }, { "docid": "d6410966c6a8c4e5b1370a0c990ca691", "score": "0.5309908", "text": "function cursorPoint(event){\n pt.x = event.clientX; pt.y = event.clientY;\n return pt.matrixTransform(sourceElement.getScreenCTM().inverse());\n }", "title": "" }, { "docid": "da91dad32914db08f0c5a839a04afb9f", "score": "0.5297369", "text": "motion() {\n this.pX += this.mX;\n this.pY += this.mY;\n if (this.pX >= width - 115 || this.pX <= 115) {\n this.mX *= -1;\n }\n if (this.pY >= height - 65 || this.pY <= height - 160) {\n this.mY *= -1;\n }\n }", "title": "" }, { "docid": "7239da8c2c7b6b4f854dacaf165de6d6", "score": "0.52948266", "text": "function\n\ncalculateMousePos(evt) {\n let rect = canvas.getBoundingClientRect();\n let root = document.documentElement;\n let mouseX = evt.clientX - rect.left - root.scrollLeft;\n let mouseY = evt.clientY - rect.top - root.scrollTop;\n return {\n x: mouseX,\n y: mouseY\n }\n\n}", "title": "" }, { "docid": "2c731cc1a29636df49152b7755201adf", "score": "0.52947986", "text": "function relMouseCoords(event){\n var totalOffsetX = 0;\n var totalOffsetY = 0;\n var canvasX = 0;\n var canvasY = 0;\n var currentElement = this;\n do{\n totalOffsetX += currentElement.offsetLeft - currentElement.scrollLeft;\n totalOffsetY += currentElement.offsetTop - currentElement.scrollTop;\n }\n while(currentElement = currentElement.offsetParent)\n canvasX = event.pageX - totalOffsetX;\n canvasY = event.pageY - totalOffsetY;\n return {x:canvasX, y:canvasY}\n}", "title": "" }, { "docid": "f5f156e785004951f71fb436dfc6b8c8", "score": "0.5294787", "text": "updateTransition(d, i) {\n const { position } = d;\n const {x, y} = getPositionFlat(position);\n return {\n x: [x],\n y: [y],\n timing: {\n duration: ANIMATION_DURATIONS.MOVE_DURATION,\n },\n };\n }", "title": "" }, { "docid": "4fdad10d19914676fa686f7b438660a0", "score": "0.52930397", "text": "translateReduce(components, x, y) {\n $(components).css({\n \"-webkit-transform\": \"translate(\" + x + \"px,\" + y + \"px)\",\n \"-ms-transform\": \"translate(\" + x + \"px,\" + y + \"px)\",\n \"-moz-transform\": \"translate(\" + x + \"px,\" + y + \"px)\",\n \"transform\": \"translate(\" + x + \"px,\" + y + \"px)\"\n });\n }", "title": "" }, { "docid": "8a740e9465ddeda2eac208e572264a28", "score": "0.528519", "text": "getMousePos(e){\n let rect = this.canvas.getBoundingClientRect()\n return {\n x: e.clientX - rect.left, \n y: e.clientY - rect.top\n }\n }", "title": "" }, { "docid": "241f6044d5095be390c437e270d1c819", "score": "0.5281483", "text": "swipeMove(event) {\n if (this.touchStartCoords) {\n event = event ? event : window.event;\n const translate = event.pageX - this.touchStartCoords;\n this.results.style.transform = `translate3d(${itemService.translate + translate}px,0,0)`;\n } \n }", "title": "" }, { "docid": "58d450c86d3e95eb1cd14ddc2b0b23b7", "score": "0.5276462", "text": "function move(xx, yy){\n var temp = xx;\n xx = xVal + \"px\";\n xVal = parseInt(temp);\n temp = yy;\n yy = yVal +\"px\";\n yVal = parseInt(temp);\n return [xx, yy];\n}", "title": "" }, { "docid": "3dc4f08545a1407590d6f76cb235e466", "score": "0.52738965", "text": "setPosition() {\n \"use strict\";\n let domobject = this._html[0];\n domobject.style.transform = \"translate3d(\" + this._coord.pixel.x + \"px,\" + this._coord.pixel.y + \"px,0)\";\n }", "title": "" }, { "docid": "b49581332d0405157a468772391f341c", "score": "0.52735", "text": "function dragMoveListener(event) {\n var target = event.target\n // keep the dragged position in the data-x/data-y attributes\n x = (parseFloat(target.getAttribute('data-x')) || 0) + event.dx\n y = (parseFloat(target.getAttribute('data-y')) || 0) + event.dy\n\n // translate the element\n target.style.webkitTransform =\n target.style.transform =\n 'translate(' + x + 'px, ' + y + 'px)'\n\n // update the posiion attributes\n target.setAttribute('data-x', x)\n target.setAttribute('data-y', y)\n}", "title": "" }, { "docid": "58633f70558162f81e26d8f304aa624c", "score": "0.5270047", "text": "function getMousePosElement(e) {\n const rect = e.target.getBoundingClientRect();\n return [\n e.clientX - Math.floor(rect.left),\n e.clientY - Math.floor(rect.top)\n ];\n}", "title": "" }, { "docid": "5b124783275d38bdc53caa378a2b2cd8", "score": "0.52687186", "text": "function getCrossBrowserElementCoords(mouseEvent)\n {\n var result = {\n x: 0,\n y: 0\n };\n\n if (!mouseEvent) {\n mouseEvent = window.event;\n }\n\n if (mouseEvent.pageX || mouseEvent.pageY) {\n result.x = mouseEvent.pageX;\n result.y = mouseEvent.pageY;\n }\n else if (mouseEvent.clientX || mouseEvent.clientY) {\n result.x = mouseEvent.clientX + document.body.scrollLeft +\n document.documentElement.scrollLeft;\n result.y = mouseEvent.clientY + document.body.scrollTop +\n document.documentElement.scrollTop;\n }\n\n if (mouseEvent.target) {\n var offEl = mouseEvent.target;\n var offX = 0;\n var offY = 0;\n\n if (typeof(offEl.offsetParent) != \"undefined\") {\n while (offEl) {\n offX += offEl.offsetLeft;\n offY += offEl.offsetTop;\n\n offEl = offEl.offsetParent;\n }\n }\n else {\n offX = offEl.x;\n offY = offEl.y;\n }\n result.x -= offX;\n result.y -= offY;\n }\n return result;\n }", "title": "" }, { "docid": "a73c7c5fd166fac7a4a81e2293ac0e45", "score": "0.52673405", "text": "function relMouseCoords(event){\n var totalOffsetX = 0;\n var totalOffsetY = 0;\n var canvasX = 0;\n var canvasY = 0;\n var currentElement = $('#game')[0];\n do {\n totalOffsetX += currentElement.offsetLeft;\n totalOffsetY += currentElement.offsetTop;\n }\n while(currentElement = currentElement.offsetParent)\n\n canvasX = event.pageX - totalOffsetX;\n canvasY = event.pageY - totalOffsetY;\n return {x:canvasX, y:canvasY};\n}", "title": "" }, { "docid": "ce7c82a8065a89c68484407d32351225", "score": "0.5267194", "text": "mapToCam(x,y) {return { x: x - this.x, y: y - this.y };}", "title": "" }, { "docid": "53c4981900b43a7b6d06e92b8e8b23d7", "score": "0.5267015", "text": "function transformOrigin(xOffset, yOffset) {\n return xOffset + \" \" + yOffset;\n }", "title": "" }, { "docid": "72a2baf69911240a5f22e3f87bc04335", "score": "0.5259368", "text": "function getRelativeCoords(event) {\n var body = $(mainElement);\n var bodyX = body.offset().left;\n var bodyY = body.offset().top;\n\n return \"\" + String(Math.round(event.pageX-bodyX)) + \" \" + String(Math.round(event.pageY-bodyY));\n}", "title": "" }, { "docid": "7651345772031b43e8aa8b7b234a5e20", "score": "0.5259343", "text": "static getCoordsByCss(o){\n return [o.getAttributeNS(null,\"left\"), o.getAttributeNS(null,\"top\")];\n }", "title": "" }, { "docid": "fbf356b8be4b499c0fec22a6cbfdcd01", "score": "0.52592295", "text": "function obtenerCoordenadas () {\n\tespacioAux = espacio;\n\tespacioX=0;\n\tespacioY=0;\n\twhile (espacioAux.offsetParent) {\n\t espacioX += espacioAux.offsetLeft;\n\t\tespacioY += espacioAux.offsetTop;\n\t\tespacioAux = espacioAux.offsetParent;\n\t}\n}", "title": "" }, { "docid": "ea3cc7746d06f7d6b24776a60b4c3a33", "score": "0.52584773", "text": "function handleMouseMove(e) {\n var winWidth = window.innerWidth;\n var winHeight = window.innerHeight;\n var multiplier = 1.8; // parallax multiplier\n var rotY;\n var rotX;\n\n x = (e.clientX - (winWidth/2)) / 10;\n y = (e.clientY - (winHeight/2)) /10;\n\n rotationY = (e.clientX - (winWidth/2) );\n rotationX = (e.clientY - (winHeight/2) );\n\n // Turn neg to pos OR pos to neg\n rotY = rotationY/50;\n rotY = rotY < 0 ? Math.abs(rotY) : -Math.abs(rotY);\n\n rotX = rotationX/50;\n rotX = rotX < 0 ? Math.abs(rotX) : -Math.abs(rotX);\n\n // Tilt with tween\n TweenMax.to( tiltElements, 0.2, {\n rotationY: rotationY/12,\n rotationX: rotationX/12,\n transformOrigin:\"center center\", \n transformPerspective: 1200,\n transformStyle:'preserve-3d'\n });\n}", "title": "" }, { "docid": "d7f3ba0661edc628465946af15b68e6e", "score": "0.52571106", "text": "getPosition() {\n const prect = this.node.parentNode.getBoundingClientRect();\n const rect = this.node.getBoundingClientRect();\n return {\n x: rect.x - prect.x, y: rect.y - prect.y,\n w: rect.width,\n h: rect.height,\n };\n }", "title": "" }, { "docid": "14bf3e234d2eaf5759c74e9ffa5f029f", "score": "0.52493817", "text": "function touchMove(event) {\n if (isDragging) {\n const currentPosition = getPositionX(event);\n currentTranslate = prevTranslate + currentPosition - startPosition;\n }\n }", "title": "" }, { "docid": "f0df8659e6b0ba6b92fb91b60571aa85", "score": "0.5248158", "text": "function translateDirectionToDelta (direction) {\n\n let x, y\n\n switch (direction) {\n case 1:\n x = 0\n y = -1\n break\n\n case 2:\n x = 1\n y = -1\n break\n\n case 3:\n x = 1\n y = 0\n break\n\n case 4:\n x = 1\n y = 1\n break\n\n case 5:\n x = 0\n y = 1\n break\n\n case 6:\n x = -1\n y = 1\n break\n\n case 7:\n x = -1\n y = 0\n break\n\n case 8:\n x = -1\n y = -1\n break\n\n default:\n console.log('something went wrong in direction switch')\n }\n return [ x, y ]\n }", "title": "" }, { "docid": "4a7b880b32e801e3b69d8cad0c52fe34", "score": "0.5246805", "text": "function relMouseCoords(event){\r\n var totalOffsetX = 0;\r\n var totalOffsetY = 0;\r\n var canvasX = 0;\r\n var canvasY = 0;\r\n var currentElement = this;\r\n\r\n do{\r\n totalOffsetX += currentElement.offsetLeft - currentElement.scrollLeft;\r\n totalOffsetY += currentElement.offsetTop - currentElement.scrollTop;\r\n }\r\n while(currentElement = currentElement.offsetParent)\r\n\r\n canvasX = event.pageX - totalOffsetX;\r\n canvasY = event.pageY - totalOffsetY;\r\n\r\n return {x:canvasX, y:canvasY}\r\n}", "title": "" }, { "docid": "8d9211860fd2f718d0b17a28c4dc92e0", "score": "0.52453184", "text": "function getTooltipPosition(target) {\n\n var boundingBox = insight.utils.getSVGBoundingBox(target);\n\n var offset = self.offset();\n\n var y = boundingBox.n.y - self.element.offsetHeight;\n var x = boundingBox.n.x - self.element.offsetWidth / 2;\n\n y = y + offset.y;\n x = x + offset.x;\n\n return {\n x: x,\n y: y\n };\n }", "title": "" }, { "docid": "f628a15ab751ef52bb951daff05dfca1", "score": "0.524059", "text": "function valuesFromMotion(e) {\n x = e.gamma;\n y = e.beta;\n\n // Swap x and y in Landscape orientation\n if (Math.abs(window.orientation) === 90) {\n var a = x;\n x = y;\n y = a;\n }\n\n // Invert x and y in upsidedown orientations\n if (window.orientation < 0) {\n x = -x;\n y = -y;\n }\n\n motionStartX = (motionStartX === null) ? x : motionStartX;\n motionStartY = (motionStartY === null) ? y : motionStartY;\n\n return {\n x: x - motionStartX,\n y: y - motionStartY\n };\n }", "title": "" }, { "docid": "8f1b573f14c9e11aaf684d8559fc6537", "score": "0.5239167", "text": "pos() {\n var gotPos = getPos(this.sprite);\n gotPos.x-=.5;\n return gotPos;\n }", "title": "" }, { "docid": "e2b83ca6ad626b093898608362b53813", "score": "0.523571", "text": "getScrollPosition() {\n if (this.supportsScrolling()) {\n return [this.window.pageXOffset, this.window.pageYOffset];\n } else {\n return [0, 0];\n }\n }", "title": "" }, { "docid": "e2b83ca6ad626b093898608362b53813", "score": "0.523571", "text": "getScrollPosition() {\n if (this.supportsScrolling()) {\n return [this.window.pageXOffset, this.window.pageYOffset];\n } else {\n return [0, 0];\n }\n }", "title": "" }, { "docid": "9784f363b3a32ca919ac6ceba6bd47cd", "score": "0.5233549", "text": "getOffset(){\n return {x:this._dx,y:this._dy};\n }", "title": "" }, { "docid": "f4b214eb1474e937cec0862779fd5a35", "score": "0.523024", "text": "function getElCoords(el) {\n el = el.className;\n var parts = el.split('-')\n var pos = { i: +parts[1], j: +parts[2] };\n return pos;\n}", "title": "" }, { "docid": "157bbafb540cb214dad5eb04b37b7407", "score": "0.52291685", "text": "function gpos(x, y) {\n return \"translate(\" + x + \",\" + y + \")\";\n}", "title": "" }, { "docid": "655487ed9b90f88740969814d68a82f4", "score": "0.52282536", "text": "function getActualTarget() {\r\n var scrollX = window.scrollX,\r\n scrollY = window.scrollY;\r\n\r\n // IE is stupid and doesn't support scrollX/Y\r\n if(scrollX === undefined){\r\n scrollX = d.body.scrollLeft;\r\n scrollY = d.body.scrollTop;\r\n }\r\n\r\n return d.elementFromPoint(this.pageX - window.scrollX, this.pageY - window.scrollY);\r\n}", "title": "" } ]
798991f4a0e5d7517fcae294b2db5caf
Calculates box size and creates divs accordingly
[ { "docid": "8b2e683a9b06fefab03f2acd300192a5", "score": "0.0", "text": "function displayGrid(columns) {\n var grid = $(\".grid\").html(\"\");\n var boxSize = grid.width() / columns - 2;\n for (var i = 0; i < columns; i++) {\n for (var j = 0; j < columns; j++) {\n grid.append($(\"<div class='square'></div>\").height(boxSize).width(boxSize));\n }\n }\n $(\"#text\").attr(\"placeholder\", \"How many columns? (1-99)\");\n}", "title": "" } ]
[ { "docid": "2184837ce3cf5794e9be9e49361a85db", "score": "0.7083457", "text": "function createDivBox(sizes) {\n var divBox = new HtmlElement({tagName:\"div\",className:\"box\",AttributeName:\"data-after\"})\n .createHtml(sizes);\n return divBox.htmlElement;\n }", "title": "" }, { "docid": "38acb686bbf12a21b69c6275acc61710", "score": "0.68525094", "text": "function bild(boxes){\r\n\t\tvar wid = ($('#base').width()-boxes*2-15)/(boxes); //gjendet hapsira qe duhet te ket cdo div //nga gjeresia e divit kryesor hiqet dhe gjeresia qe zen pixels\r\n\r\n\t\tfor (var i = 0; i < boxes; i++) {\r\n\t\t\tfor (var j = 0; j < boxes; j++) {\r\n\t\t\t\t$(\"#base\").append(\"<div class='test'></div>\");\r\n\t\t\t};\r\n\t\t\t//$(\"#base\").append(\"<br>\");\r\n\t\t};\t\r\n\t\t$('.test').css('width',wid);//cdo div i shtuar do e ket gjeresin nga formula qe llogaritem siper\r\n\t\t$('.test').css('height',wid);//lartesia do jet e njejte me gjeresin meqnse kemi katror\r\n\t\t\r\n\t}", "title": "" }, { "docid": "34301d097debd987540e5d132b731d50", "score": "0.6796028", "text": "function buildBox(r,c){\n\t\t$('.tabl').empty();\n\t\tfor(var i=1; i<= r; i++){\n\t\t\t$('.tabl').append('<tr class=\"row\"></tr>');\n\t\t};\n\t\tfor(var j=1; j<= c; j++){\n\t\t\t$('.row').append('<td class=\"box\">&nbsp</td>');\t\n\t\t};\n\t\tvar height = $('.bigBox').width()/r;\n \t\t$('.row').css({'height': height});\n \t\t$('.box').css({'width': height});\n \t\tif(r>16){\n \t\t\t$('.box').css({\"font-size\": \"0\"});\n \t\t}\n\n\t}", "title": "" }, { "docid": "81b3c1cab7e0003400a8f2f28d989684", "score": "0.6786934", "text": "function gridSize (size) {\n\n for (let i = 0; i < size; i++)\n {\n let rowDiv = document.createElement('div');\n rowDiv.setAttribute('class', 'row');\n gridBox.appendChild(rowDiv);\n \n for (let j = 0; j < size; j++)\n {\n let colDiv = document.createElement('div');\n colDiv.setAttribute('class', 'column');\n rowDiv.appendChild(colDiv);\n }\n }\n const rowStyle = document.querySelectorAll('.row');\n\n rowStyle.forEach(el => {\n el.style.display = 'flex';\n el.style.width = '100%' ;\n el.style.height = '100%';\n });\n\n const columnStyle = document.querySelectorAll('.column');\n\n columnStyle.forEach(el => {\n el.style.width = '100%';\n el.style.height = '100%';\n el.style.border = '0.5px solid black';\n });\n}", "title": "" }, { "docid": "b932ca118e052b60efd127bf87b665e5", "score": "0.67689353", "text": "function createGrid () {\n\tfor (var rows = 0; rows < size; rows++) {\n\t\tfor (var columns = 0; columns < size; columns++) {\n\t\t\t$(\"#container\").append(\"<div class='grid' x='\" + columns + \"' y='\" + rows + \"'><span></span></div>\");\n\t\t}\n\t}\n\n\tvalue = 480 / size; \t\n\tfontSize = 120;\n\n\t$(\".grid\").width(value);\n\t$(\".grid span\").width(value);\n\t$(\".grid\").height(value);\n\t$(\".grid\").css(\"fontSize\", (fontSize/size));\n\tinitNumbers();\n\tcreateArray();\t\n}", "title": "" }, { "docid": "3b92bc33f30131e2cf6a39c0d63836aa", "score": "0.6719558", "text": "function boxResize() {\r\n let scaling = (window.innerHeight < window.innerWidth) ? 'vh' : 'vw';\r\n for (let i = 0; i < taskList.tasks.length; i++) {\r\n let boxRef = document.getElementById(`box${i}`);\r\n let textRef = document.getElementById(`text${i}`);\r\n boxRef.style.width = `${sideLength}${scaling}`;\r\n boxRef.style.height = `${sideLength}${scaling}`;\r\n textRef.style.fontSize = `${sideLength*0.135}${scaling}`;\r\n }\r\n}", "title": "" }, { "docid": "6b9ecd9d95bd8e413e08edf1be847d86", "score": "0.671087", "text": "function resizeBoxes() {\n\n // TODO clean this up it looks stupid\n if (screenIsVertical()) {\n leftBox.style.width = \"80vw\";\n rightBox.style.width = \"80vw\";\n leftBox.style.height = \"20vh\";\n rightBox.style.height = \"20vh\";\n leftBox.style.left = \"10vw\";\n rightBox.style.left = \"10vw\";\n leftBox.style.top = \"2.5vh\";\n rightBox.style.top = \"77.5vh\";\n } else {\n leftBox.style.width = \"20vw\";\n rightBox.style.width = \"20vw\";\n leftBox.style.height = \"80vh\";\n rightBox.style.height = \"80vh\";\n leftBox.style.left = \"2.5vw\";\n rightBox.style.left = \"77.5vw\";\n leftBox.style.top = \"10vh\";\n rightBox.style.top = \"10vh\";\n }\n}", "title": "" }, { "docid": "ffcce18c0a5a05fe1ab50396f57b6540", "score": "0.6615801", "text": "function postGetBlockSizes() {\r\n\t\t$(\"#stringInputArea\").css(\"height\", (((document.body.clientHeight)/2)-100) + \"px\");\r\n\t\t$(\"#resultArea\").css(\"height\", ((document.body.clientHeight)/2-40 -8 ) + \"px\");\r\n\t\t$(\"#resultArea-incolor\").css(\"height\", ((document.body.clientHeight)/2-40 -2 ) + \"px\");\r\n\t\t//console.log($(\"#render-envelope\").css(\"width\"));\r\n\t}", "title": "" }, { "docid": "957d8264a01ab4de422ffab91129e275", "score": "0.660535", "text": "function initBoxes() {\n\t$(\".box\").each(function() {\n\t\tfor (var i = 0; i < numCells; i++) {\n\t\t\tfor (var j = 0; j < numCells; j++) {\n\t\t\t\t$(this).append(\"<div class='box-cell' data-x='\"+j+\"' data-y='\"+i+\"' style='width:\"+boxCellSize+\";height:\"+boxCellSize+\";'></div>\");\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "ec6143b5661174a5335df47569986ea9", "score": "0.65287393", "text": "createBoxes() {\n const params = [['start', 'resize'], ['end', 'resize'], ['center', 'move']];\n params.forEach(([position, type]) => {\n // create box\n const editBox = document.createElement('div');\n editBox.id = position;\n editBox.className = `${type}-box box`;\n\n // push it to the desired position\n const [x, y] = state.drawing[position];\n editBox.style.left = `${x + boxOffset}px`;\n editBox.style.top = `${y + boxOffset}px`;\n drawingArea.appendChild(editBox);\n\n // prevent context menu from opening on boxes\n editBox.addEventListener('contextmenu', event => event.preventDefault());\n\n // keep track of created boxes\n editBoxManager.boxes.push(editBox);\n });\n }", "title": "" }, { "docid": "9514eeb65e22630e31b0a9d8f701bb41", "score": "0.65198606", "text": "function getSize(){\n\t//jquery gave most accurate window dimesnions\n\twidth = $(window).width();\n height = $(window).height();\n //the starting point of the players box\n x = width/2;\n\ty = height/2;\n\t//the size of the box itself\n\tsize = height /20;\n\n\t//Intialize squareobject to move around screen\n\tcube = new SquareObj(\"ff0000\",x,y,size);\n}", "title": "" }, { "docid": "15512c010a1f582ebb8eb746e30f5bde", "score": "0.65136415", "text": "function restyle(numberofBoxes){\n //Set width and height css value for '.box' divs\n $('.box').css('width', (100/numberofBoxes)+'%');\n $('.box').css('height', (100/numberofBoxes)+'%');\n }", "title": "" }, { "docid": "6ca4f154d3d17a5627b57e0e0bec021d", "score": "0.6512116", "text": "function createDivs (rows, columns) {\n container.innerHTML = \" \";\n let amountOfDivs = rows*columns; \n\n for (let i = 0 ; i < amountOfDivs ; i++) {\n let div = document.createElement('div');\n div.className = \"box\";\n container.appendChild(div);\n }\n gridTemplate(rows, columns);\n blackBox();\n}", "title": "" }, { "docid": "440af7e9bf20d0a6302316011a25d460", "score": "0.6459817", "text": "function make_boxes(rows, cols) {\n container.style.setProperty('--grid-rows', rows);\n container.style.setProperty('--grid-cols', cols);\n for (let i = 0; i < (rows*cols); i++){\n let cell = document.createElement('div');\n cell.className = \"cell\"\n container.appendChild(cell);\n };\n black();\n}", "title": "" }, { "docid": "518956e836290302f8fc2840e04a906c", "score": "0.6452726", "text": "function setHeightBoxs() {\n 'use strict';\n var re;\n for (re = 0; re < boxsmq.length; re++) {\n boxsmq[re].style.height = boxsmq[re].offsetWidth + 'px';\n }\n}", "title": "" }, { "docid": "56b77560732c1047451575658ed212cf", "score": "0.6421594", "text": "function changeSize(val) {\n var s = String(val).split(\",\");\n viz_container.transition().duration(300).style('width', s[0] + 'px').style('height', s[1] + 'px');\n\n var divWidth = s[0] * 0.80 / 4;\n\n divs.forEach(function (div,i) {\n div.style(\"width\",divWidth + 'px').style(\"margin-left\", (s[0] *.05) + \"px\");\n vizs[i].width(divWidth).height(divWidth).radius(divWidth/2.2).update();\n })\n\n}", "title": "" }, { "docid": "b23ce8e10d74cebe2bf50a90daed5978", "score": "0.6416404", "text": "function createBox() {\n images = mix(images);\n for (var i = 0; i < boxCount; i++) {\n var creatingPositions = new Vector2(windowWidth / 8 + (i * windowWidth / 8), windowHeight / 2);\n boxes[i] = new Box(images[i], creatingPositions);\n }\n}", "title": "" }, { "docid": "ad329f5ff544ab500963266291ab2012", "score": "0.6398406", "text": "function updateBoxSize() {\n\t\t\t\t\tvar boxX,\n\t\t\t\t\t\tboxY,\n\t\t\t\t\t\tstyle = text.element.style;\n\t\n\t\t\t\t\tbBox = (width === undefined || height === undefined || wrapper.styles.textAlign) && defined(text.textStr) && \n\t\t\t\t\t\ttext.getBBox(); //#3295 && 3514 box failure when string equals 0\n\t\t\t\t\twrapper.width = (width || bBox.width || 0) + 2 * padding + paddingLeft;\n\t\t\t\t\twrapper.height = (height || bBox.height || 0) + 2 * padding;\n\t\n\t\t\t\t\t// update the label-scoped y offset\n\t\t\t\t\tbaselineOffset = padding + renderer.fontMetrics(style && style.fontSize, text).b;\n\t\n\t\t\t\t\t\n\t\t\t\t\tif (needsBox) {\n\t\n\t\t\t\t\t\t// create the border box if it is not already present\n\t\t\t\t\t\tif (!box) {\n\t\t\t\t\t\t\tboxX = mathRound(-alignFactor * padding) + crispAdjust;\n\t\t\t\t\t\t\tboxY = (baseline ? -baselineOffset : 0) + crispAdjust;\n\t\n\t\t\t\t\t\t\twrapper.box = box = shape ?\n\t\t\t\t\t\t\t\trenderer.symbol(shape, boxX, boxY, wrapper.width, wrapper.height, deferredAttr) :\n\t\t\t\t\t\t\t\trenderer.rect(boxX, boxY, wrapper.width, wrapper.height, 0, deferredAttr[STROKE_WIDTH]);\n\t\t\t\t\t\t\tbox.attr('fill', NONE).add(wrapper);\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t// apply the box attributes\n\t\t\t\t\t\tif (!box.isImg) { // #1630\n\t\t\t\t\t\t\tbox.attr(extend({\n\t\t\t\t\t\t\t\twidth: mathRound(wrapper.width),\n\t\t\t\t\t\t\t\theight: mathRound(wrapper.height)\n\t\t\t\t\t\t\t}, deferredAttr));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdeferredAttr = null;\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" }, { "docid": "89cd7bbe7b4474764837f4c2f98aceab", "score": "0.6391667", "text": "generateBoxes(state) {\n while (this.element.children.length > 0) {\n this.element.removeChild(this.element.firstChild);\n }\n\n // Bikin box kiri & kanan\n const leftBox = document.createElement('div');\n leftBox.addEventListener('click', this.handleBoxClick);\n leftBox.id = 'left-box';\n this.element.appendChild(leftBox);\n\n const rightBox = document.createElement('div');\n rightBox.addEventListener('click', this.handleBoxClick);\n rightBox.id = 'right-box';\n this.element.appendChild(rightBox);\n\n this.leftBox = leftBox;\n this.rightBox = rightBox;\n\n this.assignColors(state);\n }", "title": "" }, { "docid": "2176f22f0806d6fb7b4d9c5919b81606", "score": "0.6361061", "text": "addBox() {\n // Create new box and set properties for it\n const box = document.createElement('div');\n box.classList.add('main-draggable-box');\n box.style.width = `calc(${this.boxDimensions}% - 20px)`;\n box.style.height = `calc(${this.boxDimensions}% - 20px)`;\n box.setAttribute('data-order', this.boxesOrderCounter);\n // Check if we already have a box with this properties and if not set them and break the loop\n for (let i = 0; i < this.boxesProperties.length; i++) {\n if (this.initializedProperties.indexOf(this.boxesProperties[i]['name']) == -1 ) {\n this.boxesPlaceholder.push(box);\n box.setAttribute('data-name', this.boxesProperties[i]['name']);\n box.style.backgroundColor = this.boxesProperties[i]['color'];\n box.innerHTML = `<p>${this.boxesProperties[i]['name']}</p>`;\n this.initializedPropertiesCounter++;\n this.boxesOrderCounter++;\n this.targetContainer.appendChild(box);\n this.reorderBoxes(0);\n break;\n }\n }\n }", "title": "" }, { "docid": "a5a81449cac1c40bd91fb7a859280ed4", "score": "0.6345629", "text": "function makeBig(){\n divSize *= 1.1;\n\n newDiv.style.height = divSize + \"px\";\n newDiv.style.width = divSize + \"px\";\n console.log(newDiv.style.height);\n}", "title": "" }, { "docid": "850c727460e4e61af0e6b5c104639b73", "score": "0.6343023", "text": "function createBoxes(gridSize, cssBoxBorderWidth) {\n for (i = 0; i < (gridSize * gridSize); i++) {\n const box = document.createElement('div');\n // show box border\n box.setAttribute('style', `border-width: ${cssBoxBorderWidth};`);\n box.classList.add('box');\n container.appendChild(box);\n }\n\n boxes = Array.from(document.querySelectorAll('.box'));\n boxes.forEach(box => box.addEventListener('mouseover', trail));\n}", "title": "" }, { "docid": "7ff982b57e89f5462ddefa79175c7927", "score": "0.63342327", "text": "function getGridDivStylesForRegion(aspect_x, aspect_y, n_boxes, screen_x, screen_y, top_left_x, top_left_y, screen_px_x, screen_px_y) {\n var dims = getGridDims(aspect_x, aspect_y, n_boxes, screen_px_x, screen_px_y);\n var w = dims[0];\n var h = dims[1];\n var n_grid_points = w * h;\n var fits = w * h >= n_boxes;\n var styles = [];\n\n console.log(n_boxes + \" box(es) (cols x rows) == (\" + w + \" x \" + h + \") (\" + fits + \")\");\n if (!fits)\n alert(\"Boxes wont fit!\");\n\n // calculate which rows should have a different effective size,\n // due to empty grid elements.\n var modified_size_rows = {};\n var n_modified_rows = (n_grid_points - n_boxes);\n var n_top_modified_rows;\n var n_btm_modified_rows;\n\n // if more rows are modified, then put unmodified rows between\n // the modified rows because it looks nicer. otherwise, put the\n // modified rows between the unmodified rows\n if (n_modified_rows > h - n_modified_rows)\n n_top_modified_rows = Math.floor((h - 1) / 2);\n else\n n_top_modified_rows = Math.ceil(n_modified_rows / 2);\n\n n_btm_modified_rows = n_modified_rows - n_top_modified_rows;\n var i;\n for (i = 0; i < n_top_modified_rows; i++){\n modified_size_rows[i] = true;\n }\n for (i = 0; i < n_btm_modified_rows; i++){\n modified_size_rows[h - 1 - i] = true;\n }\n for (var r = 0; r < h; r++) {\n for (var c = 0; c < w; c++) {\n if (styles.length < n_boxes) {\n var style = {};\n\n var effective_h = h;\n var effective_w = w;\n\n if (r in modified_size_rows)\n effective_w--;\n\n var width = screen_x / effective_w;\n var height = screen_y / effective_h;\n var left = c * width;\n var top = r * height;\n\n // a change in effective height or width would push this grid item\n // off the screen, so we can move it to the next row. Add a pertubation\n // to avoid issues with float arithmetic\n if (left + width > screen_x + 0.0001 || top + height > screen_y + 0.0001)\n continue;\n\n style.width = width + '%';\n style.height = height + '%';\n style.top = top + top_left_y + '%';\n style.left = left + top_left_x + '%';\n style.position = 'absolute';\n styles.push(style);\n }\n }\n }\n return styles;\n}", "title": "" }, { "docid": "25e5fa0d11703eddc4f1d78b55cf4d4d", "score": "0.63281065", "text": "function createBox(gridStyle,gridSize) {\n\t\tfor(let i = 0; i<(gridSize*gridSize); i++) {\n\n\t\t\tconst box = document.createElement(\"li\");\n\t\t\tconst grid = document.getElementsByClassName(\"gameBoard\")[0];\n\n\t\t// Add class that captures grid size to the box\n\t\t\tbox.classList.add(\"box\");\n\t\t\tgrid.setAttribute(\"style\",gridStyle);\n\t\t\tgrid.appendChild(box);\n\t\t\t// box.innerHTML=i;\n\t\t}\n\t}", "title": "" }, { "docid": "276b9f100ea0dbeed5ca2aeba33c8bb6", "score": "0.63082075", "text": "drawSizeBoxes(ctx, c) {\n // Draw the panel text offset above and left of the middle box column\n const panelPos = this.boxPosition(1, c, this.sz);\n ctx.font = this.sz.textFont;\n ctx.fillStyle = this.sz.textColour;\n ctx.fillText(this.sz.text, panelPos.x - this.sz.textXOffset, panelPos.y - this.sz.textYOffset);\n\n for (let i = 0; i < this.sz.count; i++) {\n const pos = this.boxPosition(i, c, this.sz);\n drawBox(ctx, pos.x, pos.y, this.sz.size, this.sz.size, this.sz.borderWidth, this.sz.boxColour);\n\n // Draw selection highlight for currently selected brush size\n if (this.brushSizeIndex === i) {\n drawBox(\n ctx,\n pos.x + this.sz.selectedPadding,\n pos.y + this.sz.selectedPadding,\n this.sz.size - (this.sz.selectedPadding * 2.0),\n this.sz.size - (this.sz.selectedPadding * 2.0),\n this.sz.selectedBorderWidth,\n this.sz.selectedColour\n );\n }\n\n // Draw scaled shape at center of box\n const centerX = pos.x + (this.sz.size / 2.0);\n const centerY = pos.y + (this.sz.size / 2.0);\n ctx.beginPath();\n ctx.fillStyle = this.sz.shapeColour;\n this.drawBrush(ctx, centerX, centerY, this.scaledBrushSize(i));\n ctx.fill();\n }\n }", "title": "" }, { "docid": "b5863edc9046cbc17e7b3b58033595a6", "score": "0.6307848", "text": "function prototypeBoxes () {\n var sizes = [\"short\", \"medium\", \"long\"];\n var count = 0;\n var file = getFile('components/box.html');\n for (let j = 0; j < 20; j = j + 5)\n {\n for (let i = 0; i < 5; i++)\n {\n document.querySelector(\"#row\" + math.englishify(count)).innerHTML += eval('`' + file + '`');\n }\n count++;\n }\n}", "title": "" }, { "docid": "7f896e1d65aa953c3f041df24e445d8c", "score": "0.6304476", "text": "function getBox(width, height) {\n return {\n string: \"+\",\n style: \"font-size: 1px; padding: \" + Math.floor(height/2) + \"px \" + Math.floor(width/2) + \"px; line-height: \" + height + \"px;\"\n }\n }", "title": "" }, { "docid": "4dbbcc4914baac4c65c570ec968c8cd5", "score": "0.6298062", "text": "function sizeGrid() {\n var eachSize = gridSize / squareCount;\n $('.square').css({\n 'height': eachSize,\n 'width': eachSize\n });\n }", "title": "" }, { "docid": "c225437dd5798880cec9909fb50c138c", "score": "0.6292661", "text": "function generateRoundedBox() {\n var tabbedBoxContent = \".tabbed-content .box-content\";\n $(tabbedBoxContent).each(function () {\n $(this).find(\"blockquote\").each(function () {\n makeBoxes($(this));\n });\n });\n }", "title": "" }, { "docid": "6bbe6be7011b9d8c4388cbe12449add5", "score": "0.6251309", "text": "function updateBoxSize() {\n\t\t\tvar boxX,\n\t\t\t\tboxY,\n\t\t\t\tstyle = text.element.style;\n\n\t\t\tbBox = (width === undefined || height === undefined || wrapper.styles.textAlign) &&\n\t\t\t\ttext.getBBox();\n\t\t\twrapper.width = (width || bBox.width || 0) + 2 * padding + paddingLeft;\n\t\t\twrapper.height = (height || bBox.height || 0) + 2 * padding;\n\n\t\t\t// update the label-scoped y offset\n\t\t\tbaselineOffset = padding + renderer.fontMetrics(style && style.fontSize).b;\n\n\t\t\tif (needsBox) {\n\n\t\t\t\t// create the border box if it is not already present\n\t\t\t\tif (!box) {\n\t\t\t\t\tboxX = mathRound(-alignFactor * padding);\n\t\t\t\t\tboxY = baseline ? -baselineOffset : 0;\n\n\t\t\t\t\twrapper.box = box = shape ?\n\t\t\t\t\t\trenderer.symbol(shape, boxX, boxY, wrapper.width, wrapper.height, deferredAttr) :\n\t\t\t\t\t\trenderer.rect(boxX, boxY, wrapper.width, wrapper.height, 0, deferredAttr[STROKE_WIDTH]);\n\t\t\t\t\tbox.add(wrapper);\n\t\t\t\t}\n\n\t\t\t\t// apply the box attributes\n\t\t\t\tif (!box.isImg) { // #1630\n\t\t\t\t\tbox.attr(merge({\n\t\t\t\t\t\twidth: wrapper.width,\n\t\t\t\t\t\theight: wrapper.height\n\t\t\t\t\t}, deferredAttr));\n\t\t\t\t}\n\t\t\t\tdeferredAttr = null;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "352bfde612cb2c9b5721c8c5383b448a", "score": "0.6244252", "text": "function updateBoxSize() {\n\t\t\tvar boxX,\n\t\t\t\tboxY,\n\t\t\t\tstyle = text.element.style;\n\n\t\t\tbBox = (width === undefined || height === undefined || wrapper.styles.textAlign) && text.textStr && \n\t\t\t\ttext.getBBox();\n\t\t\twrapper.width = (width || bBox.width || 0) + 2 * padding + paddingLeft;\n\t\t\twrapper.height = (height || bBox.height || 0) + 2 * padding;\n\n\t\t\t// update the label-scoped y offset\n\t\t\tbaselineOffset = padding + renderer.fontMetrics(style && style.fontSize).b;\n\n\t\t\tif (needsBox) {\n\n\t\t\t\t// create the border box if it is not already present\n\t\t\t\tif (!box) {\n\t\t\t\t\tboxX = mathRound(-alignFactor * padding);\n\t\t\t\t\tboxY = baseline ? -baselineOffset : 0;\n\n\t\t\t\t\twrapper.box = box = shape ?\n\t\t\t\t\t\trenderer.symbol(shape, boxX, boxY, wrapper.width, wrapper.height, deferredAttr) :\n\t\t\t\t\t\trenderer.rect(boxX, boxY, wrapper.width, wrapper.height, 0, deferredAttr[STROKE_WIDTH]);\n\t\t\t\t\tbox.attr('fill', NONE).add(wrapper);\n\t\t\t\t}\n\n\t\t\t\t// apply the box attributes\n\t\t\t\tif (!box.isImg) { // #1630\n\t\t\t\t\tbox.attr(merge({\n\t\t\t\t\t\twidth: wrapper.width,\n\t\t\t\t\t\theight: wrapper.height\n\t\t\t\t\t}, deferredAttr));\n\t\t\t\t}\n\t\t\t\tdeferredAttr = null;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "17c7a003119d072c2955ad6b72dc95d4", "score": "0.6243456", "text": "function createCubeDOM() {\r\n const boxSize = 9;\r\n let wrapper = createDIV(WRAPPER);\r\n for (let i = 0; i < boxSize; i++) {\r\n wrapper.append(createDIV(COLORBOX));\r\n }\r\n return wrapper;\r\n}", "title": "" }, { "docid": "fd11806bae4a7aa7e2ac854701c293c6", "score": "0.62432677", "text": "function volumeOfBox(sizes) {\r\n return sizes.width * sizes.length * sizes.height;\r\n}", "title": "" }, { "docid": "505f3e4e15d61fa7a20aad3ea5641314", "score": "0.62417114", "text": "function calcElementsSize(){\n\tvar bodyHeight = window.innerHeight;\n\t// partimos del ancho como referencia para obtener cosas \"cuadradas\"\n\tvar boardWidth = $('.shop').width();\n\t\n\tvar pickWidth = $('.item .pick').width();\n\t\n\t$('.item .pick').css({'height':pickWidth+'px'});\n\t$('.item').css({'height':pickWidth+'px'});\n\t\n\t$('.item .info, .item .button').css({'font-size':pickWidth/4+'px'});\n\t$('.item .info, .item .button').css({'line-height':pickWidth/4+'px'});\n\t\n\t$('.item .info .name').css({'height':(pickWidth/4)*3+'px'});\n\t$('.item .info .value').css({'height':pickWidth/4+'px'});\n\t\n\t$('.item .button').css({'margin-top':(pickWidth/2-$('.item .button').height()/2-3)+'px'});\n\t\n\tvar navigationHeight = $('.navigation').height();\n\tvar itemListHeight = bodyHeight - navigationHeight;\n\t$('.items-list').css({'height':itemListHeight+'px'});\n\t// Asignamos el height deseado a las fuentes\n\t\n\t$('.shop .money-gold, .shop .money-silver, .shop .money-copper').css({'background-size':(pickWidth/4)+'px '+(pickWidth/4)+'px'});\n\t$('.shop .money-gold, .shop .money-silver, .shop .money-copper').css({'padding-right':(pickWidth/4)+'px'});\n\t\n\t$('body').css({'font-size':((boardWidth*1/5)/3)+'px'});\n\t\n\t// ELEMENTOS DE DETALLE\n\tvar boardWidth = $('.detail-panel').width();\n\t// Asignamos el height deseado a las fuentes\n\t$('.detail-panel').css({'font-size':((boardWidth*1/4)/4)+'px'});\n\t$('.detail-panel').css({'line-height':(((boardWidth*1/4)/4)+2)+'px'});\n\t$('.detail-panel .money-gold, .detail-panel .money-silver, .detail-panel .money-copper').css({'background-size':((boardWidth*1/4)/4)+'px '+((boardWidth*1/4)/4)+'px'});\n\t$('.detail-panel .money-gold, .detail-panel .money-silver, .detail-panel .money-copper').css({'padding-right':((boardWidth*1/4)/4)+'px'});\n}", "title": "" }, { "docid": "c236bf5f07f473499f6fcfd78133c5c0", "score": "0.62330616", "text": "function updateBoxSize() {\n\t\t\tvar boxX,\n\t\t\t\tboxY,\n\t\t\t\tstyle = text.element.style;\n\n\t\t\tbBox = (width === undefined || height === undefined || wrapper.styles.textAlign) && text.textStr && \n\t\t\t\ttext.getBBox();\n\t\t\twrapper.width = (width || bBox.width || 0) + 2 * padding + paddingLeft;\n\t\t\twrapper.height = (height || bBox.height || 0) + 2 * padding;\n\n\t\t\t// update the label-scoped y offset\n\t\t\tbaselineOffset = padding + renderer.fontMetrics(style && style.fontSize).b;\n\n\t\t\t\n\t\t\tif (needsBox) {\n\n\t\t\t\t// create the border box if it is not already present\n\t\t\t\tif (!box) {\n\t\t\t\t\tboxX = mathRound(-alignFactor * padding);\n\t\t\t\t\tboxY = baseline ? -baselineOffset : 0;\n\n\t\t\t\t\twrapper.box = box = shape ?\n\t\t\t\t\t\trenderer.symbol(shape, boxX, boxY, wrapper.width, wrapper.height, deferredAttr) :\n\t\t\t\t\t\trenderer.rect(boxX, boxY, wrapper.width, wrapper.height, 0, deferredAttr[STROKE_WIDTH]);\n\t\t\t\t\tbox.attr('fill', NONE).add(wrapper);\n\t\t\t\t}\n\n\t\t\t\t// apply the box attributes\n\t\t\t\tif (!box.isImg) { // #1630\n\t\t\t\t\tbox.attr(extend({\n\t\t\t\t\t\twidth: mathRound(wrapper.width),\n\t\t\t\t\t\theight: mathRound(wrapper.height)\n\t\t\t\t\t}, deferredAttr));\n\t\t\t\t}\n\t\t\t\tdeferredAttr = null;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "bce66b688751327d267d004e97cb41ea", "score": "0.62262046", "text": "function createGrid(size, hoverStyle) {\n for (i = 0; i < size * size; i++) {\n var row = '<div class=\"square\">'+'</div>';\n $('#wrapper').append(row);\n }\n // Calculate dimensions of the square\n var squareSize = $('#wrapper').width() / size; \n $('.square').css(\"height\", squareSize + \"px\");\n $('.square').css(\"width\", squareSize + \"px\");\n \n hoverStyle();\n}", "title": "" }, { "docid": "67f0fcfa007337114a0ad33331d96118", "score": "0.621707", "text": "function CalculateBoxWidth(box_width, box_width_type, element, type) {\n if(box_width_type === 1) {\n return box_width;\n } else if(box_width_type === 2) {\n if(type === 0) { \n return box_width * 0.01 * $(element).parent().width();\n } else {\n return box_width * 0.01 * $(element).parent().height();\n }\n }\n}", "title": "" }, { "docid": "f4b28ceb00472dd6a63ddb0ac9ec78c1", "score": "0.61967003", "text": "createInsetBox(){\n let src = getElementsByClassName(document, 'picture');\n let anzahl = $(src).length;\n let hoehe = 100 + parseInt(this.inset.css('height'));\n let div = $('<div></div>').appendTo('#testBox');\n\n console.log(hoehe);\n div.css('position', 'relative')\n .css('border', '1px solid')\n .css('min-height', hoehe+'px')\n .css('margin', '5px 5px 5px 5px');\n\n\n\n //Erzeuge Div für Optionen\n\n let optionDiv = $('<div></div>').appendTo(div);\n optionDiv.css(\"position\", 'relative')\n .css('min-height', '0px')\n .css('display', 'inline-block');\n\n //Erzeuge Div für die Elemente um die Farben zu ändern\n let colorDiv = $('<div></div>').appendTo(optionDiv);\n colorDiv.css('position', 'relative')\n .css('display', 'inline-block')\n .css('margin', '0px 5px 0px 5px');\n\n //Erzeuge Input für die Farbgebung der Ränder\n this.input = $(`<input type=\"color\" value=\"${this.getRandomColor()}\"'>`).appendTo(colorDiv);\n this.inset.css('border-color', this.input.val());\n div.css('border-color', this.inset.css('border-left-color'))\n .css('position', 'relative');\n this.input\n .css('position', 'relative')\n .css('display', 'block')\n .change(() => {\n this.changeColor();\n });\n\n\n //Erzeuge Div für Breit und Höhe\n let sizeDiv = $('<div></div>').appendTo(optionDiv);\n sizeDiv.css('position', 'relative')\n .css('display', 'inline-block')\n .css('margin', '0px 5px 0px 5px');\n\n\n let inputWDiv = $('<div></div>'). appendTo(sizeDiv)\n .css('display', 'block')\n .css('position', 'relative');\n\n //Erzeuge Input für die Breite\n $('<label for=\"'+this.inputW+'\">width :</label>').appendTo(inputWDiv);\n this.inputW = $('<input type=\"number\" value=\"'+ parseInt(this.inset.css('width')) +'\">').appendTo(inputWDiv);\n this.inputW.css('position', 'relative')\n .css('display', 'inline-block')\n .change(() => {\n this.changeInputSize(this.inputW.val(), undefined)\n });\n\n\n\n\n let inputHDiv = $('<div></div>'). appendTo(sizeDiv)\n .css('display', 'block')\n .css('position', 'relative');\n\n //Erzeuge Input für die Höhe\n $('<label for=\"'+this.inputH+'\">height:</label>').appendTo(inputHDiv);\n this.inputH = $('<input type=\"number\" value=\"'+ parseInt(this.inset.css('height')) +'\">').appendTo(inputHDiv);\n this.inputH.css('position', 'relative')\n .css('display', 'inline-block')\n .change(() => {\n this.changeInputSize(undefined, this.inputH.val())\n });\n\n\n\n\n\n\n //Erzeuge div für Aspect Ratio\n let checkDiv = $('<div></div>').appendTo(optionDiv);\n checkDiv.css('position', 'relative')\n .css('display', 'inline-block')\n .css('margin', '0px 5px 0px 5px');\n\n //Erzeuge Checkbox für Aspect Ratio\n let checkBoxDiv = $('<div></div>').appendTo(checkDiv)\n .css('display', 'block')\n .css('position', 'relative');\n\n this.checkBox=$('<input type=\"checkbox\" value=\"false\">').appendTo(checkBoxDiv);\n this.checkBox.css('position', 'relative')\n .css('display', 'inline-block')\n .change(()=>{\n let val =this.inputA.val();//parseFloat(this.inputA.val());\n console.log(this.checkBox.prop('checked'));\n let options = this.inset.resizable('option');\n\n if (this.checkBox.prop('checked')){\n this.inset.resizable( \"option\", \"aspectRatio\", val);\n options.aspectRatio = true;\n this.inset.resizable('destroy');\n this.inset.resizable(options);\n this.changeInputSize(this.inset.css('width'), undefined);\n }else{\n this.inset.resizable( \"option\", \"aspectRatio\", false);\n options.aspectRatio = false;\n this.inset.resizable('destroy');\n this.inset.resizable(options);\n }\n });\n $('<label for=\"'+this.checkBox+'\"> activate ascpect ratio</label>').appendTo(checkBoxDiv);\n\n //Erzeuge Input für Aspect Ratio\n let aspectDiv = $('<div></div>').appendTo(checkDiv);\n aspectDiv.css('position', 'relative')\n .css('display', 'block');\n this.inputA = $('<input type=\"text\" value=\"1\" >').appendTo(aspectDiv)\n .change(()=>{\n this.changeInputSize(this.inset.css('height'), undefined);\n });\n $('<label for=\"'+this.inputA+'\"> ascpect ratio value</label>').appendTo(aspectDiv);\n\n\n\n //Erzeuge Div wo die Inset Vorschaubilder hineinkommen\n let imgDiv = $('<div class=\"imgDiv\"></div>').appendTo(div);\n\n imgDiv\n .css('position', 'relative')\n .css('min-height', '10px')\n .css('margin', '5px 5px 5px 5px');\n\n\n //Erzeuge Inset Vorschaubilder\n for(let i=0; i<anzahl; i++){\n let imgView = $('<div></div>').appendTo(imgDiv);\n imgView\n .css('position', 'relative')\n .css('display', 'inline-block')\n .css('height', this.inset.css('height'))\n .css('width', this.inset.css('height'))\n .css('margin', '5px 5px 5px 5px')\n .css('background-image', 'url('+$(src[i]).children('img').attr('src')+')');\n }\n\n\n\n this.imgDiv = imgDiv;\n return div;\n }", "title": "" }, { "docid": "a27c860adf4f141e608a460bc7e64107", "score": "0.6182058", "text": "function calculateTotal()\n{ \n\n var height = getHeight();\n //var width = getWidth();\n //var length = getLength();\n //var wallThickness = getWallThickness();\n var outerRadius = getOuterRad();\n var coneHeight = getConeHeight();\n var apertureRad = getApertureRad();\n var numFins = getNumFins();\n\n\n //display the result\n var divobj = document.getElementById('volume');\n divobj.style.display='block';\n divobj.innerHTML = \n \"height: \"+twoDecimals(height) +\n //\"<br>wallThickness: \"+twoDecimals(wallThickness) +\n \"<br>outerRadius: \"+twoDecimals(outerRadius) +\n \"<br>coneHeight: \"+twoDecimals(coneHeight)+\n \"<br>apertureRad: \"+twoDecimals(apertureRad)+\n \"<br>numFins: \"+twoDecimals(numFins)+\n \"<br>\";\n\n //var s = \"def+build():++++return+Part.makeBox(\"+height+\",\"+width+\",\"+length+\")++++++++\"\n //var s = \"def+build%28%29%3A%0D%0A++++return+Part.makeBox%281%2C2%2C3%29%0D%0A++++++++\"\n}", "title": "" }, { "docid": "f8c5a0e119793df82259d97f383a9154", "score": "0.6179838", "text": "function makeGrid(size) {\n $('#container').empty();\n var blockSize = 600 / size;\n for (var row = 0; row < size; row++) {\n $('#container').append('<div class=\"row\"></div>'); \n for (var column = 0; column < size ; column++) {\n $('#container').find('.row:last').append('<div class=\"grid-div\"></div>'); \n }\n }\n $('.row').css({'height': blockSize + 'px'});\n $('.grid-div').css({'height': blockSize + 'px', 'width': blockSize + 'px'});\n $('.column').css({'height': blockSize + 'px'})\n $('#current-size').text(\"The current size is \" + gridSize + 'x' + gridSize + '.');\n if($('#opacity-button').hasClass('highlight')){\n $('.grid-div').css('opacity', '0');\n }\n}", "title": "" }, { "docid": "705825afcb786a061c18ae4a4a598063", "score": "0.61774796", "text": "function makeBox (width, height) {\n\n var asterisks = \"*\";\n var finalBox = \"\";\n var lineTop = asterisks.repeat(width) + '\\n';\n var lineMiddle = \"\";\n var lineBottom = asterisks.repeat(width);\n\n function noAsterisks () {\n if (height >= 3 && width >= 3) {\n lineMiddle = lineMiddle + \"*\" + ( \" \".repeat(width - 2) ) + \"*\" + '\\n';\n }\n }\n\n function ifHeiWid () {\n if (height === 1) {\n finalBox = finalBox + lineBottom;\n } else if (height === 2) {\n finalBox = finalBox + lineTop + lineBottom;\n } else if (width === 1 || width === 2) {\n finalBox = finalBox + ( lineTop.repeat(height - 1) ) + lineBottom;\n } else {\n finalBox = finalBox + lineTop + ( lineMiddle.repeat(height - 2) ) + lineBottom;\n }\n }\n\n noAsterisks();\n ifHeiWid();\n return finalBox;\n\n}", "title": "" }, { "docid": "42143be4dd9a4d052c1e9889c3bb6628", "score": "0.6168037", "text": "function UI_box(UI_box_number){\n UI_body = document.createElement(\"div\");\n body[0].append(UI_body);\n UI_body.setAttribute(\"id\", UI_box_number);\n UI_body.style.display = \"flex\";\n\n return UI_body;\n}", "title": "" }, { "docid": "ee29b4d9825fc875468d7b20174eb26c", "score": "0.6156409", "text": "function loadDimensions(h, w, d){\n\tboxHeight = h;\n\tboxWidth = w;\n\tboxDepth = d;\n\n\t//resize box to new dimensions\n\tgeometryList[edgeType][1].translate((boxWidth-lastWidth)/2, 0, 0);\n\tgeometryList[edgeType][3].translate((-(boxWidth-lastWidth))/2, 0, 0);\n\n\tgeometryList[edgeType][4].translate(0, (boxHeight-lastHeight)/2, 0);\n\tgeometryList[edgeType][5].translate(0, (-(boxHeight-lastHeight))/2, 0);\n\n\tgeometryList[edgeType][0].translate(0, 0, (boxDepth-lastDepth)/2);\n\tgeometryList[edgeType][2].translate(0, 0, (-(boxDepth-lastDepth))/2);\n\n\t//We want two measurements of each box face to scale, and one to translate, in order to preserve eventual material thickness property\n\tfor(var i=0; i<6; i++){\n\t\tswitch(i){\n\t\t\tcase 0: //Front\n\t\t\t\tgeometryList[edgeType][i].scale(boxWidth/lastWidth, boxHeight/lastHeight, 1);\n\t\t\t\tbreak;\n\t\t\tcase 1: //Right\n\t\t\t\tgeometryList[edgeType][i].scale(1, boxHeight/lastHeight, boxDepth/lastDepth);\n\t\t\t\tbreak;\n\t\t\tcase 2: //Back\n\t\t\t\tgeometryList[edgeType][i].scale(boxWidth/lastWidth, boxHeight/lastHeight, 1);\n\t\t\t\tbreak;\n\t\t\tcase 3: //Left\n\t\t\t\tgeometryList[edgeType][i].scale(1, boxHeight/lastHeight, boxDepth/lastDepth);\n\t\t\t\tbreak;\n\t\t\tcase 4: //Top\n\t\t\t\tgeometryList[edgeType][i].scale(boxWidth/lastWidth, 1, boxDepth/lastDepth);\n\t\t\t\tbreak;\n\t\t\tcase 5: //Bottom\n\t\t\t\tgeometryList[edgeType][i].scale(boxWidth/lastWidth, 1, boxDepth/lastDepth);\n\t\t\t\tbreak;\n\t\t}\n\t\tgeometryList[edgeType][i].verticesNeedUpdate = true;\n\t}\n\n\tlastWidth = boxWidth;\n\tlastHeight = boxHeight;\n\tlastDepth = boxDepth;\n}", "title": "" }, { "docid": "038d5dff8857dae9574121440ce87e16", "score": "0.61426145", "text": "function setup() {\r\n\t\t// setup once\r\n\t\tif (isSetup) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tisSetup = true;\r\n\t\t// -------------------------- box sizing -------------------------- //\r\n\t\t/**\r\n\t\t * Chrome & Safari measure the outer-width on style.width on border-box elems\r\n\t\t * IE11 & Firefox<29 measures the inner-width\r\n\t\t */\r\n\t\tvar div = document.createElement('div');\r\n\t\tdiv.style.width = '200px';\r\n\t\tdiv.style.padding = '1px 2px 3px 4px';\r\n\t\tdiv.style.borderStyle = 'solid';\r\n\t\tdiv.style.borderWidth = '1px 2px 3px 4px';\r\n\t\tdiv.style.boxSizing = 'border-box';\r\n\t\tvar body = document.body || document.documentElement;\r\n\t\tbody.appendChild(div);\r\n\t\tvar style = getStyle(div);\r\n\t\t// round value for browser zoom. desandro/masonry#928\r\n\t\tisBoxSizeOuter = Math.round(getStyleSize(style.width)) == 200;\r\n\t\tgetSize.isBoxSizeOuter = isBoxSizeOuter;\r\n\t\tbody.removeChild(div);\r\n\t}", "title": "" }, { "docid": "f59184726bc41f6d892df7ecf1a9ea36", "score": "0.6131918", "text": "function createGrid(ro) {\n var squares = ro * ro;\n var length = (parseInt($('#container').height()) - ro) / ro;\n\n $('#container').empty();\n\n for (var i=0; i<squares; i++) {\n $('#container').append('<div class=\"square\"></div>');\n }\n \n $('.square').height(length);\n $('.square').width(length);\n }", "title": "" }, { "docid": "97099fdd37acfb01eba18cd57b9d27fd", "score": "0.6131908", "text": "function BoxMaker() {\n var box = {\n length : 10,\n width : 50,\n height : 60,\n contents : ['spray', 'tan', 'morning', 'sun']\n }\n return box;\n}", "title": "" }, { "docid": "d26a68443f8691daa5c6663b77652acc", "score": "0.6127534", "text": "function size() {\n //set up ui\n $(\"#container\").css('padding-top', $(\"#controls\").outerHeight()+\"px\");\n\n $graphicsContainer = $(\"#graphics-container\");\n $graphics.attr(\"height\", $graphicsContainer.height());\n $graphics.attr(\"width\", $graphicsContainer.width());\n\n //logo\n var $logo = $(\"#logo\");\n var $controls = $(\"#controls\");\n $logo.css({\n lineHeight: $controls.outerHeight()+\"px\"\n });\n\n $controls.children('#runners').css('margin-left', $logo.outerWidth());\n }", "title": "" }, { "docid": "eff3ffece02cdc14009c5daa54694974", "score": "0.6122354", "text": "function createDiv (wi, idd, cla){\n $(\"<div>\").addClass(\"float box \"+cla).css({\n width: wi,\n height: box_h-margin*2,\n \"marginTop\": margin,\n \"marginRight\": margin,\n \"marginBottom\": margin,\n \"marginLeft\": margin\n }).attr(\"id\", idd)\n .appendTo(\"body\"); \n }", "title": "" }, { "docid": "1e6c0eacc8aa84ef4a9996a1f27cfd58", "score": "0.6121752", "text": "function resize_box() {\n grids = $('.portfolio-item');\n grids.height(grids.width())\n }", "title": "" }, { "docid": "fc5540cf9b958a11191f5447305570ed", "score": "0.6120232", "text": "function prepareOneSlideBox(slotholder, opt, visible) {\n\n var sh = slotholder;\n var img = sh.find('img')\n setSize(img, opt)\n var src = img.attr('src');\n var bgcolor = img.css('background-color');\n\n var w = img.data('neww');\n var h = img.data('newh');\n var fulloff = img.data(\"fxof\");\n if (fulloff == undefined)\n fulloff = 0;\n\n var fullyoff = img.data(\"fyof\");\n if (img.data('fullwidthcentering') != \"on\" || fullyoff == undefined)\n fullyoff = 0;\n\n\n\n var off = 0;\n\n\n\n\n // SET THE MINIMAL SIZE OF A BOX\n var basicsize = 0;\n if (opt.sloth > opt.slotw)\n basicsize = opt.sloth\n else\n basicsize = opt.slotw;\n\n\n if (!visible) {\n var off = 0 - basicsize;\n }\n\n opt.slotw = basicsize;\n opt.sloth = basicsize;\n var x = 0;\n var y = 0;\n\n\n\n for (var j = 0; j < opt.slots; j++) {\n\n y = 0;\n for (var i = 0; i < opt.slots; i++) {\n\n\n sh.append('<div class=\"slot\" ' +\n 'style=\"position:absolute;' +\n 'top:' + (fullyoff + y) + 'px;' +\n 'left:' + (fulloff + x) + 'px;' +\n 'width:' + basicsize + 'px;' +\n 'height:' + basicsize + 'px;' +\n 'overflow:hidden;\">' +\n '<div class=\"slotslide\" data-x=\"' + x + '\" data-y=\"' + y + '\" ' +\n 'style=\"position:absolute;' +\n 'top:' + (0) + 'px;' +\n 'left:' + (0) + 'px;' +\n 'width:' + basicsize + 'px;' +\n 'height:' + basicsize + 'px;' +\n 'overflow:hidden;\">' +\n '<img style=\"position:absolute;' +\n 'top:' + (0 - y) + 'px;' +\n 'left:' + (0 - x) + 'px;' +\n 'width:' + w + 'px;' +\n 'height:' + h + 'px' +\n 'background-color:' + bgcolor + ';\"' +\n 'src=\"' + src + '\"></div></div>');\n y = y + basicsize;\n }\n x = x + basicsize;\n }\n }", "title": "" }, { "docid": "467bd6fc9c4e5281c4722932c5eeae75", "score": "0.60971177", "text": "function sendGridLength(){\n var gridLength = document.getElementById(\"gridLength\").value;\n if (gridLength > 100){ return };\n var pixels = 800 / gridLength;\n document.getElementById(\"container\").style.gridTemplateColumns = `repeat(${gridLength}, ${pixels}px)`;\n document.getElementById(\"container\").style.gridTemplateRows = `repeat(${gridLength}, ${pixels}px)`;\n \n //Remove old divs\n for (var i = 0; i < oldGridLength**2; i++){\n var oldDiv = document.getElementById(i);\n oldDiv.remove();\n }\n\n //Adjust divs to new input\n for (var i = 0; i < gridLength**2; i++){\n var newDiv = document.createElement('div');\n newDiv.setAttribute('id', i);\n newDiv.setAttribute('class', 'box');\n container.appendChild(newDiv);\n oldGridLength = gridLength; \n }\n}", "title": "" }, { "docid": "3591762cdec77767b4d6d7172786a2b5", "score": "0.6094228", "text": "function createBoxes(i) {\n var newDiv = document.createElement('div');\n newDiv.id = 'answerBox' + i;\n newDiv.className = \"answerBoxes\";\n $('#answerPlaceHolder')\n .append(newDiv);\n}", "title": "" }, { "docid": "4defed4aba7679ec5f4b1e9c676ce830", "score": "0.60781145", "text": "function hContainer() {\r\n\t\tvar lHContainer=30;\r\n\t\tvar rHContainer=70;\r\n\t\tvar newHContainer;\r\n\t\t\r\n\t\tif (document.getElementById(\"allLeft\").style.display!=\"none\") {\r\n\t\t\tlHContainer=320;\r\n\t\t\tif (PageBoxes.PSbox.style.display==\"block\") lHContainer+=265;\r\n\t\t\tif (PageBoxes.SEbox.style.display==\"block\") lHContainer+=220;\r\n\t\t}\t\r\n\t\tif (document.getElementById(\"allRight\").style.display!=\"none\") {\r\n\t\t\trHContainer=340;\r\n\t\t\tif (PageBoxes.UIbox.style.display==\"block\") rHContainer+=170;\r\n\t\t\tif (PageBoxes.UCbox.style.display==\"block\")\r\n\t\t\t\tif(document.getElementById(\"textureColour\").style.display==\"block\") rHContainer+=250;\r\n\t\t\t\telse rHContainer+=80;\r\n\t\t}\r\n\t\t\r\n\t\tnewHContainer = lHContainer > rHContainer? lHContainer : rHContainer;\r\n\t\tst=newHContainer.toString()+\"px\";\r\n\t\tdocument.getElementById(\"container\").style.minHeight=st;\t\r\n\t}", "title": "" }, { "docid": "526582fba19c3942af4c7e530e53049b", "score": "0.6072553", "text": "divideBox() {\n const halfWidth = this.box.width / 2, halfHeight = this.box.height / 2;\n // Top left\n this.nodes[0] = new QuadTreeNode({\n left: this.box.left,\n top: this.box.top,\n width: halfWidth,\n height: halfHeight\n });\n // Top right\n this.nodes[1] = new QuadTreeNode({\n left: this.box.left + halfWidth,\n top: this.box.top,\n width: halfWidth,\n height: halfHeight\n });\n // Bottom right\n this.nodes[2] = new QuadTreeNode({\n left: this.box.left + halfWidth,\n top: this.box.top + halfHeight,\n width: halfWidth,\n height: halfHeight\n });\n // Bottom left\n this.nodes[3] = new QuadTreeNode({\n left: this.box.left,\n top: this.box.top + halfHeight,\n width: halfWidth,\n height: halfHeight\n });\n }", "title": "" }, { "docid": "9213af82636464bf30f268073b62a7ff", "score": "0.60670036", "text": "function boxCalc(sizers, space) {\n // Bail early if there is nothing to do.\n var count = sizers.length;\n if (count === 0) {\n return;\n }\n // Setup the size and stretch counters.\n var totalMin = 0;\n var totalMax = 0;\n var totalSize = 0;\n var totalStretch = 0;\n var stretchCount = 0;\n // Setup the sizers and compute the totals.\n for (var i = 0; i < count; ++i) {\n var sizer = sizers[i];\n initSizer(sizer);\n totalSize += sizer.size;\n totalMin += sizer.minSize;\n totalMax += sizer.maxSize;\n if (sizer.stretch > 0) {\n totalStretch += sizer.stretch;\n stretchCount++;\n }\n }\n // If the space is equal to the total size, return.\n if (space === totalSize) {\n return;\n }\n // If the space is less than the total min, minimize each sizer.\n if (space <= totalMin) {\n for (var i = 0; i < count; ++i) {\n var sizer = sizers[i];\n sizer.size = sizer.minSize;\n }\n return;\n }\n // If the space is greater than the total max, maximize each sizer.\n if (space >= totalMax) {\n for (var i = 0; i < count; ++i) {\n var sizer = sizers[i];\n sizer.size = sizer.maxSize;\n }\n return;\n }\n // The loops below perform sub-pixel precision sizing. A near zero\n // value is used for compares instead of zero to ensure that the\n // loop terminates when the subdivided space is reasonably small.\n var nearZero = 0.01;\n // A counter which is decremented each time a sizer is resized to\n // its limit. This ensures the loops terminate even if there is\n // space remaining to distribute.\n var notDoneCount = count;\n // Distribute negative delta space.\n if (space < totalSize) {\n // Shrink each stretchable sizer by an amount proportional to its\n // stretch factor. If a sizer reaches its min size it's marked as\n // done. The loop progresses in phases where each sizer is given\n // a chance to consume its fair share for the pass, regardless of\n // whether a sizer before it reached its limit. This continues\n // until the stretchable sizers or the free space is exhausted.\n var freeSpace = totalSize - space;\n while (stretchCount > 0 && freeSpace > nearZero) {\n var distSpace = freeSpace;\n var distStretch = totalStretch;\n for (var i = 0; i < count; ++i) {\n var sizer = sizers[i];\n if (sizer.done || sizer.stretch === 0) {\n continue;\n }\n var amt = sizer.stretch * distSpace / distStretch;\n if (sizer.size - amt <= sizer.minSize) {\n freeSpace -= sizer.size - sizer.minSize;\n totalStretch -= sizer.stretch;\n sizer.size = sizer.minSize;\n sizer.done = true;\n notDoneCount--;\n stretchCount--;\n }\n else {\n freeSpace -= amt;\n sizer.size -= amt;\n }\n }\n }\n // Distribute any remaining space evenly among the non-stretchable\n // sizers. This progresses in phases in the same manner as above.\n while (notDoneCount > 0 && freeSpace > nearZero) {\n var amt = freeSpace / notDoneCount;\n for (var i = 0; i < count; ++i) {\n var sizer = sizers[i];\n if (sizer.done) {\n continue;\n }\n if (sizer.size - amt <= sizer.minSize) {\n freeSpace -= sizer.size - sizer.minSize;\n sizer.size = sizer.minSize;\n sizer.done = true;\n notDoneCount--;\n }\n else {\n freeSpace -= amt;\n sizer.size -= amt;\n }\n }\n }\n }\n else {\n // Expand each stretchable sizer by an amount proportional to its\n // stretch factor. If a sizer reaches its max size it's marked as\n // done. The loop progresses in phases where each sizer is given\n // a chance to consume its fair share for the pass, regardless of\n // whether a sizer before it reached its limit. This continues\n // until the stretchable sizers or the free space is exhausted.\n var freeSpace = space - totalSize;\n while (stretchCount > 0 && freeSpace > nearZero) {\n var distSpace = freeSpace;\n var distStretch = totalStretch;\n for (var i = 0; i < count; ++i) {\n var sizer = sizers[i];\n if (sizer.done || sizer.stretch === 0) {\n continue;\n }\n var amt = sizer.stretch * distSpace / distStretch;\n if (sizer.size + amt >= sizer.maxSize) {\n freeSpace -= sizer.maxSize - sizer.size;\n totalStretch -= sizer.stretch;\n sizer.size = sizer.maxSize;\n sizer.done = true;\n notDoneCount--;\n stretchCount--;\n }\n else {\n freeSpace -= amt;\n sizer.size += amt;\n }\n }\n }\n // Distribute any remaining space evenly among the non-stretchable\n // sizers. This progresses in phases in the same manner as above.\n while (notDoneCount > 0 && freeSpace > nearZero) {\n var amt = freeSpace / notDoneCount;\n for (var i = 0; i < count; ++i) {\n var sizer = sizers[i];\n if (sizer.done) {\n continue;\n }\n if (sizer.size + amt >= sizer.maxSize) {\n freeSpace -= sizer.maxSize - sizer.size;\n sizer.size = sizer.maxSize;\n sizer.done = true;\n notDoneCount--;\n }\n else {\n freeSpace -= amt;\n sizer.size += amt;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "3ce1ad0ca51e58d7ff433433b3b53b85", "score": "0.60643715", "text": "function makeGrid(width, height) {\n //scale to the most constricted element so that all the boxes fit on the page (set the line height accordingly)\n let a = window.innerHeight/height;\n let b = (window.innerWidth-51)/width; //the 51 is the sidebar width\n let divSize = Math.min(a,b)-2;\n document.body.style.lineHeight = (Math.floor(divSize)+1).toString()+'px';\n\n let divSizeFinal = Math.floor(divSize).toString()+'px';\n \n //actually make and append the elements to the page\n for (let a=0; a<height; a++) {\n let newSpan = document.createElement('span');\n\n newSpan.classList.add('rowSpan'); //used for getting the spans\n\n\n for (let b=0; b<width; b++) {\n\n let newDiv = document.createElement('div');\n\n newDiv.style.height = newDiv.style.width = divSizeFinal;\n\n newDiv.setAttribute(\"onclick\",\"divClick(this)\");\n newDiv.setAttribute(\"onmouseenter\",\"divHover(this)\");\n newDiv.setAttribute(\"onmousedown\",\"if(!lining){divHover(this, true)}\");\n newDiv.setAttribute(\"data-coords\", `${a},${b}`);\n \n //make divs on the right and bottom have a border\n if (b-width === -1) newDiv.style.borderRight = \"solid gray 1px\";\n if (a-height === -1) newDiv.style.borderBottom = \"solid gray 1px\";\n\n newDiv.classList.add('pixel'); //pixel class has extra formatting (see style.css)\n\n\n newSpan.appendChild(newDiv);\n\n }\n document.body.appendChild(newSpan);\n document.body.innerHTML += '<br>';\n }\n document.body.innerHTML += '<br>';\n\n //make sure sliders are updated\n let currentColour = getColour();\n currentColour = currentColour.concat(rgbToHsl(currentColour[0], currentColour[1], currentColour[2]));\n updateSliders(currentColour);\n\n\n let spans = document.getElementsByClassName('rowSpan');\n for (span of spans) {\n elementsMatrix.push(span.children);\n }\n}", "title": "" }, { "docid": "8c938e7acaad85e0310c1382bb50c75e", "score": "0.60625464", "text": "function makeBoxes (numOfBoxes) {\n for (var i = 0; i < numOfBoxes; i++) {\n boxes.push(i);\n // ****** added div boxes to HTML *******\n var box = $('<div class=\"inactive\"><div class=\"active\"></div></div>');\n\n container.append(box);\n }\n}", "title": "" }, { "docid": "49654502c1ca5167bc11e2c53850f5b2", "score": "0.6058242", "text": "updateSize() {\n let orderObject = 0;\n let hBeforeElements = 42;\n let wBoundary = BOUNDARY_ATTR_SIZE.BOUND_WIDTH;\n let marginTop = 3;\n\n this.member.forEach(mem => {\n if (mem.show) {\n\n if (mem.type == \"B\") {\n let boundaryObj = _.find(this.dataContainer.boundary, {\"id\": mem.id});\n boundaryObj.updateSize();\n }\n\n const { width, height } = this.objectUtils.getBBoxObject(`#${mem.id}`);\n orderObject++;\n hBeforeElements += height;\n if (width >= wBoundary)\n wBoundary = width + 10;\n }\n });\n\n let hBoundary = hBeforeElements + marginTop * orderObject + 2;\n\n this.setHeight(hBoundary);\n this.setWidth(wBoundary);\n }", "title": "" }, { "docid": "572c534e6b142d9cb181ddb38df1734a", "score": "0.6055795", "text": "function getDivDims (given_css, content) {\n\t\t\tvar testDiv = $('<div><\\/div>');\n\t\t\ttestDiv.css({\n\t\t\t\t'visibility':'hidden',\n\t\t\t\t'margin' :0,\n\t\t\t\t'padding' :0,\n\t\t\t\t'position' :'absolute'\n\t\t\t});\n\t\t\tif (content) {\n\t\t\t\ttestDiv.append(content);\n\t\t\t}\n\t\t\tif (given_css) {\n\t\t\t\ttestDiv.css(given_css);\n\t\t\t}\n\t\t\ttpl_el.append(testDiv);\n\t\t\tvar info = {\n\t\t\t\tw:testDiv.width(),\n\t\t\t\th:testDiv.height()\n\t\t\t};\n\t\t\ttestDiv.remove();\n\t\t\treturn info;\n\t\t}", "title": "" }, { "docid": "91a9ab9a34be1aa2d246eb3ce45a8179", "score": "0.60511893", "text": "function dimensionCalc() {\n if (width > height) {\n vMax = width / 100;\n vMin = height / 100;\n circleRad = height * 0.45;\n } else {\n vMax = height / 100;\n vMin = width / 100;\n circleRad = width * 0.45;\n }\n}", "title": "" }, { "docid": "7add14f19384e6d8cef261086d110d02", "score": "0.60491246", "text": "function setup() {\n // setup once\n if ( isSetup ) {\n return;\n }\n isSetup = true;\n\n // -------------------------- box sizing -------------------------- //\n\n /**\n * Chrome & Safari measure the outer-width on style.width on border-box elems\n * IE11 & Firefox<29 measures the inner-width\n */\n var div = document.createElement('div');\n div.style.width = '200px';\n div.style.padding = '1px 2px 3px 4px';\n div.style.borderStyle = 'solid';\n div.style.borderWidth = '1px 2px 3px 4px';\n div.style.boxSizing = 'border-box';\n\n var body = document.body || document.documentElement;\n body.appendChild( div );\n var style = getStyle( div );\n // round value for browser zoom. desandro/masonry#928\n isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200;\n getSize.isBoxSizeOuter = isBoxSizeOuter;\n\n body.removeChild( div );\n }", "title": "" }, { "docid": "e59c6acb0333b3ac6f282a0cf7abeba8", "score": "0.6045149", "text": "function boxCalc(sizers, space) {\r\n\t // Bail early if there is nothing to do.\r\n\t var count = sizers.length;\r\n\t if (count === 0) {\r\n\t return;\r\n\t }\r\n\t // Setup the size and stretch counters.\r\n\t var totalMin = 0;\r\n\t var totalMax = 0;\r\n\t var totalSize = 0;\r\n\t var totalStretch = 0;\r\n\t var stretchCount = 0;\r\n\t // Setup the sizers and compute the totals.\r\n\t for (var i = 0; i < count; ++i) {\r\n\t var sizer = sizers[i];\r\n\t initSizer(sizer);\r\n\t totalSize += sizer.size;\r\n\t totalMin += sizer.minSize;\r\n\t totalMax += sizer.maxSize;\r\n\t if (sizer.stretch > 0) {\r\n\t totalStretch += sizer.stretch;\r\n\t stretchCount++;\r\n\t }\r\n\t }\r\n\t // If the space is equal to the total size, return.\r\n\t if (space === totalSize) {\r\n\t return;\r\n\t }\r\n\t // If the space is less than the total min, minimize each sizer.\r\n\t if (space <= totalMin) {\r\n\t for (var i = 0; i < count; ++i) {\r\n\t var sizer = sizers[i];\r\n\t sizer.size = sizer.minSize;\r\n\t }\r\n\t return;\r\n\t }\r\n\t // If the space is greater than the total max, maximize each sizer.\r\n\t if (space >= totalMax) {\r\n\t for (var i = 0; i < count; ++i) {\r\n\t var sizer = sizers[i];\r\n\t sizer.size = sizer.maxSize;\r\n\t }\r\n\t return;\r\n\t }\r\n\t // The loops below perform sub-pixel precision sizing. A near zero\r\n\t // value is used for compares instead of zero to ensure that the\r\n\t // loop terminates when the subdivided space is reasonably small.\r\n\t var nearZero = 0.01;\r\n\t // A counter which is decremented each time a sizer is resized to\r\n\t // its limit. This ensures the loops terminate even if there is\r\n\t // space remaining to distribute.\r\n\t var notDoneCount = count;\r\n\t // Distribute negative delta space.\r\n\t if (space < totalSize) {\r\n\t // Shrink each stretchable sizer by an amount proportional to its\r\n\t // stretch factor. If a sizer reaches its min size it's marked as\r\n\t // done. The loop progresses in phases where each sizer is given\r\n\t // a chance to consume its fair share for the pass, regardless of\r\n\t // whether a sizer before it reached its limit. This continues\r\n\t // until the stretchable sizers or the free space is exhausted.\r\n\t var freeSpace = totalSize - space;\r\n\t while (stretchCount > 0 && freeSpace > nearZero) {\r\n\t var distSpace = freeSpace;\r\n\t var distStretch = totalStretch;\r\n\t for (var i = 0; i < count; ++i) {\r\n\t var sizer = sizers[i];\r\n\t if (sizer.done || sizer.stretch === 0) {\r\n\t continue;\r\n\t }\r\n\t var amt = sizer.stretch * distSpace / distStretch;\r\n\t if (sizer.size - amt <= sizer.minSize) {\r\n\t freeSpace -= sizer.size - sizer.minSize;\r\n\t totalStretch -= sizer.stretch;\r\n\t sizer.size = sizer.minSize;\r\n\t sizer.done = true;\r\n\t notDoneCount--;\r\n\t stretchCount--;\r\n\t }\r\n\t else {\r\n\t freeSpace -= amt;\r\n\t sizer.size -= amt;\r\n\t }\r\n\t }\r\n\t }\r\n\t // Distribute any remaining space evenly among the non-stretchable\r\n\t // sizers. This progresses in phases in the same manner as above.\r\n\t while (notDoneCount > 0 && freeSpace > nearZero) {\r\n\t var amt = freeSpace / notDoneCount;\r\n\t for (var i = 0; i < count; ++i) {\r\n\t var sizer = sizers[i];\r\n\t if (sizer.done) {\r\n\t continue;\r\n\t }\r\n\t if (sizer.size - amt <= sizer.minSize) {\r\n\t freeSpace -= sizer.size - sizer.minSize;\r\n\t sizer.size = sizer.minSize;\r\n\t sizer.done = true;\r\n\t notDoneCount--;\r\n\t }\r\n\t else {\r\n\t freeSpace -= amt;\r\n\t sizer.size -= amt;\r\n\t }\r\n\t }\r\n\t }\r\n\t }\r\n\t else {\r\n\t // Expand each stretchable sizer by an amount proportional to its\r\n\t // stretch factor. If a sizer reaches its max size it's marked as\r\n\t // done. The loop progresses in phases where each sizer is given\r\n\t // a chance to consume its fair share for the pass, regardless of\r\n\t // whether a sizer before it reached its limit. This continues\r\n\t // until the stretchable sizers or the free space is exhausted.\r\n\t var freeSpace = space - totalSize;\r\n\t while (stretchCount > 0 && freeSpace > nearZero) {\r\n\t var distSpace = freeSpace;\r\n\t var distStretch = totalStretch;\r\n\t for (var i = 0; i < count; ++i) {\r\n\t var sizer = sizers[i];\r\n\t if (sizer.done || sizer.stretch === 0) {\r\n\t continue;\r\n\t }\r\n\t var amt = sizer.stretch * distSpace / distStretch;\r\n\t if (sizer.size + amt >= sizer.maxSize) {\r\n\t freeSpace -= sizer.maxSize - sizer.size;\r\n\t totalStretch -= sizer.stretch;\r\n\t sizer.size = sizer.maxSize;\r\n\t sizer.done = true;\r\n\t notDoneCount--;\r\n\t stretchCount--;\r\n\t }\r\n\t else {\r\n\t freeSpace -= amt;\r\n\t sizer.size += amt;\r\n\t }\r\n\t }\r\n\t }\r\n\t // Distribute any remaining space evenly among the non-stretchable\r\n\t // sizers. This progresses in phases in the same manner as above.\r\n\t while (notDoneCount > 0 && freeSpace > nearZero) {\r\n\t var amt = freeSpace / notDoneCount;\r\n\t for (var i = 0; i < count; ++i) {\r\n\t var sizer = sizers[i];\r\n\t if (sizer.done) {\r\n\t continue;\r\n\t }\r\n\t if (sizer.size + amt >= sizer.maxSize) {\r\n\t freeSpace -= sizer.maxSize - sizer.size;\r\n\t sizer.size = sizer.maxSize;\r\n\t sizer.done = true;\r\n\t notDoneCount--;\r\n\t }\r\n\t else {\r\n\t freeSpace -= amt;\r\n\t sizer.size += amt;\r\n\t }\r\n\t }\r\n\t }\r\n\t }\r\n\t}", "title": "" }, { "docid": "199eb3b5845035e5a94a7587312a7b78", "score": "0.6039685", "text": "getContainerBox() {\n return {\n width: getStyle(this.renderTo, 'width', true) || 0,\n height: getStyle(this.renderTo, 'height', true) || 0\n };\n }", "title": "" }, { "docid": "c69b25c73a20b0d8841d93b0e5afc4ed", "score": "0.60324925", "text": "function _changeBoxSize () {\n if (this.naturalHeight){\n height = this.naturalHeight;\n } else {\n height = this.height;\n }\n if (this.naturalWidth){\n width = this.naturalWidth;\n } else {\n width = this.width;\n }\n var mediawindowBox = $('.mediawindow-box');\n _windowSize.call(this.mediaWindow, mediawindowBox, width, height);\n _hideSpinner.call(this.mediaWindow);\n this.mediaWindow = null;\n return true;\n }", "title": "" }, { "docid": "444bf2c42b650b70e9853620e4aa97cd", "score": "0.6030137", "text": "changeDimensions() {\n if (mouseIsPressed) {\n // Box width based on mouseX location\n this.boxWidth = this.distX;\n // Box height based on mouseY location\n this.boxHeight = this.distY;\n }\n }", "title": "" }, { "docid": "4e38272628db2012cf8ffaed26cee011", "score": "0.6018936", "text": "function volumeOfBox(sizes) {\n\treturn sizes.length * sizes.width * sizes.height;\n}", "title": "" }, { "docid": "73798da12118a8869a5e7db171ec7c45", "score": "0.60181195", "text": "splitBox(box) {\n const boxes = [];\n let newSides = [];\n const portrait = box.h > box.w;\n if (portrait) {\n newSides = utils.splitRough(box.h, 2, box.h * 0.3);\n\n boxes.push(new Box(box.x, box.y, box.w, newSides[0]));\n boxes.push(\n new Box(\n box.x,\n box.y + newSides[0] + this.gutter,\n box.w,\n newSides[1] - this.gutter\n )\n );\n } else {\n newSides = utils.splitRough(box.w, 2, box.w * 0.3);\n\n boxes.push(new Box(box.x, box.y, newSides[0], box.h));\n boxes.push(\n new Box(\n box.x + newSides[0] + this.gutter,\n box.y,\n newSides[1] - this.gutter,\n box.h\n )\n );\n }\n\n return boxes;\n }", "title": "" }, { "docid": "d6f01408cade24d23fa458b20517de27", "score": "0.6012584", "text": "function createSquares () {\n $(\".container\").append('<div class=\"color-block\"></div>');\n var $el = $(\".container\").children().last();\n\n $el.append(\"<div class='color-cube \" + color + \"'> </div>\");\n $el.css(\"float\", \"left\");\n\n }", "title": "" }, { "docid": "40be80dea2f99ddb189c3225042807c9", "score": "0.60078096", "text": "function setup() {\n // setup once\n if (isSetup) {\n return;\n }\n\n isSetup = true; // -------------------------- box sizing -------------------------- //\n\n /**\n * Chrome & Safari measure the outer-width on style.width on border-box elems\n * IE11 & Firefox<29 measures the inner-width\n */\n\n var div = document.createElement('div');\n div.style.width = '200px';\n div.style.padding = '1px 2px 3px 4px';\n div.style.borderStyle = 'solid';\n div.style.borderWidth = '1px 2px 3px 4px';\n div.style.boxSizing = 'border-box';\n var body = document.body || document.documentElement;\n body.appendChild(div);\n var style = getStyle(div); // round value for browser zoom. desandro/masonry#928\n\n isBoxSizeOuter = Math.round(getStyleSize(style.width)) == 200;\n getSize.isBoxSizeOuter = isBoxSizeOuter;\n body.removeChild(div);\n } // -------------------------- getSize -------------------------- //", "title": "" }, { "docid": "ce1a7b27e6a8480e8b7063c7a1b89a8c", "score": "0.6007765", "text": "size(renderContext, {text, size, font, sizeMode = 'xHeight'}) {\n const {textMetrics, width, height} = measureText(\n renderContext.fonts[font],\n text,\n size,\n sizeMode\n );\n const newBox = {x: 0, y: 0, width, height};\n this.box = newBox;\n this.textMetrics = textMetrics;\n\n return Object.assign({}, newBox);\n }", "title": "" }, { "docid": "533a59d9cb9710752118e6bc70be3a32", "score": "0.59977585", "text": "function makeBoxes(num, col, cost) {\n var boxOutput = $(\"#box-slider\"); //used in multiple places so stored in variable\n var colorName = $(\"#color option:selected\").attr(\"name\"); //get name attribute of selected color - allows value to store hex code instead\n if(isNaN(num) || (!num)){ //checks for non-numeric or undefined values\n boxOutput.html(\"<h3>Invalid Amount</h3><p>Please enter a valid number 1 - 1000</p>\");\n } else if(num > 1000) { //checks for quantities over 1000 boxes\n boxOutput.html(\"<h3>Sorry, Box Maker Union doesn't pay overtime!</h3> <p>Orders must be 1000 boxes or less.</p>\");\n } \n else if(num) { //probably don't need to use boolean anymore given !num above, but this one guards/guarded against weird inputs and blank orders\n boxOutput.html(\"\").css(\"display\", \"none\"); //clears and hides box-slider from view while making boxes\n for(var i=1; i<=num; i++){ //loop to create boxes based on num value (quantity)\n boxOutput.append(\"<div class='box'><p>\" + i + \"</p></div>\"); //appends div into box-slider div (same as +=)\n }\n boxOutput.children().css(\"background-color\", col); //colors boxes using col value\n boxOutput.slideDown(800); //slides boxes into view\n $(\"#history\").prepend(\"<p>\" + num + \" \" + colorName + \" @ $\" + cost + \" each = $\" + (num*cost) + \"</p>\"); //logs order summary to history div\n } \n\n }", "title": "" }, { "docid": "709bca50d61cbb25cbfc743771148cf0", "score": "0.59903723", "text": "function setup() {\n\t // setup once\n\t if ( isSetup ) {\n\t return;\n\t }\n\t isSetup = true;\n\t\n\t // -------------------------- box sizing -------------------------- //\n\t\n\t /**\n\t * WebKit measures the outer-width on style.width on border-box elems\n\t * IE & Firefox<29 measures the inner-width\n\t */\n\t var div = document.createElement('div');\n\t div.style.width = '200px';\n\t div.style.padding = '1px 2px 3px 4px';\n\t div.style.borderStyle = 'solid';\n\t div.style.borderWidth = '1px 2px 3px 4px';\n\t div.style.boxSizing = 'border-box';\n\t\n\t var body = document.body || document.documentElement;\n\t body.appendChild( div );\n\t var style = getStyle( div );\n\t\n\t getSize.isBoxSizeOuter = isBoxSizeOuter = getStyleSize( style.width ) == 200;\n\t body.removeChild( div );\n\t\n\t}", "title": "" }, { "docid": "eb801474839b4cb8b65955607301c8f9", "score": "0.5975511", "text": "function setup() {\n // setup once\n if (isSetup) {\n return;\n }\n isSetup = true;\n\n // -------------------------- box sizing -------------------------- //\n\n /**\n * WebKit measures the outer-width on style.width on border-box elems\n * IE & Firefox<29 measures the inner-width\n */\n var div = document.createElement('div');\n div.style.width = '200px';\n div.style.padding = '1px 2px 3px 4px';\n div.style.borderStyle = 'solid';\n div.style.borderWidth = '1px 2px 3px 4px';\n div.style.boxSizing = 'border-box';\n\n var body = document.body || document.documentElement;\n body.appendChild(div);\n var style = getStyle(div);\n\n getSize.isBoxSizeOuter = isBoxSizeOuter = getStyleSize(style.width) == 200;\n body.removeChild(div);\n }", "title": "" }, { "docid": "6ea7dd152117a5021dbe95f7a4c8a8af", "score": "0.5960622", "text": "function doSizing(){\n $('#header').css('height', roomHeight);\n $('#footer').css('height', roomHeight + 10);\n $('#footer-toggle').css({\n 'bottom': roomHeight - 15,\n 'height': 23,\n 'width': screenWidth / 5\n });\n $('#buy-button').css({\n 'height': roomHeight - 30,\n 'width': roomHeight - 30\n });\n $('#craft-button').css({\n 'height': roomHeight - 30,\n 'width': roomHeight - 30\n });\n $('.slot').css({\n 'height': roomHeight,\n 'width': roomHeight\n });\n $('.slot-2').css({\n 'height': roomHeight,\n 'width': roomHeight\n });\n $('.crow').css({\n 'height': roomHeight + 5\n });\n $('#animals-tab').css({\n 'height': roomHeight\n });\n $('#plants-tab').css({\n 'height': roomHeight\n });\n $('#auxilary-tab').css({\n 'height': roomHeight\n });\n $('#collect-floor').css({\n 'height': roomHeight / 2,\n 'width': roomWidth,\n 'left': (screenWidth - roomWidth) / 2\n });\n $('#save-button').css({\n 'height': roomHeight - 30,\n 'width': roomHeight - 30\n });\n $('#tutorial-button').css({\n 'height': roomHeight - 30,\n 'width': roomHeight - 30,\n 'left': 1 * (roomHeight - 15)\n });\n $('#tutorial-label').css({\n 'left': (1 * (roomHeight - 15)) - 10\n });\n $('#pause-button').css({\n 'height': roomHeight - 30,\n 'width': roomHeight - 30,\n 'left': 2 * (roomHeight - 15)\n });\n $('#pause-label').css({\n 'left': 2 * (roomHeight - 15)\n });\n $('#item-dex').css({\n 'height': roomHeight - 30,\n 'width': roomHeight - 30,\n 'left': 3 * (roomHeight - 15)\n });\n $('#itemdex-label').css({\n 'left': 3 * (roomHeight - 15)\n });\n $('#animal-dex').css({\n 'height': roomHeight - 30,\n 'width': roomHeight - 30,\n 'left': 4 * (roomHeight - 15)\n });\n $('#animaldex-label').css({\n 'left': 4 * (roomHeight - 15)\n });\n $('#cheat-button').css({\n 'height': roomHeight - 30,\n 'width': roomHeight - 30,\n 'left': 5 * (roomHeight - 15)\n });\n $('#cheat-label').css({\n 'left': 5 * (roomHeight - 15)\n })\n $('#items-lbl').css({\n 'top': (roomHeight * 1.5) + 'px'\n });\n $('#crafting').css({\n 'top': (roomHeight * 2) + 'px'\n });\n $('#crafting-inv').css({\n 'top': (roomHeight * 4) + 'px'\n });\n $('#craft-btn').css({\n 'top': (roomHeight * 2.8) + 'px'\n });\n $('#craft-next').css({\n 'top': (roomHeight * 6.5) + 'px',\n 'width': roomHeight * 0.8\n });\n $('#dex-title').css({\n 'height': roomHeight,\n 'font-size': roomHeight / 2.5\n });\n $('#tut-close').css({\n 'height': roomHeight - 30,\n 'width': roomHeight - 30\n });\n $('#tut-prev').css({\n 'height': roomHeight - 30,\n 'width': roomHeight - 30\n });\n $('#tut-next').css({\n 'height': roomHeight - 30,\n 'width': roomHeight - 30\n });\n\n // makes it so there is no white space after the end of the rooms\n $('document').append('<div id=\"extraspace\"><br><br><br>' +\n '<br><br><br><br><br><br><br><br><br><br></div>');\n $('#extraspace').css({\n 'width': '100%',\n 'height': '100%',\n 'background-color': '#000000'\n });\n}", "title": "" }, { "docid": "432f4fe799abf84839a370594045880a", "score": "0.5955419", "text": "function computeSquares() {\n let s = 100 / squareTotal;\n for (var i = 0; i < (squareTotal*squareTotal); i++) {\n $(\"<div class='squares' style='width:\" + s + \"%; height:\" + s + \"%'></div>\").appendTo(gameScreen);\n }\n}", "title": "" }, { "docid": "18c1664c07eb3d0be6e06b6a5a8f3c45", "score": "0.5952921", "text": "function prepareOneSlideBox(slotholder,opt,visible) {\n\n\t\t\t\tvar sh=slotholder;\n\t\t\t\tvar img = sh.find('img')\n\t\t\t\tsetSize(img,opt)\n\t\t\t\tvar src = img.attr('src');\n\t\t\t\tvar bgcolor=img.css('background-color');\n\n\t\t\t\tvar w = img.data('neww');\n\t\t\t\tvar h = img.data('newh');\n\t\t\t\tvar fulloff = img.data(\"fxof\");\n\t\t\t\tif (fulloff==undefined) fulloff=0;\n\n\t\t\t\tvar fullyoff=img.data(\"fyof\");\n\t\t\t\tif (img.data('fullwidthcentering')!=\"on\" || fullyoff==undefined) fullyoff=0;\n\n\n\n\t\t\t\tvar off=0;\n\n\n\n\n\t\t\t\t// SET THE MINIMAL SIZE OF A BOX\n\t\t\t\tvar basicsize = 0;\n\t\t\t\tif (opt.sloth>opt.slotw)\n\t\t\t\t\tbasicsize=opt.sloth\n\t\t\t\telse\n\t\t\t\t\tbasicsize=opt.slotw;\n\n\n\t\t\t\tif (!visible) {\n\t\t\t\t\tvar off=0-basicsize;\n\t\t\t\t}\n\n\t\t\t\topt.slotw = basicsize;\n\t\t\t\topt.sloth = basicsize;\n\t\t\t\tvar x=0;\n\t\t\t\tvar y=0;\n\n\n\n\t\t\t\tfor (var j=0;j<opt.slots;j++) {\n\n\t\t\t\t\ty=0;\n\t\t\t\t\tfor (var i=0;i<opt.slots;i++) \t{\n\n\n\t\t\t\t\t\tsh.append('<div class=\"slot\" '+\n\t\t\t\t\t\t\t\t 'style=\"position:absolute;'+\n\t\t\t\t\t\t\t\t\t\t\t'top:'+(fullyoff+y)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'left:'+(fulloff+x)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'width:'+basicsize+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'height:'+basicsize+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'overflow:hidden;\">'+\n\n\t\t\t\t\t\t\t\t '<div class=\"slotslide\" data-x=\"'+x+'\" data-y=\"'+y+'\" '+\n\t\t\t\t\t\t\t\t 'style=\"position:absolute;'+\n\t\t\t\t\t\t\t\t\t\t\t'top:'+(0)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'left:'+(0)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'width:'+basicsize+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'height:'+basicsize+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'overflow:hidden;\">'+\n\n\t\t\t\t\t\t\t\t '<img style=\"position:absolute;'+\n\t\t\t\t\t\t\t\t\t\t\t'top:'+(0-y)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'left:'+(0-x)+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'width:'+w+'px;'+\n\t\t\t\t\t\t\t\t\t\t\t'height:'+h+'px'+\n\t\t\t\t\t\t\t\t\t\t\t'background-color:'+bgcolor+';\"'+\n\t\t\t\t\t\t\t\t 'src=\"'+src+'\"></div></div>');\n\t\t\t\t\t\ty=y+basicsize;\n\t\t\t\t\t}\n\t\t\t\t\tx=x+basicsize;\n\t\t\t\t}\n\t\t}", "title": "" }, { "docid": "0c525154f7d160624ee413ac4a1209d3", "score": "0.59500855", "text": "function setup() {\n\t // setup once\n\t if ( isSetup ) {\n\t return;\n\t }\n\t isSetup = true;\n\n\t // -------------------------- box sizing -------------------------- //\n\n\t /**\n\t * WebKit measures the outer-width on style.width on border-box elems\n\t * IE & Firefox<29 measures the inner-width\n\t */\n\t var div = document.createElement('div');\n\t div.style.width = '200px';\n\t div.style.padding = '1px 2px 3px 4px';\n\t div.style.borderStyle = 'solid';\n\t div.style.borderWidth = '1px 2px 3px 4px';\n\t div.style.boxSizing = 'border-box';\n\n\t var body = document.body || document.documentElement;\n\t body.appendChild( div );\n\t var style = getStyle( div );\n\n\t getSize.isBoxSizeOuter = isBoxSizeOuter = getStyleSize( style.width ) == 200;\n\t body.removeChild( div );\n\n\t}", "title": "" }, { "docid": "0c525154f7d160624ee413ac4a1209d3", "score": "0.59500855", "text": "function setup() {\n\t // setup once\n\t if ( isSetup ) {\n\t return;\n\t }\n\t isSetup = true;\n\n\t // -------------------------- box sizing -------------------------- //\n\n\t /**\n\t * WebKit measures the outer-width on style.width on border-box elems\n\t * IE & Firefox<29 measures the inner-width\n\t */\n\t var div = document.createElement('div');\n\t div.style.width = '200px';\n\t div.style.padding = '1px 2px 3px 4px';\n\t div.style.borderStyle = 'solid';\n\t div.style.borderWidth = '1px 2px 3px 4px';\n\t div.style.boxSizing = 'border-box';\n\n\t var body = document.body || document.documentElement;\n\t body.appendChild( div );\n\t var style = getStyle( div );\n\n\t getSize.isBoxSizeOuter = isBoxSizeOuter = getStyleSize( style.width ) == 200;\n\t body.removeChild( div );\n\n\t}", "title": "" }, { "docid": "8bcdcb06ee5b5e5987545383aed889ff", "score": "0.59443545", "text": "function createBox(num){\n\n\tlet clName = 'box';\n\tif(num > maxDay) clName = 'box-closed';\n\n\tnum = num.toString();\n\tlet elName = document.createElement('div');\n\telName.setAttribute('id', 'window' + num );\n\telName.setAttribute('class', clName);\n\n\tlet para = document.createElement(\"h3\");\n\tpara.innerHTML = num;\n\telName.appendChild(para);\n\treturn elName;\n}", "title": "" }, { "docid": "3049bec7f3e4bb47bc68e52b7239a186", "score": "0.5943909", "text": "function gridCreator(n) {\n\n let sqheight = Math.floor(container.clientHeight / n - 2);\n let sqwidth = Math.floor(container.clientHeight / n - 2);\n\n for (let i = 0; i < n; i++) {\n for (let j = 0; j < n; j++) {\n const square = document.createElement('div');\n square.classList.add('square-clear');\n square.setAttribute('id', 'square' + i + j);\n square.style.height = sqheight + \"px\";\n square.style.width = sqwidth + \"px\";\n container.appendChild(square);\n }\n\n }\n\n}", "title": "" }, { "docid": "3b94a49f6bb60afa4a488b44ac8099db", "score": "0.594192", "text": "function createBoard() {\n var boxDiv = document.getElementById(\"boxes\");\n for (var row = 0; row < HEIGHT; row++) {\n var boxRow = document.createElement(\"div\");\n boxRow.className = \"row\";\n for (var col = 0; col < WIDTH; col++) {\n var box = createBox(row, col);\n boxRow.appendChild(box);\n }\n boxDiv.appendChild(boxRow);\n }\n}", "title": "" }, { "docid": "18c561f704bad8ffe57ad5959ac2940d", "score": "0.5924341", "text": "function setDynamicSizes() { \n for (var m = 0; m < 3; m++) {\n \n //settings for the main CSS\n if (m === 0) {\n var media = '';\n var media2 = '';\n var size = 70;\n var units = 'vh';\n }\n \n //settings for the portrait mode CSS\n if (m === 1) {\n var media = '@media screen and (max-aspect-ratio: 35/48){ ';\n var media2 = '} ';\n var size = 96;\n var units = 'vw';\n }\n \n //settings for the landscape mode CSS\n if (m === 2) {\n var media = '@media screen and (min-aspect-ratio: 48/35){ ';\n var media2 = '} ';\n var size = 96;\n var units = 'vh';\n }\n var regularBlock = (size * 0.96) / gameState.gridSize;\n var clickFont = (size * (5 / 7)) / gameState.gridSize;\n var pigFont = (size * 0.25) / gameState.gridSize;\n\n //sets CSS pig sizes\n $('<style>')\n .text(media + '.sleepZ {font-size: ' + (regularBlock / 4) + units + '; font-size: ' + pigFont + units + ' }' + media2)\n .appendTo('head');\n $('<style>')\n .text(media + '.pigContainer {transform: scale(' + (8 / gameState.gridSize) + '); }' + media2)\n .appendTo('head');\n \n //sets width of the columns in CSS\n $('<style>')\n .text(media + '.row {width: ' + (size / gameState.gridSize) + units + '}' + media2)\n .appendTo('head');\n \n //sets size of the blocks in CSS\n $('<style>')\n .text(media + '.gameSquare { height:' + ((size / gameState.gridSize) - 0.5) + units + ';' + ' width: ' + ((size / gameState.gridSize) - 0.5) + units + ';' + ' border-radius: 1' + units + ';' + ' margin: 0.25' + units + '; font-size: ' + clickFont + units + '}' + media2)\n .appendTo('head');\n }\n}", "title": "" }, { "docid": "cef547e75dc81349d46be46994cec3b4", "score": "0.59074986", "text": "function createGrid(size){\n //create divs (boxes in the grid)\n for(i=0; i< size**2; i++){\n let addBox = document.createElement('div');\n addBox.classList.add('addBox');\n container.appendChild(addBox);\n \n\n \n }\n //makes each box in the grid equal in size\n if(size){\n container.style.gridTemplateColumns = \"repeat(\" + size + \",1fr)\";\n \n }\n\n //adds mouseover event to each box in the grid\n const boxColor = document.querySelectorAll('div.addBox');\n boxColor.forEach(boxColor => {\n boxColor.addEventListener('mouseover', changeColor);\n });\n //change the background color of the div on mouseover event\n function changeColor(e){\n e.target.style.background = 'blue';\n }\n \n}", "title": "" }, { "docid": "86afb025609fd0828cb2eb1386241b3b", "score": "0.59039986", "text": "function setup() {\n // setup once\n if ( isSetup ) {\n return;\n }\n isSetup = true;\n\n // -------------------------- box sizing -------------------------- //\n\n /**\n * WebKit measures the outer-width on style.width on border-box elems\n * IE & Firefox<29 measures the inner-width\n */\n var div = document.createElement('div');\n div.style.width = '200px';\n div.style.padding = '1px 2px 3px 4px';\n div.style.borderStyle = 'solid';\n div.style.borderWidth = '1px 2px 3px 4px';\n div.style.boxSizing = 'border-box';\n\n var body = document.body || document.documentElement;\n body.appendChild( div );\n var style = getStyle( div );\n\n getSize.isBoxSizeOuter = isBoxSizeOuter = getStyleSize( style.width ) == 200;\n body.removeChild( div );\n\n }", "title": "" }, { "docid": "8f9d94d9171d86675d8b9be0a375c755", "score": "0.590326", "text": "function styleBoxInfo(info){\n var content = $(document.createElement('div')).attr('class', 'contents-container');\n $(content).css({\n 'width': '700px',\n 'max-width': '100%',\n 'height': '200px',\n 'max-height': '100%',\n 'position': 'fixed',\n 'top': '50%',\n 'transform': 'translateY(-50%)',\n 'overflow-x': 'auto',\n });\n products = info.allProducts\n for(i=0; i<products.length; i++){\n var newdiv = $(document.createElement('div')).attr('class', 'content-div')\n newdiv.append(`<a href=\"${products[i].href}\"><img src=\"${products[i].img}\">`)\n newdiv.append(`<p>${products[i].name}</p>`)\n newdiv.append(`<p>${products[i].price}</p>`)\n newdiv.append(`<p>Quantiy: ${products[i].quantity}</p>`)\n $(newdiv).css({\n 'max-width': '170px',\n 'display': 'inline-block',\n 'vertical-align': 'top',\n 'margin-right': '20px',\n })\n $(content).append(newdiv)\n }\n return content;\n }", "title": "" }, { "docid": "2f35f01c2a159a10f78eddd83a541423", "score": "0.58943087", "text": "function setup() {\n // setup once\n if ( isSetup ) {\n return;\n }\n isSetup = true;\n\n // -------------------------- box sizing -------------------------- //\n\n /**\n * Chrome & Safari measure the outer-width on style.width on border-box elems\n * IE11 & Firefox<29 measures the inner-width\n */\n var div = document.createElement('div');\n div.style.width = '200px';\n div.style.padding = '1px 2px 3px 4px';\n div.style.borderStyle = 'solid';\n div.style.borderWidth = '1px 2px 3px 4px';\n div.style.boxSizing = 'border-box';\n\n var body = document.body || document.documentElement;\n body.appendChild( div );\n var style = getStyle( div );\n // round value for browser zoom. desandro/masonry#928\n isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200;\n getSize.isBoxSizeOuter = isBoxSizeOuter;\n\n body.removeChild( div );\n}", "title": "" }, { "docid": "2f35f01c2a159a10f78eddd83a541423", "score": "0.58943087", "text": "function setup() {\n // setup once\n if ( isSetup ) {\n return;\n }\n isSetup = true;\n\n // -------------------------- box sizing -------------------------- //\n\n /**\n * Chrome & Safari measure the outer-width on style.width on border-box elems\n * IE11 & Firefox<29 measures the inner-width\n */\n var div = document.createElement('div');\n div.style.width = '200px';\n div.style.padding = '1px 2px 3px 4px';\n div.style.borderStyle = 'solid';\n div.style.borderWidth = '1px 2px 3px 4px';\n div.style.boxSizing = 'border-box';\n\n var body = document.body || document.documentElement;\n body.appendChild( div );\n var style = getStyle( div );\n // round value for browser zoom. desandro/masonry#928\n isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200;\n getSize.isBoxSizeOuter = isBoxSizeOuter;\n\n body.removeChild( div );\n}", "title": "" }, { "docid": "2f35f01c2a159a10f78eddd83a541423", "score": "0.58943087", "text": "function setup() {\n // setup once\n if ( isSetup ) {\n return;\n }\n isSetup = true;\n\n // -------------------------- box sizing -------------------------- //\n\n /**\n * Chrome & Safari measure the outer-width on style.width on border-box elems\n * IE11 & Firefox<29 measures the inner-width\n */\n var div = document.createElement('div');\n div.style.width = '200px';\n div.style.padding = '1px 2px 3px 4px';\n div.style.borderStyle = 'solid';\n div.style.borderWidth = '1px 2px 3px 4px';\n div.style.boxSizing = 'border-box';\n\n var body = document.body || document.documentElement;\n body.appendChild( div );\n var style = getStyle( div );\n // round value for browser zoom. desandro/masonry#928\n isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200;\n getSize.isBoxSizeOuter = isBoxSizeOuter;\n\n body.removeChild( div );\n}", "title": "" }, { "docid": "2f35f01c2a159a10f78eddd83a541423", "score": "0.58943087", "text": "function setup() {\n // setup once\n if ( isSetup ) {\n return;\n }\n isSetup = true;\n\n // -------------------------- box sizing -------------------------- //\n\n /**\n * Chrome & Safari measure the outer-width on style.width on border-box elems\n * IE11 & Firefox<29 measures the inner-width\n */\n var div = document.createElement('div');\n div.style.width = '200px';\n div.style.padding = '1px 2px 3px 4px';\n div.style.borderStyle = 'solid';\n div.style.borderWidth = '1px 2px 3px 4px';\n div.style.boxSizing = 'border-box';\n\n var body = document.body || document.documentElement;\n body.appendChild( div );\n var style = getStyle( div );\n // round value for browser zoom. desandro/masonry#928\n isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200;\n getSize.isBoxSizeOuter = isBoxSizeOuter;\n\n body.removeChild( div );\n}", "title": "" }, { "docid": "2f35f01c2a159a10f78eddd83a541423", "score": "0.58943087", "text": "function setup() {\n // setup once\n if ( isSetup ) {\n return;\n }\n isSetup = true;\n\n // -------------------------- box sizing -------------------------- //\n\n /**\n * Chrome & Safari measure the outer-width on style.width on border-box elems\n * IE11 & Firefox<29 measures the inner-width\n */\n var div = document.createElement('div');\n div.style.width = '200px';\n div.style.padding = '1px 2px 3px 4px';\n div.style.borderStyle = 'solid';\n div.style.borderWidth = '1px 2px 3px 4px';\n div.style.boxSizing = 'border-box';\n\n var body = document.body || document.documentElement;\n body.appendChild( div );\n var style = getStyle( div );\n // round value for browser zoom. desandro/masonry#928\n isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200;\n getSize.isBoxSizeOuter = isBoxSizeOuter;\n\n body.removeChild( div );\n}", "title": "" }, { "docid": "2f35f01c2a159a10f78eddd83a541423", "score": "0.58943087", "text": "function setup() {\n // setup once\n if ( isSetup ) {\n return;\n }\n isSetup = true;\n\n // -------------------------- box sizing -------------------------- //\n\n /**\n * Chrome & Safari measure the outer-width on style.width on border-box elems\n * IE11 & Firefox<29 measures the inner-width\n */\n var div = document.createElement('div');\n div.style.width = '200px';\n div.style.padding = '1px 2px 3px 4px';\n div.style.borderStyle = 'solid';\n div.style.borderWidth = '1px 2px 3px 4px';\n div.style.boxSizing = 'border-box';\n\n var body = document.body || document.documentElement;\n body.appendChild( div );\n var style = getStyle( div );\n // round value for browser zoom. desandro/masonry#928\n isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200;\n getSize.isBoxSizeOuter = isBoxSizeOuter;\n\n body.removeChild( div );\n}", "title": "" }, { "docid": "2f35f01c2a159a10f78eddd83a541423", "score": "0.58943087", "text": "function setup() {\n // setup once\n if ( isSetup ) {\n return;\n }\n isSetup = true;\n\n // -------------------------- box sizing -------------------------- //\n\n /**\n * Chrome & Safari measure the outer-width on style.width on border-box elems\n * IE11 & Firefox<29 measures the inner-width\n */\n var div = document.createElement('div');\n div.style.width = '200px';\n div.style.padding = '1px 2px 3px 4px';\n div.style.borderStyle = 'solid';\n div.style.borderWidth = '1px 2px 3px 4px';\n div.style.boxSizing = 'border-box';\n\n var body = document.body || document.documentElement;\n body.appendChild( div );\n var style = getStyle( div );\n // round value for browser zoom. desandro/masonry#928\n isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200;\n getSize.isBoxSizeOuter = isBoxSizeOuter;\n\n body.removeChild( div );\n}", "title": "" }, { "docid": "05ce4a9dc7f28b21335eab2eac711d00", "score": "0.5888628", "text": "function getHeight(_box){\n\tvar dummy = document.createElement(\"div\");\n\tdummy.id = \"content-box\";\n\tdummy.style.position = \"relative\";\n\tdummy.style.zIndex = -9;\n\tdummy.style.bottom = 1000000;\n\tdummy.innerHTML = _box[0].innerHTML;\n\tdummy.style.height = \"100%\";\n\t$(\"body\").append(dummy);\n\t\n\tvar val = 1.0 * $(dummy).height() + \"px\";\n\t\n\treturn val;\n\n\t\t\n}", "title": "" }, { "docid": "3b228f5731d9941f11912f95c784825a", "score": "0.5885427", "text": "function setBox(){\n model.box = {\n x: 0,\n y: 0,\n width: runtime.div.clientWidth,\n height: runtime.div.clientHeight\n };\n }", "title": "" }, { "docid": "8d994facbbb12620e6bad4ae5f52d00d", "score": "0.5877579", "text": "function setup() {\n // setup once\n if (isSetup) {\n return;\n }\n isSetup = true;\n\n // -------------------------- box sizing -------------------------- //\n\n /**\n * WebKit measures the outer-width on style.width on border-box elems\n * IE & Firefox<29 measures the inner-width\n */\n var div = document.createElement('div');\n div.style.width = '200px';\n div.style.padding = '1px 2px 3px 4px';\n div.style.borderStyle = 'solid';\n div.style.borderWidth = '1px 2px 3px 4px';\n div.style.boxSizing = 'border-box';\n\n var body = document.body || document.documentElement;\n body.appendChild(div);\n var style = getStyle(div);\n\n getSize.isBoxSizeOuter = isBoxSizeOuter = getStyleSize(style.width) == 200;\n body.removeChild(div);\n\n }", "title": "" }, { "docid": "22799e5163ba47f7158ef3888c8c0d0e", "score": "0.58691", "text": "function resize(viz, bounding_box) {\n _X1 = bounding_box.p1.x;\n _Y1 = bounding_box.p1.y;\n _X2 = bounding_box.p2.x;\n _Y2 = bounding_box.p2.y;\n _W = _X2 - _X1;\n _H = _Y2 - _Y1;\n _radius = Math.min(.5 * _W / 16, .5 * _H / 10);\n _rootPos = {cx:_W / 2, cy:_Y1 + 1.5 * _radius};\n _nextNodePos = {cx:_X1 + 1.5 * _radius, cy:_Y1 + 1.5 * _radius};\n _xOffset = 2 * _radius;\n _yOffset = 3 * _radius;\n _someSpace = .1 * _radius;\n if (viz)\n _resize(viz);\n }", "title": "" }, { "docid": "18bfaf903646472fba1139efc2e1846d", "score": "0.585947", "text": "function newSize() {\n\n $(\".square\").remove();\n\n var inputSquares = parseFloat(prompt(\"How many boxes (0 - 100) do you want on each side? \" + \" Press 'Cancel' for default grid.\"));\n\n if(isNaN(inputSquares) || (inputSquares < 1 || inputSquares > 100)) {\n createGrid(rowGrid);\n } else {\n createGrid(inputSquares);\n }\n}", "title": "" }, { "docid": "168f3f6b043dc529a093c2c1f6b091dc", "score": "0.58475137", "text": "function createGrid() {\n for (let i = 0; i < pixelNumber; i++) {\n drawBox();\n }\n // mobile check\n let k = window.mobileCheck();\n\n makeLength(k);\n\n readyPixels();\n}", "title": "" }, { "docid": "a7a1125354f038fc509735760aeb1cf1", "score": "0.5840009", "text": "function createBoxes(boxColor) {\n $('body').append('<div class=\"' + boxColor + '\"></div>');\n $el = $('body').children().last()\n $el.css('background-color', boxColor);\n $el.append('<img src=\"thumbs-up.png\" />');\n }", "title": "" }, { "docid": "7e5f1fb6fc8c3c4d9ace72823799b968", "score": "0.58370376", "text": "function create_grid(input){\n\t\tif ((input >= 1) && (input <= 128))\n\t\t{\n\t\t\tbox_size = $('#grid_container').width()/input - 2;\n\t\t\tfor (i= 0; i <=input; i++){\n\t\t\t\tfor(j = 0; j <= input; j++){\n\t\t\t\t\t$('#grid_container').append('<div class=\"grid_border\"><div class=\"grid_square\"></div></div>');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t$('.grid_border').css('height', box_size);\n\t\t\t$('.grid_border').css('width', box_size);\n\t\t\t$('.grid_square').css('height', box_size);\n\t\t\t$('.grid_square').css('width', box_size);\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\talert(\"Invalid input\");\n\t\t}\n\t\tTrail_Value(value);\n\t\n\t}", "title": "" }, { "docid": "35218a931b913f500e482482ef3726a8", "score": "0.5829545", "text": "function fitBox(box){var minBoxSize=helpers.findNextWhere(minBoxSizes,function(minBox){return minBox.box===box;});if(minBoxSize){if(box.isHorizontal()){var scaleMargin={left:Math.max(totalLeftBoxesWidth,maxHorizontalLeftPadding),right:Math.max(totalRightBoxesWidth,maxHorizontalRightPadding),top:0,bottom:0};// Don't use min size here because of label rotation. When the labels are rotated, their rotation highly depends\n// on the margin. Sometimes they need to increase in size slightly\nbox.update(box.fullWidth?chartWidth:maxChartAreaWidth,chartHeight/2,scaleMargin);}else{box.update(minBoxSize.minSize.width,maxChartAreaHeight);}}}// Update, and calculate the left and right margins for the horizontal boxes", "title": "" } ]
7caf4c988bae90aff959582f10ce4ce5
Return a list of Trial objects. A large part of the work of defining the experiment takes place here, although the key properties are actually defined in the Governor definition. The trials defined here are the master list used by the Governor to decide which stimuli to serve, which advisor or choice to offer, etc. This list is not necessarily the same as the trial list established at the beginning of the experiment and handed to jsPsych. It is therefore the responsibility of the programmer to ensure that these lists are lawfully aligned such that the block structures, etc. match. A possible alternative strategy push new trials to the jsPsych timeline at the end of each completed trial. Since we don't get nice progress bar this way we may as well use onthefly timeline tweaking. This may just be more work to duplicate jsPsych's capabilities, though
[ { "docid": "c09f37ea4331be0511ed0f71730d7ee4", "score": "0.65652674", "text": "getTrials() {\n\t \tlet trials = [];\n let id = 0;\n let realId = 0;\n let blockCount = this.blockStructure.length * this.blockCount;\n let practiceBlockCount = this.practiceBlockStructure.length; \n \n // Shuffle which side the correct answer appears on\n let whichSideDeck = utils.shuffleShoe([0, 1], utils.sumList(this.blockStructure));\n \n // Define trials\n for (let b=0; b<practiceBlockCount+blockCount; b++) {\n let blockIndex = b; // the block we're in\n if (b >= practiceBlockCount) {\n blockIndex = (b-practiceBlockCount)%this.blockStructure.length; // account for practice blocks\n }\n let blockLength = b<practiceBlockCount? utils.sumList(this.practiceBlockStructure[blockIndex]) :\n utils.sumList(this.blockStructure[blockIndex]);\n // Work out what type of trial to be\n let trialTypeDeck = []; \n let structure = b<practiceBlockCount?\n this.practiceBlockStructure[blockIndex] : this.blockStructure[blockIndex];\n }\n\n\n for (let tt=0; tt<Object.keys(trialTypes).length; tt++) {\n for (let i=0; i<structure[tt]; i++)\n trialTypeDeck.push(tt);\n }\n trialTypeDeck = utils.shuffle(trialTypeDeck);\n for (let i=1; i<=blockLength; i++) {\n id++;\n let isPractice = b<practiceBlockCount;\n let trialType = trialTypeDeck.pop();\n let left;\n let right;\n let larger;\n \n // Below we retrieve the configs, advice and confidences (if relevant) used for the trial\n // This is only for data recording purposes after the experiment.\n\n \t\t\t// trialTypes = {\n \t\t\t// baseline: 0, // no interference, simple task switching between WM and discriination\n \t\t\t// encoding: 1, // WM interference overlaps with stimulus presentation/encoding\n \t\t\t// response: 2, // WM interference overlaps with response mapping\n \t\t\t// confj: 3, // WM interference overlaps with providing confjudgement\n \t\t\t// };\n \t\t\tif (trialType == 1) {}\n \n else if (trialType == 2) {}\n \n else {\n left = null;\n right = null;\n larger = null; \n \n \ttrials.push(new Trial(id, {\n type: trialType,\n typeName: 'Orien', // may need to change? was 'dot'\n block: b,\n answer: [NaN, NaN],\n confidence: [NaN, NaN],\n getCorrect: function(finalAnswer = true) {\n let answer = finalAnswer? this.answer[1] : this.answer[0];\n return answer === this.whichSide;\n },\n whichSide: isPractice? Math.round(Math.random()) : whichSideDeck[realId],\n practice: isPractice,\n feedback: isPractice,\n warnings: [],\n stimulusDrawTime: [],\n stimulusOffTime: [],\n fixationDrawTime: [], \n leftGrid: left,\n rightGrid: right,\n whereLarger: larger\n \t}));\n if (!isPractice)\n realId++;\n }\n }\n return trials;\n\n\t }", "title": "" } ]
[ { "docid": "47a49a7b9e70f94c064517530513dd95", "score": "0.6071815", "text": "function initTrial() {\r\n\r\n\t// Get Trials\r\n\tvar data = getData(preExptTrialFile);\r\n\r\n\tvar records = data.split(\"\\n\");\r\n\tnumTrials = records.length - 1;\r\n\tfor (var i = 1; i <= numTrials; i++) {\r\n\t\tvar cells = records[i].split(\",\");\r\n\t\tvar menuType = cells[0].trim();\r\n\t\tvar menuDepth = cells[1].trim();\r\n var menuBreadth = cells[2].trim();\r\n\t\tvar targetItem = cells[3].trim();\r\n\t\ttrialsData[i] = {\r\n\t\t\t'Menu Type': menuType,\r\n\t\t\t'Menu Depth': menuDepth,\r\n 'Menu Breadth': menuBreadth,\r\n\t\t\t'Target Item': targetItem\r\n\t\t};\r\n\t}\r\n\r\n\t// Get trial Menus\r\n\tvar trialMenuL1Data = getData(preExptTrialMenuL1File);\r\n\tvar trialMenuL2Data = getData(preExptTrialMenuL2File);\r\n\r\n\ttrialMarkingMenuL1 = formatMarkingMenuData(trialMenuL1Data);\r\n trialMarkingMenuL2 = formatMarkingMenuData(trialMenuL2Data);\r\n trialRadialMenuL1 = formatRadialMenuData(trialMenuL1Data);\r\n trialRadialMenuL2 = formatRadialMenuData(trialMenuL2Data);\r\n \r\n\t// Get Menus\r\n\tvar menuL1Data = getData(menuL1File);\r\n\tvar menuL2Data = getData(menuL2File);\r\n var menuL3Data = getData(menuL3File);\r\n var menuL1B6Data = getData(menuL1B6File);\r\n var menuL2B6Data = getData(menuL2B6File);\r\n\tvar menuL3B6Data = getData(menuL3B6File);\r\n\t\r\n\t// Format CSV Menu to respective Menu structures\r\n\tmarkingMenuL1 = formatMarkingMenuData(menuL1Data);\r\n\tmarkingMenuL2 = formatMarkingMenuData(menuL2Data);\r\n\tmarkingMenuL3 = formatMarkingMenuData(menuL3Data);\r\n markingMenuL1B6 = formatMarkingMenuData(menuL1B6Data);\r\n markingMenuL2B6 = formatMarkingMenuData(menuL2B6Data);\r\n markingMenuL3B6 = formatMarkingMenuData(menuL3B6Data);\r\n\tradialMenuL1 = formatRadialMenuData(menuL1Data);\r\n\tradialMenuL2 = formatRadialMenuData(menuL2Data);\r\n\tradialMenuL3 = formatRadialMenuData(menuL3Data);\r\n radialMenuL1B6 = formatRadialMenuData(menuL1B6Data);\r\n\tradialMenuL2B6 = formatRadialMenuData(menuL2B6Data);\r\n\tradialMenuL3B6 = formatRadialMenuData(menuL3B6Data);\r\n\t\r\n\t\r\n\t//Start the first trial\r\n\tnextTrial();\r\n}", "title": "" }, { "docid": "34da83167ad3d63ed30fb03dc49dccf7", "score": "0.59392416", "text": "function all_task_trials(){\n\tmerge_iaps = all_pofa_trials();\n\tmerge_pofa = all_iaps_trials();\n\tmerge_task = _.merge({}, merge_iaps, merge_pofa)\n\treturn merge_task\n}", "title": "" }, { "docid": "314b2a8b81c4b11c7ba55d5344bab508", "score": "0.5937337", "text": "function assembleTrials(section, trialSpecs, params) {\n // Unpack keyMapping.\n const yesKey = params[\"keyMapping\"][\"yes\"]\n const noKey = params[\"keyMapping\"][\"no\"]\n\n // Assemble trials.\n const trials = []\n\n // Add section welcome block containing high-level instructions.\n if (section == \"demo\") {\n sectionPages = \"<p>We will begin with a slowed-down PRACTICE section \" + \n \"in which we will guide you through the task. Please pay \" + \n \"close attention to the instructions.</p><p>Press the <b>'Next'</b> \" + \n \"button to proceed.</p>\"\n }\n else if (section == \"practice\") {\n sectionPages = \"Now we will do some more practice, this time a little \" +\n \"faster.\"\n } else if (section == \"experiment\") {\n sectionPages = \"<p>You have completed the practice session. Everything \" + \n \"you see after this is the <b>real experiment</b>. The images will \" + \n \"be faster than before.</p>\"\n }\n const welcomeBlock = {\n type: \"instructions\",\n pages: [sectionPages],\n show_clickable_nav: true \n }\n trials.push(welcomeBlock)\n\n // Add trials.\n for (i = 0; i < trialSpecs.length; i++) {\n \n // Add inter-trial iterval (iti).\n var itiStimulus = \"<div style='font-size:50px; color:white'>+</div>\"\n if (section == \"demo\") {\n itiStimulus += \"<p>Look at the cross.</p>\"\n }\n const iti = {\n type: \"html-keyboard-response\",\n stimulus: itiStimulus,\n choices: jsPsych.NO_KEYS,\n trial_duration: params.itiDur,\n data: {\n type: \"iti\",\n trial_num: trialSpecs[i].trial_num,\n block_num: trialSpecs[i].block_num,\n section: section\n }\n }\n\n // Determine stimulus type.\n const extraData = deepCopy(trialSpecs[i])\n extraData.section = section\n const stimName = trialSpecs[i].fname\n if (trialSpecs[i].role == \"target\") {\n // Add target.\n extraData.type = \"target\"\n const targetPath = params.stimDir + stimName\n const target_trial = {\n type: \"image-keyboard-response\",\n stimulus: targetPath,\n stimulus_height: params.stimSize,\n stimulus_width: params.stimSize,\n choices: jsPsych.ALL_KEYS,\n prompt: \"<p>Please look carefully at \" +\n \"the image above.</p><p>You are about to see a series \" +\n \"of images. For each image, press the <b>\" + yesKey + \"</b> key if \" +\n \"the image is <b>exactly</b> the same as <b>this one</b>, \" + \n \"and the <b>\" + noKey + \"</b> key if it is not.</p><p>Respond as \" + \n \"quickly and accurately as possible. In between images, look \" + \n \"at the white cross. Remember to take a close look at the image \" + \n \"above before you start.</p><p>When you are ready, press any \" + \n \"key to begin.</p>\",\n response_ends_trial: true,\n data: extraData\n }\n trials.push(target_trial)\n trials.push(iti)\n\n } else {\n // Add stimulus.\n extraData.type = \"option\"\n const stimPath = params.stimDir + stimName\n var stimText = \"\"\n if (section == \"demo\"){\n stimText += \"<p>Exactly the same as the target?</p>\"\n }\n const stim_trial = {\n type: \"image-keyboard-response\",\n stimulus: stimPath,\n stimulus_height: params.stimSize,\n stimulus_width: params.stimSize,\n choices: jsPsych.NO_KEYS, // no responses permitted during stimulus\n prompt: stimText,\n stimulus_duration: null,\n trial_duration: params.stimDur,\n response_ends_trial: false,\n data: extraData\n }\n trials.push(stim_trial)\n\n // Select mask (if required).\n if (maskCondition !== \"nomask\") {\n // Add mask (randomly sampled).\n if (maskCondition == \"scramble\") {\n // Ensure scramble mask does not match stimulus shape or texture.\n if (stimCondition == \"baker\") {\n // Does not match shape or texture class.\n maskName = sampleNonmatchMask(maskNames, trialSpecs[i].shape_class, \n trialSpecs[i].texture_class) \n } else if (stimCondition == \"gst\") {\n maskName = sampleNonmatchMask(maskNames, trialSpecs[i].shape, \n trialSpecs[i].texture) \n }\n } else {\n maskName = _.sample(maskNames)\n }\n var maskPath = params.maskDir + maskName\n }\n \n // Add mask trial.\n var maskText = \"\"\n if (section == \"demo\"){\n if (i == 0 || i == 1) {\n if (maskCondition !== \"nomask\") {\n maskText += \"<p>(Ignore the image above.)</p>\"\n }\n }\n maskText += \"<p>Respond now ('\" + yesKey + \"' for same, '\" + noKey + \n \"' for different)</p>\"\n }\n\n if (maskCondition == \"nomask\") {\n var maskResponseStimulus = \"<div style='font-size:50px; color:red'>+</div>\"\n\n var maskTrial = {\n type: \"html-keyboard-response\",\n stimulus: maskResponseStimulus,\n choices: jsPsych.ALL_KEYS,\n prompt: maskText,\n stimulus_duration: null,\n trial_duration: params.maskDur,\n response_ends_trial: false,\n data: {\n type: \"mask\",\n mask_fname: null,\n fname: trialSpecs[i].fname,\n shape: trialSpecs[i].shape,\n texture: trialSpecs[i].texture,\n role: trialSpecs[i].role,\n target: trialSpecs[i].target,\n trial_num: trialSpecs[i].trial_num,\n block_num: trialSpecs[i].block_num,\n section: section\n },\n // Define data collection function.\n on_finish: function(data) {\n // Determine response type (true positive, false negative, etc.) \n // and whether correct.\n data = assessResponse(data, yesKey, noKey)\n maskOnFinish(data, section, yesKey, noKey)\n }\n }\n } else {\n var maskTrial = {\n type: \"image-keyboard-response\",\n stimulus: maskPath,\n stimulus_height: params.stimSize,\n stimulus_width: params.stimSize,\n choices: jsPsych.ALL_KEYS,\n prompt: maskText,\n stimulus_duration: null,\n trial_duration: params.maskDur,\n response_ends_trial: false,\n data: {\n type: \"mask\",\n mask_fname: maskName,\n fname: trialSpecs[i].fname,\n shape: trialSpecs[i].shape,\n texture: trialSpecs[i].texture,\n role: trialSpecs[i].role,\n target: trialSpecs[i].target,\n trial_num: trialSpecs[i].trial_num,\n block_num: trialSpecs[i].block_num,\n section: section\n },\n // Define data collection function.\n on_finish: function(data) {\n // Determine response type (true positive, false negative, etc.) \n // and whether correct.\n data = assessResponse(data, yesKey, noKey)\n maskOnFinish(data, section, yesKey, noKey)\n }\n }\n }\n trials.push(maskTrial)\n trials.push(iti)\n }\n }\n return trials\n}", "title": "" }, { "docid": "91917d4ea565216ab9ba206bbffd190b", "score": "0.5879996", "text": "function nextTrial() {\n //Reset variables\n circles = [];\n\n if (practiceCount == NUMBER_OF_PRACTICE_TRIALS) {\n $('#practice-completed').foundation('reveal', 'open');\n practiceCount++;\n startBlocks();\n return;\n }\n \n if (practiceCount < NUMBER_OF_PRACTICE_TRIALS) {\n practiceCount++;\n } else {\n $( \"#progressbar\" ).progressbar({\n value: (blockCount - 1)*NUMBER_OF_TRIAL_SETS*NUMBER_OF_TRIALS + (trialSetCount - 1) * NUMBER_OF_TRIALS + trialCount\n });\n var trial_time = Date.now() - start_time;\n\n //Export tracking data\n var trial_data = [ip_address,\n inputDevice,\n writingHand,\n bubbleCursor ? 'bubble' : 'regular',\n a, w, ewr, d,\n blockCount,\n trialSetCount,\n trialCount,\n trial_time/1000];\n logs.push(trial_data);\n\n //Updates progression of experiment.\n //function will return true when the experiment is completed.\n if(updateExperiment()) {\n $('#experiment-completed').foundation('reveal', 'open');\n return;\n }\n $('#progress').html(\"trial: \" + trialCount +\n \", set: \" + trialSetCount +\n \", block: \" + blockCount +\n \", Last trial's time: \"+ trial_time/1000 +\n ' seconds.');\n } \n\n block_index++;\n var trial = block_trials[block_index];\n \n //Set globals\n a = trial.a;\n w = trial.w;\n ewr = trial.ewr;\n d = trial.d;\n\n drawStart(ctx, w)\n drawGoal(canvas, ctx, a, w);\n drawFour(canvas, ctx, ewr, w);\n drawDistracters(canvas, ctx, d, w, ewr);\n\n start_time = Date.now();\n }", "title": "" }, { "docid": "3e0eee1dbeb7f5f57a323fa4de5ad9c2", "score": "0.58036566", "text": "_prepareSequence()\n\t{\n\t\tconst response = {\n\t\t\torigin: \"TrialHandler._prepareSequence\",\n\t\t\tcontext: \"when preparing a sequence of trials\",\n\t\t};\n\n\t\t// get an array of the indices of the elements of trialList:\n\t\tconst indices = Array.from(this.trialList.keys());\n\n\t\tif (this._method === TrialHandler.Method.SEQUENTIAL)\n\t\t{\n\t\t\tthis._trialSequence = Array(this.nReps).fill(indices);\n\t\t\t// transposed version:\n\t\t\t// this._trialSequence = indices.reduce( (seq, e) => { seq.push( Array(this.nReps).fill(e) ); return seq; }, [] );\n\t\t}\n\t\telse if (this._method === TrialHandler.Method.RANDOM)\n\t\t{\n\t\t\tthis._trialSequence = [];\n\t\t\tfor (let i = 0; i < this.nReps; ++i)\n\t\t\t{\n\t\t\t\tthis._trialSequence.push(util.shuffle(indices.slice(), this._randomNumberGenerator));\n\t\t\t}\n\t\t}\n\t\telse if (this._method === TrialHandler.Method.FULL_RANDOM)\n\t\t{\n\t\t\t// create a flat sequence with nReps repeats of indices:\n\t\t\tconst flatSequence = [];\n\t\t\tfor (let i = 0; i < this.nReps; ++i)\n\t\t\t{\n\t\t\t\tflatSequence.push.apply(flatSequence, indices);\n\t\t\t}\n\n\t\t\t// shuffle the sequence:\n\t\t\tutil.shuffle(flatSequence, this._randomNumberGenerator);\n\n\t\t\t// reshape it into the trialSequence:\n\t\t\tthis._trialSequence = [];\n\t\t\tfor (let i = 0; i < this.nReps; i++)\n\t\t\t{\n\t\t\t\tthis._trialSequence.push(flatSequence.slice(i * this.nStim, (i + 1) * this.nStim));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow Object.assign(response, { error: \"unknown method\" });\n\t\t}\n\n\t\treturn this._trialSequence;\n\t}", "title": "" }, { "docid": "4c61c9df1be8c7542e444eba5badb7c7", "score": "0.578822", "text": "function logTrialData() {\n data.push({\n counterbalancing_order: counterbalances[_counterbalance_index].counterbalancing_order,\n index: _index++,\n trial: trials[currentTrialNumber].trial,\n response_time: Date.now() - trialStartTime,\n cb_time_elapsed: Date.now() - experimentStartTime,\n time_elapsed: Date.now() - _startTime\n });\n }", "title": "" }, { "docid": "7494ffa89ad0e3fa4bc9544eb5444697", "score": "0.57096297", "text": "nextTrial(x) {\r\n this.experiment.nextTrial();\r\n \r\n }", "title": "" }, { "docid": "a9097d0c0d8ef4e38894f18c0c244d21", "score": "0.5643906", "text": "function all_pofa_trials(){\n\tpofa_task = {};\n\t//task\n\tconsole.log('settings.blocks: ' + settings.blocks)\n\tfor (var j = 0; j <= (settings.blocks); ++j) {\n\t\t//blocks\n\t\tvar pofa_block = {};\n\t\t//generate two random trials and add to trialNum to make 12 trials\n\t\trand = _.shuffle([0,1,2,3,4,5,6,7,8,9]).slice(8)\n\t\ttrialNum = _.shuffle([0,1,2,3,4,5,6,7,8,9,rand[0],rand[1]])\n\t\tfor (var i = 0; i <= (trialNum.length-1); ++i) {\n\t\t\t//trials\n\t\t\tpofa_trial = pofa[trialNum[i]];\n\t\t\tpofa_block[\"p\"+i] = pofa_trial;\n\t\t};\n\t\tpofa_task[j] = pofa_block;\n\t};\n\treturn pofa_task;\n}", "title": "" }, { "docid": "10105ea84f83bd0954bfc68cffa0ab73", "score": "0.56188965", "text": "createData(trial) {\n let score = trial.score;\n let rank = trial.Rank;\n let criteriaMatch = JSON.parse(trial.criteriaMatch);\n let type = criteriaMatch.type;\n let allocation = criteriaMatch.allocation;\n let age = criteriaMatch.age;\n let gender = criteriaMatch.gender;\n let condition = criteriaMatch.condition;\n let inclusion = criteriaMatch.inclusion;\n let exclusion = criteriaMatch.exclusion;\n let includeDrug = criteriaMatch.includeDrug;\n let excludeDrug = criteriaMatch.excludeDrug;\n\n let name = trial.Study.ProtocolSection.IdentificationModule.BriefTitle;\n\n return {score, rank, type, allocation, age, gender, name, condition, inclusion, exclusion, includeDrug, excludeDrug};\n }", "title": "" }, { "docid": "1c8548ffb1c9d5ce0ada38baf7ba2db9", "score": "0.55837125", "text": "nextTrial() {\r\n //if all trials are done, the experiment is over\r\n if (this.trialsCompleted >= this.trialsTotal) {\r\n this.endCallback();\r\n }\r\n else {\r\n this.trialsCompleted += 1;\r\n this.loadNextTrial(this.trialsCompleted, this.trialsTotal);\r\n }\r\n }", "title": "" }, { "docid": "75edf8d497ca9e8cf90ea1a49b002db7", "score": "0.5466832", "text": "function initExperiment() {\r\n\r\n\t// Get Trails\r\n\tvar data = getData(trialsFile[ID-1]);\r\n nextButton.innerHTML = \"Next\";\r\n actualExperiment = true;\r\n\tvar records = data.split(\"\\n\");\r\n currentTrial = 1;\r\n\tnumTrials = records.length - 1;\r\n\tfor (var i = 1; i <= numTrials; i++) {\r\n\t\tvar cells = records[i].split(\",\");\r\n\t\tvar menuType = cells[0].trim();\r\n\t\tvar menuDepth = cells[1].trim();\r\n var menuBreadth = cells[2].trim();\r\n\t\tvar targetItem = cells[3].trim();\r\n\t\ttrialsData[i] = {\r\n\t\t\t'Menu Type': menuType,\r\n\t\t\t'Menu Depth': menuDepth,\r\n 'Menu Breadth': menuBreadth,\r\n\t\t\t'Target Item': targetItem\r\n\t\t};\r\n\t}\r\n\r\n\r\n\t//Start the first trial\r\n\tnextTrial();\r\n}", "title": "" }, { "docid": "ed62fd08b96d001e948be700abff4d22", "score": "0.5456424", "text": "function threePlayerTrialStructure(repetitions = 1) {\n let blueprints = [];\n let i = 1;\n const outcomes = [1, 2];\n const statuses = [1, 2];\n const recipients = [0, 1, 2];\n\n for(let o of outcomes)\n for(let s of statuses)\n for(let r of recipients)\n blueprints.push({\n trial: i++,\n outcome: o,\n status: s,\n getsout: r\n });\n\n return jsPsych.randomization.repeat(blueprints, repetitions);\n}", "title": "" }, { "docid": "212bd4c470d0b8f78bd5f9213d6571fe", "score": "0.54427737", "text": "function run_trial(stim, exp_this) {\n\n // Sets up initial display (sans objects, etc.)\n $(\"button, .grid, .object, .error, .speech, .slider, .mc, .blanket, .label, #freeform, #followup_title, #trials_text, #generic_text\").hide();\n $(\".container, .table, .background\").show();\n\n // Agent greets user\n if (stim.type == \"greeting\") {\n\n // Display greeting setup (background, agent, visible speech bubble)\n agent_straight(stim.agent);\n change_image(\"background\", \"images/back\" + stim.background + \".jpg\");\n $(\".speech-bubble\").css(\"left\", \"10px\");\n $(\".speech-bubble-tail, .speech-bubble-outline\").css(\"right\", \"475px\");\n\n // Greeting text and audio\n let greeting = \"Hello! I've been doing research on this planet for a while.\";\n let hello = new Audio(\"audio/\" + stim.speaker + \"_recordings/hello_been_researching.mp3\");;\n if ((stim.item_presentation_condition == \"accidental\") || (stim.item_presentation_condition == \"naive\")) {\n greeting = \"Hello! I am a new researcher. I just arrived on this planet.\";\n hello = new Audio(\"audio/\" + stim.speaker + \"_recordings/hello_new_researcher.mp3\");\n }\n hello.play();\n\n agent_say(greeting, stim.trial_num, 4000).then(\n\n // Continue to next subtrial slide\n function() {\n $(\"#continue_button1\").show();\n }\n\n );\n\n // Agent remarks on objects (number and name) on table\n } else if (stim.type == \"on_the_table\") {\n\n // Display objects on table\n set_table(stim, true);\n\n let on_the_table;\n let on_the_table_audio;\n let wait_time = 3500;\n\n // Create grammatically correct remark and fetch correct audio file\n if (stim.item_presentation_condition == \"pedagogical\") {\n if (stim.n_examples > 1) {\n on_the_table = \"Here we have some \" + stim.item_name[1] + \" on the table.\";\n on_the_table_audio = new Audio(\"audio/\" + stim.speaker + \"_recordings/here_\" + stim.item_name[1] + \".mp3\");\n } else {\n on_the_table = \"Here we have a \" + stim.item_name[0] + \" on the table.\";\n on_the_table_audio = new Audio(\"audio/\" + stim.speaker + \"_recordings/here_\" + stim.item_name[0] + \".mp3\");\n }\n } else if ((stim.item_presentation_condition == \"accidental\") || (stim.item_presentation_condition == \"naive\")) {\n on_the_table = \"Hmm, I wonder what we have here on the table.\";\n on_the_table_audio = new Audio(\"audio/\" + stim.speaker + \"_recordings/hmm_i_wonder.mp3\");\n }\n on_the_table_audio.play()\n\n // Agent remarks on objects on the table\n agent_say(on_the_table, stim.trial_num, wait_time);\n\n setTimeout (function() {\n _stream.apply(exp_this);\n }, wait_time);\n\n } else if (stim.type == \"oh_i_see\") {\n\n // Display objects on table\n set_table(stim, true);\n\n let wait_time = 4000;\n let oh_i_see = \"Oh, I see! These are \" + stim.item_name[1] + \".\";\n let oh_i_see_audio = new Audio(\"audio/\" + stim.speaker + \"_recordings/oh_\" + stim.item_name[1] + \".mp3\");;\n if (stim.n_examples == 1) {\n oh_i_see = \"Oh, I see! This is a \" + stim.item_name[0] + \".\";\n oh_i_see_audio = new Audio(\"audio/\" + stim.speaker + \"_recordings/oh_\" + stim.item_name[0] + \".mp3\");\n }\n\n agent_say(oh_i_see, stim.trial_num, wait_time);\n oh_i_see_audio.play();\n setTimeout (function() {\n _stream.apply(exp_this);\n }, wait_time);\n\n } else if (stim.type == \"agent_knowledge\") {\n\n set_table(stim, true)\n let agent_knowledge = \"I don't know anything about \" + stim.item_name[1] + \".\";;\n let knowledge_audio = new Audio(\"audio/\" + stim.speaker + \"_recordings/idk_\" + stim.item_name[1] + \".mp3\");\n\n if (stim.item_presentation_condition == \"pedagogical\") {\n agent_knowledge = \"I know all about \" + stim.item_name[1] + \".\";\n knowledge_audio = new Audio(\"audio/\" + stim.speaker + \"_recordings/i_know_\" + stim.item_name[1] + \".mp3\");\n }\n\n knowledge_audio.play();\n\n let wait_time = 3000;\n agent_say(agent_knowledge, stim.trial_num, wait_time).then(\n function() {\n // Continues to next subtrial slide\n $(\"#continue_button1\").show();\n }\n );\n\n\n // No visuals: only text (generic statement) is displayed\n } else if (stim.type == \"text\") {\n\n $(\".agent, .object, .error, .speech, .blanket, .label, .table, .background, .slider, .continue_button, #freeform\").hide();\n\n let generic_statement = stim.item_name[1][0].toUpperCase() + stim.item_name[1].slice(1) + \" have \" + stim.property;;\n if (stim.property == \"squeaking\") {\n generic_statement = stim.item_name[1][0].toUpperCase() + stim.item_name[1].slice(1) + \" squeak\";\n }\n\n $(\"#generic_text\").text(\"\\\"\" + generic_statement + \".\\\"\");\n\n if (stim.trial_num == 1) {\n $(\"#trials_text\").text(\"You come across a scientist. The scientist tells you:\");\n } else {\n $(\"#trials_text\").text(\"You come across another scientist. The scientist tells you:\");\n }\n\n // Continue to next subtrial\n $(\"#trials_text, #generic_text, #continue_button1\").show();\n\n // Agent gives generic statement — this is only for gen+ped, generic, and generic_no_visual conditions\n } else if (stim.type == \"tell_you\") {\n\n // Display objects on table\n set_table(stim, true);\n\n if (stim.item_presentation_condition == \"generic_no_visual\") {\n $(\".object, .label, .blanket\").hide();\n };\n\n let audio_timeout = 1500;\n\n // Create grammatically correct generic statement\n let property = stim.object[2];\n let say_text = \"\"\n let say_property;\n if (property == \"squeaking\") {\n say_text = stim.item_name[1][0].toUpperCase() + stim.item_name[1].slice(1) + \" squeak.\";\n say_property = new Audio(\"audio/\" + stim.speaker + \"_recordings/\" + stim.item_name[1] + \"_\" + \"squeak\" + \".mp3\");\n } else {\n say_text = stim.item_name[1][0].toUpperCase() + stim.item_name[1].slice(1) + \" have \" + property + \".\";\n audio_timeout += 250;\n\n if (property == \"purple petals\") {\n say_property = new Audio(\"audio/\" + stim.speaker + \"_recordings/\" + stim.item_name[1] + \"_have_purple_petals.mp3\");\n } else if (property == \"green feathers\") {\n say_property = new Audio(\"audio/\" + stim.speaker + \"_recordings/\" + stim.item_name[1] + \"_have_green_feathers.mp3\");\n }\n }\n\n let something_to_tell = new Audio(\"audio/\" + stim.speaker + \"_recordings/i_have_something_to_tell_you.mp3\");\n something_to_tell.play();\n agent_say(\"I have something to tell you.\", stim.trial_num, 2000).then(\n\n function() {\n\n\n let deferred = new $.Deferred();\n\n // Agent says generic statement\n agent_say(say_text, stim.trial_num, 1500);\n say_property.play();\n\n setTimeout (function() {\n deferred.resolve();\n }, audio_timeout);\n\n return deferred.promise();\n }\n\n ).then(\n\n // Continues to next subtrial slide\n function() {\n $(\"#continue_button1\").show();\n }\n\n );\n\n // Trial\n } else if (stim.type == \"trial\") {\n\n // Display objects on table\n set_table(stim, true);\n\n if (stim.object[0] == \"bird\") {\n $(\".object1.open\").css(\"right\", \"219px\");\n $(\".object2.open\").css(\"right\", \"146px\");\n $(\".object3.open\").css(\"right\", \"73px\");\n $(\".object4.open\").css(\"right\", \"0px\");\n } else if (stim.object[0] == \"flower\") {\n $(\".open\").css(\"height\", \"95.5px\");\n }\n\n // Previously shown objects are still displayed\n counter;\n for (counter=1; counter < stim.exemplar_num; counter++) {\n change_image(\"closed\", \"images/\" + stim.object[1] + \"_closed.svg\");\n $(\".blanket\" + counter + \".blanket_up\").hide();\n $(\".blanket\" + counter + \".blanket_down\").show();\n $(\".label\" + counter).hide();\n };\n\n // Agent and speech bubble position adjust to active object\n let agent_right_val = (360 - (stim.exemplar_num - 1)*73) + \"px\";\n let speech_bubble_val = (10 + (stim.exemplar_num -1)*73) + \"px\";\n let speech_tail_val = (475 - (stim.exemplar_num - 1)*73) + \"px\";\n $(\".\" + stim.agent + \"_straight\").css(\"right\", agent_right_val);\n $(\".\" + stim.agent + \"_point_r\").css(\"right\", agent_right_val);\n $(\".speech-bubble\").css(\"left\", speech_bubble_val);\n $(\".speech-bubble-tail\").css(\"right\", speech_tail_val);\n $(\".speech-bubble-outline\").css(\"right\", speech_tail_val);\n\n // Accidental item presentation\n if (stim.item_presentation_condition == \"accidental\") {\n\n poke_blanket_fall(stim).then(\n\n // Agent says \"Oops!\"\n function() {\n\n\n let deferred = new $.Deferred();\n\n agent_say(\"Oops!\", stim.trial_num);\n oops = new Audio(\"audio/\" + stim.speaker + \"_recordings/oops.mp3\");\n oops.play();\n\n setTimeout (function() {\n deferred.resolve();\n }, 1000);\n\n return deferred.promise();\n }\n\n ).then(\n\n // Speech bubble hides, object returns to \"closed\" position\n function() {\n $(\".speech\").hide();\n effect_remark_close(stim);\n }\n\n );\n\n // Naive item presentation\n } else if (stim.item_presentation_condition == \"naive\") {\n\n let say_text = \"Let's take a look.\";\n let lets_look = new Audio(\"audio/\" + stim.speaker + \"_recordings/lets_take_a_look.mp3\");\n if (stim.exemplar_num > 1) {\n say_text = \"Let's look at another one.\";\n lets_look = new Audio(\"audio/\" + stim.speaker + \"_recordings/lets_look_another_one.mp3\");\n }\n lets_look.play();\n\n\n agent_say(say_text, stim.trial_num, 2000).then(\n\n // Agent pokes blanket and blanket falls\n function() {\n\n\n let deferred = new $.Deferred();\n\n poke_blanket_fall(stim);\n\n setTimeout (function() {\n deferred.resolve();\n }, 1200);\n\n return deferred.promise();\n }\n\n ).then(\n\n // Speech bubble disappears, object \"closes\" and disappears\n function() {\n $(\".speech\").hide();\n effect_remark_close(stim);\n }\n\n );\n\n // Pedagogical item presentation\n } else if ((stim.item_presentation_condition == \"pedagogical\") || (stim.item_presentation_condition == \"gen+ped\")) {\n\n let say_text = \"Let me show you another one.\";\n let show_you = new Audio(\"audio/\" + stim.speaker + \"_recordings/let_me_show_another.mp3\");\n if (stim.exemplar_num == 1) {\n say_text = \"Let me show you something.\"\n show_you = new Audio(\"audio/\" + stim.speaker + \"_recordings/let_me_show_you.mp3\");\n }\n show_you.play();\n\n agent_say(say_text, stim.trial_num, 2000).then(\n\n // Agent pokes blanket and blanket falls\n function() {\n\n\n let deferred = new $.Deferred();\n\n poke_blanket_fall(stim);\n\n setTimeout (function() {\n deferred.resolve();\n }, 1200);\n\n return deferred.promise();\n }\n\n ).then(\n\n // Agent says, \"Watch this!\"\n function() {\n\n\n let deferred = new $.Deferred();\n\n watch = new Audio(\"audio/\" + stim.speaker + \"_recordings/watch_this.mp3\");\n watch.play();\n\n agent_say(\"Watch this!\", stim.trial_num);\n\n setTimeout (function() {\n deferred.resolve();\n }, 1250);\n\n return deferred.promise();\n }\n\n ).then(\n\n // Speech bubble disappears, object \"closes\" and disappears\n function() {\n $(\".speech\").hide();\n effect_remark_close(stim);\n }\n\n );\n\n }\n }\n}", "title": "" }, { "docid": "2c2481148fe09147ef3ec9633323b92d", "score": "0.5390173", "text": "get raceReplays_TrialsTab() {return browser.element(\"~Trials\");}", "title": "" }, { "docid": "54bfc2d8f1ebebaae4fa19c0a605f5ca", "score": "0.5237804", "text": "function getTrainees() {\n\t\t\t//for each batch, add the trainees to an overall list of trainees\n\t\t\tallBatches.forEach(function (batch) {\n\t\t\t\tbatch.trainees.forEach(function (trainee) {\n\t\t\t\t\t$scope.allTrainees.push(trainee);\n\t\t\t\t});\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "24c851329504c278bfda9c0386788d0f", "score": "0.52035093", "text": "function newTrial(retry){\n current_trial = current_trial + 1;\n\n if(retry != true){\n // pulls a random combination from the array of combinations\n var this_combination = Math.floor(Math.random()*combination_array.length);\n var current_pair = combination_array[this_combination]\n }\n if(combination_array.length == 0){\n console.log(\"finished!\");\n printToServer();\n }\n trial_objects.push(current_pair);\n console.log(trial_objects);\n combination_array.splice(this_combination, 1);\n var index1 = Math.floor(Math.random()*2);\n var index2;\n if(index1 == 1){\n index2 = 0;\n }\n else{\n index2 = 1;\n }\n console.log(combination_array);\n\n var stimulus_one = createStimulus(current_pair[index1]);\n var stimulus_two = createStimulus(current_pair[index2]);\n\n\n\n \n\n // create ranking\n if(current_pair[index1].rank < current_pair[index2].rank){\n current_pair[index1].correct = true;\n }\n else{\n current_pair[index2].correct = true;\n }\n}", "title": "" }, { "docid": "97370c63d1fb0d6d190c0dc2f4dab26b", "score": "0.5191439", "text": "function getTribesData(data) {\n if (!data.assigneesOverview) {\n return;\n }\n var assignments = data.assigneesOverview;\n var tribes = {};\n var _t;\n for (var i in assignments) {\n if (assignments.hasOwnProperty(i)) {\n for (var j = 0, max2 = assignments[i].tribes.length; j < max2; j++) { // for each user's tribe\n _t = assignments[i].tribes[j];\n if (!tribes[_t.name]) {\n tribes[_t.name] = new SynergyModels.TribeRunStats(_t.name, _t.id, tribesSpecs);\n }\n tribes[_t.name].addAssignment(assignments[i].assignments); // all assignments for given user\n }\n }\n }\n return $scope.SYNERGY.util.toIndexedArray(tribes);\n }", "title": "" }, { "docid": "67d1d90e9b30fd9928a94ac3ef8f9737", "score": "0.5188049", "text": "function migrateToTrialLegacy(req, res){\n // Only admins should be allowed to perform this operation\n lConst = lConst || this.serviceManager.get(\"lic\").lib.Const;\n if( ! ( ( req.user.role === lConst.role.admin ) || ( req.user.role === lConst.role.reseller ) ) ) {\n this.requestUtil.errorResponse(res, \"lic.access.invalid\");\n return;\n }\n var planInfo = {\n type: \"trialLegacy\",\n seats: \"school\"\n };\n var stripeInfo = {};\n var instructors;\n var failures;\n var index = 0;\n failures = {};\n this.myds.getAllInstructorsNonCustomers()\n .then(function(results){\n instructors = results;\n function _subscribeInstructor(input, userId, stripeInfo, planInfo){\n return when.promise(function(resolve, reject){\n _createSubscription.call(this, input, userId, \"NULL\", stripeInfo, planInfo)\n .then(function(status){\n if(status === \"duplicate customer account\"){\n failures[input.user.id] = \"lic.records.invalid\";\n return;\n }\n if(status === \"account inactive\"){\n failures[input.user.id] = \"lic.account.inactive\";\n return;\n }\n if(status === \"po-pending\"){\n failures[input.user.id] = \"lic.order.pending\";\n return;\n }\n if(status === \"already on a license\"){\n failures[input.user.id] = \"lic.access.invited\";\n return;\n }\n }.bind(this))\n .then(function(){\n resolve()\n })\n .then(null, function(err){\n console.errorExt(\"LicService\", \"Create Trial Legacy User Error -\", err);\n err.errorUserId = userId;\n err.instructors = instructors;\n err.index = index;\n reject(err);\n });\n }.bind(this));\n }\n var _subscribeInstructor = _subscribeInstructor.bind(this);\n var promiseList = [];\n instructors.forEach(function(instructor){\n var input = {};\n instructor.email = instructor.EMAIL;\n instructor.firstName = instructor.FIRST_NAME;\n instructor.lastName = instructor.LAST_NAME;\n input.user = instructor;\n var userId = instructor.id;\n promiseList.push(_subscribeInstructor(input, userId, stripeInfo, planInfo));\n }.bind(this));\n return when.reduce(promiseList, function(index, result){\n index++;\n return index;\n }, index);\n }.bind(this))\n .then(function(){\n var keys = Object.keys(failures);\n if(keys.length > 0){\n // if some user was not added to trialLegacy, check to see if that should be the case, investigate particular error\n // if a user was already on a license in some way, such as being an invited teacher, they should be in check\n this.requestUtil.jsonResponse(res, { status: \"not all legacies\", check: failures });\n return;\n }\n this.requestUtil.jsonResponse(res, { status: \"ok\" });\n }.bind(this))\n .then(null, function(err){\n console.errorExt(\"LicService\", \"Migrate to Trial Legacy Error -\",err);\n this.requestUtil.errorResponse(res, err, 500);\n }.bind(this));\n}", "title": "" }, { "docid": "b2b4d5d2d95e22762539661b6a7b0773", "score": "0.51537776", "text": "getRequirements() \n {\n let requirements = [];\n \n _.forEach(requirementsToTest, (requirementToTest) => {\n \n /** \n * Check this requirement at a particular interval\n */\n if((Game.time % (requirementToTest.interval + 1)) !== requirementToTest.interval) {\n return;\n }\n \n /**\n * Test whether this requirement is already in progress, we don't need to recreate it otherwise!\n */\n if(this.alreadyHasRequirement(requirementToTest.name)) {\n return;\n }\n \n /**\n * Create a new instance of whatever the requirement to test is\n */\n const requirement = new requirementToTest.requirement(this.structure);\n \n /**\n * Test whether the requirement rules pass - If they do, it looks like we'll have a job on our hands.\n */\n if(requirement.test(this.buildingCompleted)) {\n Helper.addRequirement(this.structure.id, requirementToTest.name);\n requirements.push(requirement.getResolution(requirementToTest.name));\n }\n });\n \n return requirements;\n }", "title": "" }, { "docid": "fb2efe2b086b4ca2d41e12b6e342c666", "score": "0.5144969", "text": "function trial() {\n /* update counter display */\n $(\".countDisplay\").html((trialCount + 1) + \" /\" + trialArray.length + \" trials\");\n\n /* present target stim */\n $(\"#survival\").hide();\n $(\"#pleasantness\").hide();\n $(\"#imagery\").hide();\n $(\"#selfReference\").hide();\n\n $(\"#targetWord\").html(trialArray[trialCount].word.toUpperCase())\n $(\"#1-target\").show();\n $(\"#\" + trialArray[trialCount].encodingCondition).show();\n /* get timestamp for stim presentation */\n time1 = new Date().getTime();\n\n}", "title": "" }, { "docid": "bae54a64092357f99488497706a8d495", "score": "0.5070988", "text": "function end_trial(){\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // kill keyboard listeners\n if (typeof keyboardListener !== 'undefined') {\n jsPsych.pluginAPI.cancelKeyboardResponse(keyboardListener);\n }\n\n // save data\n var trialdata = {\n \"target_stimulus\": trial.target_stimulus,\n \"test_stimulus\": trial.test_stimulus,\n \"target_blur\": trial.targetBlur,\n \"blur_rt\": response.rt,\n \"blur_response\": response.response,\n \"attention_probe\": trial.attentionProbe,\n \"attention_delay\": trial.attentionProbeDelay,\n \"attention_duration\" : trial.attentionProbeDuration,\n \"attention_rt\": attentionResponse.rt,\n \"attention_response\": attentionResponse.key,\n\n };\n\n display_element.innerHTML = '';\n\n // TESTING DATA COLLECTION\n // console.log(trialdata);\n // console.log(response.response);\n // console.log(attentionResponse.rt);\n // console.log(attentionResponse.key);\n\n // next trial\n jsPsych.finishTrial(trialdata);\n }", "title": "" }, { "docid": "ffbbbacb03bb6e792161b991df9603b3", "score": "0.5052924", "text": "loadNextTrial(n, total) {\r\n \r\n }", "title": "" }, { "docid": "bd0ca448f1ea5690047033671a732793", "score": "0.5018984", "text": "function generateJobSkills() { \n return []\n}", "title": "" }, { "docid": "7908c2ff4c2005b8f52cccb7ddffbef8", "score": "0.5004148", "text": "getTurns() {\n const path = this._buildGetTurns();\n return this._requester.get(path)\n .then(response => response.map(turn => new Turn(turn, this._requester)));\n }", "title": "" }, { "docid": "2f65a2d27e1db8c33ce30fa8ec97d430", "score": "0.50036496", "text": "function getInfoFromTrials(field) {\r\n\tvar names = [];\r\n\t$.each(clinicalTrialCollection.models,\r\n\t\t//push all unique strings\r\n\t\tfunction (i, trial) {\r\n\t\t\tif ($.inArray(trial.attributes[field], names) === -1 && trial.attributes[field] !== \"\" && trial.attributes[field].charAt(0) !== \"(\") {\r\n\t\t\t\tnames.push(trial.attributes[field]);\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n\treturn names;\r\n}", "title": "" }, { "docid": "6432e40852e40cc9f3ff08c03d626e70", "score": "0.49962154", "text": "function buildTable_Money(trial_index){\n let table = introString();\n const addRowEnd = \"</tr>\";\n\n // build first row of table (yourself) \n table += selfBasic(); \n\n // build row of table for each player\n for(i = 0; i < numPlayers; i++) {\n table += (otherBasic(dummyPlayers[i]) + addRowEnd);\n }\n table += \"</table></div><br></br>\";\n return table; \n}", "title": "" }, { "docid": "4a8d90c9749847fa9cea0ceec2a2d04f", "score": "0.49671388", "text": "function assessPerformance() {\n\t/* Function to calculate the \"credit_var\", which is a boolean used to\n\tcredit individual experiments in expfactory. \n\t */\n\n\t// Extrait les trials correspondant aux essais\n\t//\n\tjsPsych.data.displayData()\n\n\t// Filtre les trials correspondant à des réponses pendant la phase de test\n\t//\n\tvar experiment_data = jsPsych.data.get().filter({exp_stage:'test', trial_id:'stim'})\n\t//\n\t// Calcule \t1. Le nombre de réponses correctes\n\t//\t\t\t2. Le nombre de réponses incorrectes\n\t//\t\t\t3. Le nombre d'absence de réponses (RT = 0)\n\t//\t\t\t4. La médiane de l'ensemble des temps de réaction\n\t//\t\t\t5. Les médianes selon les 4 possibilités de cue\n\t//\t\t\t6. Les médianes selon les 2 possibilités de flanker (car neutre exclu)\n\t//\n\tvar correct_count = 0\n\tvar incorrect_count = 0\n\tvar omission_count = 0\n\tvar rt_correct = []\n\tvar rt_correct_nocue = []\n\tvar rt_correct_double = []\n\tvar rt_correct_spatial = []\n\tvar rt_correct_center = []\n\tvar rt_correct_congruent = []\n\tvar rt_correct_incongruent = []\n\t\n\tfor (var i=0; i<experiment_data.count(); i++) {\t\t\t\t\t\t\t\n\t\trt = experiment_data.select('rt').values[i]\n\t\tif (rt == 0) {\n\t\t\tomission_count++\n\t\t}\n\t\telse if (experiment_data.select('correct').values[i] === true) {\n\t\t\t\tcorrect_count++\n\t\t\t\trt_correct.push(rt)\n\t\t\t\t//\n\t\t\t\tswitch (experiment_data.select('cue').values[i]) {\n\t\t\t\t\tcase 'nocue':\n\t\t\t\t\t\trt_correct_nocue.push(rt)\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'double':\n\t\t\t\t\t\trt_correct_double.push(rt)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'spatial':\n\t\t\t\t\t\trt_correct_spatial.push(rt)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'center':\n\t\t\t\t\t\trt_correct_center.push(rt)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t//\n\t\t\t\tswitch (experiment_data.select('flanker_type').values[i]) {\n\t\t\t\t\tcase 'congruent':\n\t\t\t\t\t\trt_correct_congruent.push(rt)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'incongruent':\n\t\t\t\t\t\trt_correct_incongruent.push(rt)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse { incorrect_count++ }\n\t}\n\t\n\tif (rt_correct!=0) {\n\t\tvar median_rt = math.median(rt_correct)\n\t\tvar se_rt = median_rt/math.sqrt(correct_count)\n\t} else {\n\t\tvar median_rt = -999\n\t\tvar se_rt = -999\n\t}\n\t\n\tif (rt_correct_nocue.length!=0) {\n\t\tvar median_nocue = math.median(rt_correct_nocue)\n\t} else { var median_nocue = -999 }\n\n\tif (rt_correct_double.length!=0) {\n\t\tvar median_double = math.median(rt_correct_double)\n\t} else { var median_double = -999 }\n\n\tif (rt_correct_center.length!=0) {\n\t\tvar median_center = math.median(rt_correct_center)\n\t} else { var median_center = -999 }\n\n\tif (rt_correct_spatial.length!=0) {\n\t\tvar median_spatial = math.median(rt_correct_spatial)\n\t} else { var median_spatial = -999 }\n\n\tif (rt_correct_congruent.length!=0) {\n\t\tvar median_congruent = math.median(rt_correct_congruent)\n\t} else { var median_congruent = -999 }\n\n\tif (rt_correct_incongruent.length!=0) {\n\t\tvar median_incongruent = math.median(rt_correct_incongruent)\n\t} else { var median_incongruent = -999 }\n\n\t// Sortie provisoire sur la console\n\t//\n\tconsole.log(\"Nombre d'omissions: \", omission_count)\n\tconsole.log(\"Nombre de réponses: \", correct_count + incorrect_count)\n\tconsole.log(\"Nombre de réponses correctes au total: \", correct_count)\n\tconsole.log(\"Nombre d'erreurs au total: \", incorrect_count)\n\tconsole.log(\"Médianes des RT pour réponses correctes: \", median_rt)\n\tconsole.log(\"ES des médianes des RT pour les réponses correctes: \", se_rt)\n//\n\tif (median_nocue==-999 || median_double==-999) {\n\t\tconsole.log(\"La variable Alerte ne peut être calculée...\")\n\t} else { console.log(\"Alerte: \", median_nocue - median_double) }\n//\n\tif (median_center==-999 || median_spatial==-999) {\n\t\tconsole.log(\"La variable Orientation ne peut être calculée...\")\n\t} else { console.log(\"Orientation: \", median_center - median_spatial) }\n//\n\tif (median_incongruent==-999 || median_congruent==-999) {\n\t\tconsole.log(\"La variable Conflict ne peut être calculée...\")\n\t} else { console.log(\"Conflict: \", median_incongruent - median_congruent) }\n}", "title": "" }, { "docid": "a82288525376c311c8b03efae0ae8c8a", "score": "0.49313813", "text": "function getIdeaTl(){\n \n var ideaTL = new TimelineMax({repeat: -1, repeatDelay: 3});\n\n\t\tideaTL\n .fromTo($truck, 6, {x: -1150, y: 0, ease:Power0.ease}, {x: -710, y: 0, ease:Power0.easeOut})\n .to($truck, 0.2, {opacity:0})\n .set($truck,{x: -0, y: 0, opacity:0})\n .to($truck, 0.2, {opacity:1})\n .fromTo($truck, 6, {x: -0, y: 0, ease:Power0.ease}, {x: 450, y: 0, ease:Power0.easeOut})\n\t\t\t\n\t\treturn ideaTL;\n \n \n\t}", "title": "" }, { "docid": "89560f2b6fed989eeb81001043448a31", "score": "0.49282736", "text": "function get_trains(){\r\n\t\tall_trains = [];\r\n\t\tscene.children.forEach(child =>{\r\n\t\t\tif (child.name.startsWith(train_name)){\r\n\t\t\t\tall_trains.push(child);\r\n\t\t\t}\r\n\t\t});\r\n\t\tall_campate = [];\r\n\t\tall_trains.forEach(t=>{\r\n\t\t\tt.children.forEach(child => {\r\n\t\t\t\tif (child.name !=\"Helper\") { \r\n\t\t\t\t\tall_campate.push(child)\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "05a423537c8010712f49f90ba2296c44", "score": "0.49259913", "text": "function genExpSeq() {\n 'use strict';\n\n let exp = [];\n\n exp.push(fullscreen_on);\n exp.push(welcome_de_du);\n exp.push(resize_de_du);\n exp.push(vpInfoForm_de);\n exp.push(hideMouseCursor);\n exp.push(screenInfo);\n exp.push(task_instructions1);\n exp.push(task_instructions2);\n\n for (let blk = 0; blk < prms.nBlks; blk += 1) {\n let blk_timeline = { ...trial_timeline };\n blk_timeline.repetitions = 1;\n if (blk > 0) {\n exp.push(task_reminder);\n }\n exp.push(blk_timeline); // trials within a block\n exp.push(block_feedback); // show previous block performance\n }\n exp.push(debrief_de);\n exp.push(showMouseCursor);\n exp.push(alphaNum);\n exp.push(fullscreen_off);\n\n return exp;\n}", "title": "" }, { "docid": "82adde49ccb07ccd9ec31ff9f5725066", "score": "0.49201372", "text": "function getNumberOfWantedTrials() {\r\n if (choiceParadigmType == ChoiceParadigmEnum.SAMPLING) {\r\n return problemData[choiceSetCounter][2];\r\n } else {\r\n return 100; // default number of trials before participant is forced into the choosing phase\r\n // TODO make this a constant?\r\n }\r\n}", "title": "" }, { "docid": "635016ed5dd5b2ce0d259ba253e4c9cc", "score": "0.491704", "text": "async function getTrendingTrails() {\n try {\n // Fetch all comment data\n let commentResponse = await fetch('/comments')\n let commentData = await commentResponse.json()\n let commentOnlyArray = []\n if (commentResponse.ok) {\n commentOnlyArray = [...commentData]\n }\n\n // Fetch all form submission data\n let formResponse = await fetch('/questionnaires')\n let formData = await formResponse.json()\n let actArray = []\n if (formResponse.ok) {\n actArray = [...commentOnlyArray, ...formData]\n }\n \n // Create object containing tally of every trail id\n let actObject = {}\n actArray.map(value=>{\n if (actObject[value.trail_id] === undefined && value.trail_id !== null) {\n actObject[value.trail_id] = 1\n } else if (actObject[value.trail_id] !== undefined && value.trail_id !== null){\n actObject[value.trail_id] += 1\n }\n })\n \n // Sort from descending order the trail ids\n let actKeys = Object.keys(actObject)\n let sortedActKeys = actKeys.sort((a,b) => {\n if (actObject[a] === actObject[b]) return 0\n else if (actObject[a] > actObject[b]) return -1\n else return 1\n })\n\n // Fetch trail data from the top 4 trail ids \n let trailResponse = await fetch(`https://www.hikingproject.com/data/get-trails-by-id?ids=${`${sortedActKeys[0]},${sortedActKeys[1]},${sortedActKeys[2]},${sortedActKeys[3]},`}&key=${props.apiKey}`)\n let trailData = await trailResponse.json()\n if(trailResponse.ok) {\n setFeaturedTrails(trailData.trails)\n }\n } catch (err) {\n console.log(err)\n }\n }", "title": "" }, { "docid": "fcb60206090d5c27d8b9a2465d0061aa", "score": "0.4915462", "text": "function getFromLocalStorage() {\r\n let goalsLS = getGoalFromLS()\r\n\r\n // Loop through courses and print into cart\r\n goalsLS.forEach(goal => {\r\n const li = document.createElement('li')\r\n const addTask = document.createElement('span')\r\n li.append(addTask)\r\n addTask.innerText = goal\r\n ulGoals.appendChild(addTask)\r\n });\r\n}", "title": "" }, { "docid": "4993147247edb14978283c3aff82acf4", "score": "0.49142256", "text": "getSimplestPrerequisites(course) {\n const prerequisites = [];\n const { skillsNeeded } = course;\n for (let skill in skillsNeeded) {\n const simplestCourse = this.skillTree[skill].top();\n prerequisites.push(simplestCourse)\n }\n return prerequisites;\n }", "title": "" }, { "docid": "bf0ae450511c7c77b66dd9894e2c369c", "score": "0.49118692", "text": "function endTrial() {\n if (trialCount != trialArray.length - 1) {\n trialCount++; /* increase trial counter by one */\n /* automatically starts next trial / run function blank after \"feedbackLength\" milliseconds */\n eventTimer.setTimeout(blank, feedbackLength);\n } else {\n /* END OF EXPERIMENT */\n /* send up-to-date data set to parent window */\n expEnd = new Date().getTime();\n summarizeData();\n $(\".targetDisplay\").hide();\n\n $(\"#switchRT\").text(summary.RTSwitch.toFixed(0));\n $(\"#switchACC\").text((summary.ACCSwitch * 100).toFixed(0));\n $(\"#repeatRT\").text(summary.RTRepeat.toFixed(0));\n $(\"#repeatACC\").text((summary.ACCRepeat * 100).toFixed(0));\n createRTChart();\n createErrorChart();\n $(\".resultsDisplay\").show();\n }\n}", "title": "" }, { "docid": "7ffef2958901fbb5941c9c6fc019abd6", "score": "0.49109992", "text": "function runMonteCarloTrial(numTrials, n, p) {\n\treturn Array(numTrials)\n\t\t.fill(0)\n\t\t.map((_) => binomialRun(n, p));\n}", "title": "" }, { "docid": "c6ec3ef7c0f12e7f27079069a46442ac", "score": "0.4901075", "text": "function generate_qa_steps(outcome, steps, results, note, screenshot, check_metadata, check_urls,\n check_images, check_links, check_videos, check_downloads, check_language, check_cross_browsing,\n environment, check_chrome, check_ff, check_ie, notify) {\n\n qa_results =\n\n \"{panel:title=*QA Testing Results*|borderStyle=double|borderColor=#F4E8FF|titleBGColor=#9966CC|bgColor=#FFFFFF|titleColor=#FFFFFF}\" + \"\\n\" +\n \"h3. {color:#292929}*OUTCOME*{color}\" + \"\\n\" +\n \"h4. \" + outcome + \"\\n\" + \" \" + \"\\n\" +\n\n \"----\" + \"\\n\" +\n \"h3. Replication Steps\" + \"\\n\";\n for (var i = 0, l = steps.length; i < l; i++ ) {\n steps[i].trim() ? qa_results += \"# \" + steps[i] + `\\n` : qa_results +=`\\n`;\n }\n\n qa_results += \" \" + \"\\n\" +\n\n \"h3. Results\" + \"\\n\";\n for (var i = 0, l = results.length; i < l; i++ ) {\n results[i].trim() ? qa_results += \"* \" + results[i] + `\\n` : qa_results +=`\\n`;\n }\n\n qa_results += \" \" + \"\\n\" +\n\n \"h3. Notes\" + \"\\n\";\n for (var i = 0, l = note.length; i < l; i++ ) {\n note[i].trim() ? qa_results += \"* \" + note[i] + `\\n` : qa_results +=`\\n`;\n }\n\n qa_results += \" \" + \"\\n\" +\n\n \"h3. Screenshots\" + \"\\n\";\n if(screenshot){\n for (var i = 0, l = screenshot.length; i < l; i++ ) {\n screenshot[i].trim() ? qa_results += `* !` + screenshot[i] + `.png|thumbnail!` + `\\n`: qa_results +=`\\n`;\n } \n }\n\n qa_results += \n\n \" \" + \"\\n\" +\n \"h3. Routine Checks\" + \"\\n\" +\n \"* Metadata (<title>, SiteCatalyst, description): \" + check_metadata + \"\\n\" +\n \"* URLs: \" + check_urls + \"\\n\" +\n \"* Images display properly: \" + check_images + \"\\n\" +\n \"* All links operational: \" + check_links + \"\\n\" +\n \"* Videos playable: \" + check_videos + \"\\n\" +\n \"* Download Buttons: \" + check_downloads + \"\\n\" +\n \"* Language consistency: \" + check_language + \"\\n\" +\n \"* Cross Browsing: \" + check_cross_browsing + \"\\n\" + \" \" + \"\\n\" +\n\n \"h3. Environment\" + \"\\n\" +\n \"* \" + environment + \"\\n\" + \" \" + \"\\n\" +\n\n \"h3. Browsers tested\" + \"\\n\" +\n \"* \" + check_chrome + \", \" + check_ff + \", \" + check_ie + \"\\n\" +\n\n \"{panel}\" + \"\\n\" +\n \"h4. FYI\" + \"\\n\" +\n notify;\n\n copy_to_clipboard(qa_results)\n}", "title": "" }, { "docid": "835df745fe7a86b3765ae44109871761", "score": "0.48981863", "text": "export_trial_data() {\n\n var csv = 'condition,trial_num,sub_condition,balanced_sub_condition,high_ref,estimated_mid,low_ref,num_adjustments,trials_per_round,error,sum_rt,num_points,mean,SD,num_SD,round_type,step_size,point_color,background_color,text_color,axis_color,point_size,regen_rate\\n';\n // Get most recent subcondition - will have the max subcondition value\n var max_sub_condition = jsPsych.data.get().filter({type: 'stevens', run_type: 'test'}).last(1).values()[0].sub_condition;\n var data = [];\n\n // Iterate through each sub condition\n for (let i = 0; i<=max_sub_condition; i++){\n var condition_data = jsPsych.data.get().filter({type: 'stevens', run_type: 'test', sub_condition: i})\n .filterCustom(function(x){ //Don't include trials with no user input\n return x.rt != null;\n }); \n var condition_values = condition_data.values()[0];\n var max_trial_num = condition_data.last(1).values()[0].trial_num; //The last trial of this sub-condition\n //has the last trial num\n // Iterate through each trial of a given sub condition \n for (let j = 0; j<=max_trial_num; j++){\n //Data for a given trial of a sub condition\n var trial_data = condition_data.filter({trial_num: j});\n //Take the last trial's estimated mid since we want the most recent value\n var last_estimated_mid = trial_data.last(1).values()[0].estimated_mid;\n var last_num_adjustments = trial_data.last(1).values()[0].num_adjustments;\n var sum_rt = trial_data.filterCustom(function(x){ return x.key_press != 81 }) //Don't use the exit trial rt\n .select('rt')\n .sum();\n \n var row = [this.condition_name];\n\n row.push(j+1);\n row.push(condition_values.sub_condition);\n row.push(condition_values.balanced_sub_condition);\n row.push(condition_values.high_ref);\n row.push(last_estimated_mid);\n row.push(condition_values.low_ref);\n row.push(last_num_adjustments);\n row.push(condition_values.trials_per_round);\n row.push(condition_values.error);\n row.push(average_rt);\n row.push(condition_values.num_points);\n row.push(condition_values.mean);\n row.push(condition_values.SD);\n row.push(condition_values.num_SD);\n row.push(condition_values.round_type);\n row.push(condition_values.step_size);\n row.push(condition_values.point_color);\n row.push(condition_values.background_color);\n row.push(condition_values.text_color);\n row.push(condition_values.axis_color);\n row.push(condition_values.point_size);\n row.push(condition_values.regen_rate);\n\n data.push(row);\n }\n }\n\n // Append each row\n data.forEach(function(row){\n csv += row.join(',');\n csv += \"\\n\";\n });\n\n var hiddenElement = document.createElement('a');\n hiddenElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(csv);\n hiddenElement.target = '_blank';\n hiddenElement.download = \"S\" + this.subject_id + \"_\" +this.condition_name + \"_stevens_trial_results.csv\";\n hiddenElement.click();\n }", "title": "" }, { "docid": "ebbd62b36feebdbb12bc2f4555c3bcb7", "score": "0.48625076", "text": "function nextTrial(destination, properties){\n\t\tvar source\n\t\t\t, trial;\n\n\t\t// get next trial\n\t\tswitch (destination){\n\t\t\tcase 'nextWhere':\n\t\t\t\tsource = sourceSequence.nextWhere(properties);\n\t\t\t\tbreak;\n\t\t\tcase 'previousWhere':\n\t\t\t\tsource = sourceSequence.lastWhere(properties);\n\t\t\t\tbreak;\n\t\t\tcase 'current':\n\t\t\t\tsource = sourceSequence.current();\n\t\t\t\tbreak;\n\t\t\tcase 'first':\n\t\t\t\tsource = sourceSequence.first();\n\t\t\t\tbreak;\n\t\t\tcase 'last':\n\t\t\t\tsource = sourceSequence.last();\n\t\t\t\tbreak;\n\t\t\tcase 'end':\n\t\t\t\tsource = sourceSequence.end();\n\t\t\t\tbreak;\n\t\t\tcase 'next' :\n\t\t\t\t/* falls through */\n\t\t\tdefault:\n\t\t\t\tsource = sourceSequence.next(); // get the next trial, in case there are no more trials, returns undefined\n\t\t}\n\n\t\t// if we have another trial play it (next() both returns the next trial and sets it as current)\n\t\tif (source) {\n\t\t\t// create new trial and activate it\n\t\t\ttrial = new Trial(sourceSequence.current());\n\t\t\ttrial\n\t\t\t\t.activate()\t\t\t\t\t\t\t\t// activate the trial\n\t\t\t\t.done(function(){\n\t\t\t\t\tpubsub.publish('log:send');\t\t\t// see if we need to send the log stack\n\t\t\t\t\tnextTrial.apply(null,arguments);\t// when we're done try to play the next one (move arguments on to nextTrial)\n\t\t\t\t});\n\n\t\t\t// let everyone know that we are ready to go\n\t\t\tpubsub.publish(\"trial:activated\",[trial]);\n\n\t\t\t// push trial into the trial sequence\n\t\t\ttrialSequence.add(trial);\n\t\t} else {\n\t\t\t// @TODO: this realy shouldn't be here. this whole function is responsible for too many things...\n\t\t\t//\n\t\t\t// post any data that hasn't been posted yet.\n\t\t\t// and then proceed to the end task hook or to redirect\n\t\t\tlogger()\n\t\t\t\t.always(function(){\n\t\t\t\t\tvar hooks = settingsGetter('hooks') || {};\n\t\t\t\t\treturn $.when(hooks.endTask && hooks.endTask());\n\t\t\t\t})\n\t\t\t\t.always(function(){\n\t\t\t\t\tmain.deferred.resolve();\n\t\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "0769ecca1ce6781110bb504179cac7e9", "score": "0.48331222", "text": "function end_trial() {\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // kill keyboard listeners\n jsPsych.pluginAPI.cancelAllKeyboardResponses();\n\n // gather the data to store for the trial\n var trial_data = {\n \"rt\": response.rt,\n \"stimulus\": trial.stimulus,\n \"response\": response.response\n };\n\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "title": "" }, { "docid": "21be165a4acd2c92cad5b0516d226b3f", "score": "0.48326564", "text": "function end_trial() {\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n var trial_data = {\n 'rt': response.rt,\n 'stimulus': trial.stimulus,\n 'choice': response.choice\n };\n\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "title": "" }, { "docid": "afc526a55219791e4bb8e6b9d1ce65fb", "score": "0.48295644", "text": "function showTrial(){\n\n\t}", "title": "" }, { "docid": "6414cf9ba5590d2355786f6d498830de", "score": "0.48250487", "text": "fillAdvisorNames() {\n // Make individual advisors for each trial from the individual advisors\n let numbers = utils.shuffle(utils.getSequence(10, 99));\n\n // Ensure specifically named advisors' names aren't duplicated\n this.advisors.forEach(a => {\n const regex = /[ #]([0-9]+)$/.exec(a.name);\n if (regex && regex.groups) {\n const num = parseInt(regex.groups[0]);\n const i = numbers.indexOf(num);\n if (i !== -1) {\n // remove the number from the numbers list\n numbers.splice(i, 1);\n }\n }\n });\n\n // Assign ### advisors' numbers from the pool\n for (let t = 0; t < this.trials.length; t++) {\n const T = this.trials[t];\n if (!T.advisors || !T.advisors.length)\n continue;\n const advisors = [];\n for (let i = 0; i < T.advisors.length; i++) {\n const a = T.advisors[i];\n\n // Skip advisor if they have a number\n if (!/###/.test(a.name)) {\n advisors.push(a);\n continue;\n }\n\n const name = a.name.replace(/###/, \"#\" + numbers.pop());\n\n // Hoist advisor group properties to be trial context properties\n T.context = a.group;\n T.contextName = a.idDescription;\n T.contextDescription = a.introText;\n\n // Save as new copy of advisor if advisor is a group member\n if (a.isGroup)\n advisors.push(new Advisor({\n ...a,\n name: name,\n _image: null // force the identicon to recalculate\n }));\n else {\n a.name = name;\n advisors.push(a);\n }\n }\n T.advisors = advisors;\n }\n }", "title": "" }, { "docid": "320cc204a404f3f33b573b8edf5f81b7", "score": "0.48224258", "text": "function showInstructions(txt) {\n trialOrder = shuffle(randomArray)\n totalAccArray = []\n dir = path.join(savePath, 'PolarData', 'PhonTx', getSubjID(), getSessID())\n if (!fs.existsSync(dir)) {\n mkdirp.sync(dir)\n }\n fileToSave = path.join(dir,subjID+'_'+sessID+'_PhonTx_level_'+level+'_'+getDateStamp()+'.csv')\n clearScreen()\n var textDiv = document.createElement(\"div\")\n textDiv.style.textAlign = 'center'\n var p = document.createElement(\"p\")\n var txtNode = document.createTextNode(txt)\n p.appendChild(txtNode)\n textDiv.appendChild(p)\n var lineBreak = document.createElement(\"br\")\n var startBtnDiv = document.createElement(\"div\")\n var startBtn = document.createElement(\"button\")\n var startBtnTxt = document.createTextNode(\"Start\")\n startBtn.appendChild(startBtnTxt)\n startBtn.onclick = function() {\n showNextTrial(level)\n }\n startBtnDiv.appendChild(startBtn)\n var practiceBtnDiv = document.createElement(\"div\")\n var practiceBtn = document.createElement(\"button\")\n var practiceBtnTxt = document.createTextNode(\"Practice\")\n practiceBtn.appendChild(practiceBtnTxt)\n practiceBtn.onclick = function() {\n showNextPracticeTrial(level)\n }\n practiceBtnDiv.appendChild(practiceBtn)\n content.appendChild(textDiv)\n content.appendChild(lineBreak)\n content.appendChild(startBtnDiv)\n content.appendChild(lineBreak)\n content.appendChild(practiceBtnDiv)\n return getTime()\n}", "title": "" }, { "docid": "1db0f9c4d27844a7f862c1ab43250e78", "score": "0.47967297", "text": "function createTrialWindow(parentWindow, activations, limit) {\n winTrial = new BrowserWindow(\n { width: 500\n , height: 350\n , backgroundColor: '#fff'\n , modal: true\n , useContentSize: true\n , fullscreenable: false\n , resizable: false\n , parent: parentWindow\n , show: false\n , webPreferences: { nodeIntegration: true }\n })\n\n var url = `file://${__dirname}/static/trial.html`\n winTrial.removeMenu();\n winTrial.once('ready-to-show', () => {\n winTrial.webContents.send('trial-activations', [activations, limit])\n winTrial.show()\n })\n winTrial.on('closed', () => {\n winTrial = null;\n })\n winTrial.loadURL(url)\n}", "title": "" }, { "docid": "bfcf65da8373f1f3c89ea5b217a84d7a", "score": "0.47930062", "text": "function preparePlaylist(){\n\t\t\tvar settings = getSelected();\n\t\t\tvar actObjs = [];\n\t\t\tfor (var i=0; i < settings.activities.length; i++){\n\t\t\t\tvar a = settings.activities[i];\n\t\t\t\tvar act = model.data[ settings.difficulty ][a]; //gets time object based on difficulty\n\t\t\t\tactObjs = actObjs.concat( act );\n\t\t\t};\n\n\t\t\treturn actObjs;\n\t\t}", "title": "" }, { "docid": "29363141e045e8fb7f21be004a670d2c", "score": "0.47651574", "text": "async getTrips() {\n // Step 3. Get, create and delete trips -- Delete the return \"\"; code and uncomment\n // the code below to use the GraphQL client with the query getTripsQuery\n return \"\";\n // return client\n // .query({\n // query: getTripsQuery,\n // })\n // .then((response) => response.data.trips);\n }", "title": "" }, { "docid": "c559e33155eb368245d8c768577d8909", "score": "0.47577658", "text": "function createStimuliAndTaskSets(numTrials = 16, tasks = \"both\"){\n let blocksNeeded = Math.ceil(numTrials/16);\n let arr = [], newBatch;\n for (var i = 0; i < blocksNeeded; i++) {\n do {\n newBatch = createStimTaskBatch(tasks);\n } while (newBatch == undefined);\n arr = arr.concat(newBatch);\n }\n return arr.slice(0,numTrials);\n}", "title": "" }, { "docid": "15f048a4e2be6f257e7a3b0ebc5e6031", "score": "0.4744044", "text": "getData() {\n const a = [];\n this.display.forEach(stat => {\n a.push({\n heading: this.heading,\n phaseName: stat.name,\n isSignificant: stat.confidenceInterval.isSig,\n estimatorDelta: `${stat.estimator * -1}ms`,\n controlSampleCount: stat.sampleCount.control,\n experimentSampleCount: stat.sampleCount.experiment,\n confidenceInterval: [\n `${stat.confidenceInterval.max * -1}ms`,\n `${stat.confidenceInterval.min * -1}ms`,\n ],\n controlSevenFigureSummary: stat.sevenFigureSummary.control,\n experimentSevenFigureSummary: stat.sevenFigureSummary.experiment,\n });\n this.isSigArray.push(stat.confidenceInterval.isSig);\n this.estimatorDeltas.push(stat.estimator);\n });\n return a;\n }", "title": "" }, { "docid": "14edaeb63b05d46ae819e50a85f93c92", "score": "0.47382444", "text": "getExercisePeriodRecords(exerciseRecords, currExercisePeriod) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () {\n const today = new Date().getTime();\n const exerciseInPeriod = exerciseRecords.filter(exer => new Date(exer.date).getTime() >= this.getPeriodDate(today, currExercisePeriod));\n const exerciseTimes = exerciseInPeriod.length;\n let exerciseTotalTime = 0;\n let thrRetention = 0;\n if (exerciseInPeriod.length > 0) {\n const prescriptionIdArray = exerciseInPeriod.map(exercise => exercise.prescriptionId);\n const uniqueIdArray = prescriptionIdArray.filter((item, pos) => prescriptionIdArray.indexOf(item) === pos);\n const promises = yield uniqueIdArray.map(id => this.getExerciseTotalTime(id));\n const everyPrescriptionExerciseTime = yield Promise.all(promises);\n exerciseTotalTime = prescriptionIdArray\n .map(id => uniqueIdArray.indexOf(id))\n .map(idx => everyPrescriptionExerciseTime[idx])\n .reduce((prev, curr) => prev + curr);\n thrRetention =\n Math.round(exerciseInPeriod\n .map(exercise => exercise.thrretention)\n .filter(exercise => !!exercise)\n .reduce((prev, curr) => prev + curr, 0) / exerciseTimes);\n }\n return { exerciseTimes, exerciseTotalTime, thrRetention };\n });\n }", "title": "" }, { "docid": "8facfcdb2bbd63b61615bb6a1d1a816b", "score": "0.4731386", "text": "function StableTrialPonyTraining() {\n\tStableGenericProgressStart(60, 0, 0, \"Screens/Room/Stable/toyhorse.png\", \"HorseStable\", StableTrainer, null, 0, \"StableTrainerToyHorseFin\", 0, \"StableTrainerToyHorseCancel\", 2, TextGet(\"Toyhorse\"));\n\tSkillProgress(\"Dressage\", 15);\n}", "title": "" }, { "docid": "a1ae015bf5b42f89f76a3dce2069c93e", "score": "0.47293392", "text": "generateAlternatives () {\n const numberOfParticipants = this.numberOfParticipants\n const user = this.user\n const meetingDuration = this.meetingDuration\n\n // **** Generate first alternative scenario: heavy visio\n // Generate hardware components\n // - 1/3 of used hardware is heavy visio system\n // - 2/3 are light hardware, i.e. desktops with cameras and microphones\n const heavyHardwareNumber = Math.ceil(numberOfParticipants / 3)\n const lightHardwareNumber = numberOfParticipants - heavyHardwareNumber\n let hardwareComponents = []\n const heavyHardwareComponent = [\n { name: hardwareDatabase.DESKTOP.name },\n { name: hardwareDatabase.LOGITECH_KIT.name },\n { name: hardwareDatabase.TV.name },\n { name: hardwareDatabase.TV.name },\n { name: hardwareDatabase.METAL_STRUCTURE.name }\n ]\n const lightHardwareComponent = [\n { name: hardwareDatabase.DESKTOP.name },\n { name: hardwareDatabase.CAMERA.name },\n { name: hardwareDatabase.MICROPHONE.name }\n ]\n // Add the ritght number of heavy visio systems used for the meeting\n for (let i = 0; i < heavyHardwareNumber; i++) {\n hardwareComponents = hardwareComponents.concat(heavyHardwareComponent)\n }\n // Add the right number of light visio systems used for the meeting\n for (let i = 0; i < lightHardwareNumber; i++) {\n hardwareComponents = hardwareComponents.concat(lightHardwareComponent)\n }\n // Generate software component\n let softwareComponents = [{ name: softwareDatabase.SKYPE.name }]\n // Generate journey components\n // - 1/5 of the particpants take the city bus\n const journeyNumber = Math.ceil(numberOfParticipants / 5)\n let journeyComponents = [{\n passenger: 'Meeting passengers',\n mean: transportDatabase.BUS_CITY_ONE_PERSON_KM.name,\n distance: 5,\n numberOfPeople: journeyNumber\n }]\n // Concatenate all meeting component to create the payload used to initilise the first alternative MeetingScenario\n const heavyVisioPayload = {\n [meetingCategoryDamage.HARDWARE]: hardwareComponents,\n [meetingCategoryDamage.SOFTWARE]: softwareComponents,\n [meetingCategoryDamage.JOURNEY]: journeyComponents\n }\n // Generate the MeetingScenario and add it the database\n const heavyVisioScenario = MeetingScenario.create({ user, name: 'Alternative visio lourde', meetingDuration, numberOfParticipants, payload: heavyVisioPayload })\n\n // Compute its damage\n const DamagePayload = {\n [meetingCategoryDamage.HARDWARE]: { meetingDuration, bound: bounds.UPPER },\n [meetingCategoryDamage.SOFTWARE]: { instancesNumber: numberOfParticipants, bandwithBound: bounds.UPPER, networkBound: bounds.UPPER, meetingDuration },\n [meetingCategoryDamage.JOURNEY]: {}\n }\n heavyVisioScenario.computeDamage(DamagePayload)\n\n // **** Generate the secound alternative scenario: light transport\n // Generate hardware components\n hardwareComponents = []\n const laptop = [{ name: hardwareDatabase.LAPTOP.name }]\n // 2/3 of particpants have a laptop\n for (let i = 0; i < Math.ceil(numberOfParticipants * (2 / 3)); i++) {\n hardwareComponents = hardwareComponents.concat(laptop)\n }\n // Generate software components (no software compoents for this alternative scenario)\n softwareComponents = [{ name: softwareDatabase.SKYPE.name }]\n // Generate journey components\n // Initialise meeting journey components\n journeyComponents = []\n\n /* We considered a mean journey for one person has\n - 50 km by train\n - 5 km by city bus\n - 10 km by electric car shared with 3 other people.\n If 4 people participate in the meeting\n - 200 (50 * 4) km are done by train\n - 20 (5 * 4) are done by city bus\n - 40 (10 * 4) ra done by electric car.\n By ease for users, we choose to spread these journeys over meeting particpants. Instead of\n having 4 times the same journey, we consided that Participant 1 do on journey of 150 km by train,\n Participant 2 do one journey of 15 km by city bus, Participant 3 do one journey of 30 km by electric car.\n We considered the last participant do 3 journeys (50 km by train, 5 km by city bus, 10 km by electric car)\n */\n\n // Initialise the journey counter needed for the loop (from 0 to possibleJouneys.lenght)\n let journeyCounter = 0\n\n // Compute the factor by wich we multiply the distance done by each participant\n // For each possible journey, the total distance (done by all meeting participants)\n // done is numberOfParticpants * possibleJourneys[i].distance\n const computeDistanceFactor = (numberOfParticipants < possibleJourneys.length)\n ? numberOfParticipants\n : possibleJourneys.length\n\n for (let i = 0; i < numberOfParticipants; i++) {\n const journey = [{\n passenger: 'Participant ' + (i + 1),\n mean: possibleJourneys[journeyCounter].mean,\n distance: possibleJourneys[journeyCounter].distance * computeDistanceFactor,\n numberOfPeople: possibleJourneys[journeyCounter].numberOfPeople\n }]\n // Add the created journey to meeting journey components\n journeyComponents = journeyComponents.concat(journey)\n\n // If the last possible journey is reached, go back to the first one\n if (journeyCounter === possibleJourneys.length - 1) {\n journeyCounter = 0\n } else {\n // If the last participant is reached, but not the last possible\n // don't increase partcipant counter (i.e. i) in order to give all not reached possible\n // journeys to the last participant (see explanations above the loop)\n if (i === numberOfParticipants - 1 && journeyCounter !== possibleJourneys.lengt - 1) {\n i--\n }\n journeyCounter++\n }\n }\n // Create the payload\n const lightTransportPayload = {\n [meetingCategoryDamage.HARDWARE]: hardwareComponents,\n [meetingCategoryDamage.SOFTWARE]: softwareComponents,\n [meetingCategoryDamage.JOURNEY]: journeyComponents\n }\n // Generate meeting scenario\n const lightTransportScenario = MeetingScenario.create({ user, name: 'Alternative transports légers', meetingDuration, numberOfParticipants, payload: lightTransportPayload })\n // Compute its damage\n lightTransportScenario.computeDamage(DamagePayload)\n }", "title": "" }, { "docid": "269d079b77f2ec83fc1f8c4b5e0209ed", "score": "0.47239828", "text": "function end_trial() {\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n var trial_data = {\n \"rt\": response.rt,\n \"stimulus\": trial.stimulus,\n \"button_pressed\": response.button,\n \"unshuffled_button\": response.unshuffled_button\n };\n\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "title": "" }, { "docid": "09ea2c29b333930944bfcd179c1e0774", "score": "0.47124258", "text": "function createTrial(res,customer) {\n\n var trialEndpoint = config.license.api + '/trial'\n var productId = config.npme.product_id\n var trialLength = config.npme.trial_length\n var trialSeats = config.npme.trial_seats\n\n // check if they already have a trial; 1 per customer\n // no model call because the models are stupid and I hate them\n request.get({\n url: trialEndpoint + '/' + productId + '/' + customer.email,\n json: true\n },function(er,httpResponse,body) {\n if (httpResponse.statusCode == 404) {\n // do not already have a trial, so create one\n request.put({\n url: trialEndpoint,\n json: {\n customer_id: customer.id,\n product_id: productId,\n length: trialLength,\n seats: trialSeats\n }\n },function(er,httpResponse,trial) {\n // stop if we couldn't create the trial\n if(httpResponse.statusCode != 200) {\n console.warn(\"Error from trial creation, status \" + httpResponse.statusCode)\n var td = {\n title: \"Problem with signup\",\n errorMessage: \"There was a problem creating your trial\",\n errorCode: \"3001\"\n }\n return res.template('enterprise-error.ejs',td)\n }\n return sendVerificationEmail(res,customer,trial)\n })\n }\n else if (httpResponse.statusCode == 200) {\n // they are already have a trial, re-send the verification email\n // body of the response is the trial object\n return sendVerificationEmail(res,customer,body)\n } else {\n // trial API problem of some kind\n console.warn(\"Problem with trial fetch, status \" + httpResponse.statusCode + \", body \" + body)\n var td = {\n title: \"Problem with signup\",\n errorMessage: \"There was an unknown problem with your trial\",\n errorCode: \"3003\"\n }\n return res.template('enterprise-error.ejs', td)\n }\n })\n\n}", "title": "" }, { "docid": "0a74217132e147b696271bc3e796f87d", "score": "0.46973014", "text": "function getSteps() {\n return ['Feelings', 'Understanding', 'Support', 'Comments', 'Complete'];\n}", "title": "" }, { "docid": "e8c9a91b5a0b30d899d016e607d97a73", "score": "0.46949127", "text": "get _phaseClassPrefix() {\n return \"Trial\";\n }", "title": "" }, { "docid": "1cd0b08c64890010ce3c4a3e89cd066c", "score": "0.46685973", "text": "function end_trial() {\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n var trial_data = {\n \"rt\": response.rt,\n \"stimulus\": trial.stimulus,\n \"button_pressed\": response.button\n };\n\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "title": "" }, { "docid": "1d447ef616da8f5b49da9395e83e2936", "score": "0.4660892", "text": "function nextTrial() {\r\n\r\n\t\r\n\tif (currentTrial <= numTrials) {\r\n\r\n\t\tvar menuType = trialsData[currentTrial]['Menu Type'];\r\n\t\tvar menuDepth = trialsData[currentTrial]['Menu Depth'];\r\n var menuBreadth = trialsData[currentTrial]['Menu Breadth'];\r\n\t\tvar targetItem = trialsData[currentTrial]['Target Item'];\r\n\r\n\t\tdocument.getElementById(\"trialNumber\").innerHTML = String(currentTrial) + \"/\" + String(numTrials);\r\n\t\tdocument.getElementById(\"menuType\").innerHTML = menuType;\r\n\t\tdocument.getElementById(\"menuDepth\").innerHTML = menuDepth;\r\n document.getElementById(\"menuBreadth\").innerHTML = menuBreadth;\r\n\t\tdocument.getElementById(\"targetItem\").innerHTML = targetItem;\r\n\t\tdocument.getElementById(\"selectedItem\").innerHTML = \"&nbsp;\";\r\n\t\t// Set IV3 state over here\r\n\r\n\t\ttracker.newTrial();\r\n\t\ttracker.trial = currentTrial;\r\n\t\ttracker.menuType = menuType;\r\n\t\ttracker.menuDepth = menuDepth;\r\n tracker.menuBreadth = menuBreadth;\r\n\t\ttracker.targetItem = targetItem;\r\n trialDone = false;\r\n\r\n\t\tif (menuType === \"Marking\") {\r\n\t\t\t\t\r\n\t\t\tinitializeMarkingMenu();\r\n\t\t\t\r\n\t\t\tif(menuDepth == 1){\r\n if(menuBreadth == 3) {\r\n menu = MarkingMenu(trialMarkingMenuL1, document.getElementById('marking-menu-container'));\r\n }else if(menuBreadth == 6) {\r\n menu = MarkingMenu(markingMenuL1B6, document.getElementById('marking-menu-container'));\r\n } else {\r\n menu = MarkingMenu(markingMenuL1, document.getElementById('marking-menu-container'));\r\n }\t\t\r\n\t\t\t}\r\n\t\t\telse if(menuDepth == 2){\r\n if(menuBreadth == 3) {\r\n menu = MarkingMenu(trialMarkingMenuL2, document.getElementById('marking-menu-container'));\r\n }else if(menuBreadth == 6) {\r\n menu = MarkingMenu(markingMenuL2B6, document.getElementById('marking-menu-container'));\r\n } else {\r\n menu = MarkingMenu(markingMenuL2, document.getElementById('marking-menu-container'));\r\n }\r\n\t\t\t}else if(menuDepth == 3){\r\n\t\t\t\tif(menuBreadth == 6) {\r\n menu = MarkingMenu(markingMenuL3B6, document.getElementById('marking-menu-container'));\r\n } else {\r\n menu = MarkingMenu(markingMenuL3, document.getElementById('marking-menu-container'));\r\n }\r\n\t\t\t}\r\n\r\n\t\t\tmarkingMenuSubscription = menu.subscribe((selection) => markingMenuOnSelect(selection));\r\n\r\n\t\t} else if (menuType === \"Radial\") {\r\n\r\n\t\t\tinitializeRadialMenu();\t\t\t\r\n\t\t\tif (menuDepth == 1){\r\n\t\t\t\tif(menuBreadth == 3) {\r\n menu = createRadialMenu(trialRadialMenuL1);\r\n }else if(menuBreadth == 6) {\r\n menu = createRadialMenu(radialMenuL1B6);\r\n } else {\r\n menu = createRadialMenu(radialMenuL1);\r\n }\r\n\t\t\t}\r\n\t\t\telse if(menuDepth == 2){\r\n\t\t\t\tif(menuBreadth == 3) {\r\n menu = createRadialMenu(trialRadialMenuL2);\r\n }else if(menuBreadth == 6) {\r\n menu = createRadialMenu(radialMenuL2B6);\r\n } else {\r\n menu = createRadialMenu(radialMenuL2);\r\n }\r\n\t\t\t}else if(menuDepth == 3){\r\n\t\t\t\tif(menuBreadth == 6) {\r\n menu = createRadialMenu(radialMenuL3B6);\r\n } else {\r\n menu = createRadialMenu(radialMenuL3);\r\n }\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\r\n\t\tcurrentTrial++;\r\n\t} else {\r\n\t\t\r\n\t nextButton.innerHTML = \"Done\";\r\n\r\n\t}\r\n}", "title": "" }, { "docid": "cf94ea8b4d7ed21094c2af8f66b9d1fa", "score": "0.4660433", "text": "static get properties() {\n return {\n trainslist: {\n type: Array,\n value: [],\n notify: true\n }\n };\n }", "title": "" }, { "docid": "582d4847eee61570274e5b6a944821ca", "score": "0.465175", "text": "function generateTestList(){\n\n}", "title": "" }, { "docid": "416831c4af63c885a95ec2091522e339", "score": "0.46465456", "text": "function end_trial() {\n webgazer.pause();\n jsPsych.pluginAPI.clearAllTimeouts();\n if (typeof keyboardListener !== 'undefined') {\n jsPsych.pluginAPI.cancelKeyboardResponse(keyboardListener);\n }\n\n let w = $(window).width();\n let h = $(window).height();\n\n let trial_data = {\n \"trial_duration\": trial.trial_duration,\n \"rt\": response.rt,\n \"option_topLeft\": trial.option_topLeft,\n \"option_bottomLeft\": trial.option_bottomLeft,\n \"option_topRight\": trial.option_topRight,\n \"option_bottomRight\": trial.option_bottomRight,\n \"key_press\": response.key,\n window_width: w,\n window_height: h,\n chin: chin,\n task_nr: task_nr,\n };\n addToChoiceArray();\n trial_data.et_data = JSON.stringify(tempDs);\n display_element.innerHTML = '';\n jsPsych.finishTrial(trial_data);\n }", "title": "" }, { "docid": "c172d0bd590944760b3cdb4c3e191ba4", "score": "0.46436667", "text": "get_trial(read) {\n return new Promise((resolve, reject) => {\n read.question(\"How many trials you want ? \", (trials) => {\n if(typeof trials === undefined || isNaN(trials) ){\n return reject(\"Please enter valid input\");\n }\n else{\n this.trial=trials;\n return resolve(trials);\n }\n });\n });\n }", "title": "" }, { "docid": "60c71a5ed19bb5d50bb3f5443c0b8420", "score": "0.4642852", "text": "function initStepsList() {\r\n var step1Content = 'Spread both slices of bread with mayonnaise';\r\n var step2Content = 'Top one bread slice, mayonnaise side up, with a piece of lettuce';\r\n var step3Content = 'Place tomato, turkey, bacon, and avocado on the same bread slice with mayonnaise';\r\n var step4Content = 'Toast in the oven for 5 minutes';\r\n \r\n var step1 = new Step(1, step1Content);\r\n var step2 = new Step(2, step2Content);\r\n var step3 = new Step(3, step3Content);\r\n var step4 = new Step(4, step4Content, true);\r\n var stepList = [step1, step2, step3, step4];\r\n\r\n //Insert steps into DOM using foreach loop\r\n stepList.forEach(function(step) {\r\n var content = step.content;\r\n\r\n var title; \r\n if(step.optional) {\r\n title = step.title + ' <span class=\"text-muted font-italic small\">(optional)</span>';\r\n } else {\r\n title = step.title;\r\n }\r\n\r\n var stepEntryHTML = buildListItemEntry(title, content);\r\n $('.accordion').append(stepEntryHTML);\r\n });\r\n}", "title": "" }, { "docid": "a2d62cd64250c1570eaace7c9bb5dcbd", "score": "0.46400574", "text": "function createTargetsArr(nTrials){\n let targetsArr = [], newBatch;\n let batchesNeeded = Math.ceil(nTrials/16);\n for (let i = 0; i < batchesNeeded; i++) {\n newBatch = createTargetBatch();\n targetsArr = targetsArr.concat(newBatch);\n }\n return targetsArr;\n}", "title": "" }, { "docid": "2f620db5203aea5353aff99f46df89e7", "score": "0.46309552", "text": "createArticulations() {\n for (let idx = 0, len = this.staffEntries.length; idx < len; ++idx) {\n const graphicalStaffEntry = this.staffEntries[idx];\n // create vex flow articulation:\n const graphicalVoiceEntries = graphicalStaffEntry.graphicalVoiceEntries;\n for (const gve of graphicalVoiceEntries) {\n const vfStaveNote = gve.vfStaveNote;\n VexFlowConverter_1.VexFlowConverter.generateArticulations(vfStaveNote, gve.notes[0].sourceNote.ParentVoiceEntry.Articulations);\n }\n }\n }", "title": "" }, { "docid": "53f138c286a35ea3311d438db3be0ec5", "score": "0.4627984", "text": "function getInitialChals() {\n return [\n {\n id: 'chal1',\n name: 'The Garden',\n isSolved: false,\n stagesCount: 5\n },\n {\n id: 'chal2',\n name: 'The Forest',\n isSolved: false,\n stagesCount: 15 //detrmines the amount of pieces on the picture\n },\n {\n id: 'chal3',\n name: 'The Beach',\n isSolved: false,\n stagesCount: 5\n\n },\n {\n id: 'chal4',\n name: 'Playground',\n isSolved: false,\n\n }];\n}", "title": "" }, { "docid": "9e025dba2cd58f4a0214adaa2faa09ef", "score": "0.46257418", "text": "get videoHubDropdown_TrialReplays() {return browser.element(\"~Go to Trial Replays\");}", "title": "" }, { "docid": "080bea0b002d98ae212309832f77ad2a", "score": "0.46101296", "text": "function TripPlanner (tripDates, accomodation, selectedSites){\n this.tripDates = tripDates;\n this.tripLength = Math.round((tripDates.to - tripDates.from) /60 /60 / 24 /1000) + 1\n\n this.accomodation = accomodation;\n this.sites = selectedSites;\n\n // The BOT Should recieve /: 1. a list of BOTSites/ 2. a BOT DistanceTable\n this.plan = function(distanceFunction){\n var promise = new Promise((resolve, reject)=>{\n var self = this;\n // Crating a new BOT \n var botSites = []\n\n //botSites\n for (var i in this.sites){\n var cSite = this.sites[i];\n botSites.push(new BOTSite(cSite, i, BOTSiteLengthEnum.Long, cSite.location))\n }\n \n var botDistanceTable = new BOTDistanceTable(botSites.length);\n\n // Need to fill the values\n this.fillBotDistanceTable(botDistanceTable, botSites, distanceFunction)\n .then(()=>{\n botDistanceTable.printDistanceTable(botDistanceTable, botSites);\n\n var optimizer = new BOT(botSites, botDistanceTable,this.tripLength);\n optimizer.optimize().then((daysPlan)=>{\n var tripDays = [];\n for (var day =0 ; day<daysPlan.length; day++){\n var tripSites = [];\n var daySites = daysPlan[day];\n // console.log('---------Day %d --------: ', day);\n for (var siteIdx =0; siteIdx<daySites.length; siteIdx++){\n // creating new trip site\n var site= self.sites[daySites[siteIdx]];\n var tripSite = new TripSite(siteIdx+1, site.siteName, site.siteId, site.location )\n tripSites[siteIdx] = tripSite;\n // console.log('- Site %d',siteIdx, self.sites[daySites[siteIdx]].siteName)\n }\n // calculating the right date\n var date = new Date( self.tripDates.from.getTime()+ (day*60*60*24*1000))\n var tripDay = new TripDay(day+1, date, tripSites, []/* TODO: should be the transport */)\n tripDays[day] = tripDay;\n }\n\n // Now we have the tripDays full\n resolve(new TripPlan(tripDays));\n })\n })\n })\n\n return promise;\n }\n\n this.fillBotDistanceTable = function(botDistanceTable, botSites, distanceFunc){\n var promises = []\n for (var i=0;i<botSites.length -1; i++ ){\n // Calculating the distance between current site to others\n var index = i;\n promises.push(distanceFunc([botSites[i].siteLocation], _.pluck(lodash.takeRight(botSites, botSites.length -1-i), 'siteLocation'))\n .then((iDistances)=>{\n // Running over the distances\n _.each(iDistances, (jDistance, jIndex)=>{\n botDistanceTable.setDistance(i,jIndex,jDistance[jIndex])\n })\n }))\n // return Promise.all(promises)\n }\n return Promise.all(promises)\n }\n\n // this.getSiteLength=function(siteId){\n // // need to randomly choose length\n\n // // TODO: get the corret site length (time to spend in site)\n // var num = Math.floor(Math.random()*(4-1+1)+1);\n // switch(num){\n // case(1):{\n // return BOTSiteLengthEnum.Short;\n // break;\n // }\n // case(2):{\n // return BOTSiteLengthEnum.Medium;\n // break;\n // }\n // case(3):{\n // return BOTSiteLengthEnum.Long;\n // break;\n // }\n // case(4):{\n // return BOTSiteLengthEnum.Longer;\n // break;\n // }\n\n // }\n // }\n}", "title": "" }, { "docid": "975b3c868b6412456fa046586f5b21f5", "score": "0.46096227", "text": "function getTrips() {\n var promise = $http.get('/poke/trips', selectedRoutes)\n .then(function (response) {\n routeTrips = response.data;\n });\n\n return promise;\n }", "title": "" }, { "docid": "1e08d83f39f668aff318278cddadface", "score": "0.46006757", "text": "function embedSlides(trials) {\n var slides = \"\";\n for (var i = 1; i <= trials; i++) {\n slides = slides + \"<div class=\\\"slide\\\" id=\\\"trial\" + i + \"\\\">\" +\n \t\"<p class=\\\"display_context\\\"></p>\" +\n \t\t\"<p class=\\\"display_target\\\"></p>\" +\n \t\t\"<p class=\\\"display_question\\\"></p>\" +\n \t\t\"<span class=\\\"display_prompt\\\"></span><input type=\\\"text\\\" id=\\\"text_response\" + i + \"\\\"></input>.\\\"<p></p>\" +\n \t\t\"<button onclick=\\\"_s.button()\\\">Continue</button>\" +\n \t\t\"<p class=\\\"err\\\">Please write something.</p>\" +\n \t\t\"</div>\";\n \t$(\".trial_slides\").html(slides);\n }\n}", "title": "" }, { "docid": "6b628dea70c310a47b1ce10e9726f412", "score": "0.45988148", "text": "function registerAllTours() {\n tours = [];\n return tourResource.getTours().then(function (tourFiles) {\n angular.forEach(tourFiles, function (tourFile) {\n angular.forEach(tourFile.tours, function (newTour) {\n validateTour(newTour);\n validateTourRegistration(newTour);\n tours.push(newTour);\n });\n });\n eventsService.emit('appState.tour.updatedTours', tours);\n });\n }", "title": "" }, { "docid": "92bb550e97b7341b76f0a42d2ae25e65", "score": "0.45972294", "text": "function perceptualTestOneTrial_simulation(ctx, plot, yMax, sigma, d_prime) {\n var delay = 0.0;\n var distanceAB = 0.0;\n var distanceAX = 0.0;\n var distanceBX = 0.0;\n var duplicate = \"\";\n var generateOrTest = 0;\n var minDist = 0.0;\n var mostDifferent = \"\";\n var N = diffTest.N.value;\n var percentCorrect = 0.0;\n var randValue = 0.0;\n var sIdx = diffTest.simTestOneTrial.simIdx;\n var success = true;\n var testData = {};\n var trueDifferent = \"\";\n var xA = 0.0;\n var xAList = [];\n var xBList = [];\n var xB = 0.0;\n var xIdx = 0;\n var xPx = 0.0;\n var xX = 0.0;\n var yAList = [];\n var yBList = [];\n var yPx = 0.0;\n\n // if stopped running simulation, then return\n if (diffTest.simTestOneTrial.running == false) {\n return;\n }\n\n document.getElementById('startStopTestOneTrial').innerHTML =\n ((sIdx+1)/2).toFixed(0) + \": PAUSE\";\n\n // if 'generate', then generateOrTest is 0;\n // if 'test', then generateOrTest is 1.\n generateOrTest = diffTest.simTestOneTrial.simIdx % 2;\n\n // compute the delay for each phase of the simulation, in milliseconds\n delay = diffTest.simTestOneTrial_delay.value * 1000.0 / 2.0;\n\n // if generate, remove any simulation points from previous iteration\n if (generateOrTest == 0) {\n plotRemoveData(ctx, plot, \"simA\");\n plotRemoveData(ctx, plot, \"simB\");\n }\n plotUpdate(ctx, plot, [], []);\n\n // plot sigma range over maximum of stimulus A\n plotSigma(ctx, plot, \"\", 0.0, sigma, yMax);\n\n // plot symbols for A and B on top of legend\n xPx = mapX(plot, plot.legendPosition[0]) + plot.paddingPx/2 -\n plot.paddingPx;\n yPx = mapY(plot, plot.legendPosition[1]) + plot.paddingPx/2 +\n plot.fontHeightPx/2 + 4;\n plotSymbol(ctx, plot, \"openSquare\", xPx, yPx, 12, \"blue\", 3);\n yPx += plot.fontHeightPx + 2;\n plotSymbol(ctx, plot, \"openCircle\", xPx, yPx, 12, \"green\", 3);\n\n\n if (N > 0) {\n if (generateOrTest == 0) {\n testData = generatePerceptualTestData(d_prime, diffTest.testType.value);\n xAList = testData.A;\n xBList = testData.B;\n trueDifferent = testData.trueDifferent;\n\n yAList = [];\n for (xIdx = 0; xIdx < xAList.length; xIdx++) {\n yAList.push(yMax*0.1);\n }\n yBList = [];\n for (xIdx = 0; xIdx < xBList.length; xIdx++) {\n yBList.push(yMax*0.1);\n }\n\n diffTest.simTestOneTrial.xAList = xAList;\n diffTest.simTestOneTrial.xBList = xBList;\n diffTest.simTestOneTrial.yAList = yAList;\n diffTest.simTestOneTrial.yBList = yBList;\n diffTest.simTestOneTrial.testData = testData;\n if (delay >= 0) {\n plotSimulationResults(ctx, plot, sIdx, \"simA\", xAList, yAList,\n \"openSquare\", \"blue\");\n plotSimulationResults(ctx, plot, sIdx, \"simB\", xBList, yBList,\n \"openCircle\", \"green\");\n }\n } else {\n // score and optionally plot the results by filling in the symbols\n // with the original color (if correct) or with red (if incorrect)\n testData = diffTest.simTestOneTrial.testData;\n success = scoreTestData(testData);\n\n xAList = diffTest.simTestOneTrial.xAList;\n xBList = diffTest.simTestOneTrial.xBList;\n yAList = diffTest.simTestOneTrial.yAList;\n yBList = diffTest.simTestOneTrial.yBList;\n\n\n // console.log(\"most different = \" + mostDifferent);\n diffTest.simTestOneTrial.total += 1;\n if (success) {\n diffTest.simTestOneTrial.corr += 1;\n if (delay >= 0) {\n plotSimulationResults(ctx, plot, sIdx, \"simA\", xAList, yAList,\n \"filledSquare\", \"blue\");\n plotSimulationResults(ctx, plot, sIdx, \"simB\", xBList, yBList,\n \"filledCircle\", \"green\");\n }\n } else {\n if (delay >= 0) {\n plotSimulationResults(ctx, plot, sIdx, \"simA\", xAList, yAList,\n \"filledSquare\", \"red\");\n plotSimulationResults(ctx, plot, sIdx, \"simB\", xBList, yBList,\n \"filledCircle\", \"red\");\n }\n }\n }\n }\n\n // compute and display on HTML the percent correct so far\n percentCorrect = diffTest.simTestOneTrial.corr/diffTest.simTestOneTrial.total;\n if (generateOrTest == 1) {\n document.getElementById('simTestOneTrialCorr').innerHTML =\n (100.0 * percentCorrect).toFixed(1)+\"%\";\n }\n\n // if we're not done yet, call this function again after specified delay.\n // alternate between generating points and testing them.\n if (sIdx < 2*N-1) {\n diffTest.simTestOneTrial.simIdx += 1;\n diffTest.runningPerceptualTestOneTrialID =\n setTimeout(perceptualTestOneTrial_simulation, delay, ctx, plot,\n yMax, sigma, d_prime);\n } else {\n // stop\n diffTest.simTestOneTrial.running = false;\n diffTest.simTestOneTrial.total = 0;\n diffTest.simTestOneTrial.corr = 0;\n diffTest.simTestOneTrial.simIdx = 2*diffTest.N.value;\n mathLibrary.seedRandom(diffTest.randSeed.value);\n document.getElementById('startStopTestOneTrial').innerHTML = \"START\";\n }\n\n return;\n}", "title": "" }, { "docid": "cf809218c5b770f72ecb15ac2dd49023", "score": "0.45913777", "text": "trial() {\n\t\t// random center\n\t\tconst p = this.pt();\n\n\t\t// two random angles from 0 - 2pi\n\t\tconst d = this.pos( Math.PI * 1 );\n\t\tconst r1 = this.pos( Math.PI * 1 );\n\t\tconst r2 = d + r1;\n\t\tconst a1 = Math.min( r1, r2 );\n\t\tconst a2 = Math.max( r1, r2 );\n\n\t\t// two lengths\n\t\tconst l1 = .1 + this.pos();\n\t\tconst l2 = .1 + this.pos();\n\n\t\t// two points along angle at given length\n\t\tconst p1 = this.trig( p, a1, l1 );\n\t\tconst p2 = this.trig( p, a2, l2 );\n\n\t\t// differences from p to p1, p to p2 and p1 to p2 (for loc)\n\t\tconst a = this.subtract( p1, p );\n\t\tconst b = this.subtract( p2, p );\n\t\tconst c = this.subtract( p1, p2 );\n\n\t\t// lenght of same\n\t\tconst al = this.length( a );\n\t\tconst bl = this.length( b );\n\t\tconst cl = this.length( c );\n\n\t\t// product of the 2 lengths\n\t\tconst ab = al * bl;\n\n\t\t// https://www.cuemath.com/geometry/angle-between-vectors/\n\t\t// dot / length product and angle\n\t\tconst dL = this.dot( a, b ) / ab;\n\t\tconst dA = Math.acos( dL );\n\n\t\t// cross / length product and angle\n\t\tconst xL = this.length( this.cross( a, b ) ) / ab;\n\t\tconst xA = Math.asin( xL );\n\n\t\t// law of cosines angle\n\t\t// https://www.mathsisfun.com/algebra/trig-cosine-law.html\n\t\t// https://stackoverflow.com/questions/1211212/how-to-calculate-an-angle-from-three-points\n\t\t//arccos((P12^2 + P13^2 - P23^2) / (2 * P12 * P13))\n\t\tconst cA = Math.acos(\n\t\t\t( al * al + bl * bl - cl * cl ) / ( 2 * al * bl )\n\t\t);\n\n\t\t// difference vs d\n\t\t// dA and cA seem to always match and match when d < PI\n\t\t// xA works when d < PI * .5\n\t\tconst dE = Math.abs( Math.abs( d ) - Math.abs( dA ) );\n\t\tconst xE = Math.abs( Math.abs( d ) - Math.abs( xA ) );\n\t\tconst cE = Math.abs( Math.abs( d ) - Math.abs( cA ) );\n\n\t\tconst ok = dE < .0001 ? true : false;\n\t\treturn this.flooro({ \n\t\t\tok, d, \n\t\t\tdA, dE, dL, \n\t\t\txA, xE, xL, \n\t\t\tcA, cE\n\t\t});\n\t}", "title": "" }, { "docid": "dac4e98666e74dfaa048ce2971e4051a", "score": "0.45889175", "text": "function createWorkout() {\n // if (currentSettings.audio) {sfx.clickBtn.play();}\n workout = exercises.filter(function(exercise) {\n return (currentSettings.bonus) ? (exercise.difficulty <= currentSettings.difficulty) : ((exercise.difficulty > 0) && (exercise.difficulty <= currentSettings.difficulty));\n });\n estimateWorkoutTime();\n textUI();\n // Store starting settings for retrieval if workout is reset later:\n originalSettings = {\n bonus: currentSettings.bonus,\n circuitsRemaining: currentSettings.circuitsRemaining,\n difficulty: currentSettings.difficulty,\n breaks: currentSettings.breaks,\n totalTimeRemaining: currentSettings.totalTimeRemaining\n };\n currentCircuitUI.innerText = `Circuit ${originalSettings.circuitsRemaining - currentSettings.circuitsRemaining + 1} of ${originalSettings.circuitsRemaining}`;\n}", "title": "" }, { "docid": "d906730b81bc761944e2efa71d8b6086", "score": "0.45828748", "text": "function getTrails(team_id,domain_id,callback){\n var url = addOnPrefs.datawakeDeploymentUrl + \"/trails\";\n var params = {team_id:team_id, domain_id:domain_id};\n requestHelper.get(url,callback,params);\n}", "title": "" }, { "docid": "bd2f0b12bffacab17729fa198fc74892", "score": "0.45763004", "text": "async generateListOfTrainsByStation() {\n\n try {\n const { trains, stationsc } = this.state;\n const arrivalsData = [];\n const departuresData = [];\n\n trains.map(train => {\n var trainText = train.trainType + ' ' + train.trainNumber;\n var startStation = train.timeTableRows[0].stationShortCode;\n var endStation = train.timeTableRows[train.timeTableRows.length -1].stationShortCode;\n var isCancelled = train.isCancelled;\n\n const result = train.timeTableRows.filter(ttableitem =>{\n return ttableitem.stationShortCode == stationsc;\n })\n\n result.map(timeTableItem => {\n\n const tableItem = [trainText,\n getStationNameByCode(startStation, this.state.stations),\n getStationNameByCode(endStation, this.state.stations), [\n getSimpleShortTime(timeTableItem.scheduledTime),\n getSimpleShortTime(timeTableItem.actualTime),\n isCancelled]\n ];\n\n if (timeTableItem.type == \"ARRIVAL\") {\n arrivalsData.push(tableItem);\n }\n\n if (timeTableItem.type == \"DEPARTURE\") {\n departuresData.push(tableItem);\n }\n\n })\n \n })\n\n this.setState({tableDataArrivals : arrivalsData});\n this.setState({tableDataDepartures : departuresData});\n\n } catch (error) {\n console.log(error);\n }\n \n }", "title": "" }, { "docid": "9c72831cf226d0709c2ff5c55e94393d", "score": "0.45720974", "text": "function PrepareAndStartTrial(logger, photosPerTrial, photosCsvUrl, photoEleId, escapeTimeout, animationDuration, shortcutKeys) {\n\n // Invoked once we have the list of photos\n function prepare(data) {\n // Derive columns required by the PhotoSeq constructor\n var candidatePhotos = data.map(n => {\n n.correctScore = n.family == \"Formicidae\" ? \"ant\" : \"notAnt\";\n n.url = n.webUrl;\n // Ants seem to weight others, so weight them down a little\n n.weight = n.correctScore == \"ant\" ? 0.85 : 1;\n return n;\n });\n\n // Prepare the photo list from the candidate photos\n var photos = new PhotoSeq(candidatePhotos, photosPerTrial);\n\n // Start the trial\n new Trial(logger, photos, photoEleId, escapeTimeout, animationDuration).prepare(shortcutKeys);\n }\n\n ReadPhotosCSV(photosCsvUrl, prepare);\n}", "title": "" }, { "docid": "30b1e98ca5f8db92eb56d311fdad24d9", "score": "0.45615125", "text": "taunts() {\n return []\n }", "title": "" }, { "docid": "39556dab0204164c6435741d9130925d", "score": "0.45586875", "text": "function study_phase(my_pool, isi=0, time_limit=0, extra_feedback=false, extra_feedback_message=\"\", extra_feedback_keys=[]){\n\n /* the above constructor (same with test_phase) can accept either a single stimulus pool (pool()),\n or an array of stimulus pools (pool()) */\n var my_pools = []\n if(my_pool.is_pool){\n my_pools.push(my_pool)\n }else{\n my_pools = my_pool\n }\n\n var trial_index = -1, my_task_id = next_task_id++\n this.ctx = ctx, this.p = my_pools, this.pool_ids = new Array()\n\n /* for study phase, selection is built from combination of all selection_n arrays, from each of the supplied pools */\n var my_selection = new Array()\n for(var a_pool in my_pools){\n var my_pool = my_pools[a_pool]\n this.pool_ids.push(my_pool.pool_id)\n for(var i in my_pool.selection_n){\n var extra_feedback_this_slide = false\n if(extra_feedback != false){\n if(0 == i % parseInt(extra_feedback)){\n extra_feedback_this_slide = true\n }\n }\n my_selection.push([my_pool.selection_n[i], my_pool.pool_id, extra_feedback_this_slide])\n }\n }\n\n /* randomize the order of the array */\n shuffle(my_selection, true)\n\n for(var selection_ind in my_selection){\n\n /* increment the trial-index counter */\n ++ trial_index\n\n var a_selection = my_selection[selection_ind]\n\n /* data (word or image) assigned to \"trial\" */\n var data = a_selection[0], p_id = a_selection[1], extra_feedback_this_slide = a_selection[2]\n\n /* if ISI was set, prefix with a \"blank\" slide */\n if(isi > 0){\n var x = new state()\n x.set_expiry(isi)\n x.type = 'isi', x.wrd_stim = \"\", x.trial_id = trial_index, x.task_id = my_task_id\n x.set_pool_id(my_pool.pool_id)\n x.clear_admissible_keys()\n x.key_expiry = false\n }\n\n /* initialize generic \"trial\" object for each case */\n var x = new state()\n if(time_limit <= 0){\n x.set_expiry(0)\n x.key_required = false\n }else{\n x.set_expiry(time_limit)\n x.key_required = false\n }\n\n /* discern by image or word, respectively */\n if( typeof(data) === 'object'){\n x.img_stim = data\n }else if(typeof(data) === 'string'){\n x.wrd_stim = data\n }\n x.type = 'study_phase', x.trial_id = trial_index, x.task_id = my_task_id\n x.set_pool_id(p_id)\n if(extra_feedback_this_slide){\n var x_f = feedback(extra_feedback_message, extra_feedback_keys)\n }\n }\n return this\n}", "title": "" }, { "docid": "64e154bc3f630c3c01cd6fe51ede5711", "score": "0.45586172", "text": "function end_trial() {\n\n // kill any remaining setTimeout handlers\n for (var i = 0; i < setTimeoutHandlers.length; i++) {\n clearTimeout(setTimeoutHandlers[i]);\n }\n\n // gather the data to store for the trial\n var trial_data = {\n \"rt\": response.rt,\n \"stimulus\": trial.stimuli,\n \"button_pressed\": response.button,\n \"block_id\": trial.block_id,\n \"mine_prob_win_left\": k_weight, //probability of win for L mine in this block\n \"mine_prob_win_right\": l_weight, //probability of win for L mine in this block\n \"gamble_feedback\": final_feedback, //feedback for the gamble (0 for loss, 1 for win)\n \"latent_agent\": trial.latent_intervention, //did latent agent intervene?\n \"weights\": input_weight, //weights used for feedback\n };\n // clear the display\n display_element.html('');\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "title": "" }, { "docid": "bb8de06f97eeb60b8febc6c7cbc05292", "score": "0.45498842", "text": "function getStims(){\n\t\tvar stims = [];\n\t\t$.ajax({\n\t\t\turl: \"/pick_trail\",\n\t\t\ttype: \"POST\",\n\t\t\tdataType: \"json\",\n\t\t\tasync: false,\n\t\t\tsuccess: function(data){\n\t\t\t\tfor (var i in data){\n\t\t\t\t\tstims.push(data[i])\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn stims;\n\t}", "title": "" }, { "docid": "9fb581719781d0a289b1cdcb3b9ba51e", "score": "0.4549278", "text": "function getSteps() {\n return [\n 'Enter business owner information',\n 'Enter Company information',\n 'Application Consent',\n 'Finish'\n ];\n}", "title": "" }, { "docid": "034e4a25cc844ca9402ed6da4bb2fecb", "score": "0.45451447", "text": "function tubeTimeIntent() {\n loadHttps(API_HOST, API_PATH, function(data) {\n\n var traintimesByDirection = parseTrainTimesByDirection(data);\n var phraseText = nextTubePhraseBuilder(traintimesByDirection);\n\n context.succeed(\n generateResponse(\n buildSpeechletResponse(phraseText, true),\n {}\n )\n );\n });\n }", "title": "" }, { "docid": "919b128e66844917bd5b63dbe487e8ec", "score": "0.45449728", "text": "loadNextTrial(n, total) {\r\n this.randomizeDots();\r\n this.showDots();\r\n SYSTEMS.timer.addInterval(null, this.interval/2, this.hideDots.bind(this), false);\r\n //SYSTEMS.timer.addInterval(null, this.interval*2, this.nextTrial, false);\r\n \r\n }", "title": "" }, { "docid": "bbe383d16da8fa93e427059307d5ce7d", "score": "0.4539467", "text": "function getSteps() {\n return [\n \"Using CS 61B Materials\",\n \"Uploading Files\",\n \"Selecting Operations\",\n \"Downloading\",\n \"Final Steps\"\n ];\n}", "title": "" }, { "docid": "e721cc271c4ae0561c3e3a15129aee13", "score": "0.45380828", "text": "function getTours() {\n return tours;\n }", "title": "" }, { "docid": "a68b4ff0387eed92221834664780222b", "score": "0.4534615", "text": "function endTrial() {\n display_element.innerHTML = ''\n jsPsych.pluginAPI.clearAllTimeouts(); //clearTimeout\n jsPsych.pluginAPI.cancelAllKeyboardResponses();\n jsPsych.finishTrial(trial_data_pre);\n }", "title": "" }, { "docid": "a5cbec398b91434bf058abe17464903c", "score": "0.45329642", "text": "static getSteps(steps) {\n let ts = new Pt_1.Group();\n for (let i = 0; i <= steps; i++) {\n let t = i / steps;\n ts.push(new Pt_1.Pt(t * t * t, t * t, t, 1));\n }\n return ts;\n }", "title": "" }, { "docid": "ba56b8ed08d53e5b5261214e06af075d", "score": "0.45225105", "text": "function end_trial() {\r\n\t\t\t\r\n\t\t\t//Stop the dot motion animation\r\n\t\t\tstopDotMotion = true;\r\n\t\t\t\r\n\t\t\t//Store the number of frames\r\n\t\t\tnumberOfFrames = frameRate.length;\r\n\t\t\t\r\n\t\t\t//Variable to store the frame rate array\r\n\t\t\tvar frameRateArray = frameRate;\r\n\t\t\t\r\n\t\t\t//Calculate the average frame rate\r\n\t\t\tif(frameRate.length > 0){//Check to make sure that the array is not empty\r\n\t\t\t\tframeRate = frameRate.reduce((total,current) => total + current)/frameRate.length; //Sum up all the elements in the array\r\n\t\t\t}else{\r\n\t\t\t\tframeRate = 0; //Set to zero if the subject presses an answer before a frame is shown (i.e. if frameRate is an empty array)\r\n\t\t\t}\r\n\r\n\t\t\t//Kill the keyboard listener if keyboardListener has been defined\r\n\t\t\tif (typeof keyboardListener !== 'undefined') {\r\n\t\t\t\tjsPsych.pluginAPI.cancelKeyboardResponse(keyboardListener);\r\n\t\t\t}\r\n\r\n\t\t\t//Place all the data to be saved from this trial in one data object\r\n\t\t\tvar trial_data = { \r\n\t\t\t\t\"rt\": response.rt, //The response time\r\n\t\t\t\t\"key_press\": response.key, //The key that the subject pressed\r\n\t\t\t\t\"correct\": correctOrNot(), //If the subject response was correct\r\n\t\t\t\t\"choices\": trial.choices, //The set of valid keys\r\n\t\t\t\t\"correct_choice\": trial.correct_choice, //The correct choice\r\n\t\t\t\t\"trial_duration\": trial.trial_duration, //The trial duration \r\n\t\t\t\t\"response_ends_trial\": trial.response_ends_trial, //If the response ends the trial\r\n\t\t\t\t\"number_of_apertures\": trial.number_of_apertures,\r\n\t\t\t\t\"number_of_dots\": trial.number_of_dots,\r\n\t\t\t\t\"number_of_sets\": trial.number_of_sets,\r\n\t\t\t\t\"coherent_direction\": trial.coherent_direction,\r\n\t\t\t\t\"coherence\": trial.coherence,\r\n\t\t\t\t\"opposite_coherence\": trial.opposite_coherence,\r\n\t\t\t\t\"dot_radius\": trial.dot_radius,\r\n\t\t\t\t\"dot_life\": trial.dot_life,\r\n\t\t\t\t\"move_distance\": trial.move_distance,\r\n\t\t\t\t\"aperture_width\": trial.aperture_width,\r\n\t\t\t\t\"aperture_height\": trial.aperture_height,\r\n\t\t\t\t\"dot_color\": trial.dot_color,\r\n\t\t\t\t\"background_color\": trial.background_color,\r\n\t\t\t\t\"RDK_type\": trial.RDK_type,\r\n\t\t\t\t\"aperture_type\": trial.aperture_type,\r\n\t\t\t\t\"reinsert_type\": trial.reinsert_type,\r\n\t\t\t\t\"frame_rate\": frameRate, //The average frame rate for the trial\r\n\t\t\t\t\"frame_rate_array\": JSON.stringify(frameRateArray), //The array of ms per frame in this trial, in the form of a JSON string\r\n\t\t\t\t\"number_of_frames\": numberOfFrames, //The number of frames in this trial\r\n\t\t\t\t\"aperture_center_x\": trial.aperture_center_x,\r\n\t\t\t\t\"aperture_center_y\": trial.aperture_center_y,\r\n\t\t\t\t\"fixation_cross\": trial.fixation_cross,\r\n\t\t\t\t\"fixation_cross_width\": trial.fixation_cross_width,\r\n\t\t\t\t\"fixation_cross_height\": trial.fixation_cross_height,\r\n\t\t\t\t\"fixation_cross_color\": trial.fixation_cross_color,\r\n\t\t\t\t\"fixation_cross_thickness\": trial.fixation_cross_thickness,\r\n\t\t\t\t\"border\": trial.border,\r\n\t\t\t\t\"border_thickness\": trial.border_thickness,\r\n\t\t\t\t\"border_color\": trial.border_color,\r\n\t\t\t\t\"canvas_width\": canvasWidth,\r\n\t\t\t\t\"canvas_height\": canvasHeight\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Remove the canvas as the child of the display_element element\r\n\t\t\tdisplay_element.innerHTML='';\r\n\t\t\t\r\n\t\t\t//Restore the settings to JsPsych defaults\r\n\t\t\tbody.style.margin = originalMargin;\r\n\t\t\tbody.style.padding = originalPadding;\r\n\t\t\tbody.style.backgroundColor = originalBackgroundColor\r\n\r\n\t\t\t//End this trial and move on to the next trial\r\n\t\t\tjsPsych.finishTrial(trial_data);\r\n\t\t\t\r\n\t\t} //End of end_trial", "title": "" }, { "docid": "bfbd17da3b6e6647c9e72681eb135879", "score": "0.45220616", "text": "function manual_trial(which_size,nafc,is_YN) {\n // Get random orientation\n var oriNew=generate_ori(nafc);\n if (is_YN) {oriNew=0}; // for Y/N task, always right-pointed\n\n // Set up trial parameters, which are merged with the code to do 1 trial\n set_value(\"trial\",`trial_params={\\n\\torientation: ${oriNew},\\n\\tsize: ${map_size[which_size]}\\n}`);\n\n do_trial(); // TODO: figure out better place for this\n\n prev_manual_trial={'ori':oriNew, 'size': which_size};\n prev_answered=false;\n num_manual_trial += 1;\n }", "title": "" }, { "docid": "313d78884a64339c46cb3cf4217cdd6c", "score": "0.45206973", "text": "function getSwitchRepeatList(taskArr, blockTrialLength){\n let switchRepeatArr = [], prevTask;\n for (let i = 0; i < taskArr.length; i++){\n // check if task switch/repeat and increment\n if ((i % trialsPerBlock != 0) && (i % miniBlockLength != 0) && (i % blockTrialLength != 0)) {\n //if not first trial of block\n if (taskArr[i] == prevTask) { //trial is repeat\n switchRepeatArr.push(\"r\");\n } else { //trial is switch\n switchRepeatArr.push(\"s\");\n }\n } else {\n //first trial so not switch or repeat, classify as \"n\"\n switchRepeatArr.push(\"n\");\n }\n\n //prepare prevTask for next loop iteration\n prevTask = taskArr[i];\n }\n return switchRepeatArr;\n}", "title": "" }, { "docid": "fd7f6e986906308ac78693d0a27ba6fb", "score": "0.4516029", "text": "function get_all_stimuli(TEST_RUN){\n\n\n all_stimuli = []\n MAIN_DIR = \"stimuli/images/spore_stims/\"\n\n if (TEST_RUN == 1) {\n // 30 species\n species = Array.from({length: 4}, (_, i) => i + 1)\n }\n else {\n // 20 species\n species = Array.from({length: 12}, (_, i) => i + 1)\n }\n\n // set number is specified in experiment.html\n for (var j = 0; j < species.length; j++){\n\n // add 0's before number for species number less than 0\n if (species[j] < 10) {\n current_species = '0' + species[j]\n }\n else {\n current_species = species[j]\n }\n\n current_stimuli = MAIN_DIR + 'simple_' + current_species + \"_A.gif\"\n\n all_stimuli.push(current_stimuli)\n }\n\n\n // put creatures in pairs\n\n\n return (all_stimuli)\n\n}", "title": "" }, { "docid": "b835248ae29e7723549b3803b3f3c2aa", "score": "0.45123556", "text": "function genSubObjects(\n latestReceiptInfo, pendingRenewalInfo, trialConsumedForGroup,\n) {\n const currentDate = new Date();\n const timestamp = currentDate.getTime();\n\n // Create the array of subscription purchases, grouped by product ID.\n const purchases = [];\n\n processLatestReceiptInfo(latestReceiptInfo, purchases, trialConsumedForGroup,\n timestamp);\n\n // Iterate over the pending renewal information to provide\n // critical information about upcoming changes to the billing cycle.\n processPendingRenewalArray(pendingRenewalInfo, purchases, timestamp);\n\n return purchases;\n}", "title": "" }, { "docid": "e3399c6aedcddd97f2fd4ad6f08ddcad", "score": "0.4509294", "text": "triplets() {\n\t\t// hand doesn't even contain 3 tiles\n\t\tif (this.tiles.length < 3) {\n\t\t\treturn [];\n\t\t}\n\n\t\tlet triples = [];\n\t\tlet i = 0;\n\n\t\twhile(i < this.tiles.length) {\n\t\t\t// check if the current tile + the next two form a triplet\n\t\t\tlet possibleTriple = [this.tiles[i], this.tiles[i+1], this.tiles[i+2]]\n\n\t\t\t// if this contains an undefined, we've reached past the end of the hand\n\t\t\tif (possibleTriple.includes(undefined)) {\n\t\t\t\treturn triples;\n\t\t\t}\n\n\t\t\t// if these 3 tiles have the same suit and number, push them\n\t\t\tif (tile.sameSuit(possibleTriple) && tile.sameNum(possibleTriple)) {\n\t\t\t\ttriples.push(possibleTriple)\n\t\t\t\t// move 3 positions to look at next possible tile\n\t\t\t\ti += 3;\n\t\t\t} else {\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\n\t\treturn triples\n\t}", "title": "" }, { "docid": "3e9058c6ab61938af641852396f9090e", "score": "0.45091885", "text": "function getTrips() {\n if (authData.isUserLoggedIn) {\n return authFactory.getIdToken().then(function(currentUser) {\n return $http({\n method: 'GET',\n url: '/trip/all/' + authData.currentUser.id,\n headers: {\n id_token: authData.currentUser.authIdToken\n }\n })\n .then(function(response) {\n data.trips = response.data;\n return;\n },\n function(err) {\n console.log('Unable to retrieve trips', err);\n return;\n });\n });\n } else {\n return;\n }\n } // End getTrips", "title": "" }, { "docid": "a5c78e33c5fb6e058d2f8489d5c43a86", "score": "0.4508868", "text": "function liveStrong() {\n let strongOrg = [];\n for (let i = 0; i < 30;) {\n if (pAequorFactor(i, mockUpStrand()).willLikelySurvive() === true) {\n strongOrg.push(pAequorFactor(i, mockUpStrand()));\n i++;\n }\n }\n return strongOrg;\n}", "title": "" }, { "docid": "f4342b7324d8eac072b545290788b40d", "score": "0.450811", "text": "function addTrain(sv) {\n \n var firstTime = sv.startTime\n var tFrequency = sv.frequency;\n \n // First Time (pushed back 1 year to make sure it comes before current time)\n var firstTimeConverted = moment(firstTime, \"HH:mm\").subtract(1, \"years\");\n \n // Current Time\n var currentTime = moment();\n console.log(\"CURRENT TIME: \" + moment(currentTime).format(\"hh:mm\"));\n \n // Difference between the times\n var diffTime = moment().diff(moment(firstTimeConverted), \"minutes\");\n \n // Time apart (remainder)\n var tRemainder = diffTime % tFrequency;\n \n // Minute Until Train\n var tMinAway = tFrequency - tRemainder;\n \n // Next Train\n var nxtTrain = moment().add(tMinAway, \"minutes\");\n //we need to dynamically generate the table rows from the firebase database and add to our index page...\n var newRow = $(\"<tr>\").append(\n $(\"<th>\").attr({\"scope\":\"col\", \"class\": \"colName\"}).text(sv.name),\n $(\"<td>\").attr({\"scope\":\"col\", \"class\": \"colDestination\"}).text(sv.destination),\n $(\"<td>\").attr({\"scope\":\"col\", \"class\": \"colFrequency\"}).text(tFrequency),\n $(\"<td>\").attr({\"scope\":\"col\", \"class\": \"colNxtTrain\"}).text(moment(nxtTrain).format(\"hh:mm\")),\n $(\"<td>\").attr({\"scope\":\"col\", \"class\": \"colMinAway\"}).text(tMinAway)\n )\n \n $(\"#train-content\").append(newRow);\n}", "title": "" }, { "docid": "2a2fcd202ffea51f07b10ac12436f111", "score": "0.45061287", "text": "function buildNoteSequence()\n{\n var notes = [];\n var parsed;\n\n for (let item of noteSet)\n {\n parsed = JSON.parse(item);\n notes.push(parsed);\n };\n\n const drumSeq = {\n notes,\n quantizationInfo: {stepsPerQuarter: 4},\n tempos: [{time: 0, qpm: 120}],\n totalQuantizedSteps: 8\n };\n\n return drumSeq;\n}", "title": "" }, { "docid": "f2e29acdcd3ffe2dae82a67e5b450bde", "score": "0.45044315", "text": "buildNarrative() {\n const {conditionSection} = this.props;\n const subsections = this.getSubsections();\n if (Object.keys(subsections).length === 0) {\n return [];\n }\n\n let narrativeTemplate = \"\";\n if (conditionSection.narrative === undefined) {\n return [];\n }\n conditionSection.narrative.forEach((sentenceObject) => {\n const template = this.getTemplate(subsections, sentenceObject);\n narrativeTemplate = narrativeTemplate.concat(template).concat(\" \");\n });\n return this.buildNarrativeSnippetList(narrativeTemplate, subsections);\n }", "title": "" }, { "docid": "67682e42689caa97681a0e84d7061751", "score": "0.44977796", "text": "scheduleTalk(talks,session_instance){\n var organizer= new Organizer();\n var new_talks=organizer.organize(talks,session_instance.getEndTime() - session_instance.getStartTime());\n var newer_talks=[]\n for(let i=0;i<new_talks.length;i++){\n if(new_talks[i].isDone==false){\n newer_talks.push(new_talks[i])\n }\n else{\n session_instance.addTalk(new_talks[i])\n }\n \n }\n return newer_talks; \n }", "title": "" } ]
9c9dd3dfab388f186f590c9aea540414
holds all rows of data
[ { "docid": "06eddd5809b5dda73e8291b22c7f50e5", "score": "0.0", "text": "async function setHeader(){\n console.log('config file')\n const header = []\n header.push('bid')\n header.push('ask')\n output.push(header.join())\n fs.writeFileSync(filename, output.join(os.EOL));\n}", "title": "" } ]
[ { "docid": "e4ecbb17495516263d58c5a27a293397", "score": "0.69443625", "text": "getData() {\n return this.rows;\n }", "title": "" }, { "docid": "6dff6839976568a860561d08d2a36d39", "score": "0.69259226", "text": "function addtoArray() {\n //console.info(\"getRowCount\" + _self.backendApi.getRowCount());\n _self.backendApi.eachDataRow(function (rownum, row) {\n //console.info(\"rownum \" + rownum);\n lastrow = rownum;\n //do something with the row..\n\n });\n\n }", "title": "" }, { "docid": "ac3073b00dc1189ffd74ae817f632270", "score": "0.69201034", "text": "getRows() {\n return this._rows.slice();\n }", "title": "" }, { "docid": "99c94d551a3b118f3347a00a69a74699", "score": "0.68251383", "text": "get rows() {\n return this._rows;\n }", "title": "" }, { "docid": "dd9cca3145e51097017fef30e5e9a365", "score": "0.6800206", "text": "getAllRows() {\r\n\t\t// The table needs to be loaded before we attempt to access the rows.\r\n\t\t// We could just return an empty Map here, but throwing an error highlights the mistake.\r\n\t\tif (!this.isLoaded)\r\n\t\t\tthrow new Error('Attempted to read a data table rows before table was loaded.');\r\n\r\n\t\tconst rows = this.rows;\r\n\r\n\t\t// Inflate all copy table data before returning.\r\n\t\tif (!this.isInflated) {\r\n\t\t\tfor (const [destID, srcID] of this.copyTable)\r\n\t\t\t\trows.set(destID, rows.get(srcID));\r\n\r\n\t\t\tthis.isInflated = true;\r\n\t\t}\r\n\r\n\t\treturn rows;\r\n\t}", "title": "" }, { "docid": "45c75fd3b50facf1d03b8c1b95e8f369", "score": "0.6785258", "text": "get_all() {\n let all = [];\n for (let [rowid, row] of this.rows) {\n for (let colid of row) {\n all.push([rowid, colid]);\n }\n }\n return all;\n }", "title": "" }, { "docid": "8e11c738a4bc8c962bc8efad34384208", "score": "0.66229147", "text": "function allData() {\n tbody.html(\"\");\n tableData.forEach((report) => {\n var row = tbody.append(\"tr\");\n Object.entries(report).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n numberEvents.text(objectLength(tableData));\n}", "title": "" }, { "docid": "7d5d4a426b3c1058c997c851613d28ea", "score": "0.66046137", "text": "rowData() {\n const data = this.mapResponseData();\n let rows = [];\n if (data) {\n for (const property in data) {\n rows = rows.concat(data[property]);\n }\n return rows;\n }\n return null;\n }", "title": "" }, { "docid": "f853a33b8d2de8a08eba1b862127be2f", "score": "0.6596581", "text": "function fulldata() {\n tbody.html(\"\");\n console.log(`Complete data: ${tableData.length} records in this table.`);\n console.log(\"----------\");\n\n tableData.forEach(function(sighting) {\n\n var row = tbody.append(\"tr\");\n\n Object.entries(sighting).forEach(function([key, value]) {\n\n var cell = row.append(\"td\");\n\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "bd84a34cebd86c39194af8f0bd1f950a", "score": "0.64999115", "text": "getDataClone() {\n return this.data.map(row => row.slice());\n }", "title": "" }, { "docid": "462271dc67f103e958039ca4e77d8411", "score": "0.6450866", "text": "all() {\n return Util_1.default.toDataset(this.data);\n }", "title": "" }, { "docid": "db448a475268828ee4c0133b338966e6", "score": "0.6436795", "text": "toArray() {\r\n let result = new Array(this.rows);\r\n result = this.data.splice(0);\r\n return result;\r\n }", "title": "" }, { "docid": "efcd84e93208b64bc9aa2127bbb0a166", "score": "0.642612", "text": "generateData() {\n\t\tvar data = [];\n\t\tthis.chunk.forEach(function(row, i, arr) {\n\t\t\tdata.push([]);\n\t\t\trow.forEach(function(item, j, rarr) {\n\t\t\t\tdata[i].push(item.generateData());\n\t\t\t});\n\t\t});\n\t\treturn data;\n\t}", "title": "" }, { "docid": "6479127ebed881032b7b7d6f2f98ed03", "score": "0.6419446", "text": "function populateRows() {\n let tmpRows = [];\n for(let i = 1; i <= 20; i++) {\n const ingredient = data[`strIngredient${i}`];\n const quantity = data[`strMeasure${i}`];\n \n if (ingredient === null || ingredient === \"\") {\n continue;\n }\n tmpRows.push({key: i, ingredient: ingredient, quantity: quantity})\n }\n setRows(tmpRows);\n }", "title": "" }, { "docid": "c0a7cf5e18e8d78a6de42e7fc937d132", "score": "0.6373339", "text": "function prepData(rows) {\n var i = 1;\n rows.forEach( (row) => {\n row.index = i;\n if (row.Count) {\n row.Count = +row.Count;\n }\n i++;\n });\n return rows;\n}", "title": "" }, { "docid": "443183e731b7c063660454d40862b611", "score": "0.63478494", "text": "get allData() {\n let currentNode = this._head;\n let data = [];\n while (currentNode != null) {\n data.push(currentNode.data);\n currentNode = currentNode.next;\n }\n return data;\n }", "title": "" }, { "docid": "3a91a45d2a1ccf7c287af82c88296567", "score": "0.632968", "text": "function viewDataAll(table) {\n console.log(\"view data all...\");\n db.transaction(function(transaction) {\n transaction.executeSql('SELECT * FROM '+table, [], function (tx, results) {\n var resLen = results.rows.length;\n console.log(\"table results=\"+JSON.stringify(results));\n for (i = 0; i < resLen; i++){\n console.log(\"id=\"+results.rows.item(i).id+\"-title=\"+results.rows.item(i).title+\"-desc=\"+results.rows.item(i).desc);\n $(\"#data-output\").append(\"<p>id=\"+results.rows.item(i).id+\" - title=\"+results.rows.item(i).title+\" - desc=\"+results.rows.item(i).desc)\n }\n }, null);\n });\n }", "title": "" }, { "docid": "216e3b708c4cc4ee3e8395e0b36f6530", "score": "0.63191277", "text": "function UltraGrid_GetData()\n{\n\t//create an array for the result\n\tvar result = [];\n\t//return it\n\treturn result;\n}", "title": "" }, { "docid": "e0bc581553f9670ca60760905bad0ab6", "score": "0.6303679", "text": "_getRowsArray() {\n return this._rows instanceof QueryList ? this._rows.toArray() : this._rows;\n }", "title": "" }, { "docid": "5be1e06118ce291c14fddf0e01d62b3e", "score": "0.62607545", "text": "function getRows() {\n var self = this;\n\n self._getRows.apply(self, arguments);\n}", "title": "" }, { "docid": "f91518d7b7da5dee8030fad3d790cdfd", "score": "0.62312335", "text": "get data() {\n\t\treturn this._tableData;\n\t}", "title": "" }, { "docid": "6f7b42ba8db14387aae8b14d73c89616", "score": "0.61986387", "text": "function getRowsData_(sheet) {\n var headersRange = sheet.getRange(1, 1, sheet.getFrozenRows(), sheet.getMaxColumns());\n var headers = headersRange.getValues()[0];\n var dataRange = sheet.getRange(sheet.getFrozenRows() + 1, 1, sheet.getMaxRows(), sheet.getMaxColumns());\n var objects = getObjects_(dataRange.getValues(), normalizeHeaders_(headers));\n return objects;\n}", "title": "" }, { "docid": "6d9a970c8f34a984ee74b0d65013b980", "score": "0.6193825", "text": "function _getAllRows() {\r\n return _table.getElementsByTagName('tr');\r\n }", "title": "" }, { "docid": "18f01a2f05fbc178356f787dff4a7d55", "score": "0.6190009", "text": "function _createDataRows(conf,data){\r\n\tvar _fields = _getCaptionArray(conf);\r\n\tvar _list = new Array();\r\n\t\r\n\tfor (var d in data){\r\n\t\tvar _row = new Array();\r\n\t\t//console.log(\"JSON: \"+JSON.stringify(success[m]));\r\n\t\tfor (var f in _fields){\r\n\t\t\tvar _column = _fields[f];\r\n\t\t\t//console.log(\"+ column: \"+_column);\r\n\t\t\tif (! data[d][_column]) _row.push(\"\");\r\n\t\t\telse _row.push(data[d][_column]);\r\n\t\t}\r\n\t\t_list.push(_row);\r\n\t\tconsole.log(\"** row: \"+_row);\r\n\t}\t\r\n\treturn _list;\r\n}", "title": "" }, { "docid": "e1c9c2230f32197b2b8898d2bc2402cf", "score": "0.6166216", "text": "constructor (data) {\n\t\tthis.rows = data;\n\t}", "title": "" }, { "docid": "998c18bbf910c54686f3707d53fab61a", "score": "0.6155213", "text": "rows() {\n let fileContents = fs.readFileSync(this.path, 'utf8');\n let lines = this.dropHeaderRow(fileContents.split(/\\r?\\n/));\n return lines.map(line => {\n return line.split(\",\").map(s => s.trim());\n });\n }", "title": "" }, { "docid": "61dab88f79f7294e34a7ff89c78eabd9", "score": "0.61483663", "text": "function addingRows(data) {\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createDescripRow(data[i]));\n }\n // console.log(rowsToAdd);\n }", "title": "" }, { "docid": "6e1762eab50bf3980f5bd3bf00214ccf", "score": "0.61401564", "text": "static generateData(count, randomHeight = false, initialId = 1, reset = true) {\n if (reset) this.reset();\n const rows = [],\n number = DataGenerator.overrideRowCount ? DataGenerator.overrideRowCount : count,\n generator = this.generate(number, randomHeight, initialId);\n\n for (let i = 0; i < number; i++) {\n rows.push(generator.next().value);\n }\n\n return rows;\n }", "title": "" }, { "docid": "ae556bad82413136eba9c9c561e61f4b", "score": "0.6138016", "text": "function queryAllRows() {\n connection.query(\"SELECT * FROM products\", function (err, data) {\n if (err) throw err;\n\n console.table(data);\n selectItem(data);\n });\n}", "title": "" }, { "docid": "ea57bc1f9d86774d35f4c24d48ec09cb", "score": "0.60970855", "text": "static generateData(count, randomHeight = false, initialId = 1, reset = true) {\n if (reset) this.reset();\n\n const rows = [],\n number = DataGenerator.overrideRowCount ? DataGenerator.overrideRowCount : count,\n generator = this.generate(number, randomHeight, initialId);\n\n for (let i = 0; i < number; i++) {\n rows.push(generator.next().value);\n }\n return rows;\n }", "title": "" }, { "docid": "9ae19a08c4278a7a877b6403a2bdbdeb", "score": "0.6095508", "text": "function parseRows(data) {\n\t\t\t\t\tdata.forEach(function (row) {\n\t\t\t\t\t\trows.push(parseRow(row));\n\t\t\t\t\t});\n\t\t\t\t}", "title": "" }, { "docid": "d32bc5f01b6a123bedda2f65cf64bf29", "score": "0.608379", "text": "getData(numRecords = undefined) {\n return !numRecords ? this.data : this.data.slice(0, numRecords);\n }", "title": "" }, { "docid": "9c8ce66db936344a5e23c36089a49146", "score": "0.6072613", "text": "get dataColl() {\n return this.toRowDataColl(this.values);\n }", "title": "" }, { "docid": "f194c65a6c0baae970ef28b9c2cd6421", "score": "0.6072308", "text": "function GetDataRows() {\n let rows = \"\";\n packingList.forEach(row => {\n rows = rows\n + \"<tr>\"\n + \"<td>\" + row.part_number + \"</td>\"\n + \"<td>(\" + row.qty + \"x) \" + row.description + \"</td>\"\n + \"<td align='right'>\" + (row.weight * row.qty).toFixed(2) + \"</td>\"\n + \"<td align='right'>$\" + (row.price * row.qty).toFixed(2) + \"</td>\"\n + \"</tr>\";\n });\n\n return rows;\n }", "title": "" }, { "docid": "6f2a1488e3629591a6dc42d80059d0c0", "score": "0.60636973", "text": "getRowData() {\n return this._area.getRowData();\n }", "title": "" }, { "docid": "4bbdc94b4bbf18791d16195e49dca8f6", "score": "0.6044364", "text": "function loadData() {\n const coordsData = table.getRows();\n length = table.getRowCount();\n\n for (let i = 0; i < length; i++) {\n let name = coordsData[i].getNum(\"array#\");\n let xPos = coordsData[i].getNum(\"x\");\n let yPos = coordsData[i].getNum(\"y\");\n coords[i] = new Coord(name, xPos, yPos);\n }\n}", "title": "" }, { "docid": "d5c5b472c96d096a1cfa012df6270a65", "score": "0.6040072", "text": "function getPoints() {\n return tableData;\n }", "title": "" }, { "docid": "793236ba0aaec8d58922822306979ec1", "score": "0.60156083", "text": "function getTableData(table) {\n const dataArray = [],\n tipoArray = [],\n cantArray = [];\n\n table.rows({\n search: \"applied\"\n }).every(function() {\n const data = this.data();\n tipoArray.push(data[0]);\n cantArray.push(data[1]);\n });\n\n dataArray.push(tipoArray, cantArray);\n\n return dataArray;\n}", "title": "" }, { "docid": "2e3b347433166311ae1d3bcbc67bec52", "score": "0.6014376", "text": "function getRows() {\n\t\toriginal().then(row => (originalRow = row));\n\t\texpected().then(row => (expectedRow = row));\n\t}", "title": "" }, { "docid": "e35ad4c7504f47da6f6bb8c2f4191763", "score": "0.60058343", "text": "function selectRows(data) {\n \t\n }", "title": "" }, { "docid": "4d9015e7ea75f1b91787462c8965527e", "score": "0.60031426", "text": "async prepareData(data) {\n if (!isArray(data)) {\n data = [data];\n }\n\n const batches = [];\n const batchSize = this.options.batchSize;\n let currentBatch = [];\n let fieldCount;\n\n await Promise.all(\n data.map(async (data) => {\n const instance = this.getInstance(data);\n const row = await this.getRow(instance);\n const rowFieldCount = Object.values(row).length;\n\n if (fieldCount === undefined) {\n fieldCount = rowFieldCount;\n } else if (fieldCount !== rowFieldCount) {\n throw new this.constructor.QueryError(\n `${this.model.name}: all objects for ${\n this.config.forUpdate ? 'update' : 'insert'\n } should have the same number of fields`\n );\n }\n\n if (batchSize) {\n if (currentBatch.length >= batchSize) {\n batches.push(currentBatch);\n currentBatch = [row];\n } else {\n currentBatch.push(row);\n }\n } else {\n currentBatch.push(row);\n }\n })\n );\n\n if (currentBatch.length) {\n batches.push(currentBatch);\n }\n\n return batches;\n }", "title": "" }, { "docid": "cc569850af198a17cfb998aafde86fcb", "score": "0.60023224", "text": "function newRows() {\n var rows = [];\n for (var x = 0; x < 50; x++) {\n rows.push({\n name: SECURITIES[Math.floor(Math.random() * SECURITIES.length)],\n client: CLIENTS[Math.floor(Math.random() * CLIENTS.length)],\n lastUpdate: new Date(),\n chg: Math.random() * 20 - 10,\n bid: Math.random() * 10 + 90,\n ask: Math.random() * 10 + 100,\n vol: Math.random() * 10 + 100,\n });\n }\n return rows;\n}", "title": "" }, { "docid": "7c481fca77debb18c4841af81d3a9dab", "score": "0.5993087", "text": "function toRows(data, rowCount) {\n console.log(\"data\")\n console.log(Object.values(data[0])[0])\n var arr1 = new Array()\n for (let i = 0; i < rowCount; i++) {\n arr1.push(Object.values(data[i])[0])\n }\n arr1 = [].concat.apply([], arr1)\n\n var arr2 = new Array()\n for (let i = 0; i < rowCount; i++) {\n arr2.push(parseFloat(Object.values(data[i])[1]))\n }\n arr2 = [].concat.apply([], arr2)\n console.log(arr1)\n console.log(arr2)\n return [arr1, arr2]\n\n}", "title": "" }, { "docid": "fe693dc35c2535eaab3a178a6ddd0ef1", "score": "0.5992488", "text": "fetchAll() {\n return this.data;\n }", "title": "" }, { "docid": "8da81feaf56b49693fd09660005c15c7", "score": "0.59741217", "text": "function getAllTheData() {\n var render = function (tx, rs) {\n // rs contains our SQLite recordset, at this point you can do anything with it\n // in this case we'll just loop through it and output the results to the console\n for (var i = 0; i < rs.rows.length; i++) {\n /* alert(JSON.stringify(rs.rows.item(i)));*/\n }\n }\n\n app.selectAllRecords(render);\n}", "title": "" }, { "docid": "8da81feaf56b49693fd09660005c15c7", "score": "0.59741217", "text": "function getAllTheData() {\n var render = function (tx, rs) {\n // rs contains our SQLite recordset, at this point you can do anything with it\n // in this case we'll just loop through it and output the results to the console\n for (var i = 0; i < rs.rows.length; i++) {\n /* alert(JSON.stringify(rs.rows.item(i)));*/\n }\n }\n\n app.selectAllRecords(render);\n}", "title": "" }, { "docid": "a1088d87f5eda9beff7fe975141e757c", "score": "0.5960962", "text": "constructor() { this.rows = []; this.cmd = this.oid = this.binary = this.rowParser = undefined; this.rowCount = 0; }", "title": "" }, { "docid": "978479fa434addfd8ecb16fe29e1ea84", "score": "0.5933369", "text": "getData() {\r\n return this.table;\r\n }", "title": "" }, { "docid": "270091bbbe0465b4657c7f19fedd96ce", "score": "0.593211", "text": "function getAllData() {\n fetch(\"/items\", {\n headers: { 'Content-Type': 'application/json' },\n method: \"GET\",\n })\n .then(res => {\n if(res.ok) return res.json();\n })\n .then(res => {\n data = res;\n createTable(res);\n })\n .catch(error => console.error(error.message));\n }", "title": "" }, { "docid": "2fe2fb919806da9c9da475092bc56df6", "score": "0.5927086", "text": "allData() {\n const sql = 'SELECT * FROM office';\n return this.db.many(sql);\n }", "title": "" }, { "docid": "99d21bc7db74a6c029a9a617c6c6e64b", "score": "0.5921942", "text": "_refreshDataRows() {\r\n const that = this,\r\n tbody = that.$.tableContainer.children[1],\r\n dataRows = Array.from(tbody.querySelectorAll('tr:not(.smart-table-filter-row)'));\r\n\r\n for (let i = 0; i < dataRows.length; i++) {\r\n dataRows[i].remove();\r\n }\r\n\r\n that._createDataRows(tbody);\r\n that._handleFrozenColumnPositions();\r\n }", "title": "" }, { "docid": "f8aee4f18bfc5f3dd174b3b36eb358ba", "score": "0.59197325", "text": "constructor(rows) {\n this._rows = rows.slice();\n }", "title": "" }, { "docid": "bd2b25dde77a28e9f2587cc1dfa4b043", "score": "0.591287", "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": "390eaaaae4121e0ebb34adb114ceb2af", "score": "0.59094757", "text": "get_all() {\n const sql = `SELECT * from ficha`;\n let paci=[];\n database.all(sql, [], (err, rows) => {\n if (err) {\n console.log(err);\n }\n paci = rows;\n // rows.forEach((row) => {\n // array.push(row)\n // // console.log(row)\n // });\n return paci\n });\n \n // database.close();\n }", "title": "" }, { "docid": "f80d6c4e9b2725b2b51cb586e6228ca4", "score": "0.59060514", "text": "function eachrow()\r\r\n{\r\r\n/*\tvar ids=$(\"#list2\").getDataIDs();\r\r\n\t$.each(ids,function(key,val){\r\r\n\tvar ret = jQuery(\"#list2\").getRowData(val);\r\r\n\t\t\r\r\n\t});\t\r\r\n\t*/\r\r\n\r\r\n}", "title": "" }, { "docid": "ed75777d74ef3aeb3b3b2e49de614ec3", "score": "0.5887931", "text": "function dataFunc(data) {\n console.log(data.getData());\n console.log(data.getColumns());\n }", "title": "" }, { "docid": "1370f334b52391d0aa36d62a799c1ac9", "score": "0.5875952", "text": "function makeAllRows() {\n for (var i = 0; i < allLocations.length; i++) {\n allLocations[i].customerNum();\n allLocations[i].cookiesPerHour();\n allLocations[i].totalCookies();\n allLocations[i].makeTableRow();\n }\n}", "title": "" }, { "docid": "f170aad428a7c8f046f69169de81abc5", "score": "0.587558", "text": "function getDataFromTable() {\n\n /**\n * Given a class name for a variable it reads all of its values.\n * In other words, it reads all column values. Returns this as an\n * array.\n */\n function readVariable(name) {\n\n // Iterate through all values.\n var values = []\n $(name).each(function() {\n\n // Get the floating point value from the cell. If it is not a float\n // then take it as 0.\n var val = parseFloat($(this).val());\n if (isNaN(val)) {\n val = 0;\n }\n values.push(val);\n })\n\n return values;\n\n } \n\n // Read all variables defined in VAR_NAMES and store them in data.\n for (var i = 0; i < VAR_NAMES.length; i++) {\n data[i] = readVariable(VAR_NAMES[i]);\n }\n\n // Reset to redraw everything.\n reset();\n}", "title": "" }, { "docid": "1e96b816b3fdd46fe7050c30f57e4649", "score": "0.58730114", "text": "async function prepareData( param ) {\n\n // get source data\n const source = DataStore.getDataset( param.data_id ),\n cols = source.getColumnMeta(),\n srcData = source.getData(),\n rowCount = source.getRowCount();\n\n // shortcuts\n const namecol = srcData[ param.name ],\n sizecol = srcData[ param.size ];\n\n // collect data per column set\n const result = [];\n for( let i=0; i<rowCount; i++ ) {\n\n // add value\n result.push( {\n n: namecol[i],\n s: sizecol[i],\n });\n\n }\n\n return {\n values: result,\n };\n\n }", "title": "" }, { "docid": "29370fe434aeb7a6993400f91a3d9038", "score": "0.586921", "text": "function all() {\n return database.slice();\n}", "title": "" }, { "docid": "16a527293a16159287fbdf19a95228ac", "score": "0.5867652", "text": "function createResultRows(table, data){\r\n\tfor (let i = 0; i < data.length; i++){\r\n\t\tlet row = document.createElement(\"TR\");\r\n\t\ttable.append(row);\r\n\r\n\t\t// create cells and append to the current row. Pass in the object values as argument\r\n\t\tcreateCells(row, data[i]);\r\n\t}\r\n}", "title": "" }, { "docid": "4f2692a02243b1faa071ff8dd4c8e2d2", "score": "0.5854414", "text": "function readQueryRowData(data){\n\treturn '<td>'+data.id+'</td><td>'+data.url+'</td><td>'+data.status+'</td>';\n}", "title": "" }, { "docid": "ba68e1f771b2d786753115a4070b804c", "score": "0.5853937", "text": "_getAllRenderRows() {\n const renderRows = [];\n // Store the cache and create a new one. Any re-used RenderRow objects will be moved into the\n // new cache while unused ones can be picked up by garbage collection.\n const prevCachedRenderRows = this._cachedRenderRowsMap;\n this._cachedRenderRowsMap = new Map();\n // For each data object, get the list of rows that should be rendered, represented by the\n // respective `RenderRow` object which is the pair of `data` and `CdkRowDef`.\n for (let i = 0; i < this._data.length; i++) {\n let data = this._data[i];\n const renderRowsForData = this._getRenderRowsForData(data, i, prevCachedRenderRows.get(data));\n if (!this._cachedRenderRowsMap.has(data)) {\n this._cachedRenderRowsMap.set(data, new WeakMap());\n }\n for (let j = 0; j < renderRowsForData.length; j++) {\n let renderRow = renderRowsForData[j];\n const cache = this._cachedRenderRowsMap.get(renderRow.data);\n if (cache.has(renderRow.rowDef)) {\n cache.get(renderRow.rowDef).push(renderRow);\n }\n else {\n cache.set(renderRow.rowDef, [renderRow]);\n }\n renderRows.push(renderRow);\n }\n }\n return renderRows;\n }", "title": "" }, { "docid": "7e5d7bf76d21cefc8cb8e87bef034cf4", "score": "0.58516556", "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": "abeaef3868762df87ce36adac49313c0", "score": "0.58482873", "text": "function getMultipleRandomRows() {\n let OrderId = 1800;\n let Quantity = 70;\n let Product = \"Aspirin\";\n let Destination = \"67 New York Ave\";\n\n var data = [];\n for(var i =0; i < 1000; i++) {\n data.push([rec.OrderId, rec.Quantity, Product, Destination]);\n }\n console.log(data.length);\n return data;\n}", "title": "" }, { "docid": "0a7f4044ec0de932b54a4147dee71e85", "score": "0.58464015", "text": "function readRows() {\n var sheet = SpreadsheetApp.getActiveSheet();\n var rows = sheet.getDataRange();\n var numRows = rows.getNumRows();\n var values = rows.getValues();\n \n makeTables(values)\n}", "title": "" }, { "docid": "5239d5d5909962d41020d3aeb5036ab1", "score": "0.5841076", "text": "function _fetchData() {\n var _rows = rows();\n var _windowSize = windowSize();\n var _windowPosition = windowPosition();\n var availableRowCount = AutomatonModel.getRowCount();\n\n // figure out the range we need to fetch, and fetch it.\n var end = Math.min(_windowPosition, availableRowCount);\n var start = Math.max(0, end - _windowSize);\n var fetchedRows = AutomatonModel.getRange(start, end);\n\n // adjust the automaton size if it looks like that has changed\n var _size = 0;\n if (fetchedRows.length) {\n _size = fetchedRows[0].data.length;\n }\n if (_size > automatonSize() || _size === 0) {\n automatonSize(_size);\n }\n\n // store the fetched rows in the viewModel.\n rows(fetchedRows);\n }", "title": "" }, { "docid": "37bb9648681fbbcd76c8f209651ed7cb", "score": "0.58266145", "text": "model () {\n return this.rows;\n }", "title": "" }, { "docid": "c58ef2b4c5c6f9c7210f64ce0f66040d", "score": "0.5813252", "text": "function readAllRawData() {\n\tvar raw = [];\n\t\n\tswitch(dataSetId) {\n\tcase 0:\n\t\traw.push(data00);\n\t\traw.push(data01);\n\t\traw.push(data02);\n\t\traw.push(data03);\n\t\traw.push(data04);\n\t\traw.push(data05);\n\t\traw.push(data06);\n\t\traw.push(data07);\n\t\traw.push(data08);\n\t\traw.push(data09);\n\t\tbreak;\n\tcase 1:\n\t\traw.push(data10);\n\t\traw.push(data11);\n\t\traw.push(data12);\n\t\traw.push(data13);\n\t\traw.push(data14);\n\t\traw.push(data15);\n\t\traw.push(data16);\n\t\traw.push(data17);\n\t\traw.push(data18);\n\t\traw.push(data19);\n\t\tbreak;\n\tcase 2:\n\t\traw.push(data20);\n\t\traw.push(data21);\n\t\traw.push(data22);\n\t\traw.push(data23);\n\t\traw.push(data24);\n\t\traw.push(data25);\n\t\traw.push(data26);\n\t\traw.push(data27);\n\t\traw.push(data28);\n\t\traw.push(data29);\n\t\tbreak;\n\t}\n\treturn raw;\n}", "title": "" }, { "docid": "a51513602352da0a7f7e9f26389b2abc", "score": "0.5805607", "text": "get icaos() {\n return this.rows.reduce((result, {icao}) => icao ? result.concat(icao) : result, []);\n }", "title": "" }, { "docid": "7a1141261d7521d1c635b03d5e849626", "score": "0.58028597", "text": "function unpack(rows, key) {\n let array = [];\n // console.log(rows)\n for (var doc in rows) {\n array.push(rows[doc]);\n }\n return array;\n }", "title": "" }, { "docid": "7a1141261d7521d1c635b03d5e849626", "score": "0.58028597", "text": "function unpack(rows, key) {\n let array = [];\n // console.log(rows)\n for (var doc in rows) {\n array.push(rows[doc]);\n }\n return array;\n }", "title": "" }, { "docid": "486d4699eb92296b07884f2c9bac67a1", "score": "0.5791936", "text": "function setTempRowData(){\n\t\ttempRowData = CurrentRow.getRowData(thisRow); \n\t }", "title": "" }, { "docid": "446d0e43bdabecd0d426184a4ee8f380", "score": "0.5775687", "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": "d17117b3f4135e37ae89cd2f01cb2e1b", "score": "0.57617736", "text": "static emptyBoardData() {\n let data = [];\n\n for(let line = 0; line <= MAX_LINE; line++) {\n for(let column = 0; column <= MAX_COLUMN; column++) {\n if(typeof data[line] === 'undefined') {\n data[line] = [];\n }\n data[line][column] = new BoxData(0, true);\n }\n }\n return data;\n }", "title": "" }, { "docid": "b08e0b0d8311222f216036b6ac31e1ca", "score": "0.5756356", "text": "function showAll() {\n console.log(buffer);\n var allItems = [];\n connection.query(\"SELECT item_id, product_name, department_name, price FROM products;\", function (err, res) {\n for (var i = 0; i < res.length; i++) {\n allItems.push(res[i])\n }\n console.table(allItems);\n // Browse function\n browse();\n });\n}", "title": "" }, { "docid": "1b330cca2da246e8cea7acdfa51abd39", "score": "0.57563335", "text": "ngOnInit() {\n this.fetch(data => {\n this.temp = [...data];\n this.rows = data;\n });\n }", "title": "" }, { "docid": "1b330cca2da246e8cea7acdfa51abd39", "score": "0.57563335", "text": "ngOnInit() {\n this.fetch(data => {\n this.temp = [...data];\n this.rows = data;\n });\n }", "title": "" }, { "docid": "1b330cca2da246e8cea7acdfa51abd39", "score": "0.57563335", "text": "ngOnInit() {\n this.fetch(data => {\n this.temp = [...data];\n this.rows = data;\n });\n }", "title": "" }, { "docid": "cd34d166d3679519632a514868b6cf7e", "score": "0.5753059", "text": "function loadData() {\n consolidatedresults.loaded = false;\n dataService.getConsolidatedResults()\n .then(function(response) {\n //handle the success condition here\n var data = response.data;\n consolidatedresults.realdata = data[0];\n consolidatedresults.col_names = data[1];\n consolidatedresults.loaded = true;\n // console.log(consolidatedresults.realdata);\n // console.log(consolidatedresults.col_names);\n });\n }", "title": "" }, { "docid": "a8fe2641294ca0fc79a023fc30f577bd", "score": "0.57309854", "text": "db2data() {\n\t\treturn new Promise((resolve, reject) => {\n\n\t\t\tthis.db.transaction('r', this.db.tables, async () => {\n\t\t\t\tlet tables = this.db.tables\n\t\t\t\tlet accumulator = []\n\t\t\t\tfor (var i = tables.length - 1; i >= 0; i--) {\n\t\t\t\t\t// Filter all tables starting with _\n\t\t\t\t\tif (tables[i].name.startsWith('_')) {continue}\n\t\t\t\t\t// convert table into array\n\t\t\t\t\tconst rows = await tables[i].toArray()\n\t\t\t\t\taccumulator.push({table: tables[i].name, rows: rows})\n\t\t\t\t}\n\t\t\t\treturn Promise.all(accumulator)\n\n\t\t\t}).then(result => {\n\t\t\t\tfor (var i = result.length - 1; i >= 0; i--) {\n\t\t\t\t\tthis.data[result[i].table] = result[i].rows\n\t\t\t\t}\n\t\t\t\tresolve()\n\t\t\t}).catch(e => reject(e))\n\n\n\t\t})\n\t}", "title": "" }, { "docid": "f9f1a4708a6af472536d634bd7607199", "score": "0.57282495", "text": "function data(){\n return values;\n }", "title": "" }, { "docid": "15e96383e219d34084b97601e1dbc605", "score": "0.5726277", "text": "function cityEmpDt() {\n let cityEmpArr = houseDataTable();\n cityEmpArr.forEach(element => {\n let dataArr = Object.values(element);\n dataTable.rows().add(dataArr);\n });\n}", "title": "" }, { "docid": "27ced6fc28e45b1bbcf0264998de52ba", "score": "0.5719963", "text": "function clear() {\n data = [];\n $grid.find('.row').remove();\n }", "title": "" }, { "docid": "eaf434f1e3b11e2b54a832b87e0f96d5", "score": "0.57198787", "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": "c54a63c7d158aec35e5582d2eefbaa1a", "score": "0.5710305", "text": "function getData(rowCount) {\r\n rowCount = rowCount || 4;\r\n var sentence = faker.lorem.words(12);\r\n var data = [];\r\n for (var j = 1; j <= rowCount; j++) {\r\n data.push({\r\n id: j,\r\n first_name: faker.name.findName(),\r\n email: faker.internet.email(),\r\n country: faker.address.country(),\r\n city: faker.address.city(),\r\n expenses: faker.finance.amount(),\r\n text: shuffleSentence(sentence),\r\n text2: shuffleSentence(sentence)\r\n });\r\n }\r\n return data;\r\n}", "title": "" }, { "docid": "2d4c9d7424595019ed11d6d022cba4d3", "score": "0.5696687", "text": "function initializeRows() {\n eventFeed.empty();\n const eventsToAdd = [];\n for (let i = 0; i < events.length; i++) {\n eventsToAdd.push(createNewRow(events[i]));\n }\n eventFeed.append(eventsToAdd);\n }", "title": "" }, { "docid": "bfbb1b98081593d497c67022bda5bea6", "score": "0.5678132", "text": "function loadData() {\n loadTable();\n}", "title": "" }, { "docid": "32d939e4b505d5331d914cc053d6ffe9", "score": "0.56722194", "text": "function gotAllData(err) {\n console.log(\"gotAllData()\");\n // report an error, you’d want to do something better than this in production\n if (err) {\n console.log(\"error loading data\");\n console.error(err);\n return;\n }\n // call function to show the data\n showData();\n}", "title": "" }, { "docid": "bdbe259ed5a19e253ce49d8966ae9d27", "score": "0.5668367", "text": "async all() {\n // Comprehend and validate this querys essence.\n const {conditions, modifiers, returns} = this._validatedEssence(\n 'conditions', 'modifiers', 'returns'\n );\n\n // Retrieve the rows.\n const {rows} = await this.session._emit(...processSqlTokens([\n 'select', returns || '*',\n 'from', this.hostSchema.collection,\n 'where', conditions || 'true',\n modifiers\n ]));\n // If a return value set was explicitly specified, return the pure\n // rows.\n if (this.essence.returns) return rows;\n\n // ...otherwise resolve the rows to models using the parent session.\n return rows.map(row => this.session._resolveModel(this.M, row));\n }", "title": "" }, { "docid": "a8b29c0dbc806936129e082619b985cf", "score": "0.56681305", "text": "function getValues() {\n\t\tcategoryIndexView.getRowValues(originalRow).then(values => (originalValues = values));\n\t\tcategoryIndexView.getRowValues(expectedRow).then(values => (expectedValues = values));\n\t}", "title": "" }, { "docid": "f9285f287d8b1bb0d820addcf88a042d", "score": "0.56678975", "text": "function initValues() {\n\tvalues = [];\n\tfor (var i=0; i<NY; i++) {\n\t\tvar row = [];\n\t\tfor (var j=0; j<NX; j++) {\n\t\t\trow.push(0);\n\t\t}\n\t\tvalues.push(row);\n\t}\n}", "title": "" }, { "docid": "3856c7584733d5a07c8c89c4a5ac946c", "score": "0.5665568", "text": "all() {\n return Promise.resolve(Object.values(this.data));\n }", "title": "" }, { "docid": "b186776f68c5ba6936c0f911a9af35a9", "score": "0.5654846", "text": "function insertdata() {\n getData.getAllData().then(function() {});\n }", "title": "" }, { "docid": "744db9decf475ac00845aadaa015baa7", "score": "0.5651849", "text": "function getdata() {\n\n var url = `/data`;\n\n d3.json(url).then(function(xx) {\n\n data = []\n // xx.slice(s, e)\n globaldata = xx;\n unfiltered = xx;\n actual = [], minute = []\n \n makedata();\n})\n}", "title": "" }, { "docid": "8a763deeba5fc94d1a1a2e5e1dc80a93", "score": "0.56428534", "text": "blankRowData() {\n // Each character includes the raw character ('text' field) and the\n // character attributes (same as in Terminal.cursor)\n var rowData = [];\n for (var col = 0; col < this.termCols; col++) {\n rowData.push({\n attr: 0,\n fore: \"#FFFFFF\",\n back: \"#000000\",\n text: \" \"\n });\n }\n\n return rowData;\n }", "title": "" }, { "docid": "458a4ae51c4b05c5fba6db229c37b498", "score": "0.5642209", "text": "parseRows(rows) {\n if (this.options.fields === false) {\n const fakeRows = [];\n\n if (this.options.first) {\n fakeRows.push(null);\n }\n\n return fakeRows;\n }\n\n return rows.map(this.parseRow, this);\n }", "title": "" }, { "docid": "6675f6f994da57bbccc22ef9d7fe25e7", "score": "0.56419283", "text": "toArray()\r\n {\r\n var a = [], list, k = size;\r\n for (var i = 0; i < k; i++)\r\n {\r\n list = this.#table[i];\r\n var l = list.length; \r\n \r\n for (var j = 0; j < l; j++)\r\n a.push(list[j]);\r\n }\r\n return a;\r\n }", "title": "" }, { "docid": "77c60bc44f13a4a00f428ec7900f5e21", "score": "0.56310123", "text": "function fakeData(count) {\n var i, res = [];\n for (i = 0; i < count; i++) {\n res.push({\n index: '',\n first: 'Loading',\n last: '',\n company: '',\n address: ''\n });\n }\n return res;\n }", "title": "" }, { "docid": "40175554c96d7154ffdb00d8643b6325", "score": "0.562951", "text": "function init () {\n data.forEach((tableData) => {\n let row = tbody.append(\"tr\");\n Object.values(tableData).forEach(value => {\n let cell = row.append(\"td\");\n cell.text(value);\n });\n })\n}", "title": "" }, { "docid": "26ab45dfdb93e7142b5301339eb80e03", "score": "0.56294954", "text": "function dataLoaded(err, data) {\n\n makeTableTumors(data)\n}", "title": "" } ]
c0de08339873cd2cabea5bd7692bb822
public class Block extends Statement constructor
[ { "docid": "d43b766e523e43d43b632eb5c120fd47", "score": "0.9157575", "text": "function Block(){ // default constructor\n // default constructor: call super.constructor\n Statement.prototype.constructor.apply(this,arguments)\n //properties\n //body:array of Statement // [AST_Statement*] an array of statements\n }", "title": "" } ]
[ { "docid": "9a520a1dcb5802b2f5c30d9459a39785", "score": "0.9183074", "text": "function BlockStatement(){ // default constructor\n // default constructor: call super.constructor\n Block.prototype.constructor.apply(this,arguments)\n }", "title": "" }, { "docid": "b84c0d472a17b816f81ef476c02505e1", "score": "0.79485476", "text": "function Block() {}", "title": "" }, { "docid": "5dd33f545faa053d030aa8094bc5df9e", "score": "0.76124936", "text": "function Block(parameters, body, token) {\n Node.call(this, token);\n\n this.parameters = parameters;\n this.body = body;\n}", "title": "" }, { "docid": "625b62beec1a5726a046431eebe0b112", "score": "0.7421084", "text": "function Block(parent) {\n\n // The parent block\n this.parent = parent || null;\n\n // The child blocks\n this.childs = [];\n\n // The \"deepness\" level of the block\n this.level = this.parent ? this.parent.level + 1 : 1;\n\n // The tokens inside the block\n // this.tokens = [];\n this.id = Block.id++;\n\n}", "title": "" }, { "docid": "d34de81906f33889ef8dddb6c7922f48", "score": "0.7259218", "text": "function StatementWithBody(){ // default constructor\n // default constructor: call super.constructor\n Statement.prototype.constructor.apply(this,arguments)\n //properties\n //body // [AST_Statement] the body; this should always be present, even if it's an AST_EmptyStatement\n }", "title": "" }, { "docid": "6c261991827034aa147229c23b68fece", "score": "0.725125", "text": "function BlockElement(parent) {\n this.length = 8;\n // The complete statement might be: while(i<3){i++;j--;}\n this.strStart = \"\"; // Start of statement if any - eg. while(i<3){\n this.strEnd = \"\"; // End of statement if any - eg. }\n this.type = BLOCK_GENERIC; // Type of block (for, if, etc)\n this.level = 0; // Current level (number of consecutive parents)\n this.pos = -1; // Start pos. of str inside parent block's str\n this.indented = false; // Indicates whether stmt. is indented in rel. to parent.\n this.parent = parent; // Super-block\n this.children = new Array(); // Sub-blocks\n\n if (this.parent != null) {\n parent.children[parent.children.length] = this;\n this.level = parent.level+1;\n }\n}", "title": "" }, { "docid": "f8d642c16623f35f18cfd686b85b379a", "score": "0.72491467", "text": "function Block() {\n }", "title": "" }, { "docid": "0000e2851234d11a998f2542ed175776", "score": "0.72471887", "text": "function Block (data) {\n extend(this, data);\n}", "title": "" }, { "docid": "aa8206169ba6338b0b76643ef72e5352", "score": "0.72074324", "text": "function block() {\n require(\"[\");\n var params = [], loc, body;\n while (tokens[p] === \":\") {\n p++;\n var id = tokens[p++];\n check(isId(id), 'expected identifier after \":\" for block parameter name');\n check(!isPseudo(id), \"variable name already used: \" + id);\n params[params.length] = id;\n }\n\n var loc, body;\n if (tokens[p] === \"]\") {\n loc = [];\n body = ast.ExprSeq([]);\n } else {\n if (params.length)\n require(\"|\");\n loc = locals();\n body = withScope(params.concat(loc), exprSeq, \"]\");\n }\n require(\"]\");\n return ast.Block(params, loc, body);\n }", "title": "" }, { "docid": "bc59b77801fb791d842244b39479b50b", "score": "0.7161859", "text": "function Finally(){ // default constructor\n // default constructor: call super.constructor\n Block.prototype.constructor.apply(this,arguments)\n }", "title": "" }, { "docid": "3572ee58c923dacf48367765de3e1c41", "score": "0.71044415", "text": "function newBlock(statement) {\n\tif(statement.hasOwnProperty('body')) {\n\t\treturn statement.body;\n\t}\n\tif(statement.hasOwnProperty('consequent') && statement.consequent.hasOwnProperty('type') && statement.consequent.type === 'BlockStatement' && statement.consequent.hasOwnProperty('body')) {\n\t\treturn statement.consequent;\n\t}\n\tif(statement.hasOwnProperty('declarations') && statement.declarations[0].hasOwnProperty('init') && statement.declarations[0].init.hasOwnProperty('body') && statement.declarations[0].init.body.hasOwnProperty('type') && statement.declarations[0].init.body.type === 'BlockStatement' && statement.declarations[0].init.body.hasOwnProperty('body')) {\n\t\treturn statement.declarations[0].init.body;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "374804310bf8c354968693fd8cf7f70a", "score": "0.7099118", "text": "function Scope(){ // default constructor\n // default constructor: call super.constructor\n Block.prototype.constructor.apply(this,arguments)\n //properties\n //cname // [integer/S] current index for mangling variables (used internally by the mangler)\n //enclosed // [SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes\n //parent_scope // [AST_Scope?/S] link to the parent scope\n //uses_eval // [boolean/S] tells whether this scope contains a direct call to the global `eval`\n //uses_with // [boolean/S] tells whether this scope uses the `with` statement\n //functions // [Object/S] like `variables`, but only lists function declarations\n //variables // [Object/S] a map of name -> SymbolDef for all variables/functions defined in this scope\n //directives // [string*/S] an array of directives declared in this scope\n }", "title": "" }, { "docid": "2b2d790ff59f24fc81878fbcb311358f", "score": "0.70916325", "text": "function BreakableBlock() {\n\t// class constructor\n}", "title": "" }, { "docid": "d9c79e82e6dd56b2c7d1f101768b8c38", "score": "0.7028906", "text": "function Block(spec, scope){\n // If called as constructor, return empty example\n if (this instanceof Block) return this;\n // If called as function, demux to the correct constructor\n switch(spec.blocktype){\n case 'step':\n return new Step(spec, scope);\n case 'expression':\n return new Expression(spec, scope);\n case 'context':\n return new Context(spec, scope);\n case 'eventhandler':\n return new EventHandler(spec, scope);\n default:\n console.warn('Unsupported blocktype: %o', model);\n return null;\n }\n}", "title": "" }, { "docid": "3f27cd55559dcecc22ea9fc65cd1bc1d", "score": "0.701657", "text": "function Statement(){ // default constructor\n // default constructor: call super.constructor\n Node.prototype.constructor.apply(this,arguments)\n }", "title": "" }, { "docid": "768f628f04879857106d7e9ceec2ce55", "score": "0.7012395", "text": "function Statement(){}", "title": "" }, { "docid": "bb3097b01a1cfbfdff6d83e74b4dc32e", "score": "0.69524324", "text": "function WithStatement(){ // default constructor\n // default constructor: call super.constructor\n StatementWithBody.prototype.constructor.apply(this,arguments)\n //properties\n //expression // [AST_Node] the `with` expression\n }", "title": "" }, { "docid": "9bb1b61b9a369cbb412ba73de320cc0a", "score": "0.69421583", "text": "function BlockNode(name, contents) {\n this.name = isString(name) ? name : name.name;\n TemplateNode.call(this, contents);\n}", "title": "" }, { "docid": "e31b53cd7ee3fad9dcb47c08d08dd1cc", "score": "0.69263184", "text": "function Block(descr) {\n\n // Common inherited setup logic from Entity\n this.setup(descr);\n\n //this.randomisePosition();\n //this.randomiseVelocity();\n\n\n // Default sprite and scale, if not otherwise specified\n this.sprite = g_sprites.block;\n this.scale = this.scale || 1;\n this.height = this.height || this.sprite.height;\n this.width = this.width || this.sprite.width;\n this.isSolid = true;\n\n spatialManager.register(this);\n\n/*\n // Diagnostics to check inheritance stuff\n this._BlockProperty = true;\n console.dir(this);\n*/\n\n}", "title": "" }, { "docid": "e82da25a9b6d9f736eedde9ade4fc04b", "score": "0.6916119", "text": "function IterationStatement(){ // default constructor\n // default constructor: call super.constructor\n StatementWithBody.prototype.constructor.apply(this,arguments)\n }", "title": "" }, { "docid": "adec32f7ffac1633065f5c9b599291fb", "score": "0.6905179", "text": "function Catch(){ // default constructor\n // default constructor: call super.constructor\n Block.prototype.constructor.apply(this,arguments)\n //properties\n //argname // [AST_SymbolCatch] symbol for the exception\n }", "title": "" }, { "docid": "fb08b2e572332464b29329b24b6883d4", "score": "0.6839432", "text": "function block_class(id,group,config){\n this.init_block(id,group,config);\n}", "title": "" }, { "docid": "d2541d074ebbd35f20e44bb213212121", "score": "0.68384695", "text": "function SimpleStatement(){ // default constructor\n // default constructor: call super.constructor\n Statement.prototype.constructor.apply(this,arguments)\n //properties\n //body:Token // [AST_Node] an expression node (should not be instanceof AST_Statement)\n }", "title": "" }, { "docid": "72d672bf87c1f5ab1b935a89324fba02", "score": "0.68069655", "text": "function Block() {\n this.next = null;\n this.previous = null;\n}", "title": "" }, { "docid": "1102d354589da85cedf9d75940fde521", "score": "0.67922103", "text": "function ItemBlock() {\n\t// class constructor\n\tthis.blockType = 'coin';\n}", "title": "" }, { "docid": "df10558f80a505abe2448e7cfe1e3f6a", "score": "0.6788351", "text": "function Block(position, color) {\n this.position = position;\n this.color = color;\n}", "title": "" }, { "docid": "674817b1880242224d2b2aa4d115a78c", "score": "0.6776565", "text": "function Block(descr) {\n\tthis.setup(descr);\n\tthis.sprite = this.Asprite || g_sprites.defaultBlock;\n\tthis.AnimationSprite = this.AnimationSprite || g_sprites.coin;\n\tthis.sizeMod = 1;\n\tthis.isCracked = true;\n\tthis._isInitialized = false;\n\tthis.enemySpawnTimer = 500 + Math.random()*1000;\n}", "title": "" }, { "docid": "d285627bd8a26fecc9b9d3cb7c020e31", "score": "0.6773235", "text": "function LabeledStatement(){ // default constructor\n // default constructor: call super.constructor\n StatementWithBody.prototype.constructor.apply(this,arguments)\n //properties\n //label // [AST_Label] a label definition\n }", "title": "" }, { "docid": "3b5937166de9d7b5c273e431f9ad5f18", "score": "0.67652065", "text": "function Block(descr) {\n for (var property in descr) {\n this[property] = descr[property];\n } \n}", "title": "" }, { "docid": "5580c3cb3acf912421f12c14d833b3e3", "score": "0.67476547", "text": "function EmptyStatement(){ // default constructor\n // default constructor: call super.constructor\n Statement.prototype.constructor.apply(this,arguments)\n }", "title": "" }, { "docid": "8adb980ca07cec0486fac0ad1c4e22bb", "score": "0.6704919", "text": "makefirstBlock() {\n return new Block(0, \"02/01/2018\", \"First block on the chain!\", \"0\");\n }", "title": "" }, { "docid": "90f1fded933fb92352cbe7ee101043f1", "score": "0.67", "text": "function MathBlock(){}", "title": "" }, { "docid": "63ba2645f0fd178818932e381de86b6c", "score": "0.6685061", "text": "function block(parameters, apply) {\n return new prim.Block(parameters, apply);\n}", "title": "" }, { "docid": "24b6de31dc6c0147e5b16a87bf567b08", "score": "0.6644098", "text": "function SwitchBranch(){ // default constructor\n // default constructor: call super.constructor\n Block.prototype.constructor.apply(this,arguments)\n }", "title": "" }, { "docid": "90f70280991aac969f426fd5dd3f11c4", "score": "0.6611343", "text": "function Switch(){ // default constructor\n // default constructor: call super.constructor\n Block.prototype.constructor.apply(this,arguments)\n //properties\n //expression // [AST_Node] the `switch` “discriminant”\n }", "title": "" }, { "docid": "48d3c80c75505a6c579e505d9b1163dc", "score": "0.65011674", "text": "function Block(v) {\n this._v = new Vector(v || this.v, this.k);\n this._A('w', 0);\n this._A('h', 1);\n this._A('d', 2);\n this._A('e', 3);\n console.log(this, this.v, this.e);\n}", "title": "" }, { "docid": "3cc69efc4ce510b525e569c67ca0d1ed", "score": "0.6462745", "text": "constructor () {\n console.log('constructor');\n this.blocks = []; //there was a humble array to store the chain\n }", "title": "" }, { "docid": "9c49514cde0e46328a17ecbac69a7712", "score": "0.64442235", "text": "constructor(block, target) {\n this.blocks = block.childBlocks(block.within);\n this.target = target;\n this.context = new Context(target.context, false);\n for (var block of this.blocks) {\n\n }\n this.subscripts = [];\n let time = 0;\n for (var block of this.blocks) {\n block.startTime = time;\n time += block.duration;\n for (var subscript of block.subscripts) {\n if (subscript.blocks.length) {\n this.subscripts.push(subscript);\n }\n }\n this.context.sublayers.push(block.context);\n }\n this.allSubscripts = this.allSubscripts_();\n }", "title": "" }, { "docid": "e5960ad3abfe3b9dd8a26b669f03ef2b", "score": "0.6438204", "text": "function block(stmts) {\n\tstmts = stmts.filter(function(stmt) { return stmt.type !== 'EmptyStatement '})\n\tif (stmts.length === 0)\n\t\treturn { type: 'EmptyStatement' }\n\telse if (stmts.length === 1)\n\t\treturn stmts[0]\n\telse\n\t\treturn { type: 'BlockStatement', body: stmts }\n}", "title": "" }, { "docid": "bf6defff013267596d03c916d3a95027", "score": "0.6429755", "text": "visitBlockStatement(ctx) {\r\n\t return this.visitChildren(ctx);\r\n\t}", "title": "" }, { "docid": "761c8d294487a2c420f213ec235c75aa", "score": "0.6424223", "text": "constructor (content, row) {\n\t\tif (content instanceof CodeBlock) {\n\t\t\tthis.type = content.getType();\n\t\t\tthis.content = content.getContent();\n\t\t\tthis.rowCount = content.getRowCount();\n\t\t\tthis.startingRow = content.getStartingRow();\n\t\t\tthis.rowsBefore = content.getRowsBefore();\n\t\t\tthis.rowsAfter = content.getRowsAfter();\n\t\t\tthis.exportedName = content.getExportedName();\n\t\t\tthis.aliases = [];\n\t\t\tthis.assignedFields = {};\n\t\t\tthis._parent = content.getParent();\n\t\t}\n\t\telse {\n\t\t\tif (content) {\n\t\t\t\tlet meta = CodeBlock.getBlockMeta(content);\n\t\t\t\tthis.type = meta.type;\n\t\t\t\tthis.content = content.slice(0, meta.length);\n\t\t\t\tthis.rowCount = this.content.split(\"\\n\").length;\n\t\t\t}\n\t\t\tthis.startingRow = row !== undefined ? row : 0;\n\t\t\tthis.rowsBefore = 0;\n\t\t\tthis.rowsAfter = 0;\n\t\t\tthis.exportedName = null;\n\t\t\tthis._parent = null;\n\t\t}\n\t\t// store previous and next blocks in this array, index is level\n\t\tthis.link = [\n\t\t\t{ prev: null, next: null },\n\t\t\t{ prev: null, next: null },\n\t\t\t{ prev: null, next: null }\n\t\t];\n\t}", "title": "" }, { "docid": "1af94776354178be1a7af09701f3dee0", "score": "0.6408425", "text": "createFirstBlock(){\n return new Block('10/01/2020', 'Bloque Genesis - Valor Inicial wC: 25.000,00 USD', '0');\n }", "title": "" }, { "docid": "0f1b9402b9b6ffaeb8c6e4c0bf1734bf", "score": "0.63962656", "text": "function BlockStatement(node, print) {\n this.push(\"{\");\n if (node.body.length) {\n this.newline();\n print.sequence(node.body, { indent: true });\n if (!this.format.retainLines) this.removeLast(\"\\n\");\n this.rightBrace();\n } else {\n print.printInnerComments();\n this.push(\"}\");\n }\n}", "title": "" }, { "docid": "ac8b42468688cd60d1146f933eb591d9", "score": "0.6383382", "text": "function block(type){\n if (type == \"}\") cont();\n else pass(statement, block);\n }", "title": "" }, { "docid": "ac8b42468688cd60d1146f933eb591d9", "score": "0.6383382", "text": "function block(type){\n if (type == \"}\") cont();\n else pass(statement, block);\n }", "title": "" }, { "docid": "76c164e0952855b4025f5ed8ee9e9766", "score": "0.6373475", "text": "createGenesisBlock() {\n return new Block(/*0,*/ \"01/01/2018\", \"Genesis Block data here.\", \"0\");\n //see how this is creating one instance of your class Block?\n }", "title": "" }, { "docid": "f7d9ffc83aa483681dc262da6763c9b3", "score": "0.6362974", "text": "function mk_block_toSource() {\n\t\treturn \"Markdown.mk_block( \" + uneval(this.toString()) + \", \" + uneval(this.trailing) + \", \" + uneval(this.lineNumber) + \" )\";\n\t}", "title": "" }, { "docid": "c4a4617498698b8fc69c36142727a4f0", "score": "0.6317273", "text": "function Try(){ // default constructor\n // default constructor: call super.constructor\n Block.prototype.constructor.apply(this,arguments)\n //properties\n //bfinally // [AST_Finally?] the finally block, or null if not present\n //bcatch // [AST_Catch?] the catch block, or null if not present\n }", "title": "" }, { "docid": "156f2ae8b7c10060aab9e787b15f43cc", "score": "0.6315281", "text": "function init_block(s) {\n var n; /* iterates over tree elements */ \n /* Initialize the trees. */ for(n = 0; n < L_CODES; n++)s.dyn_ltree[n * 2] = 0;\n for(n = 0; n < D_CODES; n++)s.dyn_dtree[n * 2] = 0;\n for(n = 0; n < BL_CODES; n++)s.bl_tree[n * 2] = 0;\n s.dyn_ltree[END_BLOCK * 2] = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "16f48b4dc83a871659de0659e32cf002", "score": "0.6301733", "text": "function mk_block_toSource() {\n return \"Markdown.mk_block( \" + uneval(this.toString()) + \", \" + uneval(this.trailing) + \", \" + uneval(this.lineNumber) + \" )\";\n } // node", "title": "" }, { "docid": "c5071b67b9eddfbe8df2b62c58991b4a", "score": "0.6262473", "text": "createGenesisBlock(){\n return new Block(\"01/01/2018\", \"Genesis block\", \"0\");\n }", "title": "" }, { "docid": "6aeb2a512cca364cd6f2487bba497e19", "score": "0.6242596", "text": "function mk_block_toSource() {\n return \"Markdown.mk_block( \" +\n uneval(this.toString()) +\n \", \" +\n uneval(this.trailing) +\n \", \" +\n uneval(this.lineNumber) +\n \" )\";\n }", "title": "" }, { "docid": "8850b990116776a36cc73c82def14757", "score": "0.623274", "text": "createGenesisBlock(){\r\n return new Block(moment.utc().format(), [], \"0\");\r\n }", "title": "" }, { "docid": "ba33d6268957dfed46d928d2987b88ca", "score": "0.62287456", "text": "createGenisisBlock(){\n return new Block({userId: 0, amount: 0});\n }", "title": "" }, { "docid": "0513e3a4aa409b2eed1bb2c4be962e45", "score": "0.62197053", "text": "function BreakStatement(){ // default constructor\n // default constructor: call super.constructor\n LoopControl.prototype.constructor.apply(this,arguments)\n }", "title": "" }, { "docid": "829776c627739323f4740bf27e462451", "score": "0.6212035", "text": "function InstructionsBlock(instructions) {\n this.instructions = instructions;\n this.onEndedBlock = function() {return this;};\n}", "title": "" }, { "docid": "d15f57dadd1480d1eda527e35869c4dc", "score": "0.62014985", "text": "function New(){ // default constructor\n // default constructor: call super.constructor\n CallStatement.prototype.constructor.apply(this,arguments)\n }", "title": "" }, { "docid": "d1cc9e89dd92df2b3ccd9dec717fcdf4", "score": "0.6187773", "text": "function init_block(s){var n;/* iterates over tree elements *//* Initialize the trees. */for(n=0;n<L_CODES;n++){s.dyn_ltree[n*2]/*.Freq*/=0;}for(n=0;n<D_CODES;n++){s.dyn_dtree[n*2]/*.Freq*/=0;}for(n=0;n<BL_CODES;n++){s.bl_tree[n*2]/*.Freq*/=0;}s.dyn_ltree[END_BLOCK*2]/*.Freq*/=1;s.opt_len=s.static_len=0;s.last_lit=s.matches=0;}", "title": "" }, { "docid": "b5bf1958115aa947b9e38732b095d683", "score": "0.61856174", "text": "function newGenesisBlock() {\n return new Block(\n 0, \n Date.now(), \n \"I am the Genesis Block\",\n \"0\"\n );\n}", "title": "" }, { "docid": "92ac236a61c879e44efc3c057dc1b7b6", "score": "0.6182806", "text": "function ThrowStatement(){ // default constructor\n // default constructor: call super.constructor\n ExitStatement.prototype.constructor.apply(this,arguments)\n }", "title": "" }, { "docid": "003e971ae723240baed3fa022f6113fb", "score": "0.6170097", "text": "function mk_block_toSource() {\n return \"Markdown.mk_block( \" +\n uneval(this.toString()) +\n \", \" +\n uneval(this.trailing) +\n \", \" +\n uneval(this.lineNumber) +\n \" )\";\n }", "title": "" }, { "docid": "003e971ae723240baed3fa022f6113fb", "score": "0.6170097", "text": "function mk_block_toSource() {\n return \"Markdown.mk_block( \" +\n uneval(this.toString()) +\n \", \" +\n uneval(this.trailing) +\n \", \" +\n uneval(this.lineNumber) +\n \" )\";\n }", "title": "" }, { "docid": "003e971ae723240baed3fa022f6113fb", "score": "0.6170097", "text": "function mk_block_toSource() {\n return \"Markdown.mk_block( \" +\n uneval(this.toString()) +\n \", \" +\n uneval(this.trailing) +\n \", \" +\n uneval(this.lineNumber) +\n \" )\";\n }", "title": "" }, { "docid": "003e971ae723240baed3fa022f6113fb", "score": "0.6170097", "text": "function mk_block_toSource() {\n return \"Markdown.mk_block( \" +\n uneval(this.toString()) +\n \", \" +\n uneval(this.trailing) +\n \", \" +\n uneval(this.lineNumber) +\n \" )\";\n }", "title": "" }, { "docid": "ebb69e077d3041cd8006b65bb09f9343", "score": "0.6164322", "text": "function FormBlock() {}", "title": "" }, { "docid": "ead9c1c62094d9bdcc591138c8ef3c8b", "score": "0.6142869", "text": "static wrap(nodes) {\n if (nodes.length === 1 && nodes[0] instanceof Block) {\n return nodes[0];\n }\n return new Block(nodes);\n }", "title": "" }, { "docid": "d117c25bef3fc3cadf8ce44e32c2e44c", "score": "0.6139308", "text": "createGenesisBlock()\n {\n return new BlockClass(0, Date(), \"Genesis Block\", \"0\");\n }", "title": "" }, { "docid": "e4c6a549135a5ac85fea1cddc4024aed", "score": "0.61313736", "text": "function DoStatement(){ // default constructor\n // default constructor: call super.constructor\n DWLoop.prototype.constructor.apply(this,arguments)\n }", "title": "" }, { "docid": "c321b7abd4fd304ecbbf12aa039e160c", "score": "0.612803", "text": "function mk_block_toSource() {\n return \"Markdown.mk_block( \" +\n uneval(this.toString()) +\n \", \" +\n uneval(this.trailing) +\n \", \" +\n uneval(this.lineNumber) +\n \" )\";\n}", "title": "" }, { "docid": "c321b7abd4fd304ecbbf12aa039e160c", "score": "0.612803", "text": "function mk_block_toSource() {\n return \"Markdown.mk_block( \" +\n uneval(this.toString()) +\n \", \" +\n uneval(this.trailing) +\n \", \" +\n uneval(this.lineNumber) +\n \" )\";\n}", "title": "" }, { "docid": "c321b7abd4fd304ecbbf12aa039e160c", "score": "0.612803", "text": "function mk_block_toSource() {\n return \"Markdown.mk_block( \" +\n uneval(this.toString()) +\n \", \" +\n uneval(this.trailing) +\n \", \" +\n uneval(this.lineNumber) +\n \" )\";\n}", "title": "" }, { "docid": "c321b7abd4fd304ecbbf12aa039e160c", "score": "0.612803", "text": "function mk_block_toSource() {\n return \"Markdown.mk_block( \" +\n uneval(this.toString()) +\n \", \" +\n uneval(this.trailing) +\n \", \" +\n uneval(this.lineNumber) +\n \" )\";\n}", "title": "" }, { "docid": "c321b7abd4fd304ecbbf12aa039e160c", "score": "0.612803", "text": "function mk_block_toSource() {\n return \"Markdown.mk_block( \" +\n uneval(this.toString()) +\n \", \" +\n uneval(this.trailing) +\n \", \" +\n uneval(this.lineNumber) +\n \" )\";\n}", "title": "" }, { "docid": "bdca2db785ec7e7883a5a03ff7b701de", "score": "0.61245537", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "bdca2db785ec7e7883a5a03ff7b701de", "score": "0.61245537", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "bdca2db785ec7e7883a5a03ff7b701de", "score": "0.61245537", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "bdca2db785ec7e7883a5a03ff7b701de", "score": "0.61245537", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "bdca2db785ec7e7883a5a03ff7b701de", "score": "0.61245537", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "bdca2db785ec7e7883a5a03ff7b701de", "score": "0.61245537", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "bdca2db785ec7e7883a5a03ff7b701de", "score": "0.61245537", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "bdca2db785ec7e7883a5a03ff7b701de", "score": "0.61245537", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "bdca2db785ec7e7883a5a03ff7b701de", "score": "0.61245537", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "bdca2db785ec7e7883a5a03ff7b701de", "score": "0.61245537", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "bdca2db785ec7e7883a5a03ff7b701de", "score": "0.61245537", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "bdca2db785ec7e7883a5a03ff7b701de", "score": "0.61245537", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "bdca2db785ec7e7883a5a03ff7b701de", "score": "0.61245537", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "bdca2db785ec7e7883a5a03ff7b701de", "score": "0.61245537", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "bdca2db785ec7e7883a5a03ff7b701de", "score": "0.61245537", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "bdca2db785ec7e7883a5a03ff7b701de", "score": "0.61245537", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "bdca2db785ec7e7883a5a03ff7b701de", "score": "0.61245537", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "bdca2db785ec7e7883a5a03ff7b701de", "score": "0.61245537", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "bdca2db785ec7e7883a5a03ff7b701de", "score": "0.61245537", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "bdca2db785ec7e7883a5a03ff7b701de", "score": "0.61245537", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "bdca2db785ec7e7883a5a03ff7b701de", "score": "0.61245537", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "bdca2db785ec7e7883a5a03ff7b701de", "score": "0.61245537", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "bdca2db785ec7e7883a5a03ff7b701de", "score": "0.61245537", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "a9c07dcb4924e283cc2b7491a7098c60", "score": "0.610234", "text": "enterBlockStatement(ctx) {\n\t}", "title": "" }, { "docid": "6d5c09aefbb9fb010b8737997fbead7a", "score": "0.6102008", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "6d5c09aefbb9fb010b8737997fbead7a", "score": "0.6102008", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" }, { "docid": "6d5c09aefbb9fb010b8737997fbead7a", "score": "0.6102008", "text": "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "title": "" } ]
1c58a2438aaf7de885f1429d309d3002
makePlotFramework: Create the plot container and axes
[ { "docid": "bdbf582d449ded24f0ca47c6d45aeded", "score": "0.75246304", "text": "function makePlotFramework(gd) {\n var gd3 = d3.select(gd);\n var fullLayout = gd._fullLayout;\n\n // Plot container\n fullLayout._container = gd3.selectAll('.plot-container').data([0]);\n fullLayout._container.enter().insert('div', ':first-child')\n .classed('plot-container', true)\n .classed('plotly', true);\n\n // Make the svg container\n fullLayout._paperdiv = fullLayout._container.selectAll('.svg-container').data([0]);\n fullLayout._paperdiv.enter().append('div')\n .classed('svg-container', true)\n .style('position', 'relative');\n\n // Make the graph containers\n // start fresh each time we get here, so we know the order comes out\n // right, rather than enter/exit which can muck up the order\n // TODO: sort out all the ordering so we don't have to\n // explicitly delete anything\n // FIXME: parcoords reuses this object, not the best pattern\n fullLayout._glcontainer = fullLayout._paperdiv.selectAll('.gl-container')\n .data([{}]);\n\n fullLayout._glcontainer.enter().append('div')\n .classed('gl-container', true);\n\n // That is initialized in drawFramework if there are `gl` traces\n fullLayout._glcanvas = null;\n\n fullLayout._paperdiv.selectAll('.main-svg').remove();\n\n fullLayout._paper = fullLayout._paperdiv.insert('svg', ':first-child')\n .classed('main-svg', true);\n\n fullLayout._toppaper = fullLayout._paperdiv.append('svg')\n .classed('main-svg', true);\n\n if(!fullLayout._uid) {\n var otherUids = [];\n d3.selectAll('defs').each(function() {\n if(this.id) otherUids.push(this.id.split('-')[1]);\n });\n fullLayout._uid = Lib.randstr(otherUids);\n }\n\n fullLayout._paperdiv.selectAll('.main-svg')\n .attr(xmlnsNamespaces.svgAttrs);\n\n fullLayout._defs = fullLayout._paper.append('defs')\n .attr('id', 'defs-' + fullLayout._uid);\n\n fullLayout._clips = fullLayout._defs.append('g')\n .classed('clips', true);\n\n fullLayout._topdefs = fullLayout._toppaper.append('defs')\n .attr('id', 'topdefs-' + fullLayout._uid);\n\n fullLayout._topclips = fullLayout._topdefs.append('g')\n .classed('clips', true);\n\n fullLayout._bgLayer = fullLayout._paper.append('g')\n .classed('bglayer', true);\n\n fullLayout._draggers = fullLayout._paper.append('g')\n .classed('draglayer', true);\n\n // lower shape/image layer - note that this is behind\n // all subplots data/grids but above the backgrounds\n // except inset subplots, whose backgrounds are drawn\n // inside their own group so that they appear above\n // the data for the main subplot\n // lower shapes and images which are fully referenced to\n // a subplot still get drawn within the subplot's group\n // so they will work correctly on insets\n var layerBelow = fullLayout._paper.append('g')\n .classed('layer-below', true);\n fullLayout._imageLowerLayer = layerBelow.append('g')\n .classed('imagelayer', true);\n fullLayout._shapeLowerLayer = layerBelow.append('g')\n .classed('shapelayer', true);\n\n // single cartesian layer for the whole plot\n fullLayout._cartesianlayer = fullLayout._paper.append('g').classed('cartesianlayer', true);\n\n // single polar layer for the whole plot\n fullLayout._polarlayer = fullLayout._paper.append('g').classed('polarlayer', true);\n\n // single ternary layer for the whole plot\n fullLayout._ternarylayer = fullLayout._paper.append('g').classed('ternarylayer', true);\n\n // single geo layer for the whole plot\n fullLayout._geolayer = fullLayout._paper.append('g').classed('geolayer', true);\n\n // single pie layer for the whole plot\n fullLayout._pielayer = fullLayout._paper.append('g').classed('pielayer', true);\n\n // fill in image server scrape-svg\n fullLayout._glimages = fullLayout._paper.append('g').classed('glimages', true);\n\n // lastly upper shapes, info (legend, annotations) and hover layers go on top\n // these are in a different svg element normally, but get collapsed into a single\n // svg when exporting (after inserting 3D)\n // upper shapes/images are only those drawn above the whole plot, including subplots\n var layerAbove = fullLayout._toppaper.append('g')\n .classed('layer-above', true);\n fullLayout._imageUpperLayer = layerAbove.append('g')\n .classed('imagelayer', true);\n fullLayout._shapeUpperLayer = layerAbove.append('g')\n .classed('shapelayer', true);\n\n fullLayout._infolayer = fullLayout._toppaper.append('g').classed('infolayer', true);\n fullLayout._menulayer = fullLayout._toppaper.append('g').classed('menulayer', true);\n fullLayout._zoomlayer = fullLayout._toppaper.append('g').classed('zoomlayer', true);\n fullLayout._hoverlayer = fullLayout._toppaper.append('g').classed('hoverlayer', true);\n\n gd.emit('plotly_framework');\n}", "title": "" } ]
[ { "docid": "a5766c42681ac992cd0418ebae787a6b", "score": "0.7294494", "text": "function makePlotFramework(gd) {\n var gd3 = d3.select(gd);\n var fullLayout = gd._fullLayout;\n\n // Plot container\n fullLayout._container = gd3.selectAll('.plot-container').data([0]);\n fullLayout._container.enter().insert('div', ':first-child')\n .classed('plot-container', true)\n .classed('plotly', true);\n\n // Make the svg container\n fullLayout._paperdiv = fullLayout._container.selectAll('.svg-container').data([0]);\n fullLayout._paperdiv.enter().append('div')\n .classed('svg-container', true)\n .style('position', 'relative');\n\n // Make the graph containers\n // start fresh each time we get here, so we know the order comes out\n // right, rather than enter/exit which can muck up the order\n // TODO: sort out all the ordering so we don't have to\n // explicitly delete anything\n // FIXME: parcoords reuses this object, not the best pattern\n fullLayout._glcontainer = fullLayout._paperdiv.selectAll('.gl-container')\n .data([{}]);\n\n fullLayout._glcontainer.enter().append('div')\n .classed('gl-container', true);\n\n fullLayout._paperdiv.selectAll('.main-svg').remove();\n fullLayout._paperdiv.select('.modebar-container').remove();\n\n fullLayout._paper = fullLayout._paperdiv.insert('svg', ':first-child')\n .classed('main-svg', true);\n\n fullLayout._toppaper = fullLayout._paperdiv.append('svg')\n .classed('main-svg', true);\n\n fullLayout._modebardiv = fullLayout._paperdiv.append('div');\n\n fullLayout._hoverpaper = fullLayout._paperdiv.append('svg')\n .classed('main-svg', true);\n\n if (!fullLayout._uid) {\n var otherUids = {};\n d3.selectAll('defs').each(function () {\n if (this.id) otherUids[this.id.split('-')[1]] = 1;\n });\n fullLayout._uid = Lib.randstr(otherUids);\n }\n\n fullLayout._paperdiv.selectAll('.main-svg')\n .attr(xmlnsNamespaces.svgAttrs);\n\n fullLayout._defs = fullLayout._paper.append('defs')\n .attr('id', 'defs-' + fullLayout._uid);\n\n fullLayout._clips = fullLayout._defs.append('g')\n .classed('clips', true);\n\n fullLayout._topdefs = fullLayout._toppaper.append('defs')\n .attr('id', 'topdefs-' + fullLayout._uid);\n\n fullLayout._topclips = fullLayout._topdefs.append('g')\n .classed('clips', true);\n\n fullLayout._bgLayer = fullLayout._paper.append('g')\n .classed('bglayer', true);\n\n fullLayout._draggers = fullLayout._paper.append('g')\n .classed('draglayer', true);\n\n // lower shape/image layer - note that this is behind\n // all subplots data/grids but above the backgrounds\n // except inset subplots, whose backgrounds are drawn\n // inside their own group so that they appear above\n // the data for the main subplot\n // lower shapes and images which are fully referenced to\n // a subplot still get drawn within the subplot's group\n // so they will work correctly on insets\n var layerBelow = fullLayout._paper.append('g')\n .classed('layer-below', true);\n fullLayout._imageLowerLayer = layerBelow.append('g')\n .classed('imagelayer', true);\n fullLayout._shapeLowerLayer = layerBelow.append('g')\n .classed('shapelayer', true);\n\n // single cartesian layer for the whole plot\n fullLayout._cartesianlayer = fullLayout._paper.append('g').classed('cartesianlayer', true);\n\n // single polar layer for the whole plot\n fullLayout._polarlayer = fullLayout._paper.append('g').classed('polarlayer', true);\n\n // single ternary layer for the whole plot\n fullLayout._ternarylayer = fullLayout._paper.append('g').classed('ternarylayer', true);\n\n // single geo layer for the whole plot\n fullLayout._geolayer = fullLayout._paper.append('g').classed('geolayer', true);\n\n // single funnelarea layer for the whole plot\n fullLayout._funnelarealayer = fullLayout._paper.append('g').classed('funnelarealayer', true);\n\n // single pie layer for the whole plot\n fullLayout._pielayer = fullLayout._paper.append('g').classed('pielayer', true);\n\n // single treemap layer for the whole plot\n fullLayout._treemaplayer = fullLayout._paper.append('g').classed('treemaplayer', true);\n\n // single sunburst layer for the whole plot\n fullLayout._sunburstlayer = fullLayout._paper.append('g').classed('sunburstlayer', true);\n\n // single indicator layer for the whole plot\n fullLayout._indicatorlayer = fullLayout._toppaper.append('g').classed('indicatorlayer', true);\n\n // fill in image server scrape-svg\n fullLayout._glimages = fullLayout._paper.append('g').classed('glimages', true);\n\n // lastly upper shapes, info (legend, annotations) and hover layers go on top\n // these are in a different svg element normally, but get collapsed into a single\n // svg when exporting (after inserting 3D)\n // upper shapes/images are only those drawn above the whole plot, including subplots\n var layerAbove = fullLayout._toppaper.append('g')\n .classed('layer-above', true);\n fullLayout._imageUpperLayer = layerAbove.append('g')\n .classed('imagelayer', true);\n fullLayout._shapeUpperLayer = layerAbove.append('g')\n .classed('shapelayer', true);\n\n fullLayout._infolayer = fullLayout._toppaper.append('g').classed('infolayer', true);\n fullLayout._menulayer = fullLayout._toppaper.append('g').classed('menulayer', true);\n fullLayout._zoomlayer = fullLayout._toppaper.append('g').classed('zoomlayer', true);\n fullLayout._hoverlayer = fullLayout._hoverpaper.append('g').classed('hoverlayer', true);\n\n // Make the modebar container\n fullLayout._modebardiv\n .classed('modebar-container', true)\n .style('position', 'absolute')\n .style('top', '0px')\n .style('right', '0px');\n\n gd.emit('plotly_framework');\n }", "title": "" }, { "docid": "72f8b836cf8a7fedb61aad65a093b7c9", "score": "0.72885275", "text": "function makePlotFramework(gd) {\n var gd3 = d3.select(gd);\n var fullLayout = gd._fullLayout;\n fullLayout._calcInverseTransform = calcInverseTransform;\n fullLayout._calcInverseTransform(gd);\n\n // Plot container\n fullLayout._container = gd3.selectAll('.plot-container').data([0]);\n fullLayout._container.enter().insert('div', ':first-child').classed('plot-container', true).classed('plotly', true);\n\n // Make the svg container\n fullLayout._paperdiv = fullLayout._container.selectAll('.svg-container').data([0]);\n fullLayout._paperdiv.enter().append('div').classed('user-select-none', true).classed('svg-container', true).style('position', 'relative');\n\n // Make the graph containers\n // start fresh each time we get here, so we know the order comes out\n // right, rather than enter/exit which can muck up the order\n // TODO: sort out all the ordering so we don't have to\n // explicitly delete anything\n // FIXME: parcoords reuses this object, not the best pattern\n fullLayout._glcontainer = fullLayout._paperdiv.selectAll('.gl-container').data([{}]);\n fullLayout._glcontainer.enter().append('div').classed('gl-container', true);\n fullLayout._paperdiv.selectAll('.main-svg').remove();\n fullLayout._paperdiv.select('.modebar-container').remove();\n fullLayout._paper = fullLayout._paperdiv.insert('svg', ':first-child').classed('main-svg', true);\n fullLayout._toppaper = fullLayout._paperdiv.append('svg').classed('main-svg', true);\n fullLayout._modebardiv = fullLayout._paperdiv.append('div');\n delete fullLayout._modeBar;\n fullLayout._hoverpaper = fullLayout._paperdiv.append('svg').classed('main-svg', true);\n if (!fullLayout._uid) {\n var otherUids = {};\n d3.selectAll('defs').each(function () {\n if (this.id) otherUids[this.id.split('-')[1]] = 1;\n });\n fullLayout._uid = Lib.randstr(otherUids);\n }\n fullLayout._paperdiv.selectAll('.main-svg').attr(xmlnsNamespaces.svgAttrs);\n fullLayout._defs = fullLayout._paper.append('defs').attr('id', 'defs-' + fullLayout._uid);\n fullLayout._clips = fullLayout._defs.append('g').classed('clips', true);\n fullLayout._topdefs = fullLayout._toppaper.append('defs').attr('id', 'topdefs-' + fullLayout._uid);\n fullLayout._topclips = fullLayout._topdefs.append('g').classed('clips', true);\n fullLayout._bgLayer = fullLayout._paper.append('g').classed('bglayer', true);\n fullLayout._draggers = fullLayout._paper.append('g').classed('draglayer', true);\n\n // lower shape/image layer - note that this is behind\n // all subplots data/grids but above the backgrounds\n // except inset subplots, whose backgrounds are drawn\n // inside their own group so that they appear above\n // the data for the main subplot\n // lower shapes and images which are fully referenced to\n // a subplot still get drawn within the subplot's group\n // so they will work correctly on insets\n var layerBelow = fullLayout._paper.append('g').classed('layer-below', true);\n fullLayout._imageLowerLayer = layerBelow.append('g').classed('imagelayer', true);\n fullLayout._shapeLowerLayer = layerBelow.append('g').classed('shapelayer', true);\n\n // single cartesian layer for the whole plot\n fullLayout._cartesianlayer = fullLayout._paper.append('g').classed('cartesianlayer', true);\n\n // single polar layer for the whole plot\n fullLayout._polarlayer = fullLayout._paper.append('g').classed('polarlayer', true);\n\n // single smith layer for the whole plot\n fullLayout._smithlayer = fullLayout._paper.append('g').classed('smithlayer', true);\n\n // single ternary layer for the whole plot\n fullLayout._ternarylayer = fullLayout._paper.append('g').classed('ternarylayer', true);\n\n // single geo layer for the whole plot\n fullLayout._geolayer = fullLayout._paper.append('g').classed('geolayer', true);\n\n // single funnelarea layer for the whole plot\n fullLayout._funnelarealayer = fullLayout._paper.append('g').classed('funnelarealayer', true);\n\n // single pie layer for the whole plot\n fullLayout._pielayer = fullLayout._paper.append('g').classed('pielayer', true);\n\n // single treemap layer for the whole plot\n fullLayout._iciclelayer = fullLayout._paper.append('g').classed('iciclelayer', true);\n\n // single treemap layer for the whole plot\n fullLayout._treemaplayer = fullLayout._paper.append('g').classed('treemaplayer', true);\n\n // single sunburst layer for the whole plot\n fullLayout._sunburstlayer = fullLayout._paper.append('g').classed('sunburstlayer', true);\n\n // single indicator layer for the whole plot\n fullLayout._indicatorlayer = fullLayout._toppaper.append('g').classed('indicatorlayer', true);\n\n // fill in image server scrape-svg\n fullLayout._glimages = fullLayout._paper.append('g').classed('glimages', true);\n\n // lastly upper shapes, info (legend, annotations) and hover layers go on top\n // these are in a different svg element normally, but get collapsed into a single\n // svg when exporting (after inserting 3D)\n // upper shapes/images are only those drawn above the whole plot, including subplots\n var layerAbove = fullLayout._toppaper.append('g').classed('layer-above', true);\n fullLayout._imageUpperLayer = layerAbove.append('g').classed('imagelayer', true);\n fullLayout._shapeUpperLayer = layerAbove.append('g').classed('shapelayer', true);\n fullLayout._selectionLayer = fullLayout._toppaper.append('g').classed('selectionlayer', true);\n fullLayout._infolayer = fullLayout._toppaper.append('g').classed('infolayer', true);\n fullLayout._menulayer = fullLayout._toppaper.append('g').classed('menulayer', true);\n fullLayout._zoomlayer = fullLayout._toppaper.append('g').classed('zoomlayer', true);\n fullLayout._hoverlayer = fullLayout._hoverpaper.append('g').classed('hoverlayer', true);\n\n // Make the modebar container\n fullLayout._modebardiv.classed('modebar-container', true).style('position', 'absolute').style('top', '0px').style('right', '0px');\n gd.emit('plotly_framework');\n}", "title": "" }, { "docid": "14916552ace2fd2ecff3ac61cec8ef04", "score": "0.72363794", "text": "function makePlotFramework(gd) {\n var gd3 = d3.select(gd);\n var fullLayout = gd._fullLayout; // Plot container\n\n fullLayout._container = gd3.selectAll('.plot-container').data([0]);\n\n fullLayout._container.enter().insert('div', ':first-child').classed('plot-container', true).classed('plotly', true); // Make the svg container\n\n\n fullLayout._paperdiv = fullLayout._container.selectAll('.svg-container').data([0]);\n\n fullLayout._paperdiv.enter().append('div').classed('svg-container', true).style('position', 'relative'); // Make the graph containers\n // start fresh each time we get here, so we know the order comes out\n // right, rather than enter/exit which can muck up the order\n // TODO: sort out all the ordering so we don't have to\n // explicitly delete anything\n // FIXME: parcoords reuses this object, not the best pattern\n\n\n fullLayout._glcontainer = fullLayout._paperdiv.selectAll('.gl-container').data([{}]);\n\n fullLayout._glcontainer.enter().append('div').classed('gl-container', true);\n\n fullLayout._paperdiv.selectAll('.main-svg').remove();\n\n fullLayout._paper = fullLayout._paperdiv.insert('svg', ':first-child').classed('main-svg', true);\n fullLayout._toppaper = fullLayout._paperdiv.append('svg').classed('main-svg', true);\n\n if (!fullLayout._uid) {\n var otherUids = {};\n d3.selectAll('defs').each(function () {\n if (this.id) otherUids[this.id.split('-')[1]] = 1;\n });\n fullLayout._uid = Lib.randstr(otherUids);\n }\n\n fullLayout._paperdiv.selectAll('.main-svg').attr(xmlnsNamespaces.svgAttrs);\n\n fullLayout._defs = fullLayout._paper.append('defs').attr('id', 'defs-' + fullLayout._uid);\n fullLayout._clips = fullLayout._defs.append('g').classed('clips', true);\n fullLayout._topdefs = fullLayout._toppaper.append('defs').attr('id', 'topdefs-' + fullLayout._uid);\n fullLayout._topclips = fullLayout._topdefs.append('g').classed('clips', true);\n fullLayout._bgLayer = fullLayout._paper.append('g').classed('bglayer', true);\n fullLayout._draggers = fullLayout._paper.append('g').classed('draglayer', true); // lower shape/image layer - note that this is behind\n // all subplots data/grids but above the backgrounds\n // except inset subplots, whose backgrounds are drawn\n // inside their own group so that they appear above\n // the data for the main subplot\n // lower shapes and images which are fully referenced to\n // a subplot still get drawn within the subplot's group\n // so they will work correctly on insets\n\n var layerBelow = fullLayout._paper.append('g').classed('layer-below', true);\n\n fullLayout._imageLowerLayer = layerBelow.append('g').classed('imagelayer', true);\n fullLayout._shapeLowerLayer = layerBelow.append('g').classed('shapelayer', true); // single cartesian layer for the whole plot\n\n fullLayout._cartesianlayer = fullLayout._paper.append('g').classed('cartesianlayer', true); // single polar layer for the whole plot\n\n fullLayout._polarlayer = fullLayout._paper.append('g').classed('polarlayer', true); // single ternary layer for the whole plot\n\n fullLayout._ternarylayer = fullLayout._paper.append('g').classed('ternarylayer', true); // single geo layer for the whole plot\n\n fullLayout._geolayer = fullLayout._paper.append('g').classed('geolayer', true); // single pie layer for the whole plot\n\n fullLayout._pielayer = fullLayout._paper.append('g').classed('pielayer', true); // fill in image server scrape-svg\n\n fullLayout._glimages = fullLayout._paper.append('g').classed('glimages', true); // lastly upper shapes, info (legend, annotations) and hover layers go on top\n // these are in a different svg element normally, but get collapsed into a single\n // svg when exporting (after inserting 3D)\n // upper shapes/images are only those drawn above the whole plot, including subplots\n\n var layerAbove = fullLayout._toppaper.append('g').classed('layer-above', true);\n\n fullLayout._imageUpperLayer = layerAbove.append('g').classed('imagelayer', true);\n fullLayout._shapeUpperLayer = layerAbove.append('g').classed('shapelayer', true);\n fullLayout._infolayer = fullLayout._toppaper.append('g').classed('infolayer', true);\n fullLayout._menulayer = fullLayout._toppaper.append('g').classed('menulayer', true);\n fullLayout._zoomlayer = fullLayout._toppaper.append('g').classed('zoomlayer', true);\n fullLayout._hoverlayer = fullLayout._toppaper.append('g').classed('hoverlayer', true);\n gd.emit('plotly_framework');\n }", "title": "" }, { "docid": "7b79ba2639782e40fcbdb85ee1f129a3", "score": "0.71436685", "text": "function makePlotFramework(gd) {\n\t var gd3 = d3.select(gd),\n\t fullLayout = gd._fullLayout;\n\n\t // Plot container\n\t fullLayout._container = gd3.selectAll('.plot-container').data([0]);\n\t fullLayout._container.enter().insert('div', ':first-child')\n\t .classed('plot-container', true)\n\t .classed('plotly', true);\n\n\t // Make the svg container\n\t fullLayout._paperdiv = fullLayout._container.selectAll('.svg-container').data([0]);\n\t fullLayout._paperdiv.enter().append('div')\n\t .classed('svg-container', true)\n\t .style('position', 'relative');\n\n\t // Make the graph containers\n\t // start fresh each time we get here, so we know the order comes out\n\t // right, rather than enter/exit which can muck up the order\n\t // TODO: sort out all the ordering so we don't have to\n\t // explicitly delete anything\n\t fullLayout._glcontainer = fullLayout._paperdiv.selectAll('.gl-container')\n\t .data([0]);\n\t fullLayout._glcontainer.enter().append('div')\n\t .classed('gl-container', true);\n\n\t fullLayout._geocontainer = fullLayout._paperdiv.selectAll('.geo-container')\n\t .data([0]);\n\t fullLayout._geocontainer.enter().append('div')\n\t .classed('geo-container', true);\n\n\t fullLayout._paperdiv.selectAll('.main-svg').remove();\n\n\t fullLayout._paper = fullLayout._paperdiv.insert('svg', ':first-child')\n\t .classed('main-svg', true);\n\n\t fullLayout._toppaper = fullLayout._paperdiv.append('svg')\n\t .classed('main-svg', true);\n\n\t if(!fullLayout._uid) {\n\t var otherUids = [];\n\t d3.selectAll('defs').each(function() {\n\t if(this.id) otherUids.push(this.id.split('-')[1]);\n\t });\n\t fullLayout._uid = Lib.randstr(otherUids);\n\t }\n\n\t fullLayout._paperdiv.selectAll('.main-svg')\n\t .attr(xmlnsNamespaces.svgAttrs);\n\n\t fullLayout._defs = fullLayout._paper.append('defs')\n\t .attr('id', 'defs-' + fullLayout._uid);\n\n\t fullLayout._topdefs = fullLayout._toppaper.append('defs')\n\t .attr('id', 'topdefs-' + fullLayout._uid);\n\n\t fullLayout._draggers = fullLayout._paper.append('g')\n\t .classed('draglayer', true);\n\n\t // lower shape layer\n\t // (only for shapes to be drawn below the whole plot)\n\t var layerBelow = fullLayout._paper.append('g')\n\t .classed('layer-below', true);\n\t fullLayout._imageLowerLayer = layerBelow.append('g')\n\t .classed('imagelayer', true);\n\t fullLayout._shapeLowerLayer = layerBelow.append('g')\n\t .classed('shapelayer', true);\n\n\t // single cartesian layer for the whole plot\n\t fullLayout._cartesianlayer = fullLayout._paper.append('g').classed('cartesianlayer', true);\n\n\t // single ternary layer for the whole plot\n\t fullLayout._ternarylayer = fullLayout._paper.append('g').classed('ternarylayer', true);\n\n\t // upper shape layer\n\t // (only for shapes to be drawn above the whole plot, including subplots)\n\t var layerAbove = fullLayout._paper.append('g')\n\t .classed('layer-above', true);\n\t fullLayout._imageUpperLayer = layerAbove.append('g')\n\t .classed('imagelayer', true);\n\t fullLayout._shapeUpperLayer = layerAbove.append('g')\n\t .classed('shapelayer', true);\n\n\t // single pie layer for the whole plot\n\t fullLayout._pielayer = fullLayout._paper.append('g').classed('pielayer', true);\n\n\t // fill in image server scrape-svg\n\t fullLayout._glimages = fullLayout._paper.append('g').classed('glimages', true);\n\t fullLayout._geoimages = fullLayout._paper.append('g').classed('geoimages', true);\n\n\t // lastly info (legend, annotations) and hover layers go on top\n\t // these are in a different svg element normally, but get collapsed into a single\n\t // svg when exporting (after inserting 3D)\n\t fullLayout._infolayer = fullLayout._toppaper.append('g').classed('infolayer', true);\n\t fullLayout._zoomlayer = fullLayout._toppaper.append('g').classed('zoomlayer', true);\n\t fullLayout._hoverlayer = fullLayout._toppaper.append('g').classed('hoverlayer', true);\n\n\t gd.emit('plotly_framework');\n\t}", "title": "" }, { "docid": "d9dfd37017032ee7476a96e2ae31823a", "score": "0.68535155", "text": "function drawFramework() {\n\t var basePlotModules = fullLayout._basePlotModules;\n\n\t for(var i = 0; i < basePlotModules.length; i++) {\n\t if(basePlotModules[i].drawFramework) {\n\t basePlotModules[i].drawFramework(gd);\n\t }\n\t }\n\n\t return Lib.syncOrAsync([\n\t subroutines.layoutStyles,\n\t drawAxes,\n\t Fx.init\n\t ], gd);\n\t }", "title": "" }, { "docid": "888dee737040ce3d3724ca75b9c3dd0a", "score": "0.63136685", "text": "function Plot() {\n this.dataseries = [];\n this.container = \"\";\n\n if ('plot' in $) {\n this.plotapi = new PlotApi();\n } else {\n this.plotapi = undefined;\n }\n}", "title": "" }, { "docid": "0885a2d887335bc2d3dbca751c20a0e6", "score": "0.6310902", "text": "constructor() {\n const container1 = document.querySelector(\".plot-1\");\n const container2 = document.querySelector(\".plot-2\");\n this.visualization1 = new _epivizGlDefault.default(container1);\n this.visualization2 = new _epivizGlDefault.default(container2);\n this.visualization1.addToDom();\n this.visualization2.addToDom();\n this.store = _storeDefault.default;\n this.store.subscribe(this.subscription.bind(this));\n const toolbar = new _toolbarDefault.default(this.store.dispatch);\n toolbar.init();\n window.addEventListener(\"resize\", this.onWindowResize.bind(this));\n }", "title": "" }, { "docid": "eb2bcd07ea3430c8ffcbc8d516521308", "score": "0.6272535", "text": "function jqPlot() {\n // Group: Properties\n // These properties are specified at the top of the options object\n // like so:\n // > {\n // > axesDefaults:{min:0},\n // > series:[{color:'#6633dd'}],\n // > title: 'A Plot'\n // > }\n //\n // prop: data\n // user's data. Data should *NOT* be specified in the options object,\n // but be passed in as the second argument to the $.jqplot() function.\n // The data property is described here soley for reference. \n // The data should be in the form of an array of 2D or 1D arrays like\n // > [ [[x1, y1], [x2, y2],...], [y1, y2, ...] ].\n this.data = [];\n // The id of the dom element to render the plot into\n this.targetId = null;\n // the jquery object for the dom target.\n this.target = null; \n this.defaults = {\n // prop: axesDefaults\n // default options that will be applied to all axes.\n // see <Axis> for axes options.\n axesDefaults: {},\n axes: {xaxis:{}, yaxis:{}, x2axis:{}, y2axis:{}, y3axis:{}, y4axis:{}, y5axis:{}, y6axis:{}, y7axis:{}, y8axis:{}, y9axis:{}},\n // prop: seriesDefaults\n // default options that will be applied to all series.\n // see <Series> for series options.\n seriesDefaults: {},\n gridPadding: {top:10, right:10, bottom:10, left:10},\n series:[]\n };\n // prop: series\n // Array of series object options.\n // see <Series> for series specific options.\n this.series = [];\n // prop: axes\n // up to 4 axes are supported, each with it's own options, \n // See <Axis> for axis specific options.\n this.axes = {xaxis: new Axis('xaxis'), yaxis: new Axis('yaxis'), x2axis: new Axis('x2axis'), y2axis: new Axis('y2axis'), y3axis: new Axis('y3axis'), y4axis: new Axis('y4axis'), y5axis: new Axis('y5axis'), y6axis: new Axis('y6axis'), y7axis: new Axis('y7axis'), y8axis: new Axis('y8axis'), y9axis: new Axis('y9axis')};\n // prop: grid\n // See <Grid> for grid specific options.\n this.grid = new Grid();\n // prop: legend\n // see <$.jqplot.TableLegendRenderer>\n this.legend = new Legend();\n this.baseCanvas = new $.jqplot.GenericCanvas();\n this.seriesCanvas = new $.jqplot.GenericCanvas();\n this.eventCanvas = new $.jqplot.GenericCanvas();\n this._width = null;\n this._height = null; \n this._plotDimensions = {height:null, width:null};\n this._gridPadding = {top:10, right:10, bottom:10, left:10};\n // don't think this is implemented.\n this.equalXTicks = true;\n // don't think this is implemented.\n this.equalYTicks = true;\n // prop: seriesColors\n // Ann array of CSS color specifications that will be applied, in order,\n // to the series in the plot. Colors will wrap around so, if their\n // are more series than colors, colors will be reused starting at the\n // beginning. For pie charts, this specifies the colors of the slices.\n this.seriesColors = [ \"#4bb2c5\", \"#EAA228\", \"#c5b47f\", \"#579575\", \"#839557\", \"#958c12\", \"#953579\", \"#4b5de4\", \"#d8b83f\", \"#ff5800\", \"#0085cc\"];\n // prop: sortData\n // false to not sort the data passed in by the user.\n // Many bar, stakced and other graphs as well as many plugins depend on\n // having sorted data.\n this.sortData = true;\n var seriesColorsIndex = 0;\n // prop textColor\n // css spec for the css color attribute. Default for the entire plot.\n this.textColor;\n // prop; fontFamily\n // css spec for the font-family attribute. Default for the entire plot.\n this.fontFamily;\n // prop: fontSize\n // css spec for the font-size attribute. Default for the entire plot.\n this.fontSize;\n // prop: title\n // Title object. See <Title> for specific options. As a shortcut, you\n // can specify the title option as just a string like: title: 'My Plot'\n // and this will create a new title object with the specified text.\n this.title = new Title();\n // container to hold all of the merged options. Convienence for plugins.\n this.options = {};\n // prop: stackSeries\n // true or false, creates a stack or \"mountain\" plot.\n // Not all series renderers may implement this option.\n this.stackSeries = false;\n // array to hold the cumulative stacked series data.\n // used to ajust the individual series data, which won't have access to other\n // series data.\n this._stackData = [];\n // array that holds the data to be plotted. This will be the series data\n // merged with the the appropriate data from _stackData according to the stackAxis.\n this._plotData = [];\n // Namespece to hold plugins. Generally non-renderer plugins add themselves to here.\n this.plugins = {};\n \n this.colorGenerator = ColorGenerator;\n \n // Group: methods\n //\n // method: init\n // sets the plot target, checks data and applies user\n // options to plot.\n this.init = function(target, data, options) {\n for (var i=0; i<$.jqplot.preInitHooks.length; i++) {\n $.jqplot.preInitHooks[i].call(this, target, data, options);\n }\n this.targetId = target;\n this.target = $('#'+target);\n if (!this.target.get(0)) {\n throw \"No plot target specified\";\n }\n \n // make sure the target is positioned by some means and set css\n if (this.target.css('position') == 'static') {\n this.target.css('position', 'relative');\n }\n if (!this.target.hasClass('jqplot-target')) {\n this.target.addClass('jqplot-target');\n }\n \n // if no height or width specified, use a default.\n if (!this.target.height()) {\n this._height = 300;\n this.target.css('height', '300px');\n }\n else {\n this._height = this.target.height();\n }\n if (!this.target.width()) {\n this._width = 400;\n this.target.css('width', '400px');\n }\n else {\n this._width = this.target.width();\n }\n \n this._plotDimensions.height = this._height;\n this._plotDimensions.width = this._width;\n this.grid._plotDimensions = this._plotDimensions;\n this.title._plotDimensions = this._plotDimensions;\n this.baseCanvas._plotDimensions = this._plotDimensions;\n this.seriesCanvas._plotDimensions = this._plotDimensions;\n this.eventCanvas._plotDimensions = this._plotDimensions;\n this.legend._plotDimensions = this._plotDimensions;\n if (this._height <=0 || this._width <=0 || !this._height || !this._width) {\n throw \"Canvas dimensions <=0\";\n }\n \n this.data = data;\n \n this.parseOptions(options);\n \n if (this.textColor) {\n this.target.css('color', this.textColor);\n }\n if (this.fontFamily) {\n this.target.css('font-family', this.fontFamily);\n }\n if (this.fontSize) {\n this.target.css('font-size', this.fontSize);\n }\n \n this.title.init();\n this.legend.init();\n for (var i=0; i<this.series.length; i++) {\n for (var j=0; j<$.jqplot.preSeriesInitHooks.length; j++) {\n $.jqplot.preSeriesInitHooks[j].call(this.series[i], target, data, this.options.seriesDefaults, this.options.series[i]);\n }\n this.populatePlotData(this.series[i], i);\n this.series[i]._plotDimensions = this._plotDimensions;\n this.series[i].init(i, this.grid.borderWidth);\n for (var j=0; j<$.jqplot.postSeriesInitHooks.length; j++) {\n $.jqplot.postSeriesInitHooks[j].call(this.series[i], target, data, this.options.seriesDefaults, this.options.series[i]);\n }\n }\n\n for (var name in this.axes) {\n this.axes[name]._plotDimensions = this._plotDimensions;\n this.axes[name].init();\n }\n \n if (this.sortData) {\n sortData(this.series);\n }\n this.grid.init();\n this.grid._axes = this.axes;\n \n this.legend._series = this.series;\n\n for (var i=0; i<$.jqplot.postInitHooks.length; i++) {\n $.jqplot.postInitHooks[i].call(this, target, data, options);\n }\n }; \n \n // sort the series data in increasing order.\n function sortData(series) {\n var d;\n for (var i=0; i<series.length; i++) {\n d = series[i].data;\n if (series[i]._stackAxis == 'x') {\n d.sort(function(a,b){\n var ret = a[1] - b[1];\n if (ret) {\n return ret;\n }\n return 0;\n });\n }\n else {\n d.sort(function(a,b){\n var ret = a[0] - b[0];\n if (ret) {\n return ret;\n }\n return 0;\n });\n }\n }\n }\n \n // populate the _stackData and _plotData arrays for the plot and the series.\n this.populatePlotData = function(series, index) {\n // if a stacked chart, compute the stacked data\n this._plotData = [];\n this._stackData = [];\n series._stackData = [];\n series._plotData = [];\n if (this.stackSeries) {\n series._stack = true;\n var sidx = series._stackAxis == 'x' ? 0 : 1;\n var idx = sidx ? 0 : 1;\n // push the current data into stackData\n //this._stackData.push(this.series[i].data);\n var temp = $.extend(true, [], series.data);\n // create the data that will be plotted for this series\n var plotdata = $.extend(true, [], series.data);\n // for first series, nothing to add to stackData.\n for (var j=0; j<index; j++) {\n var cd = this.series[j].data;\n for (var k=0; k<cd.length; k++) {\n temp[k][0] += cd[k][0];\n temp[k][1] += cd[k][1];\n // only need to sum up the stack axis column of data\n plotdata[k][sidx] += cd[k][sidx];\n }\n }\n this._plotData.push(plotdata);\n this._stackData.push(temp);\n series._stackData = temp;\n series._plotData = plotdata;\n }\n else {\n this._stackData.push(series.data);\n this.series[index]._stackData = series.data;\n this._plotData.push(series.data);\n series._plotData = series.data;\n }\n if (index>0) {\n series._prevPlotData = this.series[index-1]._plotData;\n }\n };\n \n // function to safely return colors from the color array and wrap around at the end.\n this.getNextSeriesColor = (function(t) {\n var idx = 0;\n var sc = t.seriesColors;\n \n return function () { \n if (idx < sc.length) {\n return sc[idx++];\n }\n else {\n idx = 0;\n return sc[idx++];\n }\n };\n })(this);\n \n this.parseOptions = function(options){\n for (var i=0; i<$.jqplot.preParseOptionsHooks.length; i++) {\n $.jqplot.preParseOptionsHooks[i].call(this, options);\n }\n this.options = $.extend(true, {}, this.defaults, options);\n this.stackSeries = this.options.stackSeries;\n if (this.options.seriesColors) {\n this.seriesColors = this.options.seriesColors;\n }\n var cg = new this.colorGenerator(this.seriesColors);\n this._gridPadding = this.options.gridPadding;\n this.sortData = (this.options.sortData != null) ? this.options.sortData : this.sortData;\n for (var n in this.axes) {\n var axis = this.axes[n];\n $.extend(true, axis, this.options.axesDefaults, this.options.axes[n]);\n axis._plotWidth = this._width;\n axis._plotHeight = this._height;\n }\n if (this.data.length == 0) {\n this.data = [];\n for (var i=0; i<this.options.series.length; i++) {\n this.data.push(this.options.series.data);\n } \n }\n \n var normalizeData = function(data) {\n // return data as an array of point arrays,\n // in form [[x1,y1...], [x2,y2...], ...]\n var temp = [];\n var i;\n if (!(data[0] instanceof Array)) {\n // we have a series of scalars. One line with just y values.\n // turn the scalar list of data into a data array of form:\n // [[1, data[0]], [2, data[1]], ...]\n for (var i=0; i<data.length; i++) {\n temp.push([i+1, data[i]]);\n }\n }\n \n else {\n // we have a properly formatted data series, copy it.\n $.extend(true, temp, data);\n }\n return temp;\n };\n\n for (var i=0; i<this.data.length; i++) { \n var temp = new Series();\n for (var j=0; j<$.jqplot.preParseSeriesOptionsHooks.length; j++) {\n $.jqplot.preParseSeriesOptionsHooks[j].call(temp, this.options.seriesDefaults, this.options.series[i]);\n }\n $.extend(true, temp, this.options.seriesDefaults, this.options.series[i]);\n temp.data = normalizeData(this.data[i]);\n switch (temp.xaxis) {\n case 'xaxis':\n temp._xaxis = this.axes.xaxis;\n break;\n case 'x2axis':\n temp._xaxis = this.axes.x2axis;\n break;\n default:\n break;\n }\n temp._yaxis = this.axes[temp.yaxis];\n temp._xaxis._series.push(temp);\n temp._yaxis._series.push(temp);\n if (temp.show) {\n temp._xaxis.show = true;\n temp._yaxis.show = true;\n }\n\n // parse the renderer options and apply default colors if not provided\n if (!temp.color && temp.show != false) {\n temp.color = cg.next();\n }\n if (!temp.label) {\n temp.label = 'Series '+ (i+1).toString();\n }\n // temp.rendererOptions.show = temp.show;\n // $.extend(true, temp.renderer, {color:this.seriesColors[i]}, this.rendererOptions);\n this.series.push(temp); \n for (var j=0; j<$.jqplot.postParseSeriesOptionsHooks.length; j++) {\n $.jqplot.postParseSeriesOptionsHooks[j].call(this.series[i], this.options.seriesDefaults, this.options.series[i]);\n }\n }\n \n // copy the grid and title options into this object.\n $.extend(true, this.grid, this.options.grid);\n // if axis border properties aren't set, set default.\n for (var n in this.axes) {\n var axis = this.axes[n];\n if (axis.borderWidth == null) {\n axis.borderWidth =this.grid.borderWidth;\n }\n if (axis.borderColor == null) {\n if (n != 'xaxis' && n != 'x2axis' && axis.useSeriesColor === true && axis.show) {\n axis.borderColor = axis._series[0].color;\n }\n else {\n axis.borderColor = this.grid.borderColor;\n }\n }\n }\n \n if (typeof this.options.title == 'string') {\n this.title.text = this.options.title;\n }\n else if (typeof this.options.title == 'object') {\n $.extend(true, this.title, this.options.title);\n }\n this.title._plotWidth = this._width;\n $.extend(true, this.legend, this.options.legend);\n \n for (var i=0; i<$.jqplot.postParseOptionsHooks.length; i++) {\n $.jqplot.postParseOptionsHooks[i].call(this, options);\n }\n };\n \n \n // method: redraw\n // Empties the plot target div and redraws the plot.\n // This enables plot data and properties to be changed\n // and then to comletely clear the plot and redraw.\n // redraw *will not* reinitialize any plot elements.\n // That is, axes will not be autoscaled and defaults\n // will not be reapplied to any plot elements. \n this.redraw = function() {\n this.target.trigger('jqplotPreRedraw');\n this.target.empty();\n for (var ax in this.axes) {\n this.axes[ax]._ticks = [];\n \t }\n for (var i=0; i<this.series.length; i++) {\n this.populatePlotData(this.series[i], i);\n }\n this.draw();\n this.target.trigger('jqplotPostRedraw');\n };\n \n // method: draw\n // Draws all elements of the plot into the container.\n // Does not clear the container before drawing.\n this.draw = function(){\n this.target.trigger('jqplotPreDraw');\n for (var i=0; i<$.jqplot.preDrawHooks.length; i++) {\n $.jqplot.preDrawHooks[i].call(this);\n }\n // create an underlying canvas to be used for special features.\n this.target.append(this.baseCanvas.createElement({left:0, right:0, top:0, bottom:0}, 'jqplot-base-canvas'));\n var bctx = this.baseCanvas.setContext();\n this.target.append(this.title.draw());\n this.title.pack({top:0, left:0});\n for (var name in this.axes) {\n this.target.append(this.axes[name].draw(bctx));\n this.axes[name].set();\n }\n if (this.axes.yaxis.show) {\n this._gridPadding.left = this.axes.yaxis.getWidth();\n }\n var ra = ['y2axis', 'y3axis', 'y4axis', 'y5axis', 'y6axis', 'y7axis', 'y8axis', 'y9axis'];\n var rapad = [0, 0, 0, 0];\n var gpr = 0;\n for (var n=8; n>0; n--) {\n var ax = this.axes[ra[n-1]];\n if (ax.show) {\n rapad[n-1] = gpr;\n gpr += ax.getWidth();\n }\n }\n if (gpr > this._gridPadding.right) {\n this._gridPadding.right = gpr;\n }\n if (this.title.show && this.axes.x2axis.show) {\n this._gridPadding.top = this.title.getHeight() + this.axes.x2axis.getHeight();\n }\n else if (this.title.show) {\n this._gridPadding.top = this.title.getHeight();\n }\n else if (this.axes.x2axis.show) {\n this._gridPadding.top = this.axes.x2axis.getHeight();\n }\n if (this.axes.xaxis.show) {\n this._gridPadding.bottom = this.axes.xaxis.getHeight();\n }\n \n this.axes.xaxis.pack({position:'absolute', bottom:0, left:0, width:this._width}, {min:this._gridPadding.left, max:this._width - this._gridPadding.right});\n this.axes.yaxis.pack({position:'absolute', top:0, left:0, height:this._height}, {min:this._height - this._gridPadding.bottom, max: this._gridPadding.top});\n this.axes.x2axis.pack({position:'absolute', top:this.title.getHeight(), left:0, width:this._width}, {min:this._gridPadding.left, max:this._width - this._gridPadding.right});\n for (var i=8; i>0; i--) {\n this.axes[ra[i-1]].pack({position:'absolute', top:0, right:rapad[i-1]}, {min:this._height - this._gridPadding.bottom, max: this._gridPadding.top});\n }\n // this.axes.y2axis.pack({position:'absolute', top:0, right:0}, {min:this._height - this._gridPadding.bottom, max: this._gridPadding.top});\n \n this.target.append(this.grid.createElement(this._gridPadding));\n this.grid.draw();\n this.target.append(this.seriesCanvas.createElement(this._gridPadding, 'jqplot-series-canvas'));\n var sctx = this.seriesCanvas.setContext();\n this.target.append(this.eventCanvas.createElement(this._gridPadding, 'jqplot-event-canvas'));\n var ectx = this.eventCanvas.setContext();\n ectx.fillStyle = 'rgba(0,0,0,0)';\n ectx.fillRect(0,0,ectx.canvas.width, ectx.canvas.height);\n \n // bind custom event handlers to regular events.\n this.bindCustomEvents();\n \n // draw legend before series if the series needs to know the legend dimensions.\n if (this.legend.preDraw) { \n this.target.append(this.legend.draw());\n this.legend.pack(this._gridPadding);\n if (this.legend._elem) {\n this.drawSeries(sctx, {legendInfo:{location:this.legend.location, width:this.legend.getWidth(), height:this.legend.getHeight(), xoffset:this.legend.xoffset, yoffset:this.legend.yoffset}});\n }\n else {\n this.drawSeries(sctx);\n }\n }\n else { // draw series before legend\n this.drawSeries(sctx);\n this.target.append(this.legend.draw());\n this.legend.pack(this._gridPadding); \n }\n \n // register event listeners on the overlay canvas\n for (var i=0; i<$.jqplot.eventListenerHooks.length; i++) {\n var h = $.jqplot.eventListenerHooks[i];\n // in the handler, this will refer to the eventCanvas dom element.\n // make sure there are references back into plot objects.\n this.eventCanvas._elem.bind(h[0], {plot:this}, h[1]);\n }\n\n for (var i=0; i<$.jqplot.postDrawHooks.length; i++) {\n $.jqplot.postDrawHooks[i].call(this);\n }\n this.target.trigger('jqplotPostDraw', [this]);\n };\n \n this.bindCustomEvents = function() {\n this.eventCanvas._elem.bind('click', {plot:this}, this.onClick);\n this.eventCanvas._elem.bind('dblclick', {plot:this}, this.onDblClick);\n this.eventCanvas._elem.bind('mousedown', {plot:this}, this.onMouseDown);\n this.eventCanvas._elem.bind('mouseup', {plot:this}, this.onMouseUp);\n this.eventCanvas._elem.bind('mousemove', {plot:this}, this.onMouseMove);\n this.eventCanvas._elem.bind('mouseenter', {plot:this}, this.onMouseEnter);\n this.eventCanvas._elem.bind('mouseleave', {plot:this}, this.onMouseLeave);\n };\n \n function getEventPosition(ev) {\n \t var plot = ev.data.plot;\n // var xaxis = plot.axes.xaxis;\n // var x2axis = plot.axes.x2axis;\n // var yaxis = plot.axes.yaxis;\n // var y2axis = plot.axes.y2axis;\n \t var offsets = plot.eventCanvas._elem.offset();\n \t var gridPos = {x:ev.pageX - offsets.left, y:ev.pageY - offsets.top};\n // var dataPos = {x1y1:{x:null, y:null}, x1y2:{x:null, y:null}, x2y1:{x:null, y:null}, x2y2:{x:null, y:null}};\n \t var dataPos = {xaxis:null, yaxis:null, x2axis:null, y2axis:null, y3axis:null, y4axis:null, y5axis:null, y6axis:null, y7axis:null, y8axis:null, y9axis:null};\n \t \n \t var an = ['xaxis', 'yaxis', 'x2axis', 'y2axis', 'y3axis', 'y4axis', 'y5axis', 'y6axis', 'y7axis', 'y8axis', 'y9axis'];\n \t var ax = plot.axes;\n \t for (var n=11; n>0; n--) {\n \t var axis = an[n-1];\n \t if (ax[axis].show) {\n \t dataPos[axis] = ax[axis].series_p2u(gridPos[axis.charAt(0)]);\n \t }\n \t }\n\n return ({offsets:offsets, gridPos:gridPos, dataPos:dataPos});\n }\n \n function getNeighborPoint(plot, x, y) {\n var ret = null;\n var s, i, d0, d, j, r;\n var threshold;\n for (var i=0; i<plot.series.length; i++) {\n s = plot.series[i];\n r = s.renderer;\n if (s.show) {\n threshold = Math.abs(s.markerRenderer.size/2+s.neighborThreshold);\n for (var j=0; j<s.gridData.length; j++) {\n p = s.gridData[j];\n // neighbor looks different to OHLC chart.\n if (r.constructor == $.jqplot.OHLCRenderer) {\n if (r.candleStick) {\n var yp = s._yaxis.series_u2p;\n if (x >= p[0]-r.bodyWidth/2 && x <= p[0]+r.bodyWidth/2 && y >= yp(s.data[j][2]) && y <= yp(s.data[j][3])) {\n ret = {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};\n }\n }\n // if an open hi low close chart\n else if (!r.hlc){\n var yp = s._yaxis.series_u2p;\n if (x >= p[0]-r.tickLength && x <= p[0]+r.tickLength && y >= yp(s.data[j][2]) && y <= yp(s.data[j][3])) {\n ret = {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};\n }\n }\n // a hi low close chart\n else {\n var yp = s._yaxis.series_u2p;\n if (x >= p[0]-r.tickLength && x <= p[0]+r.tickLength && y >= yp(s.data[j][1]) && y <= yp(s.data[j][2])) {\n ret = {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};\n }\n }\n \n }\n else {\n d = Math.sqrt( (x-p[0]) * (x-p[0]) + (y-p[1]) * (y-p[1]) );\n if (d <= threshold && (d <= d0 || d0 == null)) {\n d0 = d;\n ret = {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};\n }\n }\n } \n }\n }\n return ret;\n }\n \n this.onClick = function(ev) {\n // Event passed in is unnormalized and will have data attribute.\n // Event passed out in normalized and won't have data attribute.\n var positions = getEventPosition(ev);\n var p = ev.data.plot;\n var neighbor = getNeighborPoint(p, positions.gridPos.x, positions.gridPos.y);\n \t ev.data.plot.eventCanvas._elem.trigger('jqplotClick', [positions.gridPos, positions.dataPos, neighbor, p]);\n };\n \n this.onDblClick = function(ev) {\n // Event passed in is unnormalized and will have data attribute.\n // Event passed out in normalized and won't have data attribute.\n var positions = getEventPosition(ev);\n var p = ev.data.plot;\n var neighbor = getNeighborPoint(p, positions.gridPos.x, positions.gridPos.y);\n \t ev.data.plot.eventCanvas._elem.trigger('jqplotDblClick', [positions.gridPos, positions.dataPos, neighbor, p]);\n };\n \n this.onMouseDown = function(ev) {\n var positions = getEventPosition(ev);\n var p = ev.data.plot;\n var neighbor = getNeighborPoint(p, positions.gridPos.x, positions.gridPos.y);\n \t ev.data.plot.eventCanvas._elem.trigger('jqplotMouseDown', [positions.gridPos, positions.dataPos, neighbor, p]);\n };\n \n this.onMouseUp = function(ev) {\n var positions = getEventPosition(ev);\n \t ev.data.plot.eventCanvas._elem.trigger('jqplotMouseUp', [positions.gridPos, positions.dataPos, null, ev.data.plot]);\n };\n \n this.onMouseMove = function(ev) {\n var positions = getEventPosition(ev);\n var p = ev.data.plot;\n var neighbor = getNeighborPoint(p, positions.gridPos.x, positions.gridPos.y);\n \t ev.data.plot.eventCanvas._elem.trigger('jqplotMouseMove', [positions.gridPos, positions.dataPos, neighbor, p]);\n };\n \n this.onMouseEnter = function(ev) {\n var positions = getEventPosition(ev);\n var p = ev.data.plot;\n \t ev.data.plot.eventCanvas._elem.trigger('jqplotMouseEnter', [positions.gridPos, positions.dataPos, null, p]);\n };\n \n this.onMouseLeave = function(ev) {\n var positions = getEventPosition(ev);\n var p = ev.data.plot;\n \t ev.data.plot.eventCanvas._elem.trigger('jqplotMouseLeave', [positions.gridPos, positions.dataPos, null, p]);\n };\n \n this.drawSeries = function(sctx, options){\n // first clear the canvas, since we are redrawing all series.\n sctx.clearRect(0,0,sctx.canvas.width, sctx.canvas.height);\n // if call series drawShadow method first, in case all series shadows\n // should be drawn before any series. This will ensure, like for \n // stacked bar plots, that shadows don't overlap series.\n for (var i=0; i<this.series.length; i++) {\n // console.log('series %s data: %s', i, this.series[i].data);\n this.series[i].drawShadow(sctx, options);\n }\n for (var i=0; i<this.series.length; i++) {\n this.series[i].draw(sctx, options);\n // console.log('series %s data: %s', i, this.series[i].data);\n }\n };\n }", "title": "" }, { "docid": "39a40931131b3a0751be1ffb338ba513", "score": "0.6235738", "text": "function constructPlot() {\n\tstartTime = Date.now();\n\tvar height = screen.height;\n\t$(\"#flot\").height(Math.round(height*.40)+\"px\");\n\tvar data = [ ];\n\tvar options = {\n\t\tcolors: [\"green\"],\n\t\tlines: {\n\t\t\tshow: true,\n\t\t\tfill: 1,\n\t\t\tcolor: \"green\",\n\t\t\tfillColor: 'rgba(0, 255, 0, 0.60)',\n\t\t\tlineWidth: 3\n\t\t},\n\t\txaxis: {\n\t\t\tshow: true,\n\t\t\tposition: 'bottom',\n\t\t\tmode: \"time\",\n\t\t\ttimezone: \"browser\",\n\t\t\ttickSize: [10, \"second\"],\n\t\t\ttimeformat: \"%m/%d/%y <br> %h:%M:%S\",\n\t\t\taxisLabel: \"\",\n\t\t\taxisLabelUseCanvas: true,\n\t\t\taxisLabelFontSizePixels: 12,\n\t\t\taxisLabelFontFamily: 'Verdana, Arial',\n\t\t\taxisLabelPadding: 5\n\t\t},\n\t\tyaxes: [{\n\t\t\tshow: true,\n\t\t\tposition: \"left\",\n\t\t\taxisLabel: \"Output Power Kilowatts \",\n\t\t\taxisLabelUseCanvas: true,\n\t\t\taxisLabelFontSizePixels: 16,\n\t\t\taxisLabelFontFamily: 'sans-serif',\n\t\t\tmax: 14,\n\t\t\tmin: 0,\n\t\t\tyaxis: 1\n\t\t},{\n\t\t\tshow: true,\n\t\t\tposition: \"right\",\n\t\t\taxisLabelFontSizePixels: 12,\n\t\t\taxisLabelFontFamily: 'sans-serif',\n\t\t\tmax: 14,\n\t\t\tmin: 0,\n\t\t \tyaxis: 2\t\n\t\t}]\n\t}\n\tstartTime = Date.now();\n\tplot = $.plot($(\"#flot\"), data, options);\n}", "title": "" }, { "docid": "4104fa6df2dfcb69e32ce648ddd93269", "score": "0.6133114", "text": "function appendAxes() {\n svgFrame.append('g')\n .attr('class', 'x_axis')\n .attr('transform', 'translate(0,' + (h - padding) + ')')\n .style('font-size', '14px')\n .call(xAxis);\n\n svgFrame.append('g')\n .attr('class', 'y_axis')\n .attr('transform', 'translate(' + padding + ',0)')\n .style('font-size', '12px')\n .call(yAxis);\n }", "title": "" }, { "docid": "09e522c93480b9dc34866ae7c3724c40", "score": "0.6094559", "text": "function drawFramework() {\n var basePlotModules = fullLayout._basePlotModules;\n\n for(var i = 0; i < basePlotModules.length; i++) {\n if(basePlotModules[i].drawFramework) {\n basePlotModules[i].drawFramework(gd);\n }\n }\n\n if(!fullLayout._glcanvas && fullLayout._has('gl')) {\n fullLayout._glcanvas = fullLayout._glcontainer.selectAll('.gl-canvas').data([{\n key: 'contextLayer',\n context: true,\n pick: false\n }, {\n key: 'focusLayer',\n context: false,\n pick: false\n }, {\n key: 'pickLayer',\n context: false,\n pick: true\n }], function(d) { return d.key; });\n\n fullLayout._glcanvas.enter().append('canvas')\n .attr('class', function(d) {\n return 'gl-canvas gl-canvas-' + d.key.replace('Layer', '');\n })\n .style({\n 'position': 'absolute',\n 'top': 0,\n 'left': 0,\n 'width': '100%',\n 'height': '100%',\n 'overflow': 'visible',\n 'pointer-events': 'none'\n });\n }\n\n if(fullLayout._glcanvas) {\n fullLayout._glcanvas\n .attr('width', fullLayout.width)\n .attr('height', fullLayout.height);\n }\n\n return Lib.syncOrAsync([\n subroutines.layoutStyles\n ], gd);\n }", "title": "" }, { "docid": "09e522c93480b9dc34866ae7c3724c40", "score": "0.6094559", "text": "function drawFramework() {\n var basePlotModules = fullLayout._basePlotModules;\n\n for(var i = 0; i < basePlotModules.length; i++) {\n if(basePlotModules[i].drawFramework) {\n basePlotModules[i].drawFramework(gd);\n }\n }\n\n if(!fullLayout._glcanvas && fullLayout._has('gl')) {\n fullLayout._glcanvas = fullLayout._glcontainer.selectAll('.gl-canvas').data([{\n key: 'contextLayer',\n context: true,\n pick: false\n }, {\n key: 'focusLayer',\n context: false,\n pick: false\n }, {\n key: 'pickLayer',\n context: false,\n pick: true\n }], function(d) { return d.key; });\n\n fullLayout._glcanvas.enter().append('canvas')\n .attr('class', function(d) {\n return 'gl-canvas gl-canvas-' + d.key.replace('Layer', '');\n })\n .style({\n 'position': 'absolute',\n 'top': 0,\n 'left': 0,\n 'width': '100%',\n 'height': '100%',\n 'overflow': 'visible',\n 'pointer-events': 'none'\n });\n }\n\n if(fullLayout._glcanvas) {\n fullLayout._glcanvas\n .attr('width', fullLayout.width)\n .attr('height', fullLayout.height);\n }\n\n return Lib.syncOrAsync([\n subroutines.layoutStyles\n ], gd);\n }", "title": "" }, { "docid": "cce3b5bf57178afce2b8f0f25859aad1", "score": "0.6084152", "text": "function appendAxes() {\n svgFrame.append('g')\n .attr('class', 'x_axis')\n .attr('transform', 'translate(0,' + (h - padding) + ')')\n .style('font-size', '14px')\n\t .style('stroke','white')\n .call(xAxis);\n\n svgFrame.append('g')\n .attr('class', 'y_axis')\n .attr('transform', 'translate(' + padding + ',0)')\n .style('font-size', '12px')\n\t .style('stroke','white')\n .call(yAxis);\n }", "title": "" }, { "docid": "41b335fcb3efd2fbd3aa3bf342f213d7", "score": "0.60588604", "text": "function createAxes() {\n //create x axis svg\n xAxisSVG = diagramG.append('g')\n .style('fill', 'none')\n .style('shape-rendering', 'crispEdges')\n .attr('transform', 'translate(' + margin.left + ',' + (height - margin.top) + ')')\n .attr('class', 'eve-x-axis')\n .call(xAxis);\n\n //create y axis left svg\n yAxisLeftSVG = diagramG.append('g')\n .style('fill', 'none')\n .style('shape-rendering', 'crispEdges')\n .attr('transform', 'translate(' + margin.left + ', ' + margin.top + ')')\n .attr('class', 'eve-y-axis')\n .call(yAxisLeft);\n\n //create y axis right svg\n yAxisRightSVG = diagramG.append('g')\n .style('fill', 'none')\n .style('shape-rendering', 'crispEdges')\n .attr('transform', 'translate(' + (width + margin.left) + ', ' + margin.top + ')')\n .attr('class', 'eve-y-axis')\n .call(yAxisRight);\n\n //set axes styling\n updateAxisStyle();\n }", "title": "" }, { "docid": "816c46ddf00b063a685b85d7fa25eb07", "score": "0.60529697", "text": "plot() {/* abstract */\n }", "title": "" }, { "docid": "2e6071ab96ffd81812a2cfb4f731965e", "score": "0.5985671", "text": "_setupChart()\n {\n this._createSvgCanvas();\n }", "title": "" }, { "docid": "5fe5fee613bbb661c79e5ef8887ab241", "score": "0.59705234", "text": "function setup() {\r\n var dimensions = [SIZE, SIZE];\r\n var range = [X_RANGE, Y_RANGE];\r\n var step = STEP;\r\n if (step === \"auto\") {\r\n step = _.map(range, function(extent, i) {\r\n return Perseus.Util.tickStepFromExtent(\r\n extent, dimensions[i]);\r\n });\r\n }\r\n var gridConfig = _.map(range, function(extent, i) {\r\n return Perseus.Util.gridDimensionConfig(\r\n step[i],\r\n extent,\r\n dimensions[i]);\r\n });\r\n var scale = _.pluck(gridConfig, \"scale\");\r\n xScale = scale[0];\r\n yScale = scale[1];\r\n var paddedRange = _.map(range, function(extent, i) {\r\n var padding = 25 / scale[i];\r\n return [extent[0], extent[1] + padding];\r\n });\r\n graphInit({\r\n gridRange: range,\r\n range: paddedRange,\r\n scale: scale,\r\n axisArrows: \"<->\",\r\n labelFormat: function(s) {\r\n return \"\\\\small{\" + s + \"}\";\r\n },\r\n gridStep: _.pluck(gridConfig, \"gridStep\"),\r\n tickStep: _.pluck(gridConfig, \"tickStep\"),\r\n labelStep: 1,\r\n unityLabels: _.pluck(gridConfig, \"unityLabel\")\r\n });\r\n style({\r\n clipRect: [[X_RANGE[0], Y_RANGE[0]],\r\n [X_RANGE[1] - X_RANGE[0],\r\n Y_RANGE[1] - Y_RANGE[0]]]\r\n });\r\n\r\n label([0, Y_RANGE[1]], \"y\", \"above\");\r\n label([X_RANGE[1], 0], \"x\", \"right\");\r\n}", "title": "" }, { "docid": "ac960ddaad2bad13f7a2189629fafce4", "score": "0.5931628", "text": "function mainLayout(_title, _labels) {\n return {\n title: _title,\n titlefont: {\n color: config.textColour\n },\n plot_bgcolor: config.bgColour, //background of the plot\n paper_bgcolor: config.bgColour, //background of the border\n margin: { //setting the border thickness\n l: 75,\n r: 50,\n t: 50,\n b: 75\n },\n xaxis: {\n title: _labels[0],\n titlefont: {\n color: config.textColour\n },\n range: [0, 24],\n backgroundcolor: config.bgColour,\n showbackground: true,\n showline: true,\n linecolor: config.textColour, //axis line\n ticks: 'inside', //ticks on axis line\n tickcolor: config.textColour,\n tickfont: { //numbers on the ticks\n color: config.textColour\n },\n zeroline: false,\n showgrid: config.showGrid\n },\n yaxis: {\n title: _labels[1],\n titlefont: {\n color: config.textColour\n },\n range: [0, yRange],\n backgroundcolor: config.bgColour,\n showbackground: true,\n showline: true,\n linecolor: config.textColour,\n ticks: 'inside',\n tickcolor: config.textColour,\n tickfont: {\n color: config.textColour\n },\n zeroline: false,\n showgrid: config.showGrid\n },\n yaxis2: {\n title: _labels[2],\n titlefont: {\n color: config.textColour\n },\n range: [0, yRange2],\n backgroundcolor: config.bgColour,\n showbackground: true,\n showline: true,\n linecolor: config.textColour,\n ticks: 'inside',\n tickcolor: config.textColour,\n tickfont: {\n color: config.textColour\n },\n zeroline: false,\n showgrid: config.showGrid,\n overlaying: 'y',\n side: 'right'\n },\n width: width() * config.widthFactor,\n height: height() * config.heightFactor\n }\n}", "title": "" }, { "docid": "29fc256f274dbfa8077c6914a97d413c", "score": "0.5903412", "text": "function chartMain(ele) {\n if ($(ele).length) {\n $.plot($('#main-chart'), [{\n data: [\n [1, 35],\n [2, 60],\n [3, 40],\n [4, 65],\n [5, 45],\n [6, 75],\n [7, 35],\n [8, 40],\n [9, 60]\n ],\n label: 'Purchases',\n }, {\n data: [\n [1, 20],\n [2, 40],\n [3, 25],\n [4, 45],\n [5, 25],\n [6, 50],\n [7, 35],\n [8, 60],\n [9, 30]\n ],\n label: 'Plans',\n }, {\n data: [\n [1, 35],\n [2, 15],\n [3, 20],\n [4, 30],\n [5, 15],\n [6, 18],\n [7, 28],\n [8, 10],\n [9, 30]\n ],\n label: 'Services',\n }], {\n series: {\n lines: {\n show: !0,\n lineWidth: 0,\n fill: !0,\n fillColor: {\n colors: [{\n opacity: 1\n }, {\n opacity: 1\n }]\n }\n },\n fillColor: 'rgba(0, 0, 0, 1)',\n shadowSize: 0,\n curvedLines: {\n apply: !0,\n active: !0,\n monotonicFit: !0\n }\n },\n legend: {\n show: !1\n },\n grid: {\n show: !0,\n margin: {\n top: 20,\n bottom: 0,\n left: 0,\n right: 0\n },\n labelMargin: 0,\n minBorderMargin: 0,\n axisMargin: 0,\n tickColor: 'rgba(0,0,0,0.05)',\n borderWidth: 0,\n hoverable: !0,\n clickable: !0\n },\n tooltip: {\n show: !0,\n cssClass: 'tooltip-chart',\n content: '<div class=\\'content-chart\\'> <span> %s </span> <div class=\\'label\\'> <div class=\\'label-x\\'> %x.0 </div> - <div class=\\'label-y\\'> %y.0 </div> </div></div>',\n defaultTheme: !1\n },\n colors: ['#4386f4', '#81adf8', '#a2c3fa'],\n xaxis: {\n tickFormatter: function() {\n return ''\n },\n autoscaleMargin: 0,\n ticks: 11,\n tickDecimals: 0,\n tickLength: 0\n },\n yaxis: {\n tickFormatter: function() {\n return ''\n },\n ticks: 4,\n tickDecimals: 0\n }\n });\n\n $(ele).bind('plothover', function(event, pos, item) {\n var width = $('.tooltip-chart').width();\n if (item) {\n $('.tooltip-chart').css({\n top: item.pageY - 60,\n left: item.pageX - (width / 2),\n }).fadeIn(200);\n } else {\n $('.tooltip-chart').hide()\n }\n });\n }\n}", "title": "" }, { "docid": "ed268b2fdf142fab50a54cf33a032195", "score": "0.5850067", "text": "function jqPlot() {\n // Group: Properties\n // These properties are specified at the top of the options object\n // like so:\n // > {\n // > axesDefaults:{min:0},\n // > series:[{color:'#6633dd'}],\n // > title: 'A Plot'\n // > }\n //\n\n // prop: animate\n // True to animate the series on initial plot draw (renderer dependent).\n // Actual animation functionality must be supported in the renderer.\n this.animate = false;\n // prop: animateReplot\n // True to animate series after a call to the replot() method.\n // Use with caution! Replots can happen very frequently under\n // certain circumstances (e.g. resizing, dragging points) and\n // animation in these situations can cause problems.\n this.animateReplot = false;\n // prop: axes\n // up to 4 axes are supported, each with its own options, \n // See <Axis> for axis specific options.\n this.axes = {xaxis: new Axis('xaxis'), yaxis: new Axis('yaxis'), x2axis: new Axis('x2axis'), y2axis: new Axis('y2axis'), y3axis: new Axis('y3axis'), y4axis: new Axis('y4axis'), y5axis: new Axis('y5axis'), y6axis: new Axis('y6axis'), y7axis: new Axis('y7axis'), y8axis: new Axis('y8axis'), y9axis: new Axis('y9axis'), yMidAxis: new Axis('yMidAxis')};\n this.baseCanvas = new $.jqplot.GenericCanvas();\n // true to intercept right click events and fire a 'jqplotRightClick' event.\n // this will also block the context menu.\n this.captureRightClick = false;\n // prop: data\n // user's data. Data should *NOT* be specified in the options object,\n // but be passed in as the second argument to the $.jqplot() function.\n // The data property is described here soley for reference. \n // The data should be in the form of an array of 2D or 1D arrays like\n // > [ [[x1, y1], [x2, y2],...], [y1, y2, ...] ].\n this.data = [];\n // prop: dataRenderer\n // A callable which can be used to preprocess data passed into the plot.\n // Will be called with 3 arguments: the plot data, a reference to the plot,\n // and the value of dataRendererOptions.\n this.dataRenderer;\n // prop: dataRendererOptions\n // Options that will be passed to the dataRenderer.\n // Can be of any type.\n this.dataRendererOptions;\n this.defaults = {\n // prop: axesDefaults\n // default options that will be applied to all axes.\n // see <Axis> for axes options.\n axesDefaults: {},\n axes: {xaxis:{}, yaxis:{}, x2axis:{}, y2axis:{}, y3axis:{}, y4axis:{}, y5axis:{}, y6axis:{}, y7axis:{}, y8axis:{}, y9axis:{}, yMidAxis:{}},\n // prop: seriesDefaults\n // default options that will be applied to all series.\n // see <Series> for series options.\n seriesDefaults: {},\n series:[]\n };\n // prop: defaultAxisStart\n // 1-D data series are internally converted into 2-D [x,y] data point arrays\n // by jqPlot. This is the default starting value for the missing x or y value.\n // The added data will be a monotonically increasing series (e.g. [1, 2, 3, ...])\n // starting at this value.\n this.defaultAxisStart = 1;\n // this.doCustomEventBinding = true;\n // prop: drawIfHidden\n // True to execute the draw method even if the plot target is hidden.\n // Generally, this should be false. Most plot elements will not be sized/\n // positioned correclty if renderered into a hidden container. To render into\n // a hidden container, call the replot method when the container is shown.\n this.drawIfHidden = false;\n this.eventCanvas = new $.jqplot.GenericCanvas();\n // prop: fillBetween\n // Fill between 2 line series in a plot.\n // Options object:\n // {\n // series1: first index (0 based) of series in fill\n // series2: second index (0 based) of series in fill\n // color: color of fill [default fillColor of series1]\n // baseSeries: fill will be drawn below this series (0 based index)\n // fill: false to turn off fill [default true].\n // }\n this.fillBetween = {\n series1: null,\n series2: null,\n color: null,\n baseSeries: 0,\n fill: true\n };\n // prop; fontFamily\n // css spec for the font-family attribute. Default for the entire plot.\n this.fontFamily;\n // prop: fontSize\n // css spec for the font-size attribute. Default for the entire plot.\n this.fontSize;\n // prop: grid\n // See <Grid> for grid specific options.\n this.grid = new Grid();\n // prop: legend\n // see <$.jqplot.TableLegendRenderer>\n this.legend = new Legend();\n // prop: noDataIndicator\n // Options to set up a mock plot with a data loading indicator if no data is specified.\n this.noDataIndicator = { \n show: false,\n indicator: 'Loading Data...',\n axes: {\n xaxis: {\n min: 0,\n max: 10,\n tickInterval: 2,\n show: true\n },\n yaxis: {\n min: 0,\n max: 12,\n tickInterval: 3,\n show: true\n }\n }\n };\n // prop: negativeSeriesColors \n // colors to use for portions of the line below zero.\n this.negativeSeriesColors = $.jqplot.config.defaultNegativeColors;\n // container to hold all of the merged options. Convienence for plugins.\n this.options = {};\n this.previousSeriesStack = [];\n // Namespace to hold plugins. Generally non-renderer plugins add themselves to here.\n this.plugins = {};\n // prop: series\n // Array of series object options.\n // see <Series> for series specific options.\n this.series = [];\n // array of series indices. Keep track of order\n // which series canvases are displayed, lowest\n // to highest, back to front.\n this.seriesStack = [];\n // prop: seriesColors\n // Ann array of CSS color specifications that will be applied, in order,\n // to the series in the plot. Colors will wrap around so, if their\n // are more series than colors, colors will be reused starting at the\n // beginning. For pie charts, this specifies the colors of the slices.\n this.seriesColors = $.jqplot.config.defaultColors;\n // prop: sortData\n // false to not sort the data passed in by the user.\n // Many bar, stacked and other graphs as well as many plugins depend on\n // having sorted data.\n this.sortData = true;\n // prop: stackSeries\n // true or false, creates a stack or \"mountain\" plot.\n // Not all series renderers may implement this option.\n this.stackSeries = false;\n // a shortcut for axis syncTicks options. Not implemented yet.\n this.syncXTicks = true;\n // a shortcut for axis syncTicks options. Not implemented yet.\n this.syncYTicks = true;\n // the jquery object for the dom target.\n this.target = null; \n // The id of the dom element to render the plot into\n this.targetId = null;\n // prop textColor\n // css spec for the css color attribute. Default for the entire plot.\n this.textColor;\n // prop: title\n // Title object. See <Title> for specific options. As a shortcut, you\n // can specify the title option as just a string like: title: 'My Plot'\n // and this will create a new title object with the specified text.\n this.title = new Title();\n // Count how many times the draw method has been called while the plot is visible.\n // Mostly used to test if plot has never been dran (=0), has been successfully drawn\n // into a visible container once (=1) or draw more than once into a visible container.\n // Can use this in tests to see if plot has been visibly drawn at least one time.\n // After plot has been visibly drawn once, it generally doesn't need redrawing if its\n // container is hidden and shown.\n this._drawCount = 0;\n // sum of y values for all series in plot.\n // used in mekko chart.\n this._sumy = 0;\n this._sumx = 0;\n // array to hold the cumulative stacked series data.\n // used to ajust the individual series data, which won't have access to other\n // series data.\n this._stackData = [];\n // array that holds the data to be plotted. This will be the series data\n // merged with the the appropriate data from _stackData according to the stackAxis.\n this._plotData = [];\n this._width = null;\n this._height = null; \n this._plotDimensions = {height:null, width:null};\n this._gridPadding = {top:null, right:null, bottom:null, left:null};\n this._defaultGridPadding = {top:10, right:10, bottom:23, left:10};\n\n this._addDomReference = $.jqplot.config.addDomReference;\n\n this.preInitHooks = new $.jqplot.HooksManager();\n this.postInitHooks = new $.jqplot.HooksManager();\n this.preParseOptionsHooks = new $.jqplot.HooksManager();\n this.postParseOptionsHooks = new $.jqplot.HooksManager();\n this.preDrawHooks = new $.jqplot.HooksManager();\n this.postDrawHooks = new $.jqplot.HooksManager();\n this.preDrawSeriesHooks = new $.jqplot.HooksManager();\n this.postDrawSeriesHooks = new $.jqplot.HooksManager();\n this.preDrawLegendHooks = new $.jqplot.HooksManager();\n this.addLegendRowHooks = new $.jqplot.HooksManager();\n this.preSeriesInitHooks = new $.jqplot.HooksManager();\n this.postSeriesInitHooks = new $.jqplot.HooksManager();\n this.preParseSeriesOptionsHooks = new $.jqplot.HooksManager();\n this.postParseSeriesOptionsHooks = new $.jqplot.HooksManager();\n this.eventListenerHooks = new $.jqplot.EventListenerManager();\n this.preDrawSeriesShadowHooks = new $.jqplot.HooksManager();\n this.postDrawSeriesShadowHooks = new $.jqplot.HooksManager();\n \n this.colorGenerator = new $.jqplot.ColorGenerator();\n this.negativeColorGenerator = new $.jqplot.ColorGenerator();\n\n this.canvasManager = new $.jqplot.CanvasManager();\n\n this.themeEngine = new $.jqplot.ThemeEngine();\n \n var seriesColorsIndex = 0;\n\n // Group: methods\n //\n // method: init\n // sets the plot target, checks data and applies user\n // options to plot.\n this.init = function(target, data, options) {\n options = options || {};\n for (var i=0; i<$.jqplot.preInitHooks.length; i++) {\n $.jqplot.preInitHooks[i].call(this, target, data, options);\n }\n\n for (var i=0; i<this.preInitHooks.hooks.length; i++) {\n this.preInitHooks.hooks[i].call(this, target, data, options);\n }\n \n this.targetId = '#'+target;\n this.target = $('#'+target);\n\n //////\n // Add a reference to plot\n //////\n if (this._addDomReference) {\n this.target.data('jqplot', this);\n }\n // remove any error class that may be stuck on target.\n this.target.removeClass('jqplot-error');\n if (!this.target.get(0)) {\n throw new Error(\"No plot target specified\");\n }\n \n // make sure the target is positioned by some means and set css\n if (this.target.css('position') == 'static') {\n this.target.css('position', 'relative');\n }\n if (!this.target.hasClass('jqplot-target')) {\n this.target.addClass('jqplot-target');\n }\n \n // if no height or width specified, use a default.\n if (!this.target.height()) {\n var h;\n if (options && options.height) {\n h = parseInt(options.height, 10);\n }\n else if (this.target.attr('data-height')) {\n h = parseInt(this.target.attr('data-height'), 10);\n }\n else {\n h = parseInt($.jqplot.config.defaultHeight, 10);\n }\n this._height = h;\n this.target.css('height', h+'px');\n }\n else {\n this._height = h = this.target.height();\n }\n if (!this.target.width()) {\n var w;\n if (options && options.width) {\n w = parseInt(options.width, 10);\n }\n else if (this.target.attr('data-width')) {\n w = parseInt(this.target.attr('data-width'), 10);\n }\n else {\n w = parseInt($.jqplot.config.defaultWidth, 10);\n }\n this._width = w;\n this.target.css('width', w+'px');\n }\n else {\n this._width = w = this.target.width();\n }\n\n for (var i=0, l=_axisNames.length; i<l; i++) {\n this.axes[_axisNames[i]] = new Axis(_axisNames[i]);\n }\n \n this._plotDimensions.height = this._height;\n this._plotDimensions.width = this._width;\n this.grid._plotDimensions = this._plotDimensions;\n this.title._plotDimensions = this._plotDimensions;\n this.baseCanvas._plotDimensions = this._plotDimensions;\n this.eventCanvas._plotDimensions = this._plotDimensions;\n this.legend._plotDimensions = this._plotDimensions;\n if (this._height <=0 || this._width <=0 || !this._height || !this._width) {\n throw new Error(\"Canvas dimension not set\");\n }\n \n if (options.dataRenderer && $.isFunction(options.dataRenderer)) {\n if (options.dataRendererOptions) {\n this.dataRendererOptions = options.dataRendererOptions;\n }\n this.dataRenderer = options.dataRenderer;\n data = this.dataRenderer(data, this, this.dataRendererOptions);\n }\n \n if (options.noDataIndicator && $.isPlainObject(options.noDataIndicator)) {\n $.extend(true, this.noDataIndicator, options.noDataIndicator);\n }\n \n if (data == null || $.isArray(data) == false || data.length == 0 || $.isArray(data[0]) == false || data[0].length == 0) {\n \n if (this.noDataIndicator.show == false) {\n throw new Error(\"No data specified\");\n }\n \n else {\n // have to be descructive here in order for plot to not try and render series.\n // This means that $.jqplot() will have to be called again when there is data.\n //delete options.series;\n \n for (var ax in this.noDataIndicator.axes) {\n for (var prop in this.noDataIndicator.axes[ax]) {\n this.axes[ax][prop] = this.noDataIndicator.axes[ax][prop];\n }\n }\n \n this.postDrawHooks.add(function() {\n var eh = this.eventCanvas.getHeight();\n var ew = this.eventCanvas.getWidth();\n var temp = $('<div class=\"jqplot-noData-container\" style=\"position:absolute;\"></div>');\n this.target.append(temp);\n temp.height(eh);\n temp.width(ew);\n temp.css('top', this.eventCanvas._offsets.top);\n temp.css('left', this.eventCanvas._offsets.left);\n \n var temp2 = $('<div class=\"jqplot-noData-contents\" style=\"text-align:center; position:relative; margin-left:auto; margin-right:auto;\"></div>');\n temp.append(temp2);\n temp2.html(this.noDataIndicator.indicator);\n var th = temp2.height();\n var tw = temp2.width();\n temp2.height(th);\n temp2.width(tw);\n temp2.css('top', (eh - th)/2 + 'px');\n });\n\n }\n }\n \n // make a copy of the data\n this.data = $.extend(true, [], data);\n \n this.parseOptions(options);\n \n if (this.textColor) {\n this.target.css('color', this.textColor);\n }\n if (this.fontFamily) {\n this.target.css('font-family', this.fontFamily);\n }\n if (this.fontSize) {\n this.target.css('font-size', this.fontSize);\n }\n \n this.title.init();\n this.legend.init();\n this._sumy = 0;\n this._sumx = 0;\n this.computePlotData();\n for (var i=0; i<this.series.length; i++) {\n // set default stacking order for series canvases\n this.seriesStack.push(i);\n this.previousSeriesStack.push(i);\n this.series[i].shadowCanvas._plotDimensions = this._plotDimensions;\n this.series[i].canvas._plotDimensions = this._plotDimensions;\n for (var j=0; j<$.jqplot.preSeriesInitHooks.length; j++) {\n $.jqplot.preSeriesInitHooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);\n }\n for (var j=0; j<this.preSeriesInitHooks.hooks.length; j++) {\n this.preSeriesInitHooks.hooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);\n }\n // this.populatePlotData(this.series[i], i);\n this.series[i]._plotDimensions = this._plotDimensions;\n this.series[i].init(i, this.grid.borderWidth, this);\n for (var j=0; j<$.jqplot.postSeriesInitHooks.length; j++) {\n $.jqplot.postSeriesInitHooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);\n }\n for (var j=0; j<this.postSeriesInitHooks.hooks.length; j++) {\n this.postSeriesInitHooks.hooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);\n }\n this._sumy += this.series[i]._sumy;\n this._sumx += this.series[i]._sumx;\n }\n\n var name,\n axis;\n for (var i=0, l=_axisNames.length; i<l; i++) {\n name = _axisNames[i];\n axis = this.axes[name];\n axis._plotDimensions = this._plotDimensions;\n axis.init();\n if (this.axes[name].borderColor == null) {\n if (name.charAt(0) !== 'x' && axis.useSeriesColor === true && axis.show) {\n axis.borderColor = axis._series[0].color;\n }\n else {\n axis.borderColor = this.grid.borderColor;\n }\n }\n }\n \n if (this.sortData) {\n sortData(this.series);\n }\n this.grid.init();\n this.grid._axes = this.axes;\n \n this.legend._series = this.series;\n\n for (var i=0; i<$.jqplot.postInitHooks.length; i++) {\n $.jqplot.postInitHooks[i].call(this, target, this.data, options);\n }\n\n for (var i=0; i<this.postInitHooks.hooks.length; i++) {\n this.postInitHooks.hooks[i].call(this, target, this.data, options);\n }\n }; \n \n // method: resetAxesScale\n // Reset the specified axes min, max, numberTicks and tickInterval properties to null\n // or reset these properties on all axes if no list of axes is provided.\n //\n // Parameters:\n // axes - Boolean to reset or not reset all axes or an array or object of axis names to reset.\n this.resetAxesScale = function(axes, options) {\n var opts = options || {};\n var ax = axes || this.axes;\n if (ax === true) {\n ax = this.axes;\n }\n if ($.isArray(ax)) {\n for (var i = 0; i < ax.length; i++) {\n this.axes[ax[i]].resetScale(opts[ax[i]]);\n }\n }\n else if (typeof(ax) === 'object') {\n for (var name in ax) {\n this.axes[name].resetScale(opts[name]);\n }\n }\n };\n // method: reInitialize\n // reinitialize plot for replotting.\n // not called directly.\n this.reInitialize = function (data, opts) {\n // Plot should be visible and have a height and width.\n // If plot doesn't have height and width for some\n // reason, set it by other means. Plot must not have\n // a display:none attribute, however.\n\n var options = $.extend(true, {}, this.options, opts);\n\n var target = this.targetId.substr(1);\n var tdata = (data == null) ? this.data : data;\n\n for (var i=0; i<$.jqplot.preInitHooks.length; i++) {\n $.jqplot.preInitHooks[i].call(this, target, tdata, options);\n }\n\n for (var i=0; i<this.preInitHooks.hooks.length; i++) {\n this.preInitHooks.hooks[i].call(this, target, tdata, options);\n }\n \n this._height = this.target.height();\n this._width = this.target.width();\n \n if (this._height <=0 || this._width <=0 || !this._height || !this._width) {\n throw new Error(\"Target dimension not set\");\n }\n \n this._plotDimensions.height = this._height;\n this._plotDimensions.width = this._width;\n this.grid._plotDimensions = this._plotDimensions;\n this.title._plotDimensions = this._plotDimensions;\n this.baseCanvas._plotDimensions = this._plotDimensions;\n this.eventCanvas._plotDimensions = this._plotDimensions;\n this.legend._plotDimensions = this._plotDimensions;\n\n var name,\n t, \n j, \n axis;\n\n for (var i=0, l=_axisNames.length; i<l; i++) {\n name = _axisNames[i];\n axis = this.axes[name];\n\n // Memory Leaks patch : clear ticks elements\n t = axis._ticks;\n for (var j = 0, tlen = t.length; j < tlen; j++) {\n var el = t[j]._elem;\n if (el) {\n // if canvas renderer\n if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) {\n window.G_vmlCanvasManager.uninitElement(el.get(0));\n }\n el.emptyForce();\n el = null;\n t._elem = null;\n }\n }\n t = null;\n\n delete axis.ticks;\n delete axis._ticks;\n this.axes[name] = new Axis(name);\n this.axes[name]._plotWidth = this._width;\n this.axes[name]._plotHeight = this._height;\n }\n \n if (data) {\n if (options.dataRenderer && $.isFunction(options.dataRenderer)) {\n if (options.dataRendererOptions) {\n this.dataRendererOptions = options.dataRendererOptions;\n }\n this.dataRenderer = options.dataRenderer;\n data = this.dataRenderer(data, this, this.dataRendererOptions);\n }\n \n // make a copy of the data\n this.data = $.extend(true, [], data);\n }\n\n if (opts) {\n this.parseOptions(options);\n }\n \n this.title._plotWidth = this._width;\n \n if (this.textColor) {\n this.target.css('color', this.textColor);\n }\n if (this.fontFamily) {\n this.target.css('font-family', this.fontFamily);\n }\n if (this.fontSize) {\n this.target.css('font-size', this.fontSize);\n }\n\n this.title.init();\n this.legend.init();\n this._sumy = 0;\n this._sumx = 0;\n\n this.seriesStack = [];\n this.previousSeriesStack = [];\n\n this.computePlotData();\n for (var i=0, l=this.series.length; i<l; i++) {\n // set default stacking order for series canvases\n this.seriesStack.push(i);\n this.previousSeriesStack.push(i);\n this.series[i].shadowCanvas._plotDimensions = this._plotDimensions;\n this.series[i].canvas._plotDimensions = this._plotDimensions;\n for (var j=0; j<$.jqplot.preSeriesInitHooks.length; j++) {\n $.jqplot.preSeriesInitHooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);\n }\n for (var j=0; j<this.preSeriesInitHooks.hooks.length; j++) {\n this.preSeriesInitHooks.hooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);\n }\n // this.populatePlotData(this.series[i], i);\n this.series[i]._plotDimensions = this._plotDimensions;\n this.series[i].init(i, this.grid.borderWidth, this);\n for (var j=0; j<$.jqplot.postSeriesInitHooks.length; j++) {\n $.jqplot.postSeriesInitHooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);\n }\n for (var j=0; j<this.postSeriesInitHooks.hooks.length; j++) {\n this.postSeriesInitHooks.hooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);\n }\n this._sumy += this.series[i]._sumy;\n this._sumx += this.series[i]._sumx;\n }\n\n for (var i=0, l=_axisNames.length; i<l; i++) {\n name = _axisNames[i];\n axis = this.axes[name];\n\n axis._plotDimensions = this._plotDimensions;\n axis.init();\n if (axis.borderColor == null) {\n if (name.charAt(0) !== 'x' && axis.useSeriesColor === true && axis.show) {\n axis.borderColor = axis._series[0].color;\n }\n else {\n axis.borderColor = this.grid.borderColor;\n }\n }\n }\n \n if (this.sortData) {\n sortData(this.series);\n }\n this.grid.init();\n this.grid._axes = this.axes;\n \n this.legend._series = this.series;\n\n for (var i=0, l=$.jqplot.postInitHooks.length; i<l; i++) {\n $.jqplot.postInitHooks[i].call(this, target, this.data, options);\n }\n\n for (var i=0, l=this.postInitHooks.hooks.length; i<l; i++) {\n this.postInitHooks.hooks[i].call(this, target, this.data, options);\n }\n };\n\n\n\n // method: quickInit\n // \n // Quick reinitialization plot for replotting.\n // Does not parse options ore recreate axes and series.\n // not called directly.\n this.quickInit = function () {\n // Plot should be visible and have a height and width.\n // If plot doesn't have height and width for some\n // reason, set it by other means. Plot must not have\n // a display:none attribute, however.\n \n this._height = this.target.height();\n this._width = this.target.width();\n \n if (this._height <=0 || this._width <=0 || !this._height || !this._width) {\n throw new Error(\"Target dimension not set\");\n }\n \n this._plotDimensions.height = this._height;\n this._plotDimensions.width = this._width;\n this.grid._plotDimensions = this._plotDimensions;\n this.title._plotDimensions = this._plotDimensions;\n this.baseCanvas._plotDimensions = this._plotDimensions;\n this.eventCanvas._plotDimensions = this._plotDimensions;\n this.legend._plotDimensions = this._plotDimensions;\n \n for (var n in this.axes) {\n this.axes[n]._plotWidth = this._width;\n this.axes[n]._plotHeight = this._height;\n }\n \n this.title._plotWidth = this._width;\n \n if (this.textColor) {\n this.target.css('color', this.textColor);\n }\n if (this.fontFamily) {\n this.target.css('font-family', this.fontFamily);\n }\n if (this.fontSize) {\n this.target.css('font-size', this.fontSize);\n }\n \n this._sumy = 0;\n this._sumx = 0;\n this.computePlotData();\n for (var i=0; i<this.series.length; i++) {\n // this.populatePlotData(this.series[i], i);\n if (this.series[i]._type === 'line' && this.series[i].renderer.bands.show) {\n this.series[i].renderer.initBands.call(this.series[i], this.series[i].renderer.options, this);\n }\n this.series[i]._plotDimensions = this._plotDimensions;\n this.series[i].canvas._plotDimensions = this._plotDimensions;\n //this.series[i].init(i, this.grid.borderWidth);\n this._sumy += this.series[i]._sumy;\n this._sumx += this.series[i]._sumx;\n }\n\n var name;\n \n for (var j=0; j<12; j++) {\n name = _axisNames[j];\n // Memory Leaks patch : clear ticks elements\n var t = this.axes[name]._ticks;\n for (var i = 0; i < t.length; i++) {\n var el = t[i]._elem;\n if (el) {\n // if canvas renderer\n if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) {\n window.G_vmlCanvasManager.uninitElement(el.get(0));\n }\n el.emptyForce();\n el = null;\n t._elem = null;\n }\n }\n t = null;\n \n this.axes[name]._plotDimensions = this._plotDimensions;\n this.axes[name]._ticks = [];\n // this.axes[name].renderer.init.call(this.axes[name], {});\n }\n \n if (this.sortData) {\n sortData(this.series);\n }\n \n this.grid._axes = this.axes;\n \n this.legend._series = this.series;\n };\n \n // sort the series data in increasing order.\n function sortData(series) {\n var d, sd, pd, ppd, ret;\n for (var i=0; i<series.length; i++) {\n var check;\n var bat = [series[i].data, series[i]._stackData, series[i]._plotData, series[i]._prevPlotData];\n for (var n=0; n<4; n++) {\n check = true;\n d = bat[n];\n if (series[i]._stackAxis == 'x') {\n for (var j = 0; j < d.length; j++) {\n if (typeof(d[j][1]) != \"number\") {\n check = false;\n break;\n }\n }\n if (check) {\n d.sort(function(a,b) { return a[1] - b[1]; });\n }\n }\n else {\n for (var j = 0; j < d.length; j++) {\n if (typeof(d[j][0]) != \"number\") {\n check = false;\n break;\n }\n }\n if (check) {\n d.sort(function(a,b) { return a[0] - b[0]; });\n }\n }\n }\n \n }\n }\n\n this.computePlotData = function() {\n this._plotData = [];\n this._stackData = [];\n var series,\n index,\n l;\n\n\n for (index=0, l=this.series.length; index<l; index++) {\n series = this.series[index];\n this._plotData.push([]);\n this._stackData.push([]);\n var cd = series.data;\n this._plotData[index] = $.extend(true, [], cd);\n this._stackData[index] = $.extend(true, [], cd);\n series._plotData = this._plotData[index];\n series._stackData = this._stackData[index];\n var plotValues = {x:[], y:[]};\n\n if (this.stackSeries && !series.disableStack) {\n series._stack = true;\n ///////////////////////////\n // have to check for nulls\n ///////////////////////////\n var sidx = (series._stackAxis === 'x') ? 0 : 1;\n\n for (var k=0, cdl=cd.length; k<cdl; k++) {\n var temp = cd[k][sidx];\n if (temp == null) {\n temp = 0;\n }\n this._plotData[index][k][sidx] = temp;\n this._stackData[index][k][sidx] = temp;\n\n if (index > 0) {\n for (var j=index; j--;) {\n var prevval = this._plotData[j][k][sidx];\n // only need to sum up the stack axis column of data\n // and only sum if it is of same sign.\n // if previous series isn't same sign, keep looking\n // at earlier series untill we find one of same sign.\n if (temp * prevval >= 0) {\n this._plotData[index][k][sidx] += prevval;\n this._stackData[index][k][sidx] += prevval;\n break;\n } \n }\n }\n }\n\n }\n else {\n for (var i=0; i<series.data.length; i++) {\n plotValues.x.push(series.data[i][0]);\n plotValues.y.push(series.data[i][1]);\n }\n this._stackData.push(series.data);\n this.series[index]._stackData = series.data;\n this._plotData.push(series.data);\n series._plotData = series.data;\n series._plotValues = plotValues;\n }\n if (index>0) {\n series._prevPlotData = this.series[index-1]._plotData;\n }\n series._sumy = 0;\n series._sumx = 0;\n for (i=series.data.length-1; i>-1; i--) {\n series._sumy += series.data[i][1];\n series._sumx += series.data[i][0];\n }\n }\n\n };\n \n // populate the _stackData and _plotData arrays for the plot and the series.\n this.populatePlotData = function(series, index) {\n // if a stacked chart, compute the stacked data\n this._plotData = [];\n this._stackData = [];\n series._stackData = [];\n series._plotData = [];\n var plotValues = {x:[], y:[]};\n if (this.stackSeries && !series.disableStack) {\n series._stack = true;\n var sidx = (series._stackAxis === 'x') ? 0 : 1;\n // var idx = sidx ? 0 : 1;\n // push the current data into stackData\n //this._stackData.push(this.series[i].data);\n var temp = $.extend(true, [], series.data);\n // create the data that will be plotted for this series\n var plotdata = $.extend(true, [], series.data);\n var tempx, tempy, dval, stackval, comparator;\n // for first series, nothing to add to stackData.\n for (var j=0; j<index; j++) {\n var cd = this.series[j].data;\n for (var k=0; k<cd.length; k++) {\n dval = cd[k];\n tempx = (dval[0] != null) ? dval[0] : 0;\n tempy = (dval[1] != null) ? dval[1] : 0;\n temp[k][0] += tempx;\n temp[k][1] += tempy;\n stackval = (sidx) ? tempy : tempx;\n // only need to sum up the stack axis column of data\n // and only sum if it is of same sign.\n if (series.data[k][sidx] * stackval >= 0) {\n plotdata[k][sidx] += stackval;\n }\n }\n }\n for (var i=0; i<plotdata.length; i++) {\n plotValues.x.push(plotdata[i][0]);\n plotValues.y.push(plotdata[i][1]);\n }\n this._plotData.push(plotdata);\n this._stackData.push(temp);\n series._stackData = temp;\n series._plotData = plotdata;\n series._plotValues = plotValues;\n }\n else {\n for (var i=0; i<series.data.length; i++) {\n plotValues.x.push(series.data[i][0]);\n plotValues.y.push(series.data[i][1]);\n }\n this._stackData.push(series.data);\n this.series[index]._stackData = series.data;\n this._plotData.push(series.data);\n series._plotData = series.data;\n series._plotValues = plotValues;\n }\n if (index>0) {\n series._prevPlotData = this.series[index-1]._plotData;\n }\n series._sumy = 0;\n series._sumx = 0;\n for (i=series.data.length-1; i>-1; i--) {\n series._sumy += series.data[i][1];\n series._sumx += series.data[i][0];\n }\n };\n \n // function to safely return colors from the color array and wrap around at the end.\n this.getNextSeriesColor = (function(t) {\n var idx = 0;\n var sc = t.seriesColors;\n \n return function () { \n if (idx < sc.length) {\n return sc[idx++];\n }\n else {\n idx = 0;\n return sc[idx++];\n }\n };\n })(this);\n \n this.parseOptions = function(options){\n for (var i=0; i<this.preParseOptionsHooks.hooks.length; i++) {\n this.preParseOptionsHooks.hooks[i].call(this, options);\n }\n for (var i=0; i<$.jqplot.preParseOptionsHooks.length; i++) {\n $.jqplot.preParseOptionsHooks[i].call(this, options);\n }\n this.options = $.extend(true, {}, this.defaults, options);\n var opts = this.options;\n this.animate = opts.animate;\n this.animateReplot = opts.animateReplot;\n this.stackSeries = opts.stackSeries;\n if ($.isPlainObject(opts.fillBetween)) {\n\n var temp = ['series1', 'series2', 'color', 'baseSeries', 'fill'], \n tempi;\n\n for (var i=0, l=temp.length; i<l; i++) {\n tempi = temp[i];\n if (opts.fillBetween[tempi] != null) {\n this.fillBetween[tempi] = opts.fillBetween[tempi];\n }\n }\n }\n\n if (opts.seriesColors) {\n this.seriesColors = opts.seriesColors;\n }\n if (opts.negativeSeriesColors) {\n this.negativeSeriesColors = opts.negativeSeriesColors;\n }\n if (opts.captureRightClick) {\n this.captureRightClick = opts.captureRightClick;\n }\n this.defaultAxisStart = (options && options.defaultAxisStart != null) ? options.defaultAxisStart : this.defaultAxisStart;\n this.colorGenerator.setColors(this.seriesColors);\n this.negativeColorGenerator.setColors(this.negativeSeriesColors);\n // var cg = new this.colorGenerator(this.seriesColors);\n // var ncg = new this.colorGenerator(this.negativeSeriesColors);\n // this._gridPadding = this.options.gridPadding;\n $.extend(true, this._gridPadding, opts.gridPadding);\n this.sortData = (opts.sortData != null) ? opts.sortData : this.sortData;\n for (var i=0; i<12; i++) {\n var n = _axisNames[i];\n var axis = this.axes[n];\n axis._options = $.extend(true, {}, opts.axesDefaults, opts.axes[n]);\n $.extend(true, axis, opts.axesDefaults, opts.axes[n]);\n axis._plotWidth = this._width;\n axis._plotHeight = this._height;\n }\n // if (this.data.length == 0) {\n // this.data = [];\n // for (var i=0; i<this.options.series.length; i++) {\n // this.data.push(this.options.series.data);\n // } \n // }\n \n var normalizeData = function(data, dir, start) {\n // return data as an array of point arrays,\n // in form [[x1,y1...], [x2,y2...], ...]\n var temp = [];\n var i, l;\n dir = dir || 'vertical';\n if (!$.isArray(data[0])) {\n // we have a series of scalars. One line with just y values.\n // turn the scalar list of data into a data array of form:\n // [[1, data[0]], [2, data[1]], ...]\n for (i=0, l=data.length; i<l; i++) {\n if (dir == 'vertical') {\n temp.push([start + i, data[i]]); \n }\n else {\n temp.push([data[i], start+i]);\n }\n }\n } \n else {\n // we have a properly formatted data series, copy it.\n $.extend(true, temp, data);\n }\n return temp;\n };\n\n var colorIndex = 0;\n this.series = [];\n for (var i=0; i<this.data.length; i++) {\n var sopts = $.extend(true, {index: i}, {seriesColors:this.seriesColors, negativeSeriesColors:this.negativeSeriesColors}, this.options.seriesDefaults, this.options.series[i], {rendererOptions:{animation:{show: this.animate}}});\n // pass in options in case something needs set prior to initialization.\n var temp = new Series(sopts);\n for (var j=0; j<$.jqplot.preParseSeriesOptionsHooks.length; j++) {\n $.jqplot.preParseSeriesOptionsHooks[j].call(temp, this.options.seriesDefaults, this.options.series[i]);\n }\n for (var j=0; j<this.preParseSeriesOptionsHooks.hooks.length; j++) {\n this.preParseSeriesOptionsHooks.hooks[j].call(temp, this.options.seriesDefaults, this.options.series[i]);\n }\n // Now go back and apply the options to the series. Really should just do this during initializaiton, but don't want to\n // mess up preParseSeriesOptionsHooks at this point.\n $.extend(true, temp, sopts);\n var dir = 'vertical';\n if (temp.renderer === $.jqplot.BarRenderer && temp.rendererOptions && temp.rendererOptions.barDirection == 'horizontal') {\n dir = 'horizontal';\n temp._stackAxis = 'x';\n temp._primaryAxis = '_yaxis';\n }\n temp.data = normalizeData(this.data[i], dir, this.defaultAxisStart);\n switch (temp.xaxis) {\n case 'xaxis':\n temp._xaxis = this.axes.xaxis;\n break;\n case 'x2axis':\n temp._xaxis = this.axes.x2axis;\n break;\n default:\n break;\n }\n temp._yaxis = this.axes[temp.yaxis];\n temp._xaxis._series.push(temp);\n temp._yaxis._series.push(temp);\n if (temp.show) {\n temp._xaxis.show = true;\n temp._yaxis.show = true;\n }\n else {\n if (temp._xaxis.scaleToHiddenSeries) {\n temp._xaxis.show = true;\n }\n if (temp._yaxis.scaleToHiddenSeries) {\n temp._yaxis.show = true;\n }\n }\n\n // // parse the renderer options and apply default colors if not provided\n // if (!temp.color && temp.show != false) {\n // temp.color = cg.next();\n // colorIndex = cg.getIndex() - 1;;\n // }\n // if (!temp.negativeColor && temp.show != false) {\n // temp.negativeColor = ncg.get(colorIndex);\n // ncg.setIndex(colorIndex);\n // }\n if (!temp.label) {\n temp.label = 'Series '+ (i+1).toString();\n }\n // temp.rendererOptions.show = temp.show;\n // $.extend(true, temp.renderer, {color:this.seriesColors[i]}, this.rendererOptions);\n this.series.push(temp); \n for (var j=0; j<$.jqplot.postParseSeriesOptionsHooks.length; j++) {\n $.jqplot.postParseSeriesOptionsHooks[j].call(this.series[i], this.options.seriesDefaults, this.options.series[i]);\n }\n for (var j=0; j<this.postParseSeriesOptionsHooks.hooks.length; j++) {\n this.postParseSeriesOptionsHooks.hooks[j].call(this.series[i], this.options.seriesDefaults, this.options.series[i]);\n }\n }\n \n // copy the grid and title options into this object.\n $.extend(true, this.grid, this.options.grid);\n // if axis border properties aren't set, set default.\n for (var i=0, l=_axisNames.length; i<l; i++) {\n var n = _axisNames[i];\n var axis = this.axes[n];\n if (axis.borderWidth == null) {\n axis.borderWidth =this.grid.borderWidth;\n }\n }\n \n if (typeof this.options.title == 'string') {\n this.title.text = this.options.title;\n }\n else if (typeof this.options.title == 'object') {\n $.extend(true, this.title, this.options.title);\n }\n this.title._plotWidth = this._width;\n this.legend.setOptions(this.options.legend);\n \n for (var i=0; i<$.jqplot.postParseOptionsHooks.length; i++) {\n $.jqplot.postParseOptionsHooks[i].call(this, options);\n }\n for (var i=0; i<this.postParseOptionsHooks.hooks.length; i++) {\n this.postParseOptionsHooks.hooks[i].call(this, options);\n }\n };\n \n // method: destroy\n // Releases all resources occupied by the plot\n this.destroy = function() {\n this.canvasManager.freeAllCanvases();\n if (this.eventCanvas && this.eventCanvas._elem) {\n this.eventCanvas._elem.unbind();\n }\n // Couple of posts on Stack Overflow indicate that empty() doesn't\n // always cear up the dom and release memory. Sometimes setting\n // innerHTML property to null is needed. Particularly on IE, may \n // have to directly set it to null, bypassing $.\n this.target.empty();\n\n this.target[0].innerHTML = '';\n };\n \n // method: replot\n // Does a reinitialization of the plot followed by\n // a redraw. Method could be used to interactively\n // change plot characteristics and then replot.\n //\n // Parameters:\n // options - Options used for replotting.\n //\n // Properties:\n // clear - false to not clear (empty) the plot container before replotting (default: true).\n // resetAxes - true to reset all axes min, max, numberTicks and tickInterval setting so axes will rescale themselves.\n // optionally pass in list of axes to reset (e.g. ['xaxis', 'y2axis']) (default: false).\n this.replot = function(options) {\n var opts = options || {};\n var data = opts.data || null;\n var clear = (opts.clear === false) ? false : true;\n var resetAxes = opts.resetAxes || false;\n delete opts.data;\n delete opts.clear;\n delete opts.resetAxes;\n\n this.target.trigger('jqplotPreReplot');\n \n if (clear) {\n this.destroy();\n }\n // if have data or other options, full reinit.\n // otherwise, quickinit.\n if (data || !$.isEmptyObject(opts)) {\n this.reInitialize(data, opts);\n }\n else {\n this.quickInit();\n }\n\n if (resetAxes) {\n this.resetAxesScale(resetAxes, opts.axes);\n }\n this.draw();\n this.target.trigger('jqplotPostReplot');\n };\n \n // method: redraw\n // Empties the plot target div and redraws the plot.\n // This enables plot data and properties to be changed\n // and then to comletely clear the plot and redraw.\n // redraw *will not* reinitialize any plot elements.\n // That is, axes will not be autoscaled and defaults\n // will not be reapplied to any plot elements. redraw\n // is used primarily with zooming. \n //\n // Parameters:\n // clear - false to not clear (empty) the plot container before redrawing (default: true).\n this.redraw = function(clear) {\n clear = (clear != null) ? clear : true;\n this.target.trigger('jqplotPreRedraw');\n if (clear) {\n this.canvasManager.freeAllCanvases();\n this.eventCanvas._elem.unbind();\n // Dont think I bind any events to the target, this shouldn't be necessary.\n // It will remove user's events.\n // this.target.unbind();\n this.target.empty();\n }\n for (var ax in this.axes) {\n this.axes[ax]._ticks = [];\n }\n this.computePlotData();\n // for (var i=0; i<this.series.length; i++) {\n // this.populatePlotData(this.series[i], i);\n // }\n this._sumy = 0;\n this._sumx = 0;\n for (var i=0, tsl = this.series.length; i<tsl; i++) {\n this._sumy += this.series[i]._sumy;\n this._sumx += this.series[i]._sumx;\n }\n this.draw();\n this.target.trigger('jqplotPostRedraw');\n };\n \n // method: draw\n // Draws all elements of the plot into the container.\n // Does not clear the container before drawing.\n this.draw = function(){\n if (this.drawIfHidden || this.target.is(':visible')) {\n this.target.trigger('jqplotPreDraw');\n var i,\n j,\n l,\n tempseries;\n for (i=0, l=$.jqplot.preDrawHooks.length; i<l; i++) {\n $.jqplot.preDrawHooks[i].call(this);\n }\n for (i=0, l=this.preDrawHooks.hooks.length; i<l; i++) {\n this.preDrawHooks.hooks[i].apply(this, this.preDrawSeriesHooks.args[i]);\n }\n // create an underlying canvas to be used for special features.\n this.target.append(this.baseCanvas.createElement({left:0, right:0, top:0, bottom:0}, 'jqplot-base-canvas', null, this));\n this.baseCanvas.setContext();\n this.target.append(this.title.draw());\n this.title.pack({top:0, left:0});\n \n // make room for the legend between the grid and the edge.\n // pass a dummy offsets object and a reference to the plot.\n var legendElem = this.legend.draw({}, this);\n \n var gridPadding = {top:0, left:0, bottom:0, right:0};\n \n if (this.legend.placement == \"outsideGrid\") {\n // temporarily append the legend to get dimensions\n this.target.append(legendElem);\n switch (this.legend.location) {\n case 'n':\n gridPadding.top += this.legend.getHeight();\n break;\n case 's':\n gridPadding.bottom += this.legend.getHeight();\n break;\n case 'ne':\n case 'e':\n case 'se':\n gridPadding.right += this.legend.getWidth();\n break;\n case 'nw':\n case 'w':\n case 'sw':\n gridPadding.left += this.legend.getWidth();\n break;\n default: // same as 'ne'\n gridPadding.right += this.legend.getWidth();\n break;\n }\n legendElem = legendElem.detach();\n }\n \n var ax = this.axes;\n var name;\n // draw the yMidAxis first, so xaxis of pyramid chart can adjust itself if needed.\n for (i=0; i<12; i++) {\n name = _axisNames[i];\n this.target.append(ax[name].draw(this.baseCanvas._ctx, this));\n ax[name].set();\n }\n if (ax.yaxis.show) {\n gridPadding.left += ax.yaxis.getWidth();\n }\n var ra = ['y2axis', 'y3axis', 'y4axis', 'y5axis', 'y6axis', 'y7axis', 'y8axis', 'y9axis'];\n var rapad = [0, 0, 0, 0, 0, 0, 0, 0];\n var gpr = 0;\n var n;\n for (n=0; n<8; n++) {\n if (ax[ra[n]].show) {\n gpr += ax[ra[n]].getWidth();\n rapad[n] = gpr;\n }\n }\n gridPadding.right += gpr;\n if (ax.x2axis.show) {\n gridPadding.top += ax.x2axis.getHeight();\n }\n if (this.title.show) {\n gridPadding.top += this.title.getHeight();\n }\n if (ax.xaxis.show) {\n gridPadding.bottom += ax.xaxis.getHeight();\n }\n \n // end of gridPadding adjustments.\n\n // if user passed in gridDimensions option, check against calculated gridPadding\n if (this.options.gridDimensions && $.isPlainObject(this.options.gridDimensions)) {\n var gdw = parseInt(this.options.gridDimensions.width, 10) || 0;\n var gdh = parseInt(this.options.gridDimensions.height, 10) || 0;\n var widthAdj = (this._width - gridPadding.left - gridPadding.right - gdw)/2;\n var heightAdj = (this._height - gridPadding.top - gridPadding.bottom - gdh)/2;\n\n if (heightAdj >= 0 && widthAdj >= 0) {\n gridPadding.top += heightAdj;\n gridPadding.bottom += heightAdj;\n gridPadding.left += widthAdj;\n gridPadding.right += widthAdj;\n }\n }\n var arr = ['top', 'bottom', 'left', 'right'];\n for (var n in arr) {\n if (this._gridPadding[arr[n]] == null && gridPadding[arr[n]] > 0) {\n this._gridPadding[arr[n]] = gridPadding[arr[n]];\n }\n else if (this._gridPadding[arr[n]] == null) {\n this._gridPadding[arr[n]] = this._defaultGridPadding[arr[n]];\n }\n }\n \n var legendPadding = this._gridPadding;\n \n if (this.legend.placement === 'outsideGrid') {\n legendPadding = {top:this.title.getHeight(), left: 0, right: 0, bottom: 0};\n if (this.legend.location === 's') {\n legendPadding.left = this._gridPadding.left;\n legendPadding.right = this._gridPadding.right;\n }\n }\n \n ax.xaxis.pack({position:'absolute', bottom:this._gridPadding.bottom - ax.xaxis.getHeight(), left:0, width:this._width}, {min:this._gridPadding.left, max:this._width - this._gridPadding.right});\n ax.yaxis.pack({position:'absolute', top:0, left:this._gridPadding.left - ax.yaxis.getWidth(), height:this._height}, {min:this._height - this._gridPadding.bottom, max: this._gridPadding.top});\n ax.x2axis.pack({position:'absolute', top:this._gridPadding.top - ax.x2axis.getHeight(), left:0, width:this._width}, {min:this._gridPadding.left, max:this._width - this._gridPadding.right});\n for (i=8; i>0; i--) {\n ax[ra[i-1]].pack({position:'absolute', top:0, right:this._gridPadding.right - rapad[i-1]}, {min:this._height - this._gridPadding.bottom, max: this._gridPadding.top});\n }\n var ltemp = (this._width - this._gridPadding.left - this._gridPadding.right)/2.0 + this._gridPadding.left - ax.yMidAxis.getWidth()/2.0;\n ax.yMidAxis.pack({position:'absolute', top:0, left:ltemp, zIndex:9, textAlign: 'center'}, {min:this._height - this._gridPadding.bottom, max: this._gridPadding.top});\n \n this.target.append(this.grid.createElement(this._gridPadding, this));\n this.grid.draw();\n \n var series = this.series;\n var seriesLength = series.length;\n // put the shadow canvases behind the series canvases so shadows don't overlap on stacked bars.\n for (i=0, l=seriesLength; i<l; i++) {\n // draw series in order of stacking. This affects only\n // order in which canvases are added to dom.\n j = this.seriesStack[i];\n this.target.append(series[j].shadowCanvas.createElement(this._gridPadding, 'jqplot-series-shadowCanvas', null, this));\n series[j].shadowCanvas.setContext();\n series[j].shadowCanvas._elem.data('seriesIndex', j);\n }\n \n for (i=0, l=seriesLength; i<l; i++) {\n // draw series in order of stacking. This affects only\n // order in which canvases are added to dom.\n j = this.seriesStack[i];\n this.target.append(series[j].canvas.createElement(this._gridPadding, 'jqplot-series-canvas', null, this));\n series[j].canvas.setContext();\n series[j].canvas._elem.data('seriesIndex', j);\n }\n // Need to use filled canvas to capture events in IE.\n // Also, canvas seems to block selection of other elements in document on FF.\n this.target.append(this.eventCanvas.createElement(this._gridPadding, 'jqplot-event-canvas', null, this));\n this.eventCanvas.setContext();\n this.eventCanvas._ctx.fillStyle = 'rgba(0,0,0,0)';\n this.eventCanvas._ctx.fillRect(0,0,this.eventCanvas._ctx.canvas.width, this.eventCanvas._ctx.canvas.height);\n \n // bind custom event handlers to regular events.\n this.bindCustomEvents();\n \n // draw legend before series if the series needs to know the legend dimensions.\n if (this.legend.preDraw) { \n this.eventCanvas._elem.before(legendElem);\n this.legend.pack(legendPadding);\n if (this.legend._elem) {\n this.drawSeries({legendInfo:{location:this.legend.location, placement:this.legend.placement, width:this.legend.getWidth(), height:this.legend.getHeight(), xoffset:this.legend.xoffset, yoffset:this.legend.yoffset}});\n }\n else {\n this.drawSeries();\n }\n }\n else { // draw series before legend\n this.drawSeries();\n if (seriesLength) {\n $(series[seriesLength-1].canvas._elem).after(legendElem);\n }\n this.legend.pack(legendPadding); \n }\n \n // register event listeners on the overlay canvas\n for (var i=0, l=$.jqplot.eventListenerHooks.length; i<l; i++) {\n // in the handler, this will refer to the eventCanvas dom element.\n // make sure there are references back into plot objects.\n this.eventCanvas._elem.bind($.jqplot.eventListenerHooks[i][0], {plot:this}, $.jqplot.eventListenerHooks[i][1]);\n }\n \n // register event listeners on the overlay canvas\n for (var i=0, l=this.eventListenerHooks.hooks.length; i<l; i++) {\n // in the handler, this will refer to the eventCanvas dom element.\n // make sure there are references back into plot objects.\n this.eventCanvas._elem.bind(this.eventListenerHooks.hooks[i][0], {plot:this}, this.eventListenerHooks.hooks[i][1]);\n }\n\n var fb = this.fillBetween;\n if (fb.fill && fb.series1 !== fb.series2 && fb.series1 < seriesLength && fb.series2 < seriesLength && series[fb.series1]._type === 'line' && series[fb.series2]._type === 'line') {\n this.doFillBetweenLines();\n }\n\n for (var i=0, l=$.jqplot.postDrawHooks.length; i<l; i++) {\n $.jqplot.postDrawHooks[i].call(this);\n }\n\n for (var i=0, l=this.postDrawHooks.hooks.length; i<l; i++) {\n this.postDrawHooks.hooks[i].apply(this, this.postDrawHooks.args[i]);\n }\n \n if (this.target.is(':visible')) {\n this._drawCount += 1;\n }\n\n var temps, \n tempr,\n sel,\n _els;\n // ughh. ideally would hide all series then show them.\n for (i=0, l=seriesLength; i<l; i++) {\n temps = series[i];\n tempr = temps.renderer;\n sel = '.jqplot-point-label.jqplot-series-'+i;\n if (tempr.animation && tempr.animation._supported && tempr.animation.show && (this._drawCount < 2 || this.animateReplot)) {\n _els = this.target.find(sel);\n _els.stop(true, true).hide();\n temps.canvas._elem.stop(true, true).hide();\n temps.shadowCanvas._elem.stop(true, true).hide();\n temps.canvas._elem.jqplotEffect('blind', {mode: 'show', direction: tempr.animation.direction}, tempr.animation.speed);\n temps.shadowCanvas._elem.jqplotEffect('blind', {mode: 'show', direction: tempr.animation.direction}, tempr.animation.speed);\n _els.fadeIn(tempr.animation.speed*0.8);\n }\n }\n _els = null;\n \n this.target.trigger('jqplotPostDraw', [this]);\n }\n };\n\n jqPlot.prototype.doFillBetweenLines = function () {\n var fb = this.fillBetween;\n var sid1 = fb.series1;\n var sid2 = fb.series2;\n // first series should always be lowest index\n var id1 = (sid1 < sid2) ? sid1 : sid2;\n var id2 = (sid2 > sid1) ? sid2 : sid1;\n\n var series1 = this.series[id1];\n var series2 = this.series[id2];\n\n if (series2.renderer.smooth) {\n var tempgd = series2.renderer._smoothedData.slice(0).reverse();\n }\n else {\n var tempgd = series2.gridData.slice(0).reverse();\n }\n\n if (series1.renderer.smooth) {\n var gd = series1.renderer._smoothedData.concat(tempgd);\n }\n else {\n var gd = series1.gridData.concat(tempgd);\n }\n\n var color = (fb.color !== null) ? fb.color : this.series[sid1].fillColor;\n var baseSeries = (fb.baseSeries !== null) ? fb.baseSeries : id1;\n\n // now apply a fill to the shape on the lower series shadow canvas,\n // so it is behind both series.\n var sr = this.series[baseSeries].renderer.shapeRenderer;\n var opts = {fillStyle: color, fill: true, closePath: true};\n sr.draw(series1.shadowCanvas._ctx, gd, opts);\n };\n \n this.bindCustomEvents = function() {\n this.eventCanvas._elem.bind('click', {plot:this}, this.onClick);\n this.eventCanvas._elem.bind('dblclick', {plot:this}, this.onDblClick);\n this.eventCanvas._elem.bind('mousedown', {plot:this}, this.onMouseDown);\n this.eventCanvas._elem.bind('mousemove', {plot:this}, this.onMouseMove);\n this.eventCanvas._elem.bind('mouseenter', {plot:this}, this.onMouseEnter);\n this.eventCanvas._elem.bind('mouseleave', {plot:this}, this.onMouseLeave);\n if (this.captureRightClick) {\n this.eventCanvas._elem.bind('mouseup', {plot:this}, this.onRightClick);\n this.eventCanvas._elem.get(0).oncontextmenu = function() {\n return false;\n };\n }\n else {\n this.eventCanvas._elem.bind('mouseup', {plot:this}, this.onMouseUp);\n }\n };\n \n function getEventPosition(ev) {\n var plot = ev.data.plot;\n var go = plot.eventCanvas._elem.offset();\n var gridPos = {x:ev.pageX - go.left, y:ev.pageY - go.top};\n var dataPos = {xaxis:null, yaxis:null, x2axis:null, y2axis:null, y3axis:null, y4axis:null, y5axis:null, y6axis:null, y7axis:null, y8axis:null, y9axis:null, yMidAxis:null};\n var an = ['xaxis', 'yaxis', 'x2axis', 'y2axis', 'y3axis', 'y4axis', 'y5axis', 'y6axis', 'y7axis', 'y8axis', 'y9axis', 'yMidAxis'];\n var ax = plot.axes;\n var n, axis;\n for (n=11; n>0; n--) {\n axis = an[n-1];\n if (ax[axis].show) {\n dataPos[axis] = ax[axis].series_p2u(gridPos[axis.charAt(0)]);\n }\n }\n\n return {offsets:go, gridPos:gridPos, dataPos:dataPos};\n }\n \n \n // function to check if event location is over a area area\n function checkIntersection(gridpos, plot) {\n var series = plot.series;\n var i, j, k, s, r, x, y, theta, sm, sa, minang, maxang;\n var d0, d, p, pp, points, bw, hp;\n var threshold, t;\n for (k=plot.seriesStack.length-1; k>=0; k--) {\n i = plot.seriesStack[k];\n s = series[i];\n hp = s._highlightThreshold;\n switch (s.renderer.constructor) {\n case $.jqplot.BarRenderer:\n x = gridpos.x;\n y = gridpos.y;\n for (j=0; j<s._barPoints.length; j++) {\n points = s._barPoints[j];\n p = s.gridData[j];\n if (x>points[0][0] && x<points[2][0] && y>points[2][1] && y<points[0][1]) {\n return {seriesIndex:s.index, pointIndex:j, gridData:p, data:s.data[j], points:s._barPoints[j]};\n }\n }\n break;\n case $.jqplot.PyramidRenderer:\n x = gridpos.x;\n y = gridpos.y;\n for (j=0; j<s._barPoints.length; j++) {\n points = s._barPoints[j];\n p = s.gridData[j];\n if (x > points[0][0] + hp[0][0] && x < points[2][0] + hp[2][0] && y > points[2][1] && y < points[0][1]) {\n return {seriesIndex:s.index, pointIndex:j, gridData:p, data:s.data[j], points:s._barPoints[j]};\n }\n }\n break;\n \n case $.jqplot.DonutRenderer:\n sa = s.startAngle/180*Math.PI;\n x = gridpos.x - s._center[0];\n y = gridpos.y - s._center[1];\n r = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));\n if (x > 0 && -y >= 0) {\n theta = 2*Math.PI - Math.atan(-y/x);\n }\n else if (x > 0 && -y < 0) {\n theta = -Math.atan(-y/x);\n }\n else if (x < 0) {\n theta = Math.PI - Math.atan(-y/x);\n }\n else if (x == 0 && -y > 0) {\n theta = 3*Math.PI/2;\n }\n else if (x == 0 && -y < 0) {\n theta = Math.PI/2;\n }\n else if (x == 0 && y == 0) {\n theta = 0;\n }\n if (sa) {\n theta -= sa;\n if (theta < 0) {\n theta += 2*Math.PI;\n }\n else if (theta > 2*Math.PI) {\n theta -= 2*Math.PI;\n }\n }\n \n sm = s.sliceMargin/180*Math.PI;\n if (r < s._radius && r > s._innerRadius) {\n for (j=0; j<s.gridData.length; j++) {\n minang = (j>0) ? s.gridData[j-1][1]+sm : sm;\n maxang = s.gridData[j][1];\n if (theta > minang && theta < maxang) {\n return {seriesIndex:s.index, pointIndex:j, gridData:[gridpos.x,gridpos.y], data:s.data[j]};\n }\n }\n }\n break;\n \n case $.jqplot.PieRenderer:\n sa = s.startAngle/180*Math.PI;\n x = gridpos.x - s._center[0];\n y = gridpos.y - s._center[1];\n r = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));\n if (x > 0 && -y >= 0) {\n theta = 2*Math.PI - Math.atan(-y/x);\n }\n else if (x > 0 && -y < 0) {\n theta = -Math.atan(-y/x);\n }\n else if (x < 0) {\n theta = Math.PI - Math.atan(-y/x);\n }\n else if (x == 0 && -y > 0) {\n theta = 3*Math.PI/2;\n }\n else if (x == 0 && -y < 0) {\n theta = Math.PI/2;\n }\n else if (x == 0 && y == 0) {\n theta = 0;\n }\n if (sa) {\n theta -= sa;\n if (theta < 0) {\n theta += 2*Math.PI;\n }\n else if (theta > 2*Math.PI) {\n theta -= 2*Math.PI;\n }\n }\n \n sm = s.sliceMargin/180*Math.PI;\n if (r < s._radius) {\n for (j=0; j<s.gridData.length; j++) {\n minang = (j>0) ? s.gridData[j-1][1]+sm : sm;\n maxang = s.gridData[j][1];\n if (theta > minang && theta < maxang) {\n return {seriesIndex:s.index, pointIndex:j, gridData:[gridpos.x,gridpos.y], data:s.data[j]};\n }\n }\n }\n break;\n \n case $.jqplot.BubbleRenderer:\n x = gridpos.x;\n y = gridpos.y;\n var ret = null;\n \n if (s.show) {\n for (var j=0; j<s.gridData.length; j++) {\n p = s.gridData[j];\n d = Math.sqrt( (x-p[0]) * (x-p[0]) + (y-p[1]) * (y-p[1]) );\n if (d <= p[2] && (d <= d0 || d0 == null)) {\n d0 = d;\n ret = {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};\n }\n }\n if (ret != null) {\n return ret;\n }\n }\n break;\n \n case $.jqplot.FunnelRenderer:\n x = gridpos.x;\n y = gridpos.y;\n var v = s._vertices,\n vfirst = v[0],\n vlast = v[v.length-1],\n lex,\n rex,\n cv;\n \n // equations of right and left sides, returns x, y values given height of section (y value and 2 points)\n \n function findedge (l, p1 , p2) {\n var m = (p1[1] - p2[1])/(p1[0] - p2[0]);\n var b = p1[1] - m*p1[0];\n var y = l + p1[1];\n \n return [(y - b)/m, y];\n }\n \n // check each section\n lex = findedge(y, vfirst[0], vlast[3]);\n rex = findedge(y, vfirst[1], vlast[2]);\n for (j=0; j<v.length; j++) {\n cv = v[j];\n if (y >= cv[0][1] && y <= cv[3][1] && x >= lex[0] && x <= rex[0]) {\n return {seriesIndex:s.index, pointIndex:j, gridData:null, data:s.data[j]};\n }\n } \n break; \n \n case $.jqplot.LineRenderer:\n x = gridpos.x;\n y = gridpos.y;\n r = s.renderer;\n if (s.show) {\n if ((s.fill || (s.renderer.bands.show && s.renderer.bands.fill)) && (!plot.plugins.highlighter || !plot.plugins.highlighter.show)) {\n // first check if it is in bounding box\n var inside = false;\n if (x>s._boundingBox[0][0] && x<s._boundingBox[1][0] && y>s._boundingBox[1][1] && y<s._boundingBox[0][1]) { \n // now check the crossing number \n \n var numPoints = s._areaPoints.length;\n var ii;\n var j = numPoints-1;\n\n for(var ii=0; ii < numPoints; ii++) { \n var vertex1 = [s._areaPoints[ii][0], s._areaPoints[ii][1]];\n var vertex2 = [s._areaPoints[j][0], s._areaPoints[j][1]];\n\n if (vertex1[1] < y && vertex2[1] >= y || vertex2[1] < y && vertex1[1] >= y) {\n if (vertex1[0] + (y - vertex1[1]) / (vertex2[1] - vertex1[1]) * (vertex2[0] - vertex1[0]) < x) {\n inside = !inside;\n }\n }\n\n j = ii;\n } \n }\n if (inside) {\n return {seriesIndex:i, pointIndex:null, gridData:s.gridData, data:s.data, points:s._areaPoints};\n }\n break;\n \n }\n\n else {\n t = s.markerRenderer.size/2+s.neighborThreshold;\n threshold = (t > 0) ? t : 0;\n for (var j=0; j<s.gridData.length; j++) {\n p = s.gridData[j];\n // neighbor looks different to OHLC chart.\n if (r.constructor == $.jqplot.OHLCRenderer) {\n if (r.candleStick) {\n var yp = s._yaxis.series_u2p;\n if (x >= p[0]-r._bodyWidth/2 && x <= p[0]+r._bodyWidth/2 && y >= yp(s.data[j][2]) && y <= yp(s.data[j][3])) {\n return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};\n }\n }\n // if an open hi low close chart\n else if (!r.hlc){\n var yp = s._yaxis.series_u2p;\n if (x >= p[0]-r._tickLength && x <= p[0]+r._tickLength && y >= yp(s.data[j][2]) && y <= yp(s.data[j][3])) {\n return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};\n }\n }\n // a hi low close chart\n else {\n var yp = s._yaxis.series_u2p;\n if (x >= p[0]-r._tickLength && x <= p[0]+r._tickLength && y >= yp(s.data[j][1]) && y <= yp(s.data[j][2])) {\n return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};\n }\n }\n \n }\n else if (p[0] != null && p[1] != null){\n d = Math.sqrt( (x-p[0]) * (x-p[0]) + (y-p[1]) * (y-p[1]) );\n if (d <= threshold && (d <= d0 || d0 == null)) {\n d0 = d;\n return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};\n }\n }\n } \n }\n }\n break;\n \n default:\n x = gridpos.x;\n y = gridpos.y;\n r = s.renderer;\n if (s.show) {\n t = s.markerRenderer.size/2+s.neighborThreshold;\n threshold = (t > 0) ? t : 0;\n for (var j=0; j<s.gridData.length; j++) {\n p = s.gridData[j];\n // neighbor looks different to OHLC chart.\n if (r.constructor == $.jqplot.OHLCRenderer) {\n if (r.candleStick) {\n var yp = s._yaxis.series_u2p;\n if (x >= p[0]-r._bodyWidth/2 && x <= p[0]+r._bodyWidth/2 && y >= yp(s.data[j][2]) && y <= yp(s.data[j][3])) {\n return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};\n }\n }\n // if an open hi low close chart\n else if (!r.hlc){\n var yp = s._yaxis.series_u2p;\n if (x >= p[0]-r._tickLength && x <= p[0]+r._tickLength && y >= yp(s.data[j][2]) && y <= yp(s.data[j][3])) {\n return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};\n }\n }\n // a hi low close chart\n else {\n var yp = s._yaxis.series_u2p;\n if (x >= p[0]-r._tickLength && x <= p[0]+r._tickLength && y >= yp(s.data[j][1]) && y <= yp(s.data[j][2])) {\n return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};\n }\n }\n \n }\n else {\n d = Math.sqrt( (x-p[0]) * (x-p[0]) + (y-p[1]) * (y-p[1]) );\n if (d <= threshold && (d <= d0 || d0 == null)) {\n d0 = d;\n return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};\n }\n }\n } \n }\n break;\n }\n }\n \n return null;\n }\n \n \n \n this.onClick = function(ev) {\n // Event passed in is normalized and will have data attribute.\n // Event passed out is unnormalized.\n var positions = getEventPosition(ev);\n var p = ev.data.plot;\n var neighbor = checkIntersection(positions.gridPos, p);\n var evt = $.Event('jqplotClick');\n evt.pageX = ev.pageX;\n evt.pageY = ev.pageY;\n $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);\n };\n \n this.onDblClick = function(ev) {\n // Event passed in is normalized and will have data attribute.\n // Event passed out is unnormalized.\n var positions = getEventPosition(ev);\n var p = ev.data.plot;\n var neighbor = checkIntersection(positions.gridPos, p);\n var evt = $.Event('jqplotDblClick');\n evt.pageX = ev.pageX;\n evt.pageY = ev.pageY;\n $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);\n };\n \n this.onMouseDown = function(ev) {\n var positions = getEventPosition(ev);\n var p = ev.data.plot;\n var neighbor = checkIntersection(positions.gridPos, p);\n var evt = $.Event('jqplotMouseDown');\n evt.pageX = ev.pageX;\n evt.pageY = ev.pageY;\n $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);\n };\n \n this.onMouseUp = function(ev) {\n var positions = getEventPosition(ev);\n var evt = $.Event('jqplotMouseUp');\n evt.pageX = ev.pageX;\n evt.pageY = ev.pageY;\n $(this).trigger(evt, [positions.gridPos, positions.dataPos, null, ev.data.plot]);\n };\n \n this.onRightClick = function(ev) {\n var positions = getEventPosition(ev);\n var p = ev.data.plot;\n var neighbor = checkIntersection(positions.gridPos, p);\n if (p.captureRightClick) {\n if (ev.which == 3) {\n var evt = $.Event('jqplotRightClick');\n evt.pageX = ev.pageX;\n evt.pageY = ev.pageY;\n $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);\n }\n else {\n var evt = $.Event('jqplotMouseUp');\n evt.pageX = ev.pageX;\n evt.pageY = ev.pageY;\n $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);\n }\n }\n };\n \n this.onMouseMove = function(ev) {\n var positions = getEventPosition(ev);\n var p = ev.data.plot;\n var neighbor = checkIntersection(positions.gridPos, p);\n var evt = $.Event('jqplotMouseMove');\n evt.pageX = ev.pageX;\n evt.pageY = ev.pageY;\n $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);\n };\n \n this.onMouseEnter = function(ev) {\n var positions = getEventPosition(ev);\n var p = ev.data.plot;\n var evt = $.Event('jqplotMouseEnter');\n evt.pageX = ev.pageX;\n evt.pageY = ev.pageY;\n evt.relatedTarget = ev.relatedTarget;\n $(this).trigger(evt, [positions.gridPos, positions.dataPos, null, p]);\n };\n \n this.onMouseLeave = function(ev) {\n var positions = getEventPosition(ev);\n var p = ev.data.plot;\n var evt = $.Event('jqplotMouseLeave');\n evt.pageX = ev.pageX;\n evt.pageY = ev.pageY;\n evt.relatedTarget = ev.relatedTarget;\n $(this).trigger(evt, [positions.gridPos, positions.dataPos, null, p]);\n };\n \n // method: drawSeries\n // Redraws all or just one series on the plot. No axis scaling\n // is performed and no other elements on the plot are redrawn.\n // options is an options object to pass on to the series renderers.\n // It can be an empty object {}. idx is the series index\n // to redraw if only one series is to be redrawn.\n this.drawSeries = function(options, idx){\n var i, series, ctx;\n // if only one argument passed in and it is a number, use it ad idx.\n idx = (typeof(options) === \"number\" && idx == null) ? options : idx;\n options = (typeof(options) === \"object\") ? options : {};\n // draw specified series\n if (idx != undefined) {\n series = this.series[idx];\n ctx = series.shadowCanvas._ctx;\n ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n series.drawShadow(ctx, options, this);\n ctx = series.canvas._ctx;\n ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n series.draw(ctx, options, this);\n if (series.renderer.constructor == $.jqplot.BezierCurveRenderer) {\n if (idx < this.series.length - 1) {\n this.drawSeries(idx+1); \n }\n }\n }\n \n else {\n // if call series drawShadow method first, in case all series shadows\n // should be drawn before any series. This will ensure, like for \n // stacked bar plots, that shadows don't overlap series.\n for (i=0; i<this.series.length; i++) {\n // first clear the canvas\n series = this.series[i];\n ctx = series.shadowCanvas._ctx;\n ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n series.drawShadow(ctx, options, this);\n ctx = series.canvas._ctx;\n ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n series.draw(ctx, options, this);\n }\n }\n options = idx = i = series = ctx = null;\n };\n \n // method: moveSeriesToFront\n // This method requires jQuery 1.4+\n // Moves the specified series canvas in front of all other series canvases.\n // This effectively \"draws\" the specified series on top of all other series,\n // although it is performed through DOM manipulation, no redrawing is performed.\n //\n // Parameters:\n // idx - 0 based index of the series to move. This will be the index of the series\n // as it was first passed into the jqplot function.\n this.moveSeriesToFront = function (idx) { \n idx = parseInt(idx, 10);\n var stackIndex = $.inArray(idx, this.seriesStack);\n // if already in front, return\n if (stackIndex == -1) {\n return;\n }\n if (stackIndex == this.seriesStack.length -1) {\n this.previousSeriesStack = this.seriesStack.slice(0);\n return;\n }\n var opidx = this.seriesStack[this.seriesStack.length -1];\n var serelem = this.series[idx].canvas._elem.detach();\n var shadelem = this.series[idx].shadowCanvas._elem.detach();\n this.series[opidx].shadowCanvas._elem.after(shadelem);\n this.series[opidx].canvas._elem.after(serelem);\n this.previousSeriesStack = this.seriesStack.slice(0);\n this.seriesStack.splice(stackIndex, 1);\n this.seriesStack.push(idx);\n };\n \n // method: moveSeriesToBack\n // This method requires jQuery 1.4+\n // Moves the specified series canvas behind all other series canvases.\n //\n // Parameters:\n // idx - 0 based index of the series to move. This will be the index of the series\n // as it was first passed into the jqplot function.\n this.moveSeriesToBack = function (idx) {\n idx = parseInt(idx, 10);\n var stackIndex = $.inArray(idx, this.seriesStack);\n // if already in back, return\n if (stackIndex == 0 || stackIndex == -1) {\n return;\n }\n var opidx = this.seriesStack[0];\n var serelem = this.series[idx].canvas._elem.detach();\n var shadelem = this.series[idx].shadowCanvas._elem.detach();\n this.series[opidx].shadowCanvas._elem.before(shadelem);\n this.series[opidx].canvas._elem.before(serelem);\n this.previousSeriesStack = this.seriesStack.slice(0);\n this.seriesStack.splice(stackIndex, 1);\n this.seriesStack.unshift(idx);\n };\n \n // method: restorePreviousSeriesOrder\n // This method requires jQuery 1.4+\n // Restore the series canvas order to its previous state.\n // Useful to put a series back where it belongs after moving\n // it to the front.\n this.restorePreviousSeriesOrder = function () {\n var i, j, serelem, shadelem, temp, move, keep;\n // if no change, return.\n if (this.seriesStack == this.previousSeriesStack) {\n return;\n }\n for (i=1; i<this.previousSeriesStack.length; i++) {\n move = this.previousSeriesStack[i];\n keep = this.previousSeriesStack[i-1];\n serelem = this.series[move].canvas._elem.detach();\n shadelem = this.series[move].shadowCanvas._elem.detach();\n this.series[keep].shadowCanvas._elem.after(shadelem);\n this.series[keep].canvas._elem.after(serelem);\n }\n temp = this.seriesStack.slice(0);\n this.seriesStack = this.previousSeriesStack.slice(0);\n this.previousSeriesStack = temp;\n };\n \n // method: restoreOriginalSeriesOrder\n // This method requires jQuery 1.4+\n // Restore the series canvas order to its original order\n // when the plot was created.\n this.restoreOriginalSeriesOrder = function () {\n var i, j, arr=[], serelem, shadelem;\n for (i=0; i<this.series.length; i++) {\n arr.push(i);\n }\n if (this.seriesStack == arr) {\n return;\n }\n this.previousSeriesStack = this.seriesStack.slice(0);\n this.seriesStack = arr;\n for (i=1; i<this.seriesStack.length; i++) {\n serelem = this.series[i].canvas._elem.detach();\n shadelem = this.series[i].shadowCanvas._elem.detach();\n this.series[i-1].shadowCanvas._elem.after(shadelem);\n this.series[i-1].canvas._elem.after(serelem);\n }\n };\n \n this.activateTheme = function (name) {\n this.themeEngine.activate(this, name);\n };\n }", "title": "" }, { "docid": "bd40e6bf06abd6ecfedb377d93977a38", "score": "0.5841197", "text": "function setSize() {\n\tvar svg = document.getElementById('axis-svg')\n\t// use style here, because width seems only a getter for svg\n\tsvg.style.width = (canvasPlot.plotGeometry.width + canvasPlot.plotGeometry.marginLeft + canvasPlot.plotGeometry.marginRight) + 'px';\n\tsvg.style.height = (canvasPlot.plotGeometry.height + canvasPlot.plotGeometry.marginTop + canvasPlot.plotGeometry.marginBottom) + 'px';\n\t// for canvas elements using style for left position, and attribute for width & height\n\tvar lefty = (canvasPlot.plotGeometry.marginLeft + canvasPlot.plotGeometry.borderWidth) + 'px';\n\tvar widthy = canvasPlot.plotGeometry.width;\n\tvar heighty = canvasPlot.plotGeometry.height;\n\tvar zoomCanvas = document.getElementById('catch-zoom');\n\tzoomCanvas.style.left = lefty;\n\tzoomCanvas.width = widthy;\n\tzoomCanvas.height = heighty;\n\tvar highlightCanvas = document.getElementById('highlight-points');\n\thighlightCanvas.style.left = lefty;\n\thighlightCanvas.width = widthy;\n\thighlightCanvas.height = heighty;\n\tvar selectCanvas = document.getElementById('select-points');\n\tselectCanvas.style.left = lefty;\n\tselectCanvas.width = widthy;\n\tselectCanvas.height = heighty;\n\tvar pointsCanvas = document.getElementById('plot-points');\n\tpointsCanvas.style.left = lefty;\n\tpointsCanvas.width = widthy;\n\tpointsCanvas.height = heighty;\n\tvar legendCanvas = document.getElementById('legend')\n\tlegendCanvas.style.left = (canvasPlot.plotGeometry.width + canvasPlot.plotGeometry.marginLeft + canvasPlot.plotGeometry.marginRight + 10) + 'px';\n\tlegendCanvas.height= canvasPlot.plotGeometry.height;\n}", "title": "" }, { "docid": "732ba0abba9c1f28a86c9f1cb672bad2", "score": "0.5832066", "text": "function init(){\n buildPlots(\"940\");\n}", "title": "" }, { "docid": "600badb1c0bb1ae738ac245557adfd1f", "score": "0.58274317", "text": "buildAxes() {\n this.vis.axes\n .data(this.vis.allAxis).enter()\n .append('svg:line').classed('axis-lines', true)\n .attr('x1', this.config.w / 2)\n .attr('y1', this.config.h / 2)\n .attr('x2', (d, i) => this.config.w / 2 * (1 - Math.sin(i * this.config.radians / this.vis.totalAxes)))\n .attr('y2', (d, i) => this.config.h / 2 * (1 - Math.cos(i * this.config.radians / this.vis.totalAxes)))\n .attr('stroke', 'black')\n .attr('stroke-width', this.config.w / (this.config.strokeWidthRatio * 2));\n }", "title": "" }, { "docid": "f0a45343d09bd9109fd5bee65aec73d1", "score": "0.57930547", "text": "function buildAxes() {\n vis.axes\n .data(vis.allAxis).enter()\n .append(\"svg:line\").classed(\"axis-lines\", true)\n .attr(\"x1\", config.w / 2)\n .attr(\"y1\", config.h / 2)\n .attr(\"x2\", function(d, i) { return config.w / 2 * (1 - Math.sin(i * config.radians / vis.totalAxes)); })\n .attr(\"y2\", function(d, i) { return config.h / 2 * (1 - Math.cos(i * config.radians / vis.totalAxes)); })\n .attr(\"stroke\", \"grey\")\n .attr(\"stroke-width\", \"1px\");\n }", "title": "" }, { "docid": "07a94674786ec8840b2f644b3cb600f8", "score": "0.5719493", "text": "function plotChart1Axes(params){//TODO duplicated in ex4\n \n d3.select('.display1')//Note TODO must be more efficient way to add multiline notes\n .append('text')\n .classed('chartOnenote', true)\n .attr('x', -20)\n .attr('y', height + 70)\n .classed('alignLeft', true)\n .html('GDP refers to gross domestic product.')\n d3.select('.display1')//Note\n .append('text')\n .classed('chartOnenote', true)\n .attr('x', -20)\n .attr('y', height + 80)\n .classed('alignLeft', true)\n .html('Source: OECD Health Data 2016. Note: Australia, Germany, Japan, Netherlands and Switzerland data is for current ')\n d3.select('.display1')//Note\n .append('text')\n .classed('chartOnenote', true)\n .attr('x', -20)\n .attr('y', height + 90)\n .classed('alignLeft', true)\n .html('spending only, and excludes spending on capital formation of health care providers.')\n\n this.append('g')\n .classed('gridline y', true)\n .attr('transform','translate(0,0)')\n .call(params.axis.gridlines)\n this.append('g')\n .classed('x axis', true)\n .attr('transform','translate(0,' + (height + 10)+ ')')\n .call(params.axis.x)\n this.append('g')\n .classed('y axis', true)\n .call(params.axis.y)\n\n this.select('.y.axis')//Top Label\n .append('text')\n .attr('x', 0)\n .attr('y',-20)\n .text('Percent')\n}", "title": "" }, { "docid": "0cbc45cbbefff1a7885ef9504646db38", "score": "0.56973606", "text": "function drawChart(plotParameters) {\n var namedColumns = plotParameters.sources.map(function(plotSource) {\n return { name: plotSource.columnPath,\n label: plotSource.label\n };\n });\n\n var charts = [ \n { title: plotParameters.title,\n timeSeries: plotParameters.time,\n xScale: plotParameters.time ? d3.time.scale.utc() : d3.scale.linear(),\n showXAxis: plotParameters.xAxis,\n transformName: plotParameters.zoomTransform,\n padding:[5, 5], // padding so that marks can extend past the edge of the plot area\n groups: [\n { label: plotParameters.units,\n plot: { plotter: scatter() },\n axis: sideAxis(),\n named: namedColumns\n }\n ]\n }\n ];\n\n var update = d3.selectAll(\"body\").data([{charts:charts}]);\n plotBoard(update);\n }", "title": "" }, { "docid": "e6fee135e9c21da6b976143615938145", "score": "0.56828964", "text": "function init(plot) {\n var that = this;\n var eventMarkers = new EventMarkers(plot);\n\n plot.getEvents = function () {\n return eventMarkers._events;\n };\n\n plot.hideEvents = function () {\n jquery__WEBPACK_IMPORTED_MODULE_1___default.a.each(eventMarkers._events, function (index, event) {\n event.visual().getObject().hide();\n });\n };\n\n plot.showEvents = function () {\n plot.hideEvents();\n jquery__WEBPACK_IMPORTED_MODULE_1___default.a.each(eventMarkers._events, function (index, event) {\n event.hide();\n });\n that.eventMarkers.drawEvents();\n }; // change events on an existing plot\n\n\n plot.setEvents = function (events) {\n if (eventMarkers.eventsEnabled) {\n eventMarkers.setupEvents(events);\n }\n };\n\n plot.hooks.processOptions.push(function (plot, options) {\n // enable the plugin\n if (options.events.data != null) {\n eventMarkers.eventsEnabled = true;\n }\n });\n plot.hooks.draw.push(function (plot) {\n var options = plot.getOptions();\n\n if (eventMarkers.eventsEnabled) {\n // check for first run\n if (eventMarkers.getEvents().length < 1) {\n eventMarkers.setTypes(options.events.types);\n eventMarkers.setupEvents(options.events.data);\n } else {\n eventMarkers.updateEvents();\n }\n }\n\n eventMarkers.drawEvents();\n });\n}", "title": "" }, { "docid": "c276352ec4c3cac5acbb3eb4c49a31ab", "score": "0.56827617", "text": "function addCharts( plot, start, end, name, sentinelMap, landsat7Map, landsat8Map, panel ){\n panel.widgets().add( getModis16DayNDVI( plot, start, end, name) );\n panel.widgets().add( getLandsatNDVI( plot, start, end, name, landsat7Map, landsat8Map ) );\n panel.widgets().add( getSentinel2NDVI( plot, start, end, name,sentinelMap ) );\n}", "title": "" }, { "docid": "61651e50d8ab2cb7ecb3f9e711131acf", "score": "0.5682256", "text": "function Plot(placeholder,data_,options_,plugins){\n// data is on the form:\n// [ series1, series2 ... ]\n// where series is either just the data as [ [x1, y1], [x2, y2], ... ]\n// or { data: [ [x1, y1], [x2, y2], ... ], label: \"some label\", ... }\nvar series=[],options={\n// the color theme used for graphs\ncolors:[\"#edc240\",\"#afd8f8\",\"#cb4b4b\",\"#4da74d\",\"#9440ed\"],legend:{show:true,noColumns:1,// number of colums in legend table\nlabelFormatter:null,// fn: string -> string\nlabelBoxBorderColor:\"#ccc\",// border color for the little label boxes\ncontainer:null,// container (as jQuery object) to put legend in, null means default on top of graph\nposition:\"ne\",// position of default legend container within plot\nmargin:5,// distance from grid edge to default legend container within plot\nbackgroundColor:null,// null means auto-detect\nbackgroundOpacity:.85,// set to 0 to avoid background\nsorted:null},xaxis:{show:null,// null = auto-detect, true = always, false = never\nposition:\"bottom\",// or \"top\"\nmode:null,// null or \"time\"\nfont:null,// null (derived from CSS in placeholder) or object like { size: 11, lineHeight: 13, style: \"italic\", weight: \"bold\", family: \"sans-serif\", variant: \"small-caps\" }\ncolor:null,// base color, labels, ticks\ntickColor:null,// possibly different color of ticks, e.g. \"rgba(0,0,0,0.15)\"\ntransform:null,// null or f: number -> number to transform axis\ninverseTransform:null,// if transform is set, this should be the inverse function\nmin:null,// min. value to show, null means set automatically\nmax:null,// max. value to show, null means set automatically\nautoscaleMargin:null,// margin in % to add if auto-setting min/max\nticks:null,// either [1, 3] or [[1, \"a\"], 3] or (fn: axis info -> ticks) or app. number of ticks for auto-ticks\ntickFormatter:null,// fn: number -> string\nlabelWidth:null,// size of tick labels in pixels\nlabelHeight:null,reserveSpace:null,// whether to reserve space even if axis isn't shown\ntickLength:null,// size in pixels of ticks, or \"full\" for whole line\nalignTicksWithAxis:null,// axis number or null for no sync\ntickDecimals:null,// no. of decimals, null means auto\ntickSize:null,// number or [number, \"unit\"]\nminTickSize:null},yaxis:{autoscaleMargin:.02,position:\"left\"},xaxes:[],yaxes:[],series:{points:{show:false,radius:3,lineWidth:2,// in pixels\nfill:true,fillColor:\"#ffffff\",symbol:\"circle\"},lines:{\n// we don't put in show: false so we can see\n// whether lines were actively disabled\nlineWidth:2,// in pixels\nfill:false,fillColor:null,steps:false},bars:{show:false,lineWidth:2,// in pixels\nbarWidth:1,// in units of the x axis\nfill:true,fillColor:null,align:\"left\",// \"left\", \"right\", or \"center\"\nhorizontal:false,zero:true},shadowSize:3,highlightColor:null},grid:{show:true,aboveData:false,color:\"#545454\",// primary color used for outline and labels\nbackgroundColor:null,// null for transparent, else color\nborderColor:null,// set if different from the grid color\ntickColor:null,// color for the ticks, e.g. \"rgba(0,0,0,0.15)\"\nmargin:0,// distance from the canvas edge to the grid\nlabelMargin:5,// in pixels\naxisMargin:8,// in pixels\nborderWidth:2,// in pixels\nminBorderMargin:null,// in pixels, null means taken from points radius\nmarkings:null,// array of ranges or fn: axes -> array of ranges\nmarkingsColor:\"#f4f4f4\",markingsLineWidth:2,\n// interactive stuff\nclickable:false,hoverable:false,autoHighlight:true,// highlight in case mouse is near\nmouseActiveRadius:10},interaction:{redrawOverlayInterval:1e3/60},hooks:{}},surface=null,// the canvas for the plot itself\noverlay=null,// canvas for interactive stuff on top of plot\neventHolder=null,// jQuery object that events should be bound to\nctx=null,octx=null,xaxes=[],yaxes=[],plotOffset={left:0,right:0,top:0,bottom:0},plotWidth=0,plotHeight=0,hooks={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},plot=this;\n// public functions\nplot.setData=setData;plot.setupGrid=setupGrid;plot.draw=draw;plot.getPlaceholder=function(){return placeholder};plot.getCanvas=function(){return surface.element};plot.getPlotOffset=function(){return plotOffset};plot.width=function(){return plotWidth};plot.height=function(){return plotHeight};plot.offset=function(){var o=eventHolder.offset();o.left+=plotOffset.left;o.top+=plotOffset.top;return o};plot.getData=function(){return series};plot.getAxes=function(){var res={},i;$.each(xaxes.concat(yaxes),function(_,axis){if(axis)res[axis.direction+(axis.n!=1?axis.n:\"\")+\"axis\"]=axis});return res};plot.getXAxes=function(){return xaxes};plot.getYAxes=function(){return yaxes};plot.c2p=canvasToAxisCoords;plot.p2c=axisToCanvasCoords;plot.getOptions=function(){return options};plot.highlight=highlight;plot.unhighlight=unhighlight;plot.triggerRedrawOverlay=triggerRedrawOverlay;plot.pointOffset=function(point){return{left:parseInt(xaxes[axisNumber(point,\"x\")-1].p2c(+point.x)+plotOffset.left,10),top:parseInt(yaxes[axisNumber(point,\"y\")-1].p2c(+point.y)+plotOffset.top,10)}};plot.shutdown=shutdown;plot.destroy=function(){shutdown();placeholder.removeData(\"plot\").empty();series=[];options=null;surface=null;overlay=null;eventHolder=null;ctx=null;octx=null;xaxes=[];yaxes=[];hooks=null;highlights=[];plot=null};plot.resize=function(){var width=placeholder.width(),height=placeholder.height();surface.resize(width,height);overlay.resize(width,height)};\n// public attributes\nplot.hooks=hooks;\n// initialize\ninitPlugins(plot);parseOptions(options_);setupCanvases();setData(data_);setupGrid();draw();bindEvents();function executeHooks(hook,args){args=[plot].concat(args);for(var i=0;i<hook.length;++i)hook[i].apply(this,args)}function initPlugins(){\n// References to key classes, allowing plugins to modify them\nvar classes={Canvas:Canvas};for(var i=0;i<plugins.length;++i){var p=plugins[i];p.init(plot,classes);if(p.options)$.extend(true,options,p.options)}}function parseOptions(opts){$.extend(true,options,opts);\n// $.extend merges arrays, rather than replacing them. When less\n// colors are provided than the size of the default palette, we\n// end up with those colors plus the remaining defaults, which is\n// not expected behavior; avoid it by replacing them here.\nif(opts&&opts.colors){options.colors=opts.colors}if(options.xaxis.color==null)options.xaxis.color=$.color.parse(options.grid.color).scale(\"a\",.22).toString();if(options.yaxis.color==null)options.yaxis.color=$.color.parse(options.grid.color).scale(\"a\",.22).toString();if(options.xaxis.tickColor==null)// grid.tickColor for back-compatibility\noptions.xaxis.tickColor=options.grid.tickColor||options.xaxis.color;if(options.yaxis.tickColor==null)// grid.tickColor for back-compatibility\noptions.yaxis.tickColor=options.grid.tickColor||options.yaxis.color;if(options.grid.borderColor==null)options.grid.borderColor=options.grid.color;if(options.grid.tickColor==null)options.grid.tickColor=$.color.parse(options.grid.color).scale(\"a\",.22).toString();\n// Fill in defaults for axis options, including any unspecified\n// font-spec fields, if a font-spec was provided.\n// If no x/y axis options were provided, create one of each anyway,\n// since the rest of the code assumes that they exist.\nvar i,axisOptions,axisCount,fontSize=placeholder.css(\"font-size\"),fontSizeDefault=fontSize?+fontSize.replace(\"px\",\"\"):13,fontDefaults={style:placeholder.css(\"font-style\"),size:Math.round(.8*fontSizeDefault),variant:placeholder.css(\"font-variant\"),weight:placeholder.css(\"font-weight\"),family:placeholder.css(\"font-family\")};axisCount=options.xaxes.length||1;for(i=0;i<axisCount;++i){axisOptions=options.xaxes[i];if(axisOptions&&!axisOptions.tickColor){axisOptions.tickColor=axisOptions.color}axisOptions=$.extend(true,{},options.xaxis,axisOptions);options.xaxes[i]=axisOptions;if(axisOptions.font){axisOptions.font=$.extend({},fontDefaults,axisOptions.font);if(!axisOptions.font.color){axisOptions.font.color=axisOptions.color}if(!axisOptions.font.lineHeight){axisOptions.font.lineHeight=Math.round(axisOptions.font.size*1.15)}}}axisCount=options.yaxes.length||1;for(i=0;i<axisCount;++i){axisOptions=options.yaxes[i];if(axisOptions&&!axisOptions.tickColor){axisOptions.tickColor=axisOptions.color}axisOptions=$.extend(true,{},options.yaxis,axisOptions);options.yaxes[i]=axisOptions;if(axisOptions.font){axisOptions.font=$.extend({},fontDefaults,axisOptions.font);if(!axisOptions.font.color){axisOptions.font.color=axisOptions.color}if(!axisOptions.font.lineHeight){axisOptions.font.lineHeight=Math.round(axisOptions.font.size*1.15)}}}\n// backwards compatibility, to be removed in future\nif(options.xaxis.noTicks&&options.xaxis.ticks==null)options.xaxis.ticks=options.xaxis.noTicks;if(options.yaxis.noTicks&&options.yaxis.ticks==null)options.yaxis.ticks=options.yaxis.noTicks;if(options.x2axis){options.xaxes[1]=$.extend(true,{},options.xaxis,options.x2axis);options.xaxes[1].position=\"top\";\n// Override the inherit to allow the axis to auto-scale\nif(options.x2axis.min==null){options.xaxes[1].min=null}if(options.x2axis.max==null){options.xaxes[1].max=null}}if(options.y2axis){options.yaxes[1]=$.extend(true,{},options.yaxis,options.y2axis);options.yaxes[1].position=\"right\";\n// Override the inherit to allow the axis to auto-scale\nif(options.y2axis.min==null){options.yaxes[1].min=null}if(options.y2axis.max==null){options.yaxes[1].max=null}}if(options.grid.coloredAreas)options.grid.markings=options.grid.coloredAreas;if(options.grid.coloredAreasColor)options.grid.markingsColor=options.grid.coloredAreasColor;if(options.lines)$.extend(true,options.series.lines,options.lines);if(options.points)$.extend(true,options.series.points,options.points);if(options.bars)$.extend(true,options.series.bars,options.bars);if(options.shadowSize!=null)options.series.shadowSize=options.shadowSize;if(options.highlightColor!=null)options.series.highlightColor=options.highlightColor;\n// save options on axes for future reference\nfor(i=0;i<options.xaxes.length;++i)getOrCreateAxis(xaxes,i+1).options=options.xaxes[i];for(i=0;i<options.yaxes.length;++i)getOrCreateAxis(yaxes,i+1).options=options.yaxes[i];\n// add hooks from options\nfor(var n in hooks)if(options.hooks[n]&&options.hooks[n].length)hooks[n]=hooks[n].concat(options.hooks[n]);executeHooks(hooks.processOptions,[options])}function setData(d){series=parseData(d);fillInSeriesOptions();processData()}function parseData(d){var res=[];for(var i=0;i<d.length;++i){var s=$.extend(true,{},options.series);if(d[i].data!=null){s.data=d[i].data;// move the data instead of deep-copy\ndelete d[i].data;$.extend(true,s,d[i]);d[i].data=s.data}else s.data=d[i];res.push(s)}return res}function axisNumber(obj,coord){var a=obj[coord+\"axis\"];if(typeof a==\"object\")// if we got a real axis, extract number\na=a.n;if(typeof a!=\"number\")a=1;// default to first axis\nreturn a}function allAxes(){\n// return flat array without annoying null entries\nreturn $.grep(xaxes.concat(yaxes),function(a){return a})}function canvasToAxisCoords(pos){\n// return an object with x/y corresponding to all used axes\nvar res={},i,axis;for(i=0;i<xaxes.length;++i){axis=xaxes[i];if(axis&&axis.used)res[\"x\"+axis.n]=axis.c2p(pos.left)}for(i=0;i<yaxes.length;++i){axis=yaxes[i];if(axis&&axis.used)res[\"y\"+axis.n]=axis.c2p(pos.top)}if(res.x1!==undefined)res.x=res.x1;if(res.y1!==undefined)res.y=res.y1;return res}function axisToCanvasCoords(pos){\n// get canvas coords from the first pair of x/y found in pos\nvar res={},i,axis,key;for(i=0;i<xaxes.length;++i){axis=xaxes[i];if(axis&&axis.used){key=\"x\"+axis.n;if(pos[key]==null&&axis.n==1)key=\"x\";if(pos[key]!=null){res.left=axis.p2c(pos[key]);break}}}for(i=0;i<yaxes.length;++i){axis=yaxes[i];if(axis&&axis.used){key=\"y\"+axis.n;if(pos[key]==null&&axis.n==1)key=\"y\";if(pos[key]!=null){res.top=axis.p2c(pos[key]);break}}}return res}function getOrCreateAxis(axes,number){if(!axes[number-1])axes[number-1]={n:number,// save the number for future reference\ndirection:axes==xaxes?\"x\":\"y\",options:$.extend(true,{},axes==xaxes?options.xaxis:options.yaxis)};return axes[number-1]}function fillInSeriesOptions(){var neededColors=series.length,maxIndex=-1,i;\n// Subtract the number of series that already have fixed colors or\n// color indexes from the number that we still need to generate.\nfor(i=0;i<series.length;++i){var sc=series[i].color;if(sc!=null){neededColors--;if(typeof sc==\"number\"&&sc>maxIndex){maxIndex=sc}}}\n// If any of the series have fixed color indexes, then we need to\n// generate at least as many colors as the highest index.\nif(neededColors<=maxIndex){neededColors=maxIndex+1}\n// Generate all the colors, using first the option colors and then\n// variations on those colors once they're exhausted.\nvar c,colors=[],colorPool=options.colors,colorPoolSize=colorPool.length,variation=0;for(i=0;i<neededColors;i++){c=$.color.parse(colorPool[i%colorPoolSize]||\"#666\");\n// Each time we exhaust the colors in the pool we adjust\n// a scaling factor used to produce more variations on\n// those colors. The factor alternates negative/positive\n// to produce lighter/darker colors.\n// Reset the variation after every few cycles, or else\n// it will end up producing only white or black colors.\nif(i%colorPoolSize==0&&i){if(variation>=0){if(variation<.5){variation=-variation-.2}else variation=0}else variation=-variation}colors[i]=c.scale(\"rgb\",1+variation)}\n// Finalize the series options, filling in their colors\nvar colori=0,s;for(i=0;i<series.length;++i){s=series[i];\n// assign colors\nif(s.color==null){s.color=colors[colori].toString();++colori}else if(typeof s.color==\"number\")s.color=colors[s.color].toString();\n// turn on lines automatically in case nothing is set\nif(s.lines.show==null){var v,show=true;for(v in s)if(s[v]&&s[v].show){show=false;break}if(show)s.lines.show=true}\n// If nothing was provided for lines.zero, default it to match\n// lines.fill, since areas by default should extend to zero.\nif(s.lines.zero==null){s.lines.zero=!!s.lines.fill}\n// setup axes\ns.xaxis=getOrCreateAxis(xaxes,axisNumber(s,\"x\"));s.yaxis=getOrCreateAxis(yaxes,axisNumber(s,\"y\"))}}function processData(){var topSentry=Number.POSITIVE_INFINITY,bottomSentry=Number.NEGATIVE_INFINITY,fakeInfinity=Number.MAX_VALUE,i,j,k,m,length,s,points,ps,x,y,axis,val,f,p,data,format;function updateAxis(axis,min,max){if(min<axis.datamin&&min!=-fakeInfinity)axis.datamin=min;if(max>axis.datamax&&max!=fakeInfinity)axis.datamax=max}$.each(allAxes(),function(_,axis){\n// init axis\naxis.datamin=topSentry;axis.datamax=bottomSentry;axis.used=false});for(i=0;i<series.length;++i){s=series[i];s.datapoints={points:[]};executeHooks(hooks.processRawData,[s,s.data,s.datapoints])}\n// first pass: clean and copy data\nfor(i=0;i<series.length;++i){s=series[i];data=s.data;format=s.datapoints.format;if(!format){format=[];\n// find out how to copy\nformat.push({x:true,number:true,required:true});format.push({y:true,number:true,required:true});if(s.bars.show||s.lines.show&&s.lines.fill){var autoscale=!!(s.bars.show&&s.bars.zero||s.lines.show&&s.lines.zero);format.push({y:true,number:true,required:false,defaultValue:0,autoscale:autoscale});if(s.bars.horizontal){delete format[format.length-1].y;format[format.length-1].x=true}}s.datapoints.format=format}if(s.datapoints.pointsize!=null)continue;// already filled in\ns.datapoints.pointsize=format.length;ps=s.datapoints.pointsize;points=s.datapoints.points;var insertSteps=s.lines.show&&s.lines.steps;s.xaxis.used=s.yaxis.used=true;for(j=k=0;j<data.length;++j,k+=ps){p=data[j];var nullify=p==null;if(!nullify){for(m=0;m<ps;++m){val=p[m];f=format[m];if(f){if(f.number&&val!=null){val=+val;// convert to number\nif(isNaN(val))val=null;else if(val==Infinity)val=fakeInfinity;else if(val==-Infinity)val=-fakeInfinity}if(val==null){if(f.required)nullify=true;if(f.defaultValue!=null)val=f.defaultValue}}points[k+m]=val}}if(nullify){for(m=0;m<ps;++m){val=points[k+m];if(val!=null){f=format[m];\n// extract min/max info\nif(f.autoscale!==false){if(f.x){updateAxis(s.xaxis,val,val)}if(f.y){updateAxis(s.yaxis,val,val)}}}points[k+m]=null}}else{\n// a little bit of line specific stuff that\n// perhaps shouldn't be here, but lacking\n// better means...\nif(insertSteps&&k>0&&points[k-ps]!=null&&points[k-ps]!=points[k]&&points[k-ps+1]!=points[k+1]){\n// copy the point to make room for a middle point\nfor(m=0;m<ps;++m)points[k+ps+m]=points[k+m];\n// middle point has same y\npoints[k+1]=points[k-ps+1];\n// we've added a point, better reflect that\nk+=ps}}}}\n// give the hooks a chance to run\nfor(i=0;i<series.length;++i){s=series[i];executeHooks(hooks.processDatapoints,[s,s.datapoints])}\n// second pass: find datamax/datamin for auto-scaling\nfor(i=0;i<series.length;++i){s=series[i];points=s.datapoints.points;ps=s.datapoints.pointsize;format=s.datapoints.format;var xmin=topSentry,ymin=topSentry,xmax=bottomSentry,ymax=bottomSentry;for(j=0;j<points.length;j+=ps){if(points[j]==null)continue;for(m=0;m<ps;++m){val=points[j+m];f=format[m];if(!f||f.autoscale===false||val==fakeInfinity||val==-fakeInfinity)continue;if(f.x){if(val<xmin)xmin=val;if(val>xmax)xmax=val}if(f.y){if(val<ymin)ymin=val;if(val>ymax)ymax=val}}}if(s.bars.show){\n// make sure we got room for the bar on the dancing floor\nvar delta;switch(s.bars.align){case\"left\":delta=0;break;case\"right\":delta=-s.bars.barWidth;break;default:delta=-s.bars.barWidth/2}if(s.bars.horizontal){ymin+=delta;ymax+=delta+s.bars.barWidth}else{xmin+=delta;xmax+=delta+s.bars.barWidth}}updateAxis(s.xaxis,xmin,xmax);updateAxis(s.yaxis,ymin,ymax)}$.each(allAxes(),function(_,axis){if(axis.datamin==topSentry)axis.datamin=null;if(axis.datamax==bottomSentry)axis.datamax=null})}function setupCanvases(){\n// Make sure the placeholder is clear of everything except canvases\n// from a previous plot in this container that we'll try to re-use.\nplaceholder.css(\"padding\",0).children().filter(function(){return!$(this).hasClass(\"flot-overlay\")&&!$(this).hasClass(\"flot-base\")}).remove();if(placeholder.css(\"position\")==\"static\")placeholder.css(\"position\",\"relative\");// for positioning labels and overlay\nsurface=new Canvas(\"flot-base\",placeholder);overlay=new Canvas(\"flot-overlay\",placeholder);// overlay canvas for interactive features\nctx=surface.context;octx=overlay.context;\n// define which element we're listening for events on\neventHolder=$(overlay.element).unbind();\n// If we're re-using a plot object, shut down the old one\nvar existing=placeholder.data(\"plot\");if(existing){existing.shutdown();overlay.clear()}\n// save in case we get replotted\nplaceholder.data(\"plot\",plot)}function bindEvents(){\n// bind events\nif(options.grid.hoverable){eventHolder.mousemove(onMouseMove);\n// Use bind, rather than .mouseleave, because we officially\n// still support jQuery 1.2.6, which doesn't define a shortcut\n// for mouseenter or mouseleave. This was a bug/oversight that\n// was fixed somewhere around 1.3.x. We can return to using\n// .mouseleave when we drop support for 1.2.6.\neventHolder.bind(\"mouseleave\",onMouseLeave)}if(options.grid.clickable)eventHolder.click(onClick);executeHooks(hooks.bindEvents,[eventHolder])}function shutdown(){if(redrawTimeout)clearTimeout(redrawTimeout);eventHolder.unbind(\"mousemove\",onMouseMove);eventHolder.unbind(\"mouseleave\",onMouseLeave);eventHolder.unbind(\"click\",onClick);executeHooks(hooks.shutdown,[eventHolder])}function setTransformationHelpers(axis){\n// set helper functions on the axis, assumes plot area\n// has been computed already\nfunction identity(x){return x}var s,m,t=axis.options.transform||identity,it=axis.options.inverseTransform;\n// precompute how much the axis is scaling a point\n// in canvas space\nif(axis.direction==\"x\"){s=axis.scale=plotWidth/Math.abs(t(axis.max)-t(axis.min));m=Math.min(t(axis.max),t(axis.min))}else{s=axis.scale=plotHeight/Math.abs(t(axis.max)-t(axis.min));s=-s;m=Math.max(t(axis.max),t(axis.min))}\n// data point to canvas coordinate\nif(t==identity)// slight optimization\naxis.p2c=function(p){return(p-m)*s};else axis.p2c=function(p){return(t(p)-m)*s};\n// canvas coordinate to data point\nif(!it)axis.c2p=function(c){return m+c/s};else axis.c2p=function(c){return it(m+c/s)}}function measureTickLabels(axis){var opts=axis.options,ticks=axis.ticks||[],labelWidth=opts.labelWidth||0,labelHeight=opts.labelHeight||0,maxWidth=labelWidth||(axis.direction==\"x\"?Math.floor(surface.width/(ticks.length||1)):null),legacyStyles=axis.direction+\"Axis \"+axis.direction+axis.n+\"Axis\",layer=\"flot-\"+axis.direction+\"-axis flot-\"+axis.direction+axis.n+\"-axis \"+legacyStyles,font=opts.font||\"flot-tick-label tickLabel\";for(var i=0;i<ticks.length;++i){var t=ticks[i];if(!t.label)continue;var info=surface.getTextInfo(layer,t.label,font,null,maxWidth);labelWidth=Math.max(labelWidth,info.width);labelHeight=Math.max(labelHeight,info.height)}axis.labelWidth=opts.labelWidth||labelWidth;axis.labelHeight=opts.labelHeight||labelHeight}function allocateAxisBoxFirstPhase(axis){\n// find the bounding box of the axis by looking at label\n// widths/heights and ticks, make room by diminishing the\n// plotOffset; this first phase only looks at one\n// dimension per axis, the other dimension depends on the\n// other axes so will have to wait\nvar lw=axis.labelWidth,lh=axis.labelHeight,pos=axis.options.position,isXAxis=axis.direction===\"x\",tickLength=axis.options.tickLength,axisMargin=options.grid.axisMargin,padding=options.grid.labelMargin,innermost=true,outermost=true,first=true,found=false;\n// Determine the axis's position in its direction and on its side\n$.each(isXAxis?xaxes:yaxes,function(i,a){if(a&&(a.show||a.reserveSpace)){if(a===axis){found=true}else if(a.options.position===pos){if(found){outermost=false}else{innermost=false}}if(!found){first=false}}});\n// The outermost axis on each side has no margin\nif(outermost){axisMargin=0}\n// The ticks for the first axis in each direction stretch across\nif(tickLength==null){tickLength=first?\"full\":5}if(!isNaN(+tickLength))padding+=+tickLength;if(isXAxis){lh+=padding;if(pos==\"bottom\"){plotOffset.bottom+=lh+axisMargin;axis.box={top:surface.height-plotOffset.bottom,height:lh}}else{axis.box={top:plotOffset.top+axisMargin,height:lh};plotOffset.top+=lh+axisMargin}}else{lw+=padding;if(pos==\"left\"){axis.box={left:plotOffset.left+axisMargin,width:lw};plotOffset.left+=lw+axisMargin}else{plotOffset.right+=lw+axisMargin;axis.box={left:surface.width-plotOffset.right,width:lw}}}\n// save for future reference\naxis.position=pos;axis.tickLength=tickLength;axis.box.padding=padding;axis.innermost=innermost}function allocateAxisBoxSecondPhase(axis){\n// now that all axis boxes have been placed in one\n// dimension, we can set the remaining dimension coordinates\nif(axis.direction==\"x\"){axis.box.left=plotOffset.left-axis.labelWidth/2;axis.box.width=surface.width-plotOffset.left-plotOffset.right+axis.labelWidth}else{axis.box.top=plotOffset.top-axis.labelHeight/2;axis.box.height=surface.height-plotOffset.bottom-plotOffset.top+axis.labelHeight}}function adjustLayoutForThingsStickingOut(){\n// possibly adjust plot offset to ensure everything stays\n// inside the canvas and isn't clipped off\nvar minMargin=options.grid.minBorderMargin,axis,i;\n// check stuff from the plot (FIXME: this should just read\n// a value from the series, otherwise it's impossible to\n// customize)\nif(minMargin==null){minMargin=0;for(i=0;i<series.length;++i)minMargin=Math.max(minMargin,2*(series[i].points.radius+series[i].points.lineWidth/2))}var margins={left:minMargin,right:minMargin,top:minMargin,bottom:minMargin};\n// check axis labels, note we don't check the actual\n// labels but instead use the overall width/height to not\n// jump as much around with replots\n$.each(allAxes(),function(_,axis){if(axis.reserveSpace&&axis.ticks&&axis.ticks.length){if(axis.direction===\"x\"){margins.left=Math.max(margins.left,axis.labelWidth/2);margins.right=Math.max(margins.right,axis.labelWidth/2)}else{margins.bottom=Math.max(margins.bottom,axis.labelHeight/2);margins.top=Math.max(margins.top,axis.labelHeight/2)}}});plotOffset.left=Math.ceil(Math.max(margins.left,plotOffset.left));plotOffset.right=Math.ceil(Math.max(margins.right,plotOffset.right));plotOffset.top=Math.ceil(Math.max(margins.top,plotOffset.top));plotOffset.bottom=Math.ceil(Math.max(margins.bottom,plotOffset.bottom))}function setupGrid(){var i,axes=allAxes(),showGrid=options.grid.show;\n// Initialize the plot's offset from the edge of the canvas\nfor(var a in plotOffset){var margin=options.grid.margin||0;plotOffset[a]=typeof margin==\"number\"?margin:margin[a]||0}executeHooks(hooks.processOffset,[plotOffset]);\n// If the grid is visible, add its border width to the offset\nfor(var a in plotOffset){if(typeof options.grid.borderWidth==\"object\"){plotOffset[a]+=showGrid?options.grid.borderWidth[a]:0}else{plotOffset[a]+=showGrid?options.grid.borderWidth:0}}$.each(axes,function(_,axis){var axisOpts=axis.options;axis.show=axisOpts.show==null?axis.used:axisOpts.show;axis.reserveSpace=axisOpts.reserveSpace==null?axis.show:axisOpts.reserveSpace;setRange(axis)});if(showGrid){var allocatedAxes=$.grep(axes,function(axis){return axis.show||axis.reserveSpace});$.each(allocatedAxes,function(_,axis){\n// make the ticks\nsetupTickGeneration(axis);setTicks(axis);snapRangeToTicks(axis,axis.ticks);\n// find labelWidth/Height for axis\nmeasureTickLabels(axis)});\n// with all dimensions calculated, we can compute the\n// axis bounding boxes, start from the outside\n// (reverse order)\nfor(i=allocatedAxes.length-1;i>=0;--i)allocateAxisBoxFirstPhase(allocatedAxes[i]);\n// make sure we've got enough space for things that\n// might stick out\nadjustLayoutForThingsStickingOut();$.each(allocatedAxes,function(_,axis){allocateAxisBoxSecondPhase(axis)})}plotWidth=surface.width-plotOffset.left-plotOffset.right;plotHeight=surface.height-plotOffset.bottom-plotOffset.top;\n// now we got the proper plot dimensions, we can compute the scaling\n$.each(axes,function(_,axis){setTransformationHelpers(axis)});if(showGrid){drawAxisLabels()}insertLegend()}function setRange(axis){var opts=axis.options,min=+(opts.min!=null?opts.min:axis.datamin),max=+(opts.max!=null?opts.max:axis.datamax),delta=max-min;if(delta==0){\n// degenerate case\nvar widen=max==0?1:.01;if(opts.min==null)min-=widen;\n// always widen max if we couldn't widen min to ensure we\n// don't fall into min == max which doesn't work\nif(opts.max==null||opts.min!=null)max+=widen}else{\n// consider autoscaling\nvar margin=opts.autoscaleMargin;if(margin!=null){if(opts.min==null){min-=delta*margin;\n// make sure we don't go below zero if all values\n// are positive\nif(min<0&&axis.datamin!=null&&axis.datamin>=0)min=0}if(opts.max==null){max+=delta*margin;if(max>0&&axis.datamax!=null&&axis.datamax<=0)max=0}}}axis.min=min;axis.max=max}function setupTickGeneration(axis){var opts=axis.options;\n// estimate number of ticks\nvar noTicks;if(typeof opts.ticks==\"number\"&&opts.ticks>0)noTicks=opts.ticks;else\n// heuristic based on the model a*sqrt(x) fitted to\n// some data points that seemed reasonable\nnoTicks=.3*Math.sqrt(axis.direction==\"x\"?surface.width:surface.height);var delta=(axis.max-axis.min)/noTicks,dec=-Math.floor(Math.log(delta)/Math.LN10),maxDec=opts.tickDecimals;if(maxDec!=null&&dec>maxDec){dec=maxDec}var magn=Math.pow(10,-dec),norm=delta/magn,// norm is between 1.0 and 10.0\nsize;if(norm<1.5){size=1}else if(norm<3){size=2;\n// special case for 2.5, requires an extra decimal\nif(norm>2.25&&(maxDec==null||dec+1<=maxDec)){size=2.5;++dec}}else if(norm<7.5){size=5}else{size=10}size*=magn;if(opts.minTickSize!=null&&size<opts.minTickSize){size=opts.minTickSize}axis.delta=delta;axis.tickDecimals=Math.max(0,maxDec!=null?maxDec:dec);axis.tickSize=opts.tickSize||size;\n// Time mode was moved to a plug-in in 0.8, and since so many people use it\n// we'll add an especially friendly reminder to make sure they included it.\nif(opts.mode==\"time\"&&!axis.tickGenerator){throw new Error(\"Time mode requires the flot.time plugin.\")}\n// Flot supports base-10 axes; any other mode else is handled by a plug-in,\n// like flot.time.js.\nif(!axis.tickGenerator){axis.tickGenerator=function(axis){var ticks=[],start=floorInBase(axis.min,axis.tickSize),i=0,v=Number.NaN,prev;do{prev=v;v=start+i*axis.tickSize;ticks.push(v);++i}while(v<axis.max&&v!=prev);return ticks};axis.tickFormatter=function(value,axis){var factor=axis.tickDecimals?Math.pow(10,axis.tickDecimals):1;var formatted=\"\"+Math.round(value*factor)/factor;\n// If tickDecimals was specified, ensure that we have exactly that\n// much precision; otherwise default to the value's own precision.\nif(axis.tickDecimals!=null){var decimal=formatted.indexOf(\".\");var precision=decimal==-1?0:formatted.length-decimal-1;if(precision<axis.tickDecimals){return(precision?formatted:formatted+\".\")+(\"\"+factor).substr(1,axis.tickDecimals-precision)}}return formatted}}if($.isFunction(opts.tickFormatter))axis.tickFormatter=function(v,axis){return\"\"+opts.tickFormatter(v,axis)};if(opts.alignTicksWithAxis!=null){var otherAxis=(axis.direction==\"x\"?xaxes:yaxes)[opts.alignTicksWithAxis-1];if(otherAxis&&otherAxis.used&&otherAxis!=axis){\n// consider snapping min/max to outermost nice ticks\nvar niceTicks=axis.tickGenerator(axis);if(niceTicks.length>0){if(opts.min==null)axis.min=Math.min(axis.min,niceTicks[0]);if(opts.max==null&&niceTicks.length>1)axis.max=Math.max(axis.max,niceTicks[niceTicks.length-1])}axis.tickGenerator=function(axis){\n// copy ticks, scaled to this axis\nvar ticks=[],v,i;for(i=0;i<otherAxis.ticks.length;++i){v=(otherAxis.ticks[i].v-otherAxis.min)/(otherAxis.max-otherAxis.min);v=axis.min+v*(axis.max-axis.min);ticks.push(v)}return ticks};\n// we might need an extra decimal since forced\n// ticks don't necessarily fit naturally\nif(!axis.mode&&opts.tickDecimals==null){var extraDec=Math.max(0,-Math.floor(Math.log(axis.delta)/Math.LN10)+1),ts=axis.tickGenerator(axis);\n// only proceed if the tick interval rounded\n// with an extra decimal doesn't give us a\n// zero at end\nif(!(ts.length>1&&/\\..*0$/.test((ts[1]-ts[0]).toFixed(extraDec))))axis.tickDecimals=extraDec}}}}function setTicks(axis){var oticks=axis.options.ticks,ticks=[];if(oticks==null||typeof oticks==\"number\"&&oticks>0)ticks=axis.tickGenerator(axis);else if(oticks){if($.isFunction(oticks))\n// generate the ticks\nticks=oticks(axis);else ticks=oticks}\n// clean up/labelify the supplied ticks, copy them over\nvar i,v;axis.ticks=[];for(i=0;i<ticks.length;++i){var label=null;var t=ticks[i];if(typeof t==\"object\"){v=+t[0];if(t.length>1)label=t[1]}else v=+t;if(label==null)label=axis.tickFormatter(v,axis);if(!isNaN(v))axis.ticks.push({v:v,label:label})}}function snapRangeToTicks(axis,ticks){if(axis.options.autoscaleMargin&&ticks.length>0){\n// snap to ticks\nif(axis.options.min==null)axis.min=Math.min(axis.min,ticks[0].v);if(axis.options.max==null&&ticks.length>1)axis.max=Math.max(axis.max,ticks[ticks.length-1].v)}}function draw(){surface.clear();executeHooks(hooks.drawBackground,[ctx]);var grid=options.grid;\n// draw background, if any\nif(grid.show&&grid.backgroundColor)drawBackground();if(grid.show&&!grid.aboveData){drawGrid()}for(var i=0;i<series.length;++i){executeHooks(hooks.drawSeries,[ctx,series[i]]);drawSeries(series[i])}executeHooks(hooks.draw,[ctx]);if(grid.show&&grid.aboveData){drawGrid()}surface.render();\n// A draw implies that either the axes or data have changed, so we\n// should probably update the overlay highlights as well.\ntriggerRedrawOverlay()}function extractRange(ranges,coord){var axis,from,to,key,axes=allAxes();for(var i=0;i<axes.length;++i){axis=axes[i];if(axis.direction==coord){key=coord+axis.n+\"axis\";if(!ranges[key]&&axis.n==1)key=coord+\"axis\";// support x1axis as xaxis\nif(ranges[key]){from=ranges[key].from;to=ranges[key].to;break}}}\n// backwards-compat stuff - to be removed in future\nif(!ranges[key]){axis=coord==\"x\"?xaxes[0]:yaxes[0];from=ranges[coord+\"1\"];to=ranges[coord+\"2\"]}\n// auto-reverse as an added bonus\nif(from!=null&&to!=null&&from>to){var tmp=from;from=to;to=tmp}return{from:from,to:to,axis:axis}}function drawBackground(){ctx.save();ctx.translate(plotOffset.left,plotOffset.top);ctx.fillStyle=getColorOrGradient(options.grid.backgroundColor,plotHeight,0,\"rgba(255, 255, 255, 0)\");ctx.fillRect(0,0,plotWidth,plotHeight);ctx.restore()}function drawGrid(){var i,axes,bw,bc;ctx.save();ctx.translate(plotOffset.left,plotOffset.top);\n// draw markings\nvar markings=options.grid.markings;if(markings){if($.isFunction(markings)){axes=plot.getAxes();\n// xmin etc. is backwards compatibility, to be\n// removed in the future\naxes.xmin=axes.xaxis.min;axes.xmax=axes.xaxis.max;axes.ymin=axes.yaxis.min;axes.ymax=axes.yaxis.max;markings=markings(axes)}for(i=0;i<markings.length;++i){var m=markings[i],xrange=extractRange(m,\"x\"),yrange=extractRange(m,\"y\");\n// fill in missing\nif(xrange.from==null)xrange.from=xrange.axis.min;if(xrange.to==null)xrange.to=xrange.axis.max;if(yrange.from==null)yrange.from=yrange.axis.min;if(yrange.to==null)yrange.to=yrange.axis.max;\n// clip\nif(xrange.to<xrange.axis.min||xrange.from>xrange.axis.max||yrange.to<yrange.axis.min||yrange.from>yrange.axis.max)continue;xrange.from=Math.max(xrange.from,xrange.axis.min);xrange.to=Math.min(xrange.to,xrange.axis.max);yrange.from=Math.max(yrange.from,yrange.axis.min);yrange.to=Math.min(yrange.to,yrange.axis.max);var xequal=xrange.from===xrange.to,yequal=yrange.from===yrange.to;if(xequal&&yequal){continue}\n// then draw\nxrange.from=Math.floor(xrange.axis.p2c(xrange.from));xrange.to=Math.floor(xrange.axis.p2c(xrange.to));yrange.from=Math.floor(yrange.axis.p2c(yrange.from));yrange.to=Math.floor(yrange.axis.p2c(yrange.to));if(xequal||yequal){var lineWidth=m.lineWidth||options.grid.markingsLineWidth,subPixel=lineWidth%2?.5:0;ctx.beginPath();ctx.strokeStyle=m.color||options.grid.markingsColor;ctx.lineWidth=lineWidth;if(xequal){ctx.moveTo(xrange.to+subPixel,yrange.from);ctx.lineTo(xrange.to+subPixel,yrange.to)}else{ctx.moveTo(xrange.from,yrange.to+subPixel);ctx.lineTo(xrange.to,yrange.to+subPixel)}ctx.stroke()}else{ctx.fillStyle=m.color||options.grid.markingsColor;ctx.fillRect(xrange.from,yrange.to,xrange.to-xrange.from,yrange.from-yrange.to)}}}\n// draw the ticks\naxes=allAxes();bw=options.grid.borderWidth;for(var j=0;j<axes.length;++j){var axis=axes[j],box=axis.box,t=axis.tickLength,x,y,xoff,yoff;if(!axis.show||axis.ticks.length==0)continue;ctx.lineWidth=1;\n// find the edges\nif(axis.direction==\"x\"){x=0;if(t==\"full\")y=axis.position==\"top\"?0:plotHeight;else y=box.top-plotOffset.top+(axis.position==\"top\"?box.height:0)}else{y=0;if(t==\"full\")x=axis.position==\"left\"?0:plotWidth;else x=box.left-plotOffset.left+(axis.position==\"left\"?box.width:0)}\n// draw tick bar\nif(!axis.innermost){ctx.strokeStyle=axis.options.color;ctx.beginPath();xoff=yoff=0;if(axis.direction==\"x\")xoff=plotWidth+1;else yoff=plotHeight+1;if(ctx.lineWidth==1){if(axis.direction==\"x\"){y=Math.floor(y)+.5}else{x=Math.floor(x)+.5}}ctx.moveTo(x,y);ctx.lineTo(x+xoff,y+yoff);ctx.stroke()}\n// draw ticks\nctx.strokeStyle=axis.options.tickColor;ctx.beginPath();for(i=0;i<axis.ticks.length;++i){var v=axis.ticks[i].v;xoff=yoff=0;if(isNaN(v)||v<axis.min||v>axis.max||t==\"full\"&&(typeof bw==\"object\"&&bw[axis.position]>0||bw>0)&&(v==axis.min||v==axis.max))continue;if(axis.direction==\"x\"){x=axis.p2c(v);yoff=t==\"full\"?-plotHeight:t;if(axis.position==\"top\")yoff=-yoff}else{y=axis.p2c(v);xoff=t==\"full\"?-plotWidth:t;if(axis.position==\"left\")xoff=-xoff}if(ctx.lineWidth==1){if(axis.direction==\"x\")x=Math.floor(x)+.5;else y=Math.floor(y)+.5}ctx.moveTo(x,y);ctx.lineTo(x+xoff,y+yoff)}ctx.stroke()}\n// draw border\nif(bw){\n// If either borderWidth or borderColor is an object, then draw the border\n// line by line instead of as one rectangle\nbc=options.grid.borderColor;if(typeof bw==\"object\"||typeof bc==\"object\"){if(typeof bw!==\"object\"){bw={top:bw,right:bw,bottom:bw,left:bw}}if(typeof bc!==\"object\"){bc={top:bc,right:bc,bottom:bc,left:bc}}if(bw.top>0){ctx.strokeStyle=bc.top;ctx.lineWidth=bw.top;ctx.beginPath();ctx.moveTo(0-bw.left,0-bw.top/2);ctx.lineTo(plotWidth,0-bw.top/2);ctx.stroke()}if(bw.right>0){ctx.strokeStyle=bc.right;ctx.lineWidth=bw.right;ctx.beginPath();ctx.moveTo(plotWidth+bw.right/2,0-bw.top);ctx.lineTo(plotWidth+bw.right/2,plotHeight);ctx.stroke()}if(bw.bottom>0){ctx.strokeStyle=bc.bottom;ctx.lineWidth=bw.bottom;ctx.beginPath();ctx.moveTo(plotWidth+bw.right,plotHeight+bw.bottom/2);ctx.lineTo(0,plotHeight+bw.bottom/2);ctx.stroke()}if(bw.left>0){ctx.strokeStyle=bc.left;ctx.lineWidth=bw.left;ctx.beginPath();ctx.moveTo(0-bw.left/2,plotHeight+bw.bottom);ctx.lineTo(0-bw.left/2,0);ctx.stroke()}}else{ctx.lineWidth=bw;ctx.strokeStyle=options.grid.borderColor;ctx.strokeRect(-bw/2,-bw/2,plotWidth+bw,plotHeight+bw)}}ctx.restore()}function drawAxisLabels(){$.each(allAxes(),function(_,axis){var box=axis.box,legacyStyles=axis.direction+\"Axis \"+axis.direction+axis.n+\"Axis\",layer=\"flot-\"+axis.direction+\"-axis flot-\"+axis.direction+axis.n+\"-axis \"+legacyStyles,font=axis.options.font||\"flot-tick-label tickLabel\",tick,x,y,halign,valign;\n// Remove text before checking for axis.show and ticks.length;\n// otherwise plugins, like flot-tickrotor, that draw their own\n// tick labels will end up with both theirs and the defaults.\nsurface.removeText(layer);if(!axis.show||axis.ticks.length==0)return;for(var i=0;i<axis.ticks.length;++i){tick=axis.ticks[i];if(!tick.label||tick.v<axis.min||tick.v>axis.max)continue;if(axis.direction==\"x\"){halign=\"center\";x=plotOffset.left+axis.p2c(tick.v);if(axis.position==\"bottom\"){y=box.top+box.padding}else{y=box.top+box.height-box.padding;valign=\"bottom\"}}else{valign=\"middle\";y=plotOffset.top+axis.p2c(tick.v);if(axis.position==\"left\"){x=box.left+box.width-box.padding;halign=\"right\"}else{x=box.left+box.padding}}surface.addText(layer,x,y,tick.label,font,null,null,halign,valign)}})}function drawSeries(series){if(series.lines.show)drawSeriesLines(series);if(series.bars.show)drawSeriesBars(series);if(series.points.show)drawSeriesPoints(series)}function drawSeriesLines(series){function plotLine(datapoints,xoffset,yoffset,axisx,axisy){var points=datapoints.points,ps=datapoints.pointsize,prevx=null,prevy=null;ctx.beginPath();for(var i=ps;i<points.length;i+=ps){var x1=points[i-ps],y1=points[i-ps+1],x2=points[i],y2=points[i+1];if(x1==null||x2==null)continue;\n// clip with ymin\nif(y1<=y2&&y1<axisy.min){if(y2<axisy.min)continue;// line segment is outside\n// compute new intersection point\nx1=(axisy.min-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.min}else if(y2<=y1&&y2<axisy.min){if(y1<axisy.min)continue;x2=(axisy.min-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.min}\n// clip with ymax\nif(y1>=y2&&y1>axisy.max){if(y2>axisy.max)continue;x1=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.max}else if(y2>=y1&&y2>axisy.max){if(y1>axisy.max)continue;x2=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.max}\n// clip with xmin\nif(x1<=x2&&x1<axisx.min){if(x2<axisx.min)continue;y1=(axisx.min-x1)/(x2-x1)*(y2-y1)+y1;x1=axisx.min}else if(x2<=x1&&x2<axisx.min){if(x1<axisx.min)continue;y2=(axisx.min-x1)/(x2-x1)*(y2-y1)+y1;x2=axisx.min}\n// clip with xmax\nif(x1>=x2&&x1>axisx.max){if(x2>axisx.max)continue;y1=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x1=axisx.max}else if(x2>=x1&&x2>axisx.max){if(x1>axisx.max)continue;y2=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x2=axisx.max}if(x1!=prevx||y1!=prevy)ctx.moveTo(axisx.p2c(x1)+xoffset,axisy.p2c(y1)+yoffset);prevx=x2;prevy=y2;ctx.lineTo(axisx.p2c(x2)+xoffset,axisy.p2c(y2)+yoffset)}ctx.stroke()}function plotLineArea(datapoints,axisx,axisy){var points=datapoints.points,ps=datapoints.pointsize,bottom=Math.min(Math.max(0,axisy.min),axisy.max),i=0,top,areaOpen=false,ypos=1,segmentStart=0,segmentEnd=0;\n// we process each segment in two turns, first forward\n// direction to sketch out top, then once we hit the\n// end we go backwards to sketch the bottom\nwhile(true){if(ps>0&&i>points.length+ps)break;i+=ps;// ps is negative if going backwards\nvar x1=points[i-ps],y1=points[i-ps+ypos],x2=points[i],y2=points[i+ypos];if(areaOpen){if(ps>0&&x1!=null&&x2==null){\n// at turning point\nsegmentEnd=i;ps=-ps;ypos=2;continue}if(ps<0&&i==segmentStart+ps){\n// done with the reverse sweep\nctx.fill();areaOpen=false;ps=-ps;ypos=1;i=segmentStart=segmentEnd+ps;continue}}if(x1==null||x2==null)continue;\n// clip x values\n// clip with xmin\nif(x1<=x2&&x1<axisx.min){if(x2<axisx.min)continue;y1=(axisx.min-x1)/(x2-x1)*(y2-y1)+y1;x1=axisx.min}else if(x2<=x1&&x2<axisx.min){if(x1<axisx.min)continue;y2=(axisx.min-x1)/(x2-x1)*(y2-y1)+y1;x2=axisx.min}\n// clip with xmax\nif(x1>=x2&&x1>axisx.max){if(x2>axisx.max)continue;y1=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x1=axisx.max}else if(x2>=x1&&x2>axisx.max){if(x1>axisx.max)continue;y2=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x2=axisx.max}if(!areaOpen){\n// open area\nctx.beginPath();ctx.moveTo(axisx.p2c(x1),axisy.p2c(bottom));areaOpen=true}\n// now first check the case where both is outside\nif(y1>=axisy.max&&y2>=axisy.max){ctx.lineTo(axisx.p2c(x1),axisy.p2c(axisy.max));ctx.lineTo(axisx.p2c(x2),axisy.p2c(axisy.max));continue}else if(y1<=axisy.min&&y2<=axisy.min){ctx.lineTo(axisx.p2c(x1),axisy.p2c(axisy.min));ctx.lineTo(axisx.p2c(x2),axisy.p2c(axisy.min));continue}\n// else it's a bit more complicated, there might\n// be a flat maxed out rectangle first, then a\n// triangular cutout or reverse; to find these\n// keep track of the current x values\nvar x1old=x1,x2old=x2;\n// clip the y values, without shortcutting, we\n// go through all cases in turn\n// clip with ymin\nif(y1<=y2&&y1<axisy.min&&y2>=axisy.min){x1=(axisy.min-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.min}else if(y2<=y1&&y2<axisy.min&&y1>=axisy.min){x2=(axisy.min-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.min}\n// clip with ymax\nif(y1>=y2&&y1>axisy.max&&y2<=axisy.max){x1=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.max}else if(y2>=y1&&y2>axisy.max&&y1<=axisy.max){x2=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.max}\n// if the x value was changed we got a rectangle\n// to fill\nif(x1!=x1old){ctx.lineTo(axisx.p2c(x1old),axisy.p2c(y1))}\n// fill triangular section, this sometimes result\n// in redundant points if (x1, y1) hasn't changed\n// from previous line to, but we just ignore that\nctx.lineTo(axisx.p2c(x1),axisy.p2c(y1));ctx.lineTo(axisx.p2c(x2),axisy.p2c(y2));\n// fill the other rectangle if it's there\nif(x2!=x2old){ctx.lineTo(axisx.p2c(x2),axisy.p2c(y2));ctx.lineTo(axisx.p2c(x2old),axisy.p2c(y2))}}}ctx.save();ctx.translate(plotOffset.left,plotOffset.top);ctx.lineJoin=\"round\";var lw=series.lines.lineWidth,sw=series.shadowSize;\n// FIXME: consider another form of shadow when filling is turned on\nif(lw>0&&sw>0){\n// draw shadow as a thick and thin line with transparency\nctx.lineWidth=sw;ctx.strokeStyle=\"rgba(0,0,0,0.1)\";\n// position shadow at angle from the mid of line\nvar angle=Math.PI/18;plotLine(series.datapoints,Math.sin(angle)*(lw/2+sw/2),Math.cos(angle)*(lw/2+sw/2),series.xaxis,series.yaxis);ctx.lineWidth=sw/2;plotLine(series.datapoints,Math.sin(angle)*(lw/2+sw/4),Math.cos(angle)*(lw/2+sw/4),series.xaxis,series.yaxis)}ctx.lineWidth=lw;ctx.strokeStyle=series.color;var fillStyle=getFillStyle(series.lines,series.color,0,plotHeight);if(fillStyle){ctx.fillStyle=fillStyle;plotLineArea(series.datapoints,series.xaxis,series.yaxis)}if(lw>0)plotLine(series.datapoints,0,0,series.xaxis,series.yaxis);ctx.restore()}function drawSeriesPoints(series){function plotPoints(datapoints,radius,fillStyle,offset,shadow,axisx,axisy,symbol){var points=datapoints.points,ps=datapoints.pointsize;for(var i=0;i<points.length;i+=ps){var x=points[i],y=points[i+1];if(x==null||x<axisx.min||x>axisx.max||y<axisy.min||y>axisy.max)continue;ctx.beginPath();x=axisx.p2c(x);y=axisy.p2c(y)+offset;if(symbol==\"circle\")ctx.arc(x,y,radius,0,shadow?Math.PI:Math.PI*2,false);else symbol(ctx,x,y,radius,shadow);ctx.closePath();if(fillStyle){ctx.fillStyle=fillStyle;ctx.fill()}ctx.stroke()}}ctx.save();ctx.translate(plotOffset.left,plotOffset.top);var lw=series.points.lineWidth,sw=series.shadowSize,radius=series.points.radius,symbol=series.points.symbol;\n// If the user sets the line width to 0, we change it to a very \n// small value. A line width of 0 seems to force the default of 1.\n// Doing the conditional here allows the shadow setting to still be \n// optional even with a lineWidth of 0.\nif(lw==0)lw=1e-4;if(lw>0&&sw>0){\n// draw shadow in two steps\nvar w=sw/2;ctx.lineWidth=w;ctx.strokeStyle=\"rgba(0,0,0,0.1)\";plotPoints(series.datapoints,radius,null,w+w/2,true,series.xaxis,series.yaxis,symbol);ctx.strokeStyle=\"rgba(0,0,0,0.2)\";plotPoints(series.datapoints,radius,null,w/2,true,series.xaxis,series.yaxis,symbol)}ctx.lineWidth=lw;ctx.strokeStyle=series.color;plotPoints(series.datapoints,radius,getFillStyle(series.points,series.color),0,false,series.xaxis,series.yaxis,symbol);ctx.restore()}function drawBar(x,y,b,barLeft,barRight,fillStyleCallback,axisx,axisy,c,horizontal,lineWidth){var left,right,bottom,top,drawLeft,drawRight,drawTop,drawBottom,tmp;\n// in horizontal mode, we start the bar from the left\n// instead of from the bottom so it appears to be\n// horizontal rather than vertical\nif(horizontal){drawBottom=drawRight=drawTop=true;drawLeft=false;left=b;right=x;top=y+barLeft;bottom=y+barRight;\n// account for negative bars\nif(right<left){tmp=right;right=left;left=tmp;drawLeft=true;drawRight=false}}else{drawLeft=drawRight=drawTop=true;drawBottom=false;left=x+barLeft;right=x+barRight;bottom=b;top=y;\n// account for negative bars\nif(top<bottom){tmp=top;top=bottom;bottom=tmp;drawBottom=true;drawTop=false}}\n// clip\nif(right<axisx.min||left>axisx.max||top<axisy.min||bottom>axisy.max)return;if(left<axisx.min){left=axisx.min;drawLeft=false}if(right>axisx.max){right=axisx.max;drawRight=false}if(bottom<axisy.min){bottom=axisy.min;drawBottom=false}if(top>axisy.max){top=axisy.max;drawTop=false}left=axisx.p2c(left);bottom=axisy.p2c(bottom);right=axisx.p2c(right);top=axisy.p2c(top);\n// fill the bar\nif(fillStyleCallback){c.fillStyle=fillStyleCallback(bottom,top);c.fillRect(left,top,right-left,bottom-top)}\n// draw outline\nif(lineWidth>0&&(drawLeft||drawRight||drawTop||drawBottom)){c.beginPath();\n// FIXME: inline moveTo is buggy with excanvas\nc.moveTo(left,bottom);if(drawLeft)c.lineTo(left,top);else c.moveTo(left,top);if(drawTop)c.lineTo(right,top);else c.moveTo(right,top);if(drawRight)c.lineTo(right,bottom);else c.moveTo(right,bottom);if(drawBottom)c.lineTo(left,bottom);else c.moveTo(left,bottom);c.stroke()}}function drawSeriesBars(series){function plotBars(datapoints,barLeft,barRight,fillStyleCallback,axisx,axisy){var points=datapoints.points,ps=datapoints.pointsize;for(var i=0;i<points.length;i+=ps){if(points[i]==null)continue;drawBar(points[i],points[i+1],points[i+2],barLeft,barRight,fillStyleCallback,axisx,axisy,ctx,series.bars.horizontal,series.bars.lineWidth)}}ctx.save();ctx.translate(plotOffset.left,plotOffset.top);\n// FIXME: figure out a way to add shadows (for instance along the right edge)\nctx.lineWidth=series.bars.lineWidth;ctx.strokeStyle=series.color;var barLeft;switch(series.bars.align){case\"left\":barLeft=0;break;case\"right\":barLeft=-series.bars.barWidth;break;default:barLeft=-series.bars.barWidth/2}var fillStyleCallback=series.bars.fill?function(bottom,top){return getFillStyle(series.bars,series.color,bottom,top)}:null;plotBars(series.datapoints,barLeft,barLeft+series.bars.barWidth,fillStyleCallback,series.xaxis,series.yaxis);ctx.restore()}function getFillStyle(filloptions,seriesColor,bottom,top){var fill=filloptions.fill;if(!fill)return null;if(filloptions.fillColor)return getColorOrGradient(filloptions.fillColor,bottom,top,seriesColor);var c=$.color.parse(seriesColor);c.a=typeof fill==\"number\"?fill:.4;c.normalize();return c.toString()}function insertLegend(){if(options.legend.container!=null){$(options.legend.container).html(\"\")}else{placeholder.find(\".legend\").remove()}if(!options.legend.show){return}var fragments=[],entries=[],rowStarted=false,lf=options.legend.labelFormatter,s,label;\n// Build a list of legend entries, with each having a label and a color\nfor(var i=0;i<series.length;++i){s=series[i];if(s.label){label=lf?lf(s.label,s):s.label;if(label){entries.push({label:label,color:s.color})}}}\n// Sort the legend using either the default or a custom comparator\nif(options.legend.sorted){if($.isFunction(options.legend.sorted)){entries.sort(options.legend.sorted)}else if(options.legend.sorted==\"reverse\"){entries.reverse()}else{var ascending=options.legend.sorted!=\"descending\";entries.sort(function(a,b){return a.label==b.label?0:a.label<b.label!=ascending?1:-1})}}\n// Generate markup for the list of entries, in their final order\nfor(var i=0;i<entries.length;++i){var entry=entries[i];if(i%options.legend.noColumns==0){if(rowStarted)fragments.push(\"</tr>\");fragments.push(\"<tr>\");rowStarted=true}fragments.push('<td class=\"legendColorBox\"><div style=\"border:1px solid '+options.legend.labelBoxBorderColor+';padding:1px\"><div style=\"width:4px;height:0;border:5px solid '+entry.color+';overflow:hidden\"></div></div></td>'+'<td class=\"legendLabel\">'+entry.label+\"</td>\")}if(rowStarted)fragments.push(\"</tr>\");if(fragments.length==0)return;var table='<table style=\"font-size:smaller;color:'+options.grid.color+'\">'+fragments.join(\"\")+\"</table>\";if(options.legend.container!=null)$(options.legend.container).html(table);else{var pos=\"\",p=options.legend.position,m=options.legend.margin;if(m[0]==null)m=[m,m];if(p.charAt(0)==\"n\")pos+=\"top:\"+(m[1]+plotOffset.top)+\"px;\";else if(p.charAt(0)==\"s\")pos+=\"bottom:\"+(m[1]+plotOffset.bottom)+\"px;\";if(p.charAt(1)==\"e\")pos+=\"right:\"+(m[0]+plotOffset.right)+\"px;\";else if(p.charAt(1)==\"w\")pos+=\"left:\"+(m[0]+plotOffset.left)+\"px;\";var legend=$('<div class=\"legend\">'+table.replace('style=\"','style=\"position:absolute;'+pos+\";\")+\"</div>\").appendTo(placeholder);if(options.legend.backgroundOpacity!=0){\n// put in the transparent background\n// separately to avoid blended labels and\n// label boxes\nvar c=options.legend.backgroundColor;if(c==null){c=options.grid.backgroundColor;if(c&&typeof c==\"string\")c=$.color.parse(c);else c=$.color.extract(legend,\"background-color\");c.a=1;c=c.toString()}var div=legend.children();$('<div style=\"position:absolute;width:'+div.width()+\"px;height:\"+div.height()+\"px;\"+pos+\"background-color:\"+c+';\"> </div>').prependTo(legend).css(\"opacity\",options.legend.backgroundOpacity)}}}\n// interactive features\nvar highlights=[],redrawTimeout=null;\n// returns the data item the mouse is over, or null if none is found\nfunction findNearbyItem(mouseX,mouseY,seriesFilter){var maxDistance=options.grid.mouseActiveRadius,smallestDistance=maxDistance*maxDistance+1,item=null,foundPoint=false,i,j,ps;for(i=series.length-1;i>=0;--i){if(!seriesFilter(series[i]))continue;var s=series[i],axisx=s.xaxis,axisy=s.yaxis,points=s.datapoints.points,mx=axisx.c2p(mouseX),// precompute some stuff to make the loop faster\nmy=axisy.c2p(mouseY),maxx=maxDistance/axisx.scale,maxy=maxDistance/axisy.scale;ps=s.datapoints.pointsize;\n// with inverse transforms, we can't use the maxx/maxy\n// optimization, sadly\nif(axisx.options.inverseTransform)maxx=Number.MAX_VALUE;if(axisy.options.inverseTransform)maxy=Number.MAX_VALUE;if(s.lines.show||s.points.show){for(j=0;j<points.length;j+=ps){var x=points[j],y=points[j+1];if(x==null)continue;\n// For points and lines, the cursor must be within a\n// certain distance to the data point\nif(x-mx>maxx||x-mx<-maxx||y-my>maxy||y-my<-maxy)continue;\n// We have to calculate distances in pixels, not in\n// data units, because the scales of the axes may be different\nvar dx=Math.abs(axisx.p2c(x)-mouseX),dy=Math.abs(axisy.p2c(y)-mouseY),dist=dx*dx+dy*dy;// we save the sqrt\n// use <= to ensure last point takes precedence\n// (last generally means on top of)\nif(dist<smallestDistance){smallestDistance=dist;item=[i,j/ps]}}}if(s.bars.show&&!item){// no other point can be nearby\nvar barLeft,barRight;switch(s.bars.align){case\"left\":barLeft=0;break;case\"right\":barLeft=-s.bars.barWidth;break;default:barLeft=-s.bars.barWidth/2}barRight=barLeft+s.bars.barWidth;for(j=0;j<points.length;j+=ps){var x=points[j],y=points[j+1],b=points[j+2];if(x==null)continue;\n// for a bar graph, the cursor must be inside the bar\nif(series[i].bars.horizontal?mx<=Math.max(b,x)&&mx>=Math.min(b,x)&&my>=y+barLeft&&my<=y+barRight:mx>=x+barLeft&&mx<=x+barRight&&my>=Math.min(b,y)&&my<=Math.max(b,y))item=[i,j/ps]}}}if(item){i=item[0];j=item[1];ps=series[i].datapoints.pointsize;return{datapoint:series[i].datapoints.points.slice(j*ps,(j+1)*ps),dataIndex:j,series:series[i],seriesIndex:i}}return null}function onMouseMove(e){if(options.grid.hoverable)triggerClickHoverEvent(\"plothover\",e,function(s){return s[\"hoverable\"]!=false})}function onMouseLeave(e){if(options.grid.hoverable)triggerClickHoverEvent(\"plothover\",e,function(s){return false})}function onClick(e){triggerClickHoverEvent(\"plotclick\",e,function(s){return s[\"clickable\"]!=false})}\n// trigger click or hover event (they send the same parameters\n// so we share their code)\nfunction triggerClickHoverEvent(eventname,event,seriesFilter){var offset=eventHolder.offset(),canvasX=event.pageX-offset.left-plotOffset.left,canvasY=event.pageY-offset.top-plotOffset.top,pos=canvasToAxisCoords({left:canvasX,top:canvasY});pos.pageX=event.pageX;pos.pageY=event.pageY;var item=findNearbyItem(canvasX,canvasY,seriesFilter);if(item){\n// fill in mouse pos for any listeners out there\nitem.pageX=parseInt(item.series.xaxis.p2c(item.datapoint[0])+offset.left+plotOffset.left,10);item.pageY=parseInt(item.series.yaxis.p2c(item.datapoint[1])+offset.top+plotOffset.top,10)}if(options.grid.autoHighlight){\n// clear auto-highlights\nfor(var i=0;i<highlights.length;++i){var h=highlights[i];if(h.auto==eventname&&!(item&&h.series==item.series&&h.point[0]==item.datapoint[0]&&h.point[1]==item.datapoint[1]))unhighlight(h.series,h.point)}if(item)highlight(item.series,item.datapoint,eventname)}placeholder.trigger(eventname,[pos,item])}function triggerRedrawOverlay(){var t=options.interaction.redrawOverlayInterval;if(t==-1){// skip event queue\ndrawOverlay();return}if(!redrawTimeout)redrawTimeout=setTimeout(drawOverlay,t)}function drawOverlay(){redrawTimeout=null;\n// draw highlights\noctx.save();overlay.clear();octx.translate(plotOffset.left,plotOffset.top);var i,hi;for(i=0;i<highlights.length;++i){hi=highlights[i];if(hi.series.bars.show)drawBarHighlight(hi.series,hi.point);else drawPointHighlight(hi.series,hi.point)}octx.restore();executeHooks(hooks.drawOverlay,[octx])}function highlight(s,point,auto){if(typeof s==\"number\")s=series[s];if(typeof point==\"number\"){var ps=s.datapoints.pointsize;point=s.datapoints.points.slice(ps*point,ps*(point+1))}var i=indexOfHighlight(s,point);if(i==-1){highlights.push({series:s,point:point,auto:auto});triggerRedrawOverlay()}else if(!auto)highlights[i].auto=false}function unhighlight(s,point){if(s==null&&point==null){highlights=[];triggerRedrawOverlay();return}if(typeof s==\"number\")s=series[s];if(typeof point==\"number\"){var ps=s.datapoints.pointsize;point=s.datapoints.points.slice(ps*point,ps*(point+1))}var i=indexOfHighlight(s,point);if(i!=-1){highlights.splice(i,1);triggerRedrawOverlay()}}function indexOfHighlight(s,p){for(var i=0;i<highlights.length;++i){var h=highlights[i];if(h.series==s&&h.point[0]==p[0]&&h.point[1]==p[1])return i}return-1}function drawPointHighlight(series,point){var x=point[0],y=point[1],axisx=series.xaxis,axisy=series.yaxis,highlightColor=typeof series.highlightColor===\"string\"?series.highlightColor:$.color.parse(series.color).scale(\"a\",.5).toString();if(x<axisx.min||x>axisx.max||y<axisy.min||y>axisy.max)return;var pointRadius=series.points.radius+series.points.lineWidth/2;octx.lineWidth=pointRadius;octx.strokeStyle=highlightColor;var radius=1.5*pointRadius;x=axisx.p2c(x);y=axisy.p2c(y);octx.beginPath();if(series.points.symbol==\"circle\")octx.arc(x,y,radius,0,2*Math.PI,false);else series.points.symbol(octx,x,y,radius,false);octx.closePath();octx.stroke()}function drawBarHighlight(series,point){var highlightColor=typeof series.highlightColor===\"string\"?series.highlightColor:$.color.parse(series.color).scale(\"a\",.5).toString(),fillStyle=highlightColor,barLeft;switch(series.bars.align){case\"left\":barLeft=0;break;case\"right\":barLeft=-series.bars.barWidth;break;default:barLeft=-series.bars.barWidth/2}octx.lineWidth=series.bars.lineWidth;octx.strokeStyle=highlightColor;drawBar(point[0],point[1],point[2]||0,barLeft,barLeft+series.bars.barWidth,function(){return fillStyle},series.xaxis,series.yaxis,octx,series.bars.horizontal,series.bars.lineWidth)}function getColorOrGradient(spec,bottom,top,defaultColor){if(typeof spec==\"string\")return spec;else{\n// assume this is a gradient spec; IE currently only\n// supports a simple vertical gradient properly, so that's\n// what we support too\nvar gradient=ctx.createLinearGradient(0,top,0,bottom);for(var i=0,l=spec.colors.length;i<l;++i){var c=spec.colors[i];if(typeof c!=\"string\"){var co=$.color.parse(defaultColor);if(c.brightness!=null)co=co.scale(\"rgb\",c.brightness);if(c.opacity!=null)co.a*=c.opacity;c=co.toString()}gradient.addColorStop(i/(l-1),c)}return gradient}}}", "title": "" }, { "docid": "a280e77b33e90f5da08fce692561820f", "score": "0.5679889", "text": "function build () {\n viz.updateXScale(xScale, TIME_RANGE_LIMITS, graphSize.width)\n viz.updateYScale(yScale, data, graphSize.height)\n\n viz.drawXAxis(xScale, graphSize, svgGraph)\n viz.drawYAxis(yScale, graphSize, svgGraph)\n helper.positionLabels(graphSize.width, graphSize.height)\n\n viz.drawLines(data, xScale, yScale, svgGraph)\n \n viz.drawLegend(graphSize, marginVertical, svgGraph)\n viz.setHoverHandler(data, xScale, yScale, graphSize, bisect, svgGraph)\n }", "title": "" }, { "docid": "6dbe1f9c91569305f61850e972f860de", "score": "0.56762505", "text": "function plotNow() {\n var data = [];\n var sin = [], cos = [];\n var colors = ['#115b74', '#e49600', '#cc2b36', '#e18876'];\n var sliderMin = $('#math-x-range').slider('values', 0);\n var sliderMax = $('#math-x-range').slider('values', 1);\n\n for (var j = 0; j < 2; j++) {\n var dsin = [], dcos = [];\n for (var i = sliderMin; i < sliderMax; i += 0.5) {\n dsin.push([i, (j + 1) * (j + 3) * Math.sin(i)]);\n dcos.push([i, (j + 1) * (j + 3) * Math.cos(i)]);\n }\n a = (j + 1) * (j + 3);\n data.push({data: dsin, color: colors[j * 2], label: a + \" sin(x)\"});\n data.push({data: dcos, color: colors[j * 2 + 1], label: a + \" cos(x)\"});\n }\n ;\n\n if (plot) {\n plot.setData(data);\n plot.setupGrid();\n plot.draw();\n } else {\n plot = $.plot(target, data, options);\n }\n }", "title": "" }, { "docid": "0a5c3ad7c781677a75d7c2f1abf4f7b4", "score": "0.5661702", "text": "function buildAxes() {\n vis.axes\n .data(vis.allAxis).enter()\n .append(\"svg:line\").classed(\"axis-lines\", true)\n //changed here to include inner radius (1)\n .attr(\"x1\", function(d, i) { return config.w / 2 *(1- Math.sin(i * config.radians / vis.totalAxes +config.rotate)*config.innerRadius); })\n .attr(\"y1\", function(d, i) { return config.h / 2 *(1- Math.cos(i * config.radians / vis.totalAxes +config.rotate)*config.innerRadius); })\n .attr(\"x2\", function(d, i) { return config.w / 2 * (1 - Math.sin(i * config.radians / vis.totalAxes +config.rotate)); })\n .attr(\"y2\", function(d, i) { return config.h / 2 * (1 - Math.cos(i * config.radians / vis.totalAxes +config.rotate)); })\n .attr(\"stroke\", \"grey\")\n .attr(\"stroke-width\", \"1px\");\n }", "title": "" }, { "docid": "c505df7ba47cdc7f8515fc1198223e40", "score": "0.56607467", "text": "function init () {\n svg = document.getElementById(\"plot\");\n graph = document.getElementById(\"graph\");\n xaxis = document.getElementById(\"xaxis\");\n yaxis = document.getElementById(\"yaxis\");\n list = document.getElementById(\"funclist\");\n \n center_view();\n \n svg.style.width = view.pix.w;\n svg.style.height = view.pix.h;\n \n draw_grid();\n}", "title": "" }, { "docid": "765ef017f4883d47d282a3b42e37bf58", "score": "0.56580067", "text": "render_() {\n this.elementChart_ = d3.select('.' + Selector.CHART);\n this.elementAxis_ = d3.select('.' + Selector.AXIS);\n this.destroyTimeline_();\n this.initTimeline_();\n this.createChart_();\n this.createAxis_();\n }", "title": "" }, { "docid": "d16f1ad7a1540872c6afaf96a4354023", "score": "0.5643329", "text": "drawAxes() {\n this.statePlot.drawAxes(true)\n this.barChart.drawAxes()\n }", "title": "" }, { "docid": "ad2452bb8c6404c9cbe76633b8c96fc2", "score": "0.5628138", "text": "function gras_chart_factory_make(registry, args)\n{\n //create containers\n var chart_box = $('<table />').attr({class:'chart_container'});\n var tr = $('<tr />');\n var td = $('<td />');\n tr.append(td);\n\n //call into the factory\n try\n {\n var chart = new registry.chart_factories[args.chart_type](args, td.get(0));\n }\n catch(err)\n {\n return;\n }\n\n //setup the title\n var tr_title = $('<tr />');\n var th_title = $('<th />');\n tr_title.append(th_title);\n th_title.text(chart.title);\n\n //register the chart\n var chart_info = {chart:chart,args:args,panel:chart_box};\n registry.active_charts.push(chart_info);\n $('#charts_panel').append(chart_box);\n\n //close button\n var close_div = $('<div/>').attr({class:'chart_designer_block_close'});\n var close_href = $('<a />').attr({href:'#', class:\"ui-dialog-titlebar-close ui-corner-all\", role:\"button\"});\n var close_span = $('<span />').attr({class:\"ui-icon ui-icon-closethick\"}).text('close');\n close_div.append(close_href);\n close_href.append(close_span);\n th_title.append(close_div);\n $(close_href).click(function()\n {\n var index = $.inArray(chart_info, registry.active_charts);\n registry.active_charts.splice(index, 1);\n chart_box.remove();\n gras_chart_save(registry);\n });\n gras_chart_save(registry);\n\n //finish gui building\n chart_box.append(tr_title);\n chart_box.append(tr);\n\n //implement draggable and resizable from jquery ui\n var handle_stop = function(event, ui)\n {\n args['width'] = chart_box.width();\n args['height'] = chart_box.height();\n args['position'] = chart_box.offset();\n chart.gc_resize = false;\n chart.update(registry.point);\n gras_chart_save(registry);\n };\n\n if ('default_width' in chart) chart_box.width(chart.default_width);\n chart_box.resizable({stop: handle_stop, create: function(event, ui)\n {\n if ('width' in args) chart_box.width(args.width);\n if ('height' in args) chart_box.height(args.height);\n },\n start: function(event, ui)\n {\n chart.gc_resize = true;\n chart.update(registry.point);\n }});\n\n chart_box.css('position', 'absolute');\n chart_box.draggable({stop: handle_stop, create: function(event, ui)\n {\n if ('position' in args) chart_box.offset(args.position);\n }, cursor: \"move\"});\n\n //set the cursor on the title bar so its obvious\n tr_title.hover(\n function(){$(this).css('cursor','move'); close_div.show();},\n function(){$(this).css('cursor','auto'); close_div.hide();}\n );\n close_div.hide();\n}", "title": "" }, { "docid": "3f78dda8bfeca9e09802016617dc7c5e", "score": "0.5620909", "text": "draw(){\n // get the size of the svg we are drawing on\n let width,height;\n if(Object.keys(this.settings).indexOf(\"width\")>-1){\n width =this.settings.width;\n }else{\n width = this.svg.getBoundingClientRect().width;\n }\n if(Object.keys(this.settings).indexOf(\"height\")>-1){\n height =this.settings.height;\n }else{\n height = this.svg.getBoundingClientRect().height;\n }\n \n //remove the tree if it is there already\n select(this.svg).select(\"g\").remove();\n \n // add a group which will contain the new plot\n select(this.svg).append(\"g\")\n .attr(\"transform\",`translate(${this.margins.left},${this.margins.top})`);\n \n //to selecting every time\n this.svgSelection = select(this.svg).select(\"g\");\n\n this.svgSelection.append(\"g\").attr(\"class\", \"axes-layer\");\n\n this.addDataLayers();\n \n // create the scales\n const xScale = this.settings.xScaleType()\n .domain(this.layout.horizontalRange)\n .range([this.margins.left, width - this.margins.right-this.margins.left]);\n \n //height is total \n const yScale = this.settings.yScaleType()\n .domain(this.layout.verticalRange)\n .range([height -this.margins.bottom-this.margins.top,this.margins.top]);\n \n this.scales = {x:xScale, y:yScale, width, height};\n this.addAxis();\n \n // Called whenever the layout changes...\n this.layout.updateCallback = () => {\n this.update();\n }\n \n this.update();\n }", "title": "" }, { "docid": "a8c5c8f20d927e65fdc0de4c92e0372c", "score": "0.5617282", "text": "function createChart(options){var data=Chartist.normalizeData(this.data,options.reverseData,!0);// Create new svg object\nthis.svg=Chartist.createSvg(this.container,options.width,options.height,options.classNames.chart);// Create groups for labels, grid and series\nvar gridGroup=this.svg.elem(\"g\").addClass(options.classNames.gridGroup),seriesGroup=this.svg.elem(\"g\"),labelGroup=this.svg.elem(\"g\").addClass(options.classNames.labelGroup),chartRect=Chartist.createChartRect(this.svg,options,defaultOptions.padding),axisX,axisY;if(options.axisX.type===void 0){axisX=new Chartist.StepAxis(Chartist.Axis.units.x,data.normalized.series,chartRect,Chartist.extend({},options.axisX,{ticks:data.normalized.labels,stretch:options.fullWidth}))}else{axisX=options.axisX.type.call(Chartist,Chartist.Axis.units.x,data.normalized.series,chartRect,options.axisX)}if(options.axisY.type===void 0){axisY=new Chartist.AutoScaleAxis(Chartist.Axis.units.y,data.normalized.series,chartRect,Chartist.extend({},options.axisY,{high:Chartist.isNumeric(options.high)?options.high:options.axisY.high,low:Chartist.isNumeric(options.low)?options.low:options.axisY.low}))}else{axisY=options.axisY.type.call(Chartist,Chartist.Axis.units.y,data.normalized.series,chartRect,options.axisY)}axisX.createGridAndLabels(gridGroup,labelGroup,this.supportsForeignObject,options,this.eventEmitter);axisY.createGridAndLabels(gridGroup,labelGroup,this.supportsForeignObject,options,this.eventEmitter);if(options.showGridBackground){Chartist.createGridBackground(gridGroup,chartRect,options.classNames.gridBackground,this.eventEmitter)}// Draw the series\ndata.raw.series.forEach(function(series,seriesIndex){var seriesElement=seriesGroup.elem(\"g\");// Write attributes to series group element. If series name or meta is undefined the attributes will not be written\nseriesElement.attr({\"ct:series-name\":series.name,\"ct:meta\":Chartist.serialize(series.meta)});// Use series class from series data or if not set generate one\nseriesElement.addClass([options.classNames.series,series.className||options.classNames.series+\"-\"+Chartist.alphaNumerate(seriesIndex)].join(\" \"));var pathCoordinates=[],pathData=[];data.normalized.series[seriesIndex].forEach(function(value,valueIndex){var p={x:chartRect.x1+axisX.projectValue(value,valueIndex,data.normalized.series[seriesIndex]),y:chartRect.y1-axisY.projectValue(value,valueIndex,data.normalized.series[seriesIndex])};pathCoordinates.push(p.x,p.y);pathData.push({value:value,valueIndex:valueIndex,meta:Chartist.getMetaData(series,valueIndex)})}.bind(this));var seriesOptions={lineSmooth:Chartist.getSeriesOption(series,options,\"lineSmooth\"),showPoint:Chartist.getSeriesOption(series,options,\"showPoint\"),showLine:Chartist.getSeriesOption(series,options,\"showLine\"),showArea:Chartist.getSeriesOption(series,options,\"showArea\"),areaBase:Chartist.getSeriesOption(series,options,\"areaBase\")},smoothing=\"function\"===typeof seriesOptions.lineSmooth?seriesOptions.lineSmooth:seriesOptions.lineSmooth?Chartist.Interpolation.monotoneCubic():Chartist.Interpolation.none(),path=smoothing(pathCoordinates,pathData);// If we should show points we need to create them now to avoid secondary loop\n// Points are drawn from the pathElements returned by the interpolation function\n// Small offset for Firefox to render squares correctly\nif(seriesOptions.showPoint){path.pathElements.forEach(function(pathElement){var point=seriesElement.elem(\"line\",{x1:pathElement.x,y1:pathElement.y,x2:pathElement.x+.01,y2:pathElement.y},options.classNames.point).attr({\"ct:value\":[pathElement.data.value.x,pathElement.data.value.y].filter(Chartist.isNumeric).join(\",\"),\"ct:meta\":Chartist.serialize(pathElement.data.meta)});this.eventEmitter.emit(\"draw\",{type:\"point\",value:pathElement.data.value,index:pathElement.data.valueIndex,meta:pathElement.data.meta,series:series,seriesIndex:seriesIndex,axisX:axisX,axisY:axisY,group:seriesElement,element:point,x:pathElement.x,y:pathElement.y})}.bind(this))}if(seriesOptions.showLine){var line=seriesElement.elem(\"path\",{d:path.stringify()},options.classNames.line,!0);this.eventEmitter.emit(\"draw\",{type:\"line\",values:data.normalized.series[seriesIndex],path:path.clone(),chartRect:chartRect,index:seriesIndex,series:series,seriesIndex:seriesIndex,seriesMeta:series.meta,axisX:axisX,axisY:axisY,group:seriesElement,element:line})}// Area currently only works with axes that support a range!\nif(seriesOptions.showArea&&axisY.range){// If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n// the area is not drawn outside the chart area.\nvar areaBase=Math.max(Math.min(seriesOptions.areaBase,axisY.range.max),axisY.range.min),areaBaseProjected=chartRect.y1-axisY.projectValue(areaBase);// We project the areaBase value into screen coordinates\n// In order to form the area we'll first split the path by move commands so we can chunk it up into segments\npath.splitByCommand(\"M\").filter(function onlySolidSegments(pathSegment){// We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\nreturn 1<pathSegment.pathElements.length}).map(function convertToArea(solidPathSegments){// Receiving the filtered solid path segments we can now convert those segments into fill areas\nvar firstElement=solidPathSegments.pathElements[0],lastElement=solidPathSegments.pathElements[solidPathSegments.pathElements.length-1];// Cloning the solid path segment with closing option and removing the first move command from the clone\n// We then insert a new move that should start at the area base and draw a straight line up or down\n// at the end of the path we add an additional straight line to the projected area base value\n// As the closing option is set our path will be automatically closed\nreturn solidPathSegments.clone(!0).position(0).remove(1).move(firstElement.x,areaBaseProjected).line(firstElement.x,firstElement.y).position(solidPathSegments.pathElements.length+1).line(lastElement.x,areaBaseProjected)}).forEach(function createArea(areaPath){// For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n// and adding the created DOM elements to the correct series group\nvar area=seriesElement.elem(\"path\",{d:areaPath.stringify()},options.classNames.area,!0);// Emit an event for each area that was drawn\nthis.eventEmitter.emit(\"draw\",{type:\"area\",values:data.normalized.series[seriesIndex],path:areaPath.clone(),series:series,seriesIndex:seriesIndex,axisX:axisX,axisY:axisY,chartRect:chartRect,index:seriesIndex,group:seriesElement,element:area})}.bind(this))}}.bind(this));this.eventEmitter.emit(\"created\",{bounds:axisY.bounds,chartRect:chartRect,axisX:axisX,axisY:axisY,svg:this.svg,options:options})}", "title": "" }, { "docid": "747016ad38098a829b98da5c353453c4", "score": "0.5611617", "text": "function setupAxis() {\n const yAxis = axisLeft(yScale)\n .tickSize(-innerWidth)\n const xAxis = axisBottom(xScale)\n \n \n // y Axis GROUPI G\n const yAxisG = g.append('g').call(yAxis)\n \n yAxisG\n .selectAll('.domain') // removing Y axis line and ticks\n .remove()\n \n yAxisG.append('text') // Y LABEL\n .attr('class', 'axis-label')\n .attr('y', -50)\n .attr('x', -innerHeight / 2)\n .attr('fill', 'black')\n .attr('transform', `rotate(-90)`) // ROTATING Y LABEL\n .attr('text-anchor', 'middle')\n .text(yAxisLabel)\n \n yAxisG\n .attr('class', 'axis-y')\n \n \n // x Axis GROUPING\n const xAxisG = g.append('g').call(xAxis)\n \n xAxisG\n .attr('transform', `translate(0, ${innerHeight})`)\n .attr('class', 'axis-x')\n .selectAll(\"text\")\n .attr(\"transform\", `rotate(50)`)\n .attr('text-anchor', 'start')\n .attr('x', 10)\n .attr('y', 5)\n .selectAll('.domain, .tick line') // removing X axis line and ticks\n .remove();\n xAxisG.append('text') // X AS LABEL\n .attr('class', 'axis-label')\n .attr('x', innerWidth / 2)\n .attr('y', 60)\n .attr('fill', 'black')\n .text(xAxisLabel)\n }", "title": "" }, { "docid": "bbb3e5444c2dde71980415c068c1640a", "score": "0.5604011", "text": "constructor() {\n super();\n // let lang = this.container.lang\n this.addCss(Core.path + 'lib/pivottable/dist/pivot.min.css');\n this.addCss(Core.path + 'lib/jquery-ui/jquery-ui.min.css');\n this.addCss(Core.path + 'lib/c3/c3.min.css');\n let dep = this.addScript(Core.path + 'lib/jquery-ui/jquery-ui.min.js');\n let touch = this.addScript(Core.path + 'lib/jquery-ui.touch-punch/jquery.ui.touch-punch.min.js', dep);\n let pivot = this.addScript(Core.path + 'lib/pivottable/dist/pivot.min.js', touch);\n let plotly = this.addScript(Core.path + 'lib/plotly/plotly-latest.min.js', pivot);\n this.addScript(Core.path + 'lib/pivottable/dist/plotly_renderers.js', plotly);\n let d3 = this.addScript(Core.path + 'lib/d3/d3.min.js', pivot);\n let c3 = this.addScript(Core.path + 'lib/c3/c3.min.js', d3);\n this.addScript(Core.path + 'lib/pivottable/dist/d3_renderers.js', d3);\n this.addScript(Core.path + 'lib/pivottable/dist/c3_renderers.js', c3);\n this.addScript(Core.path + 'lib/pivottable/dist/export_renderers.js', pivot);\n let gchart = this.addScript('https://www.gstatic.com/charts/loader.js', pivot);\n this.addScript(Core.path + 'lib/pivottable/dist/gchart_renderers.js', gchart);\n this.addScript(Core.path + 'lib/pivottable/dist/pivot.fr.min.js', pivot);\n }", "title": "" }, { "docid": "8334f567d619836eb9726fcfcabc41c4", "score": "0.55936897", "text": "function chart(container) {\n g = container;\n\n // g.append(\"g\")\n // .classed(\"xaxis\", true)\n\n // g.append(\"g\")\n // .classed(\"yaxis\", true)\n\n create();\n }", "title": "" }, { "docid": "00356385f3fa0178d5ee3c250b4ffa5e", "score": "0.557622", "text": "function drawAxisChart () {\n var d1, d2, d3, d4, d5, i, ticks;\n\n d1 = [];\n d2 = [];\n d3 = [];\n d4 = [];\n d5 = [];\n ticks = [\n [ 0, \"Lower\"],\n 10,\n 20,\n 30,\n [40, \"Upper\"]\n ];\n\n for(i = 0; i <= 10; i += 0.1){\n d1.push([i, 4 + Math.pow(i,1.5)]);\n d2.push([i, Math.pow(i,3)]);\n d3.push([i, i*5+3*Math.sin(i*4)]);\n d4.push([i, i]);\n if( i.toFixed(1)%1 == 0 ){\n d5.push([i, 2*i]);\n }\n }\n\n d3[30][1] = null;\n d3[31][1] = null;\n\n function ticksFn (n) { return '('+n+')'; }\n\n Flotr.draw(document.getElementById('flotr2BasicAxis'), [\n { data : d1, label : 'y = 4 + x^(1.5)', lines : { fill : true, fillOpacity: 0.15 } },\n { data : d2, label : 'y = x^3'},\n { data : d3, label : 'y = 5x + 3sin(4x)'},\n { data : d4, label : 'y = x'},\n { data : d5, label : 'y = 2x', lines : { show : true }, points : { show : true } }\n ], {\n colors: ['#bdc3c7', '#2980b9', '#1abc9c', '#34495e', '#c0392b'],\n shadowSize: 0,\n xaxis : {\n noTicks : 7, // Display 7 ticks.\n tickFormatter : ticksFn, // Displays tick values between brackets.\n min : 1, // Part of the series is not displayed.\n max : 7.5, // Part of the series is not displayed.\n color: '#95a5a6'\n },\n yaxis : {\n ticks : ticks, // Set Y-Axis ticks\n max : 40, // Maximum value along Y-Axis\n color: '#95a5a6'\n },\n grid : {\n verticalLines : false,\n outlineWidth: 0,\n color: '#34495e',\n labelMargin: 7\n },\n legend : {\n position : 'nw',\n labelBoxBorderColor: '#ecf0f1',\n backgroundColor: '#ecf0f1',\n labelBoxWidth: 20,\n labelBoxHeight: 12\n },\n mouse: {\n track: true\n }\n });\n }", "title": "" }, { "docid": "75a7754c9656404d0ec5a3139399390b", "score": "0.5535969", "text": "function buildPlot(plt, data) {\t\n\taddDayOfWeek(data);\n\n\tplt.xScale = buildXScale(plt);\n\tplt.xAxis = buildAxis(plt.xScale, \"bottom\");\n\n\tplt.yScale = buildYScale(plt);\n\tplt.yAxis = buildAxis(plt.yScale, \"left\");\n\n\tcreateDayPicker(plt, data);\n\tattachColorToggle(plt, data);\n\n\tplt.tooltip = createTooltipElement(plt);\n\n\tplt.graph = createGraphElement(plt);\n\tdrawGraph(plt, data);\n}", "title": "" }, { "docid": "b424c3b270abbb3b58881d57fb837be7", "score": "0.5524489", "text": "renderAxis() {\n //everything\n let axis = d3.axisBottom(this.props.scale);\n\n d3.select(this.refs.wrapper).call(axis);\n }", "title": "" }, { "docid": "766e6b93a3c0fe64ac03729abe94a4e9", "score": "0.5522318", "text": "function init() {\n data = [{\n x: [1, 2, 3, 4, 5],\n y: [1, 2, 4, 8, 16] }];\n \n Plotly.newPlot(\"plot\", data);\n }", "title": "" }, { "docid": "144e406094d383f2651241b3843caa35", "score": "0.5499283", "text": "function drawAxes() {\n svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + (height - margin.bottom) + \")\")\n .call(xAxis);\n\n svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .attr(\"transform\", \"translate(\" + margin.left + \",0)\")\n .call(yAxis)\n .append(\"text\")\n .attr(\"class\", \"label\")\n .attr(\"x\", (width - margin.right - margin.left) / 2)\n .attr(\"y\", 5)\n .attr(\"dy\", \"2em\")\n .style(\"text-anchor\", \"middle\")\n .attr(\"class\", \"label\")\n .text(\"Late Stage Percentage\");\n\n }", "title": "" }, { "docid": "13d2e62a51499ad34174e96ced905b3d", "score": "0.54972965", "text": "function generate_axis()\n{\n canvas\n .append(\"g\")\n .attr(\"id\",\"x-axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(d3.axisBottom(xScale).ticks(5));\n\n\n canvas\n .append(\"g\")\n .attr(\"id\",\"y-axis\")\n .attr(\"transform\", \"translate(0,0)\")\n .call(d3.axisLeft(yScale));\n}", "title": "" }, { "docid": "5c7bfba697a5730b44441713f689faf3", "score": "0.5492411", "text": "function drawAxes() {\n //Axes\n svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + (height - margin.bottom) + \")\")\n .call(xAxis)\n .append(\"text\")\n .attr(\"class\", \"label\")\n .attr(\"x\", width - margin.right)\n .attr(\"y\", 20)\n .attr(\"dy\", \"2em\")\n .style(\"text-anchor\", \"end\")\n .attr(\"class\", \"label\")\n .text(\"Year\");\n\n svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .attr(\"transform\", \"translate(\" + (margin.left) + \",0)\")\n .call(yAxis)\n .append(\"text\")\n .attr(\"class\", \"label\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"x\", -height + margin.bottom)\n .attr(\"y\", -60)\n .attr(\"dy\", \"1em\")\n .style(\"text-anchor\", \"start\")\n .attr(\"class\", \"label\")\n .text(\"Late Stage Percentage (%)\");\n }", "title": "" }, { "docid": "d678ec0628c047c1a836ca42ac95a81b", "score": "0.54810995", "text": "initialiseChart() {\r\n\t\tthis.svg = d3.select(this.selector)\r\n\t\t\t.append('svg')\r\n\t\t\t\t.attr('width', this.dimensions.width)\r\n\t\t\t\t.attr('height', this.dimensions.height);\r\n\r\n\t\tthis.wrapper = this.svg\r\n\t\t\t.append('g')\r\n\t\t\t\t.attr('width', this.dimensions.width - this.margins.x)\r\n\t\t\t\t.attr('height', this.dimensions.height - (2 * this.margins.y))\r\n\t\t\t\t.attr('class', 'wrapper')\r\n\t\t\t\t.attr('transform', `translate(0, ${this.margins.y})`);\r\n\r\n\t\t// this.buildFilter();\r\n\t\tthis.buildGuide();\r\n\t\tthis.buildLine();\r\n\t\tthis.buildEndCircle();\r\n\t}", "title": "" }, { "docid": "051ca263c28b2654083fe5e802e9854e", "score": "0.547198", "text": "createChart_() {\n this.elementChart_\n .style(Style.WIDTH,\n this.currentChartSize +\n Dimension.WIDTH_CATEGORY_LABEL +\n Dimension.WIDTH_TIMELINE_LEFT_BORDER +\n Dimension.BORDER_SIZE + UnitType.PX)\n ;\n\n const categoryResultsSvg = this.createCategories_();\n const launchSvgGroup = this.createLaunches_(categoryResultsSvg);\n this.createLaunchPointCircles_(launchSvgGroup);\n this.createLaunchPointLines_(launchSvgGroup);\n this.createLaunchLabels_(launchSvgGroup);\n }", "title": "" }, { "docid": "61f151495472894ed9df26a44cc8878a", "score": "0.54680234", "text": "function drawAxis() {\n svg.select('.x-axis-group .axis.x')\n .attr('transform', `translate(0, ${chartHeight})`)\n .call(xAxis);\n\n svg.select('.y-axis-group .axis.y')\n .call(yAxis);\n }", "title": "" }, { "docid": "fafec71430e81be97fa3c23e9c58c4c0", "score": "0.5441621", "text": "function setup() {\n\n createCanvas(windowWidth, windowHeight)\n \n HALF_HEIGHT = height / 2\n HALF_WIDTH = width / 2\n SPACE_BETWEEN_LINES = width / 128 // TODO: Add to bar wave class\n\n setupGui()\n\n angleMode(DEGREES)\n imageMode(CENTER)\n rectMode(CENTER)\n\n setParticleEmitter({value: PARTICLE_TYPES[0]})\n setWave({value: WAVE_TYPES[0]})\n\n}", "title": "" }, { "docid": "03081d607fd5d4a1b7838afc9d720535", "score": "0.54339725", "text": "buildVisComponents() {\n // update vis parameters\n this.vis.allAxis = this.data[0].axes.map((i) => ({ label: i.axis, sub: i.sub }));\n this.vis.totalAxes = this.vis.allAxis.length;\n this.vis.radius = Math.min(this.config.w / 2, this.config.h / 2);\n const realWidth = this.config.w + this.config.paddingX;\n const realHeight = this.config.h + this.config.paddingY;\n\n // create main vis svg\n this.vis.svg = select(this.dom)\n .append('svg').classed('svg-vis', true)\n .attr('viewBox', `0 0 ${realWidth} ${realHeight}`)\n .append('svg:g')\n .attr('transform', `translate(${realWidth / 5},${realHeight / 5})`);\n\n // create levels\n this.vis.levels = this.vis.svg.selectAll('.levels')\n .append('svg:g').classed('levels', true);\n\n // create axes\n this.vis.axes = this.vis.svg.selectAll('.axes')\n .append('svg:g').classed('axes', true);\n\n // create vertices\n this.vis.vertices = this.vis.svg.selectAll('.vertices');\n\n // Initiate Legend\n this.vis.legend = this.vis.svg.append('svg:g').classed('legend', true)\n .attr('height', this.config.h / 2)\n .attr('width', this.config.w / 2)\n .attr('transform', `translate(${0}, ${1.1 * this.config.h})`);\n }", "title": "" }, { "docid": "bf88494ab75f204815bd4203d5706c90", "score": "0.5433894", "text": "fillWindow() {\n\t\tthis.#renderer.setSize(this.#plotPanel.offsetWidth, this.#plotPanel.offsetHeight);\n\t}", "title": "" }, { "docid": "6edfaaf85f4f1d78506a5a5d78114b66", "score": "0.5432149", "text": "function buildPlots(subjectId) {\n console.log(\"*** buildPlots ***\")\n buildDemographics(subjectId);\n\n // create objects of otu samples and store in global otuSampleObjs\n otuSampleObjs = getOTUSampleObjects(subjectId);\n console.log(\"otuSampleObjs: \", otuSampleObjs);\n\n // build plots for subjec's otu smaples\n buildOTU_BarPlot(subjectId);\n buildBubblePlot(subjectId);\n\n buildWashGauge(subjectId);\n}", "title": "" }, { "docid": "918e28ab4a7a97df48b2d6b680c91503", "score": "0.54300845", "text": "createAxes(data, width, height, margin, xTitle, yTitle, className, topXlabel, rightYlabel, left, top, labelFontsize, axisFontsize, xExtent, yExtent, hideAllTicks, xFormat, yFormat, nXticks, nYticks){\n\n\t\tvar x0 = [margin.left, width + margin.left ],\n\t\t\ty0 = [height + margin.top, margin.top];\n\n\t\tvar xScale = xFormat.range(x0),\n\t\t\tyScale = yFormat.range(y0);\n\n\n\t\t//for style, I want the ticks inside, but the labels outside. \n\t\t//I will reposition ticks and text later\n\t\tvar xAxisBottom = d3.axisBottom(xScale),\n\t\t\txAxisTop = d3.axisTop(xScale),\n\t\t\tyAxisLeft = d3.axisLeft(yScale),\n\t\t\tyAxisRight = d3.axisRight(yScale);\n\n\n\t\tif (xExtent == null) {\n\t\t\txExtent = d3.extent(data, function(d) { return +d.x; })\n\t\t}\n\t\tif (yExtent == null){\n\t\t\tyExtent = d3.extent(data, function(d) { return (+d.y + d.ye); });\n\t\t}\n\n\t\txScale.domain(xExtent).nice();\n\t\tyScale.domain(yExtent).nice();\n\n\t\tvar plot = d3.select(this.container).append(\"svg\")\n\t\t\t.attr('class',className)\n\t\t\t.style('position', 'absolute')\n\t\t\t.style('top',top + \"px\")\n\t\t\t.style('left',left + \"px\")\n\t\t\t.attr(\"width\", (width + margin.left + margin.right)+\"px\")\n\t\t\t.attr(\"height\", (height + margin.top + margin.bottom)+\"px\")\n\t\t\t//.attr(\"transform\", \"translate(\" + left + \",\" + top + \")\")\n\n\n\t\t//https://bl.ocks.org/jarandaf/df3e58e56e9d0d3b9adb\n\t\tvar clipPath = plot.append('defs').append(\"clipPath\")\n\t\t\t.attr(\"id\",\"clip\"+className)\n\t\t\t.attr(\"class\",\"clipPathMain\");\n\t\tvar clip = clipPath.append('rect')\n\t\t\t.attr(\"width\", width+\"px\")\n\t\t\t.attr(\"height\", height+\"px\")\n\t\t\t.attr(\"x\",margin.left)\n\t\t\t.attr(\"y\",margin.top);\n\n\t\tconst main = plot.append('g')\n\t\t\t.attr('class', 'main')\n\t\t\t.attr('clip-path', 'url(#clip'+className+')');\n\n\t\t//white background for plot\n\t\tmain.append('rect')\n\t\t\t.attr(\"id\",\"backgroundFill\")\n\t\t\t.attr(\"width\", width+\"px\")\n\t\t\t.attr(\"height\", height+\"px\")\n\t\t\t.attr(\"x\",margin.left)\n\t\t\t.attr(\"y\",margin.top)\n\t\t\t.attr(\"fill\", \"white\");\n\n\t\t//axes\n\t\tvar gXbottom = plot.append(\"g\")\n\t\t\t.attr(\"class\", \"axis axis-x-bottom\")\n\t\t\t.attr(\"transform\", \"translate(0,\" + (height + margin.top) + \")\")\n\t\t\t.style(\"font-size\", axisFontsize)\n\t\t\t.call(xAxisBottom)\n\t\tvar gXtop = plot.append(\"g\")\n\t\t\t.attr(\"class\", \"axis axis-x-top\")\n\t\t\t.attr(\"transform\", \"translate(0,\" + (margin.top) + \")\")\n\t\t\t.style(\"font-size\", axisFontsize)\n\t\t\t.call(xAxisTop)\n\t\tvar gYleft = plot.append(\"g\")\n\t\t\t.attr(\"transform\", \"translate(\" + margin.left + \",0)\")\n\t\t\t.attr(\"class\", \"axis axis-y-left\")\n\t\t\t.style(\"font-size\", axisFontsize)\n\t\t\t.call(yAxisLeft)\n\t\tvar gYright = plot.append(\"g\")\n\t\t\t.attr(\"transform\", \"translate(\" + (width + margin.left) + \",0)\") \n\t\t\t.attr(\"class\", \"axis axis-y-right\")\n\t\t\t.style(\"font-size\", axisFontsize)\n\t\t\t.call(yAxisRight)\n\n\t\tgYleft.call(yAxisLeft.ticks(nYticks));\n\t\tgYright.call(yAxisRight.ticks(nYticks));\n\t\tgXtop.call(xAxisTop.ticks(nXticks));\n\t\tgXbottom.call(xAxisBottom.ticks(nXticks));\n\n\t\t//cleanup ticks\n\t\t//flip them\n\t\tvar y2 = parseFloat(gXtop.selectAll('.tick').selectAll('line').attr(\"y2\"));\n\t\tgXtop.selectAll('.tick').selectAll('line').attr(\"transform\",\"translate(0,\"+ (-y2)+\")\");\n\t\tvar y2 = parseFloat(gXbottom.selectAll('.tick').selectAll('line').attr(\"y2\"));\n\t\tgXbottom.selectAll('.tick').selectAll('line').attr(\"transform\",\"translate(0,\"+(-y2)+\")\");\n\t\tvar x2 = parseFloat(gYleft.selectAll('.tick').selectAll('line').attr(\"x2\"));\n\t\tgYleft.selectAll('.tick').selectAll('line').attr(\"transform\",\"translate(\"+(-x2)+\",0)\");\n\t\tvar x2 = parseFloat(gYright.selectAll('.tick').selectAll('line').attr(\"x2\"));\n\t\tgYright.selectAll('.tick').selectAll('line').attr(\"transform\",\"translate(\"+(-x2)+\",0)\");\n\n\t\t//and the \"domain\"\n\t\tgXtop.select('.domain').attr(\"transform\",\"scale(1,-1)\");\n\t\tgXbottom.select('.domain').attr(\"transform\",\"scale(1,-1)\");\n\t\tgYleft.select('.domain').attr(\"transform\",\"scale(-1,1)\");\n\t\tgYright.select('.domain').attr(\"transform\",\"scale(-1,1)\");\n\n\t\t//remove additional numbers\n\t\tif (topXlabel){\n\t\t\tgXbottom.classed('axis-blank', true);\n\t\t} else{\n\t\t\tgXtop.classed('axis-blank', true);\n\t\t}\n\t\tif (rightYlabel){\n\t\t\tgYleft.classed('axis-blank', true);\n\t\t} else{\n\t\t\tgYright.classed('axis-blank', true);\n\t\t}\n\n\n\t\tif (hideAllTicks){\n\t\t\tgXbottom.classed('axis-blank', true);\n\t\t\tgXtop.classed('axis-blank', true);\n\t\t\tgYleft.classed('axis-blank', true);\n\t\t\tgYright.classed('axis-blank', true);\n\t\t}\n\n\n\n\t\t//axes labels\n\t\tvar xXoffset = width/2. + margin.left,\n\t\t\txYoffset = height + margin.bottom - parseFloat(labelFontsize),\n\t\t\tyXoffset = -yTitle.length/4.*parseFloat(labelFontsize), //seems to look OK, but not ideal\n\t\t\tyYoffset = parseFloat(labelFontsize);\n\n\n\t\tif (topXlabel){\n\t\t\txYoffset = 20;\n\t\t\t//yXoffset = -height; //not sure why this is needed\n\t\t}\n\t\tif (rightYlabel){\n\t\t\tyYoffset = width + margin.left + 30;\n\t\t}\n\t\tplot.append(\"text\")\n\t\t\t.attr(\"class\", \"label x-title\")\n\t\t\t.attr(\"x\", xXoffset)\n\t\t\t.attr(\"y\", xYoffset)\n\t\t\t.style(\"text-anchor\", \"middle\")\n\t\t\t.style(\"font-size\", labelFontsize)\n\t\t\t.html(xTitle);\n\t\tplot.append(\"text\")\n\t\t\t.attr(\"class\", \"label y-title\")\n\t\t\t.attr(\"transform\", \"rotate(-90)\")\n\t\t\t.attr(\"x\", yXoffset)\n\t\t\t.attr(\"y\", yYoffset)\n\t\t\t.style(\"text-anchor\", \"middle\")\n\t\t\t.style(\"font-size\", labelFontsize)\n\t\t\t.html(yTitle)\n\n\t\treturn {\"plot\":plot,\n\t\t\t\t\"xScale\":xScale,\n\t\t\t\t\"yScale\":yScale, \n\t\t\t\t\"xAxisBottom\":xAxisBottom,\n\t\t\t\t\"xAxisTop\":xAxisTop,\n\t\t\t\t\"yAxisLeft\":yAxisLeft,\n\t\t\t\t\"yAxisRight\":yAxisRight,\n\t\t\t\t\"xExtent\":xExtent,\n\t\t\t\t\"yExtent\":yExtent, \n\t\t\t\t\"gXtop\":gXtop,\n\t\t\t\t\"gXbottom\":gXbottom,\n\t\t\t\t\"gYright\":gYright,\n\t\t\t\t\"gYleft\":gYleft,\n\t\t\t\t\"image\":null};\n\n\t}", "title": "" }, { "docid": "ae2951d95c056e3c6539a35ab5fe8198", "score": "0.54093754", "text": "function createChart(options) { // 3022\n var data = { // 3023\n raw: this.data, // 3024\n normalized: Chartist.getDataArray(this.data, options.reverseData, true) // 3025\n }; // 3026\n // 3027\n // Create new svg object // 3028\n this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart); // 3029\n // Create groups for labels, grid and series // 3030\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup); // 3031\n var seriesGroup = this.svg.elem('g'); // 3032\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup); // 3033\n // 3034\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding); // 3035\n var axisX, axisY; // 3036\n // 3037\n if(options.axisX.type === undefined) { // 3038\n axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, { // 3039\n ticks: data.raw.labels, // 3040\n stretch: options.fullWidth // 3041\n })); // 3042\n } else { // 3043\n axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX); // 3044\n } // 3045\n // 3046\n if(options.axisY.type === undefined) { // 3047\n axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, { // 3048\n high: Chartist.isNum(options.high) ? options.high : options.axisY.high, // 3049\n low: Chartist.isNum(options.low) ? options.low : options.axisY.low // 3050\n })); // 3051\n } else { // 3052\n axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY); // 3053\n } // 3054\n // 3055\n axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter); // 3056\n axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter); // 3057\n // 3058\n // Draw the series // 3059\n data.raw.series.forEach(function(series, seriesIndex) { // 3060\n var seriesElement = seriesGroup.elem('g'); // 3061\n // 3062\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({ // 3064\n 'series-name': series.name, // 3065\n 'meta': Chartist.serialize(series.meta) // 3066\n }, Chartist.xmlNs.uri); // 3067\n // 3068\n // Use series class from series data or if not set generate one // 3069\n seriesElement.addClass([ // 3070\n options.classNames.series, // 3071\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex)) // 3072\n ].join(' ')); // 3073\n // 3074\n var pathCoordinates = [], // 3075\n pathData = []; // 3076\n // 3077\n data.normalized[seriesIndex].forEach(function(value, valueIndex) { // 3078\n var p = { // 3079\n x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized[seriesIndex]), // 3080\n y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized[seriesIndex]) // 3081\n }; // 3082\n pathCoordinates.push(p.x, p.y); // 3083\n pathData.push({ // 3084\n value: value, // 3085\n valueIndex: valueIndex, // 3086\n meta: Chartist.getMetaData(series, valueIndex) // 3087\n }); // 3088\n }.bind(this)); // 3089\n // 3090\n var seriesOptions = { // 3091\n lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'), // 3092\n showPoint: Chartist.getSeriesOption(series, options, 'showPoint'), // 3093\n showLine: Chartist.getSeriesOption(series, options, 'showLine'), // 3094\n showArea: Chartist.getSeriesOption(series, options, 'showArea'), // 3095\n areaBase: Chartist.getSeriesOption(series, options, 'areaBase') // 3096\n }; // 3097\n // 3098\n var smoothing = typeof seriesOptions.lineSmooth === 'function' ? // 3099\n seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.cardinal() : Chartist.Interpolation.none());\n // Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n // index, value and meta data // 3102\n var path = smoothing(pathCoordinates, pathData); // 3103\n // 3104\n // If we should show points we need to create them now to avoid secondary loop // 3105\n // Points are drawn from the pathElements returned by the interpolation function // 3106\n // Small offset for Firefox to render squares correctly // 3107\n if (seriesOptions.showPoint) { // 3108\n // 3109\n path.pathElements.forEach(function(pathElement) { // 3110\n var point = seriesElement.elem('line', { // 3111\n x1: pathElement.x, // 3112\n y1: pathElement.y, // 3113\n x2: pathElement.x + 0.01, // 3114\n y2: pathElement.y // 3115\n }, options.classNames.point).attr({ // 3116\n 'value': [pathElement.data.value.x, pathElement.data.value.y].filter(function(v) { // 3117\n return v; // 3118\n }).join(','), // 3119\n 'meta': pathElement.data.meta // 3120\n }, Chartist.xmlNs.uri); // 3121\n // 3122\n this.eventEmitter.emit('draw', { // 3123\n type: 'point', // 3124\n value: pathElement.data.value, // 3125\n index: pathElement.data.valueIndex, // 3126\n meta: pathElement.data.meta, // 3127\n series: series, // 3128\n seriesIndex: seriesIndex, // 3129\n axisX: axisX, // 3130\n axisY: axisY, // 3131\n group: seriesElement, // 3132\n element: point, // 3133\n x: pathElement.x, // 3134\n y: pathElement.y // 3135\n }); // 3136\n }.bind(this)); // 3137\n } // 3138\n // 3139\n if(seriesOptions.showLine) { // 3140\n var line = seriesElement.elem('path', { // 3141\n d: path.stringify() // 3142\n }, options.classNames.line, true); // 3143\n // 3144\n this.eventEmitter.emit('draw', { // 3145\n type: 'line', // 3146\n values: data.normalized[seriesIndex], // 3147\n path: path.clone(), // 3148\n chartRect: chartRect, // 3149\n index: seriesIndex, // 3150\n series: series, // 3151\n seriesIndex: seriesIndex, // 3152\n axisX: axisX, // 3153\n axisY: axisY, // 3154\n group: seriesElement, // 3155\n element: line // 3156\n }); // 3157\n } // 3158\n // 3159\n // Area currently only works with axes that support a range! // 3160\n if(seriesOptions.showArea && axisY.range) { // 3161\n // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that // 3162\n // the area is not drawn outside the chart area. // 3163\n var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min); // 3164\n // 3165\n // We project the areaBase value into screen coordinates // 3166\n var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase); // 3167\n // 3168\n // In order to form the area we'll first split the path by move commands so we can chunk it up into segments // 3169\n path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) { // 3170\n // We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area // 3171\n return pathSegment.pathElements.length > 1; // 3172\n }).map(function convertToArea(solidPathSegments) { // 3173\n // Receiving the filtered solid path segments we can now convert those segments into fill areas // 3174\n var firstElement = solidPathSegments.pathElements[0]; // 3175\n var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1]; // 3176\n // 3177\n // Cloning the solid path segment with closing option and removing the first move command from the clone // 3178\n // We then insert a new move that should start at the area base and draw a straight line up or down // 3179\n // at the end of the path we add an additional straight line to the projected area base value // 3180\n // As the closing option is set our path will be automatically closed // 3181\n return solidPathSegments.clone(true) // 3182\n .position(0) // 3183\n .remove(1) // 3184\n .move(firstElement.x, areaBaseProjected) // 3185\n .line(firstElement.x, firstElement.y) // 3186\n .position(solidPathSegments.pathElements.length + 1) // 3187\n .line(lastElement.x, areaBaseProjected); // 3188\n // 3189\n }).forEach(function createArea(areaPath) { // 3190\n // For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n // and adding the created DOM elements to the correct series group // 3192\n var area = seriesElement.elem('path', { // 3193\n d: areaPath.stringify() // 3194\n }, options.classNames.area, true).attr({ // 3195\n 'values': data.normalized[seriesIndex] // 3196\n }, Chartist.xmlNs.uri); // 3197\n // 3198\n // Emit an event for each area that was drawn // 3199\n this.eventEmitter.emit('draw', { // 3200\n type: 'area', // 3201\n values: data.normalized[seriesIndex], // 3202\n path: areaPath.clone(), // 3203\n series: series, // 3204\n seriesIndex: seriesIndex, // 3205\n axisX: axisX, // 3206\n axisY: axisY, // 3207\n chartRect: chartRect, // 3208\n index: seriesIndex, // 3209\n group: seriesElement, // 3210\n element: area // 3211\n }); // 3212\n }.bind(this)); // 3213\n } // 3214\n }.bind(this)); // 3215\n // 3216\n this.eventEmitter.emit('created', { // 3217\n bounds: axisY.bounds, // 3218\n chartRect: chartRect, // 3219\n axisX: axisX, // 3220\n axisY: axisY, // 3221\n svg: this.svg, // 3222\n options: options // 3223\n }); // 3224\n } // 3225", "title": "" }, { "docid": "54e5f1fbe833f77731547f68bc6bc8a8", "score": "0.5406255", "text": "function draw_plot_xy(data) {\n\n // Create Default Layout\n var layout = {}, all_colors=null, meteor_pos=false;\n layout = set_generic_layout_options(layout);\n \n // Specifics for xy\n if(typeof data['opts'] == 'undefined') {\n layout.title.x = 0.05;\n layout.xaxis.side = 'bottom';\n } else if(data['opts'] == 'meteor_pos' ) {\n \n meteor_pos = true;\n\n // RAINBOW Color for meteor_pos!\n all_colors = get_rainbow_colors(data['x1_vals'].length+1,create_rainbow_colors());\n \n }\n\n // Plot Name\n layout.title.text = typeof data.plot_name !== 'undefined'?data.plot_name:''; \n\n if(typeof data.plot_y_axis_reverse !== \"undefined\") {\n if(data.plot_y_axis_reverse == 1) {\n layout.yaxis.autorange = \"reversed\" \n }\n } \n // Add labels\n if(typeof data.x_label !== \"undefined\") {\n layout.xaxis.title.text = data.x_label; \n }\n if(typeof data.y_label !== \"undefined\") {\n layout.yaxis.title.text = data.y_label; \n }\n \n // Show Legend\n if(typeof data.showlegend !== \"undefined\") {\n layout.showlegend = data.showlegend;\n }\n \n // X, Y axis position\n if(typeof data.x_axis_position !== \"undefined\") {\n layout.xaxis.side = data.x_axis_position;\n }\n if(typeof data.y_axis_position !== \"undefined\") {\n layout.yaxis.side = data.y_axis_position;\n }\n \n\n\n // make traces data array for each data series\n traces = [];\n ti = 0; // Trace Counter\n\n for (var i = 1; i <= XY_SERIES_MAX; i++) {\n \n // The values\n field_x = \"x\" + i + \"_vals\";\n field_y = \"y\" + i + \"_vals\";\n field_line_on = \"x\" + i + \"_line\";\n data_label = \"x\" + i + \"_data_label\";\n data_marker = \"x\" + i + \"_symbol;\"\n data_marker_size = \"x\" + i + \"_symbol_size\";\n data_marker_color = \"x\" + i + \"_color\";\n x_reverse = \"x\" + i + \"_reverse\";\n y_reverse = \"y\" + i + \"_reverse\";\n y_scale_anchor = \"y\" + i + \"_axis_scaleanchor\"; \n x_scale_anchor = \"x\" + i + \"_axis_scaleanchor\"; \n y_scale_scaleratio = \"y\" + i + \"_axis_scaleratio\"; \n x_scale_scaleratio = \"x\" + i + \"_axis_scaleratio\"; \n \n if(typeof data[field_x] !== 'undefined' && typeof data[field_y] !== 'undefined') {\n \n traces[ti] = {\n x: data[field_x],\n y: data[field_y],\n mode: 'markers',\n marker: { symbol: (data[data_marker]?data[data_marker]:get_marker()), \n size: (data[data_marker_size]?data[data_marker_size]:6), \n type: 'scatter'\n },\n name: (data[data_label]?data[data_label]:'') \n }; \n\n // Meteor Pos => Square & Rainbow colors\n if(meteor_pos) {\n traces[ti].marker.symbol = DEFAULT_METEOR_SYMBOL;\n traces[ti].marker.size = 10;\n traces[ti].marker.color = all_colors; \n }\n \n // Reverse\n if(data[x_reverse]) {\n layout.xaxis.autorange = \"reversed\";\n\n if(all_colors!== null) {\n all_colors.reverse();\n }\n }\n if(data[y_reverse]) {\n layout.yaxis.autorange = \"reversed\";\n }\n\n // Colors\n if(data[data_marker_color]) {\n traces[ti].marker.color = data[data_marker_color]; \n }\n\n // Markers size\n if(data[data_marker_size]) {\n traces[ti].marker.size = data[data_marker_size]; \n }\n\n // Line\n if(typeof data[field_line_on] !== 'undefined') {\n if(data[field_line_on] == \"1\") {\n traces[ti].mode=\"lines+markers\";\n }\n }\n\n // Scales (only for Y for now)\n if(typeof data[y_scale_anchor] !== 'undefined') {\n layout.yaxis.scaleanchor = data[y_scale_anchor] ;\n }\n if(typeof data[y_scale_scaleratio] !== 'undefined') {\n layout.yaxis.scaleratio = data[y_scale_scaleratio] ;\n\n traces[0].xaxis = \"x\";\n traces[0].yaxis = \"y\"; \n \n } \n ti++;\n }\n } \n\n\n // Line on first serie\n if(typeof data.linetype1 !== \"undefined\") {\n if(data.linetype1 == \"lines+markers\") {\n traces[0].mode = 'lines+markers'; \n traces[0].line = {};\n traces[0].line.shape = 'spline';\n traces[0].line.color = DEFAULT_LINE_COLOR;\n }\n }\n\n\n // make the trend line if tx1_vals exist\n if(typeof data['tx1_vals'] !== 'undefined' && typeof [\"ty1_vals\"] !== 'undefined') {\n traces[ti] = {\n x: data[\"tx1_vals\"],\n y: data[\"ty1_vals\"],\n mode: 'lines',\n name: typeof data['tx1_data_label']!== \"undefined\"?data['tx1_data_label']:'',\n type: 'line',\n line: {\n width: 1,\n color: typeof data['tx1_line_color']!== \"undefined\"?data['tx1_line_color']:DEFAULT_LINE_COLOR\n }\n }\n }\n\n // Do we have extra Axis?\n if(typeof data['y1_axis2_title'] !== 'undefined') {\n \n // Update the Layout \n layout.yaxis2 = {title:{font: { size: 15, color: AXIS_FONT_COLOR}}}\n layout.yaxis2.title.text = (typeof data['y1_axis2_title'] !== 'undefined'?data['y1_axis2_title']:'');\n layout.yaxis2.overlaying = 'y';\n layout.yaxis2.side = 'right'; \n layout.yaxis2.showgrid = false; \n layout.yaxis2.zerolinecolor = V_LINE_COLOR; \n layout.yaxis2.zerolinewidth = 1; \n layout.yaxis2.gridcolor= GRID_COLOR; \n layout.yaxis2.linecolor= V_LINE_COLOR; \n layout.yaxis2.tickfont = { color: TICK_FONT_COLOR};\n \n if(typeof data['plot_y_axis2_reverse'] !== \"undefined\") {\n layout.yaxis2.autorange = \"reversed\" \n } \n\n traces[3] = {\n mode : 'markers',\n marker: { size:0.1, line: {width:0} },\n yaxis: 'y2',\n y: data['y1_axis2_vals'],\n showlegend: false\n }; \n }\n \n Plotly.newPlot( set_new_graph_container(), traces,layout);\n \n}", "title": "" }, { "docid": "8abad399910f144b022119ab20cd5259", "score": "0.5405587", "text": "function createChart(options) {\n var data = Chartist.normalizeData(this.data, options.reverseData, true);\n\n // Create new svg object\n this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart);\n // Create groups for labels, grid and series\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n var axisX, axisY;\n\n if(options.axisX.type === undefined) {\n axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n ticks: data.normalized.labels,\n stretch: options.fullWidth\n }));\n } else {\n axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n high: Chartist.isNumeric(options.high) ? options.high : options.axisY.high,\n low: Chartist.isNumeric(options.low) ? options.low : options.axisY.low\n }));\n } else {\n axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, options.axisY);\n }\n\n axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n if (options.showGridBackground) {\n Chartist.createGridBackground(gridGroup, chartRect, options.classNames.gridBackground, this.eventEmitter);\n }\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n var seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n var pathCoordinates = [],\n pathData = [];\n\n data.normalized.series[seriesIndex].forEach(function(value, valueIndex) {\n var p = {\n x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized.series[seriesIndex])\n };\n pathCoordinates.push(p.x, p.y);\n pathData.push({\n value: value,\n valueIndex: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex)\n });\n }.bind(this));\n\n var seriesOptions = {\n lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'),\n showPoint: Chartist.getSeriesOption(series, options, 'showPoint'),\n showLine: Chartist.getSeriesOption(series, options, 'showLine'),\n showArea: Chartist.getSeriesOption(series, options, 'showArea'),\n areaBase: Chartist.getSeriesOption(series, options, 'areaBase')\n };\n\n var smoothing = typeof seriesOptions.lineSmooth === 'function' ?\n seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.monotoneCubic() : Chartist.Interpolation.none());\n // Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n // index, value and meta data\n var path = smoothing(pathCoordinates, pathData);\n\n // If we should show points we need to create them now to avoid secondary loop\n // Points are drawn from the pathElements returned by the interpolation function\n // Small offset for Firefox to render squares correctly\n if (seriesOptions.showPoint) {\n\n path.pathElements.forEach(function(pathElement) {\n var point = seriesElement.elem('line', {\n x1: pathElement.x,\n y1: pathElement.y,\n x2: pathElement.x + 0.01,\n y2: pathElement.y\n }, options.classNames.point).attr({\n 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNumeric).join(','),\n 'ct:meta': Chartist.serialize(pathElement.data.meta)\n });\n\n this.eventEmitter.emit('draw', {\n type: 'point',\n value: pathElement.data.value,\n index: pathElement.data.valueIndex,\n meta: pathElement.data.meta,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: point,\n x: pathElement.x,\n y: pathElement.y\n });\n }.bind(this));\n }\n\n if(seriesOptions.showLine) {\n var line = seriesElement.elem('path', {\n d: path.stringify()\n }, options.classNames.line, true);\n\n this.eventEmitter.emit('draw', {\n type: 'line',\n values: data.normalized.series[seriesIndex],\n path: path.clone(),\n chartRect: chartRect,\n index: seriesIndex,\n series: series,\n seriesIndex: seriesIndex,\n seriesMeta: series.meta,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: line\n });\n }\n\n // Area currently only works with axes that support a range!\n if(seriesOptions.showArea && axisY.range) {\n // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n // the area is not drawn outside the chart area.\n var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min);\n\n // We project the areaBase value into screen coordinates\n var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase);\n\n // In order to form the area we'll first split the path by move commands so we can chunk it up into segments\n path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) {\n // We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\n return pathSegment.pathElements.length > 1;\n }).map(function convertToArea(solidPathSegments) {\n // Receiving the filtered solid path segments we can now convert those segments into fill areas\n var firstElement = solidPathSegments.pathElements[0];\n var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1];\n\n // Cloning the solid path segment with closing option and removing the first move command from the clone\n // We then insert a new move that should start at the area base and draw a straight line up or down\n // at the end of the path we add an additional straight line to the projected area base value\n // As the closing option is set our path will be automatically closed\n return solidPathSegments.clone(true)\n .position(0)\n .remove(1)\n .move(firstElement.x, areaBaseProjected)\n .line(firstElement.x, firstElement.y)\n .position(solidPathSegments.pathElements.length + 1)\n .line(lastElement.x, areaBaseProjected);\n\n }).forEach(function createArea(areaPath) {\n // For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n // and adding the created DOM elements to the correct series group\n var area = seriesElement.elem('path', {\n d: areaPath.stringify()\n }, options.classNames.area, true);\n\n // Emit an event for each area that was drawn\n this.eventEmitter.emit('draw', {\n type: 'area',\n values: data.normalized.series[seriesIndex],\n path: areaPath.clone(),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n index: seriesIndex,\n group: seriesElement,\n element: area\n });\n }.bind(this));\n }\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: axisY.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }", "title": "" }, { "docid": "8abad399910f144b022119ab20cd5259", "score": "0.5405587", "text": "function createChart(options) {\n var data = Chartist.normalizeData(this.data, options.reverseData, true);\n\n // Create new svg object\n this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart);\n // Create groups for labels, grid and series\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n var axisX, axisY;\n\n if(options.axisX.type === undefined) {\n axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n ticks: data.normalized.labels,\n stretch: options.fullWidth\n }));\n } else {\n axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n high: Chartist.isNumeric(options.high) ? options.high : options.axisY.high,\n low: Chartist.isNumeric(options.low) ? options.low : options.axisY.low\n }));\n } else {\n axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, options.axisY);\n }\n\n axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n if (options.showGridBackground) {\n Chartist.createGridBackground(gridGroup, chartRect, options.classNames.gridBackground, this.eventEmitter);\n }\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n var seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n var pathCoordinates = [],\n pathData = [];\n\n data.normalized.series[seriesIndex].forEach(function(value, valueIndex) {\n var p = {\n x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized.series[seriesIndex])\n };\n pathCoordinates.push(p.x, p.y);\n pathData.push({\n value: value,\n valueIndex: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex)\n });\n }.bind(this));\n\n var seriesOptions = {\n lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'),\n showPoint: Chartist.getSeriesOption(series, options, 'showPoint'),\n showLine: Chartist.getSeriesOption(series, options, 'showLine'),\n showArea: Chartist.getSeriesOption(series, options, 'showArea'),\n areaBase: Chartist.getSeriesOption(series, options, 'areaBase')\n };\n\n var smoothing = typeof seriesOptions.lineSmooth === 'function' ?\n seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.monotoneCubic() : Chartist.Interpolation.none());\n // Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n // index, value and meta data\n var path = smoothing(pathCoordinates, pathData);\n\n // If we should show points we need to create them now to avoid secondary loop\n // Points are drawn from the pathElements returned by the interpolation function\n // Small offset for Firefox to render squares correctly\n if (seriesOptions.showPoint) {\n\n path.pathElements.forEach(function(pathElement) {\n var point = seriesElement.elem('line', {\n x1: pathElement.x,\n y1: pathElement.y,\n x2: pathElement.x + 0.01,\n y2: pathElement.y\n }, options.classNames.point).attr({\n 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNumeric).join(','),\n 'ct:meta': Chartist.serialize(pathElement.data.meta)\n });\n\n this.eventEmitter.emit('draw', {\n type: 'point',\n value: pathElement.data.value,\n index: pathElement.data.valueIndex,\n meta: pathElement.data.meta,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: point,\n x: pathElement.x,\n y: pathElement.y\n });\n }.bind(this));\n }\n\n if(seriesOptions.showLine) {\n var line = seriesElement.elem('path', {\n d: path.stringify()\n }, options.classNames.line, true);\n\n this.eventEmitter.emit('draw', {\n type: 'line',\n values: data.normalized.series[seriesIndex],\n path: path.clone(),\n chartRect: chartRect,\n index: seriesIndex,\n series: series,\n seriesIndex: seriesIndex,\n seriesMeta: series.meta,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: line\n });\n }\n\n // Area currently only works with axes that support a range!\n if(seriesOptions.showArea && axisY.range) {\n // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n // the area is not drawn outside the chart area.\n var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min);\n\n // We project the areaBase value into screen coordinates\n var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase);\n\n // In order to form the area we'll first split the path by move commands so we can chunk it up into segments\n path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) {\n // We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\n return pathSegment.pathElements.length > 1;\n }).map(function convertToArea(solidPathSegments) {\n // Receiving the filtered solid path segments we can now convert those segments into fill areas\n var firstElement = solidPathSegments.pathElements[0];\n var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1];\n\n // Cloning the solid path segment with closing option and removing the first move command from the clone\n // We then insert a new move that should start at the area base and draw a straight line up or down\n // at the end of the path we add an additional straight line to the projected area base value\n // As the closing option is set our path will be automatically closed\n return solidPathSegments.clone(true)\n .position(0)\n .remove(1)\n .move(firstElement.x, areaBaseProjected)\n .line(firstElement.x, firstElement.y)\n .position(solidPathSegments.pathElements.length + 1)\n .line(lastElement.x, areaBaseProjected);\n\n }).forEach(function createArea(areaPath) {\n // For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n // and adding the created DOM elements to the correct series group\n var area = seriesElement.elem('path', {\n d: areaPath.stringify()\n }, options.classNames.area, true);\n\n // Emit an event for each area that was drawn\n this.eventEmitter.emit('draw', {\n type: 'area',\n values: data.normalized.series[seriesIndex],\n path: areaPath.clone(),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n index: seriesIndex,\n group: seriesElement,\n element: area\n });\n }.bind(this));\n }\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: axisY.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }", "title": "" }, { "docid": "8abad399910f144b022119ab20cd5259", "score": "0.5405587", "text": "function createChart(options) {\n var data = Chartist.normalizeData(this.data, options.reverseData, true);\n\n // Create new svg object\n this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart);\n // Create groups for labels, grid and series\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n var axisX, axisY;\n\n if(options.axisX.type === undefined) {\n axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n ticks: data.normalized.labels,\n stretch: options.fullWidth\n }));\n } else {\n axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n high: Chartist.isNumeric(options.high) ? options.high : options.axisY.high,\n low: Chartist.isNumeric(options.low) ? options.low : options.axisY.low\n }));\n } else {\n axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, options.axisY);\n }\n\n axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n if (options.showGridBackground) {\n Chartist.createGridBackground(gridGroup, chartRect, options.classNames.gridBackground, this.eventEmitter);\n }\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n var seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n var pathCoordinates = [],\n pathData = [];\n\n data.normalized.series[seriesIndex].forEach(function(value, valueIndex) {\n var p = {\n x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized.series[seriesIndex])\n };\n pathCoordinates.push(p.x, p.y);\n pathData.push({\n value: value,\n valueIndex: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex)\n });\n }.bind(this));\n\n var seriesOptions = {\n lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'),\n showPoint: Chartist.getSeriesOption(series, options, 'showPoint'),\n showLine: Chartist.getSeriesOption(series, options, 'showLine'),\n showArea: Chartist.getSeriesOption(series, options, 'showArea'),\n areaBase: Chartist.getSeriesOption(series, options, 'areaBase')\n };\n\n var smoothing = typeof seriesOptions.lineSmooth === 'function' ?\n seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.monotoneCubic() : Chartist.Interpolation.none());\n // Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n // index, value and meta data\n var path = smoothing(pathCoordinates, pathData);\n\n // If we should show points we need to create them now to avoid secondary loop\n // Points are drawn from the pathElements returned by the interpolation function\n // Small offset for Firefox to render squares correctly\n if (seriesOptions.showPoint) {\n\n path.pathElements.forEach(function(pathElement) {\n var point = seriesElement.elem('line', {\n x1: pathElement.x,\n y1: pathElement.y,\n x2: pathElement.x + 0.01,\n y2: pathElement.y\n }, options.classNames.point).attr({\n 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNumeric).join(','),\n 'ct:meta': Chartist.serialize(pathElement.data.meta)\n });\n\n this.eventEmitter.emit('draw', {\n type: 'point',\n value: pathElement.data.value,\n index: pathElement.data.valueIndex,\n meta: pathElement.data.meta,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: point,\n x: pathElement.x,\n y: pathElement.y\n });\n }.bind(this));\n }\n\n if(seriesOptions.showLine) {\n var line = seriesElement.elem('path', {\n d: path.stringify()\n }, options.classNames.line, true);\n\n this.eventEmitter.emit('draw', {\n type: 'line',\n values: data.normalized.series[seriesIndex],\n path: path.clone(),\n chartRect: chartRect,\n index: seriesIndex,\n series: series,\n seriesIndex: seriesIndex,\n seriesMeta: series.meta,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: line\n });\n }\n\n // Area currently only works with axes that support a range!\n if(seriesOptions.showArea && axisY.range) {\n // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n // the area is not drawn outside the chart area.\n var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min);\n\n // We project the areaBase value into screen coordinates\n var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase);\n\n // In order to form the area we'll first split the path by move commands so we can chunk it up into segments\n path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) {\n // We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\n return pathSegment.pathElements.length > 1;\n }).map(function convertToArea(solidPathSegments) {\n // Receiving the filtered solid path segments we can now convert those segments into fill areas\n var firstElement = solidPathSegments.pathElements[0];\n var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1];\n\n // Cloning the solid path segment with closing option and removing the first move command from the clone\n // We then insert a new move that should start at the area base and draw a straight line up or down\n // at the end of the path we add an additional straight line to the projected area base value\n // As the closing option is set our path will be automatically closed\n return solidPathSegments.clone(true)\n .position(0)\n .remove(1)\n .move(firstElement.x, areaBaseProjected)\n .line(firstElement.x, firstElement.y)\n .position(solidPathSegments.pathElements.length + 1)\n .line(lastElement.x, areaBaseProjected);\n\n }).forEach(function createArea(areaPath) {\n // For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n // and adding the created DOM elements to the correct series group\n var area = seriesElement.elem('path', {\n d: areaPath.stringify()\n }, options.classNames.area, true);\n\n // Emit an event for each area that was drawn\n this.eventEmitter.emit('draw', {\n type: 'area',\n values: data.normalized.series[seriesIndex],\n path: areaPath.clone(),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n index: seriesIndex,\n group: seriesElement,\n element: area\n });\n }.bind(this));\n }\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: axisY.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }", "title": "" }, { "docid": "8abad399910f144b022119ab20cd5259", "score": "0.5405587", "text": "function createChart(options) {\n var data = Chartist.normalizeData(this.data, options.reverseData, true);\n\n // Create new svg object\n this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart);\n // Create groups for labels, grid and series\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n var axisX, axisY;\n\n if(options.axisX.type === undefined) {\n axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n ticks: data.normalized.labels,\n stretch: options.fullWidth\n }));\n } else {\n axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n high: Chartist.isNumeric(options.high) ? options.high : options.axisY.high,\n low: Chartist.isNumeric(options.low) ? options.low : options.axisY.low\n }));\n } else {\n axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, options.axisY);\n }\n\n axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n if (options.showGridBackground) {\n Chartist.createGridBackground(gridGroup, chartRect, options.classNames.gridBackground, this.eventEmitter);\n }\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n var seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n var pathCoordinates = [],\n pathData = [];\n\n data.normalized.series[seriesIndex].forEach(function(value, valueIndex) {\n var p = {\n x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized.series[seriesIndex])\n };\n pathCoordinates.push(p.x, p.y);\n pathData.push({\n value: value,\n valueIndex: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex)\n });\n }.bind(this));\n\n var seriesOptions = {\n lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'),\n showPoint: Chartist.getSeriesOption(series, options, 'showPoint'),\n showLine: Chartist.getSeriesOption(series, options, 'showLine'),\n showArea: Chartist.getSeriesOption(series, options, 'showArea'),\n areaBase: Chartist.getSeriesOption(series, options, 'areaBase')\n };\n\n var smoothing = typeof seriesOptions.lineSmooth === 'function' ?\n seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.monotoneCubic() : Chartist.Interpolation.none());\n // Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n // index, value and meta data\n var path = smoothing(pathCoordinates, pathData);\n\n // If we should show points we need to create them now to avoid secondary loop\n // Points are drawn from the pathElements returned by the interpolation function\n // Small offset for Firefox to render squares correctly\n if (seriesOptions.showPoint) {\n\n path.pathElements.forEach(function(pathElement) {\n var point = seriesElement.elem('line', {\n x1: pathElement.x,\n y1: pathElement.y,\n x2: pathElement.x + 0.01,\n y2: pathElement.y\n }, options.classNames.point).attr({\n 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNumeric).join(','),\n 'ct:meta': Chartist.serialize(pathElement.data.meta)\n });\n\n this.eventEmitter.emit('draw', {\n type: 'point',\n value: pathElement.data.value,\n index: pathElement.data.valueIndex,\n meta: pathElement.data.meta,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: point,\n x: pathElement.x,\n y: pathElement.y\n });\n }.bind(this));\n }\n\n if(seriesOptions.showLine) {\n var line = seriesElement.elem('path', {\n d: path.stringify()\n }, options.classNames.line, true);\n\n this.eventEmitter.emit('draw', {\n type: 'line',\n values: data.normalized.series[seriesIndex],\n path: path.clone(),\n chartRect: chartRect,\n index: seriesIndex,\n series: series,\n seriesIndex: seriesIndex,\n seriesMeta: series.meta,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: line\n });\n }\n\n // Area currently only works with axes that support a range!\n if(seriesOptions.showArea && axisY.range) {\n // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n // the area is not drawn outside the chart area.\n var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min);\n\n // We project the areaBase value into screen coordinates\n var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase);\n\n // In order to form the area we'll first split the path by move commands so we can chunk it up into segments\n path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) {\n // We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\n return pathSegment.pathElements.length > 1;\n }).map(function convertToArea(solidPathSegments) {\n // Receiving the filtered solid path segments we can now convert those segments into fill areas\n var firstElement = solidPathSegments.pathElements[0];\n var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1];\n\n // Cloning the solid path segment with closing option and removing the first move command from the clone\n // We then insert a new move that should start at the area base and draw a straight line up or down\n // at the end of the path we add an additional straight line to the projected area base value\n // As the closing option is set our path will be automatically closed\n return solidPathSegments.clone(true)\n .position(0)\n .remove(1)\n .move(firstElement.x, areaBaseProjected)\n .line(firstElement.x, firstElement.y)\n .position(solidPathSegments.pathElements.length + 1)\n .line(lastElement.x, areaBaseProjected);\n\n }).forEach(function createArea(areaPath) {\n // For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n // and adding the created DOM elements to the correct series group\n var area = seriesElement.elem('path', {\n d: areaPath.stringify()\n }, options.classNames.area, true);\n\n // Emit an event for each area that was drawn\n this.eventEmitter.emit('draw', {\n type: 'area',\n values: data.normalized.series[seriesIndex],\n path: areaPath.clone(),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n index: seriesIndex,\n group: seriesElement,\n element: area\n });\n }.bind(this));\n }\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: axisY.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }", "title": "" }, { "docid": "8abad399910f144b022119ab20cd5259", "score": "0.5405587", "text": "function createChart(options) {\n var data = Chartist.normalizeData(this.data, options.reverseData, true);\n\n // Create new svg object\n this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart);\n // Create groups for labels, grid and series\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n var axisX, axisY;\n\n if(options.axisX.type === undefined) {\n axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n ticks: data.normalized.labels,\n stretch: options.fullWidth\n }));\n } else {\n axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n high: Chartist.isNumeric(options.high) ? options.high : options.axisY.high,\n low: Chartist.isNumeric(options.low) ? options.low : options.axisY.low\n }));\n } else {\n axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, options.axisY);\n }\n\n axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n if (options.showGridBackground) {\n Chartist.createGridBackground(gridGroup, chartRect, options.classNames.gridBackground, this.eventEmitter);\n }\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n var seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n var pathCoordinates = [],\n pathData = [];\n\n data.normalized.series[seriesIndex].forEach(function(value, valueIndex) {\n var p = {\n x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized.series[seriesIndex])\n };\n pathCoordinates.push(p.x, p.y);\n pathData.push({\n value: value,\n valueIndex: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex)\n });\n }.bind(this));\n\n var seriesOptions = {\n lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'),\n showPoint: Chartist.getSeriesOption(series, options, 'showPoint'),\n showLine: Chartist.getSeriesOption(series, options, 'showLine'),\n showArea: Chartist.getSeriesOption(series, options, 'showArea'),\n areaBase: Chartist.getSeriesOption(series, options, 'areaBase')\n };\n\n var smoothing = typeof seriesOptions.lineSmooth === 'function' ?\n seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.monotoneCubic() : Chartist.Interpolation.none());\n // Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n // index, value and meta data\n var path = smoothing(pathCoordinates, pathData);\n\n // If we should show points we need to create them now to avoid secondary loop\n // Points are drawn from the pathElements returned by the interpolation function\n // Small offset for Firefox to render squares correctly\n if (seriesOptions.showPoint) {\n\n path.pathElements.forEach(function(pathElement) {\n var point = seriesElement.elem('line', {\n x1: pathElement.x,\n y1: pathElement.y,\n x2: pathElement.x + 0.01,\n y2: pathElement.y\n }, options.classNames.point).attr({\n 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNumeric).join(','),\n 'ct:meta': Chartist.serialize(pathElement.data.meta)\n });\n\n this.eventEmitter.emit('draw', {\n type: 'point',\n value: pathElement.data.value,\n index: pathElement.data.valueIndex,\n meta: pathElement.data.meta,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: point,\n x: pathElement.x,\n y: pathElement.y\n });\n }.bind(this));\n }\n\n if(seriesOptions.showLine) {\n var line = seriesElement.elem('path', {\n d: path.stringify()\n }, options.classNames.line, true);\n\n this.eventEmitter.emit('draw', {\n type: 'line',\n values: data.normalized.series[seriesIndex],\n path: path.clone(),\n chartRect: chartRect,\n index: seriesIndex,\n series: series,\n seriesIndex: seriesIndex,\n seriesMeta: series.meta,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: line\n });\n }\n\n // Area currently only works with axes that support a range!\n if(seriesOptions.showArea && axisY.range) {\n // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n // the area is not drawn outside the chart area.\n var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min);\n\n // We project the areaBase value into screen coordinates\n var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase);\n\n // In order to form the area we'll first split the path by move commands so we can chunk it up into segments\n path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) {\n // We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\n return pathSegment.pathElements.length > 1;\n }).map(function convertToArea(solidPathSegments) {\n // Receiving the filtered solid path segments we can now convert those segments into fill areas\n var firstElement = solidPathSegments.pathElements[0];\n var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1];\n\n // Cloning the solid path segment with closing option and removing the first move command from the clone\n // We then insert a new move that should start at the area base and draw a straight line up or down\n // at the end of the path we add an additional straight line to the projected area base value\n // As the closing option is set our path will be automatically closed\n return solidPathSegments.clone(true)\n .position(0)\n .remove(1)\n .move(firstElement.x, areaBaseProjected)\n .line(firstElement.x, firstElement.y)\n .position(solidPathSegments.pathElements.length + 1)\n .line(lastElement.x, areaBaseProjected);\n\n }).forEach(function createArea(areaPath) {\n // For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n // and adding the created DOM elements to the correct series group\n var area = seriesElement.elem('path', {\n d: areaPath.stringify()\n }, options.classNames.area, true);\n\n // Emit an event for each area that was drawn\n this.eventEmitter.emit('draw', {\n type: 'area',\n values: data.normalized.series[seriesIndex],\n path: areaPath.clone(),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n index: seriesIndex,\n group: seriesElement,\n element: area\n });\n }.bind(this));\n }\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: axisY.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }", "title": "" }, { "docid": "8abad399910f144b022119ab20cd5259", "score": "0.5405587", "text": "function createChart(options) {\n var data = Chartist.normalizeData(this.data, options.reverseData, true);\n\n // Create new svg object\n this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart);\n // Create groups for labels, grid and series\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n var axisX, axisY;\n\n if(options.axisX.type === undefined) {\n axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n ticks: data.normalized.labels,\n stretch: options.fullWidth\n }));\n } else {\n axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n high: Chartist.isNumeric(options.high) ? options.high : options.axisY.high,\n low: Chartist.isNumeric(options.low) ? options.low : options.axisY.low\n }));\n } else {\n axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, options.axisY);\n }\n\n axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n if (options.showGridBackground) {\n Chartist.createGridBackground(gridGroup, chartRect, options.classNames.gridBackground, this.eventEmitter);\n }\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n var seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n var pathCoordinates = [],\n pathData = [];\n\n data.normalized.series[seriesIndex].forEach(function(value, valueIndex) {\n var p = {\n x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized.series[seriesIndex])\n };\n pathCoordinates.push(p.x, p.y);\n pathData.push({\n value: value,\n valueIndex: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex)\n });\n }.bind(this));\n\n var seriesOptions = {\n lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'),\n showPoint: Chartist.getSeriesOption(series, options, 'showPoint'),\n showLine: Chartist.getSeriesOption(series, options, 'showLine'),\n showArea: Chartist.getSeriesOption(series, options, 'showArea'),\n areaBase: Chartist.getSeriesOption(series, options, 'areaBase')\n };\n\n var smoothing = typeof seriesOptions.lineSmooth === 'function' ?\n seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.monotoneCubic() : Chartist.Interpolation.none());\n // Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n // index, value and meta data\n var path = smoothing(pathCoordinates, pathData);\n\n // If we should show points we need to create them now to avoid secondary loop\n // Points are drawn from the pathElements returned by the interpolation function\n // Small offset for Firefox to render squares correctly\n if (seriesOptions.showPoint) {\n\n path.pathElements.forEach(function(pathElement) {\n var point = seriesElement.elem('line', {\n x1: pathElement.x,\n y1: pathElement.y,\n x2: pathElement.x + 0.01,\n y2: pathElement.y\n }, options.classNames.point).attr({\n 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNumeric).join(','),\n 'ct:meta': Chartist.serialize(pathElement.data.meta)\n });\n\n this.eventEmitter.emit('draw', {\n type: 'point',\n value: pathElement.data.value,\n index: pathElement.data.valueIndex,\n meta: pathElement.data.meta,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: point,\n x: pathElement.x,\n y: pathElement.y\n });\n }.bind(this));\n }\n\n if(seriesOptions.showLine) {\n var line = seriesElement.elem('path', {\n d: path.stringify()\n }, options.classNames.line, true);\n\n this.eventEmitter.emit('draw', {\n type: 'line',\n values: data.normalized.series[seriesIndex],\n path: path.clone(),\n chartRect: chartRect,\n index: seriesIndex,\n series: series,\n seriesIndex: seriesIndex,\n seriesMeta: series.meta,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: line\n });\n }\n\n // Area currently only works with axes that support a range!\n if(seriesOptions.showArea && axisY.range) {\n // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n // the area is not drawn outside the chart area.\n var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min);\n\n // We project the areaBase value into screen coordinates\n var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase);\n\n // In order to form the area we'll first split the path by move commands so we can chunk it up into segments\n path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) {\n // We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\n return pathSegment.pathElements.length > 1;\n }).map(function convertToArea(solidPathSegments) {\n // Receiving the filtered solid path segments we can now convert those segments into fill areas\n var firstElement = solidPathSegments.pathElements[0];\n var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1];\n\n // Cloning the solid path segment with closing option and removing the first move command from the clone\n // We then insert a new move that should start at the area base and draw a straight line up or down\n // at the end of the path we add an additional straight line to the projected area base value\n // As the closing option is set our path will be automatically closed\n return solidPathSegments.clone(true)\n .position(0)\n .remove(1)\n .move(firstElement.x, areaBaseProjected)\n .line(firstElement.x, firstElement.y)\n .position(solidPathSegments.pathElements.length + 1)\n .line(lastElement.x, areaBaseProjected);\n\n }).forEach(function createArea(areaPath) {\n // For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n // and adding the created DOM elements to the correct series group\n var area = seriesElement.elem('path', {\n d: areaPath.stringify()\n }, options.classNames.area, true);\n\n // Emit an event for each area that was drawn\n this.eventEmitter.emit('draw', {\n type: 'area',\n values: data.normalized.series[seriesIndex],\n path: areaPath.clone(),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n index: seriesIndex,\n group: seriesElement,\n element: area\n });\n }.bind(this));\n }\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: axisY.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }", "title": "" }, { "docid": "8abad399910f144b022119ab20cd5259", "score": "0.5405587", "text": "function createChart(options) {\n var data = Chartist.normalizeData(this.data, options.reverseData, true);\n\n // Create new svg object\n this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart);\n // Create groups for labels, grid and series\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n var axisX, axisY;\n\n if(options.axisX.type === undefined) {\n axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n ticks: data.normalized.labels,\n stretch: options.fullWidth\n }));\n } else {\n axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n high: Chartist.isNumeric(options.high) ? options.high : options.axisY.high,\n low: Chartist.isNumeric(options.low) ? options.low : options.axisY.low\n }));\n } else {\n axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, options.axisY);\n }\n\n axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n if (options.showGridBackground) {\n Chartist.createGridBackground(gridGroup, chartRect, options.classNames.gridBackground, this.eventEmitter);\n }\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n var seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n var pathCoordinates = [],\n pathData = [];\n\n data.normalized.series[seriesIndex].forEach(function(value, valueIndex) {\n var p = {\n x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized.series[seriesIndex])\n };\n pathCoordinates.push(p.x, p.y);\n pathData.push({\n value: value,\n valueIndex: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex)\n });\n }.bind(this));\n\n var seriesOptions = {\n lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'),\n showPoint: Chartist.getSeriesOption(series, options, 'showPoint'),\n showLine: Chartist.getSeriesOption(series, options, 'showLine'),\n showArea: Chartist.getSeriesOption(series, options, 'showArea'),\n areaBase: Chartist.getSeriesOption(series, options, 'areaBase')\n };\n\n var smoothing = typeof seriesOptions.lineSmooth === 'function' ?\n seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.monotoneCubic() : Chartist.Interpolation.none());\n // Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n // index, value and meta data\n var path = smoothing(pathCoordinates, pathData);\n\n // If we should show points we need to create them now to avoid secondary loop\n // Points are drawn from the pathElements returned by the interpolation function\n // Small offset for Firefox to render squares correctly\n if (seriesOptions.showPoint) {\n\n path.pathElements.forEach(function(pathElement) {\n var point = seriesElement.elem('line', {\n x1: pathElement.x,\n y1: pathElement.y,\n x2: pathElement.x + 0.01,\n y2: pathElement.y\n }, options.classNames.point).attr({\n 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNumeric).join(','),\n 'ct:meta': Chartist.serialize(pathElement.data.meta)\n });\n\n this.eventEmitter.emit('draw', {\n type: 'point',\n value: pathElement.data.value,\n index: pathElement.data.valueIndex,\n meta: pathElement.data.meta,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: point,\n x: pathElement.x,\n y: pathElement.y\n });\n }.bind(this));\n }\n\n if(seriesOptions.showLine) {\n var line = seriesElement.elem('path', {\n d: path.stringify()\n }, options.classNames.line, true);\n\n this.eventEmitter.emit('draw', {\n type: 'line',\n values: data.normalized.series[seriesIndex],\n path: path.clone(),\n chartRect: chartRect,\n index: seriesIndex,\n series: series,\n seriesIndex: seriesIndex,\n seriesMeta: series.meta,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: line\n });\n }\n\n // Area currently only works with axes that support a range!\n if(seriesOptions.showArea && axisY.range) {\n // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n // the area is not drawn outside the chart area.\n var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min);\n\n // We project the areaBase value into screen coordinates\n var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase);\n\n // In order to form the area we'll first split the path by move commands so we can chunk it up into segments\n path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) {\n // We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\n return pathSegment.pathElements.length > 1;\n }).map(function convertToArea(solidPathSegments) {\n // Receiving the filtered solid path segments we can now convert those segments into fill areas\n var firstElement = solidPathSegments.pathElements[0];\n var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1];\n\n // Cloning the solid path segment with closing option and removing the first move command from the clone\n // We then insert a new move that should start at the area base and draw a straight line up or down\n // at the end of the path we add an additional straight line to the projected area base value\n // As the closing option is set our path will be automatically closed\n return solidPathSegments.clone(true)\n .position(0)\n .remove(1)\n .move(firstElement.x, areaBaseProjected)\n .line(firstElement.x, firstElement.y)\n .position(solidPathSegments.pathElements.length + 1)\n .line(lastElement.x, areaBaseProjected);\n\n }).forEach(function createArea(areaPath) {\n // For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n // and adding the created DOM elements to the correct series group\n var area = seriesElement.elem('path', {\n d: areaPath.stringify()\n }, options.classNames.area, true);\n\n // Emit an event for each area that was drawn\n this.eventEmitter.emit('draw', {\n type: 'area',\n values: data.normalized.series[seriesIndex],\n path: areaPath.clone(),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n index: seriesIndex,\n group: seriesElement,\n element: area\n });\n }.bind(this));\n }\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: axisY.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }", "title": "" }, { "docid": "08908837b49633305d12b7da86b7f18a", "score": "0.54016995", "text": "function createChart(options) {\n var data = {\n raw: this.data,\n normalized: Chartist.getDataArray(this.data, options.reverseData, true)\n };\n\n // Create new svg object\n this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart);\n // Create groups for labels, grid and series\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n var axisX, axisY;\n\n if(options.axisX.type === undefined) {\n axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n ticks: data.raw.labels,\n stretch: options.fullWidth\n }));\n } else {\n axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n high: Chartist.isNum(options.high) ? options.high : options.axisY.high,\n low: Chartist.isNum(options.low) ? options.low : options.axisY.low\n }));\n } else {\n axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY);\n }\n\n axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n var seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'series-name': series.name,\n 'meta': Chartist.serialize(series.meta)\n }, Chartist.xmlNs.uri);\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n var pathCoordinates = [],\n pathData = [];\n\n data.normalized[seriesIndex].forEach(function(value, valueIndex) {\n var p = {\n x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized[seriesIndex])\n };\n pathCoordinates.push(p.x, p.y);\n pathData.push({\n value: value,\n valueIndex: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex)\n });\n }.bind(this));\n\n var seriesOptions = {\n lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'),\n showPoint: Chartist.getSeriesOption(series, options, 'showPoint'),\n showLine: Chartist.getSeriesOption(series, options, 'showLine'),\n showArea: Chartist.getSeriesOption(series, options, 'showArea'),\n areaBase: Chartist.getSeriesOption(series, options, 'areaBase')\n };\n\n var smoothing = typeof seriesOptions.lineSmooth === 'function' ?\n seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.cardinal() : Chartist.Interpolation.none());\n // Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n // index, value and meta data\n var path = smoothing(pathCoordinates, pathData);\n\n // If we should show points we need to create them now to avoid secondary loop\n // Points are drawn from the pathElements returned by the interpolation function\n // Small offset for Firefox to render squares correctly\n if (seriesOptions.showPoint) {\n\n path.pathElements.forEach(function(pathElement) {\n var point = seriesElement.elem('line', {\n x1: pathElement.x,\n y1: pathElement.y,\n x2: pathElement.x + 0.01,\n y2: pathElement.y\n }, options.classNames.point).attr({\n 'value': [pathElement.data.value.x, pathElement.data.value.y].filter(function(v) {\n return v;\n }).join(','),\n 'meta': pathElement.data.meta\n }, Chartist.xmlNs.uri);\n\n this.eventEmitter.emit('draw', {\n type: 'point',\n value: pathElement.data.value,\n index: pathElement.data.valueIndex,\n meta: pathElement.data.meta,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: point,\n x: pathElement.x,\n y: pathElement.y\n });\n }.bind(this));\n }\n\n if(seriesOptions.showLine) {\n var line = seriesElement.elem('path', {\n d: path.stringify()\n }, options.classNames.line, true);\n\n this.eventEmitter.emit('draw', {\n type: 'line',\n values: data.normalized[seriesIndex],\n path: path.clone(),\n chartRect: chartRect,\n index: seriesIndex,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: line\n });\n }\n\n // Area currently only works with axes that support a range!\n if(seriesOptions.showArea && axisY.range) {\n // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n // the area is not drawn outside the chart area.\n var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min);\n\n // We project the areaBase value into screen coordinates\n var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase);\n\n // In order to form the area we'll first split the path by move commands so we can chunk it up into segments\n path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) {\n // We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\n return pathSegment.pathElements.length > 1;\n }).map(function convertToArea(solidPathSegments) {\n // Receiving the filtered solid path segments we can now convert those segments into fill areas\n var firstElement = solidPathSegments.pathElements[0];\n var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1];\n\n // Cloning the solid path segment with closing option and removing the first move command from the clone\n // We then insert a new move that should start at the area base and draw a straight line up or down\n // at the end of the path we add an additional straight line to the projected area base value\n // As the closing option is set our path will be automatically closed\n return solidPathSegments.clone(true)\n .position(0)\n .remove(1)\n .move(firstElement.x, areaBaseProjected)\n .line(firstElement.x, firstElement.y)\n .position(solidPathSegments.pathElements.length + 1)\n .line(lastElement.x, areaBaseProjected);\n\n }).forEach(function createArea(areaPath) {\n // For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n // and adding the created DOM elements to the correct series group\n var area = seriesElement.elem('path', {\n d: areaPath.stringify()\n }, options.classNames.area, true).attr({\n 'values': data.normalized[seriesIndex]\n }, Chartist.xmlNs.uri);\n\n // Emit an event for each area that was drawn\n this.eventEmitter.emit('draw', {\n type: 'area',\n values: data.normalized[seriesIndex],\n path: areaPath.clone(),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n index: seriesIndex,\n group: seriesElement,\n element: area\n });\n }.bind(this));\n }\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: axisY.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }", "title": "" }, { "docid": "ceda4c41d5856f10cdedfcddc94b9fe5", "score": "0.53993046", "text": "quickDraw () {\n const chartShape = this.getChartShape();\n this.moveCanvas(chartShape);\n this.drawAxes(chartShape);\n }", "title": "" }, { "docid": "d6a2124f50f0b243e7a767fe8955bc20", "score": "0.53939915", "text": "function initialise()\n{\n include_navbar();\n make_nav_item_active(\"line-chart-item\");\n tooltip= generate_tooltip();\n svg = generate_svg(\"#line-chart\",650,800);\n canvas = add_canvas(svg);\n [width,height] = svg_dimensions(svg);\n}", "title": "" }, { "docid": "05942e9849000fe1ec2b7db2c5266ec5", "score": "0.5378066", "text": "function addYAxis(plot) {\n plot.dom.svg.append(\"g\")\n .attr(\"class\", \"y axis yaxis\" + plot.type)\n .call(d3.axisLeft(plot.yAxisData.yScale));// Create an axis component with d3.axisLeft\n}", "title": "" }, { "docid": "f2c824aadb387c18d8507b7733ba61ba", "score": "0.5371202", "text": "function create ($chartDiv, config) {\n var chartDiv = $chartDiv[0],\n chart = window.am4core.create(chartDiv, am4charts.XYChart);\n \n // Create axes\n /*var categoryAxis = chart.xAxes.push(new am4charts.CategoryAxis());\n categoryAxis.dataFields.category = 'x3';\n categoryAxis.title.text = 'Months';*/\n \n var valueXAxis = chart.xAxes.push(new am4charts.ValueAxis());\n valueXAxis.title.text = 'Months';\n\n var valueYAxis = chart.yAxes.push(new am4charts.ValueAxis());\n valueYAxis.title.text = 'Height';\n \n return chart;\n }", "title": "" }, { "docid": "6cb0c9410b36f54452215798d24d6c2f", "score": "0.5370486", "text": "function setup() {\n\tcreateCanvas(600, 500);\n\tgraph = new Graph();\n\tlabels = new Labels();\n\toptions = new Options();\n\tInit();\n}", "title": "" }, { "docid": "288029b0f0fa7474931cdd9e8dac79e9", "score": "0.53695613", "text": "function plotLineChart() {\n $.jqplot('chartdiv_line',\n [\n [\n [2, 2],\n [3, 5.12],\n [5, 13.1],\n [7, 33.6],\n [9, 85.9],\n [11, 219.9]\n ]\n ], {\n title: 'Homofürst',\n highlighter: {\n show: true,\n //sizeAdjust: 7.5,\n tooltipAxes: 'both'\n },\n cursor: {\n show: false\n },\n axes: {\n xaxis: {\n label: 'Angle (radians)'\n\n },\n yaxis: {\n label: 'Cosine',\n labelRenderer: $.jqplot.CanvasAxisLabelRenderer,\n angle: 100\n }\n }\n }\n );\n}", "title": "" }, { "docid": "d5a3bd80222f1b3956665442abbdd2d0", "score": "0.5364534", "text": "function Series() {\n $.jqplot.ElemContainer.call(this);\n // Group: Properties\n // Properties will be assigned from a series array at the top level of the\n // options. If you had two series and wanted to change the color and line\n // width of the first and set the second to use the secondary y axis with\n // no shadow and supply custom labels for each:\n // > {\n // > series:[\n // > {color: '#ff4466', lineWidth: 5, label:'good line'},\n // > {yaxis: 'y2axis', shadow: false, label:'bad line'}\n // > ]\n // > }\n \n // prop: show\n // wether or not to draw the series.\n this.show = true;\n // prop: xaxis\n // which x axis to use with this series, either 'xaxis' or 'x2axis'.\n this.xaxis = 'xaxis';\n this._xaxis;\n // prop: yaxis\n // which y axis to use with this series, either 'yaxis' or 'y2axis'.\n this.yaxis = 'yaxis';\n this._yaxis;\n this.gridBorderWidth = 2.0;\n // prop: renderer\n // A class of a renderer which will draw the series, \n // see <$.jqplot.LineRenderer>.\n this.renderer = $.jqplot.LineRenderer;\n // prop: rendererOptions\n // Options to pass on to the renderer.\n this.rendererOptions = {};\n this.data = [];\n this.gridData = [];\n // prop: label\n // Line label to use in the legend.\n this.label = '';\n // prop: color\n // css color spec for the series\n this.color;\n // prop: lineWidth\n // width of the line in pixels. May have different meanings depending on renderer.\n this.lineWidth = 2.5;\n // prop: shadow\n // wether or not to draw a shadow on the line\n this.shadow = true;\n // prop: shadowAngle\n // Shadow angle in degrees\n this.shadowAngle = 45;\n // prop: shadowOffset\n // Shadow offset from line in pixels\n this.shadowOffset = 1.25;\n // prop: shadowDepth\n // Number of times shadow is stroked, each stroke offset shadowOffset from the last.\n this.shadowDepth = 3;\n // prop: shadowAlpha\n // Alpha channel transparency of shadow. 0 = transparent.\n this.shadowAlpha = '0.1';\n // prop: breakOnNull\n // Not implemented. wether line segments should be be broken at null value.\n // False will join point on either side of line.\n this.breakOnNull = false;\n // prop: markerRenderer\n // A class of a renderer which will draw marker (e.g. circle, square, ...) at the data points,\n // see <$.jqplot.MarkerRenderer>.\n this.markerRenderer = $.jqplot.MarkerRenderer;\n // prop: markerOptions\n // renderer specific options to pass to the markerRenderer,\n // see <$.jqplot.MarkerRenderer>.\n this.markerOptions = {};\n // prop: showLine\n // wether to actually draw the line or not. Series will still be renderered, even if no line is drawn.\n this.showLine = true;\n // prop: showMarker\n // wether or not to show the markers at the data points.\n this.showMarker = true;\n // prop: index\n // 0 based index of this series in the plot series array.\n this.index;\n // prop: fill\n // true or false, wether to fill under lines or in bars.\n // May not be implemented in all renderers.\n this.fill = false;\n // prop: fillColor\n // CSS color spec to use for fill under line. Defaults to line color.\n this.fillColor;\n // prop: fillAlpha\n // Alpha transparency to apply to the fill under the line.\n // Use this to adjust alpha separate from fill color.\n this.fillAlpha;\n // prop: fillAndStroke\n // If true will stroke the line (with color this.color) as well as fill under it.\n // Applies only when fill is true.\n this.fillAndStroke = false;\n // _stack is set by the Plot if the plot is a stacked chart.\n // will stack lines or bars on top of one another to build a \"mountain\" style chart.\n // May not be implemented in all renderers.\n this._stack = false;\n // prop: neighborThreshold\n // how close or far (in pixels) the cursor must be from a point marker to detect the point.\n this.neighborThreshold = 4;\n this._stackData = [];\n this._plotData = [];\n // data from the previous series, for stacked charts.\n this._prevPlotData = [];\n this._prevGridData = [];\n this._stackAxis = 'y';\n this._primaryAxis = '_xaxis';\n this.plugins = {};\n }", "title": "" }, { "docid": "939503fa1db278e7dbe906421dbc4158", "score": "0.5363525", "text": "function createAxis(currentChartInfo) {\n// Plot the X-Axis & Y-Axis using the current chart information \n\n // Group & Add Y-Axis to the chart (Use .call & set class as \"y-axis\") \n chartGroup.append(\"g\")\n .call(currentChartInfo.yAxis)\n .attr(\"class\", \"y-axis\")\n\n // Group & Add Y-Axis to the chart (Use .call & set class as \"y-axis\") \n // NOte: Transform the X-Axis to move it to Bottom instead of Top\n chartGroup.append(\"g\")\n .call(currentChartInfo.xAxis)\n .attr(\"class\", \"x-axis\")\n .attr(\"transform\", `translate(0, ${chartHeight})`)\n\n // Return\n return;\n\n}", "title": "" }, { "docid": "5d52cc4a3af83755282df7f0cabbe175", "score": "0.5357757", "text": "constructor(p, x, y){\r\n\t\tsuper(\"plot\", x, y, \"Hoe\");\r\n\t\tthis.plot = p;\r\n\t}", "title": "" }, { "docid": "4f74bfcc5e1d76700efd74571b233cc6", "score": "0.5350991", "text": "initConfig() {\n var margin = this.margin,\n id = this.id,\n width = this.width - margin.left - margin.right,\n height = this.height - margin.top - margin.bottom;\n\n this.container = d3.select(id);\n\n this.svg = d3.select(id)\n .append(\"svg\")\n .style('overflow', 'visible') // to overwrite overflow: hidden by Boostrap as default\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom);\n\n this.body = this.svg\n .append(\"g\")\n .attr('class', 'c9-chart c9-custom-container')\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n \n }", "title": "" }, { "docid": "ef4fe9c23b4b6a7065f50df0d6321a53", "score": "0.53509825", "text": "function init(){\n addOptions();\n plotCharts(\"940\");\n displayData(\"940\");\n plotGauge(\"940\");\n}", "title": "" }, { "docid": "5c80544811567855437de2da595d6d86", "score": "0.5350922", "text": "function init() {\n data = [{\n x: [1, 2, 3, 4, 5],\n y: [1, 2, 4, 8, 16] }];\n \n Plotly.newPlot(\"plot2\", data);\n}", "title": "" }, { "docid": "75f802f3c0a0cc75b8ca6e59d03ff6a7", "score": "0.53481084", "text": "function buildPlot() {\n $('#plot-loading').show();\n $('#plot-container').hide();\n $('#ts-plot').removeClass('disabled-tab');\n try {\n timeseriesPlot.destory();\n } catch {};\n $.ajax({\n headers: {\n 'X-CSRFToken': getCookie('csrftoken')\n },\n type: 'POST',\n data: {\n 'layer_code': activeLayer,\n 'site_code': selectedLayer['row'][1],\n 'var_code': selectedLayer['row'][3],\n 'site_name': selectedLayer['row'][0],\n 'var_name': selectedLayer['row'][2]\n },\n url: '/apps/hydroshare-data-viewer/ajax/get-timeseries-data/',\n success: function(response) {\n if (response['layer_code'] === activeLayer && response['variable_code'] === selectedLayer['row'][3] && response['site_code'] === selectedLayer['row'][1]) {\n var timeseriesData = [];\n for (var i = 0; i < response['timeseries_data'].length; i++) {\n timeseriesData.push({\n 'x': Date.parse(response['timeseries_data'][i][0]),\n 'y': parseFloat(response['timeseries_data'][i][1])\n })\n };\n timeseriesPlot = new CanvasJS.Chart('plot', {\n height: 250,\n responsive: true,\n animationEnabled: true,\n zoomEnabled: true,\n title: {\n text: response['variable_name'] + ' at ' + response['site_name']\n },\n axisX: {},\n axisY: {\n title: response['variable_name'] + ' (' + response['unit_name'] + ')',\n },\n data: [{\n type:'line',\n name: response['variable_name'],\n xValueType: 'dateTime',\n xValueFormatString: 'DD MMM hh:mm TT',\n dataPoints: timeseriesData\n }]\n });\n $('#plot-loading').hide();\n $('#plot-container').show();\n updatePlotSize();\n };\n },\n error: function(response) {\n console.log('Layer Load Failed');\n }\n });\n }", "title": "" }, { "docid": "9beae95a690c144ab739c2c4bd6d3e9a", "score": "0.5339646", "text": "function init(plot) {\n /*jshint validthis:true */\n var that = this;\n var eventMarkers = new EventMarkers(plot);\n\n plot.getEvents = function () {\n return eventMarkers._events;\n };\n\n plot.hideEvents = function () {\n $.each(eventMarkers._events, function (index, event) {\n event.visual().getObject().hide();\n });\n };\n\n plot.showEvents = function () {\n plot.hideEvents();\n $.each(eventMarkers._events, function (index, event) {\n event.hide();\n });\n\n that.eventMarkers.drawEvents();\n };\n\n // change events on an existing plot\n plot.setEvents = function (events) {\n if (eventMarkers.eventsEnabled) {\n eventMarkers.setupEvents(events);\n }\n };\n\n plot.hooks.processOptions.push(function (plot, options) {\n // enable the plugin\n if (options.events.data != null) {\n eventMarkers.eventsEnabled = true;\n }\n });\n\n plot.hooks.draw.push(function (plot) {\n var options = plot.getOptions();\n\n if (eventMarkers.eventsEnabled) {\n // check for first run\n if (eventMarkers.getEvents().length < 1) {\n eventMarkers.setTypes(options.events.types);\n eventMarkers.setupEvents(options.events.data);\n } else {\n eventMarkers.updateEvents();\n }\n }\n\n eventMarkers.drawEvents();\n });\n }", "title": "" }, { "docid": "cd1cf2d0854e0c37759bacf4626d0d6f", "score": "0.533311", "text": "function Plot(placeholder, options) {\n\n var canvas = null, // the canvas for the plot itself\n overlay = null, // canvas for interactive stuff on top of plot\n eventHolder = null, // jQuery object that events should be bound to\n ctx = null, octx = null,\n plotOffset = { left: 0, right: 0, top: 0, bottom: 0},\n canvasWidth = 0, canvasHeight = 0,\n plotWidth = 0, enabled = true, plotHeight = 0,\n host = \"localhost\", port = 80, session = \"\",\n plotSocket = false, isPlotting = false,\n lastFrame = \"var frame_header = false;\",\n plot = this, cursor_info = 0;\n var plotCanvas = document.getElementById('plot_canvas');\n\n // limit and zoom divs\n var ldiv = [], startX = 0, startY = 0, stopX = 0, stopY = 0, zdraw = -1, ztop = 0;\n var move = -1, resize = -1, rStartX = 0, rStartY = 0, mStartX = 0, mStartY = 0;\n\n // Public function\n plot.plotInit = function () {\n\n if (!isPlotting) {\n\n var addr = 'ws://' + host + ':' + port + '/api/' + session;\n if (\"WebSocket\" in window) {\n plotSocket = new WebSocket(addr);\n } else {\n plotSocket = new MozWebSocket(addr);\n }\n\n document.getElementById('status').innerText = \"Connecting to port \" + port + \"...\";\n\n plotSocket.onopen = function(e) {\n plotSocket.send(\"<hello args=''\");\n }\n\n plotSocket.onmessage = function(e) {\n document.getElementById('status').innerText = \"Connected\";\n lastFrame = e.data;\n drawFrame(ctx);\n }\n\n plotSocket.onclose = function(e) {\n isPlotting = false;\n }\n\n isPlotting = true;\n }\n }\n\n // Init\n parseOptions(options);\n setupCanvases();\n resize_canvas(0, canvasWidth, canvasHeight);\n\n // Set up event callbacks\n $(\"#plotBody\").mouseup(function (e) { outSize(); });\n\n $(\"#zoom_div\").mousemove(function(event) { slideCanvas(event, this); });\n $(\"#zoom_div\").mouseup(function(event) {\n\n if ( event.which == 1 ) {\n releaseCanvas(event, this);\n }\n\n });\n\n $(\"#hb\").click(function(event) { goHome(); });\n $(\"#hb\").bind(\"ondragstart\", function(event) { return false; });\n\n $(\"#mb\").click(function(event) { maximize(); });\n $(\"#mb\").bind(\"ondragstart\", function(event) { return false; });\n\n $(\"#sm\").mousedown(function(event) { clickMove(event); });\n $(\"#cm\").mousedown(function(event) { clickMove(event); });\n\n $(\"#cursor_info\").click(function(event) { trackCursor(); });\n\n $(\"#cb\").click(function(event) { closePlot(); });\n\n $(\"#rb\").bind(\"ondragstart\", function(event) { return false; });\n\n $(\"#rbb\").mousedown(function(event) { clickSize(event); });\n\n $(\"#plotDiv\").bind(\"ondragover\", function(event) { onDragOver(event, this); });\n $(\"#plotDiv\").bind(\"ondrop\", function(event) { onDrop(event); });\n $(\"#plotDiv\").mouseup(function(event) { releaseCanvas(event, this); });\n\n // Private Functions\n\n function parseOptions(options) {\n if( options.host !== undefined )\n host = options.host;\n if( options.host !== undefined )\n port = options.port;\n if( options.host !== undefined )\n session = options.session;\n if( options.width !== undefined )\n canvasWidth = options.width;\n if( options.height !== undefined )\n canvasHeight = options.height;\n }\n\n // This signature must be (id, width, height)!\n // Called by payload\n function resize_canvas(id, width, height) {\n canvasWidth = width;\n canvasHeight = height;\n resizeCanvas(canvas);\n resizeCanvas(overlay);\n placeholder.width(width);\n placeholder.height(height);\n document.getElementById(\"button_menu\").style.width = width + \"px\";\n }\n\n function slideCanvas(e) {\n var pageX = getPageX(e);\n var pageY = getPageY(e);\n var xDelta = pageX - startX;\n var yDelta = pageY - startY;\n\n if (!e) { var e = window.event; }\n if (zdraw > -1) {\n var zdiv = document.getElementById(\"zoom_div\");\n var offsetTop = (plotCanvas.offsetTop + plotCanvas.offsetParent.offsetTop);\n var offsetLeft = (plotCanvas.offsetLeft + plotCanvas.offsetParent.offsetLeft);\n var startYTop = (startY - offsetTop) + \"px\";\n var startXLeft = (startX - offsetLeft) + \"px\";\n var pageYTop = (pageY - offsetTop) + \"px\";\n var pageXLeft = (pageX - offsetLeft) + \"px\";\n // IV quad\n if (xDelta > 0 && yDelta > 0) {\n zdiv.style.top = startYTop;\n zdiv.style.left = startXLeft;\n }\n // II quad\n if (xDelta < 0 && yDelta < 0) {\n zdiv.style.top = pageYTop;\n zdiv.style.left = pageXLeft;\n }\n // I quad\n if (xDelta > 0 && yDelta < 0) {\n zdiv.style.top = pageYTop;\n zdiv.style.left = startXLeft;\n }\n // III quad\n if (xDelta < 0 && yDelta > 0) {\n zdiv.style.top = startYTop;\n zdiv.style.left = pageXLeft;\n }\n zdiv.style.width = Math.abs(xDelta) + \"px\";\n zdiv.style.height = Math.abs(yDelta) + \"px\";\n }\n\n // If zooming\n if ($(\"#zoom\").is(\":checked\")) {\n document.getElementById('cursor_info').innerText = \"Cursor at: \" + pageX + \",\" + pageY;\n }\n else {\n if (startX != 0 && startY != 0) {\n // Reduce granularity by a factor of 2.\n var w = canvasWidth * 2.;\n var h = canvasHeight * 2.;\n\n var elev_delta = (yDelta/h)*180.;\n var azim_delta = (xDelta/w)*180.;\n\n document.getElementById('cursor_info').innerText = \"Delta (deg): \" +\n azim_delta.toFixed(1) + \", \" + elev_delta.toFixed(1);\n }\n }\n return false;\n }\n\n function releaseCanvas(e, zdiv) {\n var pageX = getPageX(e);\n var pageY = getPageY(e);\n\n if ($(\"#admin\").length > 0) {\n stopX = pageX;\n stopY = pageY;\n var zdiv = document.getElementById(\"zoom_div\");\n\n // Support rotation in NW, SW, and NE directions\n if (zdraw > -1 && (Math.abs(stopX-startX)>2) && (Math.abs(stopY-startY)>2)) {\n zoom(zdiv, zdraw);\n }\n else {\n // not in zdraw (or zoomed areas less than 5x5) so normal click\n handleClick(e);\n zdiv.style.display = \"none\";\n }\n startX = stopX = startY = stopY = 0;\n }\n zdraw = -1;\n return false;\n }\n\n function zoom(zdiv, axes) {\n var zoom_coords = axes +\n \",\" +\n (startX - plotCanvas.offsetLeft) +\n \",\" +\n (canvasHeight - (stopY - plotCanvas.offsetTop)) +\n \",\" +\n (stopX - plotCanvas.offsetLeft) +\n \",\" +\n (canvasHeight - (startY - plotCanvas.offsetTop));\n\n var zoom_or_rotate = $(\"#zoom\").is(\":checked\") ? \"zoom\" : \"rotate\";\n plotSocket.send(\"<\" + zoom_or_rotate + \" args='\" + zoom_coords + \"'>\");\n zdiv.style.width = \"0px\";\n zdiv.style.height = \"0px\";\n zdiv.style.display = \"none\";\n }\n\n function clickCanvas(e, axes) {\n var pageX = getPageX(e);\n var pageY = getPageY(e);\n\n if (!e) { var e = window.event; }\n if ($(\"#admin\").length > 0 && (e.button === 0) && (e.shiftKey === false)) {\n var zdiv = document.getElementById('zoom_div');\n zdraw = axes;\n zdiv.style.width = 0;\n zdiv.style.height = 0;\n zdiv.style.top = (pageY - (plotCanvas.offsetTop + plotCanvas.offsetParent.offsetTop)) + \"px\";\n zdiv.style.left = (pageX - (plotCanvas.offsetLeft + plotCanvas.offsetParent.offsetLeft)) + \"px\";\n zdiv.style.display = \"inline\";\n startX = pageX;\n startY = pageY;\n }\n return false;\n }\n\n function clickMove(e) {\n var pageX = getPageX(e);\n var pageY = getPageY(e);\n\n move = 0;\n mStartY = (pageY - plotCanvas.offsetTop);\n mStartX = (pageX - plotCanvas.offsetLeft);\n ztop += 1;\n plotCanvas.style.setProperty('z-index',ztop);\n }\n\n function trackCursor() {\n document.getElementById('cursor_info').innerText = \"\";\n cursor_info += 1;\n if (cursor_info > 1) {\n cursor_info = 0;\n }\n }\n\n function closePlot() {\n if ($(\"#admin\").length > 0) {\n plotSocket.send(\"<close args=''>\");\n stopPlotting();\n }\n }\n\n function stopPlotting() {\n\n plotSocket.onmessage = function(e) {};\n\n // reset the handler so that the buffer behind this socket does not polute new plots\n plotSocket.close();\n lastFrame = \"var frame_header = false;\";\n document.getElementById('status').innerText = \"Disconnected\";\n\n isPlotting = false;\n }\n\n function clickSize(e) {\n var pageX = getPageX(e);\n var pageY = getPageY(e);\n if ($(\"#admin\").length > 0) {\n var cr = document.getElementById('resize_div');\n resize = 0;\n rStartX = pageX;\n rStartY = pageY;\n document.getElementById('status').innerText = \"Click size at \" + rStartX + \",\" + rStartY;\n cr.style.top = plotCanvas.style.top;\n cr.style.left = plotCanvas.style.left;\n cr.style.width = (plotCanvas.clientWidth - 2) + \"px\";\n cr.style.height = (plotCanvas.clientHeight - 4) + \"px\";\n cr.style.display = \"inline\";\n }\n return false;\n }\n\n function slideSize(e) {\n var pageX = getPageX(e);\n var pageY = getPageY(e);\n if ($(\"#admin\").length > 0 && resize > -1) {\n var cr = document.getElementById('resize_div');\n cr.style.width = (pageX - cr.offsetLeft) + \"px\";\n cr.style.height = (pageY - cr.offsetTop) + \"px\";\n document.getElementById('status').innerText = \"Slide size to \" +\n (pageX - rStartX) + \",\" + (pageY - rStartY);\n }\n else if (move > -1) {\n plotCanvas.style.top = (pageY - mStartY) + \"px\";\n plotCanvas.style.left = (pageX - mStartX) + \"px\";\n }\n return false;\n }\n\n function getPageX(e) {\n return (window.Event) ? e.pageX : e.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);\n }\n\n function getPageY(e) {\n return (window.Event) ? e.pageY : e.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);\n }\n\n function getDocWidth() {\n return Math.max(\n $(document).width(),\n $(window).width(),\n document.documentElement.clientWidth\n );\n };\n\n function getDocHeight() {\n return Math.max(\n $(document).height(),\n $(window).height(),\n document.documentElement.clientHeight\n );\n };\n\n function maximize() {\n if ($(\"#admin\").length > 0) {\n var w = getDocWidth() * 0.98 - plotCanvas.offsetLeft;\n var h = getDocHeight() * 0.98 - plotCanvas.offsetTop - 20;\n resize = 0;\n doResize(w, h);\n resize = -1;\n }\n }\n\n function outSize() {\n if ($(\"#admin\").length > 0 && resize > -1) {\n var cr = document.getElementById('resize_div');\n doResize(cr.clientWidth, cr.clientHeight - 20);\n cr.style.display = \"none\";\n }\n resize = -1;\n move = -1;\n zdraw = -1;\n // make sure we kill everything on mouse up\n }\n\n function doResize(w, h) {\n if (resize > -1) {\n try {\n plotSocket.send(\"<resize args='\" + w + \",\" + h + \"'>\");\n } catch (err) {}\n }\n else {\n var xScale = w / native_w[0];\n var yScale = h / native_h[0];\n resize_canvas(0, w, h);\n document.getElementById('status').innerText = \"Client side resize mode\";\n ctx.scale(xScale, yScale);\n drawFrame(ctx);\n }\n }\n\n function goHome() {\n if($(\"#admin\").length > 0) {\n plotSocket.send(\"<home args=''>\");\n }\n }\n\n function handleClick(e) {\n var pageX = getPageX(e);\n var pageY = getPageY(e);\n\n if ($(\"#admin\").length > 0) {\n plotSocket.send(\"<click args='\" +\n (pageX - plotCanvas.offsetLeft) + \",\" +\n (canvasHeight - (pageY - plotCanvas.offsetTop)) + \",\" +\n (e.button + 1) + \"'>\");\n }\n }\n\n function onDragOver(e, div) {\n if (e.preventDefault) { e.preventDefault(); }\n div.className = 'over';\n e.dataTransfer.dropEffect = 'copy';\n return false;\n }\n\n function onDrop(e) {\n if (e.preventDefault) { e.preventDefault(); }\n return false;\n }\n\n function makeLimitDiv(nid, i) {\n var div = $('<div class=\"cursor\"></div>');\n div.attr('id', nid);\n div.mousemove(function (e) {slideCanvas(e, this);});\n div.mousedown(function (e) {\n\n if ( e.which == 1 ) {\n clickCanvas(e, i);\n }\n\n });\n div.mouseup(function (e) {releaseCanvas(e, this);});\n div.bind('ondragover', function (e) { onDragOver(e, this); });\n div.bind('ondrop', function (e) { onDrop(e); });\n return div;\n }\n\n function updateLimitDiv(ax_bb) {\n\n ldiv = [];\n for (var i=0; i < ax_bb.length; i++) {\n var nid = 'limit_div_' + i;\n for(var j=0; j < plotCanvas.childNodes.length; j++) {\n var child = plotCanvas.childNodes[j];\n if( child.id !== undefined && child.id == nid )\n plotCanvas.removeChild(child);\n }\n\n var ndiv = makeLimitDiv(nid, i);\n ndiv.appendTo($(\"#plot_canvas\"));\n ldiv[i] = document.getElementById(nid);\n ldiv[i].style.display = \"inline\";\n ldiv[i].style.left = ax_bb[i][0] + \"px\";\n ldiv[i].style.top = ax_bb[i][1] + \"px\";\n ldiv[i].style.width = ax_bb[i][4] - ax_bb[i][0] + \"px\";\n ldiv[i].style.height = ax_bb[i][3] - ax_bb[i][1] + \"px\";\n }\n\n }\n function drawFrame(c) {\n var ax_bb = [], native_w = [], native_h = [], id = 0;\n\n eval(lastFrame);\n if(frame_header) {\n frame_header();\n }\n //document.getElementById(\"info\").innerHTML = ax_bb.toString();\n\n updateLimitDiv(ax_bb);\n }\n\n function makeCanvas(skipPositioning, cls) {\n var c = document.createElement('canvas');\n c.className = cls;\n c.width = canvasWidth;\n c.height = canvasHeight;\n\n if (!skipPositioning)\n $(c).css({ position: 'absolute', left: 0, top: 0, border: '1px solid gray' });\n\n $(c).appendTo(placeholder);\n\n if (!c.getContext) // excanvas hack\n c = window.G_vmlCanvasManager.initElement(c);\n\n // used for resetting in case we get replotted\n c.getContext(\"2d\").save();\n\n return c;\n }\n\n function resizeCanvas(c) {\n // resizing should reset the state (excanvas seems to be\n // buggy though)\n if (c.width != canvasWidth)\n c.width = canvasWidth;\n\n if (c.height != canvasHeight)\n c.height = canvasHeight;\n\n // so try to get back to the initial state (even if it's\n // gone now, this should be safe according to the spec)\n var cctx = c.getContext(\"2d\");\n cctx.restore();\n\n // and save again\n cctx.save();\n }\n\n function getCanvasDimensions() {\n canvasWidth = placeholder.width();\n canvasHeight = placeholder.height();\n\n if (canvasWidth <= 0 || canvasHeight <= 0)\n throw \"Invalid dimensions for plot, width = \" + canvasWidth + \", height = \" + canvasHeight;\n }\n\n function setupCanvases() {\n var reused,\n existingCanvas = placeholder.children(\"canvas.base\"),\n existingOverlay = placeholder.children(\"canvas.overlay\");\n\n if (existingCanvas.length == 0 || existingOverlay == 0) {\n // init everything\n\n placeholder.html(\"\"); // make sure placeholder is clear\n\n placeholder.css({ padding: 0 }); // padding messes up the positioning\n\n if (placeholder.css(\"position\") == 'static')\n placeholder.css(\"position\", \"relative\"); // for positioning labels and overlay\n\n getCanvasDimensions();\n\n canvas = makeCanvas(true, \"base\");\n overlay = makeCanvas(false, \"overlay\"); // overlay canvas for interactive features\n\n reused = false;\n }\n else {\n // reuse existing elements\n\n canvas = existingCanvas.get(0);\n overlay = existingOverlay.get(0);\n\n reused = true;\n }\n\n ctx = canvas.getContext(\"2d\");\n octx = overlay.getContext(\"2d\");\n\n // we include the canvas in the event holder too, because IE 7\n // sometimes has trouble with the stacking order\n eventHolder = $([overlay, canvas]);\n\n if (reused) {\n // run shutdown in the old plot object\n placeholder.data(\"plot\").shutdown();\n\n // reset reused canvases\n plot.resize();\n\n // make sure overlay pixels are cleared (canvas is cleared when we redraw)\n octx.clearRect(0, 0, canvasWidth, canvasHeight);\n\n // then whack any remaining obvious garbage left\n eventHolder.unbind();\n placeholder.children().not([canvas, overlay]).remove();\n }\n\n // save in case we get replotted\n placeholder.data(\"plot\", plot);\n }\n\n // Contributed by Charles Blackwell\n // http://stackoverflow.com/questions/8208043/display-google-map-on-hover-link-or-text\n if (window.Event && document.captureEvents) {\n document.captureEvents(Event.MOUSEMOVE);\n }\n document.onmousemove = slideSize;\n document.addEventListener(\"onmousemove\", slideSize, true);\n }", "title": "" }, { "docid": "6c5f349562d46f73488d17ca9c0e7077", "score": "0.5322166", "text": "function setup() {\n // Configure the world.\n w = new p$.World('canvasContainer', draw, resize);\n w.scaleX.set(50, 0.5, '');\n w.scaleY.set(50, -0.1, '');\n w.axis.outsideNumbers = false;\n w.axis.draggable(false);\n\n // Configure box and labels.\n labels.area = box.addLabel(110, 14, {\n name: 'Área',\n units: '',\n decPlaces: 5,\n labelWidth: 60,\n fixPlaces: true\n });\n labels.area.setPosition(0, 25);\n box.calculateDimensions();\n\n // Add plots to data cursor.\n dc.add(plot);\n\n // Add objects to world.\n w.add(plot, shade, dc, box);\n\n // Calculate the probability density function for the normal distribution.\n plot.clear();\n for (var z = ZMIN; z <= ZMAX; z += STEP) {\n var pdf =\n (1 / (SIGMA * Math.sqrt(2 * Math.PI))) *\n Math.exp(-0.5 * Math.pow((z - MU) / SIGMA, 2));\n plot.points.push([z, pdf]);\n }\n}", "title": "" }, { "docid": "df45d34ca3a3d64aa63a77096e9d738e", "score": "0.53177816", "text": "function drawAxes() {\n // Draw X and Y axes\n context.moveTo(0, xAxis);\n context.lineTo(width, xAxis);\n context.moveTo(yAxis, 0);\n context.lineTo(yAxis, height);\n // Draw X axis tick at PI\n context.moveTo(yAxis + Math.PI * unit, xAxis + 5);\n context.lineTo(yAxis + Math.PI * unit, xAxis - 5);\n }", "title": "" }, { "docid": "477078603e04a2e3a0768b5fce152912", "score": "0.53124803", "text": "function set_generic_layout_options(layout) {\n layout.title = { \n font: { color: FONT_COLOR },\n xref: 'x', \n yref: 'y', \n x: 0.05, \n } ;\n layout.height = PLOT_H;\n layout.width = PLOT_W;\n layout.paper_bgcolor = PAPER_BG_COLOR; \n layout.plot_bgcolor = PLOT_BG_COLOR; \n\n layout.xaxis = { \n zerolinecolor: H_LINE_COLOR, \n zerolinewidth: 1,\n gridcolor: GRID_COLOR, \n linecolor: H_LINE_COLOR, \n title: { font: { size: 15, color: AXIS_FONT_COLOR } },\n tickfont: { color: TICK_FONT_COLOR},\n };\n\n layout.yaxis = {\n zerolinecolor: V_LINE_COLOR, \n zerolinewidth: 1, \n gridcolor: GRID_COLOR, \n linecolor: V_LINE_COLOR,\n title: { font: { size: 15, color: AXIS_FONT_COLOR}}, \n tickfont: { color: TICK_FONT_COLOR},\n };\n\n layout.showlegend = true;\n layout.legend = {\n xanchor:\"right\",\n yanchor:\"bottom\",\n y:5, \n x:1,\n orientation: 'v',\n traceorder: 'normal',\n bordercolor: LEGEND_BORDER, \n borderwidth: 1,\n bgcolor: LEGEND_BG,\n font: {\n color: LEGEND_FONT_COLOR\n } \n };\n\n return layout\n}", "title": "" }, { "docid": "b42757e91c461708f34e31d8dc77833b", "score": "0.5310606", "text": "function createChart(options) {\n\t this.data = Chartist.normalizeData(this.data);\n\t var data = {\n\t raw: this.data,\n\t normalized: Chartist.getDataArray(this.data, options.reverseData, true)\n\t };\n\n\t // Create new svg object\n\t this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart);\n\t // Create groups for labels, grid and series\n\t var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n\t var seriesGroup = this.svg.elem('g');\n\t var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n\t var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n\t var axisX, axisY;\n\n\t if(options.axisX.type === undefined) {\n\t axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n\t ticks: data.raw.labels,\n\t stretch: options.fullWidth\n\t }));\n\t } else {\n\t axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX);\n\t }\n\n\t if(options.axisY.type === undefined) {\n\t axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n\t high: Chartist.isNum(options.high) ? options.high : options.axisY.high,\n\t low: Chartist.isNum(options.low) ? options.low : options.axisY.low\n\t }));\n\t } else {\n\t axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY);\n\t }\n\n\t axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\t axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n\t // Draw the series\n\t data.raw.series.forEach(function(series, seriesIndex) {\n\t var seriesElement = seriesGroup.elem('g');\n\n\t // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n\t seriesElement.attr({\n\t 'ct:series-name': series.name,\n\t 'ct:meta': Chartist.serialize(series.meta)\n\t });\n\n\t // Use series class from series data or if not set generate one\n\t seriesElement.addClass([\n\t options.classNames.series,\n\t (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n\t ].join(' '));\n\n\t var pathCoordinates = [],\n\t pathData = [];\n\n\t data.normalized[seriesIndex].forEach(function(value, valueIndex) {\n\t var p = {\n\t x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized[seriesIndex]),\n\t y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized[seriesIndex])\n\t };\n\t pathCoordinates.push(p.x, p.y);\n\t pathData.push({\n\t value: value,\n\t valueIndex: valueIndex,\n\t meta: Chartist.getMetaData(series, valueIndex)\n\t });\n\t }.bind(this));\n\n\t var seriesOptions = {\n\t lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'),\n\t showPoint: Chartist.getSeriesOption(series, options, 'showPoint'),\n\t showLine: Chartist.getSeriesOption(series, options, 'showLine'),\n\t showArea: Chartist.getSeriesOption(series, options, 'showArea'),\n\t areaBase: Chartist.getSeriesOption(series, options, 'areaBase')\n\t };\n\n\t var smoothing = typeof seriesOptions.lineSmooth === 'function' ?\n\t seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.cardinal() : Chartist.Interpolation.none());\n\t // Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n\t // index, value and meta data\n\t var path = smoothing(pathCoordinates, pathData);\n\n\t // If we should show points we need to create them now to avoid secondary loop\n\t // Points are drawn from the pathElements returned by the interpolation function\n\t // Small offset for Firefox to render squares correctly\n\t if (seriesOptions.showPoint) {\n\n\t path.pathElements.forEach(function(pathElement) {\n\t var point = seriesElement.elem('line', {\n\t x1: pathElement.x,\n\t y1: pathElement.y,\n\t x2: pathElement.x + 0.01,\n\t y2: pathElement.y\n\t }, options.classNames.point).attr({\n\t 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNum).join(','),\n\t 'ct:meta': pathElement.data.meta\n\t });\n\n\t this.eventEmitter.emit('draw', {\n\t type: 'point',\n\t value: pathElement.data.value,\n\t index: pathElement.data.valueIndex,\n\t meta: pathElement.data.meta,\n\t series: series,\n\t seriesIndex: seriesIndex,\n\t axisX: axisX,\n\t axisY: axisY,\n\t group: seriesElement,\n\t element: point,\n\t x: pathElement.x,\n\t y: pathElement.y\n\t });\n\t }.bind(this));\n\t }\n\n\t if(seriesOptions.showLine) {\n\t var line = seriesElement.elem('path', {\n\t d: path.stringify()\n\t }, options.classNames.line, true);\n\n\t this.eventEmitter.emit('draw', {\n\t type: 'line',\n\t values: data.normalized[seriesIndex],\n\t path: path.clone(),\n\t chartRect: chartRect,\n\t index: seriesIndex,\n\t series: series,\n\t seriesIndex: seriesIndex,\n\t axisX: axisX,\n\t axisY: axisY,\n\t group: seriesElement,\n\t element: line\n\t });\n\t }\n\n\t // Area currently only works with axes that support a range!\n\t if(seriesOptions.showArea && axisY.range) {\n\t // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n\t // the area is not drawn outside the chart area.\n\t var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min);\n\n\t // We project the areaBase value into screen coordinates\n\t var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase);\n\n\t // In order to form the area we'll first split the path by move commands so we can chunk it up into segments\n\t path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) {\n\t // We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\n\t return pathSegment.pathElements.length > 1;\n\t }).map(function convertToArea(solidPathSegments) {\n\t // Receiving the filtered solid path segments we can now convert those segments into fill areas\n\t var firstElement = solidPathSegments.pathElements[0];\n\t var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1];\n\n\t // Cloning the solid path segment with closing option and removing the first move command from the clone\n\t // We then insert a new move that should start at the area base and draw a straight line up or down\n\t // at the end of the path we add an additional straight line to the projected area base value\n\t // As the closing option is set our path will be automatically closed\n\t return solidPathSegments.clone(true)\n\t .position(0)\n\t .remove(1)\n\t .move(firstElement.x, areaBaseProjected)\n\t .line(firstElement.x, firstElement.y)\n\t .position(solidPathSegments.pathElements.length + 1)\n\t .line(lastElement.x, areaBaseProjected);\n\n\t }).forEach(function createArea(areaPath) {\n\t // For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n\t // and adding the created DOM elements to the correct series group\n\t var area = seriesElement.elem('path', {\n\t d: areaPath.stringify()\n\t }, options.classNames.area, true);\n\n\t // Emit an event for each area that was drawn\n\t this.eventEmitter.emit('draw', {\n\t type: 'area',\n\t values: data.normalized[seriesIndex],\n\t path: areaPath.clone(),\n\t series: series,\n\t seriesIndex: seriesIndex,\n\t axisX: axisX,\n\t axisY: axisY,\n\t chartRect: chartRect,\n\t index: seriesIndex,\n\t group: seriesElement,\n\t element: area\n\t });\n\t }.bind(this));\n\t }\n\t }.bind(this));\n\n\t this.eventEmitter.emit('created', {\n\t bounds: axisY.bounds,\n\t chartRect: chartRect,\n\t axisX: axisX,\n\t axisY: axisY,\n\t svg: this.svg,\n\t options: options\n\t });\n\t }", "title": "" }, { "docid": "0a7b4092b7d4865524794eabc8e127e2", "score": "0.5308297", "text": "function drawAxes() {\n return Plotly.Axes.doTicks(gd, 'redraw');\n }", "title": "" }, { "docid": "650de602edcf221eae7ccb7852f2bbd8", "score": "0.5306519", "text": "function configureChart(aggregateData, container, title) {\n\n var dataParsed = [];\n var labelsParsed = [];\n \n var i = 1;\n aggregateData.timeByDimension.forEach(function(t){\n \tdataParsed.push([[1, i, t.value.duration]]);\n \tlabelsParsed.push(t._id + ' ' + t.value.duration + '/' + aggregateData.totalDuration);\n \ti++;\n });\n \n var\n data = [],\n timeline = { show : true, barWidth : .6},\n markers = [],\n i, graph, point;\n\n // Timeline\n Flotr._.each(dataParsed, function (d) {\n data.push({\n data : d,\n timeline : Flotr._.clone(timeline)\n });\n });\n\n // Markers\n Flotr._.each(dataParsed, function (d) {\n point = d[0];\n markers.push([point[0], point[1]]);\n });\n data.push({\n data: markers,\n markers: {\n show: true,\n position: 'rm',\n stackingType: 'b',\n stacked: false,\n stroke: false,\n fontSize: 10,\n horizontal: true,\n labelFormatter : function (o) { return labelsParsed[o.index]; }\n }\n });\n \n // Draw Graph\n graph = Flotr.draw(container, data, {\n xaxis: {\n showLabels: false\n },\n yaxis: {\n showLabels : false\n },\n grid: {\n \t color: '#37AA37',\n horizontalLines : false\n },\n title: title,\n \tbackgroundColor: '#FFFFFF',\n \tfill: false,\n \tcolors: aggregateData.colors\n });\n}", "title": "" }, { "docid": "c4489a3989616f3483a135a9393f8459", "score": "0.530555", "text": "#drawAxes() {\n this.beginPath()\n for (let i = 0; i < this.#axesCount; i++) {\n const {x, y} = getLineOffset(this.#angleOffset + this.#angleStep * i, this.#axesLength);\n this.drawLine(this.#config.position.x, this.#config.position.y, this.#config.position.x + x, this.#config.position.y + y);\n }\n this.closePath();\n }", "title": "" }, { "docid": "eab6fab6787a82aa701e21e6832cbfec", "score": "0.53055274", "text": "function Plot(placeholder,data_,options_,plugins){ // data is on the form:\n\t// [ series1, series2 ... ]\n\t// where series is either just the data as [ [x1, y1], [x2, y2], ... ]\n\t// or { data: [ [x1, y1], [x2, y2], ... ], label: \"some label\", ... }\n\tvar series=[],options={ // the color theme used for graphs\n\tcolors:[\"#edc240\",\"#afd8f8\",\"#cb4b4b\",\"#4da74d\",\"#9440ed\"],legend:{show:true,noColumns:1, // number of colums in legend table\n\tlabelFormatter:null, // fn: string -> string\n\tlabelBoxBorderColor:\"#ccc\", // border color for the little label boxes\n\tcontainer:null, // container (as jQuery object) to put legend in, null means default on top of graph\n\tposition:\"ne\", // position of default legend container within plot\n\tmargin:5, // distance from grid edge to default legend container within plot\n\tbackgroundColor:null, // null means auto-detect\n\tbackgroundOpacity:0.85, // set to 0 to avoid background\n\tsorted:null // default to no legend sorting\n\t},xaxis:{show:null, // null = auto-detect, true = always, false = never\n\tposition:\"bottom\", // or \"top\"\n\tmode:null, // null or \"time\"\n\tfont:null, // null (derived from CSS in placeholder) or object like { size: 11, lineHeight: 13, style: \"italic\", weight: \"bold\", family: \"sans-serif\", variant: \"small-caps\" }\n\tcolor:null, // base color, labels, ticks\n\ttickColor:null, // possibly different color of ticks, e.g. \"rgba(0,0,0,0.15)\"\n\ttransform:null, // null or f: number -> number to transform axis\n\tinverseTransform:null, // if transform is set, this should be the inverse function\n\tmin:null, // min. value to show, null means set automatically\n\tmax:null, // max. value to show, null means set automatically\n\tautoscaleMargin:null, // margin in % to add if auto-setting min/max\n\tticks:null, // either [1, 3] or [[1, \"a\"], 3] or (fn: axis info -> ticks) or app. number of ticks for auto-ticks\n\ttickFormatter:null, // fn: number -> string\n\tlabelWidth:null, // size of tick labels in pixels\n\tlabelHeight:null,reserveSpace:null, // whether to reserve space even if axis isn't shown\n\ttickLength:null, // size in pixels of ticks, or \"full\" for whole line\n\talignTicksWithAxis:null, // axis number or null for no sync\n\ttickDecimals:null, // no. of decimals, null means auto\n\ttickSize:null, // number or [number, \"unit\"]\n\tminTickSize:null // number or [number, \"unit\"]\n\t},yaxis:{autoscaleMargin:0.02,position:\"left\" // or \"right\"\n\t},xaxes:[],yaxes:[],series:{points:{show:false,radius:3,lineWidth:2, // in pixels\n\tfill:true,fillColor:\"#ffffff\",symbol:\"circle\" // or callback\n\t},lines:{ // we don't put in show: false so we can see\n\t// whether lines were actively disabled\n\tlineWidth:2, // in pixels\n\tfill:false,fillColor:null,steps:false // Omit 'zero', so we can later default its value to\n\t// match that of the 'fill' option.\n\t},bars:{show:false,lineWidth:2, // in pixels\n\tbarWidth:1, // in units of the x axis\n\tfill:true,fillColor:null,align:\"left\", // \"left\", \"right\", or \"center\"\n\thorizontal:false,zero:true},shadowSize:3,highlightColor:null},grid:{show:true,aboveData:false,color:\"#545454\", // primary color used for outline and labels\n\tbackgroundColor:null, // null for transparent, else color\n\tborderColor:null, // set if different from the grid color\n\ttickColor:null, // color for the ticks, e.g. \"rgba(0,0,0,0.15)\"\n\tmargin:0, // distance from the canvas edge to the grid\n\tlabelMargin:5, // in pixels\n\taxisMargin:8, // in pixels\n\tborderWidth:2, // in pixels\n\tminBorderMargin:null, // in pixels, null means taken from points radius\n\tmarkings:null, // array of ranges or fn: axes -> array of ranges\n\tmarkingsColor:\"#f4f4f4\",markingsLineWidth:2, // interactive stuff\n\tclickable:false,hoverable:false,autoHighlight:true, // highlight in case mouse is near\n\tmouseActiveRadius:10 // how far the mouse can be away to activate an item\n\t},interaction:{redrawOverlayInterval:1000/60 // time between updates, -1 means in same flow\n\t},hooks:{}},surface=null, // the canvas for the plot itself\n\toverlay=null, // canvas for interactive stuff on top of plot\n\teventHolder=null, // jQuery object that events should be bound to\n\tctx=null,octx=null,xaxes=[],yaxes=[],plotOffset={left:0,right:0,top:0,bottom:0},plotWidth=0,plotHeight=0,hooks={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},plot=this; // public functions\n\tplot.setData=setData;plot.setupGrid=setupGrid;plot.draw=draw;plot.getPlaceholder=function(){return placeholder;};plot.getCanvas=function(){return surface.element;};plot.getPlotOffset=function(){return plotOffset;};plot.width=function(){return plotWidth;};plot.height=function(){return plotHeight;};plot.offset=function(){var o=eventHolder.offset();o.left+=plotOffset.left;o.top+=plotOffset.top;return o;};plot.getData=function(){return series;};plot.getAxes=function(){var res={},i;$.each(xaxes.concat(yaxes),function(_,axis){if(axis)res[axis.direction+(axis.n!=1?axis.n:\"\")+\"axis\"]=axis;});return res;};plot.getXAxes=function(){return xaxes;};plot.getYAxes=function(){return yaxes;};plot.c2p=canvasToAxisCoords;plot.p2c=axisToCanvasCoords;plot.getOptions=function(){return options;};plot.highlight=highlight;plot.unhighlight=unhighlight;plot.triggerRedrawOverlay=triggerRedrawOverlay;plot.pointOffset=function(point){return {left:parseInt(xaxes[axisNumber(point,\"x\")-1].p2c(+point.x)+plotOffset.left,10),top:parseInt(yaxes[axisNumber(point,\"y\")-1].p2c(+point.y)+plotOffset.top,10)};};plot.shutdown=shutdown;plot.destroy=function(){shutdown();placeholder.removeData(\"plot\").empty();series=[];options=null;surface=null;overlay=null;eventHolder=null;ctx=null;octx=null;xaxes=[];yaxes=[];hooks=null;highlights=[];plot=null;};plot.resize=function(){var width=placeholder.width(),height=placeholder.height();surface.resize(width,height);overlay.resize(width,height);}; // public attributes\n\tplot.hooks=hooks; // initialize\n\tinitPlugins(plot);parseOptions(options_);setupCanvases();setData(data_);setupGrid();draw();bindEvents();function executeHooks(hook,args){args=[plot].concat(args);for(var i=0;i<hook.length;++i){hook[i].apply(this,args);}}function initPlugins(){ // References to key classes, allowing plugins to modify them\n\tvar classes={Canvas:Canvas};for(var i=0;i<plugins.length;++i){var p=plugins[i];p.init(plot,classes);if(p.options)$.extend(true,options,p.options);}}function parseOptions(opts){$.extend(true,options,opts); // $.extend merges arrays, rather than replacing them. When less\n\t// colors are provided than the size of the default palette, we\n\t// end up with those colors plus the remaining defaults, which is\n\t// not expected behavior; avoid it by replacing them here.\n\tif(opts&&opts.colors){options.colors=opts.colors;}if(options.xaxis.color==null)options.xaxis.color=$.color.parse(options.grid.color).scale('a',0.22).toString();if(options.yaxis.color==null)options.yaxis.color=$.color.parse(options.grid.color).scale('a',0.22).toString();if(options.xaxis.tickColor==null) // grid.tickColor for back-compatibility\n\toptions.xaxis.tickColor=options.grid.tickColor||options.xaxis.color;if(options.yaxis.tickColor==null) // grid.tickColor for back-compatibility\n\toptions.yaxis.tickColor=options.grid.tickColor||options.yaxis.color;if(options.grid.borderColor==null)options.grid.borderColor=options.grid.color;if(options.grid.tickColor==null)options.grid.tickColor=$.color.parse(options.grid.color).scale('a',0.22).toString(); // Fill in defaults for axis options, including any unspecified\n\t// font-spec fields, if a font-spec was provided.\n\t// If no x/y axis options were provided, create one of each anyway,\n\t// since the rest of the code assumes that they exist.\n\tvar i,axisOptions,axisCount,fontSize=placeholder.css(\"font-size\"),fontSizeDefault=fontSize?+fontSize.replace(\"px\",\"\"):13,fontDefaults={style:placeholder.css(\"font-style\"),size:Math.round(0.8*fontSizeDefault),variant:placeholder.css(\"font-variant\"),weight:placeholder.css(\"font-weight\"),family:placeholder.css(\"font-family\")};axisCount=options.xaxes.length||1;for(i=0;i<axisCount;++i){axisOptions=options.xaxes[i];if(axisOptions&&!axisOptions.tickColor){axisOptions.tickColor=axisOptions.color;}axisOptions=$.extend(true,{},options.xaxis,axisOptions);options.xaxes[i]=axisOptions;if(axisOptions.font){axisOptions.font=$.extend({},fontDefaults,axisOptions.font);if(!axisOptions.font.color){axisOptions.font.color=axisOptions.color;}if(!axisOptions.font.lineHeight){axisOptions.font.lineHeight=Math.round(axisOptions.font.size*1.15);}}}axisCount=options.yaxes.length||1;for(i=0;i<axisCount;++i){axisOptions=options.yaxes[i];if(axisOptions&&!axisOptions.tickColor){axisOptions.tickColor=axisOptions.color;}axisOptions=$.extend(true,{},options.yaxis,axisOptions);options.yaxes[i]=axisOptions;if(axisOptions.font){axisOptions.font=$.extend({},fontDefaults,axisOptions.font);if(!axisOptions.font.color){axisOptions.font.color=axisOptions.color;}if(!axisOptions.font.lineHeight){axisOptions.font.lineHeight=Math.round(axisOptions.font.size*1.15);}}} // backwards compatibility, to be removed in future\n\tif(options.xaxis.noTicks&&options.xaxis.ticks==null)options.xaxis.ticks=options.xaxis.noTicks;if(options.yaxis.noTicks&&options.yaxis.ticks==null)options.yaxis.ticks=options.yaxis.noTicks;if(options.x2axis){options.xaxes[1]=$.extend(true,{},options.xaxis,options.x2axis);options.xaxes[1].position=\"top\"; // Override the inherit to allow the axis to auto-scale\n\tif(options.x2axis.min==null){options.xaxes[1].min=null;}if(options.x2axis.max==null){options.xaxes[1].max=null;}}if(options.y2axis){options.yaxes[1]=$.extend(true,{},options.yaxis,options.y2axis);options.yaxes[1].position=\"right\"; // Override the inherit to allow the axis to auto-scale\n\tif(options.y2axis.min==null){options.yaxes[1].min=null;}if(options.y2axis.max==null){options.yaxes[1].max=null;}}if(options.grid.coloredAreas)options.grid.markings=options.grid.coloredAreas;if(options.grid.coloredAreasColor)options.grid.markingsColor=options.grid.coloredAreasColor;if(options.lines)$.extend(true,options.series.lines,options.lines);if(options.points)$.extend(true,options.series.points,options.points);if(options.bars)$.extend(true,options.series.bars,options.bars);if(options.shadowSize!=null)options.series.shadowSize=options.shadowSize;if(options.highlightColor!=null)options.series.highlightColor=options.highlightColor; // save options on axes for future reference\n\tfor(i=0;i<options.xaxes.length;++i){getOrCreateAxis(xaxes,i+1).options=options.xaxes[i];}for(i=0;i<options.yaxes.length;++i){getOrCreateAxis(yaxes,i+1).options=options.yaxes[i];} // add hooks from options\n\tfor(var n in hooks){if(options.hooks[n]&&options.hooks[n].length)hooks[n]=hooks[n].concat(options.hooks[n]);}executeHooks(hooks.processOptions,[options]);}function setData(d){series=parseData(d);fillInSeriesOptions();processData();}function parseData(d){var res=[];for(var i=0;i<d.length;++i){var s=$.extend(true,{},options.series);if(d[i].data!=null){s.data=d[i].data; // move the data instead of deep-copy\n\tdelete d[i].data;$.extend(true,s,d[i]);d[i].data=s.data;}else s.data=d[i];res.push(s);}return res;}function axisNumber(obj,coord){var a=obj[coord+\"axis\"];if((typeof a===\"undefined\"?\"undefined\":_typeof(a))==\"object\") // if we got a real axis, extract number\n\ta=a.n;if(typeof a!=\"number\")a=1; // default to first axis\n\treturn a;}function allAxes(){ // return flat array without annoying null entries\n\treturn $.grep(xaxes.concat(yaxes),function(a){return a;});}function canvasToAxisCoords(pos){ // return an object with x/y corresponding to all used axes\n\tvar res={},i,axis;for(i=0;i<xaxes.length;++i){axis=xaxes[i];if(axis&&axis.used)res[\"x\"+axis.n]=axis.c2p(pos.left);}for(i=0;i<yaxes.length;++i){axis=yaxes[i];if(axis&&axis.used)res[\"y\"+axis.n]=axis.c2p(pos.top);}if(res.x1!==undefined)res.x=res.x1;if(res.y1!==undefined)res.y=res.y1;return res;}function axisToCanvasCoords(pos){ // get canvas coords from the first pair of x/y found in pos\n\tvar res={},i,axis,key;for(i=0;i<xaxes.length;++i){axis=xaxes[i];if(axis&&axis.used){key=\"x\"+axis.n;if(pos[key]==null&&axis.n==1)key=\"x\";if(pos[key]!=null){res.left=axis.p2c(pos[key]);break;}}}for(i=0;i<yaxes.length;++i){axis=yaxes[i];if(axis&&axis.used){key=\"y\"+axis.n;if(pos[key]==null&&axis.n==1)key=\"y\";if(pos[key]!=null){res.top=axis.p2c(pos[key]);break;}}}return res;}function getOrCreateAxis(axes,number){if(!axes[number-1])axes[number-1]={n:number, // save the number for future reference\n\tdirection:axes==xaxes?\"x\":\"y\",options:$.extend(true,{},axes==xaxes?options.xaxis:options.yaxis)};return axes[number-1];}function fillInSeriesOptions(){var neededColors=series.length,maxIndex=-1,i; // Subtract the number of series that already have fixed colors or\n\t// color indexes from the number that we still need to generate.\n\tfor(i=0;i<series.length;++i){var sc=series[i].color;if(sc!=null){neededColors--;if(typeof sc==\"number\"&&sc>maxIndex){maxIndex=sc;}}} // If any of the series have fixed color indexes, then we need to\n\t// generate at least as many colors as the highest index.\n\tif(neededColors<=maxIndex){neededColors=maxIndex+1;} // Generate all the colors, using first the option colors and then\n\t// variations on those colors once they're exhausted.\n\tvar c,colors=[],colorPool=options.colors,colorPoolSize=colorPool.length,variation=0;for(i=0;i<neededColors;i++){c=$.color.parse(colorPool[i%colorPoolSize]||\"#666\"); // Each time we exhaust the colors in the pool we adjust\n\t// a scaling factor used to produce more variations on\n\t// those colors. The factor alternates negative/positive\n\t// to produce lighter/darker colors.\n\t// Reset the variation after every few cycles, or else\n\t// it will end up producing only white or black colors.\n\tif(i%colorPoolSize==0&&i){if(variation>=0){if(variation<0.5){variation=-variation-0.2;}else variation=0;}else variation=-variation;}colors[i]=c.scale('rgb',1+variation);} // Finalize the series options, filling in their colors\n\tvar colori=0,s;for(i=0;i<series.length;++i){s=series[i]; // assign colors\n\tif(s.color==null){s.color=colors[colori].toString();++colori;}else if(typeof s.color==\"number\")s.color=colors[s.color].toString(); // turn on lines automatically in case nothing is set\n\tif(s.lines.show==null){var v,show=true;for(v in s){if(s[v]&&s[v].show){show=false;break;}}if(show)s.lines.show=true;} // If nothing was provided for lines.zero, default it to match\n\t// lines.fill, since areas by default should extend to zero.\n\tif(s.lines.zero==null){s.lines.zero=!!s.lines.fill;} // setup axes\n\ts.xaxis=getOrCreateAxis(xaxes,axisNumber(s,\"x\"));s.yaxis=getOrCreateAxis(yaxes,axisNumber(s,\"y\"));}}function processData(){var topSentry=Number.POSITIVE_INFINITY,bottomSentry=Number.NEGATIVE_INFINITY,fakeInfinity=Number.MAX_VALUE,i,j,k,m,length,s,points,ps,x,y,axis,val,f,p,data,format;function updateAxis(axis,min,max){if(min<axis.datamin&&min!=-fakeInfinity)axis.datamin=min;if(max>axis.datamax&&max!=fakeInfinity)axis.datamax=max;}$.each(allAxes(),function(_,axis){ // init axis\n\taxis.datamin=topSentry;axis.datamax=bottomSentry;axis.used=false;});for(i=0;i<series.length;++i){s=series[i];s.datapoints={points:[]};executeHooks(hooks.processRawData,[s,s.data,s.datapoints]);} // first pass: clean and copy data\n\tfor(i=0;i<series.length;++i){s=series[i];data=s.data;format=s.datapoints.format;if(!format){format=[]; // find out how to copy\n\tformat.push({x:true,number:true,required:true});format.push({y:true,number:true,required:true});if(s.bars.show||s.lines.show&&s.lines.fill){var autoscale=!!(s.bars.show&&s.bars.zero||s.lines.show&&s.lines.zero);format.push({y:true,number:true,required:false,defaultValue:0,autoscale:autoscale});if(s.bars.horizontal){delete format[format.length-1].y;format[format.length-1].x=true;}}s.datapoints.format=format;}if(s.datapoints.pointsize!=null)continue; // already filled in\n\ts.datapoints.pointsize=format.length;ps=s.datapoints.pointsize;points=s.datapoints.points;var insertSteps=s.lines.show&&s.lines.steps;s.xaxis.used=s.yaxis.used=true;for(j=k=0;j<data.length;++j,k+=ps){p=data[j];var nullify=p==null;if(!nullify){for(m=0;m<ps;++m){val=p[m];f=format[m];if(f){if(f.number&&val!=null){val=+val; // convert to number\n\tif(isNaN(val))val=null;else if(val==Infinity)val=fakeInfinity;else if(val==-Infinity)val=-fakeInfinity;}if(val==null){if(f.required)nullify=true;if(f.defaultValue!=null)val=f.defaultValue;}}points[k+m]=val;}}if(nullify){for(m=0;m<ps;++m){val=points[k+m];if(val!=null){f=format[m]; // extract min/max info\n\tif(f.autoscale!==false){if(f.x){updateAxis(s.xaxis,val,val);}if(f.y){updateAxis(s.yaxis,val,val);}}}points[k+m]=null;}}else { // a little bit of line specific stuff that\n\t// perhaps shouldn't be here, but lacking\n\t// better means...\n\tif(insertSteps&&k>0&&points[k-ps]!=null&&points[k-ps]!=points[k]&&points[k-ps+1]!=points[k+1]){ // copy the point to make room for a middle point\n\tfor(m=0;m<ps;++m){points[k+ps+m]=points[k+m];} // middle point has same y\n\tpoints[k+1]=points[k-ps+1]; // we've added a point, better reflect that\n\tk+=ps;}}}} // give the hooks a chance to run\n\tfor(i=0;i<series.length;++i){s=series[i];executeHooks(hooks.processDatapoints,[s,s.datapoints]);} // second pass: find datamax/datamin for auto-scaling\n\tfor(i=0;i<series.length;++i){s=series[i];points=s.datapoints.points;ps=s.datapoints.pointsize;format=s.datapoints.format;var xmin=topSentry,ymin=topSentry,xmax=bottomSentry,ymax=bottomSentry;for(j=0;j<points.length;j+=ps){if(points[j]==null)continue;for(m=0;m<ps;++m){val=points[j+m];f=format[m];if(!f||f.autoscale===false||val==fakeInfinity||val==-fakeInfinity)continue;if(f.x){if(val<xmin)xmin=val;if(val>xmax)xmax=val;}if(f.y){if(val<ymin)ymin=val;if(val>ymax)ymax=val;}}}if(s.bars.show){ // make sure we got room for the bar on the dancing floor\n\tvar delta;switch(s.bars.align){case \"left\":delta=0;break;case \"right\":delta=-s.bars.barWidth;break;default:delta=-s.bars.barWidth/2;}if(s.bars.horizontal){ymin+=delta;ymax+=delta+s.bars.barWidth;}else {xmin+=delta;xmax+=delta+s.bars.barWidth;}}updateAxis(s.xaxis,xmin,xmax);updateAxis(s.yaxis,ymin,ymax);}$.each(allAxes(),function(_,axis){if(axis.datamin==topSentry)axis.datamin=null;if(axis.datamax==bottomSentry)axis.datamax=null;});}function setupCanvases(){ // Make sure the placeholder is clear of everything except canvases\n\t// from a previous plot in this container that we'll try to re-use.\n\tplaceholder.css(\"padding\",0) // padding messes up the positioning\n\t.children().filter(function(){return !$(this).hasClass(\"flot-overlay\")&&!$(this).hasClass('flot-base');}).remove();if(placeholder.css(\"position\")=='static')placeholder.css(\"position\",\"relative\"); // for positioning labels and overlay\n\tsurface=new Canvas(\"flot-base\",placeholder);overlay=new Canvas(\"flot-overlay\",placeholder); // overlay canvas for interactive features\n\tctx=surface.context;octx=overlay.context; // define which element we're listening for events on\n\teventHolder=$(overlay.element).unbind(); // If we're re-using a plot object, shut down the old one\n\tvar existing=placeholder.data(\"plot\");if(existing){existing.shutdown();overlay.clear();} // save in case we get replotted\n\tplaceholder.data(\"plot\",plot);}function bindEvents(){ // bind events\n\tif(options.grid.hoverable){eventHolder.mousemove(onMouseMove); // Use bind, rather than .mouseleave, because we officially\n\t// still support jQuery 1.2.6, which doesn't define a shortcut\n\t// for mouseenter or mouseleave. This was a bug/oversight that\n\t// was fixed somewhere around 1.3.x. We can return to using\n\t// .mouseleave when we drop support for 1.2.6.\n\teventHolder.bind(\"mouseleave\",onMouseLeave);}if(options.grid.clickable)eventHolder.click(onClick);executeHooks(hooks.bindEvents,[eventHolder]);}function shutdown(){if(redrawTimeout)clearTimeout(redrawTimeout);eventHolder.unbind(\"mousemove\",onMouseMove);eventHolder.unbind(\"mouseleave\",onMouseLeave);eventHolder.unbind(\"click\",onClick);executeHooks(hooks.shutdown,[eventHolder]);}function setTransformationHelpers(axis){ // set helper functions on the axis, assumes plot area\n\t// has been computed already\n\tfunction identity(x){return x;}var s,m,t=axis.options.transform||identity,it=axis.options.inverseTransform; // precompute how much the axis is scaling a point\n\t// in canvas space\n\tif(axis.direction==\"x\"){s=axis.scale=plotWidth/Math.abs(t(axis.max)-t(axis.min));m=Math.min(t(axis.max),t(axis.min));}else {s=axis.scale=plotHeight/Math.abs(t(axis.max)-t(axis.min));s=-s;m=Math.max(t(axis.max),t(axis.min));} // data point to canvas coordinate\n\tif(t==identity) // slight optimization\n\taxis.p2c=function(p){return (p-m)*s;};else axis.p2c=function(p){return (t(p)-m)*s;}; // canvas coordinate to data point\n\tif(!it)axis.c2p=function(c){return m+c/s;};else axis.c2p=function(c){return it(m+c/s);};}function measureTickLabels(axis){var opts=axis.options,ticks=axis.ticks||[],labelWidth=opts.labelWidth||0,labelHeight=opts.labelHeight||0,maxWidth=labelWidth||(axis.direction==\"x\"?Math.floor(surface.width/(ticks.length||1)):null),legacyStyles=axis.direction+\"Axis \"+axis.direction+axis.n+\"Axis\",layer=\"flot-\"+axis.direction+\"-axis flot-\"+axis.direction+axis.n+\"-axis \"+legacyStyles,font=opts.font||\"flot-tick-label tickLabel\";for(var i=0;i<ticks.length;++i){var t=ticks[i];if(!t.label)continue;var info=surface.getTextInfo(layer,t.label,font,null,maxWidth);labelWidth=Math.max(labelWidth,info.width);labelHeight=Math.max(labelHeight,info.height);}axis.labelWidth=opts.labelWidth||labelWidth;axis.labelHeight=opts.labelHeight||labelHeight;}function allocateAxisBoxFirstPhase(axis){ // find the bounding box of the axis by looking at label\n\t// widths/heights and ticks, make room by diminishing the\n\t// plotOffset; this first phase only looks at one\n\t// dimension per axis, the other dimension depends on the\n\t// other axes so will have to wait\n\tvar lw=axis.labelWidth,lh=axis.labelHeight,pos=axis.options.position,isXAxis=axis.direction===\"x\",tickLength=axis.options.tickLength,axisMargin=options.grid.axisMargin,padding=options.grid.labelMargin,innermost=true,outermost=true,first=true,found=false; // Determine the axis's position in its direction and on its side\n\t$.each(isXAxis?xaxes:yaxes,function(i,a){if(a&&(a.show||a.reserveSpace)){if(a===axis){found=true;}else if(a.options.position===pos){if(found){outermost=false;}else {innermost=false;}}if(!found){first=false;}}}); // The outermost axis on each side has no margin\n\tif(outermost){axisMargin=0;} // The ticks for the first axis in each direction stretch across\n\tif(tickLength==null){tickLength=first?\"full\":5;}if(!isNaN(+tickLength))padding+=+tickLength;if(isXAxis){lh+=padding;if(pos==\"bottom\"){plotOffset.bottom+=lh+axisMargin;axis.box={top:surface.height-plotOffset.bottom,height:lh};}else {axis.box={top:plotOffset.top+axisMargin,height:lh};plotOffset.top+=lh+axisMargin;}}else {lw+=padding;if(pos==\"left\"){axis.box={left:plotOffset.left+axisMargin,width:lw};plotOffset.left+=lw+axisMargin;}else {plotOffset.right+=lw+axisMargin;axis.box={left:surface.width-plotOffset.right,width:lw};}} // save for future reference\n\taxis.position=pos;axis.tickLength=tickLength;axis.box.padding=padding;axis.innermost=innermost;}function allocateAxisBoxSecondPhase(axis){ // now that all axis boxes have been placed in one\n\t// dimension, we can set the remaining dimension coordinates\n\tif(axis.direction==\"x\"){axis.box.left=plotOffset.left-axis.labelWidth/2;axis.box.width=surface.width-plotOffset.left-plotOffset.right+axis.labelWidth;}else {axis.box.top=plotOffset.top-axis.labelHeight/2;axis.box.height=surface.height-plotOffset.bottom-plotOffset.top+axis.labelHeight;}}function adjustLayoutForThingsStickingOut(){ // possibly adjust plot offset to ensure everything stays\n\t// inside the canvas and isn't clipped off\n\tvar minMargin=options.grid.minBorderMargin,axis,i; // check stuff from the plot (FIXME: this should just read\n\t// a value from the series, otherwise it's impossible to\n\t// customize)\n\tif(minMargin==null){minMargin=0;for(i=0;i<series.length;++i){minMargin=Math.max(minMargin,2*(series[i].points.radius+series[i].points.lineWidth/2));}}var margins={left:minMargin,right:minMargin,top:minMargin,bottom:minMargin}; // check axis labels, note we don't check the actual\n\t// labels but instead use the overall width/height to not\n\t// jump as much around with replots\n\t$.each(allAxes(),function(_,axis){if(axis.reserveSpace&&axis.ticks&&axis.ticks.length){if(axis.direction===\"x\"){margins.left=Math.max(margins.left,axis.labelWidth/2);margins.right=Math.max(margins.right,axis.labelWidth/2);}else {margins.bottom=Math.max(margins.bottom,axis.labelHeight/2);margins.top=Math.max(margins.top,axis.labelHeight/2);}}});plotOffset.left=Math.ceil(Math.max(margins.left,plotOffset.left));plotOffset.right=Math.ceil(Math.max(margins.right,plotOffset.right));plotOffset.top=Math.ceil(Math.max(margins.top,plotOffset.top));plotOffset.bottom=Math.ceil(Math.max(margins.bottom,plotOffset.bottom));}function setupGrid(){var i,axes=allAxes(),showGrid=options.grid.show; // Initialize the plot's offset from the edge of the canvas\n\tfor(var a in plotOffset){var margin=options.grid.margin||0;plotOffset[a]=typeof margin==\"number\"?margin:margin[a]||0;}executeHooks(hooks.processOffset,[plotOffset]); // If the grid is visible, add its border width to the offset\n\tfor(var a in plotOffset){if(_typeof(options.grid.borderWidth)==\"object\"){plotOffset[a]+=showGrid?options.grid.borderWidth[a]:0;}else {plotOffset[a]+=showGrid?options.grid.borderWidth:0;}}$.each(axes,function(_,axis){var axisOpts=axis.options;axis.show=axisOpts.show==null?axis.used:axisOpts.show;axis.reserveSpace=axisOpts.reserveSpace==null?axis.show:axisOpts.reserveSpace;setRange(axis);});if(showGrid){var allocatedAxes=$.grep(axes,function(axis){return axis.show||axis.reserveSpace;});$.each(allocatedAxes,function(_,axis){ // make the ticks\n\tsetupTickGeneration(axis);setTicks(axis);snapRangeToTicks(axis,axis.ticks); // find labelWidth/Height for axis\n\tmeasureTickLabels(axis);}); // with all dimensions calculated, we can compute the\n\t// axis bounding boxes, start from the outside\n\t// (reverse order)\n\tfor(i=allocatedAxes.length-1;i>=0;--i){allocateAxisBoxFirstPhase(allocatedAxes[i]);} // make sure we've got enough space for things that\n\t// might stick out\n\tadjustLayoutForThingsStickingOut();$.each(allocatedAxes,function(_,axis){allocateAxisBoxSecondPhase(axis);});}plotWidth=surface.width-plotOffset.left-plotOffset.right;plotHeight=surface.height-plotOffset.bottom-plotOffset.top; // now we got the proper plot dimensions, we can compute the scaling\n\t$.each(axes,function(_,axis){setTransformationHelpers(axis);});if(showGrid){drawAxisLabels();}insertLegend();}function setRange(axis){var opts=axis.options,min=+(opts.min!=null?opts.min:axis.datamin),max=+(opts.max!=null?opts.max:axis.datamax),delta=max-min;if(delta==0.0){ // degenerate case\n\tvar widen=max==0?1:0.01;if(opts.min==null)min-=widen; // always widen max if we couldn't widen min to ensure we\n\t// don't fall into min == max which doesn't work\n\tif(opts.max==null||opts.min!=null)max+=widen;}else { // consider autoscaling\n\tvar margin=opts.autoscaleMargin;if(margin!=null){if(opts.min==null){min-=delta*margin; // make sure we don't go below zero if all values\n\t// are positive\n\tif(min<0&&axis.datamin!=null&&axis.datamin>=0)min=0;}if(opts.max==null){max+=delta*margin;if(max>0&&axis.datamax!=null&&axis.datamax<=0)max=0;}}}axis.min=min;axis.max=max;}function setupTickGeneration(axis){var opts=axis.options; // estimate number of ticks\n\tvar noTicks;if(typeof opts.ticks==\"number\"&&opts.ticks>0)noTicks=opts.ticks;else // heuristic based on the model a*sqrt(x) fitted to\n\t// some data points that seemed reasonable\n\tnoTicks=0.3*Math.sqrt(axis.direction==\"x\"?surface.width:surface.height);var delta=(axis.max-axis.min)/noTicks,dec=-Math.floor(Math.log(delta)/Math.LN10),maxDec=opts.tickDecimals;if(maxDec!=null&&dec>maxDec){dec=maxDec;}var magn=Math.pow(10,-dec),norm=delta/magn, // norm is between 1.0 and 10.0\n\tsize;if(norm<1.5){size=1;}else if(norm<3){size=2; // special case for 2.5, requires an extra decimal\n\tif(norm>2.25&&(maxDec==null||dec+1<=maxDec)){size=2.5;++dec;}}else if(norm<7.5){size=5;}else {size=10;}size*=magn;if(opts.minTickSize!=null&&size<opts.minTickSize){size=opts.minTickSize;}axis.delta=delta;axis.tickDecimals=Math.max(0,maxDec!=null?maxDec:dec);axis.tickSize=opts.tickSize||size; // Time mode was moved to a plug-in in 0.8, and since so many people use it\n\t// we'll add an especially friendly reminder to make sure they included it.\n\tif(opts.mode==\"time\"&&!axis.tickGenerator){throw new Error(\"Time mode requires the flot.time plugin.\");} // Flot supports base-10 axes; any other mode else is handled by a plug-in,\n\t// like flot.time.js.\n\tif(!axis.tickGenerator){axis.tickGenerator=function(axis){var ticks=[],start=floorInBase(axis.min,axis.tickSize),i=0,v=Number.NaN,prev;do {prev=v;v=start+i*axis.tickSize;ticks.push(v);++i;}while(v<axis.max&&v!=prev);return ticks;};axis.tickFormatter=function(value,axis){var factor=axis.tickDecimals?Math.pow(10,axis.tickDecimals):1;var formatted=\"\"+Math.round(value*factor)/factor; // If tickDecimals was specified, ensure that we have exactly that\n\t// much precision; otherwise default to the value's own precision.\n\tif(axis.tickDecimals!=null){var decimal=formatted.indexOf(\".\");var precision=decimal==-1?0:formatted.length-decimal-1;if(precision<axis.tickDecimals){return (precision?formatted:formatted+\".\")+(\"\"+factor).substr(1,axis.tickDecimals-precision);}}return formatted;};}if($.isFunction(opts.tickFormatter))axis.tickFormatter=function(v,axis){return \"\"+opts.tickFormatter(v,axis);};if(opts.alignTicksWithAxis!=null){var otherAxis=(axis.direction==\"x\"?xaxes:yaxes)[opts.alignTicksWithAxis-1];if(otherAxis&&otherAxis.used&&otherAxis!=axis){ // consider snapping min/max to outermost nice ticks\n\tvar niceTicks=axis.tickGenerator(axis);if(niceTicks.length>0){if(opts.min==null)axis.min=Math.min(axis.min,niceTicks[0]);if(opts.max==null&&niceTicks.length>1)axis.max=Math.max(axis.max,niceTicks[niceTicks.length-1]);}axis.tickGenerator=function(axis){ // copy ticks, scaled to this axis\n\tvar ticks=[],v,i;for(i=0;i<otherAxis.ticks.length;++i){v=(otherAxis.ticks[i].v-otherAxis.min)/(otherAxis.max-otherAxis.min);v=axis.min+v*(axis.max-axis.min);ticks.push(v);}return ticks;}; // we might need an extra decimal since forced\n\t// ticks don't necessarily fit naturally\n\tif(!axis.mode&&opts.tickDecimals==null){var extraDec=Math.max(0,-Math.floor(Math.log(axis.delta)/Math.LN10)+1),ts=axis.tickGenerator(axis); // only proceed if the tick interval rounded\n\t// with an extra decimal doesn't give us a\n\t// zero at end\n\tif(!(ts.length>1&&/\\..*0$/.test((ts[1]-ts[0]).toFixed(extraDec))))axis.tickDecimals=extraDec;}}}}function setTicks(axis){var oticks=axis.options.ticks,ticks=[];if(oticks==null||typeof oticks==\"number\"&&oticks>0)ticks=axis.tickGenerator(axis);else if(oticks){if($.isFunction(oticks)) // generate the ticks\n\tticks=oticks(axis);else ticks=oticks;} // clean up/labelify the supplied ticks, copy them over\n\tvar i,v;axis.ticks=[];for(i=0;i<ticks.length;++i){var label=null;var t=ticks[i];if((typeof t===\"undefined\"?\"undefined\":_typeof(t))==\"object\"){v=+t[0];if(t.length>1)label=t[1];}else v=+t;if(label==null)label=axis.tickFormatter(v,axis);if(!isNaN(v))axis.ticks.push({v:v,label:label});}}function snapRangeToTicks(axis,ticks){if(axis.options.autoscaleMargin&&ticks.length>0){ // snap to ticks\n\tif(axis.options.min==null)axis.min=Math.min(axis.min,ticks[0].v);if(axis.options.max==null&&ticks.length>1)axis.max=Math.max(axis.max,ticks[ticks.length-1].v);}}function draw(){surface.clear();executeHooks(hooks.drawBackground,[ctx]);var grid=options.grid; // draw background, if any\n\tif(grid.show&&grid.backgroundColor)drawBackground();if(grid.show&&!grid.aboveData){drawGrid();}for(var i=0;i<series.length;++i){executeHooks(hooks.drawSeries,[ctx,series[i]]);drawSeries(series[i]);}executeHooks(hooks.draw,[ctx]);if(grid.show&&grid.aboveData){drawGrid();}surface.render(); // A draw implies that either the axes or data have changed, so we\n\t// should probably update the overlay highlights as well.\n\ttriggerRedrawOverlay();}function extractRange(ranges,coord){var axis,from,to,key,axes=allAxes();for(var i=0;i<axes.length;++i){axis=axes[i];if(axis.direction==coord){key=coord+axis.n+\"axis\";if(!ranges[key]&&axis.n==1)key=coord+\"axis\"; // support x1axis as xaxis\n\tif(ranges[key]){from=ranges[key].from;to=ranges[key].to;break;}}} // backwards-compat stuff - to be removed in future\n\tif(!ranges[key]){axis=coord==\"x\"?xaxes[0]:yaxes[0];from=ranges[coord+\"1\"];to=ranges[coord+\"2\"];} // auto-reverse as an added bonus\n\tif(from!=null&&to!=null&&from>to){var tmp=from;from=to;to=tmp;}return {from:from,to:to,axis:axis};}function drawBackground(){ctx.save();ctx.translate(plotOffset.left,plotOffset.top);ctx.fillStyle=getColorOrGradient(options.grid.backgroundColor,plotHeight,0,\"rgba(255, 255, 255, 0)\");ctx.fillRect(0,0,plotWidth,plotHeight);ctx.restore();}function drawGrid(){var i,axes,bw,bc;ctx.save();ctx.translate(plotOffset.left,plotOffset.top); // draw markings\n\tvar markings=options.grid.markings;if(markings){if($.isFunction(markings)){axes=plot.getAxes(); // xmin etc. is backwards compatibility, to be\n\t// removed in the future\n\taxes.xmin=axes.xaxis.min;axes.xmax=axes.xaxis.max;axes.ymin=axes.yaxis.min;axes.ymax=axes.yaxis.max;markings=markings(axes);}for(i=0;i<markings.length;++i){var m=markings[i],xrange=extractRange(m,\"x\"),yrange=extractRange(m,\"y\"); // fill in missing\n\tif(xrange.from==null)xrange.from=xrange.axis.min;if(xrange.to==null)xrange.to=xrange.axis.max;if(yrange.from==null)yrange.from=yrange.axis.min;if(yrange.to==null)yrange.to=yrange.axis.max; // clip\n\tif(xrange.to<xrange.axis.min||xrange.from>xrange.axis.max||yrange.to<yrange.axis.min||yrange.from>yrange.axis.max)continue;xrange.from=Math.max(xrange.from,xrange.axis.min);xrange.to=Math.min(xrange.to,xrange.axis.max);yrange.from=Math.max(yrange.from,yrange.axis.min);yrange.to=Math.min(yrange.to,yrange.axis.max);var xequal=xrange.from===xrange.to,yequal=yrange.from===yrange.to;if(xequal&&yequal){continue;} // then draw\n\txrange.from=Math.floor(xrange.axis.p2c(xrange.from));xrange.to=Math.floor(xrange.axis.p2c(xrange.to));yrange.from=Math.floor(yrange.axis.p2c(yrange.from));yrange.to=Math.floor(yrange.axis.p2c(yrange.to));if(xequal||yequal){var lineWidth=m.lineWidth||options.grid.markingsLineWidth,subPixel=lineWidth%2?0.5:0;ctx.beginPath();ctx.strokeStyle=m.color||options.grid.markingsColor;ctx.lineWidth=lineWidth;if(xequal){ctx.moveTo(xrange.to+subPixel,yrange.from);ctx.lineTo(xrange.to+subPixel,yrange.to);}else {ctx.moveTo(xrange.from,yrange.to+subPixel);ctx.lineTo(xrange.to,yrange.to+subPixel);}ctx.stroke();}else {ctx.fillStyle=m.color||options.grid.markingsColor;ctx.fillRect(xrange.from,yrange.to,xrange.to-xrange.from,yrange.from-yrange.to);}}} // draw the ticks\n\taxes=allAxes();bw=options.grid.borderWidth;for(var j=0;j<axes.length;++j){var axis=axes[j],box=axis.box,t=axis.tickLength,x,y,xoff,yoff;if(!axis.show||axis.ticks.length==0)continue;ctx.lineWidth=1; // find the edges\n\tif(axis.direction==\"x\"){x=0;if(t==\"full\")y=axis.position==\"top\"?0:plotHeight;else y=box.top-plotOffset.top+(axis.position==\"top\"?box.height:0);}else {y=0;if(t==\"full\")x=axis.position==\"left\"?0:plotWidth;else x=box.left-plotOffset.left+(axis.position==\"left\"?box.width:0);} // draw tick bar\n\tif(!axis.innermost){ctx.strokeStyle=axis.options.color;ctx.beginPath();xoff=yoff=0;if(axis.direction==\"x\")xoff=plotWidth+1;else yoff=plotHeight+1;if(ctx.lineWidth==1){if(axis.direction==\"x\"){y=Math.floor(y)+0.5;}else {x=Math.floor(x)+0.5;}}ctx.moveTo(x,y);ctx.lineTo(x+xoff,y+yoff);ctx.stroke();} // draw ticks\n\tctx.strokeStyle=axis.options.tickColor;ctx.beginPath();for(i=0;i<axis.ticks.length;++i){var v=axis.ticks[i].v;xoff=yoff=0;if(isNaN(v)||v<axis.min||v>axis.max // skip those lying on the axes if we got a border\n\t||t==\"full\"&&((typeof bw===\"undefined\"?\"undefined\":_typeof(bw))==\"object\"&&bw[axis.position]>0||bw>0)&&(v==axis.min||v==axis.max))continue;if(axis.direction==\"x\"){x=axis.p2c(v);yoff=t==\"full\"?-plotHeight:t;if(axis.position==\"top\")yoff=-yoff;}else {y=axis.p2c(v);xoff=t==\"full\"?-plotWidth:t;if(axis.position==\"left\")xoff=-xoff;}if(ctx.lineWidth==1){if(axis.direction==\"x\")x=Math.floor(x)+0.5;else y=Math.floor(y)+0.5;}ctx.moveTo(x,y);ctx.lineTo(x+xoff,y+yoff);}ctx.stroke();} // draw border\n\tif(bw){ // If either borderWidth or borderColor is an object, then draw the border\n\t// line by line instead of as one rectangle\n\tbc=options.grid.borderColor;if((typeof bw===\"undefined\"?\"undefined\":_typeof(bw))==\"object\"||(typeof bc===\"undefined\"?\"undefined\":_typeof(bc))==\"object\"){if((typeof bw===\"undefined\"?\"undefined\":_typeof(bw))!==\"object\"){bw={top:bw,right:bw,bottom:bw,left:bw};}if((typeof bc===\"undefined\"?\"undefined\":_typeof(bc))!==\"object\"){bc={top:bc,right:bc,bottom:bc,left:bc};}if(bw.top>0){ctx.strokeStyle=bc.top;ctx.lineWidth=bw.top;ctx.beginPath();ctx.moveTo(0-bw.left,0-bw.top/2);ctx.lineTo(plotWidth,0-bw.top/2);ctx.stroke();}if(bw.right>0){ctx.strokeStyle=bc.right;ctx.lineWidth=bw.right;ctx.beginPath();ctx.moveTo(plotWidth+bw.right/2,0-bw.top);ctx.lineTo(plotWidth+bw.right/2,plotHeight);ctx.stroke();}if(bw.bottom>0){ctx.strokeStyle=bc.bottom;ctx.lineWidth=bw.bottom;ctx.beginPath();ctx.moveTo(plotWidth+bw.right,plotHeight+bw.bottom/2);ctx.lineTo(0,plotHeight+bw.bottom/2);ctx.stroke();}if(bw.left>0){ctx.strokeStyle=bc.left;ctx.lineWidth=bw.left;ctx.beginPath();ctx.moveTo(0-bw.left/2,plotHeight+bw.bottom);ctx.lineTo(0-bw.left/2,0);ctx.stroke();}}else {ctx.lineWidth=bw;ctx.strokeStyle=options.grid.borderColor;ctx.strokeRect(-bw/2,-bw/2,plotWidth+bw,plotHeight+bw);}}ctx.restore();}function drawAxisLabels(){$.each(allAxes(),function(_,axis){var box=axis.box,legacyStyles=axis.direction+\"Axis \"+axis.direction+axis.n+\"Axis\",layer=\"flot-\"+axis.direction+\"-axis flot-\"+axis.direction+axis.n+\"-axis \"+legacyStyles,font=axis.options.font||\"flot-tick-label tickLabel\",tick,x,y,halign,valign; // Remove text before checking for axis.show and ticks.length;\n\t// otherwise plugins, like flot-tickrotor, that draw their own\n\t// tick labels will end up with both theirs and the defaults.\n\tsurface.removeText(layer);if(!axis.show||axis.ticks.length==0)return;for(var i=0;i<axis.ticks.length;++i){tick=axis.ticks[i];if(!tick.label||tick.v<axis.min||tick.v>axis.max)continue;if(axis.direction==\"x\"){halign=\"center\";x=plotOffset.left+axis.p2c(tick.v);if(axis.position==\"bottom\"){y=box.top+box.padding;}else {y=box.top+box.height-box.padding;valign=\"bottom\";}}else {valign=\"middle\";y=plotOffset.top+axis.p2c(tick.v);if(axis.position==\"left\"){x=box.left+box.width-box.padding;halign=\"right\";}else {x=box.left+box.padding;}}surface.addText(layer,x,y,tick.label,font,null,null,halign,valign);}});}function drawSeries(series){if(series.lines.show)drawSeriesLines(series);if(series.bars.show)drawSeriesBars(series);if(series.points.show)drawSeriesPoints(series);}function drawSeriesLines(series){function plotLine(datapoints,xoffset,yoffset,axisx,axisy){var points=datapoints.points,ps=datapoints.pointsize,prevx=null,prevy=null;ctx.beginPath();for(var i=ps;i<points.length;i+=ps){var x1=points[i-ps],y1=points[i-ps+1],x2=points[i],y2=points[i+1];if(x1==null||x2==null)continue; // clip with ymin\n\tif(y1<=y2&&y1<axisy.min){if(y2<axisy.min)continue; // line segment is outside\n\t// compute new intersection point\n\tx1=(axisy.min-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.min;}else if(y2<=y1&&y2<axisy.min){if(y1<axisy.min)continue;x2=(axisy.min-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.min;} // clip with ymax\n\tif(y1>=y2&&y1>axisy.max){if(y2>axisy.max)continue;x1=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.max;}else if(y2>=y1&&y2>axisy.max){if(y1>axisy.max)continue;x2=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.max;} // clip with xmin\n\tif(x1<=x2&&x1<axisx.min){if(x2<axisx.min)continue;y1=(axisx.min-x1)/(x2-x1)*(y2-y1)+y1;x1=axisx.min;}else if(x2<=x1&&x2<axisx.min){if(x1<axisx.min)continue;y2=(axisx.min-x1)/(x2-x1)*(y2-y1)+y1;x2=axisx.min;} // clip with xmax\n\tif(x1>=x2&&x1>axisx.max){if(x2>axisx.max)continue;y1=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x1=axisx.max;}else if(x2>=x1&&x2>axisx.max){if(x1>axisx.max)continue;y2=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x2=axisx.max;}if(x1!=prevx||y1!=prevy)ctx.moveTo(axisx.p2c(x1)+xoffset,axisy.p2c(y1)+yoffset);prevx=x2;prevy=y2;ctx.lineTo(axisx.p2c(x2)+xoffset,axisy.p2c(y2)+yoffset);}ctx.stroke();}function plotLineArea(datapoints,axisx,axisy){var points=datapoints.points,ps=datapoints.pointsize,bottom=Math.min(Math.max(0,axisy.min),axisy.max),i=0,top,areaOpen=false,ypos=1,segmentStart=0,segmentEnd=0; // we process each segment in two turns, first forward\n\t// direction to sketch out top, then once we hit the\n\t// end we go backwards to sketch the bottom\n\twhile(true){if(ps>0&&i>points.length+ps)break;i+=ps; // ps is negative if going backwards\n\tvar x1=points[i-ps],y1=points[i-ps+ypos],x2=points[i],y2=points[i+ypos];if(areaOpen){if(ps>0&&x1!=null&&x2==null){ // at turning point\n\tsegmentEnd=i;ps=-ps;ypos=2;continue;}if(ps<0&&i==segmentStart+ps){ // done with the reverse sweep\n\tctx.fill();areaOpen=false;ps=-ps;ypos=1;i=segmentStart=segmentEnd+ps;continue;}}if(x1==null||x2==null)continue; // clip x values\n\t// clip with xmin\n\tif(x1<=x2&&x1<axisx.min){if(x2<axisx.min)continue;y1=(axisx.min-x1)/(x2-x1)*(y2-y1)+y1;x1=axisx.min;}else if(x2<=x1&&x2<axisx.min){if(x1<axisx.min)continue;y2=(axisx.min-x1)/(x2-x1)*(y2-y1)+y1;x2=axisx.min;} // clip with xmax\n\tif(x1>=x2&&x1>axisx.max){if(x2>axisx.max)continue;y1=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x1=axisx.max;}else if(x2>=x1&&x2>axisx.max){if(x1>axisx.max)continue;y2=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x2=axisx.max;}if(!areaOpen){ // open area\n\tctx.beginPath();ctx.moveTo(axisx.p2c(x1),axisy.p2c(bottom));areaOpen=true;} // now first check the case where both is outside\n\tif(y1>=axisy.max&&y2>=axisy.max){ctx.lineTo(axisx.p2c(x1),axisy.p2c(axisy.max));ctx.lineTo(axisx.p2c(x2),axisy.p2c(axisy.max));continue;}else if(y1<=axisy.min&&y2<=axisy.min){ctx.lineTo(axisx.p2c(x1),axisy.p2c(axisy.min));ctx.lineTo(axisx.p2c(x2),axisy.p2c(axisy.min));continue;} // else it's a bit more complicated, there might\n\t// be a flat maxed out rectangle first, then a\n\t// triangular cutout or reverse; to find these\n\t// keep track of the current x values\n\tvar x1old=x1,x2old=x2; // clip the y values, without shortcutting, we\n\t// go through all cases in turn\n\t// clip with ymin\n\tif(y1<=y2&&y1<axisy.min&&y2>=axisy.min){x1=(axisy.min-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.min;}else if(y2<=y1&&y2<axisy.min&&y1>=axisy.min){x2=(axisy.min-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.min;} // clip with ymax\n\tif(y1>=y2&&y1>axisy.max&&y2<=axisy.max){x1=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.max;}else if(y2>=y1&&y2>axisy.max&&y1<=axisy.max){x2=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.max;} // if the x value was changed we got a rectangle\n\t// to fill\n\tif(x1!=x1old){ctx.lineTo(axisx.p2c(x1old),axisy.p2c(y1)); // it goes to (x1, y1), but we fill that below\n\t} // fill triangular section, this sometimes result\n\t// in redundant points if (x1, y1) hasn't changed\n\t// from previous line to, but we just ignore that\n\tctx.lineTo(axisx.p2c(x1),axisy.p2c(y1));ctx.lineTo(axisx.p2c(x2),axisy.p2c(y2)); // fill the other rectangle if it's there\n\tif(x2!=x2old){ctx.lineTo(axisx.p2c(x2),axisy.p2c(y2));ctx.lineTo(axisx.p2c(x2old),axisy.p2c(y2));}}}ctx.save();ctx.translate(plotOffset.left,plotOffset.top);ctx.lineJoin=\"round\";var lw=series.lines.lineWidth,sw=series.shadowSize; // FIXME: consider another form of shadow when filling is turned on\n\tif(lw>0&&sw>0){ // draw shadow as a thick and thin line with transparency\n\tctx.lineWidth=sw;ctx.strokeStyle=\"rgba(0,0,0,0.1)\"; // position shadow at angle from the mid of line\n\tvar angle=Math.PI/18;plotLine(series.datapoints,Math.sin(angle)*(lw/2+sw/2),Math.cos(angle)*(lw/2+sw/2),series.xaxis,series.yaxis);ctx.lineWidth=sw/2;plotLine(series.datapoints,Math.sin(angle)*(lw/2+sw/4),Math.cos(angle)*(lw/2+sw/4),series.xaxis,series.yaxis);}ctx.lineWidth=lw;ctx.strokeStyle=series.color;var fillStyle=getFillStyle(series.lines,series.color,0,plotHeight);if(fillStyle){ctx.fillStyle=fillStyle;plotLineArea(series.datapoints,series.xaxis,series.yaxis);}if(lw>0)plotLine(series.datapoints,0,0,series.xaxis,series.yaxis);ctx.restore();}function drawSeriesPoints(series){function plotPoints(datapoints,radius,fillStyle,offset,shadow,axisx,axisy,symbol){var points=datapoints.points,ps=datapoints.pointsize;for(var i=0;i<points.length;i+=ps){var x=points[i],y=points[i+1];if(x==null||x<axisx.min||x>axisx.max||y<axisy.min||y>axisy.max)continue;ctx.beginPath();x=axisx.p2c(x);y=axisy.p2c(y)+offset;if(symbol==\"circle\")ctx.arc(x,y,radius,0,shadow?Math.PI:Math.PI*2,false);else symbol(ctx,x,y,radius,shadow);ctx.closePath();if(fillStyle){ctx.fillStyle=fillStyle;ctx.fill();}ctx.stroke();}}ctx.save();ctx.translate(plotOffset.left,plotOffset.top);var lw=series.points.lineWidth,sw=series.shadowSize,radius=series.points.radius,symbol=series.points.symbol; // If the user sets the line width to 0, we change it to a very \n\t// small value. A line width of 0 seems to force the default of 1.\n\t// Doing the conditional here allows the shadow setting to still be \n\t// optional even with a lineWidth of 0.\n\tif(lw==0)lw=0.0001;if(lw>0&&sw>0){ // draw shadow in two steps\n\tvar w=sw/2;ctx.lineWidth=w;ctx.strokeStyle=\"rgba(0,0,0,0.1)\";plotPoints(series.datapoints,radius,null,w+w/2,true,series.xaxis,series.yaxis,symbol);ctx.strokeStyle=\"rgba(0,0,0,0.2)\";plotPoints(series.datapoints,radius,null,w/2,true,series.xaxis,series.yaxis,symbol);}ctx.lineWidth=lw;ctx.strokeStyle=series.color;plotPoints(series.datapoints,radius,getFillStyle(series.points,series.color),0,false,series.xaxis,series.yaxis,symbol);ctx.restore();}function drawBar(x,y,b,barLeft,barRight,fillStyleCallback,axisx,axisy,c,horizontal,lineWidth){var left,right,bottom,top,drawLeft,drawRight,drawTop,drawBottom,tmp; // in horizontal mode, we start the bar from the left\n\t// instead of from the bottom so it appears to be\n\t// horizontal rather than vertical\n\tif(horizontal){drawBottom=drawRight=drawTop=true;drawLeft=false;left=b;right=x;top=y+barLeft;bottom=y+barRight; // account for negative bars\n\tif(right<left){tmp=right;right=left;left=tmp;drawLeft=true;drawRight=false;}}else {drawLeft=drawRight=drawTop=true;drawBottom=false;left=x+barLeft;right=x+barRight;bottom=b;top=y; // account for negative bars\n\tif(top<bottom){tmp=top;top=bottom;bottom=tmp;drawBottom=true;drawTop=false;}} // clip\n\tif(right<axisx.min||left>axisx.max||top<axisy.min||bottom>axisy.max)return;if(left<axisx.min){left=axisx.min;drawLeft=false;}if(right>axisx.max){right=axisx.max;drawRight=false;}if(bottom<axisy.min){bottom=axisy.min;drawBottom=false;}if(top>axisy.max){top=axisy.max;drawTop=false;}left=axisx.p2c(left);bottom=axisy.p2c(bottom);right=axisx.p2c(right);top=axisy.p2c(top); // fill the bar\n\tif(fillStyleCallback){c.fillStyle=fillStyleCallback(bottom,top);c.fillRect(left,top,right-left,bottom-top);} // draw outline\n\tif(lineWidth>0&&(drawLeft||drawRight||drawTop||drawBottom)){c.beginPath(); // FIXME: inline moveTo is buggy with excanvas\n\tc.moveTo(left,bottom);if(drawLeft)c.lineTo(left,top);else c.moveTo(left,top);if(drawTop)c.lineTo(right,top);else c.moveTo(right,top);if(drawRight)c.lineTo(right,bottom);else c.moveTo(right,bottom);if(drawBottom)c.lineTo(left,bottom);else c.moveTo(left,bottom);c.stroke();}}function drawSeriesBars(series){function plotBars(datapoints,barLeft,barRight,fillStyleCallback,axisx,axisy){var points=datapoints.points,ps=datapoints.pointsize;for(var i=0;i<points.length;i+=ps){if(points[i]==null)continue;drawBar(points[i],points[i+1],points[i+2],barLeft,barRight,fillStyleCallback,axisx,axisy,ctx,series.bars.horizontal,series.bars.lineWidth);}}ctx.save();ctx.translate(plotOffset.left,plotOffset.top); // FIXME: figure out a way to add shadows (for instance along the right edge)\n\tctx.lineWidth=series.bars.lineWidth;ctx.strokeStyle=series.color;var barLeft;switch(series.bars.align){case \"left\":barLeft=0;break;case \"right\":barLeft=-series.bars.barWidth;break;default:barLeft=-series.bars.barWidth/2;}var fillStyleCallback=series.bars.fill?function(bottom,top){return getFillStyle(series.bars,series.color,bottom,top);}:null;plotBars(series.datapoints,barLeft,barLeft+series.bars.barWidth,fillStyleCallback,series.xaxis,series.yaxis);ctx.restore();}function getFillStyle(filloptions,seriesColor,bottom,top){var fill=filloptions.fill;if(!fill)return null;if(filloptions.fillColor)return getColorOrGradient(filloptions.fillColor,bottom,top,seriesColor);var c=$.color.parse(seriesColor);c.a=typeof fill==\"number\"?fill:0.4;c.normalize();return c.toString();}function insertLegend(){if(options.legend.container!=null){$(options.legend.container).html(\"\");}else {placeholder.find(\".legend\").remove();}if(!options.legend.show){return;}var fragments=[],entries=[],rowStarted=false,lf=options.legend.labelFormatter,s,label; // Build a list of legend entries, with each having a label and a color\n\tfor(var i=0;i<series.length;++i){s=series[i];if(s.label){label=lf?lf(s.label,s):s.label;if(label){entries.push({label:label,color:s.color});}}} // Sort the legend using either the default or a custom comparator\n\tif(options.legend.sorted){if($.isFunction(options.legend.sorted)){entries.sort(options.legend.sorted);}else if(options.legend.sorted==\"reverse\"){entries.reverse();}else {var ascending=options.legend.sorted!=\"descending\";entries.sort(function(a,b){return a.label==b.label?0:a.label<b.label!=ascending?1:-1 // Logical XOR\n\t;});}} // Generate markup for the list of entries, in their final order\n\tfor(var i=0;i<entries.length;++i){var entry=entries[i];if(i%options.legend.noColumns==0){if(rowStarted)fragments.push('</tr>');fragments.push('<tr>');rowStarted=true;}fragments.push('<td class=\"legendColorBox\"><div style=\"border:1px solid '+options.legend.labelBoxBorderColor+';padding:1px\"><div style=\"width:4px;height:0;border:5px solid '+entry.color+';overflow:hidden\"></div></div></td>'+'<td class=\"legendLabel\">'+entry.label+'</td>');}if(rowStarted)fragments.push('</tr>');if(fragments.length==0)return;var table='<table style=\"font-size:smaller;color:'+options.grid.color+'\">'+fragments.join(\"\")+'</table>';if(options.legend.container!=null)$(options.legend.container).html(table);else {var pos=\"\",p=options.legend.position,m=options.legend.margin;if(m[0]==null)m=[m,m];if(p.charAt(0)==\"n\")pos+='top:'+(m[1]+plotOffset.top)+'px;';else if(p.charAt(0)==\"s\")pos+='bottom:'+(m[1]+plotOffset.bottom)+'px;';if(p.charAt(1)==\"e\")pos+='right:'+(m[0]+plotOffset.right)+'px;';else if(p.charAt(1)==\"w\")pos+='left:'+(m[0]+plotOffset.left)+'px;';var legend=$('<div class=\"legend\">'+table.replace('style=\"','style=\"position:absolute;'+pos+';')+'</div>').appendTo(placeholder);if(options.legend.backgroundOpacity!=0.0){ // put in the transparent background\n\t// separately to avoid blended labels and\n\t// label boxes\n\tvar c=options.legend.backgroundColor;if(c==null){c=options.grid.backgroundColor;if(c&&typeof c==\"string\")c=$.color.parse(c);else c=$.color.extract(legend,'background-color');c.a=1;c=c.toString();}var div=legend.children();$('<div style=\"position:absolute;width:'+div.width()+'px;height:'+div.height()+'px;'+pos+'background-color:'+c+';\"> </div>').prependTo(legend).css('opacity',options.legend.backgroundOpacity);}}} // interactive features\n\tvar highlights=[],redrawTimeout=null; // returns the data item the mouse is over, or null if none is found\n\tfunction findNearbyItem(mouseX,mouseY,seriesFilter){var maxDistance=options.grid.mouseActiveRadius,smallestDistance=maxDistance*maxDistance+1,item=null,foundPoint=false,i,j,ps;for(i=series.length-1;i>=0;--i){if(!seriesFilter(series[i]))continue;var s=series[i],axisx=s.xaxis,axisy=s.yaxis,points=s.datapoints.points,mx=axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n\tmy=axisy.c2p(mouseY),maxx=maxDistance/axisx.scale,maxy=maxDistance/axisy.scale;ps=s.datapoints.pointsize; // with inverse transforms, we can't use the maxx/maxy\n\t// optimization, sadly\n\tif(axisx.options.inverseTransform)maxx=Number.MAX_VALUE;if(axisy.options.inverseTransform)maxy=Number.MAX_VALUE;if(s.lines.show||s.points.show){for(j=0;j<points.length;j+=ps){var x=points[j],y=points[j+1];if(x==null)continue; // For points and lines, the cursor must be within a\n\t// certain distance to the data point\n\tif(x-mx>maxx||x-mx<-maxx||y-my>maxy||y-my<-maxy)continue; // We have to calculate distances in pixels, not in\n\t// data units, because the scales of the axes may be different\n\tvar dx=Math.abs(axisx.p2c(x)-mouseX),dy=Math.abs(axisy.p2c(y)-mouseY),dist=dx*dx+dy*dy; // we save the sqrt\n\t// use <= to ensure last point takes precedence\n\t// (last generally means on top of)\n\tif(dist<smallestDistance){smallestDistance=dist;item=[i,j/ps];}}}if(s.bars.show&&!item){ // no other point can be nearby\n\tvar barLeft,barRight;switch(s.bars.align){case \"left\":barLeft=0;break;case \"right\":barLeft=-s.bars.barWidth;break;default:barLeft=-s.bars.barWidth/2;}barRight=barLeft+s.bars.barWidth;for(j=0;j<points.length;j+=ps){var x=points[j],y=points[j+1],b=points[j+2];if(x==null)continue; // for a bar graph, the cursor must be inside the bar\n\tif(series[i].bars.horizontal?mx<=Math.max(b,x)&&mx>=Math.min(b,x)&&my>=y+barLeft&&my<=y+barRight:mx>=x+barLeft&&mx<=x+barRight&&my>=Math.min(b,y)&&my<=Math.max(b,y))item=[i,j/ps];}}}if(item){i=item[0];j=item[1];ps=series[i].datapoints.pointsize;return {datapoint:series[i].datapoints.points.slice(j*ps,(j+1)*ps),dataIndex:j,series:series[i],seriesIndex:i};}return null;}function onMouseMove(e){if(options.grid.hoverable)triggerClickHoverEvent(\"plothover\",e,function(s){return s[\"hoverable\"]!=false;});}function onMouseLeave(e){if(options.grid.hoverable)triggerClickHoverEvent(\"plothover\",e,function(s){return false;});}function onClick(e){triggerClickHoverEvent(\"plotclick\",e,function(s){return s[\"clickable\"]!=false;});} // trigger click or hover event (they send the same parameters\n\t// so we share their code)\n\tfunction triggerClickHoverEvent(eventname,event,seriesFilter){var offset=eventHolder.offset(),canvasX=event.pageX-offset.left-plotOffset.left,canvasY=event.pageY-offset.top-plotOffset.top,pos=canvasToAxisCoords({left:canvasX,top:canvasY});pos.pageX=event.pageX;pos.pageY=event.pageY;var item=findNearbyItem(canvasX,canvasY,seriesFilter);if(item){ // fill in mouse pos for any listeners out there\n\titem.pageX=parseInt(item.series.xaxis.p2c(item.datapoint[0])+offset.left+plotOffset.left,10);item.pageY=parseInt(item.series.yaxis.p2c(item.datapoint[1])+offset.top+plotOffset.top,10);}if(options.grid.autoHighlight){ // clear auto-highlights\n\tfor(var i=0;i<highlights.length;++i){var h=highlights[i];if(h.auto==eventname&&!(item&&h.series==item.series&&h.point[0]==item.datapoint[0]&&h.point[1]==item.datapoint[1]))unhighlight(h.series,h.point);}if(item)highlight(item.series,item.datapoint,eventname);}placeholder.trigger(eventname,[pos,item]);}function triggerRedrawOverlay(){var t=options.interaction.redrawOverlayInterval;if(t==-1){ // skip event queue\n\tdrawOverlay();return;}if(!redrawTimeout)redrawTimeout=setTimeout(drawOverlay,t);}function drawOverlay(){redrawTimeout=null; // draw highlights\n\toctx.save();overlay.clear();octx.translate(plotOffset.left,plotOffset.top);var i,hi;for(i=0;i<highlights.length;++i){hi=highlights[i];if(hi.series.bars.show)drawBarHighlight(hi.series,hi.point);else drawPointHighlight(hi.series,hi.point);}octx.restore();executeHooks(hooks.drawOverlay,[octx]);}function highlight(s,point,auto){if(typeof s==\"number\")s=series[s];if(typeof point==\"number\"){var ps=s.datapoints.pointsize;point=s.datapoints.points.slice(ps*point,ps*(point+1));}var i=indexOfHighlight(s,point);if(i==-1){highlights.push({series:s,point:point,auto:auto});triggerRedrawOverlay();}else if(!auto)highlights[i].auto=false;}function unhighlight(s,point){if(s==null&&point==null){highlights=[];triggerRedrawOverlay();return;}if(typeof s==\"number\")s=series[s];if(typeof point==\"number\"){var ps=s.datapoints.pointsize;point=s.datapoints.points.slice(ps*point,ps*(point+1));}var i=indexOfHighlight(s,point);if(i!=-1){highlights.splice(i,1);triggerRedrawOverlay();}}function indexOfHighlight(s,p){for(var i=0;i<highlights.length;++i){var h=highlights[i];if(h.series==s&&h.point[0]==p[0]&&h.point[1]==p[1])return i;}return -1;}function drawPointHighlight(series,point){var x=point[0],y=point[1],axisx=series.xaxis,axisy=series.yaxis,highlightColor=typeof series.highlightColor===\"string\"?series.highlightColor:$.color.parse(series.color).scale('a',0.5).toString();if(x<axisx.min||x>axisx.max||y<axisy.min||y>axisy.max)return;var pointRadius=series.points.radius+series.points.lineWidth/2;octx.lineWidth=pointRadius;octx.strokeStyle=highlightColor;var radius=1.5*pointRadius;x=axisx.p2c(x);y=axisy.p2c(y);octx.beginPath();if(series.points.symbol==\"circle\")octx.arc(x,y,radius,0,2*Math.PI,false);else series.points.symbol(octx,x,y,radius,false);octx.closePath();octx.stroke();}function drawBarHighlight(series,point){var highlightColor=typeof series.highlightColor===\"string\"?series.highlightColor:$.color.parse(series.color).scale('a',0.5).toString(),fillStyle=highlightColor,barLeft;switch(series.bars.align){case \"left\":barLeft=0;break;case \"right\":barLeft=-series.bars.barWidth;break;default:barLeft=-series.bars.barWidth/2;}octx.lineWidth=series.bars.lineWidth;octx.strokeStyle=highlightColor;drawBar(point[0],point[1],point[2]||0,barLeft,barLeft+series.bars.barWidth,function(){return fillStyle;},series.xaxis,series.yaxis,octx,series.bars.horizontal,series.bars.lineWidth);}function getColorOrGradient(spec,bottom,top,defaultColor){if(typeof spec==\"string\")return spec;else { // assume this is a gradient spec; IE currently only\n\t// supports a simple vertical gradient properly, so that's\n\t// what we support too\n\tvar gradient=ctx.createLinearGradient(0,top,0,bottom);for(var i=0,l=spec.colors.length;i<l;++i){var c=spec.colors[i];if(typeof c!=\"string\"){var co=$.color.parse(defaultColor);if(c.brightness!=null)co=co.scale('rgb',c.brightness);if(c.opacity!=null)co.a*=c.opacity;c=co.toString();}gradient.addColorStop(i/(l-1),c);}return gradient;}}} // Add the plot function to the top level of the jQuery object", "title": "" }, { "docid": "7eb56618597ff1d9876eff457051c84c", "score": "0.53027976", "text": "function createAxes(g, xAxis, yAxis, height) {\n g.append(\"g\")\n .classed(\"x\", true)\n .classed(\"axis\", true)\n .attr(\"transform\", \"translate(0, \" + height + \")\")\n .call(xAxis);\n g.append(\"g\")\n .classed(\"y\", true)\n .classed(\"axis\", true)\n .call(yAxis)\n .append(\"text\")\n .text(\"Number of trips\")\n .attr(\"text-anchor\", \"middle\")\n .attr(\"dominant-baseline\", \"ideographic\")\n .attr(\"font-size\", 14)\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n}", "title": "" }, { "docid": "73d17f5ec531879393fd49f998475b90", "score": "0.5299494", "text": "initAxes() {\n // length of the axes\n const length = 100;\n\n const lineMaterial = new THREE.LineDashedMaterial({\n ...this.settings.lineMaterial,\n color: this.settings.colors.amber,\n });\n const points = [\n new THREE.Vector3(-length / 2, 0, 0),\n new THREE.Vector3(length / 2, 0, 0),\n new THREE.Vector3(0, -length / 2, 0),\n new THREE.Vector3(0, length / 2, 0),\n new THREE.Vector3(0, 0, 0),\n new THREE.Vector3(0, 0, length / 2),\n ];\n const geometry = new THREE.BufferGeometry().setFromPoints(points);\n const line = new THREE.LineSegments(geometry, lineMaterial);\n line.computeLineDistances();\n // group axes vertices in the viewer together and treat as a 3D object\n this.axesGroup = new THREE.Object3D();\n\n const gridHelper = new THREE.GridHelper(\n 100,\n 100,\n this.settings.colors.amber,\n this.settings.colors.gray,\n );\n gridHelper.geometry.rotateX(Math.PI / 2);\n gridHelper.position.x = 0;\n gridHelper.position.y = 0;\n\n this.axesGroup.add(line, gridHelper);\n this.scene.add(this.axesGroup);\n }", "title": "" }, { "docid": "9d6456d45481a2cbdb92f8f530464bd0", "score": "0.5298772", "text": "function createAxes() {\n\tconst depth = -1;\n\tconst origin = [0, 0, depth];\n\tconst y_axes = [0, 1, depth];\n\tconst x_axes = [1, 0, depth];\n\tdrawLine(origin, x_axes, 0xFF0000);\n\tdrawLine(origin, y_axes, 0x00FF00);\n}", "title": "" }, { "docid": "2828dddef739afdc3291f3fc966a2e17", "score": "0.52969533", "text": "function plot_system(plotly_div){\n\tvar trace1 = {\n\t x: [1, 2, 3, 4],\n\t y: [5, 10, 2, 8],\n\t marker: {\n\t\t color: \"#C8A2C8\",\n\t\t line: {\n\t\t\t width: 2.5\n\t\t }\n\t }\n\t};\n\n\tvar data = [ trace1 ];\n\n\tvar layout = { \n\t title: \"Dynamical System Coupled Equations\",\n\t height: 375,\n\t font: {size: 14}\n\t};\n\n\tPlotly.newPlot(plotly_div, data, layout, {responsive: true}); \n}", "title": "" }, { "docid": "53eb0fc9f904e60fc4a3d0afc3cd5b5e", "score": "0.52955014", "text": "constructor(settings={}) {\n /*\n * Args:\n * settings:\n * - title\n * - subtitle\n * - grid: (list of 2 integers) [nRows, nCols] (default=[1,1])\n * - figMargins\n * - gridCellGap\n *\n * OPTIONAL SETTINGS\n * - df\n */\n // GRID SETTINGS\n var gridDims = get(settings, \"grid\", [1,1]);\n var nrows = gridDims[0];\n var ncols = gridDims[1];\n\n var gridCellGap = get(settings, \"gridCellGap\", [1,5]);\n var xGridCellGap = gridCellGap[0];\n var yGridCellGap = gridCellGap[1];\n // var yGridCellGap = 1;\n var figMargins = get(settings, \"figMargins\", {});\n var FIG_LEFT_MARGIN = get(figMargins, \"left\", 5);\n var FIG_RIGHT_MARGIN = get(figMargins, \"right\", 2);\n var FIG_TOP_MARGIN = get(figMargins, \"top\", 12);\n var FIG_BOTTOM_MARGIN = get(figMargins, \"bottom\", 7);\n\n var CELL_WIDTH = (100 - FIG_LEFT_MARGIN - FIG_RIGHT_MARGIN - xGridCellGap) / ncols - xGridCellGap;\n var CELL_HEIGHT = (100 - FIG_TOP_MARGIN - FIG_BOTTOM_MARGIN - yGridCellGap) / nrows - yGridCellGap;\n\n this.syncedAxisRanges = {x: [], y: []};\n\n this.options = {\n animation: false,\n title: {\n text: null,\n subtext: null,\n left: '0%',\n align: 'right'\n },\n legend: {\n // data: ['a', 'b'],\n left: \"right\",\n top: \"center\",\n // bottom: 20,\n orient: \"vertical\",\n // align: \"right\",\n // padding: 5\n // itemGap: 0, // Gap between each legend item\n // itemHeight: 5, // height of legend item icon\n // itemWidth: 10, // Width of legend item icon\n // formatter: function(name){return name.toUpperCase()} // format legend item text\n },\n\n tooltip: {\n axisPointer: {type: \"cross\", label:{}},\n },\n toolbox: {\n right: \"0%\",\n top: \"0%\",\n height: \"auto\",\n feature: {\n dataZoom: {\n // filterMode: \"filter\",\n // yAxisIndex: false, // to prevent zooming along y axis\n },\n brush: {\n type: ['lineX', 'lineY', \"rect\",\"polygon\", \"keep\", 'clear']\n },\n restore: {},\n saveAsImage: {},\n tooltip: {},\n // dataView: {},// to view and edit data\n // magicType: {type: ['line', 'bar', 'stack', 'tiled']}, // for switching between diferent representations\n }\n },\n brush: {\n xAxisIndex: [],\n yAxisIndex: [],\n // brushLink: 'all'; // link up all cells\n // inBrush: {opacity: 1},\n // outOfBrush: {colorAlpha: 0.1},\n },\n dataZoom: [],\n dataset: {},\n grid: [],\n xAxis: [],\n yAxis: [],\n series: [],\n };\n\n // TITLE\n this.setTitle(get(settings, \"title\"), get(settings, \"subtitle\"));\n\n var tooltip = get_or_create(this.options, \"tooltip\", {});\n get_or_create(tooltip, \"trigger\", 'item');\n\n // SET AXES\n this.axes = [];\n var cell_count = 0;\n var grid = this.options.grid;\n for (var irow = 0; irow < nrows; irow++){\n for (var icol = 0; icol < ncols; icol++){\n cell_count++;\n grid.push({\n top: FIG_TOP_MARGIN + irow * (CELL_HEIGHT + yGridCellGap) + '%',\n left: FIG_LEFT_MARGIN + icol * (CELL_WIDTH + xGridCellGap) + '%',\n width: CELL_WIDTH + '%',\n height: CELL_HEIGHT + '%',\n containLabel: false,\n });\n new Axes(this, {gridIndex:cell_count-1});\n };\n };\n\n // SET DATA\n this.bigDataThreshold = 20000; // the amount of data before which it starts to optimize the settings for speed\n if (get(settings, \"df\") != null){\n this.setData(settings.df)\n } else {\n this.df = null;\n this.schema = {};\n // this.options.dataset.source = null;\n };\n\n\n }", "title": "" }, { "docid": "b0c5a486f51893953feaa47ee9db6316", "score": "0.5291448", "text": "function makeAxes(width, height, x, y) {\n\n var xScale = d3.scaleBand()\n .domain(x)\n .range([0, width]);\n\n var yScale = d3.scaleLinear()\n .domain([d3.max(y) + 2, 0])\n .range([30, height]);\n\n var xAxis = d3.axisBottom(xScale)\n .scale(xScale);\n\n var yAxis = d3.axisLeft()\n .scale(yScale);\n\n svgLineGraph.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(50,\" + height + \")\")\n .call(xAxis)\n .selectAll(\"text\")\n .style(\"font-size\", \"8px\")\n .style(\"text-anchor\", \"end\")\n .attr(\"dx\", \"-.8em\")\n .attr(\"dy\", \"-.55em\")\n .attr(\"transform\", \"rotate(-90)\" );\n\n svgLineGraph.append(\"g\")\n .attr(\"class\", \"y axis\")\n .attr('transform', 'translate(50, 0)')\n .call(yAxis);\n\n return {\n xScale: xScale,\n yScale: yScale,\n width: width,\n height: height\n }\n }", "title": "" }, { "docid": "21695fc3bd1f0ffdae2c9b0f11ae5057", "score": "0.52885103", "text": "initSecondAxes() {\n const length = 100;\n const containerDimension = 100;\n\n this.renderer2 = this.getWebGLRenderer({ alpha: true });\n this.renderer2.setClearColor(\"#FFFFFF\", 0);\n this.renderer2.setSize(containerDimension, containerDimension);\n this.container.prepend(this.renderer2.domElement);\n\n const origin = new TV3(0, 0, 0);\n const [x, y, z] = [\n new THREE.ArrowHelper(\n new TV3(1, 0, 0),\n origin,\n length,\n \"#FF0000\",\n length / 3,\n length / 3,\n ),\n new THREE.ArrowHelper(\n new TV3(0, 1, 0),\n origin,\n length,\n \"#00FF00\",\n length / 3,\n length / 3,\n ),\n new THREE.ArrowHelper(\n new TV3(0, 0, 1),\n origin,\n length,\n \"#0000FF\",\n length / 3,\n length / 3,\n ),\n ];\n\n // add axes to second scene to make stationary\n this.scene2 = new THREE.Scene();\n this.camera2 = new THREE.PerspectiveCamera(50, 1, 1, 1000);\n this.camera2.up = this.camera.up;\n // saving axes helpers inside the scene object itself for further re-use in `hide*` method\n this.scene2.x = x;\n this.scene2.y = y;\n this.scene2.z = z;\n }", "title": "" }, { "docid": "ecbdd25bf28bec112b4336585f663874", "score": "0.5287651", "text": "function setupVis(data) {\n\n setupGasifier();\n setupPlot(data);\n displayPeriphery(data);\n\n}", "title": "" }, { "docid": "9fe7ee2f17d4c756af09c99d5c3a33de", "score": "0.5287559", "text": "getAxes() {\n return [];\n }", "title": "" }, { "docid": "dcf41e1cad4c4ebf7898e68c7a8f7a34", "score": "0.5286358", "text": "render () {\n const {\n variableName,\n temporalResolution,\n } = this.props;\n const dataUncertaintyValues = this.dataUncertaintyValues;\n const tickMarkFormat = AnalyticsChart.tickMarkFormatsPerResolution[temporalResolution];\n const plotData = this.getPlotData();\n const plotLayout = {\n // title: `${data.datasetId}`,\n margin: {\n b: 50,\n t: 30,\n r: 30,\n },\n autosize: true,\n showlegend: false,\n hovermode: 'x',\n yaxis: {\n title: variableName,\n // This disables zooming on y-axis.\n fixedrange: true,\n },\n xaxis: {\n title: `Date (${temporalResolution})`,\n // tickformat: tickMarkFormat,\n hoverformat: tickMarkFormat,\n },\n };\n const plotConfig = {\n showLink: false,\n displaylogo: false,\n // Modebar Buttons names at https://github.com/plotly/plotly.js/blob/master/src/components/modebar/buttons.js\n modeBarButtonsToRemove: [\n 'sendDataToCloud',\n ],\n };\n\n return (\n <div className=\"AnalyticsChart\">\n <Plot\n data={plotData}\n layout={plotLayout}\n config={plotConfig}\n style={{\n width: '100%',\n height: '100%',\n }}\n useResizeHandler\n // This seems to only run for the first time the plot is mounted.\n onInitialized={this.onPlotInitialized}\n // For some reason this is not called for the first render after `onInitialized`.\n // onAfterPlot={this.props.onRenderEnd}\n />\n {dataUncertaintyValues && (\n <Toggle\n label=\"Show uncertainty\"\n labelPosition=\"right\"\n toggled={this.state.displayDataUncertaintyValues}\n onToggle={this.onToggleDataUncertainty}\n />\n )}\n </div>\n );\n }", "title": "" } ]
8707fb0a26b090050ee70d890a5987f9
(protected) r = this + a
[ { "docid": "04402f37b9c2266437787911a1845e95", "score": "0.6520421", "text": "function bnpAddTo(a,r) {\n\t var i = 0, c = 0, m = Math.min(a.t,this.t);\n\t while(i < m) {\n\t c += this[i]+a[i];\n\t r[i++] = c&this.DM;\n\t c >>= this.DB;\n\t }\n\t if(a.t < this.t) {\n\t c += a.s;\n\t while(i < this.t) {\n\t c += this[i];\n\t r[i++] = c&this.DM;\n\t c >>= this.DB;\n\t }\n\t c += this.s;\n\t }\n\t else {\n\t c += this.s;\n\t while(i < a.t) {\n\t c += a[i];\n\t r[i++] = c&this.DM;\n\t c >>= this.DB;\n\t }\n\t c += a.s;\n\t }\n\t r.s = (c<0)?-1:0;\n\t if(c > 0) r[i++] = c;\n\t else if(c < -1) r[i++] = this.DV+c;\n\t r.t = i;\n\t r.clamp();\n\t }", "title": "" } ]
[ { "docid": "7a828f4cd93bbd46ddfb4ed4dbe11228", "score": "0.6961447", "text": "function A(){r.apply(this)}", "title": "" }, { "docid": "1eef6495f1caf9beeb1b809ec3da8682", "score": "0.68854123", "text": "add(c) {\n let r = this.r + c.r;\n let i = this.i + c.i;\n this.r = r;\n this.i = i;\n }", "title": "" }, { "docid": "77bf4a3d37963f60c76f62e82341e513", "score": "0.68322563", "text": "function add(a, b) {\n return ( a + b ) + this.c;\n}", "title": "" }, { "docid": "be93dd635cae18e6f1b2ca57a48402a6", "score": "0.67289555", "text": "plus(that) {\n return new Complex(this.r + that.r, this.i + that.i);\n }", "title": "" }, { "docid": "4906ca32dea765f66e9d5eda6130c7c0", "score": "0.66853726", "text": "add(other) {\n this.x += other.x;\n this.y += other.y;\n return this;\n }", "title": "" }, { "docid": "c52403836f98d4067d7b35b54b17ccba", "score": "0.6684243", "text": "add(a, b) {\r\n\t this.data[0] = a.data[0] + b.data[0];\r\n\t this.data[1] = a.data[1] + b.data[1];\r\n\t this.data[2] = a.data[2] + b.data[2];\r\n\t this.data[3] = a.data[3] + b.data[3];\r\n\t this.data[4] = a.data[4] + b.data[4];\r\n\t this.data[5] = a.data[5] + b.data[5];\r\n\t this.data[6] = a.data[6] + b.data[6];\r\n\t this.data[7] = a.data[7] + b.data[7];\r\n\t this.data[8] = a.data[8] + b.data[8];\r\n\t this.data[9] = a.data[9] + b.data[9];\r\n\t }", "title": "" }, { "docid": "d5730db463026e4ea9f1d706177afd73", "score": "0.6619571", "text": "function bnpAddTo(a, r) {\r\n var i = 0, c = 0, m = Math.min(a.t, this.t);\r\n while (i < m) {\r\n c += this[i] + a[i];\r\n r[i++] = c & this.DM;\r\n c >>= this.DB;\r\n }\r\n if (a.t < this.t) {\r\n c += a.s;\r\n while (i < this.t) {\r\n c += this[i];\r\n r[i++] = c & this.DM;\r\n c >>= this.DB;\r\n }\r\n c += this.s;\r\n } else {\r\n c += this.s;\r\n while (i < a.t) {\r\n c += a[i];\r\n r[i++] = c & this.DM;\r\n c >>= this.DB;\r\n }\r\n c += a.s;\r\n }\r\n r.s = (c < 0) ? -1 : 0;\r\n if (c > 0) r[i++] = c;\r\n else if (c < -1) r[i++] = this.DV + c;\r\n r.t = i;\r\n r.clamp();\r\n }", "title": "" }, { "docid": "33e73e1adf8bc58fc353c6850d24ac13", "score": "0.6611024", "text": "function add(i,j){\n a = i, b = j\n return this.a + this.b\n}", "title": "" }, { "docid": "7d710381b8c7ddc87f2aa8f552954235", "score": "0.66056097", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "88c7349d7889d573a6c7102c982183e3", "score": "0.6585539", "text": "function bnpAddTo(a, r) {\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = c < 0 ? -1 : 0;\n if (c > 0) r[i++] = c;\n else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "9334e8750d5ab9b73cdecfa0318c7475", "score": "0.6577724", "text": "function bnpAddTo(a, r) {\n\t var i = 0, c = 0, m = Math.min(a.t, this.t);\n\t while (i < m) {\n\t c += this[i] + a[i];\n\t r[i++] = c & this.DM;\n\t c >>= this.DB;\n\t }\n\t if (a.t < this.t) {\n\t c += a.s;\n\t while (i < this.t) {\n\t c += this[i];\n\t r[i++] = c & this.DM;\n\t c >>= this.DB;\n\t }\n\t c += this.s;\n\t }\n\t else {\n\t c += this.s;\n\t while (i < a.t) {\n\t c += a[i];\n\t r[i++] = c & this.DM;\n\t c >>= this.DB;\n\t }\n\t c += a.s;\n\t }\n\t r.s = (c < 0) ? -1 : 0;\n\t if (c > 0) r[i++] = c;\n\t else if (c < -1) r[i++] = this.DV + c;\n\t r.t = i;\n\t r.clamp();\n\t}", "title": "" }, { "docid": "0e8b9269ddb0884d76ffa54c901c5a3f", "score": "0.6573848", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0e8b9269ddb0884d76ffa54c901c5a3f", "score": "0.6573848", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0e8b9269ddb0884d76ffa54c901c5a3f", "score": "0.6573848", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0e8b9269ddb0884d76ffa54c901c5a3f", "score": "0.6573848", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0e8b9269ddb0884d76ffa54c901c5a3f", "score": "0.6573848", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0e8b9269ddb0884d76ffa54c901c5a3f", "score": "0.6573848", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0e8b9269ddb0884d76ffa54c901c5a3f", "score": "0.6573848", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0e8b9269ddb0884d76ffa54c901c5a3f", "score": "0.6573848", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0e8b9269ddb0884d76ffa54c901c5a3f", "score": "0.6573848", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0e8b9269ddb0884d76ffa54c901c5a3f", "score": "0.6573848", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0e8b9269ddb0884d76ffa54c901c5a3f", "score": "0.6573848", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0e8b9269ddb0884d76ffa54c901c5a3f", "score": "0.6573848", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0e8b9269ddb0884d76ffa54c901c5a3f", "score": "0.6573848", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0e8b9269ddb0884d76ffa54c901c5a3f", "score": "0.6573848", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0e8b9269ddb0884d76ffa54c901c5a3f", "score": "0.6573848", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0e8b9269ddb0884d76ffa54c901c5a3f", "score": "0.6573848", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0e8b9269ddb0884d76ffa54c901c5a3f", "score": "0.6573848", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0e8b9269ddb0884d76ffa54c901c5a3f", "score": "0.6573848", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0e8b9269ddb0884d76ffa54c901c5a3f", "score": "0.6573848", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0e8b9269ddb0884d76ffa54c901c5a3f", "score": "0.6573848", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0e8b9269ddb0884d76ffa54c901c5a3f", "score": "0.6573848", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "23b84ea042ef0938cb77527548a5228b", "score": "0.65645075", "text": "function bnpAddTo(a,r) {\r\n var i = 0, c = 0, m = Math.min(a.t,this.t);\r\n while(i < m) {\r\n c += this[i]+a[i];\r\n r[i++] = c&this.DM;\r\n c >>= this.DB;\r\n }\r\n if(a.t < this.t) {\r\n c += a.s;\r\n while(i < this.t) {\r\n c += this[i];\r\n r[i++] = c&this.DM;\r\n c >>= this.DB;\r\n }\r\n c += this.s;\r\n }\r\n else {\r\n c += this.s;\r\n while(i < a.t) {\r\n c += a[i];\r\n r[i++] = c&this.DM;\r\n c >>= this.DB;\r\n }\r\n c += a.s;\r\n }\r\n r.s = (c<0)?-1:0;\r\n if(c > 0) r[i++] = c;\r\n else if(c < -1) r[i++] = this.DV+c;\r\n r.t = i;\r\n r.clamp();\r\n }", "title": "" }, { "docid": "23b84ea042ef0938cb77527548a5228b", "score": "0.65645075", "text": "function bnpAddTo(a,r) {\r\n var i = 0, c = 0, m = Math.min(a.t,this.t);\r\n while(i < m) {\r\n c += this[i]+a[i];\r\n r[i++] = c&this.DM;\r\n c >>= this.DB;\r\n }\r\n if(a.t < this.t) {\r\n c += a.s;\r\n while(i < this.t) {\r\n c += this[i];\r\n r[i++] = c&this.DM;\r\n c >>= this.DB;\r\n }\r\n c += this.s;\r\n }\r\n else {\r\n c += this.s;\r\n while(i < a.t) {\r\n c += a[i];\r\n r[i++] = c&this.DM;\r\n c >>= this.DB;\r\n }\r\n c += a.s;\r\n }\r\n r.s = (c<0)?-1:0;\r\n if(c > 0) r[i++] = c;\r\n else if(c < -1) r[i++] = this.DV+c;\r\n r.t = i;\r\n r.clamp();\r\n }", "title": "" }, { "docid": "0d0136311aea091dde65eb40e9823d43", "score": "0.65576833", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0d0136311aea091dde65eb40e9823d43", "score": "0.65576833", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0d0136311aea091dde65eb40e9823d43", "score": "0.65576833", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0d0136311aea091dde65eb40e9823d43", "score": "0.65576833", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0d0136311aea091dde65eb40e9823d43", "score": "0.65576833", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0d0136311aea091dde65eb40e9823d43", "score": "0.65576833", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0d0136311aea091dde65eb40e9823d43", "score": "0.65576833", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0d0136311aea091dde65eb40e9823d43", "score": "0.65576833", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0d0136311aea091dde65eb40e9823d43", "score": "0.65576833", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0d0136311aea091dde65eb40e9823d43", "score": "0.65576833", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0d0136311aea091dde65eb40e9823d43", "score": "0.65576833", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "0d0136311aea091dde65eb40e9823d43", "score": "0.65576833", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "e2c36bf850ea83c8fc67f2f58116929c", "score": "0.65523386", "text": "function bnpAddTo(a, r) {\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c < 0) ? -1 : 0;\n if (c > 0) r[i++] = c;\n else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n }", "title": "" }, { "docid": "199e43cd388c5c0fd7068c0fa5ab41dd", "score": "0.6542143", "text": "add(a, b) {\n this.data[0] = a.data[0] + b.data[0];\n this.data[1] = a.data[1] + b.data[1];\n this.data[2] = a.data[2] + b.data[2];\n this.data[3] = a.data[3] + b.data[3];\n this.data[4] = a.data[4] + b.data[4];\n this.data[5] = a.data[5] + b.data[5];\n this.data[6] = a.data[6] + b.data[6];\n this.data[7] = a.data[7] + b.data[7];\n this.data[8] = a.data[8] + b.data[8];\n this.data[9] = a.data[9] + b.data[9];\n }", "title": "" }, { "docid": "ca8c6cc01d004b2ff8f6d98d63f3394f", "score": "0.65046346", "text": "static add(a,b){\n return a+b;\n }", "title": "" }, { "docid": "b0f1583a4aa88070bc203440b34794c4", "score": "0.6435545", "text": "add(a,b){\n\t\treturn a+b;\n }", "title": "" }, { "docid": "ae61972a383275d2a68ab94809953e6e", "score": "0.6430135", "text": "function bnpAddTo(a, r) {\n var i = 0, c = 0, m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c < 0) ? -1 : 0;\n if (c > 0) r[i++] = c;\n else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n}", "title": "" }, { "docid": "8892f65f901db31b76cec003b79b8575", "score": "0.64251256", "text": "static add(a, b) {\r\n return a + b;\r\n }", "title": "" }, { "docid": "d1e2de5e662854a2afad0932e179dfdd", "score": "0.6417403", "text": "function bnpAddTo(a, r) {\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c < 0) ? -1 : 0;\n if (c > 0) r[i++] = c;\n else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n}", "title": "" }, { "docid": "4f244281e1e04a3c38e222cb6fed2f94", "score": "0.64145845", "text": "function bnpAddTo(a, r) {\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = c < 0 ? -1 : 0;\n if (c > 0) r[i++] = c;else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n}", "title": "" }, { "docid": "4f244281e1e04a3c38e222cb6fed2f94", "score": "0.64145845", "text": "function bnpAddTo(a, r) {\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = c < 0 ? -1 : 0;\n if (c > 0) r[i++] = c;else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n}", "title": "" }, { "docid": "4f244281e1e04a3c38e222cb6fed2f94", "score": "0.64145845", "text": "function bnpAddTo(a, r) {\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = c < 0 ? -1 : 0;\n if (c > 0) r[i++] = c;else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n}", "title": "" }, { "docid": "5f4b3645880c475b705a5c196ef18735", "score": "0.64118785", "text": "function bnpAddTo (a, r) {\n var i = 0; var c = 0; var m = Math.min(a.t, this.t)\n while (i < m) {\n c += this[i] + a[i]\n r[i++] = c & this.DM\n c >>= this.DB\n }\n if (a.t < this.t) {\n c += a.s\n while (i < this.t) {\n c += this[i]\n r[i++] = c & this.DM\n c >>= this.DB\n }\n c += this.s\n } else {\n c += this.s\n while (i < a.t) {\n c += a[i]\n r[i++] = c & this.DM\n c >>= this.DB\n }\n c += a.s\n }\n r.s = (c < 0) ? -1 : 0\n if (c > 0) r[i++] = c\n else if (c < -1) r[i++] = this.DV + c\n r.t = i\n r.clamp()\n}", "title": "" }, { "docid": "8cdcb2c89bd7d44b29342793ea860570", "score": "0.6409142", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n}", "title": "" }, { "docid": "99f119dd71838bd82b8eb9525dd6c11e", "score": "0.64042115", "text": "function bnpAddTo(a, r) {\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c < 0) ? -1 : 0;\n if (c > 0) r[i++] = c;\n else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n}", "title": "" }, { "docid": "da2ad1aeb13098769b1351dbace8bb14", "score": "0.640255", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n}", "title": "" }, { "docid": "da2ad1aeb13098769b1351dbace8bb14", "score": "0.640255", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n}", "title": "" }, { "docid": "da2ad1aeb13098769b1351dbace8bb14", "score": "0.640255", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n}", "title": "" }, { "docid": "da2ad1aeb13098769b1351dbace8bb14", "score": "0.640255", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n}", "title": "" }, { "docid": "da2ad1aeb13098769b1351dbace8bb14", "score": "0.640255", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n}", "title": "" }, { "docid": "da2ad1aeb13098769b1351dbace8bb14", "score": "0.640255", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n}", "title": "" }, { "docid": "f2d55aee3507f431abcb3867a6e7b3c1", "score": "0.63998723", "text": "function add(c, d){\n return this.a + this.b + c + d;\n}", "title": "" }, { "docid": "b1000be98e6ae6aca1a6619b33879536", "score": "0.63974077", "text": "static add(a, b) {\n return a + b;\n }", "title": "" }, { "docid": "0ec1d580d81e3639fdc7c9f2d3858f49", "score": "0.63965476", "text": "function foo(something) {\r\n console.log(this.a, something);\r\n return this.a + something;\r\n}", "title": "" }, { "docid": "9976fb7fc0c5d9e0a9cdb286db1e4eb4", "score": "0.6396325", "text": "function bnpAddTo(a, r) {\n var self = this\n\n var i = 0,\n c = 0,\n m = Math.min(a.t, self.t)\n while (i < m) {\n c += self[i] + a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n if (a.t < self.t) {\n c += a.s\n while (i < self.t) {\n c += self[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += self.s\n } else {\n c += self.s\n while (i < a.t) {\n c += a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += a.s\n }\n r.s = (c < 0) ? -1 : 0\n if (c > 0) r[i++] = c\n else if (c < -1) r[i++] = self.DV + c\n r.t = i\n r.clamp()\n}", "title": "" }, { "docid": "9976fb7fc0c5d9e0a9cdb286db1e4eb4", "score": "0.6396325", "text": "function bnpAddTo(a, r) {\n var self = this\n\n var i = 0,\n c = 0,\n m = Math.min(a.t, self.t)\n while (i < m) {\n c += self[i] + a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n if (a.t < self.t) {\n c += a.s\n while (i < self.t) {\n c += self[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += self.s\n } else {\n c += self.s\n while (i < a.t) {\n c += a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += a.s\n }\n r.s = (c < 0) ? -1 : 0\n if (c > 0) r[i++] = c\n else if (c < -1) r[i++] = self.DV + c\n r.t = i\n r.clamp()\n}", "title": "" }, { "docid": "9976fb7fc0c5d9e0a9cdb286db1e4eb4", "score": "0.6396325", "text": "function bnpAddTo(a, r) {\n var self = this\n\n var i = 0,\n c = 0,\n m = Math.min(a.t, self.t)\n while (i < m) {\n c += self[i] + a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n if (a.t < self.t) {\n c += a.s\n while (i < self.t) {\n c += self[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += self.s\n } else {\n c += self.s\n while (i < a.t) {\n c += a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += a.s\n }\n r.s = (c < 0) ? -1 : 0\n if (c > 0) r[i++] = c\n else if (c < -1) r[i++] = self.DV + c\n r.t = i\n r.clamp()\n}", "title": "" }, { "docid": "9976fb7fc0c5d9e0a9cdb286db1e4eb4", "score": "0.6396325", "text": "function bnpAddTo(a, r) {\n var self = this\n\n var i = 0,\n c = 0,\n m = Math.min(a.t, self.t)\n while (i < m) {\n c += self[i] + a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n if (a.t < self.t) {\n c += a.s\n while (i < self.t) {\n c += self[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += self.s\n } else {\n c += self.s\n while (i < a.t) {\n c += a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += a.s\n }\n r.s = (c < 0) ? -1 : 0\n if (c > 0) r[i++] = c\n else if (c < -1) r[i++] = self.DV + c\n r.t = i\n r.clamp()\n}", "title": "" }, { "docid": "9976fb7fc0c5d9e0a9cdb286db1e4eb4", "score": "0.6396325", "text": "function bnpAddTo(a, r) {\n var self = this\n\n var i = 0,\n c = 0,\n m = Math.min(a.t, self.t)\n while (i < m) {\n c += self[i] + a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n if (a.t < self.t) {\n c += a.s\n while (i < self.t) {\n c += self[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += self.s\n } else {\n c += self.s\n while (i < a.t) {\n c += a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += a.s\n }\n r.s = (c < 0) ? -1 : 0\n if (c > 0) r[i++] = c\n else if (c < -1) r[i++] = self.DV + c\n r.t = i\n r.clamp()\n}", "title": "" }, { "docid": "9976fb7fc0c5d9e0a9cdb286db1e4eb4", "score": "0.6396325", "text": "function bnpAddTo(a, r) {\n var self = this\n\n var i = 0,\n c = 0,\n m = Math.min(a.t, self.t)\n while (i < m) {\n c += self[i] + a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n if (a.t < self.t) {\n c += a.s\n while (i < self.t) {\n c += self[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += self.s\n } else {\n c += self.s\n while (i < a.t) {\n c += a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += a.s\n }\n r.s = (c < 0) ? -1 : 0\n if (c > 0) r[i++] = c\n else if (c < -1) r[i++] = self.DV + c\n r.t = i\n r.clamp()\n}", "title": "" }, { "docid": "9976fb7fc0c5d9e0a9cdb286db1e4eb4", "score": "0.6396325", "text": "function bnpAddTo(a, r) {\n var self = this\n\n var i = 0,\n c = 0,\n m = Math.min(a.t, self.t)\n while (i < m) {\n c += self[i] + a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n if (a.t < self.t) {\n c += a.s\n while (i < self.t) {\n c += self[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += self.s\n } else {\n c += self.s\n while (i < a.t) {\n c += a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += a.s\n }\n r.s = (c < 0) ? -1 : 0\n if (c > 0) r[i++] = c\n else if (c < -1) r[i++] = self.DV + c\n r.t = i\n r.clamp()\n}", "title": "" }, { "docid": "9976fb7fc0c5d9e0a9cdb286db1e4eb4", "score": "0.6396325", "text": "function bnpAddTo(a, r) {\n var self = this\n\n var i = 0,\n c = 0,\n m = Math.min(a.t, self.t)\n while (i < m) {\n c += self[i] + a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n if (a.t < self.t) {\n c += a.s\n while (i < self.t) {\n c += self[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += self.s\n } else {\n c += self.s\n while (i < a.t) {\n c += a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += a.s\n }\n r.s = (c < 0) ? -1 : 0\n if (c > 0) r[i++] = c\n else if (c < -1) r[i++] = self.DV + c\n r.t = i\n r.clamp()\n}", "title": "" }, { "docid": "da038e18ff5a7bd5c4d71ea943bfda94", "score": "0.6384337", "text": "incrementBy(a)\n\t{\n\t\tthis.x += a.x;\n\t\tthis.y += a.y;\n\t\tthis.z += a.z;\n\t}", "title": "" }, { "docid": "15caf82941cbc6477ccb9931c967576d", "score": "0.6352394", "text": "function foo(sth) {\n console.log(this.a, sth)\n return this.a + sth\n}", "title": "" }, { "docid": "9f6e840e21411141e13749e5dcd9e302", "score": "0.6347873", "text": "function foo(something) {\n console.log(this.a, something);\n return this.a + something;\n}", "title": "" }, { "docid": "9f6e840e21411141e13749e5dcd9e302", "score": "0.6347873", "text": "function foo(something) {\n console.log(this.a, something);\n return this.a + something;\n}", "title": "" }, { "docid": "441b873249e808712e415ca6c08e04b3", "score": "0.6344109", "text": "function add(a, b) {\n return (a + b);\n }", "title": "" }, { "docid": "8185f7b934f3a68fe656425c6bad4781", "score": "0.63433784", "text": "function add(a, b) {\n return a + b;\n }", "title": "" }, { "docid": "14684ad6f3337d4e2d653e381512de91", "score": "0.63050514", "text": "function bnpAddTo(a,r) {\n var self = this;\n\n var i = 0, c = 0, m = Math.min(a.t,self.t);\n while(i < m) {\n c += self[i]+a[i];\n r[i++] = c&self.DM;\n c >>= self.DB;\n }\n if(a.t < self.t) {\n c += a.s;\n while(i < self.t) {\n c += self[i];\n r[i++] = c&self.DM;\n c >>= self.DB;\n }\n c += self.s;\n }\n else {\n c += self.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&self.DM;\n c >>= self.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = self.DV+c;\n r.t = i;\n r.clamp();\n}", "title": "" }, { "docid": "c07c330e30eda812fe2c12c5afa1e6c9", "score": "0.63007784", "text": "add(a, b){\n return a + b;\n }", "title": "" }, { "docid": "741bb681a6f5a6f3af0ebdde170757b8", "score": "0.63002264", "text": "function add(a, b) {\n \treturn a + b;\n\t}", "title": "" }, { "docid": "c7d44d43daf6a762df09fdc9871fa0a6", "score": "0.6290453", "text": "function add(a, b) {\n console.log(this);\n return a + b;\n}", "title": "" }, { "docid": "67d2747e7b0e15f14b2f08d0d4d71d31", "score": "0.62501687", "text": "function add (a, b) {\n // console.log(this)\n return a + b;\n}", "title": "" }, { "docid": "8074d23c3cbe75863a4cad702c39b4ab", "score": "0.62419915", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this.data[i]+a.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r.data[i++] = c;\n else if(c < -1) r.data[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n}", "title": "" }, { "docid": "8074d23c3cbe75863a4cad702c39b4ab", "score": "0.62419915", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this.data[i]+a.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r.data[i++] = c;\n else if(c < -1) r.data[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n}", "title": "" }, { "docid": "8074d23c3cbe75863a4cad702c39b4ab", "score": "0.62419915", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this.data[i]+a.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r.data[i++] = c;\n else if(c < -1) r.data[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n}", "title": "" }, { "docid": "8074d23c3cbe75863a4cad702c39b4ab", "score": "0.62419915", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this.data[i]+a.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r.data[i++] = c;\n else if(c < -1) r.data[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n}", "title": "" }, { "docid": "8074d23c3cbe75863a4cad702c39b4ab", "score": "0.62419915", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this.data[i]+a.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r.data[i++] = c;\n else if(c < -1) r.data[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n}", "title": "" }, { "docid": "8074d23c3cbe75863a4cad702c39b4ab", "score": "0.62419915", "text": "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this.data[i]+a.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r.data[i++] = c;\n else if(c < -1) r.data[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n}", "title": "" }, { "docid": "c9a7ee739a9913eae8db64828744e360", "score": "0.6237452", "text": "function add(c, d) {\n return this.a + this.b + c + d;\n}", "title": "" }, { "docid": "5a165412c241327da2a9a90bbf818111", "score": "0.6219914", "text": "add(other) {\n\t\tthis.x += other.x;\n\t\tthis.y += other.y;\n\n\t\treturn this;\n\t}", "title": "" }, { "docid": "4a0ca6775b90380e3f5733d242ff1e93", "score": "0.6212113", "text": "add(u) {\n this.x += u.x;\n this.y += u.y;\n return this;\n }", "title": "" }, { "docid": "4e1e4f84af77941295605ac00efda399", "score": "0.6205368", "text": "function add (a,b){\r\n return a + b;\r\n }", "title": "" } ]
b634d0adb4f9b2a41844df13b099a792
7 / We first get an array of arguments except the firstone, because the firstone is the function and we don't need that one, and in this case we're assuming that we're on ES5 so we're not doing the awful "Array.prototype.slice.apply", and then "curry" returns a function and that function will apply the "arguments" to the function. One bit of weirdness that's left over from "arguments" not being a real array is that: if we pass "arguments" as a parameter to "concat", it doesn't recognize it as it's an array and then it'll take all the members of it and concatenate them to the other thing, and it will concatenate them as a single array which in this case is not what we want, so we need to turn it into a real array so the "concat" will do the right thing to it, and we do that by calling its "slice" method, so in ES5, it has the "slice" method, so "slice" returns an array so that'll work, but we shouldn't have had to to that, there's still some things left to get fixed in future editions. Everybody still with me? :D
[ { "docid": "06254c6907fbd175220b822645d397a6", "score": "0.0", "text": "function make_promise() {\n\tvar status = 'unresolved',\n\t\toutcome,\n\t\twaiting = [],\n\t\tdreading = [];\n\t\t\n\tfunction vouch(deed, func) {\n\t\tswitch (status) {\n\t\t\tcase 'unresolved':\n\t\t\t\t(deed === 'fulfilled' ? waiting : dreading).push(func);\n\t\t\t\tbreak;\n\t\t\tcase deed:\n\t\t\t\tfunc(outcome);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tfunction resolve(deed, value) {\n\t\tif (status !== 'unresolved') {\n\t\t\tthrow new Error('The promise has already been resolved: ' + status);\n\t\t}\n\t\tstatus = deed;\n\t\toutcome = value;\n\t\t(deed === 'fulfilled' ? waiting : dreading).forEach(function (func) {\n\t\t\ttry {\n\t\t\t\tfunc(outcome);\n\t\t\t} catch (ignore) {}\n\t\t});\n\t\twaiting = null;\n\t\tdreading = null;\n\t}\n\treturn {\n\t\twhen: function (func) {\n\t\t\tvouch('fulfilled', func);\n\t\t},\n\t\tfail: function (func) {\n\t\t\tvouch('smashed', func);\n\t\t},\n\t\tfulfill: function (value) {\n\t\t\tresolve('fulfilled', value);\n\t\t},\n\t\tsmash: function (string) {\n\t\t\tresolve('smashed', string);\n\t\t},\n\t\tstatus: function () {\n\t\t\treturn status;\n\t\t}\n\t};\n}", "title": "" } ]
[ { "docid": "ea54ab2b63fd694bfc11c37ea2108bc4", "score": "0.684296", "text": "function curry(fn){\n return function(){\n if(fn.length > arguments.length){\n var slice = Array.prototype.slice;\n var args = slice.apply(arguments);\n return function(){\n return fn.apply(\n null,args.concat(slice.apply(arguments)));\n };\n }\n return fn.apply(null,arguments);\n };\n}", "title": "" }, { "docid": "6430909bf7861678f9f12b91ad6ede7e", "score": "0.67225295", "text": "function f(){\r\n var args=[].slice.call(arguments,1,3);\r\n return args;\r\n}", "title": "" }, { "docid": "9370a7f7344424b8672da161cf7f900a", "score": "0.64371747", "text": "function curry(f) {\n\tvar slice = Array.prototype.slice;\n\tvar args = slice.call(arguments, 1);\n\treturn function () {\n\t\treturn f.apply(this, args.concat(slice.call(arguments, 0)));\n\t};\n}", "title": "" }, { "docid": "b97c2faed9c677abe9d9c62c5d205958", "score": "0.6369266", "text": "function curry(fn, ...firstArgs) {\n return function(...secondArgs) {\n return fn.apply(null, firstArgs.concat(secondArgs));\n };\n}", "title": "" }, { "docid": "d7ed857fa8558f91a3b8a13361883417", "score": "0.63560337", "text": "function advancedCurry(argFn) {\n let fnLength = argFn.length;\n const self = this;\n return function curried(...arg1) {\n if (arg1.length >= fnLength) {\n return argFn.apply(self, [...arg1]);\n } else {\n return function (...arg2) {\n return curried.apply(self, [...arg1, ...arg2]);\n };\n }\n };\n}", "title": "" }, { "docid": "6e4e2fab14b7aeb7aeb30b43e3d72134", "score": "0.63383037", "text": "function curry (fn, arr = []) {\n console.log('fn.length',fn.length)\n return fn.length === arr.length ? fn.apply(null, arr) : function (...args) {\n return curry (fn, arr.concat(args))\n }\n}", "title": "" }, { "docid": "db7ab79edbda9d374f4b00acbc5c469d", "score": "0.631989", "text": "function l(a,b,d){var e=Array.prototype.slice.call(arguments,2);return function(){var d=e.slice();d.push.apply(d,arguments);return a.apply(b,d)}}", "title": "" }, { "docid": "5160dd89da1001bba40f460c0054f993", "score": "0.6293064", "text": "function myCurry(fn,initArgs=[]){\n fnArgsLength = fn.length;\n\n const result = function (){\n const newArgs = initArgs.concat(Array.from(arguments));\n if(newArgs.length < fnArgsLength){\n return myCurry.call(this,fn,newArgs);\n }else{\n return fn.apply(this,newArgs);\n }\n }\n return result;\n}", "title": "" }, { "docid": "06a7baac9df15a6133f374bc741b9573", "score": "0.62854224", "text": "function add(){\n console.log(arguments); //{ '0': 10, '1': 20, '2': 30 } \n console.log(arguments[0]) //10\n console.log(arguments[2]) //30\n console.log(arguments.length); //3\n console.log(arguments.callee); //[Function: add]\n //console.log(arguments.caller); //undefined\n //console.log(arguments[@@iterator]);\n\n // convert arguments into array\n console.log(Array.from(arguments)); // [ 10, 20, 30 ]\n console.log(...arguments); // 10 20 30\n console.log([...arguments]); // [ 10, 20, 30 ]\n}", "title": "" }, { "docid": "ddb98b7079f7076856ae7c55ea020535", "score": "0.61896116", "text": "function compose() {\n\tvar funcs = Array.prototype.slice(arguments);\n\n\treturn function() {\n\t\tvar args = arguments;\n\t\tfor(var i = funcs.length - 1; i > -1; i--) {\n\t\t\targs = [funcs[i].apply(this, args)];\n\t\t}\n\t\treturn args[0];\n\t}\n}", "title": "" }, { "docid": "b196ba4f796c330cae0fb56d364823fc", "score": "0.6177843", "text": "function _restParam(func,startIndex){startIndex=startIndex==null?func.length-1:+startIndex;return function(){var length=Math.max(arguments.length-startIndex,0);var rest=Array(length);for(var index=0;index<length;index++){rest[index]=arguments[index+startIndex];}switch(startIndex){case 0:return func.call(this,rest);case 1:return func.call(this,arguments[0],rest);}// Currently unused but handle cases outside of the switch statement:\n// var args = Array(startIndex + 1);\n// for (index = 0; index < startIndex; index++) {\n// args[index] = arguments[index];\n// }\n// args[startIndex] = rest;\n// return func.apply(this, args);\n};}", "title": "" }, { "docid": "d1999c51c1e902c1af5b6ae1bc1821d8", "score": "0.6147434", "text": "concat (...args) {\n\t\treturn NorArray.create( this.a.concat(...args) );\n\t}", "title": "" }, { "docid": "afa6e19fd68c281553a9e2b5a1608ce0", "score": "0.6143696", "text": "function curry(f) {\n var a = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n\n return function () {\n for (var _len = arguments.length, p = Array(_len), _key = 0; _key < _len; _key++) {\n p[_key] = arguments[_key];\n }\n\n return function (o) {\n return o.length >= f.length ? f.apply(undefined, _toConsumableArray(o)) : curry(f, o);\n }([].concat(_toConsumableArray(a), p));\n };\n }", "title": "" }, { "docid": "21bd3d7b0f2c3b0c63f24b2563646e78", "score": "0.6118081", "text": "function sumArgumentsCorrectly(){\n // we are going to use the slice method which makes copies of arrays, but instead of making a copy of [], we will use the arguments array as the context that we want slice to be called in. We can immediately attach reduce and we are good to go!\n return [].slice.call(arguments).reduce(function(acc,next){\n return acc + next;\n },0)\n}", "title": "" }, { "docid": "008d6037a0f6762f99a1d42e852dd3b6", "score": "0.6115924", "text": "function concat_concat() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n return function (source) { return source.lift.call(concat[\"a\" /* concat */].apply(void 0, [source].concat(observables))); };\n}", "title": "" }, { "docid": "8cac787241c86fb4b1a8fb47dab1c53f", "score": "0.6109367", "text": "function curry (funt) {\n let allArgumets = [];\n let expectedArgsAmount = funt.length;\n return function curriedFunction () {\n let args = [].concat.apply([], arguments);\n allArgumets = allArgumets.concat(args);\n if (allArgumets.length >= expectedArgsAmount) {\n return funt.apply(null, allArgumets);\n } else {\n return curriedFunction;\n }\n };\n}", "title": "" }, { "docid": "dfd133091af4482563ca17515c38c2cf", "score": "0.6084197", "text": "function curryPLus(f){\n\treturn function(){\n\n\t\treturn doCurry(slice(arguments));\n\n\t\t// recurcive function\n\t\tfunction doCurry(providedArgs){\n\t\t\tvar numberOfMissingArgs = f.length - providedArgs.length;\n\t\t\t\n\t\t\tif(numberOfMissingArgs > 0){\n\t\t\t\tconsole.log('called with', providedArgs);\n\t\t\t\treturn function(){\n\t\t\t\t\tvar allArgs = [].concat(providedArgs, slice(arguments));\n\t\t\t\t\tconsole.log('all args', allArgs)\n\t\t\t\t\treturn doCurry(allArgs);\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn f.apply(null, providedArgs);\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "fbab7060721404cfcdce8c3ba53fc7b1", "score": "0.60773224", "text": "function compose() {\n var args = arguments;\n var start = args.length - 1;\n return function() {\n var i = start;\n var result = args[start].apply(this, arguments);\n while (i--) result = args[i].call(this, result);\n return result;\n };\n }", "title": "" }, { "docid": "fbab7060721404cfcdce8c3ba53fc7b1", "score": "0.60773224", "text": "function compose() {\n var args = arguments;\n var start = args.length - 1;\n return function() {\n var i = start;\n var result = args[start].apply(this, arguments);\n while (i--) result = args[i].call(this, result);\n return result;\n };\n }", "title": "" }, { "docid": "fbab7060721404cfcdce8c3ba53fc7b1", "score": "0.60773224", "text": "function compose() {\n var args = arguments;\n var start = args.length - 1;\n return function() {\n var i = start;\n var result = args[start].apply(this, arguments);\n while (i--) result = args[i].call(this, result);\n return result;\n };\n }", "title": "" }, { "docid": "fbab7060721404cfcdce8c3ba53fc7b1", "score": "0.60773224", "text": "function compose() {\n var args = arguments;\n var start = args.length - 1;\n return function() {\n var i = start;\n var result = args[start].apply(this, arguments);\n while (i--) result = args[i].call(this, result);\n return result;\n };\n }", "title": "" }, { "docid": "97c0192b45af44ea0784280bb97553ca", "score": "0.60757613", "text": "function print2() {\n var arr = Array.prototype.slice.call(arguments);\n console.log(arr); // prints [ 1, 5, 2, 'hello', 'world', {} ]\n}", "title": "" }, { "docid": "69d936a524ae40d5f62ec51ae334a7da", "score": "0.6068989", "text": "function concat () {\n return Array.prototype.slice.call(arguments).join(' ')\n }", "title": "" }, { "docid": "78a564f5a4b48d1fb782ba59dcf45202", "score": "0.606578", "text": "function curry(func) {\n\tvar args = Array.prototype.slice.apply( arguments, [1] );\n\treturn function () {\n\t\treturn func.apply( null, args.concat(Array.prototype.slice.apply(arguments)) );\n\t};\n}", "title": "" }, { "docid": "e41d3ecf93dc8da8fc1c861334a0ae12", "score": "0.60615635", "text": "function compose() {\n var args = arguments;\n var start = args.length - 1;\n return function () {\n var i = start, result = args[start].apply(this, arguments);\n while (i--)\n result = args[i].call(this, result);\n return result;\n };\n}", "title": "" }, { "docid": "e41d3ecf93dc8da8fc1c861334a0ae12", "score": "0.60615635", "text": "function compose() {\n var args = arguments;\n var start = args.length - 1;\n return function () {\n var i = start, result = args[start].apply(this, arguments);\n while (i--)\n result = args[i].call(this, result);\n return result;\n };\n}", "title": "" }, { "docid": "87765a37bf73efbaaed6010e5029e967", "score": "0.6055547", "text": "function curry(method){\n const slice = Array.prototype.slice;\n const startArgs = slice.apply(arguments).slice(1); // exclude the 1st method argument\n return function(){\n const restArgs = slice.apply(arguments);\n return method.apply(null, startArgs.concat(restArgs)); // call actual function\n };\n}", "title": "" }, { "docid": "9cdde83ec56d84a270a26e66c01d1540", "score": "0.6037034", "text": "function compose() {\n var args = arguments;\n var start = args.length - 1;\n return function() {\n var i = start;\n var result = args[start].apply(this, arguments);\n while (i--) result = args[i].call(this, result);\n return result;\n };\n}", "title": "" }, { "docid": "9cdde83ec56d84a270a26e66c01d1540", "score": "0.6037034", "text": "function compose() {\n var args = arguments;\n var start = args.length - 1;\n return function() {\n var i = start;\n var result = args[start].apply(this, arguments);\n while (i--) result = args[i].call(this, result);\n return result;\n };\n}", "title": "" }, { "docid": "9cdde83ec56d84a270a26e66c01d1540", "score": "0.6037034", "text": "function compose() {\n var args = arguments;\n var start = args.length - 1;\n return function() {\n var i = start;\n var result = args[start].apply(this, arguments);\n while (i--) result = args[i].call(this, result);\n return result;\n };\n}", "title": "" }, { "docid": "9cdde83ec56d84a270a26e66c01d1540", "score": "0.6037034", "text": "function compose() {\n var args = arguments;\n var start = args.length - 1;\n return function() {\n var i = start;\n var result = args[start].apply(this, arguments);\n while (i--) result = args[i].call(this, result);\n return result;\n };\n}", "title": "" }, { "docid": "9cdde83ec56d84a270a26e66c01d1540", "score": "0.6037034", "text": "function compose() {\n var args = arguments;\n var start = args.length - 1;\n return function() {\n var i = start;\n var result = args[start].apply(this, arguments);\n while (i--) result = args[i].call(this, result);\n return result;\n };\n}", "title": "" }, { "docid": "9cdde83ec56d84a270a26e66c01d1540", "score": "0.6037034", "text": "function compose() {\n var args = arguments;\n var start = args.length - 1;\n return function() {\n var i = start;\n var result = args[start].apply(this, arguments);\n while (i--) result = args[i].call(this, result);\n return result;\n };\n}", "title": "" }, { "docid": "9cdde83ec56d84a270a26e66c01d1540", "score": "0.6037034", "text": "function compose() {\n var args = arguments;\n var start = args.length - 1;\n return function() {\n var i = start;\n var result = args[start].apply(this, arguments);\n while (i--) result = args[i].call(this, result);\n return result;\n };\n}", "title": "" }, { "docid": "9cdde83ec56d84a270a26e66c01d1540", "score": "0.6037034", "text": "function compose() {\n var args = arguments;\n var start = args.length - 1;\n return function() {\n var i = start;\n var result = args[start].apply(this, arguments);\n while (i--) result = args[i].call(this, result);\n return result;\n };\n}", "title": "" }, { "docid": "9cdde83ec56d84a270a26e66c01d1540", "score": "0.6037034", "text": "function compose() {\n var args = arguments;\n var start = args.length - 1;\n return function() {\n var i = start;\n var result = args[start].apply(this, arguments);\n while (i--) result = args[i].call(this, result);\n return result;\n };\n}", "title": "" }, { "docid": "c32622519683e743de04494d2b315dbb", "score": "0.6024858", "text": "function curry(func) {\n console.log(...arguments);\n return function() {\n /*\n 'arguments' is an Array-like object accessible inside functions\n that contains the values of the arguments passed to that function.\n functions all have a 'length' that indicates the number of parameters\n expected by the function.\n */\n console.log(arguments);\n if (arguments.length >= func.length) {\n /*\n spread the arguments that you have into the actual function. The function\n itself is unchanged through the recursion calls; the arguments are what\n gets attached to the function with each curry call.\n */\n return func(...arguments);\n } else {\n /*\n When a function is bound to n arguments, the returned bound function\n length has a length that is n smaller than the original function.\n */\n const boundFunc = func.bind(null, ...arguments);\n return curry(boundFunc);\n }\n };\n}", "title": "" }, { "docid": "46c6f646cc7488616e8eaa87bd66c78e", "score": "0.60155237", "text": "function compose() {\r\n\t var args = arguments;\r\n\t var start = args.length - 1;\r\n\t return function () {\r\n\t var i = start, result = args[start].apply(this, arguments);\r\n\t while (i--)\r\n\t result = args[i].call(this, result);\r\n\t return result;\r\n\t };\r\n\t}", "title": "" }, { "docid": "c64aad814f1cca2a12c1307f492df637", "score": "0.59797347", "text": "function callTogether () {\n var funcs = arguments\n var length = funcs.length\n var index = length\n\n if (!length) {\n return function () {}\n }\n\n return function () {\n length = index\n\n while (length--) {\n var fn = funcs[length]\n if (typeof fn === 'function') {\n var result = funcs[length].apply(this, arguments)\n }\n }\n return result\n }\n}", "title": "" }, { "docid": "db3ca7d9af3c95910715aa2f99c20e41", "score": "0.5967195", "text": "function one() {\n return Array.prototype.slice.call(arguments);\n}", "title": "" }, { "docid": "fe2ec512d9303ddb123598085ff63ee8", "score": "0.5962531", "text": "function compose () {\n var filters = slice.apply(arguments);\n return reduceRight(filters, function(right, left) {\n return left(right);\n });\n}", "title": "" }, { "docid": "cd3a956e79ec384e4c1017e4e4c34766", "score": "0.59612536", "text": "function curried(f, length, acc) {\n return function fn() {\n // eslint-disable-next-line prefer-rest-params\n var combined = acc.concat(Array.prototype.slice.call(arguments));\n return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined);\n };\n} // eslint-disable-next-line no-redeclare", "title": "" }, { "docid": "cd3a956e79ec384e4c1017e4e4c34766", "score": "0.59612536", "text": "function curried(f, length, acc) {\n return function fn() {\n // eslint-disable-next-line prefer-rest-params\n var combined = acc.concat(Array.prototype.slice.call(arguments));\n return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined);\n };\n} // eslint-disable-next-line no-redeclare", "title": "" }, { "docid": "cd3a956e79ec384e4c1017e4e4c34766", "score": "0.59612536", "text": "function curried(f, length, acc) {\n return function fn() {\n // eslint-disable-next-line prefer-rest-params\n var combined = acc.concat(Array.prototype.slice.call(arguments));\n return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined);\n };\n} // eslint-disable-next-line no-redeclare", "title": "" }, { "docid": "cd3a956e79ec384e4c1017e4e4c34766", "score": "0.59612536", "text": "function curried(f, length, acc) {\n return function fn() {\n // eslint-disable-next-line prefer-rest-params\n var combined = acc.concat(Array.prototype.slice.call(arguments));\n return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined);\n };\n} // eslint-disable-next-line no-redeclare", "title": "" }, { "docid": "fe9f75f023aa70fd6fd0c0898e40c3e2", "score": "0.59477746", "text": "function _curryN(length, received, fn) {\n return function () {\n var combined = [];\n var argsIdx = 0;\n var left = length;\n var combinedIdx = 0;\n while (combinedIdx < received.length || argsIdx < arguments.length) {\n var result;\n if (combinedIdx < received.length) {\n result = received[combinedIdx];\n } else {\n result = arguments[argsIdx];\n argsIdx += 1;\n }\n combined[combinedIdx] = result;\n {\n left -= 1;\n }\n combinedIdx += 1;\n }\n return left <= 0 ? fn.apply(this, combined) : _arity(left, _curryN(length, combined, fn));\n };\n }", "title": "" }, { "docid": "f852aaacfdf757a0b38b15a23488a1f5", "score": "0.59407413", "text": "function carry (fn) {\n\tfunction _c(rest, argulist) {\n\t\tif (rest === 0) {\n\t\t\treturn fn.apply(null ,argulist)\n\t\t} else {\n\t\t\treturn function (x) {\n\t\t\t\treturn _c(rest - 1, argulist.concat(x))\n\t\t\t}\n\t\t}\n\t}\n\n\treturn _c(fn.length, [])\n}", "title": "" }, { "docid": "cd48828c42dd678b4a4e890d3a66e908", "score": "0.59164137", "text": "function compose() {\n var funcs = arguments;\n return function() {\n var args = arguments;\n for (var i = funcs.length; i --> 0;) {\n args = [funcs[i].apply(this, args)];\n }\n return args[0];\n };\n}", "title": "" }, { "docid": "61eaa1987e7f755f0f4ce7baff93316e", "score": "0.5901926", "text": "function f6(arguments) { return arguments; }", "title": "" }, { "docid": "5c3493476e1100b9cc58ceb88d8055cc", "score": "0.58868635", "text": "function cat() {\n var head = _.first(arguments);\n if (existy(head))\n return head.concat.apply(head, _.rest(arguments));\n else\n return [];\n}", "title": "" }, { "docid": "0dee1c844b35c237350e4b90f0ba1b94", "score": "0.58802277", "text": "function sum() {\r\n console.log(arguments);\r\n return [...arguments].reduce((a, b) => a + b);\r\n}", "title": "" }, { "docid": "c192542a225e5206fac72cd6aebfeabf", "score": "0.5852436", "text": "function spread(func, args) {\n return func.apply(this, args);\n}", "title": "" }, { "docid": "cd2e7268a987ff7ab208fb07fb7e2ad5", "score": "0.5846316", "text": "function f(){\n var arg_array = Array.prototype.slice.call(arguments);\n console.log(arg_array.pop());\n console.log(arg_array.push(\"hello world!\"));\n console.log(arg_array);\n console.log(typeof arg_array);\n}", "title": "" }, { "docid": "ecdf09ddde82efd090eeebbaae439a81", "score": "0.5832792", "text": "function add(){\n console.log(arguments);\n const args = Array.prototype.slice.call(arguments);\n console.log(args);\n console.log(Array.from(arguments));\n console.log([...arguments]);\n}", "title": "" }, { "docid": "3a306ebd81febc0d467dd7ab05277c71", "score": "0.5814725", "text": "function lexicalCompose() {\n for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return function (a, b) {\n return args.reduce(function (acc, curr) {\n return acc === 0 ? curr(a, b) : acc;\n }, 0);\n };\n}", "title": "" }, { "docid": "b13cfc08937b54a7fae473b337627953", "score": "0.58118397", "text": "function curry (fn, length) {\n var needLen = fn.length || length\n return function () {\n var arg = [].slice.call(arguments)\n if (arg.length < needLen) {\n return curry(fixedParamsCurry.apply(this, [fn].concat(arg)), needLen - arg.length)\n } else {\n return fn.apply(this, arg)\n }\n }\n}", "title": "" }, { "docid": "bd23aed4502fb106726104d934f364ed", "score": "0.5807751", "text": "function cat() {\n var head = _.first(arguments);\n \n if (existy(head))\n return head.concat.apply(head, _.rest(arguments));\n else\n return [];\n}", "title": "" }, { "docid": "5df69dd65b3dd08f57cd4709dfde7ef7", "score": "0.579933", "text": "function variadic () {\n console.log(typeof arguments.pop) //<- undefined. arguments is an array-like object not an array\n var vargs = slice.call(arguments) // <- this creates array and assigns it to vargs\n console.log(vargs.pop()) // <- bc vargs is an array it inherits from the Array object prototype\n}", "title": "" }, { "docid": "0515d6b0e1bdfe22c211d70885e8884c", "score": "0.5786451", "text": "function curried(f, length, acc) {\n return function fn() {\n // eslint-disable-next-line prefer-rest-params\n var combined = acc.concat(Array.prototype.slice.call(arguments));\n return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined);\n };\n}", "title": "" }, { "docid": "07c367ecf7c3659a8d0cd2fc92aab509", "score": "0.5776624", "text": "_extractArgs(args) {\n return (args.length === 1 ? [args[0]] : Array.apply(null, args)).slice(1);\n }", "title": "" }, { "docid": "a5b995b7da7dbb8acabe519bbe6f717c", "score": "0.5757266", "text": "function f(a, b) {\n var args = Array.prototype.slice.call(arguments, f.length);\n}", "title": "" }, { "docid": "12958a7302f33871d69d958c41364bdb", "score": "0.5757137", "text": "function sumArgs(a1, a2, a3, a4, a5) {\n //borrowing method reduce\n arguments.reduce = [].reduce;\n //returning reduces arguments\n return arguments.reduce(function (a, b) {\n return a + b;\n })\n}", "title": "" }, { "docid": "cb8acbeb945b4cfed60e288a1d916440", "score": "0.57455105", "text": "function concat(...args) {\n return args.reduce((p, c) => c ? p.concat(c) : p, []);\n}", "title": "" }, { "docid": "3ed87b807f2b0f777f27ab717f8b5fa3", "score": "0.57408", "text": "function curry(fn, ...args){\n return(..._args)=>{\n return fn(...args, ..._args)\n }\n}", "title": "" }, { "docid": "b666cf9b0b85b627e50740bb45949b00", "score": "0.57346225", "text": "function spread(fn) {\r\n // .apply() accepts two arguments, the context (what would become this inside of the target function) and an iterable of arguments \r\n // .bind() takes a context (what would become this), and optionally, additional arguments, and returns a new function, with the context bound, and the additional arguments locked\r\n // apply() is a function itself, so it can be bound with bind()\r\n // meaning that the this of .apply() would be fn and the first argument to .apply() would be null \r\n // Meaning that it would look like this: fn.apply(null, args) which spreads the parameters from an array\r\n return Function.apply.bind(fn, null);\r\n}", "title": "" }, { "docid": "d056ea63762823ce439105b619a778b7", "score": "0.57240516", "text": "function sumArgs(x, y) {\n\tconsole.log(arguments);\n\t// return arguments.array.forEach(element => { });\n\t// Uncaught TypeError: Cannot read property 'forEach' of undefined\n\t// Its an array l;ike object\n\tconst args = [ ...arguments ];\n\tconsole.log(args);\n\t// [2, 3, 4, 5, 6, 67] // x=2, y=3, rest are argumants\n\tconsole.log(arguments[0]); // 2 // is also 2\n\tconsole.log(x, y); // 2,3\n}", "title": "" }, { "docid": "42723c3cb37e7252da5efdc42ab53468", "score": "0.5714118", "text": "function compose(fun1, fun2 /*, ... */) {\n var funcs = Array.prototype.slice.call(arguments);\n return function() {\n var args = Array.prototype.slice.call(arguments);\n for(var i = 0; i < funcs.length; i++) {\n args = funcs[i].apply(null, args);\n }\n return args;\n }\n }", "title": "" }, { "docid": "5991caea55df1484a51061bff41ec89a", "score": "0.5710217", "text": "function f(a, b, c, d) { return arguments; }", "title": "" }, { "docid": "1fe48b14874e003f5ce7931f386f5378", "score": "0.57100755", "text": "function compose() {\n var fns = flatten(arguments);\n\n return function () {\n for (var i = 0; i < fns.length; i++) {\n fns[i].apply(this, arguments);\n }\n };\n }", "title": "" }, { "docid": "f25014678e93192c007df8fd3d8b637d", "score": "0.56992984", "text": "function concat(...args) {\n\tconsole.log(args)\n let arr= args.flat(Infinity)\n //array.flet(infinity) concaticate array build a new flat array with no sub array\n console.log(arr)\n return arr\n}", "title": "" }, { "docid": "0358233c52255307d59577f390731a4f", "score": "0.56981224", "text": "function curry(fun, args) {\n return function(x) {\n return fun.apply(bindingContext, args.concat([x]));\n };\n }", "title": "" }, { "docid": "3eceefed40369079a78ff8bc1d283403", "score": "0.5695159", "text": "function argsArr(){\n var args = Array.prototype.slice.call(arguments);\n return args;\n}", "title": "" }, { "docid": "93c985fd4cec2ddd7afe33c3dc4a60f5", "score": "0.56779945", "text": "function strictCurry(fn) {\n // arguments are all arguments used to call the strictCurry-function\n // it's not an array, so we can't splice it\n // but by using apply we can use the Array's splice-function\n // to get all arguments after the first one (which is the function to be curried)\n var predefinedArguments = Array.prototype.splice.call(arguments, 1);\n\n // the curried function!\n return function() {\n // we must first get the additional arguments, again we have to splice them\n // though from zero this time, since we want to use all inserted arguments\n var newArguments = Array.prototype.splice.call(arguments, 0);\n\n // the predefined arguments together with the new ones\n var allArguments = predefinedArguments.concat(newArguments);\n\n // we call the function with all the arguments\n return fn.apply(this, allArguments);\n };\n}", "title": "" }, { "docid": "1bb98ee96a275e5aa1bd8b39bbf6ec7d", "score": "0.5664755", "text": "function pipe() {\r\n\t var funcs = [];\r\n\t for (var _i = 0; _i < arguments.length; _i++) {\r\n\t funcs[_i - 0] = arguments[_i];\r\n\t }\r\n\t return compose.apply(null, [].slice.call(arguments).reverse());\r\n\t}", "title": "" }, { "docid": "529b37226fe3d532ea98fb5f2891af7f", "score": "0.5654073", "text": "function concat(arr1, arr2) {\n console.log(arguments)\n var needarr = [];\n [].push.apply(needarr,arr1);\n [].push.apply(needarr,arr2)\n return needarr\n}", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.5645794", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.5645794", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.5645794", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.5645794", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.5645794", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.5645794", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.5645794", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.5645794", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.5645794", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.5645794", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.5645794", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.5645794", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.5645794", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "17dfe7555259caceff139675e62fc065", "score": "0.5642274", "text": "function foo (...everything) {} // => everything is an array with all parameters passed to foo", "title": "" }, { "docid": "8c8e014cbafbb779776ac5d6a6bbf06f", "score": "0.5630134", "text": "function _curry(fn) {\n return function(a, b) {\n return arguments.length == 2\n ? fn(a, b)\n : function(b) {\n return fn(a, b);\n };\n };\n}", "title": "" }, { "docid": "5ba69f76f44a8b8414e55ad1aab3b208", "score": "0.5626324", "text": "function curry(fx) {\n\tvar arity = fx.length;\n\t\n\treturn function f1() {\n\t\tvar args = Array.prototype.slice.call(arguments, 0);\n\t\tif (args.length >= arity) {\n\t\t\treturn fx.apply(null, args);\n\t\t}\n\t\telse {\n\t\t\treturn function f2() {\n\t\t\t\tvar args2 = Array.prototype.slice.call(arguments, 0);\n\t\t\t\treturn f1.apply(null, args.concat(args2));\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "71361b05ba0090d1fde6c459eed8cf7e", "score": "0.56217605", "text": "function foo() {\n let args = Array.from(arguments);\n }", "title": "" }, { "docid": "11c0060bc121625e8ca610c6af6b023f", "score": "0.5620487", "text": "function curry(f) {\r\n var args = [].slice.call(arguments, 1);\r\n return function () {\r\n return f.apply(this, args.concat([].slice.call(arguments, 0)));\r\n };\r\n}", "title": "" }, { "docid": "dd52ca29939e58dc5da0c0ecf201318a", "score": "0.56061757", "text": "function curry(callback) {\n //return (a) => (...b) => callback(a, ...b);\n return (a) => (...b) => callback(a, ...b);\n}", "title": "" }, { "docid": "00e090ef6de3a1775264820d478252dc", "score": "0.5601025", "text": "function concat() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n return function (source) { return source.lift.call(_observable_concat__WEBPACK_IMPORTED_MODULE_0__[\"concat\"].apply(void 0, [source].concat(observables))); };\n}", "title": "" }, { "docid": "5a1f42f6c970c15dc3cd392ecd3a7adb", "score": "0.5595469", "text": "function partial(func /*, 0..n args */) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function() {\n var allArguments = args.concat(Array.prototype.slice.call(arguments));\n return func.apply(this, allArguments);\n }\n}", "title": "" }, { "docid": "cb11c54757b866715ef4cf6fca865f8a", "score": "0.5585233", "text": "function _restParam(func, startIndex) {\n\t startIndex = startIndex == null ? func.length - 1 : +startIndex;\n\t return function () {\n\t var length = Math.max(arguments.length - startIndex, 0);\n\t var rest = Array(length);\n\t for (var index = 0; index < length; index++) {\n\t rest[index] = arguments[index + startIndex];\n\t }\n\t switch (startIndex) {\n\t case 0:\n\t return func.call(this, rest);\n\t case 1:\n\t return func.call(this, arguments[0], rest);\n\t }\n\t // Currently unused but handle cases outside of the switch statement:\n\t // var args = Array(startIndex + 1);\n\t // for (index = 0; index < startIndex; index++) {\n\t // args[index] = arguments[index];\n\t // }\n\t // args[startIndex] = rest;\n\t // return func.apply(this, args);\n\t };\n\t }", "title": "" }, { "docid": "0654989491ea7eebde50b25a24207662", "score": "0.55846614", "text": "function concat(arr) {\n var newArr = _toConsumableArray(arr);\n\n for (var _len = arguments.length, value = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n value[_key - 1] = arguments[_key];\n }\n\n value.forEach(function (v) {\n if (Array.isArray(v)) {\n v.forEach(function (element) {\n return newArr.push(element);\n });\n } else newArr.push(v);\n });\n return newArr;\n}", "title": "" }, { "docid": "4003b7e51be3c760cbb937f1afb50192", "score": "0.55806", "text": "function curry( func ) {\n var args = aps.call( arguments, 1 );\n \n return function() {\n return func.apply( this, args.concat( aps.call( arguments ) ) );\n };\n }", "title": "" }, { "docid": "4003b7e51be3c760cbb937f1afb50192", "score": "0.55806", "text": "function curry( func ) {\n var args = aps.call( arguments, 1 );\n \n return function() {\n return func.apply( this, args.concat( aps.call( arguments ) ) );\n };\n }", "title": "" }, { "docid": "4003b7e51be3c760cbb937f1afb50192", "score": "0.55806", "text": "function curry( func ) {\n var args = aps.call( arguments, 1 );\n \n return function() {\n return func.apply( this, args.concat( aps.call( arguments ) ) );\n };\n }", "title": "" } ]
86d898e17a92bca1479be195403a484f
Draws an item on the canvas
[ { "docid": "b984244bf9cf2775e3f915d5266e0a85", "score": "0.0", "text": "function drawCanvas(data, x, y){\n let newCanvas = document.getElementById(\"newCanvas\");\n let ctx = newCanvas.getContext(\"2d\");\n let img = new Image();\n //Base 64 data from call to proxy server\n img.src=data;\n img.onload = function(){\n ctx.drawImage(img, x, y, 320, 320);\n //once last tile has been drawn, call generate PDF function\n if (y >= 300) savePDF();\n }\n}", "title": "" } ]
[ { "docid": "fabab0134feadbfa00ea851f4d31f580", "score": "0.8015483", "text": "drawItem() {\n ctx.fillStyle = \"red\";\n ctx.fillRect(this.xPos, this.yPos, this.size, this.extension);\n }", "title": "" }, { "docid": "7593b778efc346877e01cceb024ba098", "score": "0.74550843", "text": "function drawItem() {\n ctx.drawImage(itemType, itemX, itemY);\n itemX += dx\n if (isSuck) itemY -= 0.3;\n}", "title": "" }, { "docid": "73240227bf348d02512f8769f43b8f2a", "score": "0.7346188", "text": "drawItem() {\n const yellowRingImg = new Image(30, 30);\n yellowRingImg.src = \"./img/yellowRingFinal.png\";\n ctx.drawImage(yellowRingImg, this.xPos, this.yPos);\n }", "title": "" }, { "docid": "1f005f77179239140969326469878be0", "score": "0.7064955", "text": "draw() {\n var context = document.getElementById(this.getCanvas()).getContext(\"2d\");\n context.beginPath();\n context.fillStyle = this.color;\n context.strokeStyle = this.color;\n context.moveTo(this.getPos().getx(),this.getPos().gety());\n context.fillRect(this.getPos().getx(), this.getPos().gety(), this.getWidth(), this.getHeight());\n context.closePath();\n }", "title": "" }, { "docid": "8b4db80f1dd260a74698a607dd028dce", "score": "0.7064343", "text": "drawItem() {\n const specialRingImg = new Image(30, 30);\n specialRingImg.src = \"./img/specialRingFinal.png\";\n ctx.drawImage(specialRingImg, this.xPos, this.yPos);\n }", "title": "" }, { "docid": "0d9789f5dac3242e86eb645fa7ee2cf0", "score": "0.6951436", "text": "function draw() {\n ctx.clearRect(0, 0, canvas.width, canvas.height); // clear the canvas\n scaleToFill(bg);\n // Draw scrolling platform\n drawPlatform();\n // Draw meme mirror\n drawMirror();\n // Check if Kirby collided with item\n checkCollision();\n // Check if item landed on grass platform\n if (itemLanded) drawItem(itemType);\n // Draw clouds\n drawClouds();\n // Draw Kirby\n drawKirbys();\n if (itemType === tomato && isSuck) {\n drawSparkles();\n }\n // Draw music toggle button\n drawButtons();\n}", "title": "" }, { "docid": "bb4fdc0f366881d8d9f81d95ea8080b4", "score": "0.69227034", "text": "function drawItem(ctx) {\n return function(item) {\n drawingFuncs[item.type](ctx, item);\n };\n}", "title": "" }, { "docid": "1bba89cd7e93ddbc65ff44ebe481606e", "score": "0.6914923", "text": "drawItem() {\n const enemyImg = new Image(30, 30);\n enemyImg.src = \"./img/enemyFinal.png\";\n ctx.drawImage(enemyImg, this.xPos, this.yPos);\n }", "title": "" }, { "docid": "befd528d367c73b9e946c6c0334e73c7", "score": "0.6904608", "text": "function drawCanvas() {\n if (drawio.selectedElement) {\n drawio.selectedElement.render();\n }\n for (var i = 0; i < drawio.shapes.length; i++) {\n drawio.shapes[i].render();\n }\n }", "title": "" }, { "docid": "5b326592d3413c3d1491a89e7dea724c", "score": "0.690045", "text": "draw() {\r\n }", "title": "" }, { "docid": "6412884ea5a088205fc75fa6a9c329b0", "score": "0.68562734", "text": "draw (context) {\n context.fillStyle = '#fff'\n context.fillRect(this.x, this.y, this.width, this.height)\n }", "title": "" }, { "docid": "c50947c41fcdb07cb6a586df501f1660", "score": "0.6830861", "text": "draw() {\n this.checkContext();\n this.setRendered();\n\n const tick_context = this.getTickContext();\n const next_context = TickContext.getNextContext(tick_context);\n\n const begin_x = this.getAbsoluteX();\n const end_x = next_context ? next_context.getX() : this.stave.x + this.stave.width;\n const y = this.stave.getYForLine(this.line + -3) + 1;\n\n L('Drawing ', this.decrescendo ? 'decrescendo ' : 'crescendo ', this.height, 'x', begin_x - end_x);\n\n renderHairpin(this.context, {\n begin_x: begin_x - this.render_options.extend_left,\n end_x: end_x + this.render_options.extend_right,\n y: y + this.render_options.y_shift,\n height: this.height,\n reverse: this.decrescendo,\n });\n }", "title": "" }, { "docid": "d9ff89e1b2ed3b5a2168382d8cc87f45", "score": "0.6802838", "text": "function draw() {\r\n // TODO: is there any of the update logic that should instead be handled here?\r\n }", "title": "" }, { "docid": "d9ff89e1b2ed3b5a2168382d8cc87f45", "score": "0.6802838", "text": "function draw() {\r\n // TODO: is there any of the update logic that should instead be handled here?\r\n }", "title": "" }, { "docid": "638d4a13e35e1e3a21afa2052e52147f", "score": "0.6794024", "text": "draw(context) {\n context.fillStyle = '#fff'\n context.fillRect(this.x, this.y, this.width, this.height)\n }", "title": "" }, { "docid": "077814106a62a22e4f66e56956a18991", "score": "0.6791027", "text": "draw(ctx) {}", "title": "" }, { "docid": "37d52e732312fc0ab68510fa1140d7fb", "score": "0.6760125", "text": "draw() {\n\t\tthis.element.draw(1);\n\t}", "title": "" }, { "docid": "64e7c14cf2f2e87586f85e584f2f7aae", "score": "0.67546284", "text": "draw() {\n drawCoordinates(this.type, this.coordinates, this.id, this.size);\n\t}", "title": "" }, { "docid": "47d2136c5d8c4d3755166fee34df501d", "score": "0.674859", "text": "internalDraw() {\n this.context.rect(this.point.x, this.point.y, this.width, this.height);\n }", "title": "" }, { "docid": "f97ddc1e15031f72b121c7fbcc86b7cc", "score": "0.67456186", "text": "draw() {\n\n\t}", "title": "" }, { "docid": "7e6ee4902d87f59640e9804252a19b4e", "score": "0.6729463", "text": "draw(context, shape): void {}", "title": "" }, { "docid": "f68a7d68cdf8db2d46c663853c15049e", "score": "0.67050964", "text": "function drawFood(){\n context.fillStyle = \"red\";\n context.fillRect(food.x, food.y, box, box)\n}", "title": "" }, { "docid": "e7337356da5ee5d101079a4ab15b5d3a", "score": "0.670052", "text": "draw() {\n this.checkContext();\n this.setRendered();\n\n const tick_context = this.getTickContext();\n const next_context = _tickcontext__WEBPACK_IMPORTED_MODULE_2__[\"TickContext\"].getNextContext(tick_context);\n\n const begin_x = this.getAbsoluteX();\n const end_x = next_context ? next_context.getX() : this.stave.x + this.stave.width;\n const y = this.stave.getYForLine(this.line + (-3)) + 1;\n\n L(\n 'Drawing ',\n this.decrescendo ? 'decrescendo ' : 'crescendo ',\n this.height,\n 'x',\n begin_x - end_x\n );\n\n renderHairpin(this.context, {\n begin_x: begin_x - this.render_options.extend_left,\n end_x: end_x + this.render_options.extend_right,\n y: y + this.render_options.y_shift,\n height: this.height,\n reverse: this.decrescendo,\n });\n }", "title": "" }, { "docid": "b6e9e185ba25f3eaa9684f6daad2a675", "score": "0.66656184", "text": "function draw() {\n\n // this is text on the display to tell users what to do.\n if (itemsDrawn === 0) {\n fill(0)\n rect(50, 200, 300, 100, 16)\n textSize(24);\n textAlign(CENTER, CENTER);\n fill(255);\n text(\"Click anywhere to begin drawing my portrait\" , 50, 200 , 300, 100);\n }\n // DRAW END\n }", "title": "" }, { "docid": "38d7a302cfd754dbd803c9c5f6732ac1", "score": "0.6654035", "text": "function draw() {}", "title": "" }, { "docid": "38d7a302cfd754dbd803c9c5f6732ac1", "score": "0.6654035", "text": "function draw() {}", "title": "" }, { "docid": "38d7a302cfd754dbd803c9c5f6732ac1", "score": "0.6654035", "text": "function draw() {}", "title": "" }, { "docid": "e92767c27702706cc9f88b6f275ab04c", "score": "0.664785", "text": "draw() {\n this.ctx.fillStyle = this.__value === 1 ? this.fill : this.background\n this.ctx.strokeStyle = this.stroke\n this.ctx.lineWidth = this.lineWidth\n this.ctx.fillRect( 0,0, this.rect.width, this.rect.height )\n\n this.ctx.strokeRect( 0,0, this.rect.width, this.rect.height )\n }", "title": "" }, { "docid": "62dfd7c0f99e0b5d08bfda51299a1e46", "score": "0.6646922", "text": "Draw()\n\t{\n\t\t// Clear the canvas, optimize later if enough brain\n\t\tthis.ctx.clearRect(0, 0, this.canvasWidth, this.canvasHeight);\n\n\t\t// Draw everything\n\t\tfor(var i = 0; i < this.CanvasComponentCollection.orderedCollection.length; i++)\n\t\t{\n\t\t\tthis.CanvasComponentCollection.orderedCollection[i].Draw();\n\t\t}\n\t}", "title": "" }, { "docid": "99c6000b66d7de010ecaeba3c4ac59c9", "score": "0.6646408", "text": "render() {\n ctx.beginPath();\n ctx.fillStyle = this.color;\n ctx.fillRect(this.posX, this.posY, this.width, this.height);\n ctx.closePath();\n ctx.stroke();\n }", "title": "" }, { "docid": "6ca2098e808f2968e6feb87b392f9ef8", "score": "0.66370255", "text": "function draw() {\r\n var job;\r\n\r\n job = this;\r\n\r\n // TODO:\r\n }", "title": "" }, { "docid": "6ca2098e808f2968e6feb87b392f9ef8", "score": "0.66370255", "text": "function draw() {\r\n var job;\r\n\r\n job = this;\r\n\r\n // TODO:\r\n }", "title": "" }, { "docid": "1700bb4f37898e052c944a26fbd41468", "score": "0.6632988", "text": "function drawCanvas( particle ) { particle.draw( _context ); }", "title": "" }, { "docid": "d88048912d52f91a5612f73b5baea3c6", "score": "0.66294587", "text": "draw() {\n this.context.clearRect(0,0, this.canvas.width, this.canvas.height);\n\n this.players.forEach(player => {\n player.draw(this.context);\n });\n\n this.bombs.forEach(bomb => {\n bomb.draw(this.context);\n });\n\n this.walls.forEach(wall => {\n wall.draw(this.context);\n });\n\n this.items.forEach(item => {\n item.draw(this.context);\n });\n }", "title": "" }, { "docid": "befa6630a4656bfd86e087bd4508114c", "score": "0.66171056", "text": "function __draw(ctx){\n __drawTarget(ctx); \n __draw_option(ctx, new Pol.Core.Math.Rect(10, 10, Pol.Core.Game.GameWidth-20, 70));\n __draw_buttons(ctx); \n }", "title": "" }, { "docid": "c855f9315ef860cb101964b7b7ddcce4", "score": "0.6608033", "text": "draw(){\n\t\tpush();\n\t\ttranslate(this.x + (this.d / 2), this.y + (this.d / 2));\n\t\tfill(this.owner.color);\n\t\tcircle(0, 0, this.d / 2);\n\t\tpop();\n\t}", "title": "" }, { "docid": "ed17dd7f314dca77115f2aa43bb51821", "score": "0.6587731", "text": "draw () {\n this._root._dispatch('willdraw')\n this._ctx.clearRect(0, 0, this._el.width, this._el.height)\n this._root.draw(this._ctx)\n }", "title": "" }, { "docid": "762c91358ca1a2c34372f198569a9ed4", "score": "0.6585309", "text": "draw() {\n this.ctx.fillStyle = \"crimson\"\n this.ctx.fillRect(this.x, this.y, 10, 10)\n }", "title": "" }, { "docid": "d114cba80a2451647432cd46cca6228c", "score": "0.6563359", "text": "draw()\n {\n Renderer.ctx.beginPath();\n Renderer.ctx.moveTo(this.startPosition.x, this.startPosition.y);\n Renderer.ctx.lineTo(this.endPosition.x,this.endPosition.y);\n Renderer.ctx.lineWidth=this.lineWidth;\n Renderer.ctx.strokeStyle=this.color;\n Renderer.ctx.stroke(); \n }", "title": "" }, { "docid": "343dbe12e6c58965e86a6ed11f41ef4e", "score": "0.6551565", "text": "function draw()\n\t{\n\t\tdrawNode.draw(ctx);\n\t\tfor( var i = 0; i < drawNode.children.length; i++ )\n\t\t{\n\t\t\tdrawNode.children[i].draw(ctx);\n\t\t}\n\t\treturn;\n\t}", "title": "" }, { "docid": "4d8e4dcc6397d4ba319304ce171ff6ba", "score": "0.6540375", "text": "draw(ctx) {\n ctx.fillStyle = this.fill;\n ctx.fillRect(this.x, this.y, this.w, this.h);\n }", "title": "" }, { "docid": "a17c1dc0a252803cda00033da9837c7a", "score": "0.6537658", "text": "draw(context) {\n\t\t\n\t\tif (!this.gameOver) {\n\t\t\tcontext.clearRect(0, 0, this.w, this.h);\n\t\t\tfor (var x = 0; x < this.COLS; ++x) {\n\t\t\t\tfor (var y = 0; y < this.ROWS; ++y) {\n\n\t\t\t\t\tif (((y == this.item_y) && (x == this.item_x))) {\n\t\t\t\t\t\t//fruit\n\t\t\t\t\t\tcontext.fillStyle = \"red\";\n\t\t\t\t\t\tcontext.fillRect(this.BLOCK_W * x , this.BLOCK_H * y, this.BLOCK_W , this.BLOCK_H);\n\t\t\t\t\t} else if (this.grid_aStar[y][x].block) {\n\t\t\t\t\t\t//snake\n\t\t\t\t\t\tcontext.fillStyle = \"white\";\n\t\t\t\t\t\tcontext.fillRect(this.BLOCK_W * x , this.BLOCK_H * y, this.BLOCK_W , this.BLOCK_H);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//empty\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "803bd3c747c5b0aeb302602592ef7576", "score": "0.65363646", "text": "draw(ctx) {\n\t\tctx.beginPath();\n\t\tctx.rect(this.x, this.y, this.width, this.height);\n\t\tctx.fillStyle = this.color;\n\t\tctx.fill();\n\t\tctx.closePath();\n\t}", "title": "" }, { "docid": "0a089224f21ff6acdaccd52a4a676d9d", "score": "0.6525187", "text": "function draw() {\r\n if (use === \"pen\")\r\n draw_with_pen()\r\n if (use === \"square\")\r\n draw_square()\r\n if (use === \"rounded_square\")\r\n draw_rounded_square()\r\n if (use === \"circle\")\r\n draw_circle()\r\n if (use === \"ellipse\")\r\n draw_ellipse()\r\n if (use === \"line\")\r\n draw_line()\r\n if (use === \"curved_line\")\r\n draw_curved_line()\r\n if (use === \"triangle\")\r\n draw_triangle()\r\n if (use === \"polygon\")\r\n draw_polygon()\r\n if (use === \"move\")\r\n move_item()\r\n if (use === \"edit_points\")\r\n edit_point()\r\n}", "title": "" }, { "docid": "cf0b73a72c9397b074d1fdab49b29eab", "score": "0.6516621", "text": "draw() {\n this.FillPieces(this.color);\n }", "title": "" }, { "docid": "b0c83e2f8b0d87b0ee7e3dbebd7b3f82", "score": "0.6514655", "text": "draw() {\n // Empty\n }", "title": "" }, { "docid": "0a5c2617bf225edaad6dabe5ede2af47", "score": "0.6512418", "text": "draw() {\n\n }", "title": "" }, { "docid": "b0b35f0195ba91a9dfab9e3be6a006c2", "score": "0.6498952", "text": "function paintCanvas() {\n ctx.fillStyle = \"black\";\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n /* *** */\n } //Function to draw user controlled object*****", "title": "" }, { "docid": "55199b9d2ee20a231930aef8692b9954", "score": "0.64862394", "text": "draw() {\r\n ctx.beginPath();\r\n ctx.fillStyle = this.color;\r\n ctx.arc(this.x, this.y, this.size, 0, 2*Math.PI);\r\n ctx.fill();\r\n }", "title": "" }, { "docid": "c3c7dffa8e619ca9fb93d4d877771163", "score": "0.6474643", "text": "draw() {\n push();\n stroke(this.yellow);\n strokeWeight(this.radius);\n point(this.x, this.y);\n pop();\n }", "title": "" }, { "docid": "676a6040a6d3fd093b9319fab424f07a", "score": "0.64715916", "text": "draw(){\n context.beginPath();\n context.arc(this.x, this.y,this.size, 0, 2*Math.PI);\n context.fillStyle = this.color;\n context.fill();\n context.stroke();\n }", "title": "" }, { "docid": "6a2cbf25c10610974d79e76baf13e32b", "score": "0.6464938", "text": "function draw(){\n\t\t\n\t}", "title": "" }, { "docid": "74fff2b31cbf92596cb5bc251fd88283", "score": "0.64602", "text": "draw() {\n this.textureCanvas.draw(this);\n }", "title": "" }, { "docid": "187dc7cab3ba0f7ed54b8a8046170375", "score": "0.6449325", "text": "Draw() {\n\t\tDrawAllInstances(this);\n\t}", "title": "" }, { "docid": "2b29012e14d480d81c73e2a1b193df29", "score": "0.6447277", "text": "draw() {\n }", "title": "" }, { "docid": "f2bb3efe6f1799fc5fb4c046ef985ebc", "score": "0.6446713", "text": "function draw(ctx,element){\n switch(element.kind){\n case \"rectangle\":\n ctx.fillRect(element.x, element.y, element.width, element.height);\n break;\n case \"circle\": \n ctx.beginPath();\n ctx.arc(element.x,element.y,element.radius,0,7);\n ctx.fill();\n ctx.closePath();\n break;\n }\n }", "title": "" }, { "docid": "37d52d095437016ccd91023f0621a40a", "score": "0.644477", "text": "draw() {\n\n\t\tvar pos = scaleToPixels(this.body.GetPosition());\n\n\t\tpush();\n\t\ttranslate(pos.x, pos.y);\n\t fill('green');\n\t stroke('green');\n\t rectMode(CENTER);\n\t rect(0, 0, this.w, this.h);\n\t\tpop();\n\t}", "title": "" }, { "docid": "56ce6a7752cbc34f2396f73317944743", "score": "0.64412403", "text": "draw()\n {\n\n super.draw();\n }", "title": "" }, { "docid": "5dd8a20ce8017e6a5e2eee6242e3bacd", "score": "0.64311165", "text": "draw(){\n ctx.drawImage(this.link, this.x, this.y)\n }", "title": "" }, { "docid": "75b22178d2437194394ee11dcf18e6c8", "score": "0.64280635", "text": "function renderCanvas() {\n if (drawing) {\n ctx.moveTo(lastPos.x, lastPos.y);\n ctx.lineTo(mousePos.x, mousePos.y);\n ctx.stroke();\n lastPos = mousePos;\n }\n }", "title": "" }, { "docid": "6943a26eac201da2990cbd3cb560a44f", "score": "0.64232105", "text": "draw() {\n ctx.drawImage(this.img, this.x, this.y, this.width, this.height);\n }", "title": "" }, { "docid": "0f34b4dd094bd46ebcb883510a4ef544", "score": "0.6422946", "text": "function draw() {\n if(dirty){\n clear();\n update_view();\n dirty = false;\n }\n}", "title": "" }, { "docid": "0d87abec03f857719cfe702671224dcd", "score": "0.64221615", "text": "draw() {\r\n\t\tfill(255);\r\n\t\tstroke(0);\r\n\t\tstrokeWeight(4);\r\n\t\trect(this.drawPos.x, this.drawPos.y, 200, 80, 10);\r\n\r\n\t\trect(this.drawPos.x, this.drawPos.y, 200, 40, 10);\r\n\t\tfill(color(this.color));\r\n\t\trect(this.drawPos.x + 140, this.drawPos.y, 60, 40, 0, 10, 10, 0);\r\n\t\t\r\n\t\tfill(0);\r\n\t\tstrokeWeight(2);\r\n\t\ttextSize(20);\r\n\t\ttext(this.name, this.drawPos.x, this.drawPos.y, 140, 40);\r\n\t\ttextAlign(LEFT);\r\n\t\ttext(\"Shares:\", this.drawPos.x + 8, this.drawPos.y + 40, 190, 40);\r\n\t\ttextAlign(RIGHT);\r\n\t\ttext(\"\" + this.shares, this.drawPos.x, this.drawPos.y + 40, 197, 40);\r\n\t\tfill(255);\r\n\t\tstroke(255);\r\n\t\tstrokeWeight(1);\r\n\t\ttext(\"$\" + Math.floor(this.getValue()), this.drawPos.x + 140, this.drawPos.y, 57, 40);\r\n\t\ttextAlign(CENTER);\r\n\r\n\t\tthis.buyButton.draw();\r\n\t\tthis.sellButton.draw();\r\n\r\n\t}", "title": "" }, { "docid": "3902148b78af62a1980551e941d0c651", "score": "0.6417561", "text": "Draw(){\n ctx.fillStyle = this.color;\n fillCircleGrid(this.x, this.y);\n }", "title": "" }, { "docid": "f08a5ff75d48d5b3c3e8e5625d0e2b24", "score": "0.64158374", "text": "function renderCanvas() {\r\n\t\tif (drawing) {\r\n\t\t\tctx.beginPath();\r\n\t\t\tctx.moveTo(lastPos.x, lastPos.y);\r\n\t\t\tctx.lineTo(mousePos.x, mousePos.y);\r\n\t\t\tctx.lineJoin = 'round';\r\n\t\t\tctx.lineCap = 'round';\r\n\t\t\tctx.stroke();\r\n\t\t\tctx.strokeStyle = color;\r\n\t\t\tlastPos = mousePos;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "47f67629ee512775248984601a11ea85", "score": "0.6415673", "text": "_render() {\n this.context.beginPath();\n this.context.rect(this.x, this.y, this.width, this.height);\n this.context.fillStyle = this.color;\n this.context.fill();\n this.context.closePath();\n }", "title": "" }, { "docid": "aec0e7bcf852ed74ca835e1bde80fbca", "score": "0.6399659", "text": "function renderCanvas() {\r\n let meme = getMeme()\r\n gCtx.save()\r\n gCtx.fillStyle = \"white\"\r\n gCtx.fillRect(0, 0, gElCanvas.width, gElCanvas.height)\r\n const img = new Image();\r\n img.src = `imgs/${meme.selectedImgId}.jpg`;\r\n gCtx.drawImage(img, 0, 0, gElCanvas.width, gElCanvas.height)\r\n renderLines();\r\n gCtx.restore()\r\n}", "title": "" }, { "docid": "51978c402ac1047332478840194251a7", "score": "0.63982725", "text": "draw() {}", "title": "" }, { "docid": "51978c402ac1047332478840194251a7", "score": "0.63982725", "text": "draw() {}", "title": "" }, { "docid": "51978c402ac1047332478840194251a7", "score": "0.63982725", "text": "draw() {}", "title": "" }, { "docid": "ecc9717d64ac534a71bc0ec2ec97973b", "score": "0.63935137", "text": "function drawApple(){\n context.fillStyle = apple.color;\n context.fillRect(apple.x + 2, apple.y + 2,36,36);\n}", "title": "" }, { "docid": "59b672f9cc3fec0f983fc5a710758c68", "score": "0.63909817", "text": "draw() {\n this.bubble.draw();\n this.nameText.draw();\n this.moneyText.draw();\n }", "title": "" }, { "docid": "4d362aae59432405013519164662356a", "score": "0.6386299", "text": "draw() {\n // clear the game board\n const ctx = this.ctx;\n ctx.fillStyle = '#000000';\n ctx.fillRect(0, 0, this.width, this.height);\n\n // ask everyone to draw themselves\n this.objects.forEach(o => o.draw && o.draw(this.ctx));\n }", "title": "" }, { "docid": "535c2a805c3075b6847d57457ee5616a", "score": "0.63843316", "text": "draw(){\n ctx.beginPath();\n ctx.arc(this.x, this.y, this.size, 0, Math.PI*2, false);\n ctx.fillStyle = '#2c4b5e';\n ctx.fill();\n }", "title": "" }, { "docid": "6f2a8f8afc98967a012906e81868160c", "score": "0.637819", "text": "draw(ctx) {\n ctx.drawImage(\n this.image,\n this.position.x,\n this.position.y,\n this.width,\n this.height\n );\n }", "title": "" }, { "docid": "a54bddb34d96827906effcc9e72552c0", "score": "0.6368563", "text": "function renderCanvas() {\n\t if (drawing) {\n\t ctx.moveTo(lastPos.x, lastPos.y);\n\t ctx.lineTo(mousePos.x, mousePos.y);\n\t ctx.stroke();\n\t lastPos = mousePos;\n\t }\n\t}", "title": "" }, { "docid": "60ff1c9b9f87de33d31d32cc7977ebbb", "score": "0.635712", "text": "draw() {\n\t\t\tconst radius = this.distance / 2;\n\t\t\tthis.scene.context.drawImage(\n\t\t\t\tthis._rendered,\n\t\t\t\tthis.arcLocation - radius,\n\t\t\t\tthis.y - radius,\n\t\t\t);\n\t\t}", "title": "" }, { "docid": "1339286f8822f5f80230efe18d1b6195", "score": "0.6349325", "text": "draw(){\n this.field.fillStyle = this.color \n this.field.fillRect(this.x, this.y , this.width, this.height);\n\n }", "title": "" }, { "docid": "f27f369cbb587c544e410f4c002bff51", "score": "0.6347339", "text": "function draw() {\r\n}", "title": "" }, { "docid": "5ddbe11b62aafcaf365a11fc133b8c1a", "score": "0.63397515", "text": "function draw(){\n context.clearRect(0, 0, canvas.width, canvas.height);\n boxes.forEach(function(box, i){\n context.fillStyle = box.color;\n context.fillRect(box.x, box.y, box.width, box.height);\n });\n}", "title": "" }, { "docid": "b6ca1b276d66c89b4b520a63668722f5", "score": "0.6335477", "text": "function draw(){\r\n drawCanvas();\r\n user.draw();\r\n drawText();\r\n }", "title": "" }, { "docid": "fcf569ac55d96405d6ae831c144158ed", "score": "0.6331142", "text": "function drawApple(){\n /* TO DO */\n //\n context.drawImage(document.getElementById('apple'),0, 0, 200, 200, apple.x, apple.y, grid, grid);\n}", "title": "" }, { "docid": "82a3763f6382ca5f1459bf4c3f9fba07", "score": "0.63224125", "text": "draw(){\n push();\n // fill(255,125);\n noFill();\n noStroke();\n rect(this.x,this.y,this.width,this.height);\n pop();\n }", "title": "" }, { "docid": "28f05a6709d2c4205cc51795cd9d4748", "score": "0.6317574", "text": "function mouseClicked(){\n // Change Background.\n var randomColor = Math.floor(Math.random()*16777215).toString(16);\n background(\"#\"+randomColor);\n\n // BEGIN Draw items loop.\n if (itemsDrawn < itemstToBeDrawn.length) {\n // Draw new item and all previous items.\n for (let i = -1; i < itemsDrawn; i++) {\n itemstToBeDrawn[i+1]();\n }\n // Increase itemsDrawn by 1 and log itemsDrawn\n itemsDrawn++\n console.log(\"you have drawn \" + itemsDrawn + \" items\");\n\n }else{\n // Draw all items\n for (let i = 0; i < itemsDrawn; i++) {\n itemstToBeDrawn[i]();\n }\n textSize(20);\n textAlign(CENTER, CENTER);\n fill(0);\n text(\"Thanks for drawing my face!\" , 50, 115 , 300, 50);\n // Log process complete.\n console.log(\"Thanks for drawing my face!\")\n }\n\n // End Mouse click actions\n }", "title": "" }, { "docid": "f0c1959be6e4070bef8c21dee22c1d84", "score": "0.63125604", "text": "function renderCanvas() {\n\nif (drawing) { \n ctx.strokeStyle = myColor;\n ctx.lineWidth = myWidth;\n ctx.beginPath(); \n ctx.moveTo(lastPos.x, lastPos.y);\n ctx.lineTo(mousePos.x, mousePos.y);\n ctx.stroke();\n ctx.closePath();\n lastPos = mousePos;\n \n}\n\n}", "title": "" }, { "docid": "3e4c601b1b358b636098a3c681560b6b", "score": "0.63024575", "text": "function draw(){\n\t\tcontext.clearRect(0,0,canvas.width,canvas.height);\n\t\t//Drawing candy \n\t\tcontext.fillStyle=\"red\";\n\t\tcontext.fillRect(candy.x*gridSize,candy.y*gridSize,gridSize,gridSize);\n\t\t//Drawing the snake\n\t\tfor (var i=0;i<player.tail;i++){\n\t\t\tcontext.fillStyle=\"black\";\n\t\t\tcontext.fillRect(snakeBody[i][0]*gridSize,snakeBody[i][1]*gridSize,gridSize,gridSize);\n\t\t}\n\t}", "title": "" }, { "docid": "e7d7a878ab3323c6c18f72573f39e7e3", "score": "0.6294967", "text": "function draw()\n\t{\n\t\tdrawInstructions();\n\t\tdrawQuestion();\n\t\tdrawNumber();\n\t}", "title": "" }, { "docid": "cf4fc60b358999ea0495f0034100b5de", "score": "0.6292175", "text": "function draw(){\n\t\tcontext.clearRect(0,0,canvas.width,canvas.height);\n\t\t//Drawing candy\n\t\tcontext.fillStyle=\"red\";\n\t\tcontext.fillRect(candy.x*gridSize,candy.y*gridSize,gridSize,gridSize);\n\t\t//Drawing the snake\n\t\tfor(var i=0; i<player.tail;i++){\n\t\t\tcontext.fillStyle=\"black\";\n\t\t\tcontext.fillRect(snakeBody[i][0]*gridSize,snakeBody[i][1]*gridSize,gridSize,gridSize);\n\t\t}\n\t}", "title": "" }, { "docid": "03ed75636feb4efddb066953152652e4", "score": "0.6290205", "text": "render(ctx){\n\t\tctx.fillStyle = 'pink';\n\t\tctx.fillRect(\n\t\t\tthis.x, this.y, \n\t\t\tthis.width, this.height\n\t\t\t);\n\t}", "title": "" }, { "docid": "b32982ab59022fc598e71c71f2121ece", "score": "0.628831", "text": "draw(ctx){\n ctx.save();\n ctx.drawImage(this.image, this.x, this.y, this.width, this.height);\n ctx.restore();\n }", "title": "" }, { "docid": "b32982ab59022fc598e71c71f2121ece", "score": "0.628831", "text": "draw(ctx){\n ctx.save();\n ctx.drawImage(this.image, this.x, this.y, this.width, this.height);\n ctx.restore();\n }", "title": "" }, { "docid": "be0ba8f986dfe098b4534e80c8db4be6", "score": "0.628513", "text": "get_draw_item(){ return Draw.new_draw_item( this.mesh, this.material, 4 ); }", "title": "" }, { "docid": "ce5a80482f1a4fc5b2af68e369d6f772", "score": "0.6283247", "text": "async draw(_context, _snake) {\n if (this.eaten === true)\n this.setNewPosition(_snake);\n\n _context.fillStyle = \"#922\";\n _context.fillRect(this.x, this.y, 10, 10);\n }", "title": "" }, { "docid": "5dcb5725e2b5fa22bbe5db325dc75dd5", "score": "0.6279719", "text": "draw() {\n this.update();\n \n push();\n stroke(this.stroke);\n strokeWeight(this.strokeWeight);\n \n if (this._state) {\n \tfill(this.fillOn);\n } else {\n \tfill(this.fillOff);\n }\n\n rectMode(CENTER);\n rect(this.x, this.y, this.width, this.height, this.round);\n\n noStroke();\n textAlign(CENTER, CENTER);\n fill(this.labelColor);\n textSize(this.textSize);\n text(this.label, this.x, this.y);\n pop();\n }", "title": "" }, { "docid": "58e86c9cf7d6e9f1380bcc215a7fbf6d", "score": "0.6275571", "text": "function draw() {\n draw_board(width, height, color)\n draw_square(fruit.position.x, fruit.position.y, fruit.color, fruit.color)\n draw_snake()\n}", "title": "" }, { "docid": "2804cc74b5039a1525417bb0603665d7", "score": "0.62719715", "text": "function draw(){\n cxt.fillStyle=\"#000\";\n cxt.fillRect(0,0,canvas.width,canvas.height);\n drawShapes(arena,{x:0,y:0});\n drawShapes(player.matrix,player.pos);\n}", "title": "" }, { "docid": "cdd5e238336ba6857f3c16004753bdf2", "score": "0.6261126", "text": "draw() {\n this.ctx.clearRect(0, 0, this.game.canvasSizeX, this.game.canvasSizeY);\n this.game.draw(this.ctx);\n this.drawCrosshair();\n this.drawHealthAndEnergy();\n this.drawFloorCounter();\n }", "title": "" }, { "docid": "da41c02c0928a24292041fababcadfd9", "score": "0.6259141", "text": "draw(ctx) {\n const { x, y, height, width, color } = this;\n\n ctx.fillStyle = color;\n ctx.fillRect(x, y, width, height);\n }", "title": "" }, { "docid": "1e378c4c4534920543fd70083508816e", "score": "0.62552387", "text": "draw(img){\n ctx.drawImage(img, this.x, this.y);\n }", "title": "" }, { "docid": "24692e60a37b0a73eddab795f693041b", "score": "0.62538093", "text": "function draw() {\n // Place your drawing code here \n}", "title": "" }, { "docid": "5ff16a576ff0b8f11152c14395cdc498", "score": "0.6249579", "text": "function draw() {\r\n\r\n}", "title": "" } ]
e6ddc89ccbcf161af880b4511519cff7
Zoom in on the sector defined by the brush
[ { "docid": "f089547a18ac0c1bf218549c584d2cc5", "score": "0.59185183", "text": "function zoom() {\n let t = svg.transition().duration(750);\n\n // Update axes, circles, and lines\n svg.select(\".axis--x\")\n .transition(t)\n .call(xAxis);\n g.select(\".axis--y\")\n .transition(t)\n .call(yAxis);\n g.selectAll(\".circles\")\n .transition(t)\n .attr(\"cx\", d => xScale(d[0]))\n .attr(\"cy\", d => yScale(d[1]));\n g.selectAll(\".line\")\n .transition(t)\n .attr(\"d\", d => line(d));\n\n // Update voronoi diagram for focus\n voronoi_diagram = d3.voronoi()\n .x(d => xScale(d[0]))\n .y(d => yScale(d[1]))\n .size([container_width, container_height])(vorData);\n }", "title": "" } ]
[ { "docid": "c5786e5b508cef896918618581dc8e0d", "score": "0.651965", "text": "function zoomIn() {\n\t//decreases the value of the slider and saves the value\n\tif (slider.immediateValue > minScale) { //if slider isnt at the lowest point\n\t\tslider.decrement();\n\t\tcurrentScale = slider.immediateValue;\n\t}\n\tdrawToCanvas(globalJSON);\n}", "title": "" }, { "docid": "bcfb794e00b24ece7ce8600cead122e6", "score": "0.6477619", "text": "function zoomIn(e){\n\t\tvar x = (e.pageX - canvas_offset.left) / draw_data.scale; //determines where zoom is centered\n\t\tvar y = (e.pageY - canvas_offset.top) / draw_data.scale;\n\t\t$('canvas.board').scaleCanvas({\n\t\t\tx: x + leftgap, y: y + topgap,\n\t\t\tscale: 1.25,\n\t\t\tautosave: false\n\t\t});\n\t\trefresh();\n\t\t//gaps between border of visible canvas and actual canvas become larger\n\t\tleftgap += x * 0.2;\n\t\ttopgap += y * 0.2;\n\t\trightgap += ($('canvas.board').width() / draw_data.scale - x) * 0.2;\n\t\tbottomgap += ($('canvas.board').height() / draw_data.scale - y) * 0.2;\n\t\twrite_data.scale = draw_data.scale = draw_data.scale * 1.25;\n\t}", "title": "" }, { "docid": "1069041cc68e3f25b712fe0e15d9eb62", "score": "0.646946", "text": "zoomIn() {\n this.zoomWithScaleFactor(0.5)\n }", "title": "" }, { "docid": "90408feb6b25fc39aecd6cf5de870246", "score": "0.6461455", "text": "panZoom() {\r\n\t\tthis.transformer.unSelect();\r\n\t\tthis.svg.draw(false).panZoom(Sketch.VIEW_ZOOM);\r\n\t\t\r\n\t}", "title": "" }, { "docid": "6cb86ab791c59083c292bd9a98f7fbc6", "score": "0.63939494", "text": "function zoomEntirety() {\r\n zoom(-48722.5, -54872, 44704.8, 10467.3, 1751.8, 1462.8);\r\n}", "title": "" }, { "docid": "1c76e4e3c405af59cd2f8859d1226876", "score": "0.6387545", "text": "function zoom(event){\n var mousex = event.clientX - canvas.offsetLeft;\n var mousey = event.clientY - canvas.offsetTop;\n var wheel = event.wheelDelta/120;//n or -n\n\n ctx.clearRect(0,0,canvas.width,canvas.height);\n\n var zoom = Math.pow(1 + Math.abs(wheel)/8 , wheel > 0 ? 1 : -1);\n\n ctx.translate(originx,originy );\n\n ctx.imageSmoothingEnabled = 0;\n ctx.scale(zoom,zoom);\n\n ctx.translate(\n -( mousex / scale + originx - mousex / ( scale * zoom ) ),\n -( mousey / scale + originy - mousey / ( scale * zoom ) )\n );\n\n // Update the origin\n originx = ( mousex / scale + originx - mousex / ( scale * zoom ) );\n originy = ( mousey / scale + originy - mousey / ( scale * zoom ) );\n scale *= zoom;\n\n drawMainStage(img,ctx);\n\n $('#mouseInfo').html(\"ZOOM=\"+Math.round((canvas.width/img.width)*scale*100)\n + \"% MX=\"+mousex\n +\" MY=\"+mousey\n +\" CanvasOffset(\"+canvas.offsetLeft+\",\"+canvas.offsetTop+\")\");\n\n}", "title": "" }, { "docid": "649f51c186ce938d5d4f7077ec0f8257", "score": "0.6258064", "text": "function zoom()\n{\n\n\t// find final selection indices\n\tvar extent = d3.event.target.extent();\n\n\t// look for points that were selected\n\tvar selection = get_brush_sel(extent);\n\n // was it an empty zoom?\n if (selection.length > 0) {\n\n // user did zoom in on something, so reset window\n x_scale.domain([extent[0][0], extent[1][0]]);\n y_scale.domain([extent[0][1], extent[1][1]]);\n\n // change button color to indicate zoom state\n $(\"#dac-scatter-button-zoom\").addClass(\"text-warning\");\n\n // fire zoom changed event\n var zoomEvent = new CustomEvent(\"DACZoomChanged\",\n {detail: {extent: extent, zoom: true}});\n document.body.dispatchEvent(zoomEvent);\n\n } else {\n\n // reset scale\n module.reset_zoom();\n\n }\n\n // remove gray selection box\n d3.event.target.clear();\n d3.select(this).call(d3.event.target);\n\n // re-draw display (animate if small number of points)\n if (mds_coords.length > max_points_animate) {\n module.draw();\n } else {\n animate();\n };\n\n}", "title": "" }, { "docid": "30fe42b2a2ca29cc5aa99af456d50ae0", "score": "0.6216183", "text": "function zoom() {\n mapXY.translate(d3.event.translate)\n .scale(d3.event.scale);\n pathsLayer.selectAll(\"path\")\n .attr(\"d\", path);\n }", "title": "" }, { "docid": "234b074a5b86e0e583fb50b40435c869", "score": "0.618608", "text": "setZoom(zoom) {\n if (this.zoom === zoom)\n return;\n if (this.maxZoom < zoom * P.config.scale) {\n this.maxZoom = zoom * P.config.scale;\n const canvas = document.createElement('canvas');\n canvas.width = this.penCanvas.width;\n canvas.height = this.penCanvas.height;\n canvas.getContext('2d').drawImage(this.penCanvas, 0, 0);\n this.penRenderer.reset(this.maxZoom);\n this.penRenderer.ctx.drawImage(canvas, 0, 0, 480 * zoom * P.config.scale, 360 * zoom * P.config.scale);\n this.penRenderer.ctx.lineCap = 'round';\n }\n this.root.style.width =\n this.canvas.style.width =\n this.backdropCanvas.style.width =\n this.penCanvas.style.width =\n this.ui.style.width = (480 * zoom | 0) + 'px';\n this.root.style.height =\n this.canvas.style.height =\n this.backdropCanvas.style.height =\n this.penCanvas.style.height =\n this.ui.style.height = (360 * zoom | 0) + 'px';\n this.root.style.fontSize = (zoom * 10) + 'px';\n this.zoom = zoom;\n this.updateBackdrop();\n }", "title": "" }, { "docid": "ff07b28b9f272dd563476b15e2a22371", "score": "0.61561495", "text": "function zoomIn(point) {\n\t\tif (zoomLevel < zoomLevelMax) {\n\t\t\tzoomLevel++;\n\t\t\tcanvas.zoomToPoint(point, Math.pow(1.5, zoomLevel));\n\t\t\tconsole.log(\"Clem sets his vision to \"+zoomLevel+\", and has a target: \",point);\n\t\t}\n\t}", "title": "" }, { "docid": "a1930c8816c483bc731d44bc8f1d5d1e", "score": "0.6138301", "text": "function wheel() {\n scale = d3.event.transform.k;\n stereographic.scale( scale * width );\n //stereographic.clipAngle( scale * 179.0 );\n starmap();\n }", "title": "" }, { "docid": "f42a7fdf476d95cf14a97dc3679f7fd7", "score": "0.612735", "text": "zoomIn() {\n this.__img.zoomIn();\n }", "title": "" }, { "docid": "56a783b3da200dc34ee2c91a92d5684a", "score": "0.6119788", "text": "zoomIn() {\n this.zoomTo(this.zoom / Camera.ZOOM_FACTOR);\n }", "title": "" }, { "docid": "e401364aceea2847e53939770e40a84a", "score": "0.6107119", "text": "function zoomIn(factor, x, y) {\n var scale = this.container.stage.transform.scale;\n var position = this.container.stage.transform.position;\n var oldScale = scale.x;\n scale.x *= factor;\n scale.y *= factor;\n position.x -= (x - position.x) * Math.abs(scale.x / oldScale - 1);\n position.y -= (y - position.y) * Math.abs(scale.x / oldScale - 1);\n }", "title": "" }, { "docid": "7903be34b45085a80221f8ea3f5e4004", "score": "0.6047078", "text": "function zoom() {\n d3.select(this).attr(\"transform\", d3.event.transform);\n\n var dots = pitchVis.selectAll(\".dot\");\n dots.attr(\"r\", function() {\n idealRadius = (convertDimension(3.6) / d3.event.transform.k) + convertDimension(0.25)\n return idealRadius;\n });\n }", "title": "" }, { "docid": "c8a94dcff1adc5a517813230486fdc7f", "score": "0.60387987", "text": "performZoom(mousePoint, delta) {\n const fraction = this.growFactor * delta;\n if ([EXyDirection.XDirection, EXyDirection.XyDirection].includes(this.xyDirection)) {\n this.parentSurface.xAxes.asArray().forEach(axis => {\n this.growBy(mousePoint, axis, fraction);\n });\n }\n if ([EXyDirection.YDirection, EXyDirection.XyDirection].includes(this.xyDirection)) {\n this.parentSurface.yAxes.asArray().forEach(axis => {\n this.growBy(mousePoint, axis, fraction);\n });\n }\n }", "title": "" }, { "docid": "e78e025cd6e3871dda2f08e24b4b8aa3", "score": "0.602079", "text": "function zoom(event){\n\t\t\t\tif (event.wheelDelta >=120){\n\t\t\t\t\tmesh.scale.x +=0.05;\n\t\t\t\t\tmesh.scale.y +=0.05;\n\t\t\t\t\tmesh.scale.z +=0.05;\n\t\t\t\t}\n\t\t\t\telse if(event.wheelDelta <=-120){\n\t\t\t\t\tmesh.scale.x -=0.05;\n\t\t\t\t\tmesh.scale.y -=0.05;\n\t\t\t\t\tmesh.scale.z -=0.05\t;\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}", "title": "" }, { "docid": "d028bf140e4972403c17c90180b2be5a", "score": "0.60203785", "text": "function zoomed() {\n features.attr(\"transform\", \"translate(\" + zoom.translate() + \")scale(\" + zoom.scale() + \")\")\n .selectAll(\"path\").style(\"stroke-width\", 1 / zoom.scale() + \"px\" );\n}", "title": "" }, { "docid": "49d360798b39be46324438439370b062", "score": "0.60185724", "text": "onZoom() {\n this.prjFnc.scale(d3.event.scale);\n let mouse1 = d3.mouse(this.group[0][0]);\n let between = this.rotateBetween(this.zoomPoint, this.position(this.prjFnc, mouse1));\n this.prjFnc.rotate(this.eulerFromQuaternion(this.rotate = between\n ? this.multiply(this.rotate, between)\n : this.multiply(this.bank(this.prjFnc, this.mouse0, mouse1), this.rotate)));\n this.mouse0 = mouse1;\n this.redraw();\n }", "title": "" }, { "docid": "90577091e0fd98176dbf55df6dad7ccc", "score": "0.5984098", "text": "function brushcenter_cdp() {\n var target_cdp = d3.event.target,\n extent_cdp = brush_cdp.extent(),\n size_cdp = extent_cdp[1] - extent_cdp[0],\n range_cdp = mini_yScale_cdp.range(),\n y0_cdp = d3.min(range_cdp) + size_cdp / 2,\n y1_cdp = d3.max(range_cdp) + mini_yScale_cdp.rangeBand() - size_cdp / 2,\n center_cdp = Math.max( y0_cdp, Math.min( y1_cdp, d3.mouse(target_cdp)[1] ) );\n \n d3.event.stopPropagation();\n \n gBrush_cdp\n .call(brush_cdp.extent([center_cdp - size_cdp / 2, center_cdp + size_cdp / 2]))\n .call(brush_cdp.event);\n \n }//brushcenter", "title": "" }, { "docid": "bed2e940ac7cdec2dd7303de2362bef8", "score": "0.5974195", "text": "function brushcenter() {\n var target = d3.event.target,\n extent = brush.extent(),\n size = extent[1] - extent[0],\n range = mini_yScale.range(),\n y0 = d3.min(range) + size / 2,\n y1 = d3.max(range) + mini_yScale.rangeBand() - size / 2,\n center = Math.max( y0, Math.min( y1, d3.mouse(target)[1] ) );\n \n d3.event.stopPropagation();\n \n gBrush\n .call(brush.extent([center - size / 2, center + size / 2]))\n .call(brush.event);\n \n }//brushcenter", "title": "" }, { "docid": "4f2fbf9ea45b3237db6aa54efe417692", "score": "0.59543896", "text": "zoomed() {\n this.prjFnc.scale(this.zoom.scale());\n this.redraw();\n }", "title": "" }, { "docid": "4bafd6f21558efad6686290ca27d2eea", "score": "0.5946022", "text": "function fitzoom(){\n var wGroup = new paper.Group();\n //listing drawed paths\n for(var i = 0; i < window.thisPage().drawed.length; i++)\n {\n var thisPath = window.thisPage().drawed[i];\n wGroup.addChild(thisPath);\n }\n //listing loaded paths\n for(var i = 0; i < window.thisPage().loaded.length; i++)\n {\n var thisPath = window.thisPage().loaded[i];\n wGroup.addChild(thisPath);\n }\n //listing loaded paths\n for(var i = 0; i < window.thisPage().ofMaster.length; i++)\n {\n var thisPath = window.thisPage().ofMaster[i];\n wGroup.addChild(thisPath);\n }\n //now that we have added all paths in view...\n //paper.view.setCenter(wGroup.bounds.center);\n //paper.view.setZoom(Math.min(paper.view.zoom,Math.min((paper.view.bounds.width/wGroup.bounds.width),(paper.view.bounds.height/wGroup.bounds.height))));\n //saving the new center and the new zoom factor into global variables\n window.scalePoint = wGroup.bounds.center.subtract(paper.view.center);\n window.scaleFactor = Math.min((paper.view.bounds.width/wGroup.bounds.width),(paper.view.bounds.height/wGroup.bounds.height));\n saveTransform();\n}", "title": "" }, { "docid": "7aff776f7817e1c19e297d7b75b88123", "score": "0.59368795", "text": "function setZoom(factor)\r\n{\r\n\t// Store for use by the Area function\r\n\tzoom = factor;\r\n}", "title": "" }, { "docid": "4d8392ba05a95fb261b4f6cb22d84575", "score": "0.593384", "text": "function zoomIn_onclick() {\n navToolbar.activate(esri.toolbars.Navigation.ZOOM_IN);\n map.enableScrollWheelZoom();\n \n}", "title": "" }, { "docid": "77d98d80874eb2254d19bfd6b019be59", "score": "0.593261", "text": "function Zoom(inOut){\n\tvar z = WebAnnotationViewer1.getZoom();\n\tvar zp = WebAnnotationViewer1.getZoomInOutPercentage();\n\t\n\tz += inOut * z * zp / 100;\n\t\n\tWebAnnotationViewer1.setZoom(z);\n}", "title": "" }, { "docid": "ca37b4242bc3e7bf747b48c16e5d4f54", "score": "0.5927554", "text": "function zoom(d) {\n totalSize = parseInt(d.size); // the new size of the middle piece\n console.log(totalSize);\n // zoom in and see new subsection of graph\n path.transition()\n .duration(750)\n .attrTween(\"d\", arcTween(d))\n .each(\"end\", function (e, i) {\n if (e.x >= d.x && e.x < (d.x + d.dx)) {\n const arcText = d3.select(this.parentNode).select(\"text\");\n arcText.transition().duration(750)\n .attr(\"transform\", function (d) {\n return \"translate(\" + arc.centroid(d) + \")\";\n })\n .attr(\"opacity\", 1)\n }\n });\n // update the tooltip to show percentage of total and percentage of subsection selected\n path.on(\"mouseover\", function (d) {\n div.transition()\n .duration(200)\n .style(\"opacity\", .9);\n div.html(d.name + \"<br/> Size: \" + d.size + \"<br/> Percentage of Total: \" + formatNum((d.size / 891)) + \"<br/> Percentage of Subsection: \" + formatNum((d.size / totalSize)))\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\n })\n .on(\"mouseout\", function (d) {\n div.transition()\n .duration(500)\n .style(\"opacity\", 0);\n })\n }", "title": "" }, { "docid": "b4df48d8df3e6fa054c8776ade710c69", "score": "0.5924822", "text": "function onZoomIn() {\n\n hideContextMenu();\n\n\tvar fPImg = document.getElementById(\"floorPlanImg\"); \n\t\n\t// Set new zoom level\n\tuiState.setZoomLevel(uiState.getZoomLevel() * ZOOMSTEPIN);\n\t\n\t// calculate and update image width with the new zoom level\n\tfPImg.style.width = coordConv.floorToDisp(0, fPImg.naturalWidth, uiState.getZoomLevel()) + \"px\"; \n\n\t// caculate and update POIs locations on screen\n\tupdatePOIsLocationsOnScreen(); \n\t\n}", "title": "" }, { "docid": "023d60aa4aab1b3e32a8bd2dd7df9419", "score": "0.5894577", "text": "function brushmove() {\n if (SHIFTKEY) {\n svg = svg.call(d3.behavior.zoom().on(\"zoom\", null));\n var e = brush.extent();\n console.log(e);\n var deps = svg.selectAll(\".node\").filter(function(d) {\n return e[0][0] < d.scatterplot[1] && d.scatterplot[1] < e[1][0]\n && e[0][1] < d.scatterplot[0] && d.scatterplot[0] < e[1][1];\n }).data();\n chart.selectDeputiesBySearch(deps);\n }\n else {\n d3.event.target.clear();\n d3.select(this).call(d3.event.target);\n }\n }", "title": "" }, { "docid": "5dafc496932cee4982641d47c637116f", "score": "0.58944863", "text": "function brush() {\n brush_count++;\n var actives = dimensions.filter(function(p) { return !y[p].brush.empty(); }),\n extents = actives.map(function(p) { return y[p].brush.extent(); });\n\n // Get lines within extents\n var selected = [];\n\t// Koppla till worldMap\n\t\n data.map(function(d) {\n return actives.every(function(p, i) {\n var p_new = (y[p].ticks)?d[p]:y[p](d[p]); //convert to pixel range if ordinal\n return extents[i][0] <= p_new && p_new <= extents[i][1];\n }) ? selected.push(d) : null;\n });\n\n // Render selected lines\n foreground.clearRect(0,0,w+1,h+1);\n paths(selected, foreground, brush_count);\n\tdraw(topo, selected);\n }", "title": "" }, { "docid": "40369c8df0a489bfe24395ae550430e0", "score": "0.5886069", "text": "function zoomed() {\n x = d3.event.transform.rescaleX(x2); //3\n xAxis.scale(x); //4\n axisG.call(d3.axisBottom(x)); //5\n tracerCourbe(selectedChromosome,data,lineGen,svg,ancestorsNameColor); //6 à chaque zoom on redessine nos courbes.\n }", "title": "" }, { "docid": "b28a54fd0aeb420914674ccd613e36c0", "score": "0.58798075", "text": "function zoom() {\n svg.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "6efc002734ce9fdd41627afb6c8ccd22", "score": "0.58708483", "text": "function zoom() {\n svg.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "c984210855ed5305dea7d0df0e4cad94", "score": "0.5850416", "text": "function zoom() {\n\tproj.translate(d3.event.translate).scale(d3.event.scale);\n\tsvg.selectAll(\"path\").attr(\"d\", path);\n\tcircles\n \t\t.attr(\"cx\", function(d){return proj([d.longitude, d.latitude])[0];})\n\t\t.attr(\"cy\", function(d){return proj([d.longitude, d.latitude])[1];});\n}", "title": "" }, { "docid": "aa2b6a77da13addc90485d8c69b47b65", "score": "0.5836675", "text": "function zoom(key) {\r\n var scale = myDiagram.scale;\r\n if (scale <0.13){\r\n scale = 0.18;\r\n }\r\n myDiagram.scale = scale;\r\n var nodePosition = myDiagram.model.findNodeDataForKey(key).loc.split(' ');\r\n var windowSize = {height:$('#myDiagramDiv').height() ,width: $('#myDiagramDiv').width()};\r\n myDiagram.position = new go.Point(Math.floor(nodePosition[0] - (windowSize.width/2/scale)),Math.floor(nodePosition[1] - (windowSize.height/2/scale)));\r\n }", "title": "" }, { "docid": "1a4296ba3a627d939a6d712db40c199e", "score": "0.5832852", "text": "function zoomed() {\n svgContainer.attr(\"transform\", \"translate(\" + zoom.translate() + \")\" + \"scale(\" + zoom.scale() + \")\");\n}", "title": "" }, { "docid": "5b4816eb2592bd60c72b653f2325eb14", "score": "0.58311117", "text": "function clicked(d){\n\n var x, y;\n var boundary = d3.select('.subunit-boundary');\n var center = getBoundingBoxCenter(boundary);\n\n if (d && centered !== d) {\n var centroid = path.centroid(d);\n x = centroid[0];\n y = centroid[1];\n z = 3;\n centered = d;\n $('.zoom.out').removeClass('inactive');\n } else {\n x = center[0];\n y = center[1];\n z = 1;\n centered = null;\n $('.zoom.out').addClass('inactive');\n }\n\n g.selectAll(\"path\")\n .classed(\"active\", centered && function(d) { return d === centered; });\n\n g.transition()\n .duration(750)\n .attr(\"transform\", \"translate(\" + width / 2 + \",\" + height / 2 + \")scale(\" + z + \")translate(\" + -x + \",\" + -y + \")\")\n .style(\"stroke-width\", 1 / z + \"px\");\n\n $(\".control.zoom\").addClass(z == 1 ? \"inactive\" : \"active\").removeClass(z == 1 ? \"active\" : \"inactive\");\n if (z != 1){\n d3.select(\".control.zoom\")\n .on(\"click\", clicked);\n }\n\n}", "title": "" }, { "docid": "da9572b00d7b8d5d38d7207cc1081492", "score": "0.58296", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "b3a06789b4f90faa4e233104130fa350", "score": "0.5820997", "text": "function brushcenter() {\n let target = d3.event.target,\n extent = brush.extent(),\n size = extent[1] - extent[0],\n range = mini_yScale.range(),\n y0 = d3.min(range) + size / 2,\n y1 = d3.max(range) + mini_yScale.rangeBand() - size / 2,\n center = Math.max( y0, Math.min( y1, d3.mouse(target)[1] ) );\n\n d3.event.stopPropagation();\n\n gBrush\n .call(brush.extent([center - size / 2, center + size / 2]))\n .call(brush.event);\n\n }//brushcenter", "title": "" }, { "docid": "bf90d098d1a846e80f3233ca7a16d484", "score": "0.5813674", "text": "function mouseZoom(canvas) {\n canvas.on(\"mouse:wheel\", function(opt) {\n let delta;\n delta = opt.e.deltaY;\n zoom = canvas.getZoom();\n zoom *= Math.pow(0.999, delta);\n if (zoom > 4) {\n zoom = 4;\n }\n if (zoom < 0.2) {\n zoom = 0.2;\n }\n canvas.setZoom(zoom);\n opt.e.preventDefault();\n opt.e.stopPropagation();\n });\n}", "title": "" }, { "docid": "c043b15acf66f9ec9753978a4cdd9bf9", "score": "0.579852", "text": "function doZoom() {\n mapFeatures.attr(\"transform\",\n \"translate(\" + d3.event.translate + \") scale(\" + d3.event.scale + \")\")\n // Keep the stroke width proportional. The initial stroke width\n // (0.5) must match the one set in the CSS.\n .style(\"stroke-width\", 0.5 / d3.event.scale + \"px\");\n}", "title": "" }, { "docid": "7974a53115a097ded655ec58ed5aba12", "score": "0.5798341", "text": "function zoom(e) {\n e.preventDefault();\n\n if (e.ctrlKey) {\n scale -= e.deltaY * 0.01;\n // console.log(e.deltaY);\n\n scale = Math.max(MIN_SCALE, scale);\n scale = Math.min(MAX_SCALE, scale);\n } else {\n posX -= e.deltaX * 2;\n posY -= e.deltaY * 2;\n }\n\n render();\n }", "title": "" }, { "docid": "b92039f9c94cee5f2cfdbf26ebdc4086", "score": "0.5793717", "text": "zoom(delta, scr_point_arg) {\n const cam = this.camera;\n if (delta < 1 && cam.isZoomLimit()) {\n this.engine.notify('zoom.limit');\n return;\n }\n // zoom @ center of screen by default\n const scr_point = scr_point_arg || cam.screenSize.times(0.5);\n const cpx_point = cam.scr2cpx(scr_point);\n log.info('zoom', delta, scr_point, cpx_point);\n const cpx_center = cam.getPos();\n // complex vector from point to view center\n const cpx_vector = cpx_center.minus(cpx_point);\n // scale vector and compute new center\n const cpx_new_point = cpx_point.plus(cpx_vector.times(delta));\n cam.setPos(cpx_new_point, cam.w * delta);\n this.engine.draw();\n }", "title": "" }, { "docid": "a81ac0393e120ae7a6b64ddedb99cee2", "score": "0.5793531", "text": "zoomIn() {\r\n this._timenav.zoomIn();\r\n }", "title": "" }, { "docid": "d62970b0b2b1669dc3ddd12fccf51c00", "score": "0.5793223", "text": "function zoom() {\n\n set_zoom_hint(false); // hint how to zoom back out\n\n var t = scatter.transition().duration(750);\n chart_graph.select(\"#axis--x\").transition(t).call(chart_xAxis);\n chart_graph.select(\"#axis--y\").transition(t).call(chart_yAxis);\n chart_graph.selectAll('.dot').transition(t)\n .attr(\"r\", CHART_DOT_RADIUS)\n .attr(\"cx\", chart_xMap)\n .attr(\"cy\", chart_yMap);\n\n //add interactivity for all data points (copied from below)\n d3.selectAll('.dot')\n .style('opacity', function (d) {\n //if out of the boundaing box, make the circle invisible\n if ((chart_xMap(d) < 0 || chart_xMap(d) > chart_width) || (chart_yMap(d) < 0 || chart_yMap(d) > chart_height)) {\n return 0;\n } else return 1;\n })\n .on(\"click\", function (d) {\n show_reading_popup(d);\n })\n .on(\"mouseover\", function (d) {\n mouseover_interactions(d, feature);\n })\n .on(\"mouseout\", function (d) {\n chart_tooltip_el.transition()\n .duration(500)\n .style(\"opacity\", 0);\n });\n }", "title": "" }, { "docid": "87f683f39b4c295da2d6e6b0fcfb66e5", "score": "0.579105", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate\n + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "3368f7469ed3bdd404eaec5ef4345838", "score": "0.5773847", "text": "function zoom_and_move(d) {\n var x, y, k;\n if (d && heatmap_svg_centered !== d) {\n var centroid = heatmap_path.centroid(d);\n x = centroid[0];\n y = centroid[1];\n k = 4;\n heatmap_svg_centered = d;\n } else {\n x = heatmap_svg_width / 2;\n y = heatmap_svg_height / 2;\n k = 1;\n heatmap_svg_centered = null;\n }\n heatmap_g.selectAll(\"path\").classed(\"active\", heatmap_svg_centered && function(d) { return d === heatmap_svg_centered; });\n heatmap_g.transition()\n .duration(750)\n .attr(\"transform\", \"translate(\" + heatmap_svg_width / 2 + \",\" + heatmap_svg_height / 2 + \")scale(\" + k + \")translate(\" + -x + \",\" + -y + \")\")\n .style(\"stroke-width\", 1.5 / k + \"px\");\n }", "title": "" }, { "docid": "eb1b14b1e9fab7c5c7a9485b26cda73b", "score": "0.5768417", "text": "function zoomToBox(xmin,xmax,ymin,ymax){\n\tvar xmid=(xmin+xmax)/2;\n\tvar ymid=(ymin+ymax)/2;\n\tvar x=(xmid+400)/grChipSize*600;\n\tvar y=600-ymid/grChipSize*600;\n\tvar zoom=5; // pending a more careful calculation\n\tmoveHere([x,y,zoom]);\n}", "title": "" }, { "docid": "567a5e5b14e37c8ef530c4cb1dcdb667", "score": "0.5762904", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "fc067764b55923cc082ec82958db550d", "score": "0.5760091", "text": "function zoomIn() {\n var newStart = viewRegStart + Math.floor((viewRegEnd-viewRegStart)/4);\n var newEnd = viewRegEnd - Math.floor((viewRegEnd-viewRegStart)/4);\n render(viewRefName, newStart, newEnd);\n}", "title": "" }, { "docid": "788b4d2e79a96fdd9e1b58a394771c2e", "score": "0.57483214", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "c7495f225dcb78668c066dabec96a8b4", "score": "0.5745306", "text": "function pinchZoomIn(zoomFactor) {\n\n hideContextMenu();\n\n\tvar fPImg = document.getElementById(\"floorPlanImg\"); \n\t\n\t// Set new zoom level\n\tuiState.setZoomLevel(uiState.getZoomLevel() * zoomFactor);\n\t\n\t// Calculate and update image width with the new zoom level\n\tfPImg.style.width = coordConv.floorToDisp(0, fPImg.naturalWidth, uiState.getZoomLevel()) + \"px\"; \n\n\t// Calculate and update POI locations on screen\n\tupdatePOIsLocationsOnScreen(); \n\t\n}", "title": "" }, { "docid": "9e1fe8b2bc72f98287396333e37bf077", "score": "0.57349914", "text": "onZoomStart() {\n this.mouse0 = d3.mouse(this.group[0][0]);\n this.rotate = this.quaternionFromEuler(this.prjFnc.rotate());\n this.point = this.position(this.prjFnc, this.mouse0);\n if(this.point) { this.zoomPoint = this.point; }\n }", "title": "" }, { "docid": "9f612706c2be83eeb336c535d5ecb5b7", "score": "0.57301754", "text": "function zoomBy(zoomAmount){\n var oldViewBoxWidth = viewBox.width;\n var oldViewBoxHeight = viewBox.height;\n\n // algorithm to zoom in and gravitate towards center\n viewBox.width = viewBox.width * zoomAmount;\n viewBox.height = viewBox.height * zoomAmount;\n var midX = oldViewBoxWidth / 2 + viewBox.x;\n var midY = oldViewBoxHeight / 2 + viewBox.y;\n\n // these should always turn out positive, because client cursor must be within svg x to x+width and y to y+height\n var fracOfSVGX = (midX - viewBox.x) / oldViewBoxWidth;\n var fracOfSVGY = (midY - viewBox.y) / oldViewBoxHeight;\n var leftWidth = fracOfSVGX * viewBox.width; // offset to new x\n var upperHeight = fracOfSVGY * viewBox.height; // offset to new y\n viewBox.x = midX - leftWidth;\n viewBox.y = midY - upperHeight;\n setViewBox();\n}", "title": "" }, { "docid": "95e60abbe736837247193b34cfe372ba", "score": "0.5719723", "text": "function zoomToPoint( point ) {\n if ( point == null ) {\n return;\n }\n var left = parseFloat(mapDiv.style.left);\n var top = parseFloat(mapDiv.style.top);\n var midLeft = point.x -left;\n var midTop = point.y - top;\n midLeft /= cssScale;\n midTop /= cssScale;\n if ( point.action == -1 && cssScale <= defaultMinScale ) {\n return;\n }\n if ( point.action == 1 && cssScale >= defaultMaxScale ) {\n return;\n }\n if ( point.action == 1 ) {\n cssScale += defaultZoomScale;\n } else {\n cssScale -= defaultZoomScale;\n }\n\n midLeft *= cssScale;\n midTop *= cssScale;\n \n offsetX = point.x - midLeft;\n offsetY = point.y - midTop;\n \n move();\n \n //scale=cssScale; \n \n mapDiv.style.transform = \"scale(\"+cssScale+\")\";\n mapDiv.style.mozTransform = \"scale(\"+cssScale+\")\";\n mapDiv.style.webkitTransform = \"scale(\"+cssScale+\")\";\n mapDiv.style.oTransform = \"scale(\"+cssScale+\")\";\n \n //mapDiv.style.transformOrigin=point.mid_x +\" \"+point.mid_y;\n //draw();\n \n }", "title": "" }, { "docid": "72122330632654b83c795ff36b9cd865", "score": "0.5715333", "text": "function zoom(root, p) {\n if (document.documentElement.__transition__) {\n return;\n }\n\n // Stash the original root dimensions for transitions.\n var angle1 = d3.scale.linear()\n .domain([0, 2 * Math.PI])\n .range([root.x, root.x + root.dx]);\n\n function insideArc(d) {\n return p.key > d.key ? {depth: d.depth - 1, x: 0, dx: 0} : p.key < d.key ? {depth: d.depth - 1, x: 2 * Math.PI, dx: 0} : {depth: 0, x: 0, dx: 2 * Math.PI};\n }\n\n function outsideArc(d) {\n return {depth: d.depth + 1, x: angle1(d.x), dx: angle1(d.x + d.dx) - angle1(d.x)};\n }\n\n // When zooming in, arcs enter from the outside and exit to the inside.\n // When zooming out, arcs enter from the inside and exit to the outside.\n var enterArc = root === p ? outsideArc : insideArc,\n exitArc = root === p ? insideArc : outsideArc;\n\n center.datum(root);\n\n d3.transition().duration(750).each(function() {\n path = path.data(partition.nodes(root).slice(1), function(d) { return d.key; });\n\n path.transition()\n .attrTween(\"d\", function(d) { return arcTween.call(this, updateArc(d)); });\n\n path.enter().append(\"path\")\n .style(\"fill-opacity\", 0)\n .style(\"fill\", function(d) { return d.fill; })\n .on(\"click\", zoomIn)\n .each(function(d) { this._current = enterArc(d); })\n .transition()\n .style(\"fill-opacity\", 1)\n .attrTween(\"d\", function(d) { return arcTween.call(this, updateArc(d)); });\n\n path.exit().transition()\n .style(\"fill-opacity\", 0)\n .attrTween(\"d\", function(d) { return arcTween.call(this, exitArc(d)); })\n .remove();\n });\n }", "title": "" }, { "docid": "4b7f02a1af40f7bdf1d352aaf083fff9", "score": "0.570803", "text": "function zoom() {\n svgGroup.attr( \"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\" );\n }", "title": "" }, { "docid": "f6a16379e359e91b220eff9ca781e139", "score": "0.5705901", "text": "function zoomMouseMove(evt) {\n if(zoomAction) {\n var p = svgDocElement.createSVGPoint();\n p.x = evt.clientX;\n p.y = evt.clientY;\n\n var m = zoomRectangle.getScreenCTM();\n p = p.matrixTransform(m.inverse());\n\n zoomX2 = p.x;\n zoomY2 = p.y;\n zoomWidth = Math.abs(zoomX2 - zoomX1);\n zoomHeight = Math.abs(zoomY2 - zoomY1);\n\n // set top left corner point of zoom rectangle\n zoomX1 < zoomX2 ? zoomRectangle.setAttribute(\"x\", zoomX1) : zoomRectangle.setAttribute(\"x\", zoomX2);\n zoomY1 < zoomY2 ? zoomRectangle.setAttribute(\"y\", zoomY1) : zoomRectangle.setAttribute(\"y\", zoomY2);\n\n zoomRectangle.setAttribute(\"width\", zoomWidth);\n zoomRectangle.setAttribute(\"height\", zoomHeight);\n }\n}", "title": "" }, { "docid": "777ad613254163629b55c0b14025bb44", "score": "0.57012653", "text": "function markLocation() {\n curX = width/2 + changeX;\n curY = height/2 + changeY;\n}", "title": "" }, { "docid": "2018914f806a1746687aeeb8248d5d50", "score": "0.5691099", "text": "function zoomed(){\n context.save();\n context.clearRect(0, 0, width, height);\n context.translate(d3.event.transform.x, d3.event.transform.y);\n context.scale(d3.event.transform.k, d3.event.transform.k);\n k = d3.event.transform.k;\n drawLabels(k);\n context.restore();\n}", "title": "" }, { "docid": "3f3617a534fb8bc53c856f466a20cd80", "score": "0.56876004", "text": "function zoomTo(e) {\n map.fitBounds(e.layer.getBounds());\n}", "title": "" }, { "docid": "2c074e35b48f11c18b2d64196ac21a3d", "score": "0.5681052", "text": "function zoomIn(){\n map.setZoom(map.getZoom()+1);\n}", "title": "" }, { "docid": "87377bb3c09c4edd8ca3420d8f658805", "score": "0.5671184", "text": "function selectBox() {\r\t\r\t//alert('minX:'+minX+', minY:'+minY);\r\t//map size is 360px by 720px\r\t\r\t// zoom of 1 is the global view - 180x360\r\tif (zoom==1) {\r\t\t// 2 pixels represents 1 degree\t\t\r\t\tvar lon = - 180 + Math.floor(minX/2) ;\r\t\tvar lat = 90 - Math.floor(minY/2) - 10;\r\t\tzoom2level5(lon, lat);\r\t}\r\r\t// zoom of 2 is a quadrant of the global view - 90x180\r\tif (zoom==2) {\r\t\t// 4 pixels represents 1 degree\r\t\tvar lon = minMapLong + Math.floor(minX/4);\r\t\tvar lat = maxMapLat - Math.floor(minY/4) - 10;\r\t\tzoom2level5(lon, lat);\r\t}\r\t\r\t// zoom of 3 is an area of 40x80\r\tif (zoom==3) {\r\t\t// 9 pixels represents 1 degree\r\t\tvar lon = minMapLong + Math.floor(minX/9);\r\t\tvar lat = maxMapLat - Math.floor(minY/9) - 10;\r\t\tzoom2level5(lon, lat);\r\t}\t\r\t\r\t// zoom of 4 is an area of 20x40\r\tif (zoom==4) {\r\t\t// 18 pixels represents 1 degree\r\t\tvar lon = minMapLong + Math.floor(minX/18);\r\t\tvar lat = maxMapLat - Math.floor(minY/18) - 10;\r\t\tzoom2level5(lon, lat);\r\t}\t\r\r\t// zoom of 5 is an area of 10x20\r\tif (zoom==5) {\r\t\t// 36 pixels represents 1 degree\r\t\tvar lat = maxMapLat - (minY/36) - 1;\r\t\tvar lon = minMapLong + (minX/36);\r\t\trefocus(zoom+1, lon, lat, lon+2, lat+1);\r\t}\r}", "title": "" }, { "docid": "c50c971ed7f613b04f80b3b7a9336b25", "score": "0.56711334", "text": "function zoomIn () {\n if (!status.disableZoomIn) {\n\n var povChange = mapService.getPovChangeStatus();\n var pov = mapService.getPov();\n\n setZoom(pov.zoom + 1);\n povChange[\"status\"] = true;\n canvas.clear().render();\n $(document).trigger('ZoomIn');\n return this;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "700cdc2e551504e6fdaffc79056a7fbc", "score": "0.5653884", "text": "function centerZoom(data){\n\n var o = topojson.mesh(data, data.objects.outline, function(a, b) { return a === b; });\n\n projection\n .scale(1)\n .translate([0, 0]);\n\n var b = path.bounds(o),\n s = 1 / Math.max((b[1][0] - b[0][0]) / width, (b[1][1] - b[0][1]) / height),\n t = [(width - s * (b[1][0] + b[0][0])) / 2, (height - s * (b[1][1] + b[0][1])) / 2];\n\n projection\n .scale(s)\n .translate(t);\n\n return o;\n}", "title": "" }, { "docid": "4763a24dedf1b52dde157266dcda21f9", "score": "0.56461984", "text": "function kaZoomer_draw()\n{\n //get scale info for the current map.\n var oMap = this.kaMap.getCurrentMap();\n \n var nScales = oMap.getScales().length;\n var nCurrentScale = oMap.currentScale;\n var nTrackHeight = this.nZoomImageHeight * nScales;\n var nTrackMaxPosition = this.nZoomImageHeight * (nScales - 1);\n var nInitialPosition = dd.Int(this.nZoomImageHeight * \n (nScales - nCurrentScale - 1));\n\n //widget images\n var szThumbImg = this.kaMap.server + 'images/slider_button.png';\n var szTrackTopImg = this.kaMap.server + 'images/slider_tray_top.png';\n var szTrackBottomImg = this.kaMap.server + 'images/slider_tray_bottom.png';\n \n \n //container div\n this.zoomControlObj = document.createElement('div');\n this.zoomControlObj.id = 'zoomControl';\n this.zoomControlObj.style.position = 'absolute';\n\n if (this.left != null)\n {\n if (this.left == '') {\n this.zoomControlObj.style.left = '';\n } else {\n this.zoomControlObj.style.left = this.left + 'px';\n }\n }\n else if (this.right != null)\n {\n if (this.right == '') {\n this.zoomControlObj.style.right = '';\n } else {\n this.zoomControlObj.style.right = this.right + 'px';\n }\n }\n if (this.top != null)\n {\n if (this.top == '') {\n this.zoomControlObj.style.top = '';\n } else {\n this.zoomControlObj.style.top = this.top + 'px';\n }\n }\n else if (this.bottom != null)\n {\n if (this.bottom == '') {\n this.zoomControlObj.style.bottom = '';\n } else {\n this.zoomControlObj.style.bottom = this.bottom + 'px';\n }\n }\n\n this.zoomControlObj.style.width = 17 + \"px\";\n this.zoomControlObj.style.height = (nTrackHeight + 2 * this.nZoomImageHeight + 6) + \"px\";\n this.zoomControlObj.style.opacity = this.opacity/100;\n this.zoomControlObj.style.mozOpacity = this.opacity/100;\n this.zoomControlObj.style.filter = \"Alpha(opacity=\"+this.opacity+\")\"; this.zoomControlObj.style.cursor = 'auto'; \n this.zoomControlObj.style.zIndex = 300;\n this.zoomControlObj.onmouseover = kaZoomer_onmouseover;\n this.zoomControlObj.onmouseout = kaZoomer_onmouseout;\n this.zoomControlObj.kaZoomer = this;\n this.kaMap.domObj.appendChild(this.zoomControlObj);\n \n //draw the widget\n var oZoomTrack = document.createElement( 'div' );\n oZoomTrack.id = 'zoomTrack';\n oZoomTrack.kaZoomer = this;\n oZoomTrack.style.position = 'absolute';\n oZoomTrack.style.left = '0px';\n oZoomTrack.style.top = '20px';\n oZoomTrack.style.height = parseInt(nTrackHeight) + 'px';\n oZoomTrack.style.width = '17px';\n oZoomTrack.style.backgroundColor = \"#acacac\";\n oZoomTrack.style.backgroundImage = 'url(' + this.kaMap.server + 'images/slider_tray_fill.png)';\n oZoomTrack.elementHeight = this.nZoomImageHeight;\n oZoomTrack.onclick = kaZoomer_zoomTo;\n this.zoomControlObj.appendChild(oZoomTrack);\n \n var oZoomThumb = document.createElement( 'div' );\n oZoomThumb.id = 'zoomThumb';\n oZoomThumb.style.position = 'absolute';\n oZoomThumb.style.height = '17px';\n oZoomThumb.style.width = '17px';\n oZoomThumb.style.backgroundColor = \"#888888\";\n oZoomThumb.innerHTML = '<img src=\"' + szThumbImg +'\" border=\"0\" width=\"17\" height=\"17\">';\n this.zoomControlObj.appendChild(oZoomThumb);\n\n var oZoomTrackTop = document.createElement( 'div' );\n oZoomTrackTop.id = 'zoomTrackTop';\n oZoomTrackTop.style.position = 'absolute';\n oZoomTrackTop.style.left = '0px';\n oZoomTrackTop.style.top = '17px';\n oZoomTrackTop.style.width = '17px';\n oZoomTrackTop.style.height = '3px';\n oZoomTrackTop.innerHTML = '<img src=\"' + szTrackTopImg +'\" border=\"0\" width=\"17\" height=\"3\">';\n this.zoomControlObj.appendChild(oZoomTrackTop);\n \n var oZoomTrackBottom = document.createElement( 'div' );\n oZoomTrackBottom.id = 'zoomTrackBottom';\n oZoomTrackBottom.style.position = 'absolute';\n oZoomTrackBottom.style.left = '0px';\n oZoomTrackBottom.style.top = 20 + nTrackHeight + 'px';\n oZoomTrackBottom.style.width = '17px';\n oZoomTrackBottom.style.height = '3px';\n oZoomTrackBottom.innerHTML = '<img src=\"' + szTrackBottomImg +'\" border=\"0\" width=\"17\" height=\"3\">';\n this.zoomControlObj.appendChild(oZoomTrackBottom);\n\n //add +/- labels\n var oZoomIn = document.createElement('div');\n oZoomIn.id = 'zoomIn';\n oZoomIn.style.position = 'absolute';\n oZoomIn.style.top = '0px';\n oZoomIn.style.left = '0px';\n oZoomIn.style.width = '17px';\n oZoomIn.style.height = '17px';\n oZoomIn.kaZoomer = this;\n oZoomIn.onclick = kaZoomer_zoomIn;\n oZoomIn.innerHTML= \"<img src='\" + this.kaMap.server + \"images/slider_button_zoomin.png' border='0' width='17' height='17'>\";\n this.zoomControlObj.appendChild(oZoomIn);\n\n var oZoomOut = document.createElement('div');\n oZoomOut.id = 'zoomOut';\n oZoomOut.style.position = 'absolute';\n oZoomOut.style.top = 23 + nTrackHeight + 'px';\n oZoomOut.style.left = '0px';\n oZoomOut.style.width = '17px';\n oZoomOut.style.height = '17px';\n oZoomOut.kaZoomer = this;\n oZoomOut.onclick = kaZoomer_zoomOut;\n oZoomOut.innerHTML= \"<img src='\" + this.kaMap.server + \"images/slider_button_zoomout.png' border='0' width='17' height='17'>\";\n this.zoomControlObj.appendChild(oZoomOut);\n\n //set up drag and drop\n ADD_DHTML('zoomThumb'+MAXOFFTOP+0+MAXOFFBOTTOM+nTrackMaxPosition+VERTICAL);\n ADD_DHTML('zoomTrack'+NO_DRAG);\n\n dd.elements.zoomThumb.moveTo(dd.elements.zoomTrack.x, dd.elements.zoomTrack.y + nInitialPosition);\n dd.elements.zoomThumb.setZ(dd.elements.zoomTrack.z+1);\n\n dd.elements.zoomTrack.addChild('zoomThumb');\n\n dd.elements.zoomThumb.defx = dd.elements.zoomTrack.x;\n dd.elements.zoomThumb.defy = dd.elements.zoomTrack.y;\n \n dd.elements.zoomThumb.my_DropFunc = kaZoomer_DropFunc;\n \n this.kaMap.registerForEvent( KAMAP_SCALE_CHANGED, this, this.update );\n}", "title": "" }, { "docid": "08834463705ba99275dad7e88ac79ddc", "score": "0.56425554", "text": "function zoomed() {\n zoom = d3.event.transform;\n zoom_level = zoom[\"k\"];\n g.attr(\"transform\", d3.event.transform)\n gPins.attr(\"transform\", d3.event.transform)\n gArrows.attr(\"transform\", d3.event.transform)\n long_binner.range(d3.range(-180, 180, LONGLAT_STEP/zoom_level))\n lat_binner.range(d3.range(-90, 90, LONGLAT_STEP/zoom_level))\n water.attr(\"transform\", d3.event.transform)\n}", "title": "" }, { "docid": "08834463705ba99275dad7e88ac79ddc", "score": "0.56425554", "text": "function zoomed() {\n zoom = d3.event.transform;\n zoom_level = zoom[\"k\"];\n g.attr(\"transform\", d3.event.transform)\n gPins.attr(\"transform\", d3.event.transform)\n gArrows.attr(\"transform\", d3.event.transform)\n long_binner.range(d3.range(-180, 180, LONGLAT_STEP/zoom_level))\n lat_binner.range(d3.range(-90, 90, LONGLAT_STEP/zoom_level))\n water.attr(\"transform\", d3.event.transform)\n}", "title": "" }, { "docid": "e348915bb640ed881fe3c607e9904355", "score": "0.56407964", "text": "function actOpenDICOMZoomIn() {\n if (DICOM.zoom < 2) {\n DICOM.zoom += .2;\n openDICOMUpData();\n }\n }", "title": "" }, { "docid": "6b968cd1aa555dcf7e63e64f2696b547", "score": "0.56402653", "text": "function zoom() {\n $('svg .osd').popover('hide')\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "06f58f43413c777f0ae180ec833d9cb9", "score": "0.5633554", "text": "function changeSizePath() {\r\n context.lineWidth = inputRange.value;\r\n context.beginPath();\r\n }", "title": "" }, { "docid": "7a9c66ef6bf1a99e335f9770b2b202c8", "score": "0.5633243", "text": "setScale() {\n if (this.height >= this.width) {\n this.zoom.scale(this.width / 2);\n this.prjFnc.scale(this.width / 2);\n } else {\n this.zoom.scale(this.height / 2 - (this.height * 0.05));\n this.prjFnc.scale(this.height / 2 - (this.height * 0.05));\n }\n this.prjFnc.translate([this.width / 2, this.height / 2]);\n }", "title": "" }, { "docid": "53555aadadd0676157c696f284d83a78", "score": "0.56325126", "text": "calcZoomLevel (tX,tY,gS,tS) {\r\n //console.log(tX + \"\" + tY + \"\" + gS + \"\" + tS);\r\n let pixelsPerInch = tvFunc.ppiTV(tS,tX,tY);\r\n //console.log(pixelsPerInch);\r\n let scaleValue = Math.round(tvFunc.scaleTV(gS,pixelsPerInch) / .01);\r\n //console.log(scaleValue);\r\n let scaleValue2 = .01 * .01 * scaleValue;\r\n //console.log(scaleValue2);\r\n canvas.stage.scale.set(scaleValue2 ,scaleValue2); //This when called sets the scale for the canvas given X and Y\r\n }", "title": "" }, { "docid": "033da32198292005fcae4e2b6fdacf23", "score": "0.56313455", "text": "function zoom(root, p, isInit) {\n var tmpDepth = root._depth;\n if (document.documentElement.__transition__) return;\n\n // Rescale outside angles to match the new layout.\n var enterArc,\n exitArc,\n outsideAngle = d3.scale.linear().domain([0, 2 * Math.PI]);\n\n //function insideArc(d) {\n // return p.key > d.key\n // ? {depth: d.depth - 1, x: 0, dx: 0} : p.key < d.key\n // ? {depth: d.depth - 1, x: 2 * Math.PI, dx: 0}\n // : {depth: 0, x: 0, dx: 2 * Math.PI};\n //}\n\n function outsideArc(d) {\n return {depth: d.depth + 1, x: outsideAngle(d.x), dx: outsideAngle(d.x + d.dx) - outsideAngle(d.x)};\n }\n\n //center.datum(root);\n //svg.selectAll(\"text\").remove();\n //svg.selectAll(\".cat\").remove();\n\n // When zooming in, arcs enter from the outside and exit to the inside.\n // Entering outside arcs start from the old layout.\n if (root === p) {\n enterArc = outsideArc;\n //exitArc = insideArc;\n outsideAngle.range([p.x, p.x + p.dx]);\n } else {\n enterArc = insideArc, exitArc = outsideArc, outsideAngle.range([p.x, p.x + p.dx]);\n }\n\n var tmpRoot = {};\n $.extend(tmpRoot,root);\n var tmpNodes = partition.nodes(tmpRoot).slice(1).map(function(item){\n var tmpItem = {};\n $.extend(tmpItem,item);\n tmpItem.depth = tmpItem.depth + tmpDepth;\n return tmpItem;\n });\n path = path.data(tmpNodes, function(d) { return d.key; });\n\n d3.transition().duration(isInit ? 0 : 750).each(function() {\n //path.exit().transition()\n // .style(\"fill-opacity\", function(d) { return d.depth === 1 + (root === p) ? 1 : 0; })\n // .attrTween(\"d\", function(d) { return arcTween.call(this, exitArc(d)); })\n // .remove();\n\n for (var key in levelPath) {\n if (key >= tmpDepth) {\n svg.selectAll(\"[level='\" + key +\"']\").remove();\n //levelPath[key].remove();\n }\n }\n\n levelPath[tmpDepth] = path.enter().append(\"path\")\n .style(\"fill-opacity\", function(d) { return d.depth === 2 - (root === p) ? 1 : 0; })\n .style(\"fill\", function(d) { return d.fill; })\n .style(\"stroke\", \"gray\")\n .style(\"stroke-width\", \"0.5\")\n .attr(\"level\", tmpDepth)\n .attr(\"id\", function(d) { return d.id; })\n .attr(\"cursor\", \"pointer\")\n .on(\"mouseenter\",update_legend)\n .on(\"mouseout\",remove_legend)\n .on(\"click\", preZoomIn)\n .each(function(d) { this._current = enterArc(d); })\n //.append(\"path\")\n //.attr(\"d\", labelArc)\n //.attr(\"id\", function(d) {\n // return \"al_\"+d.id;\n //})\n ;\n\n currRoot = currRoot.filter(function(item){\n return (item.depth <= tmpDepth);\n });\n currRoot = currRoot.concat(partition.nodes(tmpRoot).slice(1).map(function(item){\n item.depth += tmpDepth;\n return item;\n }));\n //var currKey = [];\n //currRoot = currRoot.filter(function(item){\n // if (currKey.indexOf(item.key) === -1) {\n // currKey.push(item.key);\n // return true;\n // } else {\n // return false;\n // }\n //});\n\n //var text = svg.selectAll(\"text\")\n // .data(currRoot)\n // .enter().append(\"text\")\n // .attr(\"class\", \"cat\")\n // .style(\"font-size\", \"14px\")\n // .style(\"font-family\", \"simsun\")\n // //.style(\"z-index\",\"100\")\n // .attr(\"text-anchor\",\"middle\")\n // .on(\"click\", preZoomIn)\n // .on(\"mouseenter\",update_legend)\n // .on(\"mouseout\",remove_legend)\n // .append(\"textPath\")\n // .attr(\"startOffset\", \"20%\")\n // .attr(\"xlink:href\", function(d) {\n // //return '#al_' + d.key.replace(/\\./gi, \"_\");\n // return '#al_' + d.id;\n // })\n // .text(function(d) { return d.name; });\n\n image = svg.selectAll(\"image .cat\")\n .data(tmpNodes)\n .enter().append(\"image\")\n .attr(\"class\", \"cat\")\n .attr(\"level\", tmpDepth)\n .attr(\"id\", function(d) { return d.id; })\n .attr(\"xlink:href\", function(d) {\n if (d.img) {\n return d.img;\n } else {\n return \"skin/default/image/home/taichi.png\";\n }\n })\n .attr(\"width\", \"50px\")\n .attr(\"height\", \"50px\")\n .attr(\"cursor\", \"pointer\")\n .on(\"click\", preZoomIn)\n .on(\"mouseenter\",update_legend)\n .on(\"mouseout\",remove_legend)\n .attr(\"transform\",imgTransformI)\n ;\n path.transition()\n .style(\"fill-opacity\", 1)\n .attrTween(\"d\", function(d) { return arcTween.call(this, updateArc(d)); });\n\n transformAll();\n\n });\n }", "title": "" }, { "docid": "2a22784320f93772b26384b712ba307e", "score": "0.5614766", "text": "function zoomInOut(handler) {\n\t\tvar transformAttr = handler.data.tempG.getAttribute(\"transform\");\n\t\tvar panLevelsHorizontal = parseInt(/translate\\((-?\\d+)\\,\\ ?(-?\\d+)\\)/gm.exec(transformAttr)[1]);\n\t\tvar panLevelsVertical = parseInt(/translate\\((-?\\d+)\\,\\ ?(-?\\d+)\\)/gm.exec(transformAttr)[2]);\n\t\tvar zoomLevel = parseFloat(/scale\\((\\d*\\.?\\d+)\\)/gm.exec(transformAttr)[1]);\n\t\tvar svgWidth = handler.data.treeSVG.attr(\"width\");\n\t\tvar svgHeight = handler.data.treeSVG.attr(\"height\");\n\t\tif (handler.data.isZoomIn) {\t\t\t\n\t\t\tzoomLevel = zoomLevel * 1.1;\n\t\t\tsvgWidth = svgWidth * 1.1;\n\t\t\tsvgHeight = svgHeight * 1.1;\n\t\t} else {\t\n\t\t\tzoomLevel = zoomLevel / 1.1;\n\t\t\tsvgWidth = svgWidth / 1.1;\n\t\t\tsvgHeight = svgHeight / 1.1;\n\t\t}\n\t\thandler.data.tempG.setAttribute('transform', 'translate(' + panLevelsHorizontal + ',' + panLevelsVertical + ') scale(' + zoomLevel.toFixed(2) + ')');\n\t\thandler.data.treeSVG.attr(\"width\", svgWidth);\n\t\thandler.data.treeSVG.attr(\"height\", svgHeight);\n\t}", "title": "" }, { "docid": "3500c2a49c6f63bd0333f1293904cdb8", "score": "0.56110424", "text": "function sizeChange(){\n mySize = size.value;\n context.lineWidth = mySize;\n}", "title": "" }, { "docid": "89472b0eb079fd9e651b819e899d94b9", "score": "0.5606298", "text": "function zoomed() {\n\tif (d3.event.sourceEvent && d3.event.sourceEvent.type === \"brush\") return; // ignore zoom-by-brush\n\tvar t = d3.event.transform;\n\tx.domain(t.rescaleX(x2).domain());\n\tlet i = 0;\n\tselected_metrics_values.forEach(function(val) {\n\t\tconst id = \"#\" + val + \"_main\";\n\t\tconst line = line1_array[i];\n\t\ti = i + 1;\n\t\tLine_chart.select(id).attr(\"d\", line);\n\t});\n\tfocus.select(\".axis--x\").call(xAxis);\n\tcontext.select(\".brush\").call(brush.move, x.range().map(t.invertX, t));\n}", "title": "" }, { "docid": "bf7c8a718db86db5027e26ead6d8ebff", "score": "0.55882543", "text": "function brushend() {\n svg.call(d3.behavior.zoom().x(x).y(y).on(\"zoom\", zoom));\n d3.event.target.clear();\n d3.select(this).call(d3.event.target);\n //console.log(d3.event.target);\n //if (brush.empty()) resetSelection();\n }", "title": "" }, { "docid": "780c61365737320e776f876708c6db55", "score": "0.5576588", "text": "function zoomin()\n{\n\t\tscrollx=scrollx/zoomfact;\n\t\tscrolly=scrolly/zoomfact;\n\t\n\t\tif(zoomfact==0.125) zoomfact=0.25\n\t\telse if(zoomfact==0.25) zoomfact=0.5\n\t\telse if(zoomfact==0.5) zoomfact=0.75\n\t\telse if(zoomfact==0.75) zoomfact=1.0\n\t\telse if(zoomfact==1.0) zoomfact=1.25\n\t\telse if(zoomfact==1.25) zoomfact=1.5\n\t\telse if(zoomfact==1.5) zoomfact=2.0\n\t\telse if(zoomfact==2.0) zoomfact=4.0;\n\n\t\tscrollx=scrollx*zoomfact;\n\t\tscrolly=scrolly*zoomfact;\n\t\n\t\t// Update scroll position - missing code for determining that center of screen should remain at nevw zoom factor\n\t\tshowdata();\n}", "title": "" }, { "docid": "8b5164a2205389c3dfe38aa8c7ed290a", "score": "0.557543", "text": "function zoomOut() {\n\t//increases value of the slider\n\tif (slider.immediateValue < maxScale) { //if slider isnt at the highest point\n\t\tslider.increment();\n\t\tcurrentScale = slider.immediateValue;\n\t}\n\tdrawToCanvas(globalJSON);\n}", "title": "" }, { "docid": "edcd8c49697a3f59d5bee1e71506817e", "score": "0.5568562", "text": "function clicked(d) {\n var x, y, k;\n\n // Compute centroid of the selected path\n if (d && centered !== d) {\n // if (d) {\n var centroid = path.centroid(d);\n x = centroid[0];\n y = centroid[1];\n // k = zoom.scaleExtent()[1];\n k = 5;\n centered = d;\n } else {\n x = width / 2;\n y = height / 2;\n k = 1;\n centered = null;\n }\n\n // Manually Zoom\n svg.transition()\n .duration(750)\n .call(zoom.transform, d3.zoomIdentity\n .translate(width / 2, height / 2)\n .scale(k)\n .translate(-x, -y));\n }", "title": "" }, { "docid": "daee3ae8def7dfa6ba4e79e71f784752", "score": "0.5567287", "text": "function mouseWheel() {\n fill(bread);\n strokeWeight(30);\n stroke(crust);\n rect(0, 0, 300, 300);\n noStroke();\n}", "title": "" }, { "docid": "9991e7dda68af771ca6c3195e478d92c", "score": "0.5566698", "text": "_onChangeViewportZoom() {\n this._markDeepRender();\n }", "title": "" }, { "docid": "a11764499838ce871436fd6b8bffd39e", "score": "0.5564548", "text": "function zoom_to (level) {\n while (drawer.cell_width > level) {\n zoom_centered(true)\n }\n\n while (drawer.cell_width * 2 < level) {\n zoom_centered(false)\n }\n }", "title": "" }, { "docid": "a41eb9e278300d77cb7428822acd178e", "score": "0.55607104", "text": "scale(scale) {\n this.x *= scale;\n this.y *= scale;\n }", "title": "" }, { "docid": "17deb9de4449463b67f209e0377a21b9", "score": "0.55576295", "text": "onZoomModeChanged() {\n if (this._zoomModeChanged) {\n this._zoomModeChanged.raise();\n }\n if (this.zoomMode == null) {\n return;\n }\n let size = new latte.Size(this.container.width(), this.container.height());\n let img = this.image;\n if (!img) {\n return;\n }\n let can = new latte.Element(this.canvas);\n let imgSize = new latte.Size(img.naturalWidth, img.naturalHeight);\n this._zoom = 1;\n can.removeClass('centered-x');\n can.removeClass('centered-y');\n can.style.marginTop = '';\n can.style.marginLeft = '';\n switch (this.zoomMode) {\n case ImageZoomMode.ACTUAL_SIZE:\n can.width = img.naturalWidth;\n can.height = img.naturalHeight;\n this.lblZoom.text = strings.actualSize;\n break;\n case ImageZoomMode.FIT:\n let fitted = imgSize.scaleToFit(size);\n can.width = fitted.width;\n can.height = fitted.height;\n this._zoom = fitted.area / imgSize.area;\n this.lblZoom.text = latte.sprintf(\"%s%\", Math.round(this.zoom * 100));\n break;\n }\n img.width = can.width;\n img.height = can.height;\n if (size.width > img.width) {\n can.addClass('centered-x');\n can.style.marginLeft = latte.sprintf('%spx', Math.round(-img.width / 2));\n }\n if (size.height > img.height) {\n can.addClass('centered-y');\n can.style.marginTop = latte.sprintf('%spx', Math.round(-img.height / 2));\n }\n if (size.height < img.height && size.width < img.height) {\n can.addClass('overflow');\n }\n else {\n can.removeClass('overflow');\n }\n if (!size.contains(imgSize)) {\n this.container.css('overflow', 'auto');\n }\n if (this._cropper) {\n // Force update of cropper\n this.onCropBoundsChanged();\n }\n }", "title": "" }, { "docid": "481e45a1588b95255594f24eabf66e3f", "score": "0.5548308", "text": "onClick() {\n const{\n map,\n extent,\n fitOptions\n } = this.props;\n const view = map.getView();\n\n const {fitOptions: defaultFitOptions} = ZoomToExtentButton.defaultProps;\n\n if (!view) { // no view, no zooming\n return;\n }\n if (view.getAnimating()) {\n view.cancelAnimations();\n }\n\n const finalFitOptions = {\n ...defaultFitOptions,\n ...fitOptions\n };\n\n view.fit(extent, finalFitOptions);\n }", "title": "" }, { "docid": "f1a7ff08366a569ce314adf5db720ecb", "score": "0.5547868", "text": "function recenter() {\n if (centering) return; // time is active and already interpolating\n centering = true;\n d3.timer(function() {\n var extent = _('brush').extent(),\n size = extent[1] - extent[0],\n center1 = center * alpha + (extent[0] + extent[1]) / 2 * (1 - alpha);\n if (!(centering = Math.abs(center1 - center) > 1e-3)) center1 = center;\n\n console.log(\"recenter\", size, center, center1);\n gBrush\n .call(_('brush').extent([center1 - size / 2, center1 + size/2]))\n .call(_('brush').event);\n\n return !centering;\n })\n }", "title": "" }, { "docid": "ebbb1aa64c2c915101eaea31f820959d", "score": "0.55458164", "text": "resize(e) {\n if (this.state === 'large') {\n this.state = 'small';\n this.layer.scale(0.2, new paper.Point(0, 0));\n } else {\n this.state = 'large';\n this.layer.scale(5, new paper.Point(0, 0)); \n }\n\n this.canvas.width = this.layer.bounds.width;\n this.canvas.height = this.layer.bounds.height;\n }", "title": "" }, { "docid": "1b510d2d88a6acfd568a124c614c9884", "score": "0.55448467", "text": "function clicked(d) {\n var x, y, k;\n\n // Compute centroid of the selected path\n if (d && centered !== d) {\n var centroid = path.centroid(d);\n x = centroid[0];\n y = centroid[1];\n k = 10;\n centered = d;\n } else {\n x = width / 2;\n y = height / 2;\n k = 1;\n centered = null;\n }\n\n // Highlight the clicked province\n mapLayer.selectAll('path').style('fill', function(d, i) {\n return centered && d === centered ? '#D5708B' : fillFn(d, i);\n });\n // Zoom\n g.transition().duration(750)\n .attr('transform', 'translate(' + width / 2 + ',' + height / 2 + ')scale(' + k + ')translate(' + -x + ',' + -y + ')');\n }", "title": "" }, { "docid": "c091eca9b6c2320c6706113109d21efb", "score": "0.5543907", "text": "function zoomed() {\n // svg.attr(\"transform\", d3.event.transform);\n // console.log(d3.event.transform);\n // var xy = d3.mouse(this); \n // var transform = d3.zoomTransform(svg.node());\n // var xy1 = transform.invert(xy);\n // console.log(xy1);\n svg.attr(\"transform\", \"translate(\" + (d3.event.transform[\"x\"]+width+130) / 2 + \",\" + (d3.event.transform[\"y\"]+height+130) / 2 + \")scale(\" + d3.event.transform[\"k\"] + \")\")\n }", "title": "" }, { "docid": "5a56fdd8b03ed48c1e6458c9240c238e", "score": "0.5541138", "text": "function mousePressed() {\n scale(2);\n}", "title": "" }, { "docid": "16c233ef5284b2a3e3ecfe4230fb3851", "score": "0.5534888", "text": "scaleBy(c){\n this.x *= c;\n this.y *= c;\n }", "title": "" }, { "docid": "8ce8061205eb5db6f65515fadfe750bf", "score": "0.5527821", "text": "function zoomToCounty(term) {\n\n counties.eachLayer(function(layer) {\n if(layer.feature.properties.NAME === term) {\n \n map.flyToBounds(layer.getBounds(), {\n paddingTopLeft: [350, 20] \n })\n //set outline to green\n layer.setStyle({\n color: \"#046A38\",\n weight: 4.5\n })\n\n //reset outline to gray when map's clicked\n map.on('click', function() {\n layer.setStyle({\n color: '#999999',\n weight: 1.5,\n fillOpacity: 0\n })\n\n })\n }\n\n });\n }", "title": "" }, { "docid": "b97bc7c39648a298cfd21f6c4d3a0ebb", "score": "0.5527189", "text": "incrementZoom(amount) {\n this.setZoom(this.zoom + amount);\n }", "title": "" }, { "docid": "2d2a9944b4caa3eb0bf472f5e651a695", "score": "0.54979444", "text": "function zoomed() {\n //svg.attr(\"transform\", d3.event.transform);\n gX.call(xAxis.scale(d3.event.transform.rescaleX(xScale)));\n gY.call(yAxis.scale(d3.event.transform.rescaleY(yScale)));\n circles.attr(\"transform\", d3.event.transform);\n label.attr(\"transform\", d3.event.transform);\n }", "title": "" }, { "docid": "4277c06cf4678b83b21b349e8684af96", "score": "0.54950804", "text": "function zoom(d) {\n\n if (d3.event.sourceEvent && !nodeHighlighted) {\n d3.event.sourceEvent.stopPropagation();\n }\n scaleFactor = d3.event.scale;\n translation = d3.event.translate;\n tick(); //update positions\n }", "title": "" }, { "docid": "0fab4ad0b083a04787519571c7687157", "score": "0.5491526", "text": "function render() {\n\t// Create a new transformation matrix\n\tt = new Transform();\n\tm = t.m;\n\t\n\t// Adjust the canvas to fit the image\n\tadjust_image();\n\t\n\t// Set the initial position of the mouse to the center\n\tlastX = canvas.width / 2;\n\tlastY = canvas.height / 2;\n\t\n\t// Set the zoom level to the current scale factor, and set the\n\t// upper and the lower zoom boundaries according to the current\n\t// zoom level (10 scrolls up for the upper boundary, and 10\n\t// scrolls down for the lower boundary, assuming each spin of the\n\t// mouse wheel is equivalent to 3 \"clicks\", so 10 * 3 = 30)\n\tzoomLevel = Math.sqrt(Math.pow(m[0], 2) + Math.pow(m[1], 2));\n\tzoomUp = zoomLevel * Math.pow(scale_factor, 30);\n\tzoomLow = zoomLevel / Math.pow(scale_factor, 30);\n\t\n\t// Once the scale factor has changed, set it to all the regions\n\t// (if any) to draw their elements properly\n\tvar factor = 1 / zoomLevel;\n\t$.each(location_points, function(index, location_point) {\n\t\tlocation_point.point.setFactor(factor);\n\t});\n\t\n\t// Draw the image fitted to the canvas\n\tredraw();\n}", "title": "" }, { "docid": "8490f34d4da2160fdd584bb4d1e2d4dd", "score": "0.5490505", "text": "function select_area(){\n\tvar rect1 = elems[\"paper_\"+current_graph_id].rect(((2*paddingx[current_graph_id])), 2*paddingy[current_graph_id] , 0, (height[current_graph_id]-(4*paddingy[current_graph_id]))).attr({\n\t\topacity : 0,\n\t});\n\telems['zoom_rect_'+current_graph_id] = rect1;\n}", "title": "" }, { "docid": "ea3b0ea6bac30ca1cc4c5f6b63c152e7", "score": "0.54900044", "text": "function mouseWheel(event) {\n if (event.deltaY > 0) {\n penSize += dPenSize;\n }\n else if (event.deltaY < 0 && penSize > 1) {\n penSize -= dPenSize;\n }\n \n}", "title": "" } ]
39490a79195bc29e80948c2b5cfa8dd2
TODO: REMOVE, NOW GOT OWN URL
[ { "docid": "fc4adfff6054e168c4bee83b3a3496c2", "score": "0.0", "text": "function toggleInfo() {\n\t\t\tvm.info = !vm.info;\n\t\t}", "title": "" } ]
[ { "docid": "8c13e189a82b45213c499487f13f750c", "score": "0.66145855", "text": "url() {\n throw new Error('Not implemented');\n }", "title": "" }, { "docid": "a4a72405a35ca12b211ec9786197d992", "score": "0.6252065", "text": "function URLUtils() {}", "title": "" }, { "docid": "480b4de6128ee98b5c5bd45ebac06817", "score": "0.62458473", "text": "getUrl(name) { return \"\"; }", "title": "" }, { "docid": "f8f7c6b279a6ffd8b32fe86c26ef7185", "score": "0.62179166", "text": "function getResourceUrl() { return \"http://\"+location.href.split(\"//\")[1].split(\"/\").splice(0,3).join(\"/\")+'.json?api_key='+MoviePilot.apikey;}", "title": "" }, { "docid": "ef02c763f75d29c3e589124c139c9a91", "score": "0.6159274", "text": "get url() {return '/';}", "title": "" }, { "docid": "c54a08fff684e5db229c112acd9c8c68", "score": "0.5995159", "text": "get url() {\n\t\treturn this.__url;\n\t}", "title": "" }, { "docid": "c54a08fff684e5db229c112acd9c8c68", "score": "0.5995159", "text": "get url() {\n\t\treturn this.__url;\n\t}", "title": "" }, { "docid": "c54a08fff684e5db229c112acd9c8c68", "score": "0.5995159", "text": "get url() {\n\t\treturn this.__url;\n\t}", "title": "" }, { "docid": "c54a08fff684e5db229c112acd9c8c68", "score": "0.5995159", "text": "get url() {\n\t\treturn this.__url;\n\t}", "title": "" }, { "docid": "c54a08fff684e5db229c112acd9c8c68", "score": "0.5995159", "text": "get url() {\n\t\treturn this.__url;\n\t}", "title": "" }, { "docid": "ae513c5903d50328b3a068dc8e1b5a03", "score": "0.5991954", "text": "function newUrl() {\n\trecordUrl();\n\n\tconstructUrlMarkup(2);\n}", "title": "" }, { "docid": "ad3a57b5146cf9eec9606a42ecf9e1fc", "score": "0.5990392", "text": "function Action()\n{\n\tweb.url(\n\t\t{\n\t\t\t\t\t\tname : 'www.elcorteingles.es', \n\t\t\turl : 'http://www.elcorteingles.es/', \n\t\t\ttargetFrame : '', \n\t\t\tresource : 0, \n\t\t\trecContentType : 'text/html', \n\t\t\treferer : '', \n\t\t\tsnapshot : 't1.inf', \n\t\t\tmode : 'HTML', \n\t\t\textraRes : [\n\t\t\t\t{url : '/sgfm/SGFM/assets/stylesheets/fonts/opensans-regular-webfont.woff', referer : 'http://www.elcorteingles.es/sgfm/SGFM/assets/stylesheets/crs.css'},\n\t\t\t\t{url : '/sgfm/SGFM/assets/stylesheets/fonts/opensans-bold-webfont.woff', referer : 'http://www.elcorteingles.es/sgfm/SGFM/assets/stylesheets/crs.css'},\n\t\t\t\t{url : '/sgfm/SGFM/assets/stylesheets/fonts/moonshine-font.woff', referer : 'http://www.elcorteingles.es/sgfm/SGFM/assets/stylesheets/crs.css'},\n\t\t\t\t{url : '/sgfm/SGFM/assets/javascripts/library/external/dust-helpers.min.js'},\n\t\t\t\t{url : '/sgfm/SGFM/assets/stylesheets/fonts/lato-regular-webfont.woff', referer : 'http://www.elcorteingles.es/sgfm/SGFM/assets/stylesheets/crs.css'},\n\t\t\t\t{url : '/sgfm/SGFM/assets/javascripts/library/external/dust-core.min.js'},\n\t\t\t\t{url : 'http://www.googletagmanager.com/gtm.js?id=GTM-TMQVMD'},\n\t\t\t\t{url : '/sgfm/SGFM/assets/javascripts/compiled/templates.js'},\n\t\t\t\t{url : '/sgfm/SGFM/assets/javascripts/library/external/form2js.min.js'},\n\t\t\t\t{url : '/sgfm/SGFM/assets/stylesheets/images/confianza-online-icon.svg', referer : 'http://www.elcorteingles.es/sgfm/SGFM/assets/stylesheets/crs.css'}\n\t\t\t]\n\t\t}\n\t);\n\n\treturn 0;\n}", "title": "" }, { "docid": "324a0a95679d073db8a5de7392765d6b", "score": "0.5943481", "text": "get url () {\n\t\treturn this._url;\n\t}", "title": "" }, { "docid": "324a0a95679d073db8a5de7392765d6b", "score": "0.5943481", "text": "get url () {\n\t\treturn this._url;\n\t}", "title": "" }, { "docid": "324a0a95679d073db8a5de7392765d6b", "score": "0.5943481", "text": "get url () {\n\t\treturn this._url;\n\t}", "title": "" }, { "docid": "324a0a95679d073db8a5de7392765d6b", "score": "0.5943481", "text": "get url () {\n\t\treturn this._url;\n\t}", "title": "" }, { "docid": "324a0a95679d073db8a5de7392765d6b", "score": "0.5943481", "text": "get url () {\n\t\treturn this._url;\n\t}", "title": "" }, { "docid": "45041f516f4b08a4c062b9ab9e8884c0", "score": "0.59003395", "text": "get url() { return this.serializeUrl(this.currentUrlTree); }", "title": "" }, { "docid": "80d3813bd5c15c97ec15ab8be63f6013", "score": "0.5899903", "text": "get url() { return this.link.url; }", "title": "" }, { "docid": "58184f8fa87a63b2b791ef442ea0a217", "score": "0.5894206", "text": "_changeUrl(url) {\n this.rawUrl = url;\n }", "title": "" }, { "docid": "0b8136ae8fed6f6f5f0e7ecc8be4b090", "score": "0.5889782", "text": "boardItemViewUrl (baseUrl,username,spacename){\n browser.get(baseUrl + username + \"/\" + spacename +\"/plan/board\");\n }", "title": "" }, { "docid": "1808d1df9ceec5660e70158648d2ef57", "score": "0.5857253", "text": "getURL()\n {\n return this.url;\n }", "title": "" }, { "docid": "16f4da814ca4a3a456800d4a4462b5b5", "score": "0.58066815", "text": "url( pid, query ) {\n \n // Initialize the URL.\n let url = `${self.src}${self.endpoint}`;\n \n // Add query data if applicable.\n if( query ) url += this.query(true);\n \n // Add a unique id.\n url += (query ? '&' : '?') + `pid=${pid}`;\n\n // Return the URL.\n return url;\n\n }", "title": "" }, { "docid": "de16b3d48dbc42a447dc8724b2850479", "score": "0.58033305", "text": "get url() {\n return this._url;\n }", "title": "" }, { "docid": "de16b3d48dbc42a447dc8724b2850479", "score": "0.58033305", "text": "get url() {\n return this._url;\n }", "title": "" }, { "docid": "de16b3d48dbc42a447dc8724b2850479", "score": "0.58033305", "text": "get url() {\n return this._url;\n }", "title": "" }, { "docid": "de16b3d48dbc42a447dc8724b2850479", "score": "0.58033305", "text": "get url() {\n return this._url;\n }", "title": "" }, { "docid": "a02901aa4b434c73a960fbd9e83adcc2", "score": "0.57773644", "text": "function getUrl() { \n var uri = createUriParams(), \n url = document.URL.split(\"#\")[0]; \n \n url += \"#\" + uri \n dojo.byId(\"url\").value = url; \n \n dijit.byId(\"urlDialog\").show(); \n}", "title": "" }, { "docid": "a229cb5a68282f76e9beafb0df357150", "score": "0.57605475", "text": "get url () {\n return this._url;\n }", "title": "" }, { "docid": "995e33a9eefd23bf72250f1fe60b7c5d", "score": "0.5699678", "text": "function getURLHttpSimpleLoad() {\n return getServerURL('extensions/api_test/webrequest/simpleLoad/a.html');\n}", "title": "" }, { "docid": "ec57e9071d6bf0fc69156a3fb032fbf5", "score": "0.5689461", "text": "function UriUtils() {}", "title": "" }, { "docid": "fa7c3ec3ef7a97e42b59c7b211d4ec17", "score": "0.56870496", "text": "get url() {\n return this._url;\n }", "title": "" }, { "docid": "a926298d482ee532827e8488703ac09d", "score": "0.5681557", "text": "get href(){return $href;}", "title": "" }, { "docid": "a926298d482ee532827e8488703ac09d", "score": "0.5681557", "text": "get href(){return $href;}", "title": "" }, { "docid": "6c966852b341d3aac1a2abf465e31a5c", "score": "0.56815463", "text": "getFileUrl(path) { return this.engine.getFileUrl(path); }", "title": "" }, { "docid": "e980e5d236310e6a6303af4774dab787", "score": "0.5673892", "text": "get url() {\n return internalSlots.get(this).url.href;\n }", "title": "" }, { "docid": "c8c3246ede49e9c5edc6bd4e7920ad71", "score": "0.5668994", "text": "constructor(url, id) {\n super(url); //llama al constructor desde el que extiende\n this._id = id;\n }", "title": "" }, { "docid": "7076e1dedd2a03b31553fd7733148701", "score": "0.5649227", "text": "resource(fullUrl){\n //Pega o caminho da URL ou seja a string que vem após a porta e antes das querys\n //protocolo://domínio:porta/RECURSO/.../RECURSO?query_string#fragmento\n let parsedUrl = url.parse(fullUrl).pathname\n return parsedUrl\n }", "title": "" }, { "docid": "cfe01e98199e62457328b897b48583c5", "score": "0.56487274", "text": "boardItemQueryUrl (baseUrl,username,spacename,query){\n browser.get(baseUrl + username + \"/\" + spacename +\"/plan/board?\" + query);\n }", "title": "" }, { "docid": "6aeba2e4da26b2009e2ce1d4145748c2", "score": "0.5644838", "text": "@action\n getTinyUrl() {\n\n let urlArray = this.get('findUrl').split('/');\n let urlSearch;\n if (urlArray.length > 1) {\n urlSearch = urlArray[(urlArray.length - 1)]\n } else {\n urlSearch =urlArray[0]\n }\n\n this.store.findRecord('find', urlSearch)\n .then((url) => {\n let newLocation = url.get('url');\n window.location.href = newLocation;\n });\n }", "title": "" }, { "docid": "5cada24f56d030a2bec42d69cc80a0eb", "score": "0.564155", "text": "get url() {\n return this._data.url;\n }", "title": "" }, { "docid": "7cfb2f2356b707c0555966d8ba8f049e", "score": "0.5634221", "text": "getUrl() {\n return this.folder.url()+\"/\"+this.file;\n }", "title": "" }, { "docid": "7b3642e4c5d5b3b738abb1c39c40b6c5", "score": "0.56295335", "text": "url() {\n\t\treturn this._url;\n\t}", "title": "" }, { "docid": "01c7c46e70a7ce1993193b80bc0de227", "score": "0.5629315", "text": "getFinalUrl() {\n let url = Request.mergeUrls(this.host, this.url);\n const urlParams = this.getUrlParams();\n if (urlParams.length > 0) {\n url += `?${urlParams}`;\n }\n return url;\n }", "title": "" }, { "docid": "bf3e89df1bd93a4039582f2190a15223", "score": "0.5618757", "text": "function constructorurl(intput1) {\n return serverURL + \"?text=\" + intput1;\n}", "title": "" }, { "docid": "e92274c97747737c62511563f9eb5f79", "score": "0.5603157", "text": "constructor(url) {\n this.url = url;\n }", "title": "" }, { "docid": "3a5ae180da4a0a34783c89bd10c6a72d", "score": "0.5592696", "text": "getUrl() {\n if (this.state != remote_file) {\n return undefined;\n }\n let [ssName, storageService] = getStorageService();\n return storageService.getUrl(this._obj.location);\n }", "title": "" }, { "docid": "a644ae150594aae56dddfd15570c5f06", "score": "0.5591457", "text": "_request() {\n var options = url.parse(this._url);\n options.headers = {\n 'User-Agent': 'Benjamin Tambourine',\n 'If-None-Match': this._etag\n };\n https.get(options, this._onResponse.bind(this));\n }", "title": "" }, { "docid": "0f83f58a9f8309254025b5379ca3cfc4", "score": "0.55847776", "text": "function getURL() {\n return {\n omDbURL: \"http://www.omdbapi.com/?\",\n MDBurl: \"https://api.themoviedb.org/3/search/movie?api_key=838eabeda5ff3bb866d5c5fc023308d1\"\n };\n}", "title": "" }, { "docid": "296c79baf306c44c82ff33665d945161", "score": "0.55728924", "text": "get uri() {\n\t\treturn this.__uri;\n\t}", "title": "" }, { "docid": "296c79baf306c44c82ff33665d945161", "score": "0.55728924", "text": "get uri() {\n\t\treturn this.__uri;\n\t}", "title": "" }, { "docid": "296c79baf306c44c82ff33665d945161", "score": "0.55728924", "text": "get uri() {\n\t\treturn this.__uri;\n\t}", "title": "" }, { "docid": "a78d9b848e5c0863299a2ef1dc2d2f2d", "score": "0.5566038", "text": "function url() {\n var u = a + b + c + d\n return u\n }", "title": "" }, { "docid": "4b3efd4b6da9f7f3639b0abb99a0ed8e", "score": "0.55600965", "text": "function _get_url( els ) {\n\treturn basepath + els.join('/');\n}", "title": "" }, { "docid": "dd0430c1359640d4cd59f13282d399bc", "score": "0.55589575", "text": "static stringURIPath(uriobj) {\nvar res;\nres = uriobj.path;\nif (uriobj.query != null) {\nres += \"?\" + uriobj.query;\n}\nreturn res;\n}", "title": "" }, { "docid": "c875b28dc2abf48b42da5e61e62cecae", "score": "0.55573577", "text": "resourcesUrl (baseUrl,username){\n browser.get(baseUrl + username + \"/_resources\");\n }", "title": "" }, { "docid": "b9a80f2f7eb8dc74257aface9f3306b8", "score": "0.5554562", "text": "GET() {\n }", "title": "" }, { "docid": "3520e00ffc84b1d011f78470f71309a3", "score": "0.5539135", "text": "toString() {\n return this.url();\n }", "title": "" }, { "docid": "3520e00ffc84b1d011f78470f71309a3", "score": "0.5539135", "text": "toString() {\n return this.url();\n }", "title": "" }, { "docid": "577906d9481a4c30e1c6defcbab76e8a", "score": "0.5514381", "text": "workitemWithId (baseUrl,username,spacename,id){\n browser.get(baseUrl + username + \"/\" + spacename +\"/plan/detail/\" +id);\n }", "title": "" }, { "docid": "e23f84c7e16cd479e051572917359f70", "score": "0.550913", "text": "getURL() {\n return Meteor.absoluteUrl(`${ UploadFS.config.storesPath }/${ this.name }`, {\n secure: UploadFS.config.https\n });\n }", "title": "" }, { "docid": "54f8c064538bb3d21903d6f02723aa4a", "score": "0.5506878", "text": "get uri () {\n\t\treturn this._uri;\n\t}", "title": "" }, { "docid": "09b753d3bb94797237e714ab462ceb03", "score": "0.55054206", "text": "toUrlAndQuery() {\r\n return `${super.toUrl()}?${Array.from(this.query).map((v) => v[0] + \"=\" + v[1]).join(\"&\")}`;\r\n }", "title": "" }, { "docid": "75a0f6c7f5f2ffcbbe14c2fab25f283f", "score": "0.5495619", "text": "get feed(){\n return fbpage+\"/feed\";\n }", "title": "" }, { "docid": "f856b169deba1fbde6043f60c19371fb", "score": "0.54844147", "text": "function finalurl() {\n var url = new URL(window.location.href);\n var search_params = url.searchParams;\n search_params.set('sorting', document.getElementById(\"sort-list\").value);\n url.search = search_params.toString();\n var new_url = url.toString();\n return new_url\n }", "title": "" }, { "docid": "aa3e1671ea4ee8bc403ad018b10a90d7", "score": "0.5478628", "text": "url(...args) {\n return getMethodUrl(this.name, this.host, this.route, args);\n }", "title": "" }, { "docid": "0b1ead9073e3b05b98a17c85632ffa38", "score": "0.5476379", "text": "function makeurl()\r\n\t{\r\n\t\tvar url = class_baseUrl + \"?func=ll&objAction=page&objID=\" + virtual_containerId + \"&page=\" + currentPageNum + \"&sort=\" + class_sortColumn;\r\n\r\n\t\t// add on the optional pieces\r\n\t\tif ( containerSubType !== \"\" ) \r\n\t\t{\r\n\t\t\turl += \"&objType=\" + containerSubType;\r\n\t\t}\r\n\t\tif ( filterValue !== \"\" )\r\n\t\t{\r\n\t\t\turl += \"&filterValue=\" + encodeURIComponent( filterValue );\r\n\t\t}\r\n\r\n\t\tif ( objFilter !== \"\" )\r\n\t\t{\r\n\t\t\turl += \"&objFilter=\" + objFilter;\r\n\t\t}\r\n\t\t\r\n\t\tif ( currentTab !== \"\" )\r\n\t\t\t\t{\r\n\t\t\t\t\turl += \"&tab=\" + encodeURIComponent( currentTab );\r\n\t\t}\r\n\t\t\r\n\t\tfor ( var key in contentFilter ) \r\n\t\t{\r\n\t\t\tfor ( var i = 0; i < contentFilter[ key ].length; i ++ ) \r\n\t\t\t{\r\n\t\t\t\turl += \"&\" + key + \"=\" + encodeURIComponent( contentFilter[ key ][ i ] );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn url;\r\n\t}", "title": "" }, { "docid": "87ec7bb9c01859e901a2f7708d3eb950", "score": "0.5470344", "text": "function getURL(uri) \r\n{\r\n uri.dir = location.href.substring(0, location.href.lastIndexOf('\\/'));\r\n uri.dom = uri.dir; \r\n if (uri.dom.substr(0,7) == 'http:\\/\\/') \r\n uri.dom = uri.dom.substr(7);\r\n \r\n uri.path = ''; \r\n \r\n var pos = uri.dom.indexOf('\\/'); \r\n \r\n if (pos > -1) \r\n {\r\n uri.path = uri.dom.substr(pos+1); \r\n uri.dom = uri.dom.substr(0,pos);\r\n }\r\n \r\n uri.page = location.href.substring(uri.dir.length+1, location.href.length+1);\r\n pos = uri.page.indexOf('?');\r\n \r\n if (pos > -1) \r\n {\r\n uri.page = uri.page.substring(0, pos);\r\n }\r\n pos = uri.page.indexOf('#');\r\n \r\n if (pos > -1) \r\n {\r\n uri.page = uri.page.substring(0, pos);\r\n }\r\n uri.ext = '';\r\n pos = uri.page.indexOf('.');\r\n \r\n if (pos > -1) \r\n {\r\n uri.ext =uri.page.substring(pos+1); \r\n uri.page = uri.page.substr(0,pos);\r\n }\r\n uri.file = uri.page;\r\n if (uri.ext != '') uri.file += '.' + uri.ext;\r\n \r\n if (uri.file == '') \r\n uri.page = 'index';\r\n \r\n uri.args = location.search.substr(1).split(\"?\");\r\n \r\n return uri;\r\n}", "title": "" }, { "docid": "a0a3643470432b1649dd9f92f8edc335", "score": "0.547033", "text": "function url() {\n return protocol + \"://\" + fayecom_address + \":\" + port + \"/faye\";\n }", "title": "" }, { "docid": "fc5397139e32e6d20e538079d7fe9925", "score": "0.5469055", "text": "function eUtil() {\n\n //Get URL Parameters by name\n function getUrlParam(name){\n if(name=(new RegExp('[?&]'+encodeURIComponent(name)+'=([^&]*)')).exec(location.search))\n return decodeURIComponent(name[1]);\n }\n\n}", "title": "" }, { "docid": "b37b8f0c95e4a23ed379b429a42f1f0a", "score": "0.5466903", "text": "function validator_url(x){\n \n }", "title": "" }, { "docid": "5f68ccc92a7e26d53db4cb9abe8e4fb3", "score": "0.54548174", "text": "buildUrlEndpoint(action) {\n\t\t\tconst host = this._configuration.getDomain() + '/api/Bookmark/'\n\t\t\tconst endpoint = action || '';\n\t\t\treturn host + endpoint;\n\t\t}", "title": "" }, { "docid": "83cbe823b70f50f5379ab535e1918e1b", "score": "0.5454462", "text": "createShortenedListURL(params) {\n return ApiService.post('/link', { url: params.url });\n }", "title": "" }, { "docid": "56d95a6143f3a5e772b3b4bec07ff235", "score": "0.5446939", "text": "function createURL() {\n var query_url = api_url.concat(patientID,auth,accessToken);\n actualQuery();\n }", "title": "" }, { "docid": "e7ecfd81667fa0072a3f764d35133cb6", "score": "0.5443243", "text": "function getmatche(link){\n request(link, cb);\n }", "title": "" }, { "docid": "b1087292b62524c2729607075ae14ce7", "score": "0.5436498", "text": "function getUrl() {\n // debugger;\n return urls[Math.floor(Math.random() * urls.length)];\n }", "title": "" }, { "docid": "932715caeeadbfe4c72af7afa379c077", "score": "0.54319465", "text": "function get_open_url(url) {\n var curr = new builder.Url(url);\n var base = new builder.Url(builder.lastStep().url() || builder.storage.get('baseurl'));\n\n if (base.server() == curr.server()) {\n return curr.path();\n } else {\n return curr.href();\n }\n }", "title": "" }, { "docid": "05384c3d60975cc183c9bc1ec89179ba", "score": "0.5426564", "text": "static __createUrl(url, base) {\n return new URL(url, base);\n }", "title": "" }, { "docid": "3906b935984e218c9d341c8ba51e852b", "score": "0.5425769", "text": "url() {\n return this.win.location.href;\n }", "title": "" }, { "docid": "1da8f35d728e1aa148a816db9ce8ae8a", "score": "0.5425615", "text": "function modifyTourUri(){\n\t\tserverUri = Parameters.getTourServerUri() + \"/path\";\n\t}", "title": "" }, { "docid": "c81f6a4220839d354e9aed11ea6dfb54", "score": "0.5416749", "text": "function makeurl( path ) {\n if (path.indexOf(\"://\") > 0) return path;\n return url + \"/\" + path;\n }", "title": "" }, { "docid": "39510669eabc74d63449dad4dd69af02", "score": "0.5416225", "text": "get anchor() {}", "title": "" }, { "docid": "ff52dc0134fea8fe43b34d955c0e1b27", "score": "0.5410482", "text": "function get_orig_url(url)\n {\n return url.replace(/(?:re|edit)announce/, \"dispbbs\").replace(/reply.*?&/g, \"\")\n .replace(/&bm=/, \"#\");\n }", "title": "" }, { "docid": "19b17c37188cd5b8ec7e3015bdc67340", "score": "0.5409875", "text": "get uri() {\n return this.uri_;\n }", "title": "" }, { "docid": "5936aea02479b1646ef660180eda58d3", "score": "0.540968", "text": "function api_url(data){\n\treturn base_url+data;\n}", "title": "" }, { "docid": "69e181cf745cf678596e62a4231a912c", "score": "0.54096454", "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": "08aa52987b406bd45f4e2d8c3f27e01d", "score": "0.54081553", "text": "function model_geturl(id){//through the model id to get this model's collection fatch url ,this function return a standand (maybe) url string\r\n\tvar iHandlemodel=iElementlist.get(id);\r\n\tvar url='/'+id;//for example '1234' it's parent is 'portal',it will do this_function to find parent \r\n\tif (iHandlemodel.get('iType')=='Page'){//next time it find portal return portal\r\n\t\treturn iHandlemodel.id+'/';\r\n\t}\r\n\telse {\r\n\t\turl=model_geturl(iHandlemodel.get('iParent'))+iHandlemodel.id+'/';\r\n\t\treturn url;\r\n\t}// so it will be portal\r\n}", "title": "" }, { "docid": "b658bd00f750d58e34720c26fe8fc67f", "score": "0.5408018", "text": "getPublicPathUrl() {\n return `${this.getServerUrl()}${this.publicPath}`;\n }", "title": "" }, { "docid": "e5bc73c6c12bb58b265d7600ef5b5a85", "score": "0.54077643", "text": "constructor() {\n this.url = BASE_URL;\n }", "title": "" }, { "docid": "dd2fca2f6a5a4971fd1648f798da9b15", "score": "0.5405623", "text": "worldUrl() {\n return this.serverFolder.baseUrl+this.serverFolder.name;\n }", "title": "" }, { "docid": "0797897e53366c47bd63a59b7be474f0", "score": "0.54035753", "text": "function toString(){\n\t\treturn this.url;\n\t}", "title": "" }, { "docid": "734bcb4c2b6b795f76cd65b77ae561cc", "score": "0.54024035", "text": "function getUrl(listName) {\n return \"/_api/Web/Lists/GetByTitle('\" + listName + \"')/Items\";\n}", "title": "" }, { "docid": "ee7ecd26e7891a17595826924c1e4689", "score": "0.53921974", "text": "static urlError()\n {\n throw new Error('A \"url\" property or function must be specified');\n }", "title": "" }, { "docid": "8f74a950f52c0eaddb196ca5d4575220", "score": "0.5389313", "text": "function DataUrl() \n{ \n var url = \"json.php?bucket=m\";\n url += \"&publisher=\";\n if (params['publisher']) \n {\t\n url += params['publisher'];\n }\n url += \"&advertiser=\";\n if (params['advertiser']) \n {\t\n url += params['advertiser'];\n }\n url += \"&adunit=\";\n if (params['adunit']) \n {\t\n url += params['adunit'];\n }\n url += \"&from=\";\n url += Math.floor(lookback);\n return url; \n}", "title": "" }, { "docid": "7b616b74d89ee90e8f8f4fcde57fa565", "score": "0.5388888", "text": "function urlReader() {\n ajxStore.urlBuild.imgLink = $(\"#url-value\").val();\n myDataRef.push({url: ajxStore.urlBuild.imgLink});\n showImg(ajxStore.urlBuild.imgLink);\n ajxStore.urlBuild.encodedURL = encodeURIComponent(ajxStore.urlBuild.imgLink); \n alchemyAjax();\n projectOxfordAjax();\n skyAjax();\n }", "title": "" }, { "docid": "ec932ec44f466d1d16ba2bb58b7a64cf", "score": "0.53795725", "text": "getUri() {\n return super.getAsString(\"uri\");\n }", "title": "" }, { "docid": "a2fa881c3ad9f14dd707b0ee58f97bf0", "score": "0.537284", "text": "function apiURL(service) { //Función para formar la ruta completa a la API \n return BaseApiUrl + service;\n}", "title": "" }, { "docid": "24efd6ef2868f55b05140e06c2dda139", "score": "0.53704983", "text": "getUrl() {\n if (!this._url) {\n this._url = new URL(location + \"\");\n }\n\n return this._url;\n }", "title": "" }, { "docid": "bfba7e7661bf9937c6953cd345993927", "score": "0.5367158", "text": "get url() {\n return createDocumentCollectionUri(this.database.id, this.id);\n }", "title": "" }, { "docid": "89a0932b5db9ca7ca5758b0ddb1f6433", "score": "0.5363281", "text": "get url() {\n return createUserUri(this.database.id, this.id);\n }", "title": "" }, { "docid": "14a1bc4a0d82cdaa02d4b15ac4a1d39f", "score": "0.53611577", "text": "function getTheUrl() {\n var nhlJsonUrl = urlPrefix + '/api/v1/schedule?date=' + getTheDates();\n console.log(\"getTheUrl(): [\" + nhlJsonUrl + \"]\");\n return nhlJsonUrl;\n}", "title": "" } ]
06c7e98d4804c657be8465ae3d4486cf
Functions to manage the message information
[ { "docid": "b7d26c8f4bbbcf47f8e795dc6ac7ae7f", "score": "0.6110371", "text": "function createDataMessage(message) {\n // Return the Data from message to make the template\n const img_src = createFileLogo();\n let user = getData('user');\n\n return {'text': message.types === 'text',\n 'image': message.types === 'image',\n 'file': !(message.types === 'text' || message.types === 'image') ,\n 'msg': message,\n 'logo': img_src[message.types],\n 'class': (message.username === user.username)?'msg-own':'msg-other',\n 'date': getLocalTime(message.date)};\n}", "title": "" } ]
[ { "docid": "70020c6a32c5d1a7a9905b490bfb15af", "score": "0.70404255", "text": "handleMessage(message) {\n\n this.Name=message.Name;\n this.Description=message.Description;\n this.CourseImage=message.CourseImage;\n this.Level=message.Level;\n this.Position=message.Position;\n this.Title=message.Title;\n this.Link=message.Link;\n this.Category=message.Category;\n console.log('retrieved data from message payload');\n \n }", "title": "" }, { "docid": "de5711ea63864b065149daabb32f16ed", "score": "0.6950026", "text": "handleOnMessage(msg) {\n console.debug('Message: ' + JSON.stringify(JSON.parse(msg.data), null, 4));\n //this.saveUsage('received');\n }", "title": "" }, { "docid": "8984b498597efed0469abaf4ea08e8cc", "score": "0.67518514", "text": "handleSend() {\n \t\tconst {newMsg} = this.state;\n \t\tif (newMsg.length > 0) {\n\t \t\tconst message = {\n\t \t\t\tauthor: this.uname,\n\t \t\t\tbody: newMsg,\n\t \t\t\tcreated: new Date(),\n\t \t\t}\n\t \t\tthis.addMsg(message)\n \t\t}\n \t}", "title": "" }, { "docid": "76eb400ebb73619d8fd93674ee0680cd", "score": "0.6630871", "text": "function messageInfo(content) {\n addMessage(content, \"info\");\n}", "title": "" }, { "docid": "e8550ccad335b6b047e037f165560fbd", "score": "0.6610968", "text": "processReceivedMessage(blob) {\n blob.split('\\n').forEach(message => {\n try {\n message = JSON.parse(message);\n } catch (e) {\n return;\n }\n\n if (message.from_user == 'SERVER') {\n const params = message.body.split(':');\n\n switch (params[0]) {\n case 'BANNER':\n this.addMessageToChatLog(params[1].replace(/^\\s+/, ''));\n break;\n\n case 'ROOMTOPIC':\n this.setText(MciViewIds.mrcChat.roomName, `#${params[1]}`);\n this.setText(MciViewIds.mrcChat.roomTopic, params[2]);\n\n this.customFormatObj.roomName = params[1];\n this.customFormatObj.roomTopic = params[2];\n this.updateCustomViews();\n\n this.state.room = params[1];\n break;\n\n case 'USERLIST':\n this.state.nicks = params[1].split(',');\n\n this.customFormatObj.roomUserCount = this.state.nicks.length;\n this.updateCustomViews();\n break;\n\n case 'STATS': {\n const [boardCount, roomCount, userCount, activityLevel] =\n params[1].split(' ').map(v => parseInt(v));\n\n const activityLevelIndicator =\n this.getActivityLevelIndicator(activityLevel);\n\n Object.assign(this.customFormatObj, {\n boardCount,\n roomCount,\n userCount,\n activityLevel,\n activityLevelIndicator,\n });\n\n this.setText(MciViewIds.mrcChat.mrcUsers, userCount);\n this.setText(MciViewIds.mrcChat.mrcBbses, boardCount);\n\n this.updateCustomViews();\n break;\n }\n\n default:\n this.addMessageToChatLog(message.body);\n break;\n }\n } else {\n if (message.body === this.state.lastSentMsg.msg) {\n this.customFormatObj.latencyMs = moment\n .duration(moment().diff(this.state.lastSentMsg.time))\n .asMilliseconds();\n delete this.state.lastSentMsg.msg;\n }\n\n if (message.to_room == this.state.room) {\n // if we're here then we want to show it to the user\n const currentTime = moment().format(\n this.client.currentTheme.helpers.getTimeFormat()\n );\n this.addMessageToChatLog(\n '|08' + currentTime + '|00 ' + message.body + '|00'\n );\n }\n\n // Deliver PrivMsg\n else if (\n message.to_user.toLowerCase() == this.state.alias.toLowerCase()\n ) {\n const currentTime = moment().format(\n this.client.currentTheme.helpers.getTimeFormat()\n );\n this.addMessageToChatLog(\n '|08' + currentTime + '|00 ' + message.body + '|00'\n );\n }\n }\n\n this.viewControllers.mrcChat.switchFocus(MciViewIds.mrcChat.inputArea);\n });\n }", "title": "" }, { "docid": "085a0bddbe60226d2b754c2c74b6ba49", "score": "0.6582089", "text": "function messageInformation(message) {\n console.log(\"[MSG]\".bgGreen \n + \" Received message from: @\" + message.author.username \n + \"#\" + message.author.discriminator \n + \" <\" + message.author.id + \">\");\n console.log(\"[MSG]\".bgGreen + \" Message contents: \" + message.content);\n console.log(\"[MSG]\".bgGreen + \" Message channel: \" + message.channel + \" (\" + message.channel.type + \")\");\n}", "title": "" }, { "docid": "de7f8c85b45046e2abdeb54fd380d5f9", "score": "0.655485", "text": "function handle_incomming_message(message){\n\t\n\t//alert(message.type);\n\tswitch(message.type){\n\t\tcase \"eventlog\":\n\t\t\thandle_event_update(message);\n\t\t\tbreak;\n\t\t\t\n\t\tcase \"signin\":\n\t\t\thandle_new_signin(message);\n\t\t\tbreak;\n\t\t\t\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\t\n\t\n}", "title": "" }, { "docid": "28e6a4217c70dd7ca2cb13e64297f1ec", "score": "0.6470299", "text": "function getMassageFromServer (){\n\n}", "title": "" }, { "docid": "5ab77a2d9ba93949df8e18701640784a", "score": "0.6435549", "text": "receiveMessage(message) {\n let data = message.data;\n\n // TODO: Some messages will appear here in a later patch\n switch(message.name) {\n }\n }", "title": "" }, { "docid": "80aebfe134ef327eee923f044dbf2649", "score": "0.6423543", "text": "function MsgHandler() {}", "title": "" }, { "docid": "98c41a234dbd2e4ee1162658f3e74224", "score": "0.6368635", "text": "function onMessageRecieved(who, msgType, content) {\n\n switch(msgType) {\n case \"telepointer_info\":\n updateTelepointer(content);\n break;\n case \"inform_my_details_to_all_other_clients\":\n addNewClientToAllOccupantsDetails(content);\n updateOnlineStatusOfClients(all_occupants_details);\n break;\n case \"disconnected\":\n alert(\"Disconnected : \" + content);\n break;\n case \"chat_room_msg\":\n addToChatRoomConversation(content);\n break;\n case \"P2P_MSG\":\n onP2pMsgReceived(content);\n break;\n case \"remote_module_addition\":\n onWorkflowModuleAdditionRequest(content.whoAdded, content.newModuleID, content.newModuleName);\n break;\n case \"node_access_request\":\n //var requestInfo ={\"nodeID\":nodeID, \"requestedBy\":user_email};\n onNodeAccessRequest(content.requestedBy, content.nodeID);\n break;\n case \"node_access_release\":\n onNodeAccessRelease(content.nodeID, content.requestedBy)\n break;\n case \"parentChanged\":\n onModuleParentChange(content.moduleID, content.newParentID, content.parentIndex);\n break;\n case \"moduleSettingsChanged\":\n onModuleSettingsChanged(content);\n break;\n case \"workflow_obj_new_link_drawn\":\n addNewLinkToWorkflowObject(content);\n break;\n case \"workflow_obj_selection_moved\":\n workflowObjSelectionMoved(content);\n break;\n case \"workflow_obj_selection_node_delete\":\n workflowObjRemoveNode(content);\n break;\n case \"workflow_obj_selection_link_delete\":\n workflowObjRemoveLink(content);\n break;\n\n }\n}", "title": "" }, { "docid": "62dc7d7687b8736cba028ed3ac8dacff", "score": "0.63610864", "text": "_handleMessage(e) {\n ChatActions.newMessage(e.data);\n }", "title": "" }, { "docid": "4f394670dce8dac4093f3c5d6020100b", "score": "0.63196623", "text": "function displayEmailInformation(message) {\n\n}", "title": "" }, { "docid": "7f07ad12930c07432dd50483fb5ace0c", "score": "0.62726086", "text": "function getMessageDataSucces(data) {\n _.forEach(data, function (info) {\n if (info.name == USER_NAME) {\n domUpdatesHandler.addMessage('self-message', info);\n } else {\n domUpdatesHandler.addMessage('incoming-message', info);\n }\n });\n }", "title": "" }, { "docid": "8ca2875e8cee079371dca8c0d19dc7d7", "score": "0.62479204", "text": "function handleMessage(message) {\n console.log('dit werkt nu MESSAGE')\n\n //get warzone stats from the logedin user\n api.getDetailsWZ(message.username, message.platform).then(async response => {\n const BR_PROPERTIES = response.lifetime.mode.br.properties\n\n //create a response object with the warzone stats\n let newMessage = {\n id: message.id,\n time: message.time,\n username: message.username,\n message: message.message,\n wins: BR_PROPERTIES.wins,\n kd: BR_PROPERTIES.kdRatio.toFixed(2)\n }\n //save message to db\n messagesCollection.insertOne(newMessage)\n //send formatted message to clients\n io.emit('message', newMessage)\n })\n }", "title": "" }, { "docid": "2b2727b7e118256b2ad4b59f33fa13ee", "score": "0.6239344", "text": "function processChatData(username, iconString, tagString, msg, isPM)\n\t{\n\t\tvar tag = parseInt(tagString, 10);\n\t\tvar userlevel = 0;\n\t\tvar type = Type.normal;\n\t\tif (isPM == 1)\n\t\t{\n\t\t\tvar match = msg.match(/^\\s*\\[(PM from|Sent to) ([A-Za-z0-9_ ]+)\\]: (.+?)\\s*$/) || ['', '', username, msg];\n\t\t\ttype = match[1] == 'Sent to' ? Type.pmSent : Type.pmReceived;\n\t\t\tusername = match[2];\n\t\t\tif (username !== 'sexy_squid')\n\t\t\t{\n\t\t\t\tusername = username.replace(/_/g, ' ');\n\t\t\t}\n\t\t\tmsg = match[3];\n\t\t}\n\t\telse if (tag == Tag.server)\n\t\t{\n\t\t\ttype = Type.serverMsg;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar match = msg.match(/^\\s*\\((\\d+)\\): (.+?)\\s*$/);\n\t\t\tif (match)\n\t\t\t{\n\t\t\t\tuserlevel = parseInt(match[1], 10);\n\t\t\t\tmsg = match[2];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tuserlevel = win.getGlobalLevel();\n\t\t\t}\n\t\t}\n\t\t// unlinkify when using DH2QoL to store the plain message\n\t\tif (win.addToChatBox.toString().includes('linkify(arguments[3])'))\n\t\t{\n\t\t\tmsg = msg.replace(/<a href='([^']+)' target='_blank'>\\1<\\/a>/ig, '$1');\n\t\t}\n\t\tif (type == Type.pmSent)\n\t\t{\n\t\t\t// turn some critical characters into HTML entities\n\t\t\tmsg = msg.replace(/[<>]/g, function (char)\n\t\t\t{\n\t\t\t\treturn '&#' + char.charCodeAt(0) + ';';\n\t\t\t});\n\t\t}\n\t\treturn {\n\t\t\ttimestamp: now()\n\t\t\t, username: username\n\t\t\t, userlevel: userlevel\n\t\t\t, icon: parseInt(iconString, 10)\n\t\t\t, tag: tag\n\t\t\t, type: type\n\t\t\t, msg: msg\n\t\t};\n\t}", "title": "" }, { "docid": "7a10aea87df98a23e961c8263f74ce12", "score": "0.6237219", "text": "parseMessage(data) {\n // Check if data is an object\n if (typeof data !== 'object') {\n parent.postMessage({\n 'status' : 'error',\n 'message' : 'Invalid message format.'\n }, '*');\n return;\n }\n\n let cmd = data.cmd;\n if (typeof cmd !== 'string') {\n parent.postMessage({\n 'status' : 'error',\n 'message' : 'Invalid or missing command.'\n }, '*');\n return;\n }\n\n // Invoke command\n let args = data.args;\n switch(cmd) {\n case 'setTheme':\n // Change theme\n if (typeof args !== 'object') {\n parent.postMessage({\n 'status' : 'error',\n 'message' : 'Invalid or missing arguments.'\n }, '*');\n return;\n }\n this.emit('setTheme', args);\n parent.postMessage({\n 'status' : 'success',\n 'message' : 'Theme set.'\n }, '*');\n break;\n\n case 'roomHeader':\n // Toggle room header\n if (typeof args !== 'boolean') {\n parent.postMessage({\n 'status' : 'error',\n 'message' : 'Invalid or missing arguments.'\n }, '*');\n return;\n }\n this.emit('roomHeader', args);\n parent.postMessage({\n 'status' : 'success',\n 'message' : 'Toggled room header.'\n }, '*');\n break;\n\n case 'roomsList':\n // Toggle rooms list\n if (typeof args !== 'boolean') {\n parent.postMessage({\n 'status' : 'error',\n 'message' : 'Invalid or missing arguments.'\n }, '*');\n return;\n }\n this.emit('roomsList', args);\n parent.postMessage({\n 'status' : 'success',\n 'message' : 'Toggled rooms list.'\n }, '*');\n break;\n\n case 'msgComposer':\n // Toggle message composer\n if (typeof args !== 'boolean') {\n parent.postMessage({\n 'status' : 'error',\n 'message' : 'Invalid or missing arguments.'\n }, '*');\n return;\n }\n this.emit('msgComposer', args);\n parent.postMessage({\n 'status' : 'success',\n 'message' : 'Toggled message composer.'\n }, '*');\n break;\n\n case 'login':\n // Sign in to account using password\n if (typeof args !== 'object') {\n parent.postMessage({\n 'status' : 'error',\n 'message' : 'Invalid or missing arguments.'\n }, '*');\n return;\n }\n this.emit('login', args);\n parent.postMessage({\n 'status' : 'success',\n 'message' : 'Attempting sign in...'\n }, '*');\n break;\n\n case 'switchRoom':\n // Switch to this room\n if (typeof args !== 'string') {\n parent.postMessage({\n 'status' : 'error',\n 'message' : 'Invalid or missing arguments.'\n }, '*');\n return;\n }\n this.emit('switchRoom', args);\n parent.postMessage({\n 'status' : 'success',\n 'message' : 'Attempting to switch room...'\n }, '*');\n break;\n\n default:\n // No matching command\n parent.postMessage({\n 'status' : 'error',\n 'message' : 'Invalid command.'\n }, '*');\n return;\n }\n }", "title": "" }, { "docid": "31fad50d5173464e2d43fa0327a24186", "score": "0.62362534", "text": "function UpdateMessages() {\n\n // Get messages\n\n // Recalculate widths\n CalculateMessageWidths();\n}", "title": "" }, { "docid": "86f84f46236b8c6e5eb4619aaebe2d95", "score": "0.62283874", "text": "SOCKET_ONMESSAGE (state, message) {\n state.socket.message = message\n if (message && message.data) {\n var obj = JSON.parse(message.data)\n if (obj.os && obj.os.uptime > 0) {\n state.osinfo = updateOsInfo(state.osinfo, obj.os)\n }\n if (obj.thermal && obj.thermal.temp && obj.thermal.temp.length > 0) {\n state.thermalinfo = updateThermalInfo(state.thermalinfo, obj.thermal, chartLen)\n }\n if (obj.cpumem && obj.cpumem.updateat > 0) {\n state.cpumeminfo = updateCpuMemInfo(state.cpumeminfo, obj.cpumem, chartLen)\n }\n if (obj.network && obj.network.updateat > 0) {\n state.networkinfo = updateNetWorkInfo(state.networkinfo, obj.network, chartLen)\n }\n if (obj.netif && obj.netif.updateat > 0) {\n state.netifinfo = updateNetIfInfo(state.netifinfo, obj.netif, chartLen)\n }\n if (obj.disk && obj.disk.updateat > 0) {\n state.diskinfo = updateDiskInfo(state.diskinfo, obj.disk, chartLen)\n }\n }\n }", "title": "" }, { "docid": "bade5e6a02aecdebe941de09636b1714", "score": "0.62135696", "text": "function handleMessage(aJSJaCPacket) {\n\t\t\t\t// We get the message items\n\t\t\t\tvar messageFromJID = aJSJaCPacket.getFromJID();\n\t\t\t\tvar messageType = aJSJaCPacket.getType();\n\t\t\t\tvar messageBody = aJSJaCPacket.getBody();\n\t\t\t\tvar messageNode = aJSJaCPacket.getNode();\n\t\t\t\tvar messageSubject = aJSJaCPacket.getSubject();\n\t\t\t\tvar messageTime = getCompleteTime();\n\t\t\t\t\n\t\t\t\tif(messageType != 'error') {\n\t\t\t\t\t// For the groupchats\n\t\t\t\t\tvar messageFromXHashable = \"\" + messageFromJID + \"\";\n\t\t\t\t\tvar messageFromXSplitted = messageFromXHashable.split(\"/\");\n\t\t\t\t\tvar messageFromRoom = messageFromXSplitted[0];\n\t\t\t\t\tvar messageFromNick = messageFromXSplitted[1];\n\t\t\t\t\tvar fromMUCHash = hex_md5(messageFromRoom);\n\t\t\t\t\tvar messageStamp = $(messageNode).find('x').attr('stamp');\n\t\t\t\t\n\t\t\t\t\t// We remove the ressource of the user\n\t\t\t\t\tvar noRessourceJID = messageFromJID + '';\n\t\t\t\t\n\t\t\t\t\t// If the jid has yet no resource\n\t\t\t\t\tif (noRessourceJID.indexOf('/') == -1) {\n\t\t\t\t\t\tvar messageFromJIDNoRessource = noRessourceJID;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t// Else we must remove the resource from the jid\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar splittednoRessourceJID = noRessourceJID.split('/');\n\t\t\t\t\t\tvar messageFromJIDNoRessource = splittednoRessourceJID[0];\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t// We generate the hash\n\t\t\t\t\tvar messageFromJIDHashable = '' + messageFromJIDNoRessource + '';\n\t\t\t\t\tvar fromJIDHash = hex_md5(messageFromJIDHashable);\n\t\t\t\t\tvar noHashfriendJID = messageFromJIDNoRessource;\n\t\t\t\t\n\t\t\t\t\tif(messageNode != '' && $(messageNode).find('error').attr('code') == undefined) {\n\t\t\t\t\t\t/* REF : http://xmpp.org/extensions/xep-0085.html */\n\t\t\t\t\t\n\t\t\t\t\t\tif($(messageNode).find('composing').attr('xmlns') != undefined) {\n\t\t\t\t\t\t\tdisplayChatState('composing', fromJIDHash);\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\tif($(messageNode).find('paused').attr('xmlns') != undefined) {\n\t\t\t\t\t\t\tdisplayChatState('paused', fromJIDHash);\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\tif($(messageNode).find('active').attr('xmlns') != undefined) {\n\t\t\t\t\t\t\tdisplayChatState('active', fromJIDHash);\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\tif($(messageNode).find('inactive').attr('xmlns') != undefined) {\n\t\t\t\t\t\t\tdisplayChatState('inactive', fromJIDHash);\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\tif($(messageNode).find('gone').attr('xmlns') != undefined) {\n\t\t\t\t\t\t\tdisplayChatState('gone', fromJIDHash);\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// If this is a room topic message\n\t\t\t\t\tif(messageSubject) {\n\t\t\t\t\t\tvar filteredSubject = filterThisMessage(messageSubject, messageFromNick);\n\t\t\t\t\t\t$(\"#\" + fromMUCHash + \" .top .name .buddy-infos .muc-topic\").replaceWith('<span class=\"muc-topic\">' + filteredSubject + '</span>');\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// If the message is really a message\n\t\t\t\t\tif(messageBody) {\n\t\t\t\t\t\tif(messageType == 'chat') {\n\t\t\t\t\t\t\t// Gets the nickname of the user\n\t\t\t\t\t\t\tvar splittingJID = noHashfriendJID + '';\n\t\t\t\t\t\t\tvar messageFromName = getBuddyName(splittingJID);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Filter the received message\n\t\t\t\t\t\t\tvar filteredMessage = filterThisMessage(messageBody, messageFromName);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// If the chat is yet opened, doesn't create a new one\n\t\t\t\t\t\t\tvar DIVfromJIDHash = '#' + fromJIDHash;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($.exists(DIVfromJIDHash)) {\n\t\t\t\t\t\t\t\t// We tell the user with a sound\n\t\t\t\t\t\t\t\tsoundPlay(3);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// We notify the user if he has not the focus on the chat\n\t\t\t\t\t\t\t\tvar chanToTest = '#chat-switch .channels .' + fromJIDHash;\n\t\t\t\t\t\t\t\tif (!$(chanToTest).hasClass('activechan')) {\n\t\t\t\t\t\t\t\t\t$(chanToTest).addClass('chan-newmessage');\n\t\t\t\t\t\t\t\t\tpageTitle('new');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// If the chat isn't yet opened, open it !\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tchatCreate(fromJIDHash, noHashfriendJID, messageFromName); // JID hash, JID without hash, the JID name\n\t\t\t\t\t\t\t\t// We tell the user that a new chat has started\n\t\t\t\t\t\t\t\tsoundPlay(2);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Display the received message\n\t\t\t\t\t\t\t$(\"#\" + fromJIDHash + \" .content \" + \".thisFalseDivIsForJQuery\").before('<div class=\"one-line user-message\"><p><em>(' + messageTime + ') </em><b class=\"him\">' + messageFromName + ' : </b> ' + filteredMessage + '</p></div>');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// We apply the videobox\n\t\t\t\t\t\t\tapplyVideoBox();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Scroll to the last message\n\t\t\t\t\t\t\tautoScroll(fromJIDHash);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\telse if(messageType == 'groupchat') {\n\t\t\t\t\t\t\t/* REF : http://xmpp.org/extensions/xep-0045.html */\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Filter the received message\n\t\t\t\t\t\t\tvar filteredMessage = filterThisMessage(messageBody, messageFromNick);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// We get the message time\n\t\t\t\t\t\t\tif(messageStamp != undefined) {\n\t\t\t\t\t\t\t\tvar messageT = messageStamp.split(\"T\");\n\t\t\t\t\t\t\t\tmessageT = messageT[1];\n\t\t\t\t\t\t\t\tvar messageType = 'old-message';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tvar messageT = messageTime;\n\t\t\t\t\t\t\t\tvar messageType = 'user-message';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar color = generateColour(messageFromNick);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tfunction displayMUCMessage(type) {\n\t\t\t\t\t\t\t\t// Display the received message in the room\n\t\t\t\t\t\t\t\t$(\"#\" + fromMUCHash + \" .content \" + \".thisFalseDivIsForJQuery\").before('<div class=\"one-line ' + type + '\"><p><em>(' + messageT + ') </em><b style=\"color: ' + color + ';\">' + messageFromNick + ' : </b> ' + filteredMessage + '</p></div>');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// We apply the videobox\n\t\t\t\t\t\t\t\tapplyVideoBox();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// Scroll to the last message\n\t\t\t\t\t\t\t\tautoScroll(fromMUCHash);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(messageFromNick == undefined) {\n\t\t\t\t\t\t\t\tmessageFromNick = 'server';\n\t\t\t\t\t\t\t\tdisplayMUCMessage('system-message');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tdisplayMUCMessage(messageType);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\telse if(messageType == 'normal') {\n\t\t\t\t\t\t\tvar messageSubject = aJSJaCPacket.getSubject();\n\t\t\t\t\t\t\tvar dateOfTheMessage = getCompleteTime();\n\t\t\t\t\t\t\tvar messageID = hex_md5(messageFromJIDNoRessource + messageSubject + dateOfTheMessage);\n\t\t\t\t\t\t\tvar htmlMessage = messageBody.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// We display the received message\n\t\t\t\t\t\t\tdisplayMessage(messageFromJIDNoRessource, messageSubject, htmlMessage, 'unread', messageID, 'fresh');\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\topenThisError(2);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "74c27466f3fc646cd6718f16a7ed6474", "score": "0.62063575", "text": "function _updateMsg(){\n if(typeof self.msg != 'undefined' && self.msg.length > 0){\n element.show();\n if(self.msg[0].constructor.name != 'App_Common_Models_Message'){\n Logger.entry(\n 'Banner.msg not instance of App_Common_Models_Message',\n 'appCommonDirectivesBanner',\n Logger.TYPE.ERROR);\n }\n if(Date.now() > _expiresAt){\n if(self.msg.length == 1){\n // fade last message\n _opacity = Number(element.css('opacity'));\n _opacity = Math.round((_opacity - _fade)*100)/100;\n element.css('opacity',_opacity);\n if(_opacity <= _fade){\n element.hide();\n $interval.cancel(_intervalId);\n self.msg.shift();\n }\n }else if(self.msg.length > 1){\n _opacity = 1.0;\n self.msg.shift();\n if(self.msg.length > 0){\n // show next message\n _expiresAt = Date.now() + self.expires;\n }else{\n element.hide();\n $interval.cancel(_intervalId);\n }\n }else{\n $interval.cancel(_intervalId);\n }\n }\n }else{\n element.hide();\n $interval.cancel(_intervalId);\n }\n }", "title": "" }, { "docid": "9232ea40776d70cce51f5aee8fc526f7", "score": "0.62050605", "text": "dataMessage () {\n if (this.fin) {\n const messageLength = this.messageLength;\n const fragments = this.fragments;\n\n this.totalPayloadLength = 0;\n this.messageLength = 0;\n this.fragmented = 0;\n this.fragments = [];\n\n if (this.opcode === 2) {\n var data;\n\n if (this.binaryType === 'nodebuffer') {\n data = toBuffer(fragments, messageLength);\n } else if (this.binaryType === 'arraybuffer') {\n data = toArrayBuffer(toBuffer(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.onmessage(data, { masked: this.masked, binary: true });\n } else {\n const buf = toBuffer(fragments, messageLength);\n\n if (!isValidUTF8(buf)) {\n this.error(new Error('invalid utf8 sequence'), 1007);\n return;\n }\n\n this.onmessage(buf.toString(), { masked: this.masked });\n }\n }\n\n this.state = GET_INFO;\n }", "title": "" }, { "docid": "ac262284698f6081496f12e4ff5ea406", "score": "0.620279", "text": "message(message) {\n return message;\n }", "title": "" }, { "docid": "1c9b42eeea655e58e906d99dbaf52aa2", "score": "0.6196439", "text": "processMessage(messageObj) {\n\t\tconst [, context, argument] = messageObj.content.split(' ');\n\n\t\tswitch (context) {\n\t\t\tcase 'meme':\n\t\t\t\tthis.processMemeContext(messageObj, argument);\n\t\t\t\tbreak;\n\t\t\tcase 'cache':\n\t\t\t\tthis.processCacheContext(messageObj, argument);\n\t\t\t\tbreak;\n\t\t\tcase 'about':\n\t\t\t\tthis.processAboutContext(messageObj);\n\t\t\t\tbreak;\n\t\t\tcase 'help':\n\t\t\t\tthis.processHelpContext(messageObj);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthis.processUnknownContext(messageObj);\n\t\t}\n\t}", "title": "" }, { "docid": "77654ae42a673f1cfeee9cf84483f4ab", "score": "0.61961377", "text": "handleMessage(message) {\n this.claimId = message.recordId;\n this.claimStatus = message.recordStatus;\n //console.log('this.claimId ' + JSON.stringify(this.claimId));\n //console.log('this.claimStatus ' + JSON.stringify(this.claimStatus));\n\n }", "title": "" }, { "docid": "ba0c52b7c4b03e2efa1658c343e1696b", "score": "0.6195182", "text": "function appropriate_message(this_message) {\n console.log(appropriate_message);\n }", "title": "" }, { "docid": "343a26dd68cd18f98a79de70b774d109", "score": "0.6188923", "text": "function processMessage(msg, rinfo) {\n\tvar lines = msg.toString().split(\"\\n\");\n\tvar serverRules = q3json.parseStatusBody(lines[1]);\n\tvar playerList = [];\n\t// lines 2 -> end are player info\n\tfor(let i = 2; i < lines.length; i++) {\n\t\tif(lines[i].length > 1) {\n\t\t\tvar playerInfo = lines[i].split(\" \");\n\t\t\tplayerList.push({name:playerInfo[2],\n\t\t\t\tscore:parseInt(playerInfo[0])});\n\t\t}\n\t}\n\t// update our in memory \"database\"\n\tupdateData.call(this, rinfo.address, rinfo.port, serverRules, playerList);\n}", "title": "" }, { "docid": "6583e596d49e84f8d1f09644d04e30f0", "score": "0.6173446", "text": "function setInfo(message) {\r\n title = document.getElementById(\"title\");\r\n title.innerHTML = message.title;\r\n year = document.getElementById(\"year\");\r\n year.innerHTML = message.year;\r\n authors = document.getElementById(\"authors\");\r\n authors.innerHTML = message.authors;\r\n journal = document.getElementById(\"journal\");\r\n journal.innerHTML = message.journal;\r\n aiDoi = document.getElementById(\"aiDoi\");\r\n aiDoi.innerHTML = message.doi;\r\n}", "title": "" }, { "docid": "592506f22bef31f6d92b35608bbb67cb", "score": "0.6172187", "text": "_createMessages(array_state) {\n\t\tconst short_message_text = mytools.tl(this._getMessageText(array_state, false), this.systemLang);\n\t\tconst long_message_text = ((this.config.NoticeType == NoticeTypeLong) ? mytools.tl('Call security organization and leave the house', this.systemLang) : '');\n\n\t\t//send notification\n\t\tif(array_state[8]) {\n\t\t\tnotification.sendNotification(this, ErrorNotification, short_message_text + ((this.config.NoticeType == NoticeTypeLong) ? ('\\n' + long_message_text) : ('')));\n\t\t}\n\t\t//Alarm siren\n\t\tthis._setAlarmSiren(array_state, this.config.AlarmSiren, this.config.AlarmSirenIntruderOn);\n\t\t//AWTRIX - force, name, lifetime, icon, text, soundfile, moveicon, repeatIcon, repeat, duration, color, rainbow, progress, progressColor, progressBackground, scrollSpeed\n\t\tthis._sendAWTRIXMessage(array_state, '\"text\":\"' + short_message_text + '! \"', '', '', '', '', '', '', '', '');\n\t\t//Alexa\n\t\tthis._sendAlexaMessage(array_state, short_message_text, this.systemLang);\n\t}", "title": "" }, { "docid": "6deff841c2b29f60c81b36470f6fe20e", "score": "0.6170217", "text": "get message() { return this._message; }", "title": "" }, { "docid": "6292b6934684c25ae0d16d270e20ab81", "score": "0.61677146", "text": "function _vise_handle_message(packet) {\n //console.log(\"message: \" + packet);\n var first_space = packet.indexOf(' ', 0);\n var second_space = packet.indexOf(' ', first_space + 1);\n\n var sender = packet.substr(0, first_space);\n var receiver = packet.substr(first_space + 1, second_space - first_space - 1);\n var msg = packet.substr(second_space + 1);\n\n if ( receiver === \"command\" ) {\n _vise_handle_command( sender, msg );\n } else if ( receiver === \"log\" ) {\n _vise_handle_log_message(sender, msg);\n } else if ( receiver === \"message\" ) {\n _vise_show_message(msg, VISE_THEME_MESSAGE_TIMEOUT_MS);\n } else if ( receiver === \"progress\" ) {\n _vise_handle_progress_message(sender, msg);\n }\n}", "title": "" }, { "docid": "1794421924501f0f0c2e6102a86fa4a2", "score": "0.6159516", "text": "function onMessageArrived(message) {\n // console.log(\"topic: \",message.destinationName);\n var arr_topic = message.destinationName.split(\"/\");\n // console.log(arr_topic[3]);\n // logMessage(\"INFO\", \"Message Recieved: [Topic: \", message.destinationName, \", Payload: \", message.payloadString, \", QoS: \", message.qos, \", Retained: \", message.retained, \", Duplicate: \", message.duplicate, \"]\");\n if(arr_topic[2]===\"OPCDABRG_STATUS\"){\n // console.log(message.payloadString);\n var status_message = JSON.parse(message.payloadString);\n $(\".OPCServerStatus\").text(status_message[2]);\n if(status_message[2]==\"online\"){\n $(\".OPCServerStatus\").addClass('label-success');\n $(\"button.postValue\").attr(\"disabled\",false);\n }else{\n $(\".OPCServerStatus\").removeClass('label-success');\n $(\"button.postValue\").attr(\"disabled\",true);\n }\n }\n\n if(arr_topic[2]===\"OPCDABRG_LOGS\"){\n console.log(message.payloadString);\n var log_message = JSON.parse(message.payloadString);\n // console.log(log_message);\n var local_datetime = new Date(parseInt(log_message[0]) * 1000).toLocaleString('chinese', { hour12: false });\n // console.log(bj_datetime)\n var new_log_message = [local_datetime, log_message[1], log_message[2]];\n log_table.row.add(new_log_message).draw();\n }\n if(arr_topic[2]===\"OPCDABRG_COMM\"){\n console.log(message.payloadString);\n var log_message = JSON.parse(message.payloadString);\n // console.log(log_message);\n var local_datetime = new Date(parseInt(log_message[0]) * 1000).toLocaleString('chinese', { hour12: false });\n // console.log(bj_datetime)\n var new_comm_message = [local_datetime, log_message[1], log_message[2]];\n comm_table.row.add(new_comm_message).draw();\n }\n if(arr_topic[2]===\"OPCDABRG_DATAS\") {\n // console.log(message.payloadString);\n var data_message = JSON.parse(message.payloadString);\n var opcdata = new Array() ;\n if(data_message.length>0){\n $.each(data_message, function (i, v) {\n var html_str = '<button type=\\\"button\\\" class=\\\"btn btn-default writeItem\\\" data-toggle=\\\"modal\\\" data-target=\\\"#writeItemModal\\\" data-id=\\\"' + v[0] + '\\\">下置</button>';\n // var local_datetime = new Date(parseInt(1585298533.4069197).toLocaleString('chinese', { hour12: false }));\n var local_datetime = new Date(parseInt(v.slice(-1) * 1000)).toLocaleString('chinese', { hour12: false });\n // console.log(local_datetime);\n v.pop();\n v.push(local_datetime, html_str);\n opcdata.push(v)\n });\n }\n //var opcdata = data_message;\n var currentPage = data_table.page();\n // console.log(currentPage);\n data_table.clear();\n data_table.rows.add(opcdata).draw(false);\n data_table.page(currentPage).draw(false);\n\n }\n if(arr_topic[3]===\"RESULT\"){\n // console.log(message.payloadString);\n var apiResult_message = JSON.parse(message.payloadString);\n if(apiResult_message.result){\n var local_datetime = new Date(parseInt(new Date().getTime())).toLocaleString('chinese', { hour12: false });\n var max_str = JSON.stringify(apiResult_message.data);\n if(JSON.stringify(apiResult_message.data).length > 64){\n max_str = JSON.stringify(apiResult_message.data).slice(0,64) + ' ...';\n }\n var new_log_message = [local_datetime, 'api', apiResult_message['id'] + \":\" + max_str];\n if(apiResult_message['id'].indexOf(\"getConfig\") != -1 ){\n // console.log(received_logs_num/60, isInteger(received_logs_num/60), apiResult_message);\n if(isInteger(received_logs_num/60)){\n log_table.row.add(new_log_message).draw();\n }\n received_logs_num = received_logs_num + 1;\n }else{\n log_table.row.add(new_log_message).draw();\n }\n\n }else{\n var local_datetime = new Date(parseInt(new Date().getTime())).toLocaleString('chinese', { hour12: false });\n var max_str = JSON.stringify(apiResult_message.error);\n if(JSON.stringify(apiResult_message.error).length > 64){\n max_str = JSON.stringify(apiResult_message.error).slice(0,64) + ' ...';\n }\n var new_log_message = [local_datetime, 'api', apiResult_message['id'] + \":\" + max_str];\n if(apiResult_message['id'].indexOf(\"getConfig\") != -1 ){\n // console.log(received_logs_num/60, isInteger(received_logs_num/60), apiResult_message);\n if(isInteger(received_logs_num/60)){\n log_table.row.add(new_log_message).draw();\n }\n received_logs_num = received_logs_num + 1;\n }else{\n log_table.row.add(new_log_message).draw();\n }\n }\n\n // console.log(apiResult_message['id']);\n\n if(apiResult_message['id'].indexOf(\"setConfig\") != -1 ){\n $(\"span.api-feed\").text(apiResult_message.id + \":\" + JSON.stringify(apiResult_message.data));\n console.log(apiResult_message);\n }\n\n if(apiResult_message['id'].indexOf(\"getConfig\") != -1 ){\n // console.log(apiResult_message);\n\n if(apiResult_message.result){\n current_opcconfig = apiResult_message['data'];\n $(\".OPCServerName\").text(apiResult_message['data']['opcname']);\n $(\".OPCServerHost\").text(apiResult_message['data']['opchost']);\n $(\"#ClientID\").val(apiResult_message['data']['clientid']);\n $(\"#OPCServer\").val(apiResult_message['data']['opcname']);\n $(\"#OPCHost\").val(apiResult_message['data']['opchost']);\n $(\"#timeinterval\").val(apiResult_message['data']['timeInterval']);\n if(isEmpty($(\"#OPCServerHost\").val())){\n $(\"#OPCServerHost\").val(apiResult_message['data']['opchost']);\n }\n var opcitems = apiResult_message['data']['opcitems'];\n // console.log(opcitems[0]);\n $(\"#OPCItems\").val('');\n var content_str = $(\"#OPCItems\").val();\n $.each(opcitems, function (i, v) {\n // console.log(v);\n content_str = content_str + v + \"\\n\";\n });\n $(\"#OPCItems\").val(content_str);\n }\n\n\n\n }\n\n if(apiResult_message['id'].indexOf(\"opctags_list\") != -1 ){\n $(\"span.api-feed\").text(apiResult_message.id + \":\" + apiResult_message.result);\n if(apiResult_message.result){\n var opcitems = apiResult_message.data;\n // console.log(opcitems);\n var content_str = '';\n $(\"#NewOPCItems\").val(content_str);\n $.each(opcitems, function (i, v) {\n // console.log(v);\n content_str = content_str + v + \"\\n\";\n });\n $(\"#NewOPCItems\").val(content_str);\n }\n\n }\n if(apiResult_message['id'].indexOf(\"getsysconfig\") != -1 ){\n if(apiResult_message.result) {\n $(\"input.timezone\").val(apiResult_message['data']);\n }\n }\n if(apiResult_message['id'].indexOf(\"setsysconfig\") != -1 ){\n if(apiResult_message.result) {\n $(\"input.timezone\").val(apiResult_message['data']);\n\n if(mqttc_connected) {\n var message = new Paho.Message(JSON.stringify({\"id\": 'restartbrg/' + $(\"#newClientID\").val() + '/' + Date.parse(new Date()).toString()}));\n message.destinationName = 'v1/opcdabrg/api/restartbrg';\n message.qos = 0;\n mqtt_client.send(message);\n }\n }\n }\n if(apiResult_message['id'].indexOf(\"tunnelStatus\") != -1 ){\n if(apiResult_message.result) {\n $(\".OPCServerStatus\").text(apiResult_message['data']);\n }\n }\n\n if(apiResult_message['id'].indexOf(\"tunnelClean\") != -1 ){\n if(apiResult_message.result) {\n $(\".OPCServerStatus\").text(apiResult_message.result);\n }\n }\n\n if(apiResult_message['id'].indexOf(\"opcservers_list\") != -1 ){\n $(\"span.api-feed\").text(apiResult_message.id + \":\" + apiResult_message.result);\n // console.log(message.destinationName);\n if(apiResult_message.result){\n console.log(apiResult_message);\n $(\"select.opcserverslist\").empty();\n var opcservers_data = apiResult_message['data'];\n if(opcservers_data.length>0){\n $.each(opcservers_data, function (i, v) {\n // console.log(v);\n $(\"select.opcserverslist\").append(\"<option value='\" + v + \"'>\" + v +\"</option>\");\n });\n $(\"select.opcserverslist\").get(0).selectedIndex = 0;\n var opcservername = $(\"select.opcserverslist\").val();\n var opchost = $(\"#OPCServerHost\").val();\n var message = new Paho.Message(JSON.stringify({\"id\":'opctags_list/' + $(\"#newClientID\").val() + '/' + Date.parse(new Date()).toString(), \"opcserver\":opcservername, \"opchost\":opchost}));\n message.destinationName = 'v1/opcdabrg/api/opctags_list';\n message.qos = 0;\n\n mqtt_client.send(message);\n }\n\n }\n }\n\n if(apiResult_message['id'].indexOf(\"deviceWrite\") != -1 ){\n $(\"span.write-feed\").text(apiResult_message.id + \":\" + apiResult_message.data);\n // console.log(message.destinationName);\n }\n // $(\".MQTTStatus\").text(apiResult_message['data']['clientid']);\n\n }\n\n}", "title": "" }, { "docid": "7f8b93b5a4819af0d6e54a258fdfad03", "score": "0.61590475", "text": "function Message(level, system, text, date){\n this.date = date;\n this.text = text; \n this.level = level; \n this.system = system; \n}", "title": "" }, { "docid": "5041b4d8d314f4903c4446009fdfbcf7", "score": "0.61528075", "text": "static async sendMessages(message, info, remove, removeDelay) {\n for (let i = 0; i < info.description.length; i += 1) {\n const embedInfo = {\n title: i === 0 ? info.title : null,\n avatar: i === 0 ? info.avatar : null,\n color: info.color,\n footer: i === info.description.length - 1 ? info.footer : null,\n request: i === info.description.length - 1 ? info.request : null,\n requestTime: info.requestTime,\n };\n\n // this means that the description is an array of fields, so\n // we will convert it from description to fields\n if (Array.isArray(info.description[i])) {\n embedInfo.fields = info.description[i];\n } else {\n embedInfo.description = info.description[i];\n }\n\n await Messenger.sendMessage(message, embedInfo, remove, removeDelay); // eslint-disable-line\n }\n }", "title": "" }, { "docid": "f930536cdb1aa775a290bbabd5f976f7", "score": "0.6151073", "text": "constructMessage(){\n // messageVariable can be adjusted to contain any number of variable inputs\n const messageVariables = {\n \"salutation\": this.salutation(),\n \"firstName\": this._guestInfo.firstName,\n \"lastName\": this._guestInfo.lastName,\n \"roomNumber\": this._guestInfo.reservation.roomNumber,\n \"company\": this._companyInfo.company,\n \"city\": this._companyInfo.city,\n }\n // define the initial message template\n let message = this._templateInfo.message\n // loop through messageVariables, if the variable key is found in 'message', replace it with the variable value\n for (const key in messageVariables){\n message = message.replace(`{${key}}`, `${messageVariables[key]}`)\n }\n return message\n }", "title": "" }, { "docid": "3628bbb61f718c36e81a03a5c8ddb40e", "score": "0.6150681", "text": "dataMessage () {\n\t if (this._fin) {\n\t const messageLength = this._messageLength;\n\t const fragments = this._fragments;\n\t\n\t this._totalPayloadLength = 0;\n\t this._messageLength = 0;\n\t this._fragmented = 0;\n\t this._fragments = [];\n\t\n\t if (this._opcode === 2) {\n\t var data;\n\t\n\t if (this._binaryType === 'nodebuffer') {\n\t data = toBuffer(fragments, messageLength);\n\t } else if (this._binaryType === 'arraybuffer') {\n\t data = toArrayBuffer(toBuffer(fragments, messageLength));\n\t } else {\n\t data = fragments;\n\t }\n\t\n\t this.onmessage(data);\n\t } else {\n\t const buf = toBuffer(fragments, messageLength);\n\t\n\t if (!isValidUTF8(buf)) {\n\t this.error(new Error('invalid utf8 sequence'), 1007);\n\t return;\n\t }\n\t\n\t this.onmessage(buf.toString());\n\t }\n\t }\n\t\n\t this._state = GET_INFO;\n\t }", "title": "" }, { "docid": "170a9de8f02f5598c3e475efdd46de60", "score": "0.61450434", "text": "function onMessageArrived(message) {\n console.log(\"onMessageArrived: \"+message.destinationName + \" \" + message.payloadString);\n if(message.destinationName === prefix + device_id + \"/$online\") {\n if(message.payloadString === \"true\")\n {\n $( \"#device_status\" ).text(\"Online\"); \n }\n else if(message.payloadString === \"false\")\n {\n $( \"#device_status\" ).text(\"Offline\");\n } else {\n $( \"#device_status\" ).text(\"Unknown\");\n }\n }\n \n if(message.destinationName === prefix + device_id + \"/measure/state\") {\n $( \"#current_state\" ).text(message.payloadString);\n if(message.payloadString === \"run\") {\n pause_measurements = false;\n } else {\n pause_measurements = true;\n }\n }\n\n if(message.destinationName === prefix + device_id + \"/measure/cutoff\") {\n $(\"#nstSlider\").attr( \"data-cur_min\", (message.payloadString*10));\n }\n \n if(message.destinationName === prefix + device_id + \"/measure/measurement\") {\n var obj = JSON.parse(message.payloadString);\n $( \"#reading_voltage\" ).text(obj.voltage);\n $( \"#reading_current\" ).text(obj.current);\n $( \"#reading_capacity\" ).text(obj.charge);\n addDataChart(chart, new Date(), obj.voltage);\n addDataTable(new Date(), obj.voltage, obj.current, obj.charge);\n }\n}", "title": "" }, { "docid": "6cb2a41eed5a2f395ab57986853d4457", "score": "0.61407965", "text": "function receiveMessage(message) {\n\n if (message != null) {\n var messageData = message.data;\n\n if (messageData != null) {\n if (messageData.messageType == 'studentWork') {\n /*\n * we have received a message that contains the latest student work from\n * this component and other components in this node\n */\n /*latestStudentWorkFromThisComponent = messageData.latestStudentWorkFromThisComponent;\n latestStudentWorkFromThisNode = messageData.latestStudentWorkFromThisNode;\n latestStudentWorkFromOtherComponents = messageData.latestStudentWorkFromOtherComponents;*/\n } else if (messageData.messageType == 'nodeSubmitClicked') {\n /*\n * the student has clicked the submit button and the student\n * work has been included in the message data\n */\n /*latestStudentWorkFromThisComponent = messageData.latestStudentWorkFromThisComponent;\n latestStudentWorkFromThisNode = messageData.latestStudentWorkFromThisNode;\n latestStudentWorkFromOtherComponents = messageData.latestStudentWorkFromOtherComponents;*/\n } else if (messageData.messageType == 'componentStateSaved') {\n /*\n * the student work that this model asked to save has now been saved\n * to the server\n */\n //latestStudentWorkFromThisComponent = messageData.componentState;\n //latestComponentStateSaved = messageData.componentState;\n\t\t\t\t\t\t\t\tlatestComponentStateId = messageData.componentState.id;\n } else if (messageData.messageType == 'siblingComponentStudentDataChanged') {\n // the student work from another component in this node has changed\n /*updateLatestStudentWorkFromThisNode(messageData.componentState);*/\n }\n }\n }\n}", "title": "" }, { "docid": "fb8302ef426995ed9e9a47776e6b9615", "score": "0.61407524", "text": "function FM_Message() {\n\tthis.text = null;\n\tthis.font = null;\n\tthis.x = 0;\n\tthis.y = 0;\n\tthis.charSpacing = 0;\n\tthis.align = 0;\n\tthis.removeTime = 0;\n}", "title": "" }, { "docid": "43d68846883e1687620d74b4ed308278", "score": "0.6139163", "text": "function receivedMessage(event) {\n var senderID = event.sender.id;\n var recipientID = event.recipient.id;\n var timeOfMessage = event.timestamp;\n var message = event.message;\n\n console.log(\"Received message for user %d and page %d at %d with message:\",\n senderID, recipientID, timeOfMessage);\n console.log(JSON.stringify(event));\n\n console.log(getUserName(senderID));\n\n\n\n var messageId = message.mid;\n var appId = message.app_id;\n var metadata = message.metadata;\n\n var entities = message.nlp.entities;\n\n var entityValues = Object.keys(entities);\n\n if (entityValues.includes(GREETINGS)) {\n sendWelcomeMessage(senderID);\n }\n\n // You may get a text or attachment but not both\n var messageText = message.text;\n\n // If we receive a text message, check to see if it matches any special\n // keywords and send back the corresponding example. Otherwise, just echo\n // the text we received.\n // switch (messageText) {\n // case 'image':\n // sendImageMessage(senderID);\n // break;\n\n // case 'gif':\n // sendGifMessage(senderID);\n // break;\n\n // case 'button':\n // sendButtonMessage(senderID);\n // break;\n\n // case 'generic':\n // sendGenericMessage(senderID);\n // break;\n\n // case 'receipt':\n // sendReceiptMessage(senderID);\n // break;\n\n // case 'quick reply':\n // sendQuickReply(senderID);\n // break;\n\n // case 'read receipt':\n // sendReadReceipt(senderID);\n // break;\n\n // case 'typing on':\n // sendTypingOn(senderID);\n // break;\n\n // case 'typing off':\n // sendTypingOff(senderID);\n // break;\n\n // case 'account linking':\n // sendAccountLinking(senderID);\n // break;\n\n // default:\n // sendTextMessage(senderID, messageText);\n // }\n}", "title": "" }, { "docid": "afdfe8131cc5db54739966e7288ddc41", "score": "0.61343026", "text": "function Message(text) {\r\n this.createdBy = currentLocation.what3Words;\r\n this.longtitue = currentLocation.longitude;\r\n this.latitude = currentLocation.latitude;\r\n this.createdOn = new Date(Date.now());\r\n this.expiresOn = new Date(Date.now() + 15*60000);\r\n this.text = text;\r\n this.own = true;\r\n}", "title": "" }, { "docid": "d9a4b26cc697016586c2e0ac9f910947", "score": "0.612537", "text": "function receivedMessage(event) {\n var senderID = event.sender.id;\n var recipientID = event.recipient.id;\n var timeOfMessage = event.timestamp;\n var message = event.message;\n\n if (senderID == PAGE_ID) {\n console.error(\"Sender is self.\");\n return;\n }\n\n console.log(\"Received message for user %d and page %d at %d with message:\",\n senderID, recipientID, timeOfMessage);\n console.log(JSON.stringify(message));\n\n var messageId = message.mid;\n\n // You may get a text or attachment but not both\n var messageText = message.text;\n var messageAttachments = message.attachments;\n\n if (messageText) {\n\n // If we receive a text message, check to see if it matches any special\n // keywords and send back the corresponding example. Otherwise, just echo\n // the text we received.\n switch (messageText) {\n // @TODO: Implement Wit.ai or Api.ai to save all this trouble\n\n case 'Help':\n case 'help':\n case 'hello':\n case 'hi':\n case 'Hello':\n case 'Hi':\n sendTextMessage(senderID, \"Set a mode you want from the menu. You can also type as following: 'Face Detection' or 'Landmark Detection'. After you set the mode, send an image you want to process, and Voila!\");\n break;\n\n case 'Face Detection':\n case 'Face detection':\n case 'face detection':\n sendTextMessage(senderID, \"Face Detection mode is set. Please send us an image.\");\n util.writeSession('Face Detection', senderID);\n break;\n\n case 'Object Detection':\n case 'Object detection':\n case 'object detection':\n sendTextMessage(senderID, \"Object Detection mode is set. Please send us an image.\");\n util.writeSession('Object Detection', senderID);\n break;\n\n case 'Landmark Detection':\n case 'Landmark detection':\n case 'landmark detection':\n sendTextMessage(senderID, \"Landmark Detection mode is set. Please send us an image.\");\n util.writeSession('Landmark Detection', senderID);\n break;\n\n case 'Logo Detection':\n case 'Logo detection':\n case 'logo detection':\n sendTextMessage(senderID, \"Logo Detection mode is set. Please send us an image.\");\n util.writeSession('Logo Detection', senderID);\n break;\n\n case 'Text Detection':\n case 'Text detection':\n case 'text detection':\n sendTextMessage(senderID, \"Text Detection mode is set. Please send us an image.\");\n util.writeSession('Text Detection', senderID);\n break;\n\n case 'Filter':\n case 'filter':\n case 'Safe Search':\n case 'Safe search':\n case 'sfe search':\n case 'Filter Safe Search':\n case 'filter safe search':\n sendTextMessage(senderID, \"Filter Safe Search mode is set. Please send us an image.\");\n util.writeSession('Filter Safe Search', senderID);\n break;\n\n case 'Image Properties':\n case 'Image properties':\n case 'image properties':\n sendTextMessage(senderID, \"Image Properties mode is set. Please send us an image.\");\n util.writeSession('Image Properties', senderID);\n break;\n\n default:\n sendTextMessage(senderID, \"Please type 'Help' or open the menu.\");\n }\n } else if (messageAttachments) {\n messageAttachments.forEach(function(messageAttachment) {\n var attachmentUrl = messageAttachment.payload.url;\n console.log(\"Received Attachment\");\n\n // Check if image / audio / video / file (messageAttachment.type)\n switch (messageAttachment.type) {\n case 'image':\n util.download(attachmentUrl, 'sessions/'+senderID+'/'+senderID+'.jpg',\n (error, filename) => {\n if (error) {\n console.log('Failed to download ' + attachmentUrl);\n }\n else {\n // read session.txt and parse\n processImage(senderID, \"Face Detection\");\n }\n });\n break;\n\n default:\n console.log(\"No matching attachment type\");\n sendTextMessage(senderID, \"Message with no matching attachment type received. Please send an image.\");\n break;\n }\n });\n }\n}", "title": "" }, { "docid": "c3b43cc6c8e7dc9f3e304de970560b72", "score": "0.61252594", "text": "static getMessages() {\r\n return { senderror: \"kindly add at least one friends\", sendsuccess: \"Request send successfully\",\r\n emailerror: \"Email id is already exist\" };\r\n }", "title": "" }, { "docid": "5ab7d7222fe46b9b3183bfabf34c6d17", "score": "0.6115024", "text": "function updateInfoMessages($scope) {\n $scope.gracePeriodMsg = utils.trustHtml(utils.trans('onGracePeriodExpl', {date: moment.utc(users.current.subscription_ends_at).format(\"dddd, MMMM Do YYYY, h:mm:ss a\")}));\n $scope.subscribedMsg = utils.trustHtml(utils.trans('subscribedExpl', {plan: $scope.currentUserPlan, lastFour: users.current.last_four, amount: getPlanPrice(users.current.stripe_plan, $scope) }));\n }", "title": "" }, { "docid": "7b72acf24fa286fd5ccbc503ba8ab77f", "score": "0.6102844", "text": "function dispatchMessage(data) { \n\n // The level has changed.\n if(data[\"level\"]){\n loadCourse(data[\"level\"]);\n }\n\n // The map style has changed\n if(data[\"maptype\"]){\n console.log(\"New map style: \" + data[\"maptype\"]);\n setStyle(data[\"maptype\"]);\n }\n\n // It's bounus time!\n if(data[\"bonusmode\"]){\n if(data[\"bonusmode\"] == \"bonus\"){\n bonusModeActive = true;\n setStyle(currentBonusStyle);\n } else {\n bonusModeActive = false;\n setStyle(currentBaseStyle);\n }\n }\n\n // Enable/disable map zoom based on altitude.\n if(data[\"mapzoom\"]){\n mapManager.setZoomEnabled(data[\"mapzoom\"] == \"on\");\n }\n\n // Update the viewport offset value. This is typically only done when configuring the viewports when setting up the game.\n if(data[\"viewOffset\"]){\n viewportMetrics.viewAngleOffset = parseFloat(data[\"viewOffset\"]);\n camera.rotation.set(0, (180 + (viewportMetrics.viewIndex * viewportMetrics.viewAngleOffset)) * Math.PI / 180, 0);\n }\n\n // HUD related messages.\n if(data[\"hud\"]){\n for(var i = 0; i < HUDItems.length; i++){\n switch(data[\"hud\"]){\n case \"show\":\n HUDItems[i].show();\n break;\n\n case \"hide\":\n HUDItems[i].hide();\n break;\n\n default:\n // for any message other than show or hide, pass the message on to all HUD objects so they can react if needed.\n if(typeof(HUDItems[i].message) == \"function\"){\n HUDItems[i].message(data);\n }\n break;\n }\n }\n }\n\n // Explicitly set the zoom level (this should only happen when altitude based zooming is disabled)\n if(data[\"zoom\"]){\n mapManager.setZoomLevel(Number(data[\"zoom\"]));\n }\n\n // This message is for an entitiy, loop through all entities and send the message to any with a matching ID.\n if(data[\"entity\"]){\n for(var i = 0; i < entities.length; i++){\n if(entities[i].id == data[\"entity\"]) {\n entities[i].message(data);\n }\n }\n }\n\n // Set a new camera behavior.\n if(data[\"camera\"]){\n cameraState.transitionStart = data[\"t\"];\n cameraState.previousBehavior = cameraState.behavior;\n cameraState.transitionDuration = Number(data[\"duration\"]);\n cameraState.behavior = data[\"camera\"];\n\n // Some camera states need to keep track of initial state when changing modes, set that here.\n switch(cameraState.behavior){\n case \"intro_climb\":\n cameraState.introStartY = player.getPosition().y;\n break;\n }\n }\n}", "title": "" }, { "docid": "0e63dff201b912f606eec969372f1437", "score": "0.6097207", "text": "function receivedMessage(event) {\r\n var senderID = event.sender.id;\r\n var recipientID = event.recipient.id;\r\n var timeOfMessage = event.timestamp;\r\n var message = event.message;\r\n\r\n var messageId = message.mid;\r\n\r\n // You may get a text or attachment but not both\r\n var messageText = message.text;\r\n var messageAttachments = message.attachments;\r\n\r\n\r\n if (messageText) { \r\n\r\n checkstatus(senderID,messageText,\"text\",\"\",\"\",\"\",\"\"); \r\n // If we receive a text message, check to see if it matches any special\r\n // keywords and send back the corresponding example. Otherwise, just echo\r\n // the text we received.\r\n // switch (messageText) { \r\n // case 'receipt':\r\n // sendReceiptMessage(senderID);\r\n // break;\r\n // default:\r\n // sendTextMessage(senderID, messageText);\r\n // }\r\n } else if (messageAttachments) {\r\n \r\n if(senderID!=\"401047436899065\")\r\n {\r\n if(messageAttachments[0].type==\"image\")\r\n { \r\n // sendTextMessage(senderID, \"Message with attachment received\");\r\n checkstatus(senderID, \"file\", messageAttachments[0].type, messageAttachments, \"\", \"\", \"\");\r\n\r\n }\r\n else{\r\n checkstatus(senderID, \"file\", messageAttachments[0].type, messageAttachments, \"\", \"\", \"\");\r\n }\r\n }\r\n \r\n\r\n }\r\n}", "title": "" }, { "docid": "75e29ecd67ac55397bc014d6f1c31b6d", "score": "0.6088334", "text": "function receivedMessage(event) {\n var senderID = event.sender.id;\n var recipientID = event.recipient.id;\n var timeOfMessage = event.timestamp;\n var message = event.message;\n\n console.log(\"Received message for user %d and page %d at %d with message:\",\n senderID, recipientID, timeOfMessage);\n console.log(JSON.stringify(message));\n\n var messageId = message.mid;\n\n // You may get a text or attachment but not both\n var messageText = message.text;\n var messageAttachments = message.attachments;\n\n\n if (messageText) {\n //sendTextMessage(senderID, \"Good Luck\");\n wiki.from_api(messageText.toLowerCase().split(\" \")[0], \"en\", function (markup) {\n var str = (wiki.plaintext(markup))\n //console.log(\"Result received \" + str)\n var sendTxt = \"\";\n if (str != \"\") {\n var result = str.match(/[^\\.!\\?]+[\\.!\\?]+/g)\n sendTxt = result[0]\n console.log(\"Result received \" + sendTxt)\n } else {\n sendTxt = \"Not Today :)\"\n }\n sendTextMessage(senderID, sendTxt);\n });\n\n } else if (messageAttachments) {\n sendTextMessage(senderID, \"Message with attachment received\");\n }\n}", "title": "" }, { "docid": "65c9b734ea48f13d3b89a54ae47bda15", "score": "0.60812736", "text": "modMessage(ob) {\n\t\t\treturn ob\n\t\t}", "title": "" }, { "docid": "2eed941125e20e4b2344ca5dd837dfb4", "score": "0.6078751", "text": "function showMsgDetail(msgElem, message) {\n console.log('showMsg: enter');\n const msgAddrArea = document.getElementById('msgAddrArea');\n const msgTextArea = document.getElementById('msgTextArea');\n const msgNoNotButton = document.getElementById('msgNoNotButton');\n msgAddrArea.disabled = true;\n msgTextArea.disabled = true;\n msgAddrArea.value = (!!message.ensName) ? message.ensName + ' (' + message.otherAddr + ')' : message.otherAddr;\n showIdAndRef(message.msgId, message.ref, true);\n msgDateArea.value = message.date;\n msgNoNotButton.textContent = parseInt(msgElem.msgNo).toString(10);\n msgTextArea.value = message.text;\n const attachmentSaveA = document.getElementById('attachmentSaveA');\n if (!!message.attachment) {\n\tattachmentSaveA.href = message.attachment.blob;\n\tattachmentSaveA.download = message.attachment.name;\n\tconst attachmentSaveSpan = document.getElementById('attachmentSaveSpan');\n\tattachmentSaveSpan.textContent = message.attachment.name;\n\tattachmentSaveA.style.display = 'inline-block';\n } else {\n\tattachmentSaveA.style.display = 'none';\n }\n const replyButton = document.getElementById('replyButton');\n replyButton.disabled = false;\n}", "title": "" }, { "docid": "06aaa66ca38e14614bfffa22eae5a146", "score": "0.60783094", "text": "_getMessageText(array_state, add_oid_name) {\n\t\tlet message_text = '';\n\t\tif(array_state[7] && array_state[7] != '') { //Text for message\n\t\t\tmessage_text = array_state[7];\n\t\t} else {\n\t\t\tswitch (array_state[6]) { //category\n\t\t\t\tcase 'fire':\n\t\t\t\t\tmessage_text = 'Fire in the house! Leave your home immediately!';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'gas':\n\t\t\t\t\tmessage_text = 'Gas leak in the house! Leave your home immediately!';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'co':\n\t\t\t\t\tmessage_text = 'Carbon monoxide in the house! Leave your home immediately!';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'water':\n\t\t\t\t\tmessage_text = 'Water ingress in the house! Close the main tap immediately!';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'vibration':\n\t\t\t\t\tmessage_text = 'Vibration alarm triggered! Check immediately!';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'window':\n\t\t\t\t\tmessage_text = 'Someone is trying to break into the window! Check immediately and call the police!';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'door':\n\t\t\t\t\tmessage_text = 'Someone is trying to break in through the doors! Check immediately and call the police!';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'others_contacts':\n\t\t\t\t\tmessage_text = 'Someone is trying to break in! Check immediately and call the police!';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'others_hazard':\n\t\t\t\t\tmessage_text = 'A hazard alarm has struck. Leave your house immediately!';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn (add_oid_name) ? (array_state[3] + '\\n\\n' + message_text) : (message_text);\n\t}", "title": "" }, { "docid": "897754f6543555316da81b8e847d05d4", "score": "0.6074903", "text": "function notifyUserOnIncomingMsges(messageObj){\n\n\t\t\t\t//TODO: msgNoteCout should be a JSON (associative array) \n\t\t\t\t//representing each contact. (only users with message notifications will be stored)\n\n\t\t\t\t//increment the message notification count \n\t\t\t\tmsgNoteCout++; \n\n\t\t\t\tconsole.log(msgNoteCout+\" incoming msg from \"+ messageObj.sender);\n\t\t\t\t\n\t\t\t\t//TODO: Store the messages in a client side data structure (and write it to the server, along with a message notification, if client signs out without reading the message)\n\n\t\t\t\t//add the notification count on the account field\n\t\t\t\tdocument.getElementById(messageObj.sender+\"_msg_notice\").textContent = msgNoteCout+\"\";\n\n\t\t}", "title": "" }, { "docid": "df4f7e5c9e55f352ad15ca9edf0ee66f", "score": "0.6074213", "text": "function onNewMessage(data) {\n // validate msg with data.sign\n var validationStatus = cryptoApi.validateMessage(data.sign);\n chatUi.displayMessage(data.msg,false,validationStatus);\n}", "title": "" }, { "docid": "af804698906b495f573b97d61055478a", "score": "0.6071547", "text": "function Message() { }", "title": "" }, { "docid": "63bed40d728086c877a03518a1c80837", "score": "0.60644114", "text": "_processMessage(msg, socket) {\n var message = msg;\n switch(message.command){\n case 'chatbox':\n this.game._ui.message(message.data);\n break;\n case 'alert':\n this.game._ui.alert(message.data);\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "3dc6673bb13012a9e8dcfde68600ae95", "score": "0.60635865", "text": "get messages () {\n return Object.assign(super.messages, {\n 'room_id.required': 'Você deve informar a sala de reunião',\n 'schedule_start.required': 'Você deve informar a data e hora de início da reunião',\n 'schedule_end.required': 'Você deve informar a data e hora de fim da reunião',\n 'accountable.required': 'Você deve informar o responsável pela reunião',\n 'is_coffee.required': 'Você deve informar se vai ter cafézinho na reunião',\n })\n }", "title": "" }, { "docid": "be3077de36f59314bf27a4c2716dd96d", "score": "0.6049689", "text": "message_received(data) {\n // if (data.embeds.length >= 1){\n // var embeds = data.embeds[0];\n // if(embeds.title === undefined){ embeds.title = \"\"; }\n // if(embeds.description === undefined){ embeds.description = \"\"; }\n // if(embeds.footer === undefined){ embeds.footer = \"\"; }\n // if(embeds.author === undefined){ embeds.author = {}; }\n // if(embeds.author.name === undefined){ embeds.author.name = \"\"; }\n // if(!embeds.title.includes(\"Slow it down\")){\n // }\n // }\n const msg = data.content;\n console.log(\"Message received: \", msg);\n }", "title": "" }, { "docid": "33a2e7296768a698489067c0eb82594f", "score": "0.6047297", "text": "function messagereceivedHandler(e) {\n var messageSize = e.detail.length;\n for (var i = 0; i < messageSize; i++){\n for (var key in e.detail[i].data) {\n switch (key) {\n //When server started message is received from background task a variable is set\n case constants.BackgroundTaskStarted: \n readyforPlaybackObj.init();\n break;\n case constants.Trackchanged: \n document.getElementById(\"txtCurrentTracktext\").innerHTML = e.detail[i].data[key];\n break;\n }\n } \n } \n}", "title": "" }, { "docid": "56f6d16eea1fa41c5baabfb5a990c082", "score": "0.6028088", "text": "function onMessageArrived(message) {\n var data = JSON.parse(message.payloadString);\n console.log(\"mqtt——msg\",data)\n var sendTime = new Date();\n _this.time = sendTime;\n var commentList=\"\";\n switch(data.type)\n {\n case \"message\":\n $(\".nothingSay\")&&$(\".nothingSay\").remove();\n ++_this.commentCount;\n commentList+='<li class=\"streamInfo\">'+\n '<div class=\"ui-avatar-s\">'+\n '<span style=\"background-image:url('+data.metaInfo.avatarUrl+')\"></span>'+\n '</div>'+\n '<div class=\"ui-list-info\">'+\n '<h4 class=\"ui-nowrap\">'+data.metaInfo.displayName+'<small class=\"date\">'+formatDate(_this.time,'yyyy-MM-dd HH:mm')+'</small></h4>'+\n '<div>'+data.metaInfo.content+'</div>'+\n '</div>'+\n '</li>'\n $(\".infoBox\").append(commentList);\n $(\"#infobox\").scrollTop($(\"#infobox\")[0].scrollHeight);\n break;\n case \"question\":\n $(\".nothingSay\")&&$(\".nothingSay\").remove();\n ++_this.commentCount;\n commentList+='<li class=\"streamInfo\">'+\n '<div class=\"ui-avatar-s\">'+\n '<span style=\"background-image:url('+data.metaInfo.avatarUrl+')\"></span>'+\n '</div>'+\n '<div class=\"ui-list-info\">'+\n '<h4 class=\"ui-nowrap\">'+data.metaInfo.displayName+'<div class=\"userqusetion\"><img src='+_this.addr+'assets/img/question.png /></div><small class=\"date\">'+formatDate(_this.time,'yyyy-MM-dd HH:mm')+'</small></h4>'+\n '<div class=\"questionContent\">'+data.metaInfo.content+'</div>'+\n '</div>'+\n '</li>'\n $(\".infoBox\").append(commentList);\n $(\"#infobox\").scrollTop($(\"#infobox\")[0].scrollHeight);\n break;\n case \"audience_num\"://在现观众\n _this.audienceNum = data.metaInfo.count;\n break;\n case \"stream.status\":\n if(data.content.status==\"stream.pause\"){\n _this.clearpauseTip()\n $(\".live_playBack #video\").hide()\n $(\"#videoBox\").append(\"<div class='pauseTip'></div>\")\n $(\".pauseTip\").css(\"backgroundImage\",\"url(\"+_this.posterImg+\")\")\n $(\"#videoBox\").append(\"<span class='pauseTipText'>主播暂时离开</span>\")\n }else if(data.content.status==\"stream.publish\"){\n _this.clearpauseTip()\n _this.getVideoInfoAgin()\n }else if(data.content.status==\"stream.unpublish\"){\n _this.clearpauseTip()\n $(\".live_playBack #video\").hide()\n $(\"#videoBox\").append(\"<div class='pauseTip'></div>\")\n $(\".pauseTip\").css(\"backgroundImage\",\"url(\"+_this.posterImg+\")\")\n $(\"#videoBox\").append(\"<p class='pauseTipText'>主播已结束直播<br>共<span class='audienceCount greenPoint'>\"+_this.audienceNum+\"人</span>观看</p>\")\n }else{return;}\n break;\n case \"stream_closed\":\n alert(data.metaInfo.content)\n }\n $(\".dialogue\").html(_this.commentCount);\n $(\".peopleCount\").html(_this.audienceNum);\n }", "title": "" }, { "docid": "c4ad1104ae081076e7a74c5df20a797b", "score": "0.60258824", "text": "function private_message_received_info(data)\r\n {\r\n \t if(data['text'] == \"undefined\") data['text'] = \" \";\r\n\r\n var out = \"<TABLE cellpadding=\\\"2\\\" cellspacing=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\" ><tr><td><b>\"+data['user_name']+\"</b>: <span style='color:#AAAAAA'> (\"+data['nick']+\")</b> <a href='#' onclick='parent.config_start(\\\"\" + data['link'] + \"\\\")'><img border='0' valign=middle src=\\\"\"+ChatTemplatePath+\"img/prv_msg.bmp\\\"></a>\t\"+data['text']+\"</span></td></tr></TABLE>\";\r\n\r\n document.getElementById(\"IFRAME_TEXT\").contentWindow.document.getElementById(\"data\").innerHTML += out;\r\n IFRAME_TEXT.scrollTo(0,document.getElementById(\"IFRAME_TEXT\").contentWindow.document.body.scrollHeight);\r\n }", "title": "" }, { "docid": "14baa8d7fa7f89511b8fb4909cdd26cd", "score": "0.6025008", "text": "function jerry_analyse_incoming_love_message ( p_message )\r\n{\r\n\t/* Si message du boss */\r\n\tif ( p_message.author.id === g_mac )\r\n\t{\r\n\t\t/* Si commande activation */\r\n\t\tif ( p_message.content === \"!=jerry,=enable\" )\r\n\t\t{\r\n\t\t\tg_active = 1;\t\r\n\t\t}\r\n\t\t\r\n\t\t/* Sinon si commande désactivation */\r\n\t\telse if ( p_message.content === \"!=jerry,=disable\" )\r\n\t\t{\r\n\t\t\tg_active = 0;\t\r\n\t\t}\r\n\t\t\r\n\t\t/* Sinon */\r\n\t\telse;\r\n\t}\r\n\t\r\n\t\r\n\t/* Si le message entrant provient de Zal ou Oli */\r\n\tif ( ( g_active == 1 ) && ( ( p_message.author.id === g_oli ) || ( p_message.author.id === g_mac ) ) )\r\n\t{\r\n\t\t/* Détermination du nombre d'élément dans le tableau */\r\n\t\tl_love_table_length = g_loveTable.length;\r\n\t\t\r\n\t\t/* Création d'une chaine de caractères */\r\n\t\tl_incoming_message = p_message.content;\r\n\t\t\r\n\t\t/* Comparaison du mot courant avec les mots d'amour interdit */\r\n\t\tfor ( l_love_table_counter = 0 ; l_love_table_counter < l_love_table_length ; l_love_table_counter++ )\r\n\t\t{\r\n\t\t\tvar regexp = new RegExp ( g_loveTable[ l_love_table_counter ], 'i' );\r\n\t\t\t\r\n\t\t\tif ( regexp.test ( l_incoming_message ) != 0 )\r\n\t\t\t{\r\n\t\t\t\t/* Suppression du message entrant */\r\n\t\t\t\tp_message.delete ( );\r\n\t\t\t\t\r\n\t\t\t\t/* Affichage d'un message */\r\n\t\t\t\tp_message.channel.send ( \"Never go full retard ! Bisous Zal, Oli \\:sparkling_heart: !\" );\r\n\t\t\t\r\n\t\t\t\t/* Arrêt de la boucle */\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\r\n\t\t\t/* Sinon */\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t/* Ne rien faire */\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t/* Sinon */\r\n\telse\r\n\t{\r\n\t\t/* Ne rien faire */\r\n\t}\r\n}", "title": "" }, { "docid": "655cbd7ad644b472185f8e093961372c", "score": "0.60240567", "text": "function receivedMessage(event) {\n\n \n\n\n var senderID = event.sender.id;\n var recipientID = event.recipient.id;\n var timeOfMessage = event.timestamp;\n var message = event.message;\n\n console.log(\"Received message for user %d and page %d at %d with message:\", \n senderID, recipientID, timeOfMessage);\n console.log(JSON.stringify(message));\n\n var isEcho = message.is_echo;\n var messageId = message.mid;\n var appId = message.app_id;\n var metadata = message.metadata;\n\n // You may get a text or attachment but not both\n var messageText = message.text;\n var messageAttachments = message.attachments;\n var quickReply = message.quick_reply;\n\n if (isEcho) {\n // Just logging message echoes to console\n console.log(\"Received echo for message %s and app %d with metadata %s\", \n messageId, appId, metadata);\n return;\n } else if (quickReply) {\n var quickReplyPayload = quickReply.payload;\n console.log(\"Quick reply for message %s with payload %s\",\n messageId, quickReplyPayload);\n\n sendTextMessage(senderID, \"Quick reply tapped\");\n return;\n }\n\n\n\n if (messageText) {\n\n // If we receive a text message, check to see if it matches any special\n // keywords and send back the corresponding example. Otherwise, just echo\n // the text we received.\n switch (messageText) {\n case 'image':\n sendImageMessage(senderID);\n break;\n\n case 'gif':\n sendGifMessage(senderID);\n break;\n\n case 'audio':\n sendAudioMessage(senderID);\n break;\n\n case 'video':\n sendVideoMessage(senderID);\n break;\n\n case 'file':\n sendFileMessage(senderID);\n break;\n\n case 'button':\n sendButtonMessage(senderID);\n break;\n\n case 'generic':\n sendGenericMessage(senderID);\n break;\n\n case 'receipt':\n sendReceiptMessage(senderID);\n break;\n\n case 'quick reply':\n sendQuickReply(senderID);\n break; \n\n case 'read receipt':\n sendReadReceipt(senderID);\n break; \n\n case 'typing on':\n sendTypingOn(senderID);\n break; \n\n case 'typing off':\n sendTypingOff(senderID);\n break; \n\n case 'account linking':\n sendAccountLinking(senderID);\n break;\n\n default:\n // match a greeting intent and send a response,\n if (messageText == \"hi\" || messageText == \"hello\") {\n sendTextMessage(senderID, \"Hello there.\");\n } \n // match an intent to talk to a real human\n else if (messageText == \"help\" || messageText == \"operator\") {\n // send a janis alert to your slack channel\n // that the user could use assistance\n janis.assistanceRequested(event);\n // let the user know that they are being routed to a human\n sendTextMessage(senderID, \"Hang tight. Let me see what I can do.\");\n }\n // otherwise log an unknown intent with janis\n else {\n // capture conversational ‘dead-ends’.\n janis.logUnkownIntent(event);\n // let the user know that the bot does not understand\n sendTextMessage(senderID, \"Huh?\");\n } \n }\n } else if (messageAttachments) {\n sendTextMessage(senderID, \"Message with attachment received\");\n }\n}", "title": "" }, { "docid": "0cfe334d6b4d1cd0ef45bee36e6ad65b", "score": "0.60217553", "text": "function infoMsgReceveid () {\n\n var timeMsg = $(this).parent().siblings('.message-time').text(); // salvo l'orario del messaggio scritto da me\n\n var nameContact = $('.chat-contacts li.active-chat').find('h3').text(); // salvo il nome del contatto attivo\n\n\n $('.info-container').fadeIn(); // la finestra delle info compare\n $('.dropdown-menu.r').fadeOut(); // scompare il dropdown-menu\n $('.info-container .title-name-msg').text(\"Il messaggio è stato inviato da: \" + nameContact); // aggiungo il nome del contatto che ha inviato il messaggio\n $('.info-container .title-time-msg').text(\"Il messaggio è stato inviato alle ore: \" + timeMsg); // aggiungo l'ora di invio messaggio\n }", "title": "" }, { "docid": "5b14ea5aada55df92de60fe1a1269cbb", "score": "0.6021488", "text": "function messageHandler(msg) {\n\n switch (msg.uneeqMessageType) {\n\n // SessionLive: Everything has loaded and the digital human is ready for interaction\n case 'SessionLive':\n\n // Add key listeners on spacebar for start and stop recording\n addPTTKeyListeners();\n\n // Clear the onscreen prompts\n msgDisplay.innerHTML = '';\n\n // Transition the UI from loading state to live state\n document.body.classList.remove('loading');\n document.body.classList.add('live');\n break;\n\n\n // The digital human has received a question (utterance) from the user\n case 'AvatarQuestionText':\n\n // Display the question spoken by the user on screen\n document.getElementById('local-transcript').innerHTML = 'User: ' + msg.question;\n break;\n\n\n // The digital human has an answer to the question\n case 'AvatarAnswer':\n\n // Add the new element onto the screen\n document.getElementById('transcript').innerHTML = 'Digital Human: ' + msg.answerSpeech;\n break;\n\n\n default:\n\n // Additional messages sent by uneeq-js that can be handled.\n console.log('uneeq-js: Unhandled message \\'' + msg.uneeqMessageType + '\\'', msg);\n break;\n }\n}", "title": "" }, { "docid": "f617691a6ad6f587d1e7cf20677c59e3", "score": "0.6008565", "text": "function playerStatus() {\n var msg = {};\n msg[\"MESSAGE_TYPE\"] = \"CLIENT_UPDATE\";\n msg[\"CURRENT_FRAME\"] = frame;\n msg[\"PLAYER_NUMBER\"] = playerNumber;\n msg[\"PLAYER_NAME\"] = myName;\n msg[\"TIME_STAMP\"] = new Date().getTime();\n msg[\"FRAME\"] = frame;\n msg[\"COLLISION\"] = collision;\n msg[\"GOT_APPLE\"] = got_apple;\n msg[\"GOT_QUEUE\"] = got_queue;\n\n if (playerNumber == 1) {\n msg[\"CLIENT_DIRECTION\"] = snake1.direction;\n msg[\"CLIENT_QUEUE\"] = snake1._queue;\n } \n \n else if (playerNumber == 2) {\n msg[\"CLIENT_DIRECTION\"] = snake2.direction;\n msg[\"CLIENT_QUEUE\"] = snake2._queue;\n }\n return msg;\n}", "title": "" }, { "docid": "8bb24ca5b661734bd2fe2eebc9139cc9", "score": "0.60064346", "text": "function onMessageArrived(message) {\n console.log(\"onMessageArrived: \" + message.payloadString);\n document.getElementById(\"messages\").innerHTML += '<span>Topic: ' + message.destinationName + ' | ' + message.payloadString + '</span><br/>';\n \n // COndição baseada na informação de outro canal\n //if (Number(message.payloadString) < 20) {\n // publicarMensagem(\"pegou\", \"esp/ALGUMA_COISA\");\n //}\n \n // é possivel tambem, salvar no firebase a mensagem que é enviada da interface para o esp\n //save_user(message.payloadString);\n }", "title": "" }, { "docid": "c7476a47ca89fb0fd00953825d81a298", "score": "0.60056555", "text": "dataMessage () {\n if (this._fin) {\n const messageLength = this._messageLength;\n const fragments = this._fragments;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragmented = 0;\n this._fragments = [];\n\n if (this._opcode === 2) {\n var data;\n\n if (this._binaryType === 'nodebuffer') {\n data = toBuffer(fragments, messageLength);\n } else if (this._binaryType === 'arraybuffer') {\n data = toArrayBuffer(toBuffer(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.onmessage(data);\n } else {\n const buf = toBuffer(fragments, messageLength);\n\n if (!isValidUTF8(buf)) {\n this.error(new Error('invalid utf8 sequence'), 1007);\n return;\n }\n\n this.onmessage(buf.toString());\n }\n }\n\n this._state = GET_INFO;\n }", "title": "" }, { "docid": "b49c21025e5b69425a1c8809c8b440d5", "score": "0.59988153", "text": "static sendMessage(message, info, remove, removeDelay) {\n let footer = '';\n if (info.footer !== undefined) {\n footer = { info };\n } else if (info.request !== undefined) {\n footer = FOOTER_REQUEST(message, info.requestTime);\n }\n\n Messenger.send(message, {\n title: info.title ? info.title : '',\n avatar: info.avatar ? info.avatar : '',\n color: info.color ? info.color : 0x3498db,\n fields: info.fields ? info.fields : '',\n description: info.description ? info.description : '',\n footer,\n }, remove, removeDelay);\n }", "title": "" }, { "docid": "98d19ac1da180b79d899cf9fadecb59d", "score": "0.5995527", "text": "function record_message(msg) {\n let message_name = msg.content.match(/{{name=.*?}}/g);\n if (message_name === null) {\n LOG.debug('record_message() - other message has no name');\n return;\n }\n\n let message_log_index = state[STATE_NAME][MESSAGE_LOG_INDEX];\n state[STATE_NAME][MESSAGE_LOG][message_log_index] = msg;\n message_log_index = message_log_index + 1;\n if (message_log_index === MESSAGE_LOG_SIZE) {\n message_log_index = 0;\n }\n state[STATE_NAME][MESSAGE_LOG_INDEX] = message_log_index;\n }", "title": "" }, { "docid": "722884e3e4230874ce4e453fbbba7bfa", "score": "0.5989514", "text": "handleMessageChanged (data) {\n\n }", "title": "" }, { "docid": "3f082cb8fa9aa89deeee8eb64140730d", "score": "0.59844947", "text": "function handleMessage(message) {\n if (typeof message.data === 'string') {\n wlog(message.data);\n } else if (message.data['cmd'] == 'setParameters') {\n onSetParameters();\n } else if (message.data['cmd'] == 'bindSuccess') {\n onBindSuccess();\n }\n}", "title": "" }, { "docid": "da73b061046d55a87e35f80d8a174ff0", "score": "0.59799427", "text": "info(message) {\n this.setStyle(NotificationStyle.info);\n this.render(message);\n }", "title": "" }, { "docid": "283326c320a18cbfe25859a1e7d726f8", "score": "0.5976651", "text": "dispatchMessage(msg, user) {\n log.warn(\"We're in dispatcher!!11\");\n const stateObject = this.findStateByName(user.state);\n log.info('StateObject: ', stateObject);\n log.info('Msg text: ', msg.text);\n if (msg.text) {\n const dbmes = new Message();\n dbmes.userid = msg.from.id;\n dbmes.text = msg.text;\n dbmes.date = new Date().toISOString();\n dbmes.object = msg;\n\n dbmes\n .save()\n .then(db => {\n log.info('Message saved in db:', db);\n })\n .catch(err => {\n log.error('Error while saving message in db:', err);\n });\n }\n\n if (stateObject.textExpected) {\n // accept text and check, that function-handler exists\n if (\n stateObject.textHandlerFunction != 'undefined' &&\n typeof this.scenarioHandler[stateObject.textHandlerFunction] === 'function'\n ) {\n // just call this function\n if (stateObject.textHandlerFunctionAsync) {\n this.scenarioHandler[stateObject.textHandlerFunction](\n user,\n msg.text,\n this.textMessageCallbackHandler.bind(this)\n );\n } else {\n const functionResult = this.scenarioHandler[stateObject.textHandlerFunction](user, msg.text);\n }\n } else {\n log.error(\n 'Text handling error occurred! Debug info below. Function name:',\n stateObject.textHandlerFunction,\n '. Function object:',\n this.scenarioHandler[stateObject.textHandlerFunction]\n );\n }\n } else {\n // TODO: think about error messaging, then text don't expected\n // currenty repeat form, we can also write error message\n const options = {\n reply_markup: JSON.stringify({\n inline_keyboard: stateObject.buttons,\n }),\n };\n // TODO: think about removing eval\n let responseText;\n try {\n responseText = eval(`\\`${stateObject.text}\\``);\n } catch (ex) {\n responseText =\n 'Возникла внутренняя ошибка при генерации текста сообщения. Приносим свои извинения, попробуйте вернуться в главное меню.';\n }\n this.emitMessage(user, responseText, options, false);\n }\n }", "title": "" }, { "docid": "5bf277ec2d0059163e1bddf4f72c31f9", "score": "0.59722984", "text": "getMessageHeader() {\r\n return { \"id\": this.id, \"width\": this.width, \"height\": this.height, \"mines\": this.num_bombs, \"seed\": this.seed, \"gametype\" : this.gameType};\r\n\t}", "title": "" }, { "docid": "5bf277ec2d0059163e1bddf4f72c31f9", "score": "0.59722984", "text": "getMessageHeader() {\r\n return { \"id\": this.id, \"width\": this.width, \"height\": this.height, \"mines\": this.num_bombs, \"seed\": this.seed, \"gametype\" : this.gameType};\r\n\t}", "title": "" }, { "docid": "41c04aabb7286ba67a935110c7746809", "score": "0.5969988", "text": "async handleMessage( msg ) {\n const { message, user } = msg;\n\n if (!user || !message || !message.trim().length ) {\n return;\n }\n\n logger.debug('running handleMessage');\n\n try { \n const response = await this.luis.handleMessage( message );\n\n // returns an object formatted like this: \n // intent: 'intent'\n // entities: { location: ''}\n const intent = response.intent;\n const entities = response.entities;\n \n logger.debug(\"luis returned: intent: %o, entities: %o \" , intent, entities );\n \n if( intent === 'None' ) {\n this.sendIM( user, \"Sorry i didn't understand your request.\\nYou can ask me about the weather in a location.\" );\n }\n else if( !entities.location ) {\n this.sendIM( user,\"I don't know which location you want the weather for.\");\n } \n else if( !entities.forecast ) {\n this.handleWeather( user, entities );\n } \n else {\n this.handleForecast( user, entities ); \n }\n }\n catch( error ){\n logger.error( \"Error returned by handlemessage %o\", error)\n this.sendIM( user, \"Sorry, I couldn't analyze your request.\" );\n }\n }", "title": "" }, { "docid": "6a6f866da3f19fc5987a5eaad0aed7c1", "score": "0.59613913", "text": "function messageReflect(msg) {\n\t\tvar method = msg[\"methodName\"];\n\t\tswitch(method) {\n\t\t\tcase \"showLinkedItems\":\n\t\t\t\tconsole.log(\"showLinkedItems();\");\n\t\t\t\tshowLinkedItems(msg[\"items\"]);\n\t\t\t\tbreak;\n\t\t\tcase \"uploadFile\":\n\t\t\t\tconsole.log(\"uploadFile();\");\n\t\t\t\tuploadFile(msg[\"filePath\"]);\n\t\t\t\tbreak;\n\t\t\tcase \"openFile\":\n\t\t\t\tconsole.log(\"openFile()\");\n\t\t\t\tFileSystem.openFile(_clientModel.getRootPath() + \"/\" + msg[\"filePath\"]);\n\t\t\t\tbreak;\n\t\t\tcase \"openUrlInBrowser\":\n\t\t\t\tconsole.log(\"openUrlInBrowser()\");\n\t\t\t\tFileSystem.openUrlInBrowser(msg[\"url\"]);\n\t\t\t\tbreak;\n\t\t\tcase \"setInstalledClients\":\n\t\t\t\tconsole.log(\"setInstalledClients();\" + msg[\"clients\"]);\n\t\t\t\tsetInstalledClients(msg[\"clients\"]);\n\t\t\t\tbreak;\n\t\t\tcase \"setConnectedClients\":\n\t\t\t\tconsole.log(\"setConnectedClients();\" + msg[\"clients\"]);\n\t\t\t\tsetConnectedClients(msg[\"clients\"]);\n\t\t\t\tbreak;\n\t\t\tcase \"addToLinkQueue\":\n\t\t\t\tconsole.log(\"addToLinkQueue()\");\n\t\t\t\taddToLinkQueue(msg[\"fileInfo\"]);\n\t\t\t\tbreak;\n\t\t\tcase \"removeFromLinkQueue\":\n\t\t\t\tconsole.log(\"removeFromLinkQueue()\");\n\t\t\t\tremoveFromLinkQueue(msg[\"fileInfo\"]);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tconsole.log(\"Unrecognized method requested: \" + method);\n\t\t};\n\t}", "title": "" }, { "docid": "c33acf5f8907ee0ae18070748132b5fa", "score": "0.59607655", "text": "generateMessage(message, status) {\n const currentChat = this.contacts[this.activeContact].messages;\n const newMessage = {\n date: dayjs().format(\"DD/MM/YYYY HH:mm:ss\"),\n message: message,\n status: status,\n };\n currentChat.push(newMessage);\n }", "title": "" }, { "docid": "59afc70db16882a0e4870502d72f8731", "score": "0.59535724", "text": "function getUnsetMessage(msg, channel) {\n\tswitch (channel) {\n\t\tcase 'engine_on':\n return {\n\t\t\t...msg,\n\t\t\t...{'engine_on': false}\n\t\t};\n\t\tbreak;\n\t\tcase 'engine_off':\n return {\n\t\t\t...msg,\n\t\t\t...{'engine_off': false}\n\t\t};\n\t\treturn {'engine_off': false};\n\t\tbreak;\n\t\tcase 'joystick_mode':\n return {\n\t\t\t...msg,\n\t\t\t...{'joystick_mode': false}\n\t\t};\n\t\tbreak;\n\t\tcase 'pallet_raise':\n\t\tcase 'pallet_lower':\n return {\n\t\t\t...msg,\n\t\t\t...{'pallet_height': 0}\n\t\t};\n break;\n\t\tcase 'pallet_angle_up':\n\t\tcase 'pallet_angle_down':\n return {\n\t\t\t...msg,\n\t\t\t...{'pallet_tilt': 0}\n\t\t};\n\t\tbreak;\n\t\tcase 'intake_raise':\n\t\tcase 'intake_lower':\n return {\n\t\t\t...msg,\n\t\t\t...{'dammer_height': 0}\n\t\t};\n\t\tbreak;\n case 'track_width_widen':\n\t\tcase 'track_width_narrow':\n return {\n\t\t\t...msg,\n\t\t\t...{'track_width': 0}\n\t\t};\n\t\tbreak;\n case 'lane_hold_assist':\n return {\n\t\t\t...msg,\n\t\t\t...{'toggle_lanefollow_mode': true}\n\t\t};\n\t\tbreak;\n case 'soil_flow_track_assist':\n return {\n\t\t\t...msg,\n\t\t\t...{'toggle_soilflow_track_control': true}\n\t\t};\n\t\tbreak;\n case 'soil_flow_belt_assist':\n return {\n\t\t\t...msg,\n\t\t\t...{'toggle_soilflow_belt_control': true}\n\t\t};\n\t\tbreak;\n case 'height_assist':\n return {\n\t\t\t...msg,\n\t\t\t...{'toggle_intake_height_control': true}\n\t\t};\n\t\tbreak;\n case 'speed_assist':\n return {\n\t\t\t...msg,\n\t\t\t...{'toggle_speed_control': true}\n\t\t};\n\t\tbreak;\n case 'hmi_active':\n return {\n\t\t\t...msg,\n\t\t\t...{'toggle_hmi_mode': true}\n\t\t};\n\t\tbreak;\n case 'machine_paused':\n return {\n\t\t\t...msg,\n\t\t\t...{'pause_operation': false}\n\t\t};\n\t\tbreak;\n\t\tdefault:\n\t\tthrow `Channel - ${channel} - not recognized!`;\n\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "6ec5861d723abe2e7ae7420e50c02770", "score": "0.59494656", "text": "function onMessageArrived(message) {\n switch (message.destinationName) {\n case \"tomate/temperaturadoar\":\n views.updateAirTemperature(message.payloadString)\n break;\n case \"tomate/umidadedoar\":\n views.updateAirHumidity(message.payloadString)\n break;\n case \"tomate/temperaturadosolo1\":\n views.updateSoilTemperature1(message.payloadString)\n break;\n case \"tomate/umidadedoar1\":\n views.updateAirHumidity1(message.payloadString)\n break;\n case \"tomate/vazao1\":\n views.updateFlow1(message.payloadString)\n break;\n case \"tomate/nivel1\":\n views.updateLevel1(message.payloadString)\n break;\n case \"tomate/temperaturadosolo2\":\n views.updateSoilTemperature2(message.payloadString)\n break;\n case \"tomate/umidadedoar2\":\n views.updateAirHumidity2(message.payloadString)\n break;\n case \"tomate/vazao2\":\n views.updateFlow2(message.payloadString)\n break;\n case \"tomate/nivel2\":\n views.updateLevel2(message.payloadString)\n break;\n case \"tomate/umidadedoar3\":\n views.updateAirHumidity3(message.payloadString)\n break;\n case \"tomate/vazao3\":\n views.updateFlow3(message.payloadString)\n break;\n case \"tomate/nivel3\":\n views.updateLevel3(message.payloadString)\n break;\n default:\n break;\n }\n}", "title": "" }, { "docid": "5fbf551d4581fb116d976898c58ae557", "score": "0.5944935", "text": "function MessageBuilder(type, data, me) {\n\tconsole.log('MessageBuilder'.bgWhite.green);\n\ttry {\n\t\t// ---------------------------------------------------------------------------------------------------\n\t\tvar msgType = type;\n\t\tvar textInput = \"\";\n\t\tvar dataAtual = new Date();\n\t\tvar logTime = jsMoment(dataAtual).format('DD/MM/gg H:mm:ss');\n\t\t// ---------------------------------------------------------------------------------------------------\n\t\tvar cstConnect = 0;\n\t\tvar cstDisconnect = 1;\n\t\tvar cstMessageSend = 2;\n\t\tvar cstFileTransfer = 3;\n\t\tvar cstFileAccept = 4;\n\t\tvar cstFileCancel = 5;\n\t\tvar cstTransferFinished = 6;\n\t\tvar cstCall = 7;\n\t\tvar cstAcceptCall = 8;\n\t\tvar cstRefuseCall = 9;\n\t\tvar cstGeneralInfo = 10;\n\t\tvar cstMessage = 11;\n\t\tvar cstFiles = 12;\n\t\tvar cstCalls = 13;\n\t\tvar cstErrors = 15;\n\t\t// ---------------------------------------------------------------------------------------------------\n\t\tswitch (msgType) {\n\t\t\tcase cstConnect:\n\t\t\t\ttextInput = '÷ ' + cstGeneralInfo + '÷ ' + logTime + ' ÷ Usuário ' + me.username + ' conectou.';\n\t\t\t\tbreak;\n\t\t\tcase cstDisconnect:\n\t\t\t\ttextInput = '÷ ' + cstGeneralInfo + '÷ ' + logTime + ' ÷ Usuário ' + me.userid + ' desconectou.';\n\t\t\t\tbreak;\n\t\t\tcase cstMessageSend:\n\t\t\t\ttextInput = '÷ ' + cstMessage + '÷ ' + logTime + ' ÷ ' + me.Nome + ' enviou mensagem para ' + me.Nome + '.';\n\t\t\t\tif (data.msg) { textInput += '÷ Mensagem: ' + data.msg + ' \\n' };\n\t\t\t\tbreak;\n\t\t\tcase cstFileTransfer:\n\t\t\t\ttextInput = '÷ ' + cstFiles + '÷ ' + logTime + ' ÷ Usuário ' + me.Nome + ' aceitou receber o arquivo.';\n\t\t\t\tif (data.name) { textInput += '÷ Arquivo: ' + data.name + '\\n' };\n\t\t\t\tbreak;\n\t\t\tcase cstFileAccept:\n\t\t\t\ttextInput = '÷ ' + cstFiles + '÷ ' + logTime + ' ÷ Usuário ' + me.Nome + ' recebeu arquivo de ' + data.username + '.';\n\t\t\t\tif (data.fileName) { textInput += '÷ Arquivo: ' + data.fileName + '\\n' };\n\t\t\t\tbreak;\n\t\t\tcase cstFileCancel:\n\t\t\t\ttextInput = '÷ ' + cstFiles + '÷ ' + logTime + ' ÷ Usuário ' + me.userid + ' cancelou a transferência do arquivo enviado por ' + data.remetente + '.';\n\t\t\t\ttextInput += '÷ Arquivo: ' + data.fileName + ' \\n';\n\t\t\t\tbreak;\n\t\t\tcase cstTransferFinished:\n\t\t\t\ttextInput = '÷ ' + cstFiles + '÷ ' + logTime + ' ÷ Arquivo enviado por ' + data.username + ' terminou de ser transferido para ' + me.Nome + '.';\n\t\t\t\tif (data.msg) { textInput += '÷ Arquivo: ' + data.msg + ' \\n' };\n\t\t\t\tbreak;\n\t\t\tcase cstCall:\n\t\t\t\ttextInput = '÷ ' + cstCalls + '÷ ' + logTime + ' ÷ Usuário X está tentando iniciar uma chamada de vídeo com usuario Y.';\n\t\t\t\t//if (data.msg) { textInput += '÷ Arquivo: ' + data.msg + ' \\n' }\t\t\t\t;\n\t\t\t\tbreak;\n\t\t\tcase cstAcceptCall:\n\t\t\t\ttextInput = '÷ ' + cstCalls + '÷ ' + logTime + ' ÷ Usuário ' + data.username + ' aceitou a chamada de vídeo com: ' + me.username + '.';\n\t\t\t\tif (data.msg) { textInput += '÷ Arquivo: ' + data.msg + ' \\n' };\n\t\t\t\tbreak;\n\t\t\tcase cstRefuseCall:\n\t\t\t\ttextInput = '÷ ' + cstCalls + '÷ ' + logTime + ' ÷ Usuário ' + data.username + ' não aceitou a chamada de vídeo com: ' + me.username + '.';\n\t\t\t\tif (data.msg) { textInput += '÷ Arquivo: ' + data.msg + ' \\n' };\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t};\n\t\treturn textInput;\n\t} catch (ex) {\n\t\treturn new Error(ex);\n\t};\n}", "title": "" }, { "docid": "3fb3f8aab5f61c6a2121762b8d8de1f5", "score": "0.594321", "text": "function receivedMessage(event) {\n var senderID = event.sender.id;\n var recipientID = event.recipient.id;\n var timeOfMessage = event.timestamp;\n var message = event.message;\n\n //console.log(\"Received message for user %d and page %d at %d with message:\",\n //senderID, recipientID, timeOfMessage);\n console.log(JSON.stringify(message));\n\n var messageId = message.mid;\n\n // You may get a text or attachment but not both\n var messageText = message.text;\n var messageAttachments = message.attachments;\n\n console.log(\"message: \"+messageText);\n if (messageText) {\n //sendMessage(senderID,messageText);\n //sendMessage(senderID, messageText);\n //console.log(\"after two echos\");\n // If we receive a text message, check to see if it matches any special\n // keywords and send back the corresponding example. Otherwise, just echo\n // the text we received.\n switch (stateOftheApp.state[0]) {\n case 0:\n console.log(\"case 0\");\n if(stateOftheApp.state[1] === 0) sendMessage(senderID,\"Hey! I’m Wingbot. I can help you write your online dating Profile\");\n if (messageText === \"hello\") {\n sendMessage(senderID,\"What should I call you?\");\n stateOftheApp.state[0] = 1;\n } else stateOftheApp.state[1] = 1;\n break;\n case 1:\n user.name = messageText;\n if (user.name === \" \") {\n user.name = messageText;\n stateOftheApp.state[0] = 1;\n } else {\n sendMessage(senderID, \"Nice to meet you \"+messageText);\n chooseGender(event);\n }\n break;\n case 2:\n console.log(\"inside case 2\");\n\n //counterHell = 0;\n if (stateOftheApp.state[1] === 0) {\n if (isNegative(messageText)) {\n sendMessage(senderID,\"This does not seem like a very positive fact about yourself, are you sure you do not want to change your answer?\");\n stateOftheApp.userAnswer = messageText;\n } else {\n console.log(\"app state: \"+stateOftheApp.state);\n console.log(\"message: \"+messageText);\n if(stateOftheApp.state[0] === 2) sendMessage(senderID,getReaction());\n console.log(\"passed Reactions\");\n //user.facts.push(messageText);\n //console.log(\"check if pool \"+checkIfPool(messageText));\n //stateOftheApp.catPool = 4;\n //console.log(\"check if pool \"+checkIfPool(messageText));\n //stateOftheApp.catPool = checkIfPool(messageText);\n //askKeyquestions(event);\n }\n } else {\n sendMessage(senderID,getReaction());\n //user.facts.push(messageText);\n //stateOftheApp.catPool = checkIfPool(messageText);\n }\n break;\n case 3:\n var chosenPool = getObject(stateOftheApp.catPool);\n if (stateOftheApp.state[1] === 0) {\n if (isNegative(messageText)) {\n //if first key question is not liked you get a random catPool num and ask question again\n stateOftheApp.catPool = Math.floor(Math.random() * 5)+1;\n askKeyquestions(event);\n } else {\n //if they like the first question we send the subquestion:\n stateOftheApp.state[1] = 1;\n sendMessage(senderID,chosenPool.subquestion[stateOftheApp.secondQuestion]);\n }\n } else {\n //if this is a repeat it means user is answering subquestion; we store the answeredQuestions and count++ to that pool\n sendMessage(senderID,getReaction());\n storeAnsweredQuestions(chosenPool.index, messageText);\n addPointsToPersonality(chosenPool.index);\n stateOftheApp.state[1] = 0;\n askKeyquestions(event);\n }\n break;\n\n case 3:\n sendReceiptMessage(senderID);\n break;\n\n default:\n sendMessage(senderID, \"Excuse I did not quite get that, can you repeat?\");\n }\n }\n}", "title": "" }, { "docid": "94059502578a03275b876c43c11d08d6", "score": "0.59414953", "text": "function incomingMessage(message)\n{\n //\n let datetime = formatDateTime(new Date());\n //\n let data = `\n <div class=\"received_avatar\"><img src=\"https://api.adorable.io/avatars/285/` + message.sender + `.png\"></div>\n <div class=\"received_content\">\n <div class=\"received_message\">\n <p>` + message.content + `</p>\n <span class=\"time_date\">` + datetime.date + `&ensp;∣&ensp;` + datetime.time + `</span>\n </div>\n </div>\n `;\n\n appendMessage({\n id: message.sender,\n data: data,\n datetime: datetime,\n text: message.content\n });\n\trecv_sound.play();\n}", "title": "" }, { "docid": "9d9cc613fa6da98913fc5669825e8604", "score": "0.59393793", "text": "infoMessage(message,{timer,playSound} = {}){\n this.info(message,{timer: timer, playSound: playSound});\n }", "title": "" }, { "docid": "266db3e8aa5276eb82ebc98301dfa90e", "score": "0.59358317", "text": "function process_msg(str_msg)\r\n{\r\n msg = JSON.parse(str_msg);\r\n //If msg type is text\r\n if(msg.type == \"status\")\r\n {\r\n if(msg.status == \"online\")\r\n {\r\n users_connected[msg.user.user_id]=msg.user;\r\n generate_a_user_in_list(msg.user);\r\n\r\n //If the user is the oldest one reply with all the members\r\n for (user_id in users_connected){\r\n if(server.user_id>user_id){\r\n return\r\n }\r\n }\r\n //Reply users and msg_text_log\r\n var msg_reply = {\r\n status:\"update_info\",\r\n type:\"status\",\r\n users_connected:users_connected,\r\n msg_text_log:msg_text_log\r\n };\r\n str_msg_reply = JSON.stringify(msg_reply);\r\n server.sendMessage(str_msg_reply,[msg.user.user_id]);\r\n }\r\n if(msg.status == \"update_info\")\r\n {\r\n //Delete old users_connected divs and update msg and users_connected\r\n document.querySelector(\"#users-connected\").innerHTML = '';\r\n document.querySelector(\"#chat\").innerHTML = '';\r\n users_connected = msg.users_connected;\r\n msg_text_log = msg.msg_text_log;\r\n \r\n //Update msg\r\n for(var m of msg_text_log){\r\n generate_msg(m);\r\n }\r\n //Update users\r\n for(var user_id in users_connected){\r\n generate_a_user_in_list(users_connected[user_id]);\r\n }\r\n auto_scroll();\r\n }\r\n }\r\n\r\n if(msg.type == \"text\")\r\n { \r\n msg_text_log.push(msg);\r\n generate_msg(msg);\r\n auto_scroll();\r\n }\r\n\r\n if(msg.type == \"event\")\r\n {\r\n if(msg.event==\"zumbido\")\r\n {\r\n shake_it();\r\n }\r\n\r\n }\r\n}", "title": "" }, { "docid": "4b200df8e32915e1ba7cff8f2430e9c4", "score": "0.59252715", "text": "messages(){throw new Error(\"Not implemented\")}", "title": "" }, { "docid": "41325b14b91cc58d893acc506b12bac3", "score": "0.59248734", "text": "function onMessageCallback(messageData){\n\t\t\n\t}", "title": "" }, { "docid": "16ad7260be87a1ff6469592e5d191490", "score": "0.5924531", "text": "function formatMessage(id, username, text, time) {\n return {\n id,\n username,\n text,\n time: time\n };\n}", "title": "" }, { "docid": "11e05e9cb54a8ee362fe9f1d28dfcd39", "score": "0.5924045", "text": "getMessageAndFunctions() {\n return (\n <Dashboard_newMsg\n adminMode={true}\n rsvns={this.state.rsvns}\n pantryDetail={this.pantry}\n pantry_id={this.state.pantry_id}\n timeToAdd={this.state.timeToAdd}\n fetchPantryDetail={() => this.props.fetchPantryDetail()}\n />\n );\n }", "title": "" }, { "docid": "83b55fafb06a6a509dea8f4c922d0af2", "score": "0.59234136", "text": "function sndMsg(msg) {\n var msgMp = {}\n msg.rcvr.split(' ').forEach(tkn => {\n var ad = tkn[0] != '-'\n if (!ad) {\n tkn = tkn.replace('-', '')\n }\n\n switch (tkn) {\n case 'all':\n fu.forEach(usrInfo.usrs, u => msgMp[u.id] = ad)\n break\n\n case 'sndr':\n msgMp[msg.sndr] = ad\n break\n\n case 'ops':\n fu.forEach(usrinfo.usrs, u => {\n if (u.op) {\n msgMp[u.id] = ad\n }\n })\n break\n\n default:\n msgMp[tkn] = ad\n break\n }\n })\n\n for (var i in msgMp) {\n if (msgMp[i] && usrMsgMp[i]) {\n usrMsgMp[i](msg)\n }\n }\n }", "title": "" }, { "docid": "da7a39371710d8fef4164962a448f8a1", "score": "0.59227896", "text": "function fillChatMessages(details) {\n for(i = 0; i < details.messages.length; i++) {\n var splitMsg = [];\n splitMsg = details.messages[i].split(\": \" );\n writeMessage(splitMsg[0], details.id, splitMsg[1]);\n }\n}", "title": "" }, { "docid": "368d9a324f4a5501d5ade8fc76dcdb61", "score": "0.59219915", "text": "function buildHelpMessages(){\n return {\n ga:{\n title: \"Genetic Algorithm\",\n text: \"\"\n },\n hillClimbing:{\n title: \"Hill Climbing\",\n text: \"\"\n },\n nelderMead:{\n title:\"Nelder-Mead\",\n text:\"\",\n img:\"http://upload.wikimedia.org/wikipedia/commons/9/96/Nelder_Mead2.gif\"\n },\n conjugateGrad:{\n title: \"Conjugate Gradient\",\n text: \"\"\n },\n populationSize:{\n title: \"Population Size\",\n text: \"\"\n },\n walkingMetric: {\n title: \"Walking Fitness Metric\",\n text:\"\"\n },\n numLegPairs: {\n title: \"Number of Leg Pairs\",\n text:\"\"\n },\n terrainType: {\n title: \"Terrain\",\n text:\"\"\n },\n evalPeriod: {\n title: \"Evaluation Period\",\n text:\"\"\n },\n friction: {\n title: \"Friction\",\n text:\"\"\n },\n targetPathMetric: {\n title: \"Target Path Fitness Metric\",\n text:\"\"\n },\n outputHinge: {\n title: \"Output Hinge Index\",\n text:\"\"\n },\n simulatedAnnealing: {\n title: \"Simulate Annealing\",\n text:\"\"\n },\n mutationRate: {\n title: \"Mutation Rate\",\n text:\"\"\n },\n maxLengthChange: {\n title: \"Maximum Length Change\",\n text:\"\"\n },\n minLinkLength: {\n title: \"Minimum Link Length\",\n text:\"\"\n },\n mutateTopology: {\n title: \"Mutate Topology\",\n text:\"\"\n }\n }\n}", "title": "" }, { "docid": "85e75acfe6748aca67dfef0871d98379", "score": "0.5921574", "text": "function addRoomMessage(message) {\n switch (message.type) {\n case \"Customer\":\n\n if (lastMsgBy == 'Agent') {\n $('#chats').append('<p class=\"systemmessage\">' + time + '</p>');\n $('#chats1').append('<p class=\"systemmessage\">' + time + '</p>');\n }\n\n agentMsgCount = 0;\n customerMsgCount++;\n /** cases of concurrent messages **/\n if (customerMsgCount == 1) {\n $(\"#chats\").append('<div class=\"chat_message_wrapper chat_message_left\"><ul class=\"chat_message\"><li class=\"messagestart\"><p>' + message.message + '</p></li></ul></div>');\n $(\"#chats1\").append('<div class=\"chat_message_wrapper chat_message_left\"><ul class=\"chat_message\"><li class=\"messagestart1\"><p>' + message.message + '</p></li></ul></div>');\n } else {\n $('.messagestart:last').parent().append('<li class=\"message2nd\"><p>' + message.message + '</p></li>');\n $('.messagestart1:last').parent().append('<li class=\"message2nd\"><p>' + message.message + '</p></li>');\n }\n\n time = new Date();\n time = time.toLocaleString('en-US', { hour: 'numeric', minute: 'numeric', hour12: true });\n\n lastMsgBy = 'Customer';\n\n break;\n case \"Agent\":\n console.log(\"Nuevo mensaje del agente !!!\");\n if (lastMsgBy == 'Customer') {\n $('#chats').append('<p class=\"systemmessage\">' + time + '</p>');\n $('#chats1').append('<p class=\"systemmessage\">' + time + '</p>');\n }\n\n customerMsgCount = 0;\n agentMsgCount++;\n /** case of concurrent messages **/\n if (agentMsgCount == 1) {\n $(\"#chats\").append('<div class=\"chat_message_wrapper chat_message_right\"><ul class=\"chat_message\"><li class=\"messageagent\"><p class=\"test\" data-id=\"'+agentMsgCount+'\">' + message.message + '</p></li></ul></div>');\n $(\"#chats1\").append('<div class=\"chat_message_wrapper chat_message_right\"><ul class=\"chat_message\"><li class=\"messageagent2\"><p class=\"test\" data-id=\"'+agentMsgCount+'\">' + message.message + '</p></li></ul></div>');\n\n } else {\n $('.messageagent:last').parent().append('<li class=\"messageagent2nd\"><p class=\"prueba\" data-id=\"'+agentMsgCount+'\">' + message.message + '</p></li>');\n $('.messageagent2:last').parent().append('<li class=\"messageagent2nd\"><p class=\"prueba\" data-id=\"'+agentMsgCount+'\">' + message.message + '</p></li>');\n }\n\n time = new Date();\n time = time.toLocaleString('en-US', { hour: 'numeric', minute: 'numeric', hour12: true });\n\n lastMsgBy = 'Agent';\n\n break;\n default:\n // var time = message.time.toLocaleString('en-US', { hour: 'numeric', minute: 'numeric', hour12: true });\n $('#chats').append('<p class=\"systemmessage\">' + message.message + '</p>');\n $('#chats1').append('<p class=\"systemmessage text-center\">' + message.message + '</p>');\n break;\n }\n\n $('#scroll').animate({ scrollTop: $('#scroll').prop('scrollHeight') }, 300);\n $('#scroll1').animate({ scrollTop: $('#scroll1').prop('scrollHeight') }, 300);\n\n\n\n}", "title": "" }, { "docid": "b147c3d441e369e3abf6ecc9eeb8dfcf", "score": "0.59183204", "text": "_parseMessage(msg, rinfo, iface) {\n var message = msg.toString();\n var type = message.substring(0, message.indexOf('\\n'));\n // HTTP/#.# ### Response to M-SEARCH\n if (httpHeader.test(type)) {\n this._parseResponse(message, rinfo);\n }\n else {\n this._parseCommand(message, rinfo, iface);\n }\n }", "title": "" }, { "docid": "ce44e64c5e0abf0014ab70f5096a56b2", "score": "0.5913318", "text": "messageHandler(msg) {\n log.info('Received message:', msg);\n // first of all, find user, that write message to us\n this.getUserObjectFromMsg(msg, (err, user) => {\n // ok, received user object for mongodb, process forward\n if (err) {\n log.warn('Error while receiving user object: ', err);\n this.bot.sendMessage(msg.from.id, 'Ошибка во время получения объекта пользователя. Повторите запрос позже');\n return;\n }\n log.info('User: ', user, '\\nReceived message: ', msg);\n if (msg.data) {\n this.callbackHandler(msg, user);\n } else {\n this.dispatchMessage(msg, user);\n }\n });\n }", "title": "" }, { "docid": "35f62605e5f72ede5f8dbda89515be0e", "score": "0.59132177", "text": "function receiveMessage(msg) {\n console.log(\"msg :\");\n console.log(msg);\n let mUnpack = JSON.parse(msg.payloadString);\n console.log(\"JSON.parse(msg.payloadString) \");\n console.log(JSON.parse(msg.payloadString));\n console.log(\"mUnpack: \");\n console.log(mUnpack);\n let receivedMessage = mUnpack.content;\n let clientIdReceived = mUnpack.deviceId;\n console.log(\"clientRecieved: \");\n console.log(clientIdReceived);\n \n //let userCoords = [lat, lon];\n console.log(\"recievedMessage: \")\n console.log(receivedMessage);\n \n //console.log(\"cookieAsId \");\n //console.log(document.cookie);\n setEntity();\n\n}", "title": "" }, { "docid": "c3ebff16de54c80a447273d358723e15", "score": "0.5910274", "text": "function receivedMessage(event) {\n var senderID = event.sender.id;\n var recipientID = event.recipient.id;\n var timeOfMessage = event.timestamp;\n var message = event.message;\n\n console.log(JSON.stringify(message));\n\n var isEcho = message.is_echo;\n var messageId = message.mid;\n var appId = message.app_id;\n var metadata = message.metadata;\n\n // You may get a text or attachment but not both\n var messageText = message.text;\n var messageAttachments = message.attachments;\n var quickReply = message.quick_reply;\n\n if (isEcho) {\n // Just logging message echoes to console\n //console.log(\"Received echo for message %s and app %d with metadata %s\",\n // messageId, appId, metadata);\n return;\n } else if (quickReply) {\n var quickReplyPayload = quickReply.payload;\n console.log(\"Quick reply for message %s with payload %s\",\n messageId, quickReplyPayload);\n\n sendTextMessage(senderID, \"Quick reply tapped\");\n return;\n }\n if (messageAttachments) {\n if (messageAttachments.template_type = \"button\") {\n switch (messageAttachments.payload) {\n case 'FEMALE_PAYLOAD':\n sendPregnantButtonMessage(senderID);\n break;\n case 'MALE_PAYLOAD':\n sendAgeButtonMessage(senderID);\n break;\n case 'OTHER_PAYLOAD':\n sendPregnantButtonMessage(senderID);\n break;\n\n case 'YES_PAYLOAD':\n sendAgeButtonMessage(senderID);\n break;\n case 'NO_PAYLOAD':\n sendAgeButtonMessage(senderID);\n break;\n case 'BACK_PAYLOAD':\n sendGenderButtonMessage(senderID);\n break;\n\n case 'AGE_LT_18_PAYLOAD':\n sendQueryTextMessage(senderID);\n break;\n case 'AGE_18_50_PAYLOAD':\n sendQueryTextMessage(senderID);\n break;\n case 'AGE_GT_50_PAYLOAD':\n sendQueryTextMessage(senderID);\n break;\n\n default:\n sendTextMessage(senderID, \"Message with payload received\");\n console.log(\"Payload not recognised\");\n }\n }\n else {\n sendTextMessage(senderID, \"Message with attachment received\");\n }\n }\n else if (messageText) {\n switch (messageText) {\n\n case 'read receipt':\n sendReadReceipt(senderID);\n break;\n\n case 'typing on':\n sendTypingOn(senderID);\n break;\n\n case 'typing off':\n sendTypingOff(senderID);\n break;\n\n case 'account linking':\n sendAccountLinking(senderID);\n break;\n\n case 'age':\n sendAgeQuickReplyMessage(senderID);\n break;\n\n case 'Female':\n case 'female':\n case 'f':\n case 'Other':\n case 'other':\n case 'NA':\n case 'na':\n case 'n/a':\n sendPregnantButtonMessage(senderID);\n break;\n\n case 'Yes':\n case 'No':\n case 'yes':\n case 'no':\n case 'Y':\n case 'N':\n case 'y':\n case 'n':\n sendDateOfBirthMessage(senderID);\n break;\n\n case 'Get Started':\n case 'get started':\n sendGenderButtonMessage(senderID);\n break;\n\n default:\n var DoBTimeStamp = Date.parse(messageText)\n\n if (isNaN(DoBTimeStamp) == false) {\n console.log(\"DoB = \" + DoBTimeStamp);\n var DoBDate = new Date(DoBTimeStamp);\n\n sendTextMessage(senderID, DoBDate);\n sendQueryTextMessage(senderID);\n } else {\n if (messageText.indexOf(',') > -1) {\n sendPotentialDiagnoses(messageText, senderID);\n }\n else {\n sendTextMessage(senderID, messageText);\n }\n }\n }\n }\n}", "title": "" }, { "docid": "be96a86567f0bdf4644f03ea69d5dcc2", "score": "0.5906144", "text": "convertToMessageSMIP(data){\n var id = data.contents.identifier + '|' + data.contents.address \n var value = data.contents.data[0].value;\n var tags = {};\n tags.location = data.contents.location;\n tags.name = data.contents.name;\n tags.peripheral = data.contents.identifier;\n var gts = data.contents.timestamp/1000;\n var ats = Number(new Date().getTime());\n return new SMIPMessage(id, value, tags, gts, ats);\n }", "title": "" }, { "docid": "8d12a830cb1675b56b47eee523253ab3", "score": "0.5905556", "text": "function message_received(data)\r\n {\r\n var out = \"\";\r\n \t var img = users_images[data['user_name']];\r\n/*\t\t\t if(!isset($out['other_options']['type_handle']))\r\n\t\t\t \t$out['other_options']['type_handle'] = 'info';*/\r\n\r\n\t if(img == undefined)\r\n\t img = \"./img/avatars/noavatar.gif\";\r\n if(data['is_command'] == \"true\")\r\n {\r\n \tif(data['type_handle'] == 'error')\r\n \t out = \"<TABLE cellpadding=\\\"2\\\" cellspacing=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\"><tr><td><span style='color:red;'><b>\"+data['text']+\"</b></span></td></tr></TABLE>\";\r\n \telse\r\n \t out = \"<TABLE cellpadding=\\\"2\\\" cellspacing=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\"><tr><td><b>\"+data['text']+\"</b></td></tr></TABLE>\";\r\n }\r\n else\t\t\t\t\t\t\t\t\tout = \"<TABLE cellpadding=\\\"2\\\" cellspacing=\\\"0\\\" border=\\\"0\\\" width=\\\"100%\\\"><tr><td><img src='\"+img+\"'></td><td width=100%><b>\"+data['user_name']+\"</b> (<span style='color:#aaaaaa;'>\"+data['hour']+ \":\"+data['minute']+ \":\"+data['second']+\"</span>)<br>\"+data['text']+\"</td></tr></TABLE>\";\r\n\r\n document.getElementById(\"IFRAME_TEXT\").contentWindow.document.getElementById(\"data\").innerHTML += out;\r\n IFRAME_TEXT.scrollTo(0,document.getElementById(\"IFRAME_TEXT\").contentWindow.document.body.scrollHeight);\r\n }", "title": "" }, { "docid": "2f3405fb47d02b1ea305d50b066a9afa", "score": "0.59024453", "text": "message(value) {\n this.newMessage = value;\n }", "title": "" }, { "docid": "84fe431d708075b8c5ae42d064667253", "score": "0.5897252", "text": "function testerMessages () {\n\tvar eelamsg = \"Dear grandma, miss you lots! How are you doing? Hope everything is fine with you! I have been doing well and am enjoying school a lot, though I really can't wait until the next time I get to visit you! Love, Eela\"\n\tvar charlenemsg = \"Hi! can't wait to see you the next time I visit! How are you doing? Can you give me a call sometime in the near future? I really do miss you and would love to talk to you very soon! Miss you lots! xoxo Charlene\"\n\tvar bowenmsg = \"Hello! How are you doing? Hope everything is fine with you! I have been doing well and am enjoying school a lot, though I really can't wait until the next time I get to visit you! -Bowen\"\n\tvar now1 = (new Date ()).toDateString();\n\tvar now2 = (new Date ()).toDateString();\n\tvar now3 = (new Date ()).toDateString();\n\treturn [{message_r_id: 0, date_time: now3, read: false, from: 0, content: eelamsg}, {message_r_id: 1, date_time: now2, read: false, from: 1, content: charlenemsg}, {message_r_id: 2, date_time: now1, read: true, from: 2, content: bowenmsg}]\n}", "title": "" } ]
f1924d9293a0423db05e59c0cd9c63a6
Update the viewport's total content size.
[ { "docid": "13e0e370e7d6d76a9c71f90062f9afee", "score": "0.8635498", "text": "_updateTotalContentSize() {\n if (!this._viewport) {\n return;\n }\n this._viewport.setTotalContentSize(this._viewport.getDataLength() * this._itemSize);\n }", "title": "" } ]
[ { "docid": "8007d29a0be99c9ea729b133a589c578", "score": "0.87372094", "text": "_updateTotalContentSize() {\n if (!this._viewport) {\n return;\n }\n\n this._viewport.setTotalContentSize(this._viewport.getDataLength() * this._itemSize);\n }", "title": "" }, { "docid": "bf32a1ccf49cb195fa40497e62bf4dce", "score": "0.7041052", "text": "function updateViewportHeight() {\n viewHeight = inst.calculateViewportHeight();\n }", "title": "" }, { "docid": "b37b5b462200820e63a4abc634598109", "score": "0.70139056", "text": "setTotalContentSize(size) {\n if (this._totalContentSize !== size) {\n this._totalContentSize = size;\n\n this._calculateSpacerSize();\n\n this._markChangeDetectionNeeded();\n }\n }", "title": "" }, { "docid": "4cbf8fa57838484e3f918f9a967856c0", "score": "0.6745367", "text": "_updateViewportSize() {\n const window = this._getWindow();\n this._viewportSize = this._platform.isBrowser ?\n { width: window.innerWidth, height: window.innerHeight } :\n { width: 0, height: 0 };\n }", "title": "" }, { "docid": "4cbf8fa57838484e3f918f9a967856c0", "score": "0.6745367", "text": "_updateViewportSize() {\n const window = this._getWindow();\n this._viewportSize = this._platform.isBrowser ?\n { width: window.innerWidth, height: window.innerHeight } :\n { width: 0, height: 0 };\n }", "title": "" }, { "docid": "4cbf8fa57838484e3f918f9a967856c0", "score": "0.6745367", "text": "_updateViewportSize() {\n const window = this._getWindow();\n this._viewportSize = this._platform.isBrowser ?\n { width: window.innerWidth, height: window.innerHeight } :\n { width: 0, height: 0 };\n }", "title": "" }, { "docid": "4cbf8fa57838484e3f918f9a967856c0", "score": "0.6745367", "text": "_updateViewportSize() {\n const window = this._getWindow();\n this._viewportSize = this._platform.isBrowser ?\n { width: window.innerWidth, height: window.innerHeight } :\n { width: 0, height: 0 };\n }", "title": "" }, { "docid": "7d6a5462b50d697611f0dab4366044b4", "score": "0.66875196", "text": "setTotalContentSize(size) {\n if (this._totalContentSize !== size) {\n this._totalContentSize = size;\n this._calculateSpacerSize();\n this._markChangeDetectionNeeded();\n }\n }", "title": "" }, { "docid": "7d6a5462b50d697611f0dab4366044b4", "score": "0.66875196", "text": "setTotalContentSize(size) {\n if (this._totalContentSize !== size) {\n this._totalContentSize = size;\n this._calculateSpacerSize();\n this._markChangeDetectionNeeded();\n }\n }", "title": "" }, { "docid": "7d6a5462b50d697611f0dab4366044b4", "score": "0.66875196", "text": "setTotalContentSize(size) {\n if (this._totalContentSize !== size) {\n this._totalContentSize = size;\n this._calculateSpacerSize();\n this._markChangeDetectionNeeded();\n }\n }", "title": "" }, { "docid": "7d6a5462b50d697611f0dab4366044b4", "score": "0.66875196", "text": "setTotalContentSize(size) {\n if (this._totalContentSize !== size) {\n this._totalContentSize = size;\n this._calculateSpacerSize();\n this._markChangeDetectionNeeded();\n }\n }", "title": "" }, { "docid": "ab07332f2c625771c87fb241a6eaf6f3", "score": "0.6673788", "text": "_updateViewportSize() {\n const window = this._getWindow();\n this._viewportSize = this._platform.isBrowser\n ? { width: window.innerWidth, height: window.innerHeight }\n : { width: 0, height: 0 };\n }", "title": "" }, { "docid": "6901b1a6c915cd869ac9c54a3c8a73ee", "score": "0.6428639", "text": "_updateViewportSize() {\n const window = this._getWindow();\n\n this._viewportSize = this._platform.isBrowser ? {\n width: window.innerWidth,\n height: window.innerHeight\n } : {\n width: 0,\n height: 0\n };\n }", "title": "" }, { "docid": "cd62d87ea885e3449652af18e495e44f", "score": "0.6379547", "text": "update() {\n this.store.documentHeight = this.container.clientHeight;\n this.store.windowHeight = window.innerHeight;\n\n document.body.style.height = this.store.documentHeight + \"px\";\n }", "title": "" }, { "docid": "333a22e74751a3d519713b78be23f836", "score": "0.6358738", "text": "function updateViewportHeight(){\n\t\tstate.viewportHeight= Math.max(document.documentElement.clientHeight, window.innerHeight || 0);\n\t\tstate.range=$container.height()-state.viewportHeight;\n\t}", "title": "" }, { "docid": "085ddf6689a604d33cb18d11a5b8c53b", "score": "0.63355243", "text": "function updateHeightValues() {\n //TODO: this is going to be updated to use ChunkArray data to be faster.\n var height = 0, i = 0, contentHeight;\n while (i < inst.rowsLength) {\n rowOffsets[i] = height;\n height += inst.templateModel.getTemplateHeight(inst.data[i]);\n i += 1;\n }\n options.rowHeight = inst.rowsLength ? inst.templateModel.getTemplateHeight(\"default\") : 0;\n contentHeight = getContentHeight();\n inst.getContent()[0].style.height = contentHeight + \"px\";\n inst.log(\"heights: viewport %s content %s\", inst.getViewportHeight(), contentHeight);\n }", "title": "" }, { "docid": "2db9b15e463797e23e081f411860355d", "score": "0.6316129", "text": "function updateSize() {\n const width = canvas.clientWidth;\n const height = canvas.clientHeight;\n if (canvas.width !== width || canvas.height !== height) {\n renderer.setSize(width, height, false);\n }\n }", "title": "" }, { "docid": "becf512e8bfec80598efba85dedfcff1", "score": "0.6307508", "text": "updateContentHeight() {\n const pageBody = $(this.getRef('pageBody'))\n const content = $(this.getRef('content'))\n\n // Reset content to { height: 'auto' } so that we can make a height comparison to get the max\n content.css({\n height: 'auto'\n })\n\n content.css({\n height: Math.max(pageBody.innerHeight(), content.outerHeight())\n })\n }", "title": "" }, { "docid": "f90655b2117d7ab72414c7969389c7ec", "score": "0.6298464", "text": "_updateScrollSize() {\n // Ensure we have at least 1px - this allows getting at least 1 item to be\n // rendered.\n this._scrollSize = Math.max(1, this._totalItems * this._delta);\n }", "title": "" }, { "docid": "db9696c68910788bea5c2fa8f2db977f", "score": "0.62963325", "text": "checkViewportSize() {\n // TODO: Cleanup later when add logic for handling content resize\n this._measureViewportSize();\n\n this._scrollStrategy.onDataLengthChanged();\n }", "title": "" }, { "docid": "d06e558c55271644cfc43069e1c0823e", "score": "0.62938726", "text": "function getContentSize() {\n var canvasWidth = $canvas.width(),\n canvasHeight = $canvas.height(),\n hasVScroll = canvasHeight > $viewport.height(),\n contentWidth = canvasWidth + (hasVScroll ? scrollbarDimensions.width : 0),\n hasHScroll = contentWidth > $viewport.width(),\n contentHeight = canvasHeight + (hasHScroll ? scrollbarDimensions.height : 0);\n return { width: contentWidth, height: contentHeight };\n }", "title": "" }, { "docid": "6f0af8a022b28317933d057803a0dd70", "score": "0.6284214", "text": "UpdateScrollHeight() {\n if (this.IsDataBound && this.pnlViewport) {\n this.ViewportHeight = tp.BoundingRect(this.pnlViewport.Handle).Height;\n this.VirtualHeight = Math.ceil(this.NodeList.length * this.RowHeight) + 3;\n this.pnlViewport.Content.style.height = tp.px(this.VirtualHeight); // + 'px';\n }\n }", "title": "" }, { "docid": "e1b665ea7f28d8f8664d66d53e84e30c", "score": "0.6279571", "text": "redraw() {\r\n this.body.emitter.emit('setSize');\r\n this._redraw();\r\n }", "title": "" }, { "docid": "2ece326453fa5a4d2aa5aa9b48815717", "score": "0.626382", "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.626382", "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.626382", "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.626382", "text": "checkViewportSize() {\n // TODO: Cleanup later when add logic for handling content resize\n this._measureViewportSize();\n this._scrollStrategy.onDataLengthChanged();\n }", "title": "" }, { "docid": "84a9c2322456b931717f3f040796a1d7", "score": "0.6216709", "text": "updateContainmentDimensions() {\n\n /**\n * Get Page\n * @type {Page}\n */\n const page = this.getContainment();\n\n page.observer.publish(page.eventManager.eventList.updateHeight);\n }", "title": "" }, { "docid": "1e3efcb5e61e1c4488e09e7e67cc769b", "score": "0.6147702", "text": "function SetResizeContent() {\n fullScreenHeight();\n ScreenFixedHeight();\n }", "title": "" }, { "docid": "a0d1047f851c108db30adab70173705e", "score": "0.61166155", "text": "function updateViewportSize() {\t\n\tfor(let element in IB.settings.dynamicFonts) {\n\t\tlet classElements;\n\n\t\tclassElements = document.getElementsByClassName(element);\n\t\tif(classElements.length > 0) {\n\t\t\tfor(let i = 0; i < classElements.length; i++) {\n\t\t\t\tclassElements[i].style.fontSize = (Number(IB.settings.dynamicFonts[element] / (IB.settings.viewPortWidth / window.innerWidth)) < IB.settings.dynamicFonts[element]) ? Number(IB.settings.dynamicFonts[element] / (IB.settings.viewPortWidth / window.innerWidth)) + 'px' : IB.settings.dynamicFonts[element];\n\t\t\t\tclassElements[i].style.lineHeight = Number(IB.settings.dynamicFonts[element] / (IB.settings.viewPortWidth / window.innerWidth)) * 2 + 'px';\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0b5d9cf4be4fdeaa72cf7ad101a339cf", "score": "0.6083496", "text": "sizeChanged() {\n this.updateBoundary();\n }", "title": "" }, { "docid": "e11c7770f62f560231cdee0578ffdab4", "score": "0.60820174", "text": "function sizesSum () {\n if (o.advanced.updateOnSelectorChange === true) { o.advanced.updateOnSelectorChange = '*' }\n var total = 0; var sel = mCSB_container.find(o.advanced.updateOnSelectorChange)\n if (o.advanced.updateOnSelectorChange && sel.length > 0) { sel.each(function () { total += this.offsetHeight + this.offsetWidth }) }\n return total\n }", "title": "" }, { "docid": "9f15d143b0f999a7869585b3454e442d", "score": "0.60697687", "text": "function updateSize() {\n\t\t//$log.log(preDebugMsg + \"updateSize\");\n\t\tfontSize = parseInt($scope.gimme(\"FontSize\"));\n\t\tif(fontSize < 5) {\n\t\t\tfontSize = 5;\n\t\t}\n\n\t\tvar rw = $scope.gimme(\"DrawingArea:width\");\n\t\tif(typeof rw === 'string') {\n\t\t\trw = parseFloat(rw);\n\t\t}\n\t\tif(rw < 1) {\n\t\t\trw = 1;\n\t\t}\n\n\t\tvar rh = $scope.gimme(\"DrawingArea:height\");\n\t\tif(typeof rh === 'string') {\n\t\t\trh = parseFloat(rh);\n\t\t}\n\t\tif(rh < 1) {\n\t\t\trh = 1;\n\t\t}\n\n\t\tvar bgDirty = false;\n\t\tif(bgCanvas === null) {\n\t\t\tbgDirty = true;\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theBgCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tbgCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(bgCanvas.width != rw) {\n\t\t\tbgDirty = true;\n\t\t\tbgCanvas.width = rw;\n\t\t}\n\t\tif(bgCanvas.height != rh) {\n\t\t\tbgDirty = true;\n\t\t\tbgCanvas.height = rh;\n\t\t}\n\n\t\tvar dotDirty = false;\n\t\tif(dotCanvas === null) {\n\t\t\tdotDirty = true;\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theDotCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tdotCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(dotCanvas.width != rw) {\n\t\t\tdotDirty = true;\n\t\t\tdotCanvas.width = rw;\n\t\t}\n\t\tif(dotCanvas.height != rh) {\n\t\t\tdotDirty = true;\n\t\t\tdotCanvas.height = rh;\n\t\t}\n\n\t\tif(undotCanvas === null) {\n\t\t\tundotDirty = true;\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theUnselectedDotCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tundotCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(undotCanvas.width != rw) {\n\t\t\tundotDirty = true;\n\t\t\tundotCanvas.width = rw;\n\t\t}\n\t\tif(undotCanvas.height != rh) {\n\t\t\tundotDirty = true;\n\t\t\tundotCanvas.height = rh;\n\t\t}\n\n\t\tvar axesDirty = false;\n\t\tif(axesCanvas === null) {\n\t\t\taxesDirty = true;\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theAxesCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\taxesCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(axesCanvas.width != rw) {\n\t\t\taxesDirty = true;\n\t\t\taxesCanvas.width = rw;\n\t\t}\n\t\tif(axesCanvas.height != rh) {\n\t\t\taxesDirty = true;\n\t\t\taxesCanvas.height = rh;\n\t\t}\n\n\n\t\tif(dropCanvas.width != rw) {\n\t\t\tdropCanvas.width = rw;\n\t\t}\n\t\tif(dropCanvas.height != rh) {\n\t\t\tdropCanvas.height = rh;\n\t\t}\n\n\t\tif(selectionCanvas === null) {\n\t\t\tvar selectionCanvasElement = $scope.theView.parent().find('#theSelectionCanvas');\n\t\t\tif(selectionCanvasElement.length > 0) {\n\t\t\t\tselectionCanvas = selectionCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no selectionCanvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tselectionCanvas.width = rw;\n\t\tselectionCanvas.height = rh;\n\t\tselectionCanvas.style.left = 0;\n\t\tselectionCanvas.style.top = 0;\n\n\t\tif(selectionHolderElement === null) {\n\t\t\tselectionHolderElement = $scope.theView.parent().find('#selectionHolder');\n\t\t}\n\t\tselectionHolderElement.width = rw;\n\t\tselectionHolderElement.height = rh;\n\t\tselectionHolderElement.top = 0;\n\t\tselectionHolderElement.left = 0;\n\n\t\tvar selectionRectElement = $scope.theView.parent().find('#selectionRectangle');\n\t\tselectionRectElement.width = rw;\n\t\tselectionRectElement.height = rh;\n\t\tselectionRectElement.top = 0;\n\t\tselectionRectElement.left = 0;\n\t\tif(selectionRectElement.length > 0) {\n\t\t\tselectionRect = selectionRectElement[0];\n\t\t\tselectionRect.width = rw;\n\t\t\tselectionRect.height = rh;\n\t\t\tselectionRect.top = 0;\n\t\t\tselectionRect.left = 0;\n\t\t}\n\n\t\tvar W = selectionCanvas.width;\n\t\tvar H = selectionCanvas.height;\n\t\tdrawW = W - leftMarg - rightMarg;\n\t\tdrawH = H - topMarg - bottomMarg * 2 - fontSize;\n\n\t\t//$log.log(preDebugMsg + \"updateSize found selections: \" + JSON.stringify(selections));\n\t\tupdateSelectionsWhenZoomingOrResizing();\n\t\tupdateDropZones(textColor, 0.3, false);\n\t\t//$log.log(preDebugMsg + \"updateSize updated selections to: \" + JSON.stringify(selections));\n\t}", "title": "" }, { "docid": "264973ced25488efb56b8cbb09f7ef85", "score": "0.60616106", "text": "refresh() {\n this._recalcResize();\n }", "title": "" }, { "docid": "000b5e8607cd01e393c85799ed66130e", "score": "0.6059986", "text": "function updateSize() {\n setWidth(window.innerWidth);\n setHeight(window.innerHeight);\n }", "title": "" }, { "docid": "d9eb1b5c70d6bc407199aab3054aacee", "score": "0.6059068", "text": "_updateSize() {\n const windowHeight = this.$window.height();\n let pageContainerHeight = null;\n let sidebarHeight = null;\n\n if (this.isFullPage) {\n pageContainerHeight = windowHeight -\n this.$pageContainer.offset().top;\n }\n\n if (this.inMobileMode) {\n if (pageContainerHeight !== null &&\n this.drawer !== null &&\n this.drawer.isVisible) {\n /*\n * If we're constraining the page container's height, and\n * there's a drawer present, reduce the page container's\n * height by the drawer size, so we don't make some content\n * inaccessible due to an overlap.\n */\n pageContainerHeight -= this.drawer.$el.outerHeight();\n }\n } else {\n if (pageContainerHeight !== null) {\n /*\n * If we're constraining the page container's height,\n * constrain the sidebar's as well.\n */\n sidebarHeight = windowHeight - this._$pageSidebar.offset().top;\n }\n }\n\n if (pageContainerHeight === null) {\n this.$pageContainer.css('height', '');\n } else {\n this.$pageContainer.outerHeight(pageContainerHeight);\n }\n\n if (sidebarHeight === null) {\n this._$pageSidebar.css('height', '');\n } else {\n this._$pageSidebar.outerHeight(sidebarHeight);\n }\n\n this.onResize();\n }", "title": "" }, { "docid": "b8dbf8639be32717a4b2a626eecf9c57", "score": "0.6040184", "text": "getViewportSize() {\n return this._viewportSize;\n }", "title": "" }, { "docid": "f95ec60801ef45bf0119b64af175db3f", "score": "0.6036877", "text": "recalculateDims() {\n const dims = this.dimensionsHelper.getDimensions(this.element);\n this._innerWidth = Math.floor(dims.width);\n if (this.scrollbarV) {\n let height = dims.height;\n if (this.headerHeight)\n height = height - this.headerHeight;\n if (this.footerHeight)\n height = height - this.footerHeight;\n this.bodyHeight = height;\n }\n this.recalculatePages();\n }", "title": "" }, { "docid": "20a24c743e95430f7efaeabe0762347a", "score": "0.6030361", "text": "getViewportSize() {\n return this._viewportSize;\n }", "title": "" }, { "docid": "20a24c743e95430f7efaeabe0762347a", "score": "0.6030361", "text": "getViewportSize() {\n return this._viewportSize;\n }", "title": "" }, { "docid": "20a24c743e95430f7efaeabe0762347a", "score": "0.6030361", "text": "getViewportSize() {\n return this._viewportSize;\n }", "title": "" }, { "docid": "20a24c743e95430f7efaeabe0762347a", "score": "0.6030361", "text": "getViewportSize() {\n return this._viewportSize;\n }", "title": "" }, { "docid": "af8497c56074911f45f2ba2124d8efb0", "score": "0.6029622", "text": "function updatePortalSize() {\n abrController.setElementSize(), abrController.setWindowResizeEventCalled(!0);\n }", "title": "" }, { "docid": "ab254c39d1da392a0c372b6703d6e593", "score": "0.60210854", "text": "updateSize() {}", "title": "" }, { "docid": "3a1804f4a369761d39fa004338cd4250", "score": "0.60186315", "text": "function updatePortalSize() {\n abrController.setElementSize();\n abrController.setWindowResizeEventCalled(true);\n }", "title": "" }, { "docid": "1b152c2198b90a4b80118bd883b88713", "score": "0.6008413", "text": "updateBodyHeight() {\n SizesCache.body.height = this.sizes.height\n SizesCache.body.scrollArea = this.sizes.height - SizesCache.window.height\n document.body.style.height = `${this.sizes.height}px`\n }", "title": "" }, { "docid": "a9bf6edf9faa4d2e57189ad995662473", "score": "0.59923315", "text": "get viewportSize() {\n return this._viewportSize;\n }", "title": "" }, { "docid": "b10f5637929b23460dd2b7cf53dd7962", "score": "0.5987284", "text": "function update_size() {\n size = window.innerWidth + ' x ' + window.innerHeight;\n size_display.textContent = size;\n}", "title": "" }, { "docid": "ac728e572af0040509f0525245a3d5d9", "score": "0.5980061", "text": "_updateSize() {\n if ( this._windowSize.width != window.innerWidth ||\n this._windowSize.height != window.innerHeight ) {\n\n this._windowSize.width = window.innerWidth;\n this._windowSize.height = window.innerHeight;\n\n // update the object that deals with view interaction\n this._quadViewInteraction.updateWindowSize(\n this._windowSize.width,\n this._windowSize.height\n );\n\n this._renderer.setSize ( this._windowSize.width, this._windowSize.height );\n }\n }", "title": "" }, { "docid": "41bf3157be5c6f8527666fe80d4d32e5", "score": "0.59706765", "text": "updateSize() {\n this.size = this.size + 1;\n }", "title": "" }, { "docid": "01bdc9414f3a56e5606ce3dfaf303214", "score": "0.5966678", "text": "function resize_contents() {\n connectionsDiv.height(self.elm.innerHeight()\n - componentsDiv.outerHeight()\n - variablesDiv.outerHeight());\n }", "title": "" }, { "docid": "7a6ffd798e984525f4dfb694b5515d36", "score": "0.59600776", "text": "resizeContent(self) {\n if(self.children) {\n for (let c of self.children){\n lively.setExtent(c, pt(this.offsetWidth, this.offsetHeight));\n c.dispatchEvent(new CustomEvent(\"extent-changed\"))\n }\n }\n }", "title": "" }, { "docid": "ecf3c6d98141f99da0f69a56a9126949", "score": "0.59510654", "text": "function sizeChanged() {\n\t\t\tsizesDirty();\n\t\t\tif (elementVisible()) {\n\t\t\t\tcalcSize();\n\t\t\t\tsetSize();\n\t\t\t\tviewUnselect();\n\t\t\t\tview.rerenderEvents();\n\t\t\t\tview.sizeDirty = false;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "a3d159fc167ed14b8e84e4910b758f3f", "score": "0.5946892", "text": "function updateViewportSize() {\n return this.props.__platform.is('browser') ?\n { width: window.innerWidth, height: window.innerHeight } :\n { width: 0, height: 0 };\n}", "title": "" }, { "docid": "2875c649a57ba1c71570fced19fa2a4f", "score": "0.59416664", "text": "function resizeViewport() {\r\n linkedScene.vWidth = canvas.clientWidth;\r\n linkedScene.vHeight = canvas.clientHeight;\r\n var ratio = linkedScene.vWidth / linkedScene.vHeight;\r\n linkedScene.updateViewport(ratio);\r\n}", "title": "" }, { "docid": "6741bcb62786a483d5e65429c3f8dd65", "score": "0.59396875", "text": "resize() {\n\t\tthis.calcSize();\n\t\tthis.applySize();\n\t}", "title": "" }, { "docid": "025430fb2a0ff16e8f6b9de4c7eccf68", "score": "0.5939327", "text": "function updateSize() {\n\n var width = window.innerWidth - $(\"#main-left\").width();\n\n $(\"#main-right\").css(\"width\", width);\n // get the header section height.\n var pixels = document.getElementById(\"sample-header\").getBoundingClientRect().height;\n\n var screenHeight = document.body.clientHeight;\n // set the main section height based on the document and header section height\n document.getElementById(\"sample-main\").style.height = (screenHeight - pixels) - 2 + \"px\";\n\n\n if (diagram._enableOverView)\n var height = $(\"#main-left\").height() - $(\".searchParent_Maxi\").height() - $(\"#Overview-div\").height() - 20;\n else\n height = $(\"#main-left\").height() - $(\".searchParent_Maxi\").height();\n /* \n The symbolPalette client side API method \"updateScrollerViewport\" is used to update the symbol palette size based on view port size.\n */\n var palette = $(\"#symbolpalette\").ejSymbolPalette(\"instance\");\n //set the palette height based on overview state.\n palette.setHeight(height + \"px\");\n // set the symbolpalette content size.\n palette.updateScrollerViewport();\n}", "title": "" }, { "docid": "6927b95a4394c74f123703c10521df47", "score": "0.5911003", "text": "function sizesSum(){\n\t\t\t\tif(o.advanced.updateOnSelectorChange===true){o.advanced.updateOnSelectorChange=\"*\";}\n\t\t\t\tvar total=0,sel=mTS_container.find(o.advanced.updateOnSelectorChange);\n\t\t\t\tif(o.advanced.updateOnSelectorChange && sel.length>0){sel.each(function(){total+=$(this).height()+$(this).width();});}\n\t\t\t\treturn total;\n\t\t\t}", "title": "" }, { "docid": "f79fe2b07e6195c56f0e6bd645d8cef3", "score": "0.5901623", "text": "_measureViewportSize() {\n const viewportEl = this.elementRef.nativeElement;\n this._viewportSize = this.orientation === 'horizontal' ?\n viewportEl.clientWidth : viewportEl.clientHeight;\n }", "title": "" }, { "docid": "f79fe2b07e6195c56f0e6bd645d8cef3", "score": "0.5901623", "text": "_measureViewportSize() {\n const viewportEl = this.elementRef.nativeElement;\n this._viewportSize = this.orientation === 'horizontal' ?\n viewportEl.clientWidth : viewportEl.clientHeight;\n }", "title": "" }, { "docid": "f79fe2b07e6195c56f0e6bd645d8cef3", "score": "0.5901623", "text": "_measureViewportSize() {\n const viewportEl = this.elementRef.nativeElement;\n this._viewportSize = this.orientation === 'horizontal' ?\n viewportEl.clientWidth : viewportEl.clientHeight;\n }", "title": "" }, { "docid": "f79fe2b07e6195c56f0e6bd645d8cef3", "score": "0.5901623", "text": "_measureViewportSize() {\n const viewportEl = this.elementRef.nativeElement;\n this._viewportSize = this.orientation === 'horizontal' ?\n viewportEl.clientWidth : viewportEl.clientHeight;\n }", "title": "" }, { "docid": "8779692fe76a1e8273b2df4af3078952", "score": "0.589568", "text": "function updateViewportDimensions() {\n\t\tvar w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0],x=w.innerWidth||e.clientWidth||g.clientWidth,y=w.innerHeight||e.clientHeight||g.clientHeight;\n\t\treturn { width:x,height:y };\n\t}", "title": "" }, { "docid": "2d8ea62e1f1e92b9715146b68ea5bec2", "score": "0.5890885", "text": "resize() {\n this.updateLayout(true);\n }", "title": "" }, { "docid": "9ff1b6bdd733e7a69f9874c565b6883e", "score": "0.5889068", "text": "Viewport_OnResized() {\n //this.UpdateScrollHeight();\n //this.RenderNodes();\n //this.BuildGroups();\n\n this.HideEditor(false);\n this.BuildGroups();\n }", "title": "" }, { "docid": "31f44ce57bae5e3c67d80711598cc5df", "score": "0.5878617", "text": "function updateViewportDimensions() {\n var w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0],x=w.innerWidth||e.clientWidth||g.clientWidth,y=w.innerHeight||e.clientHeight||g.clientHeight;\n return { width:x,height:y };\n}", "title": "" }, { "docid": "065c88ce6458e3f03acd67b638a83230", "score": "0.5837404", "text": "function update_viewport_vars() {\n\t\tviewport_width = $(window).width();\n\t\tviewport_height = $(window).height();\n\t}", "title": "" }, { "docid": "dcc369d79063c71ec8f21f40fbd88398", "score": "0.5825672", "text": "function updateViewportDimensions() {\n var w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0],x=w.innerWidth||e.clientWidth||g.clientWidth,y=w.innerHeight||e.clientHeight||g.clientHeight;\n return { width:x,height:y };\n}", "title": "" }, { "docid": "2dcaa4a398b0f9a9c265b16eae4c49ca", "score": "0.58254033", "text": "function size() {\n\t\tvar html = document.querySelector('html');\n\t\thtml.style.fontSize = document.body.clientWidth / 7.5 + 'px';\n\t}", "title": "" }, { "docid": "fb90f27c9a2b82516c962f7582f1887e", "score": "0.5809011", "text": "function updateViewportDimensions() {\r\n var w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0],x=w.innerWidth||e.clientWidth||g.clientWidth,y=w.innerHeight||e.clientHeight||g.clientHeight;\r\n return { width:x,height:y };\r\n}", "title": "" }, { "docid": "e550f18eb2d7d688db7001f4a727469f", "score": "0.5808276", "text": "function updateView() {\n\t\tvar rw = $scope.gimme(\"DrawingArea:width\");\n\t\tif(typeof rw === 'string') {\n\t\t\trw = parseFloat(rw);\n\t\t}\n\t\tif(rw < 1) {\n\t\t\trw = 1;\n\t\t}\n\n\t\tvar rh = $scope.gimme(\"DrawingArea:height\");\n\t\tif(typeof rh === 'string') {\n\t\t\trh = parseFloat(rh);\n\t\t}\n\t\tif(rh < 1) {\n\t\t\trh = 1;\n\t\t}\n\n\t\tif(myCanvas === null) {\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tmyCanvas = myCanvasElement[0];\n\t\t\t} else {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tmyCanvas.width = rw;\n\t\tmyCanvas.height = rh;\n\n\t\tvar text = buildInfoText();\n\t\tcheckNeededSize(text);\n\t\tdrawBackground();\n\t\tdrawDataInfo(text);\n\t\t$scope.displayText = dispText + \": \" + (fileName != \"\" ? fileName : \"None\");\n\t}", "title": "" }, { "docid": "786980fc6b5f1522d187ed99af1c579d", "score": "0.5804844", "text": "function updateViewportDimensions() {\n\tvar w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0],x=w.innerWidth||e.clientWidth||g.clientWidth,y=w.innerHeight||e.clientHeight||g.clientHeight;\n\treturn { width:x,height:y };\n}", "title": "" }, { "docid": "786980fc6b5f1522d187ed99af1c579d", "score": "0.5804844", "text": "function updateViewportDimensions() {\n\tvar w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0],x=w.innerWidth||e.clientWidth||g.clientWidth,y=w.innerHeight||e.clientHeight||g.clientHeight;\n\treturn { width:x,height:y };\n}", "title": "" }, { "docid": "786980fc6b5f1522d187ed99af1c579d", "score": "0.5804844", "text": "function updateViewportDimensions() {\n\tvar w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0],x=w.innerWidth||e.clientWidth||g.clientWidth,y=w.innerHeight||e.clientHeight||g.clientHeight;\n\treturn { width:x,height:y };\n}", "title": "" }, { "docid": "786980fc6b5f1522d187ed99af1c579d", "score": "0.5804844", "text": "function updateViewportDimensions() {\n\tvar w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0],x=w.innerWidth||e.clientWidth||g.clientWidth,y=w.innerHeight||e.clientHeight||g.clientHeight;\n\treturn { width:x,height:y };\n}", "title": "" }, { "docid": "786980fc6b5f1522d187ed99af1c579d", "score": "0.5804844", "text": "function updateViewportDimensions() {\n\tvar w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0],x=w.innerWidth||e.clientWidth||g.clientWidth,y=w.innerHeight||e.clientHeight||g.clientHeight;\n\treturn { width:x,height:y };\n}", "title": "" }, { "docid": "786980fc6b5f1522d187ed99af1c579d", "score": "0.5804844", "text": "function updateViewportDimensions() {\n\tvar w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0],x=w.innerWidth||e.clientWidth||g.clientWidth,y=w.innerHeight||e.clientHeight||g.clientHeight;\n\treturn { width:x,height:y };\n}", "title": "" }, { "docid": "32ca0585ffbc517308d9cceaff78e3a4", "score": "0.58016694", "text": "function changeViewSize() {\n\n\n\n }", "title": "" }, { "docid": "455eee17747820c4331de298204fe0d4", "score": "0.5778746", "text": "updateViewport()\n\t\t{\n\t\t\tvar gl = this.gl;\n\t\t\tvar canvas = this.canvas;\n\t\t\t\n\t\t\tif ( canvas.clientWidth != gl.viewportWidth || canvas.clientHeight != gl.viewportHeight )\n\t\t\t{\n\t\t\t\tgl.viewportWidth = canvas.clientWidth;\n\t\t\t\tgl.viewportHeight = canvas.clientHeight;\n\t\t\t\t\n\t\t\t\tcanvas.width = canvas.clientWidth;\n\t\t\t\tcanvas.height = canvas.clientHeight;\n\t\t\t\t\n\t\t\t\t// Update perspective projection based on new w/h ratio\n\t\t\t\tthis.setPerspective( this.fov, this.min, this.max );\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "f70ad88c1124672378d1bb65399cbad0", "score": "0.5776928", "text": "realSize() {\n\t\treturn this.viewSpec().realSize(this);\n\t}", "title": "" }, { "docid": "16a4ab94e4ad1414bd6ad238da9d2e5a", "score": "0.5771422", "text": "resizeCanvas() {\n\t\tif (!this._initialized) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._options.autoHeight) {\n\t\t\tthis._viewportH = this._options.rowHeight * this._getDataLengthIncludingAddNew();\n\t\t} else {\n\t\t\tthis._viewportH = this._getViewportHeight();\n\t\t}\n\n\t\tthis._numVisibleRows = Math.ceil(this._viewportH / this._options.rowHeight);\n\t\tthis._viewportW = this._container.clientWidth;\n\t\tif (!this._options.autoHeight) {\n\t\t\tsetPx(this._viewport, 'height', this._viewportH);\n\t\t}\n\n\t\tif (this._options.forceFitColumns) {\n\t\t\tthis.autosizeColumns();\n\t\t}\n\n\t\tthis.updateRowCount();\n\t\tthis._handleScroll();\n\n\t\t// Since the width has changed, force the render() to reevaluate virtually rendered cells.\n\t\tthis._lastRenderedScrollLeft = -1;\n\t\tthis.render();\n\t}", "title": "" }, { "docid": "15cd884e099d38199976e022997a5b3b", "score": "0.57697433", "text": "_updateCanvasSize()\n {\n this.canvas.width = this.config.container.clientWidth;\n this.canvas.height = this.config.container.clientHeight;\n }", "title": "" }, { "docid": "5f58dd8b24f101824fcd41e373342b73", "score": "0.57694936", "text": "function updateViewportDimensions() {\n\tvar w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0],x=w.innerWidth||e.clientWidth||g.clientWidth,y=w.innerHeight||e.clientHeight||g.clientHeight;\n\treturn { width:x,height:y }\n}", "title": "" }, { "docid": "c7a73d896686363d69f050748d705a26", "score": "0.57604843", "text": "function updateViewportDimensions() {\n\tvar w = window, d = document, e = d.documentElement, g = d.getElementsByTagName( 'body' )[0], x = w.innerWidth || e.clientWidth || g.clientWidth, y = w.innerHeight || e.clientHeight || g.clientHeight;\n\treturn { width: x, height: y }\n}", "title": "" }, { "docid": "9c78f99169c9ee19be45e1b082de7294", "score": "0.57591736", "text": "function updateTotalPages() {\n // Update the total page count\n total_pages = Math.ceil(data.length / page_settings.rows_per_page);\n // Update the page buttons in case there is a change\n updatePageChangeButtons();\n}", "title": "" }, { "docid": "e96256122208f9018843957e3e63f493", "score": "0.57315665", "text": "_measureViewportSize() {\n const viewportEl = this.elementRef.nativeElement;\n this._viewportSize = this.orientation === 'horizontal' ? viewportEl.clientWidth : viewportEl.clientHeight;\n }", "title": "" }, { "docid": "52b0f3df7715a812d452cf11649bdef9", "score": "0.57248634", "text": "function updateViewportDimensions() {\r\n\tvar w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0],x=w.innerWidth||e.clientWidth||g.clientWidth,y=w.innerHeight||e.clientHeight||g.clientHeight;\r\n\treturn { width:x,height:y };\r\n}", "title": "" }, { "docid": "5537bbdcde2c5b17d418db2dc04415b0", "score": "0.57076615", "text": "function updateViewportDimensions() {\n var w = window,\n d = document,\n e = d.documentElement,\n g = d.getElementsByTagName('body')[0],\n x = w.innerWidth || e.clientWidth || g.clientWidth,\n y = w.innerHeight || e.clientHeight || g.clientHeight;\n return {\n width: x,\n height: y\n };\n}", "title": "" }, { "docid": "a970df7b13f50244d356d16ee39d1e9b", "score": "0.5703094", "text": "function changeFontSize(newSize) {\n\tdocument.getElementById(\"viewport\").style.fontSize = newSize;\n}", "title": "" }, { "docid": "f0f17e26d53c931fbd17cf50e655ccec", "score": "0.56960016", "text": "function computeSize() {\n width = parseInt(d3.select(\"#map\").style(\"width\"));\n height = $('main').innerHeight();\n }", "title": "" }, { "docid": "3ebeb519a365f1105eae82a419a89866", "score": "0.56901854", "text": "updateSize()\n {\n this.pos.x = canvas.width * SELECTIONPANEL_WIDTH_PC - 1;\n this.size.x = canvas.width - this.pos.x;\n this.size.y = canvas.height * INFOPANEL_HEIGHT_PC;\n this.pos.y = canvas.height - this.size.y;\n }", "title": "" }, { "docid": "aa75f027303652a0c75c20735673caec", "score": "0.56801134", "text": "function updateCanvasSize () {\n // Set the canvas size to match the window size. Notice that canvas.width and canvas.height are not the\n // same as the CSS width and height of the canvas! If you use CSS to size your canvas, you will always have\n // to manually set the properties width and height of the canvas element accordingly.\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n\n // Tell the demo that its canvas has changed its size.\n demo.updateSize();\n }", "title": "" }, { "docid": "6e118c90f4a7a1d23118f7c043ea0dd0", "score": "0.5675775", "text": "setNewSize(){\n var containerHeight = this.getContainerHeight();\n var velocity = this.getVelocity();\n var newHeight = containerHeight;\n this.calculateGap();\n\n //HEIGHT CALCULATION\n if( this.currentGap > 0 ){\n var newHeight = containerHeight + (this.currentGap);\n if( velocity > 1 )\n newHeight *= (velocity * velocity);\n }\n\n newHeight += this.getSecuritySize();\n this.$elem.height(newHeight);\n return containerHeight;\n }", "title": "" }, { "docid": "eafb156edacdf49add664bb00e1d0a5f", "score": "0.5669304", "text": "recalculate() {\n this.resizeScrollbar();\n }", "title": "" }, { "docid": "1b8a552233b6abb1cd8c7377cfa80d0b", "score": "0.56691504", "text": "function updateFrameSize() {\n\n // Setup frame heights.\n var navHeight = Math.ceil($('nav').outerHeight(true));\n var frame = $('#content-frame').css({\n 'height': 'calc(100% - ' + navHeight + 'px)',\n 'position': 'relative',\n 'top': navHeight,\n 'left': 0\n });\n canvasSize = {x: Math.floor(frame.width()), y: Math.floor(frame.height())};\n}", "title": "" }, { "docid": "11e0cc8746c2e3d4827a2f590145f82a", "score": "0.5668199", "text": "updateSize() {\n\n this.activeProfile = this.getActiveProfile(this.profiles, this.presentationProfileChanges);\n const margin = this.activeProfile.margin;\n\n this.height = (parseInt(this.element.style(\"height\"), 10) - margin.top - margin.bottom) || 0;\n this.width = (parseInt(this.element.style(\"width\"), 10) - margin.left - margin.right) || 0;\n\n if (this.height <= 0 || this.width <= 0) return utils.warn(\"Bubble map updateSize() abort: vizabi container is too little or has display:none\");\n\n this.repositionElements();\n this.rescaleMap();\n\n }", "title": "" }, { "docid": "af4cefc86383ff4e490d2ff8fcb17179", "score": "0.5664761", "text": "function setCurrentViewPortSize() {\n _currentViewPortSize = {\n width : window.innerWidth,\n height: window.innerHeight\n };\n }", "title": "" } ]
d3e665e7933e7201fb3676666d90f7cc
Function constructor() : Create Terminal
[ { "docid": "55bcab55d9b67a4ff7ffc40493933962", "score": "0.6266489", "text": "constructor() {\n\t\tif ( Terminal.instance == null ) {\n\n\t\t\t/**\n\t\t\t * @type {import('@appsflow/core/src/modules/logger').Logger}\n\t\t\t */\n\t\t\tthis.logger = new ($flow.modules().Logger)( Terminal.getName(), true );\n\t\t\tthis.logger.startEmpty();\n\n\t\t\tthis.localStorage = window.localStorage;\n\n\t\t\twindow.document.onreadystatechange = () => {\n\t\t\t\tthis.elements = {\n\t\t\t\t\tbody: $( 'body' ),\n\n\t\t\t\t\tterminal: {\n\t\t\t\t\t\tself: $( '#terminal' ),\n\n\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\tresize: $( '#terminal button.resize' ),\n\t\t\t\t\t\t\tclose: $( '#terminal button.close' ),\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis._initialize();\n\n\t\t\t}\n\n\t\t\tTerminal.instance = this;\n\t\t}\n\n\t\treturn Terminal.instance;\n\t}", "title": "" } ]
[ { "docid": "ea52ec07958a49b098a3da6a8af08ce4", "score": "0.69422585", "text": "function Terminal(options) {\n if (! options) options = {};\n this.width = options.width;\n this.height = options.height;\n this.bell = options.bell;\n this.visualBell = options.visualBell;\n this.scrollback = options.scrollback;\n this.oninput = null;\n this.onresize = null;\n this.node = null;\n this.savedAttrs = null;\n this.parser = new EscapeParser();\n this.csiHandlers = {};\n this._currentScreen = 0;\n this._decoder = new UTF8Dec();\n this._accum = new TextAccumulator();\n this._keydown = this.keydown.bind(this);\n this._keyup = this.keyup.bind(this);\n this._mousemove = this.mousemove.bind(this);\n this._mousedown = this.mousedown.bind(this);\n this._mouseup = this.mouseup.bind(this);\n this._mousewheel = this.mousewheel.bind(this);\n this._focusin = this.focusin.bind(this);\n this._focusout = this.focusout.bind(this);\n this._resize = this.resize.bind(this);\n this._lastKey = null;\n this._lastMouse = null;\n this._pendingBells = [];\n this._pendingUpdate = [null, null];\n this._queuedInput = [];\n this._initParser();\n this._initControls();\n this.reset(false);\n }", "title": "" }, { "docid": "98f19156e328fa927879e83abb138487", "score": "0.69117063", "text": "constructor(session, options = {}) {\n super();\n this._needsResize = true;\n this._termOpened = false;\n this._offsetWidth = -1;\n this._offsetHeight = -1;\n this.session = session;\n // Initialize settings.\n this._options = Object.assign({}, ITerminal.defaultOptions, options);\n const _a = this._options, { initialCommand, theme } = _a, other = __rest(_a, [\"initialCommand\", \"theme\"]);\n const xtermOptions = Object.assign({ theme: Private.getXTermTheme(theme) }, other);\n this.addClass(TERMINAL_CLASS);\n // Create the xterm.\n this._term = new Xterm(xtermOptions);\n this._initializeTerm();\n this.id = `jp-Terminal-${Private.id++}`;\n this.title.label = 'Terminal';\n session.messageReceived.connect(this._onMessage, this);\n session.terminated.connect(this.dispose, this);\n void session.ready.then(() => {\n if (this.isDisposed) {\n return;\n }\n this.title.label = `Terminal ${session.name}`;\n this._setSessionSize();\n if (this._options.initialCommand) {\n this.session.send({\n type: 'stdin',\n content: [this._options.initialCommand + '\\r']\n });\n }\n });\n }", "title": "" }, { "docid": "605b051a46249eb70b1fe281f2e12c72", "score": "0.68835074", "text": "function Terminal(\r\n\tcontainer, \r\n\twidth, \r\n\theight, \r\n\tdefault_background, \r\n\tdefault_foreground,\r\n\tline_height\r\n) {\r\n\t\r\n\t//**** Private\r\n\t\r\n\tthis.container = container;\r\n\t\r\n\tthis.line_height = line_height;\r\n\tthis.num_excess_lines = 0; // Number of lines that aren't visible\r\n\t\r\n\tthis.default_background = default_background;\r\n\tthis.default_foreground = default_foreground;\r\n\r\n\tthis.chars = [];\r\n\tthis.breaks = [];\r\n\t\r\n\t// These start at one to be compatible with vt100 escape codes\r\n\tthis.cursorx = 1; \r\n\tthis.cursory = 1;\r\n\t\r\n\t// For save_cursor and restore_cursor\r\n\tthis.savedx = undefined;\r\n\tthis.savedy = undefined;\r\n\t\r\n\tthis.get = get;\r\n\tthis.getxy = getxy;\r\n\t\r\n\tthis.set_char = set_char;\r\n\tthis.set_char_xy = set_char_xy;\r\n\t\r\n\tthis.get_char = get_char;\r\n\tthis.get_char_xy = get_char_xy;\r\n\r\n\tthis.clear_char = clear_char;\r\n\tthis.clear_attributes = clear_attributes;\r\n\t\r\n\tthis.set_attribute = set_attribute;\r\n\tthis.apply_attributes = apply_attributes;\r\n\tthis.apply_attributes_xy = apply_attributes_xy;\r\n\t\r\n\tthis.initialize_row = initialize_row;\r\n\t\r\n\tthis.delete_row_tags = delete_row_tags;\r\n\t\r\n\t\r\n\t//**** Public\r\n\tthis.width = width; // Read-only \r\n\tthis.height = height; // Read-only\r\n\t\r\n\tthis.tab_size = 4;\r\n\t\r\n\tthis.move_cursor = move_cursor;\r\n\tthis.save_cursor = save_cursor;\r\n\tthis.restore_cursor = restore_cursor;\r\n\t\r\n\tthis.set_x = set_x;\r\n\tthis.set_y = set_y;\r\n\t\r\n\tthis.clear = clear;\r\n\t\r\n\tthis.write_char = write_char;\r\n\t\r\n\tthis.newline = newline;\r\n\tthis.tab = tab;\r\n\tthis.backspace = backspace;\r\n\t\r\n\t// Move the terminal node within a containing node that clips off the excess\r\n\tthis.move_up = move_up;\r\n\tthis.move_down = move_down;\r\n\t\r\n\tthis.scroll = scroll;\r\n\t\r\n\t// Scrolls the terminal all the way down\r\n\tthis.reset_scroll_pos = reset_scroll_pos;\r\n\t\r\n\t\r\n\t//**** Initialization\r\n\tfor(var i=height-1; i>=0; i--) {\r\n\t\tthis.initialize_row(i, this.container.firstChild);\r\n\t}\r\n\r\n\tthis.clear_attributes();\r\n}", "title": "" }, { "docid": "dbfa03c125a6e64ed95272781e60dff9", "score": "0.67543644", "text": "function createTerminalSession(options) {\n if (options === void 0) { options = {}; }\n if (options.name && options.name in Private.running) {\n return Private.running[options.name];\n }\n return new TerminalSession(options).connect();\n}", "title": "" }, { "docid": "ee5d788b83260ee3b0a42de564ae569d", "score": "0.6734099", "text": "function _terminal() {\n Util.spawn(['gnome-terminal']);\n}", "title": "" }, { "docid": "ff833a193e4ec40dcdc5483e800620a6", "score": "0.66862595", "text": "function GnomeTerminalCommand(terminal) {\n this._init(terminal);\n}", "title": "" }, { "docid": "bb82f498cb61e62dc4d1b0cf60d39779", "score": "0.65525424", "text": "function build (param) {\n const $divid = param;\n const shellcm = $divid.textContent;\n const classlist = [\n 'gnome-terminal',\n 'header-terminal',\n 'content',\n 'list-btns-terminal',\n 'btn-terminal',\n 'command',\n 'prompt'\n ];\n \n // remove a content of #gnome-terminal\n if (!isEmpty($divid)) {\n $divid.removeChild($divid.childNodes[0]);\n }\n\n // add class gnome-terminal\n $divid.className = classlist[0];\n // append element header-terminal\n $divid.appendChild(createElement());\n // append element content\n $divid.appendChild(createElement());\n // add class header-terminal\n $divid.children[0].className = classlist[1];\n // add class content\n $divid.children[1].className = classlist[2];\n // sons header-terminal and content\n const sons = $divid.children;\n // append ul to header-terminal\n sons[0].appendChild(createElement('ul'));\n // ul ~> list-btns-terminal\n const listsbtns = sons[0].children[0];\n // add class list-btns-terminal\n listsbtns.className = classlist[3];\n // append li to listsbtns\n var i;\n for (i = 0; i < 4; i++) {\n listsbtns.appendChild(createElement('li'));\n }\n // add class to li\n for (i = 0; i < 3; i++) {\n listsbtns.children[i].className = classlist[4];\n }\n // add text content 'Terminal'\n listsbtns.children[3].textContent = 'Terminal';\n // append command to content element\n sons[1].appendChild(createElement());\n // son of content (command)\n const soncontent = sons[1].children[0];\n // add class command\n soncontent.className = 'command-line';\n // append prompt to command element\n soncontent.appendChild(createElement());\n // apppend shell to command element\n soncontent.appendChild(createElement('span'));\n // append cursor\n soncontent.appendChild(createElement('span'));\n // add class to prompt element\n const $prompt = soncontent.children[0];\n const $shell = soncontent.children[1];\n const $cursor = soncontent.children[2];\n $prompt.className = 'prompt';\n $shell.className = 'shell';\n $cursor.className = 'cursor';\n // create a element span for 'user@user'\n $prompt.appendChild(createElement('span'));\n // create element span for ':'\n $prompt.appendChild(createElement('span'));\n // create element span for '~'\n $prompt.appendChild(createElement('span'));\n // create element span for '$'\n $prompt.appendChild(createElement('span'));\n // string of $prompt\n const usr = 'user@host';\n const $child = $prompt.children;\n\n // create a text node\n $child[0].appendChild(text(usr));\n $child[1].appendChild(text(':'));\n $child[2].appendChild(text('~'));\n $child[3].appendChild(text('$'));\n\n // add styles\n $child[0].style.color = '#008000';\n $child[1].style.color = '#fff';\n $child[2].style.color = '#4169e1';\n $child[3].style.color = '#fff';\n\n $shell.textContent = shellcm;\n $shell.setAttribute('contenteditable', 'true');\n }", "title": "" }, { "docid": "1c6cd1275705c47aa583fdb37d226d59", "score": "0.65388", "text": "function LilyTermCommand(terminal) {\n this._init(terminal);\n}", "title": "" }, { "docid": "6e99e64d4cdbc221c31eedecc8994df9", "score": "0.6457642", "text": "function TerminixCommand(terminal) {\n this._init(terminal);\n}", "title": "" }, { "docid": "e0e53882b4695da353a6457d8f050ffb", "score": "0.6420508", "text": "function TMuxCommand(terminal) {\n this._init(terminal);\n}", "title": "" }, { "docid": "882bde78444e1ce745974e2b7f7cc100", "score": "0.63652915", "text": "function spawn(file, args, opt) {\n return new Terminal(file, args, opt);\n}", "title": "" }, { "docid": "882bde78444e1ce745974e2b7f7cc100", "score": "0.63652915", "text": "function spawn(file, args, opt) {\n return new Terminal(file, args, opt);\n}", "title": "" }, { "docid": "cffc8f6ab9b952767e58c64b78232d84", "score": "0.6262845", "text": "function Shell()\n{\n // Properties\n this.promptStr = \">\";\n this.commandList = [];\n this.curses = \"[fuvg],[cvff],[shpx],[phag],[pbpxfhpxre],[zbgureshpxre],[gvgf]\";\n this.apologies = \"[sorry]\";\n // Methods\n this.init = shellInit;\n this.putPrompt = shellPutPrompt;\n this.handleInput = shellHandleInput;\n this.execute = shellExecute;\n}", "title": "" }, { "docid": "b3a8f608c408dcdabb4bf69b50f88177", "score": "0.6257692", "text": "function startNew(options) {\n\t return default_1.DefaultTerminalSession.startNew(options);\n\t }", "title": "" }, { "docid": "f960280a154ad24a450b65b199c9c409", "score": "0.6221773", "text": "function Shell() {\r\n // Properties\r\n this.promptStr = \">\";\r\n this.commandList = [];\r\n this.curses = \"[fuvg],[cvff],[shpx],[phag],[pbpxfhpxre],[zbgureshpxre],[gvgf]\";\r\n this.apologies = \"[sorry]\";\r\n // Methods\r\n this.init = shellInit;\r\n this.putPrompt = shellPutPrompt;\r\n this.handleInput = shellHandleInput;\r\n this.execute = shellExecute;\r\n}", "title": "" }, { "docid": "b670a7cfd24e3b6937d28b361303b422", "score": "0.6214437", "text": "function Console() {\n this.textarea = document.createElement('textarea');\n this.log = function (txt, type) {\n if (type) this.textarea.value += type + \" \";\n this.textarea.value += txt + \"\\n\";\n }\n this.error = function (txt) {\n this.log(txt, \"ERROR!\");\n }\n }", "title": "" }, { "docid": "350527a82744c5d3f31303759e58dc38", "score": "0.6115195", "text": "function Terminal(object){\n /**\n * Writes at the terminal\n * @param {string} message\n * @return null\n */\n function write(message) {\n $(object).html( $(object).html() + \"<br>$ \" + message);\n $(object).scrollTop(999999);\n }\n\n return {\n write: function(message) {write(message);}\n }\n}", "title": "" }, { "docid": "f058922c62b5ba65e8b2715a1ecf4e75", "score": "0.608365", "text": "function LogConsole(terminal) {\n\tthis.terminal = terminal;\n\tthis.length = 0;\n}", "title": "" }, { "docid": "181b6c825f2f076ade55879575bd716f", "score": "0.6078574", "text": "function Shell() {\n // Properties\n this.promptStr = \">\";\n this.commandList = [];\n this.curses = \"[fuvg],[cvff],[shpx],[phag],[pbpxfhpxre],[zbgureshpxre],[gvgf]\";\n this.apologies = \"[sorry]\";\n this.cmdHistory = [];\n this.cmdHistoryLength = -1; \n // Methods\n this.init = shellInit;\n this.putPrompt = shellPutPrompt;\n this.handleInput = shellHandleInput;\n this.execute = shellExecute;\n}", "title": "" }, { "docid": "0c02634550877f4ae9f90ea18b8192b5", "score": "0.60225964", "text": "function CardTerminals() {\r\n\tthis.contextId = 0;\r\n this.init();\r\n}", "title": "" }, { "docid": "9446421a67a7c8015c8df3a2975590b2", "score": "0.6020471", "text": "function Shell() {\n // Properties\n this.promptStr = \">\";\n this.commandList = [];\n this.curses = \"[fuvg],[cvff],[shpx],[phag],[pbpxfhpxre],[zbgureshpxre],[gvgf]\";\n this.adviceArray = [\"You should probably just talk it out.\"];\n this.apologies = \"[sorry]\"; \n // Methods\n this.init = shellInit;\n this.putPrompt = shellPutPrompt;\n this.handleInput = shellHandleInput;\n this.execute = shellExecute;\n}", "title": "" }, { "docid": "68f2ad3160ff7ed0eb5f8931c02104bb", "score": "0.6020203", "text": "function URXVTCommand(terminal) {\n this._init(terminal);\n}", "title": "" }, { "docid": "c47ef09b530e99f5f718132c7c6c3fd8", "score": "0.6008795", "text": "function ShellCommand() \n{\n // Properties\n this.command = \"\";\n this.description = \"\";\n this.function = \"\";\n}", "title": "" }, { "docid": "c47ef09b530e99f5f718132c7c6c3fd8", "score": "0.6008795", "text": "function ShellCommand() \n{\n // Properties\n this.command = \"\";\n this.description = \"\";\n this.function = \"\";\n}", "title": "" }, { "docid": "2a2215ba701ca214980e0ecb683654ff", "score": "0.5895133", "text": "_initializeTerm() {\n const term = this._term;\n term.on('data', (data) => {\n if (this.isDisposed) {\n return;\n }\n this.session.send({\n type: 'stdin',\n content: [data]\n });\n });\n term.on('title', (title) => {\n this.title.label = title;\n });\n // Do not add any Ctrl+C/Ctrl+V handling on macOS,\n // where Cmd+C/Cmd+V works as intended.\n if (Platform.IS_MAC) {\n return;\n }\n term.attachCustomKeyEventHandler(event => {\n if (event.ctrlKey && event.key === 'c' && term.hasSelection()) {\n // Return so that the usual OS copy happens\n // instead of interrupt signal.\n return false;\n }\n if (event.ctrlKey && event.key === 'v' && this._options.pasteWithCtrlV) {\n // Return so that the usual paste happens.\n return false;\n }\n return true;\n });\n }", "title": "" }, { "docid": "09b04129234aca7c60384c0bd7d7cf08", "score": "0.5884722", "text": "function ShellCommand()\n{\n // Properties\n this.command = \"\";\n this.description = \"\";\n this.function = \"\";\n}", "title": "" }, { "docid": "51d2548f10490f0dcac0618677da7147", "score": "0.5881312", "text": "function ShellCommand() {\r\n // Properties\r\n this.command = \"\";\r\n this.description = \"\";\r\n this.\r\n function = \"\";\r\n}", "title": "" }, { "docid": "951a4527be69d1716fdea7f2c91881cd", "score": "0.587681", "text": "spawnIftop() {\n this.term = pty.spawn(this.iftopPath, [\"-i\", this.iface, \"-t\", \"-L\", this.n, \"-p\", \"-f\", this.defaultFilter, \"-N\"], {\n name: 'xterm-color',\n cols: 120,\n rows: 60,\n cwd: process.env.HOME,\n env: process.env\n });\n \n this.term.on('data', (data) => {\n if (data.match(/No such device/)) {\n this.emit('error', \"ERROR: can't find specified device\");\n } else {\n this.handleData(data);\n }\n });\n }", "title": "" }, { "docid": "1ecc5ecebf76922fb4bb862fab364b1c", "score": "0.58722687", "text": "function createNewBash(){\n // create DOM elements\n let newBash = document.createElement(\"DIV\");\n let mainP = document.createElement(\"P\");\n let name_term = document.createElement(\"SPAN\");\n let path_term = document.createElement(\"SPAN\");\n let marker = document.createElement(\"SPAN\")\n let input = document.createElement(\"SPAN\");\n let blinker = document.createElement(\"SPAN\");\n\n name_term.innerHTML = name+'@'+loc+':';\n if (path !== '/'){\n path_term.innerHTML = ' ~'+ path + ' ';\n }else{\n path_term.innerHTML = ' ~ ';\n }\n marker.innerHTML = marker_val + ' ';\n\n name_term.setAttribute(\"id\", \"name_term\")\n path_term.setAttribute(\"id\", \"path_term\")\n newBash.setAttribute(\"id\",\"bash\")\n input.setAttribute(\"id\",\"input\");\n blinker.setAttribute(\"id\",\"blinker\");\n blinker.innerHTML=\"_\";\n \n // Append nodes\n mainP.appendChild(name_term);\n mainP.appendChild(path_term);\n mainP.appendChild(marker);\n mainP.appendChild(input);\n mainP.appendChild(blinker);\n newBash.appendChild(mainP);\n \n return newBash;\n \n}", "title": "" }, { "docid": "e62cb9da873e7884001cdfd6363803c1", "score": "0.5859588", "text": "function TerminatorCommand(terminal) {\n this._init(terminal);\n}", "title": "" }, { "docid": "f1fc59844b1075929e52f8b2cc728489", "score": "0.58383274", "text": "function TerminalManager(options) {\n if (options === void 0) { options = {}; }\n var _this = this;\n this._running = [];\n this._isDisposed = false;\n this._isReady = false;\n this._refreshTimer = -1;\n this._runningChanged = new signaling_1.Signal(this);\n this.serverSettings = options.serverSettings || __1.ServerConnection.makeSettings();\n // Set up state handling if terminals are available.\n if (terminal_1.TerminalSession.isAvailable()) {\n // Initialize internal data.\n this._readyPromise = this._refreshRunning();\n // Set up polling.\n this._refreshTimer = setInterval(function () {\n _this._refreshRunning();\n }, 10000);\n }\n }", "title": "" }, { "docid": "eec69c73d5adba14289d2e77440804bf", "score": "0.58022374", "text": "function TerminalSession(options) {\n if (options === void 0) { options = {}; }\n this._ajaxSettings = null;\n this._ws = null;\n this._isDisposed = false;\n this._promise = null;\n this._baseUrl = options.baseUrl || utils.getBaseUrl();\n this._ajaxSettings = options.ajaxSettings || {};\n this._name = options.name;\n this._wsUrl = options.wsUrl || utils.getWsUrl(this._baseUrl);\n this._promise = new utils.PromiseDelegate();\n }", "title": "" }, { "docid": "410ef93bc0c7459c2eeeddb4a8cf9554", "score": "0.5768736", "text": "function createNewBash(){\n // create DOM elements\n let newBash = document.createElement(\"DIV\");\n let mainP = document.createElement(\"P\");\n let input = document.createElement(\"SPAN\");\n let blinker = document.createElement(\"SPAN\");\n \n // set sttributes to created elements\n mainP.innerHTML=\"~$\";\n newBash.setAttribute(\"id\",\"bash\")\n input.setAttribute(\"id\",\"input\");\n blinker.setAttribute(\"id\",\"blinker\");\n blinker.innerHTML=\"_\";\n \n // Append nodes\n mainP.appendChild(input);\n mainP.appendChild(blinker);\n newBash.appendChild(mainP);\n \n return newBash;\n \n}", "title": "" }, { "docid": "b9bcfa189ef64d07eb4cbb3b6be4647e", "score": "0.57241523", "text": "function CreateStreamCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" }, { "docid": "f2b9b579b237ed11986ff9337b9cf367", "score": "0.57226", "text": "constructor(input) {\n // Start section: command_constructor\n super();\n this.input = input;\n // End section: command_constructor\n }", "title": "" } ]
91cacd50c65ee0b72f446365d62dcd03
End keypressevent functionality / enableRotateButtons( disabledButton ) Enables all buttons of class controllerrotatebtn except the button passed in. Parameters: disabledButton: button to remain disabled.
[ { "docid": "3621a7b749bec31c26f9e428fcba815a", "score": "0.805899", "text": "function enableRotateButtons(disabledButton) {\r\n\t$('.controller-rotate-btn').removeAttr(\"disabled\", \"disabled\");\r\n\r\n\tdisabledButton.attr(\"disabled\", \"disabled\");\r\n}", "title": "" } ]
[ { "docid": "6607c4bb379e7e06fe4f8f1a5bcd66fa", "score": "0.6386415", "text": "function disableButton() {\n this.disabled = true;\n}", "title": "" }, { "docid": "56762e1d77e4d4c320eb3e0f75a74bdf", "score": "0.6324147", "text": "function disable_buttons_retailer()\n {\n \n $('.button').removeClass('enable_button');\n $('.button').addClass('disable_button');\n }", "title": "" }, { "docid": "ba870a8f4c99200fec6647287c7ea2f3", "score": "0.6294406", "text": "function buttonEnable() {\n document.getElementById(\"back-btn\").disabled = false;\n document.getElementById(\"next-btn\").disabled = false;\n document.getElementById(\"finish-btn\").disabled = false;\n }", "title": "" }, { "docid": "7da8590e9ebc2805f10217956c2e7597", "score": "0.6278143", "text": "function buttonDisable() {\n document.getElementById(\"back-btn\").disabled = true;\n document.getElementById(\"next-btn\").disabled = true;\n document.getElementById(\"finish-btn\").disabled = true;\n }", "title": "" }, { "docid": "4e0158597702b2241faca5acea765103", "score": "0.62253004", "text": "enable() {\n this.elements.button.removeAttribute(\"disabled\");\n }", "title": "" }, { "docid": "a986bf8adb75442758d2eb37d692a588", "score": "0.61769956", "text": "function disableButtons() {\n for (var i = 65; i < 91; i++) {\n document.getElementById(String.fromCharCode(i)).disabled = true;\n }\n document.getElementById(\"restart\").disabled = true;\n}", "title": "" }, { "docid": "3321e6f0935a3094c65c1fd3862d1e8f", "score": "0.6173548", "text": "function disableNext(){\n if (nextButton!=undefined) \n nextButton.disable();\n //The .off(\"keydown\") and .off(\"keypress\") seems to have bug\n //bind to null instead\n // console.log(nextButton.style())\n }", "title": "" }, { "docid": "fcb177612cbc85d0496283a697f6c79d", "score": "0.61126906", "text": "function dadDisableSaveAndNextButton(disabled)\n{\n if (disabled)\n {\n Ext.get('tr_next').removeClass('pgBntG');\n Ext.get('tr_next').addClass('pgBntGDis');\n Ext.get('next').dom.disabled = true;\n }\n else\n {\n Ext.get('tr_next').removeClass('pgBntGDis');\n Ext.get('tr_next').addClass('pgBntG');\n Ext.get('next').dom.disabled = false;\n }\n}", "title": "" }, { "docid": "4fc46d0abf631b466fdaf009c7c49e96", "score": "0.60942703", "text": "function enableButtons() {\n for (var i = 65; i < 91; i++) {\n document.getElementById(String.fromCharCode(i)).disabled = false;\n }\n document.getElementById(\"restart\").disabled = false;\n}", "title": "" }, { "docid": "cf6e2610bdd8f766dbd555a227b1ba19", "score": "0.60872364", "text": "function disablebtn() {\r\n document.getElementById(\"next\").disabled = true;\r\n document.getElementById(\"prev\").disabled = true;\r\n}", "title": "" }, { "docid": "15f07cc661c1019cf0e4e1c1ec273e34", "score": "0.60529906", "text": "disable() {\n this.elements.button.setAttribute(\"disabled\", \"true\");\n }", "title": "" }, { "docid": "1bd84f33db4240a8d8fa91a77e5359fd", "score": "0.60409135", "text": "disable_buttons() {\n simulateButton.attr('disabled', true);\n nextStepButton.attr('disabled', true);\n stopButton.attr('disabled', true);\n }", "title": "" }, { "docid": "f835ec1c70c09ea18e1a0e4d7540ae94", "score": "0.6040249", "text": "function enableButton(button){\n\t\tbutton.prop('disabled',false).removeClass('disabled');\n\t}", "title": "" }, { "docid": "354af30f98f75036448237fe77069c13", "score": "0.60152817", "text": "function _disabledEnabledButton(_button, _disabled, _class) {\n if (stringToBoolean(_disabled)) {\n _button.removeClass('');\n }\n}", "title": "" }, { "docid": "162e8e388d5777feefd735f0e89c0da3", "score": "0.60148096", "text": "function disable_buttons()\n{\n for(var i = 0 ; i < butts_algos.length ; i++)\n {\n butts_algos[i].classList = [] ;\n butts_algos[i].classList.add('butt_locked') ;\n\n butts_algos[i].disabled = true ;\n inp_as.disabled = true ;\n inp_gen.disabled = true ;\n inp_aspeed.disabled = true ;\n }\n}", "title": "" }, { "docid": "f0fd66316ff21e1cd8fbb825ecbc5bbc", "score": "0.6005706", "text": "function disable()\n{\n // To disable the button \"Generate New Array\"\n document.getElementById(\"Button1\").disabled = true;\n document.getElementById(\"Button1\").style.backgroundColor = \"#d8b6ff\";\n\n // To disable the button \"Selection Sort\"\n document.getElementById(\"Button2\").disabled = true;\n document.getElementById(\"Button2\").style.backgroundColor = \"#d8b6ff\"; \n}", "title": "" }, { "docid": "6a5baadb03376bf15e0e4daa04d2a392", "score": "0.5981692", "text": "function disable()\n{\n // To disable the button \"Generate New Array\"\n document.getElementById(\"Button1\").disabled = true;\n document.getElementById(\"Button1\").style.backgroundColor = \"#d8b6ff\";\n \n // To disable the button \"Linear Search\"\n document.getElementById(\"Button2\").disabled = true;\n document.getElementById(\"Button2\").style.backgroundColor = \"#d8b6ff\"; \n}", "title": "" }, { "docid": "a478e38083d7bbd1dd494476f4aa65c7", "score": "0.5966273", "text": "function disableButton(button){\n\t\tbutton.prop('disabled',true).addClass('disabled');\n\t}", "title": "" }, { "docid": "93f7856bec6edc71d3d8daed2f0b6d29", "score": "0.5965188", "text": "function disableButton(button) {\n button.attr('disabled', 'disabled');\n }", "title": "" }, { "docid": "4d2dca57af0cbbfa64039272351c60a2", "score": "0.5944918", "text": "function disabledBtn() {\n elementNumber.value = ''\n elementNumber.disabled = true\n btn.disabled = true\n }", "title": "" }, { "docid": "3a20fec877d6d074d2619e069c11f1d3", "score": "0.59336793", "text": "function disableButtons() {\n for (let i = 0; i < 26; i++) {\n // letters is an array of the alphabet\n document.getElementById(letters[i]).disabled = true;\n }\n}", "title": "" }, { "docid": "6504695674c166514552e93c324421d3", "score": "0.5930724", "text": "function enableButtons() {\n\tattackButton.disabled = false;\n\tpowerattackButton.disabled = false;\n\thealButton.disabled = false;\n\tgiveupButton.disabled = false;\n}", "title": "" }, { "docid": "2ff6d7b9bb8e57fb58f338c6725a1a8b", "score": "0.5911182", "text": "disableButtons () {\n var disabledClass = this.disabledClass;\n this.$('[data-button]').each(function (i, btn) {\n if (hasClass(btn, 'disabled') || hasClass(btn, disabledClass)) {\n return;\n }\n addClass(btn, 'disabled disabled-by-btnView ' + disabledClass);\n });\n }", "title": "" }, { "docid": "7ce4fbce0bc209ec5ac3cabd10d3895e", "score": "0.5900386", "text": "function DisabledSectionRoleButtons(isDisabled) {\n if (isDisabled) {\n if (typeof(parent.parent.RemoveMark) != \"undefined\") {\n parent.parent.RemoveMark(false, 'recordDetailSectionRole');\n }\n\n sectionRoleBtnOK.disable();\n sectionRoleBtnCancel.disable();\n } else {\n sectionRoleBtnOK.enable();\n sectionRoleBtnCancel.enable();\n }\n}", "title": "" }, { "docid": "f2c6a6fa51987357799f85e142ef4909", "score": "0.5879876", "text": "function disableButton() {\n\t$(\"button\").prop(\"disabled\",true);\n $(\"button\").css(\"background-color\", \"grey\");\n}", "title": "" }, { "docid": "d1329ff35fdecf5e25cfddc841fea26b", "score": "0.58686", "text": "function stopEnabled(btn) {\r\n btn.style.color = \"#fff\";\r\n btn.style.border = \"2px solid rgb(204, 0, 0)\";\r\n btn.style.backgroundColor = \"rgb(255, 51, 51)\";\r\n btn.disabled = false;\r\n}", "title": "" }, { "docid": "119d7d9b6dddaa871da27f149c3397a7", "score": "0.58614475", "text": "disableRotation() {\n this._rotationDisabled = true;\n }", "title": "" }, { "docid": "0996fb2c22b7627c3d6458d556374661", "score": "0.5860973", "text": "function btnDisabled(btn) {// all disabled buttons are styled like this\n btn.style.color = \"#fff\" ;\n btn.style.border = \"2px solid rgb(153, 153, 102)\" ;\n btn.style.backgroundColor = \"rgb(214, 214, 194)\" ;\n btn.disabled = true ; // button IS DISABLED (turning off game start button)\n}", "title": "" }, { "docid": "f0c4b765228de06d286ec657e9a690be", "score": "0.5859978", "text": "function disable_buttons() {\n prev_button.prop('disabled', true);\n next_button.prop('disabled', true);\n for(var i=0; i < ans_buttons.length; i++) {\n var b = ans_buttons[i];\n $(b).prop('disabled', true);\n }\n }", "title": "" }, { "docid": "44c004e5bff1d12a1e1d7f2aee35f317", "score": "0.5859782", "text": "function stopEnabled(btn) {\n btn.style.color = \"#fff\" ;\n btn.style.border = \"2px solid rgb(204, 0, 0)\";\n btn.style.backgroundColor = \"rgb(255, 51, 51)\" ;\n btn.disabled = false; // turning on the game stop button\n}", "title": "" }, { "docid": "de7bb425fca6a584893353f63bd6b165", "score": "0.58536005", "text": "function disableButton(pButton) {\n\tpButton.setState(false);\n}", "title": "" }, { "docid": "8d7d36b9a416607e36839d81fe66bfbd", "score": "0.5842496", "text": "function disableButtons()\r\n{\r\n document.getElementById(\"up\").disabled = true;\r\n document.getElementById(\"left\").disabled = true;\r\n document.getElementById(\"shine\").disabled = true;\r\n document.getElementById(\"right\").disabled = true;\r\n}", "title": "" }, { "docid": "ac857a129ac8e0faa0603db0ac7b3968", "score": "0.5827967", "text": "function disable_buttons()\n{\n var x = document.getElementsByClassName(\"controls\");\n\n //Disable buttons\n for(let i=0; i<x.length;)\n {\n x[i].disabled = true;\n x[i].className = \"controls-disabled\";\n }\n}", "title": "" }, { "docid": "c310eb36c528bc4a38665150acd98c0e", "score": "0.5827203", "text": "function desactiverBoutonsEntrainements()\n{\t\n\t$(\"button\").attr(\"disabled\",\"disabled\").addClass( 'disabled' );\n}", "title": "" }, { "docid": "5aca82992b566a79cc297db62224b736", "score": "0.5820948", "text": "function buttons_enable()\n\t{\n\t\tg_disabled_buttons = false;\n\t\t$('.coinmode_button').css('opacity', '1.0');\n\t\t//$('coinmode_button').removeAttr(\"disabled\");\n\t\t//$('#coinmode_buttons_area').show();\n\t}", "title": "" }, { "docid": "1029efd6bc4eb5011d5a5a7a1c3ec756", "score": "0.5820054", "text": "function enable_buttons(enabled) {\n for (var i in buttons) { //Deze for loop gaat elke button langs.\n var b = document.getElementById(buttons[i]); //Maakt huidige knop variable\n b.disabled = !enabled; //Enabled huidige knop\n b = document.getElementById(\"stop_run\");\n b.disabled = enabled;\n }\n}", "title": "" }, { "docid": "13383c77a6595933b2f15a7de4ec5d49", "score": "0.58182395", "text": "function unlockButton(buttonId){\n\t\tdocument.getElementById(buttonId).disabled = false;\n\t}", "title": "" }, { "docid": "e86f1ca92052784ad4047238ee60244e", "score": "0.58142495", "text": "releaseControl() {\n this['disabled'] = true;\n }", "title": "" }, { "docid": "06832f71654399414acbe0ca90dd7a63", "score": "0.5810065", "text": "function disableAButton(buttonId) {\n $(\"#\" + buttonId).removeClass('transaction-button').removeClass('navigation-button').removeClass('cancel-button').removeClass('remove-button');\n $(\"#\" + buttonId).addClass('disabled-button');\n $(\"#\" + buttonId + \"LeftCurve\").attr('src', '../Content/Images/Buttons/Button_left_curve_grey.jpg');\n $(\"#\" + buttonId + \"RightCurve\").attr('src', '../Content/Images/Buttons/Button_right_curve_grey.jpg');\n $(\"#\" + buttonId).attr('disabled', true);\n $(\"#\" + buttonId).die('click').unbind('click');\n}", "title": "" }, { "docid": "ff68b59de1a0de45a1af6c1ad9a52eee", "score": "0.580254", "text": "function disabledButton() {\n $submit.attr('disabled', 'disabled');\n }", "title": "" }, { "docid": "3818db98b8333096529235886c84818e", "score": "0.5791523", "text": "function enableMe(which) {\n\tenabled[which] = true;\n\tvar button = document.getElementById(\"btn-\" + which);\n\tbutton.onclick = null;\n\tbutton.onclick = function() {disableMe(which)};\n\tbutton.innerHTML = \"Stop\";\n}", "title": "" }, { "docid": "253d51f850ed491919c7fde2b38e4027", "score": "0.5785625", "text": "enableRotation() {\n this._rotationDisabled = false;\n }", "title": "" }, { "docid": "6d54ecd8d7cef60ce67204a66ba45a77", "score": "0.5782731", "text": "function disable() {\n //disable buttons, so user can't click while clue-play\n document.getElementById(\"button1\").classList.add(\"disabled\");\n document.getElementById(\"button2\").classList.add(\"disabled\");\n document.getElementById(\"button3\").classList.add(\"disabled\");\n document.getElementById(\"button4\").classList.add(\"disabled\");\n document.getElementById(\"button5\").classList.add(\"disabled\");\n document.getElementById(\"button6\").classList.add(\"disabled\");\n}", "title": "" }, { "docid": "3788a99d061a493cc479157484b89375", "score": "0.57759565", "text": "function enableButtons()\r\n{\r\n document.getElementById(\"up\").disabled = false;\r\n document.getElementById(\"left\").disabled = false;\r\n document.getElementById(\"shine\").disabled = false;\r\n document.getElementById(\"right\").disabled = false;\r\n}", "title": "" }, { "docid": "7b5e867b79178e5fad31113e99bb687e", "score": "0.5767147", "text": "_controlStateChanged() {\n if (this.disabled) {\n this._pressed = false;\n } else {\n this._changedButtonState();\n }\n }", "title": "" }, { "docid": "7c6b6900bef4eeff684850a849119571", "score": "0.57600254", "text": "function enableButton() {\n playerbtnRock.classList.remove(\"disabled\");\n playerbtnPaper.classList.remove(\"disabled\");\n playerbtnScissors.classList.remove(\"disabled\");\n}", "title": "" }, { "docid": "b2cc5d23f2d0e7246c274280cef24dee", "score": "0.5753336", "text": "function disable() { // Function to programmatically disable an enabled button\r\n\t// 8(1) CODE GOES HERE <--\r\n document.getElementById('guessBtn').disabled = true;\r\n}", "title": "" }, { "docid": "73be151204d67a4dfd2c6fa2885ee985", "score": "0.57460016", "text": "function disabled() {\r\n }", "title": "" }, { "docid": "f404cb06b4d8ac44fa697065e16d68ee", "score": "0.5744525", "text": "function disable(btn)\n{\n btn.disabled = true;\n btn.style.backgroundColor = \"#aad\";\n btn.style.cursor = \"default\";\n}", "title": "" }, { "docid": "fdb4921ed4c488c10a754e50abeef051", "score": "0.57438", "text": "function unDisable() { // Function to programmatically enable a disabled button\r\n\t// 7(1) CODE GOES HERE <--\r\n document.getElementById('guessBtn').disabled = false;\r\n}", "title": "" }, { "docid": "4e75e6506a89afa68e2afa4e6f4ec564", "score": "0.574089", "text": "function disableButtons() {\n var i,\n iMax = allButtons.length;\n for (i = 0; i < iMax; i++) {\n allButtons[i].setAttribute('disabled', 'disabled');\n }\n }", "title": "" }, { "docid": "1772a3de1397e581dc0ad758d6e05b99", "score": "0.5736674", "text": "function disableButtons(seriesArray) {\n for (var i = 0; i < seriesArray.length; i++) {\n var lastEntry = false;\n\n // Enable/disable individual buttons\n for (var j = 1; j < 8; j++) {\n var currentGame = seriesArray[i]['game' + j];\n seriesArray[i]['game' + j + '_enabled'] = false;\n\n // Want to null out goals as well if we're going backwards\n if (lastEntry && seriesArray[i].goal_array) {\n if (seriesArray[i].goal_array[j - 1]) {\n seriesArray[i].goal_array[j - 1] = null;\n recalculateHelper();\n }\n }\n if (currentGame === null && !lastEntry) {\n\n // We found the current game that we are on; enable it\n lastEntry = true;\n seriesArray[i]['game' + (j) + '_enabled'] = true;\n seriesArray[i].lastInput = j-1;\n }\n }\n }\n return seriesArray;\n }", "title": "" }, { "docid": "82748447bbf133c55fb9ac1fcb0310bf", "score": "0.5731957", "text": "function enable(button) {\n\tbutton.className = button.className.replace(/(buttonD|bigD|d)isabled/g, \"\");\n\tif (button.getElementsByTagName(\"input\")[0]) button.getElementsByTagName(\"input\")[0].disabled = \"\";\n\telse button.disabled = \"\";\n}", "title": "" }, { "docid": "f5ea35d94c527e77a6b7e843e3f07968", "score": "0.57287395", "text": "unlockButton() {\n\t\tthis.buttonLocked = false;\n\t}", "title": "" }, { "docid": "d5b29ae6916aaf886e1a3c79bcef4dd0", "score": "0.5727146", "text": "function disableAllButtons() {\n disableOrEnableButtons(false);\n }", "title": "" }, { "docid": "10a3522ed039dfe034795ac4e04bc53a", "score": "0.56759137", "text": "function on_deactivate() { disable_all_buttons(); }", "title": "" }, { "docid": "8ca1f549f56cfaeedc9bf2cca818ed59", "score": "0.56738997", "text": "function disable() {\n\tbutton.destroy();\t\n}", "title": "" }, { "docid": "fe0252a972c88c2f608a20be182ac51c", "score": "0.5664219", "text": "function disabled(){}", "title": "" }, { "docid": "02b2744ae9c605c1c2719f5a70a4ca1d", "score": "0.56640315", "text": "enableButtons() {\n document.getElementById('pageButtonsNext').removeAttribute('hidden');\n document.getElementById('pageButtonsPrior').removeAttribute('hidden');\n\n }", "title": "" }, { "docid": "4f1d89b867f2d5361543d13d64f7c42a", "score": "0.56630874", "text": "function keypressButton(key) {\n event.preventDefault(); //prevent browser from refreshing page when button is clicked\n document.getElementById(key).disabled = true;\n keypressClickHelper(key);\n}", "title": "" }, { "docid": "c6604768cc7b1316abb51156dc17b623", "score": "0.5640712", "text": "function toggleNextButtonDisabled(disabled)\n {\n var buttons = document.getElementsByClassName(\"sequence-nav-button button-next\"); \n\n for (var i = 0; i < buttons.length; i++)\n {\n buttons[i].disabled = disabled; \n }\n\n buttons = document.getElementsByClassName(\"next-btn btn btn-link\"); \n\n for (var i = 0; i < buttons.length; i++)\n {\n buttons[i].disabled = disabled; \n } \n\n buttons = document.getElementsByClassName(\"seq_other inactive nav-item tab\"); \n\n for (var i = 0; i < buttons.length; i++)\n {\n buttons[i].disabled = disabled; \n } \n\n buttons = document.getElementsByClassName(\"complete btn btn-link\"); \n\n for (var i = 0; i < buttons.length; i++)\n {\n buttons[i].disabled = disabled; \n } \n\n buttons = document.getElementsByClassName(\"sequence-nav-button button-next\"); \n\n for (var i = 0; i < buttons.length; i++)\n {\n buttons[i].disabled = disabled; \n } \n\n buttons = document.getElementsByClassName(\"next-button btn btn-outline-primary\"); \n\n for (var i = 0; i < buttons.length; i++)\n {\n buttons[i].disabled = disabled; \n } \n }", "title": "" }, { "docid": "6630551a9670274b0a1fe6cacd8f2b13", "score": "0.56364876", "text": "function enableNext() {\n next_button.prop('disabled', false);\n bNextEnabled = true;\n }", "title": "" }, { "docid": "0c4ea2ff7cf1bdbd1401e39717de20b1", "score": "0.5634568", "text": "function disabledButtons() {\n let buttons = document.getElementsByClassName(\"button\");\n for (let i = 0; i < buttons.length; i++) {\n buttons[i].disabled = true;\n }\n}", "title": "" }, { "docid": "eb7381a98098fcec54c9ad3712c129e8", "score": "0.56334805", "text": "function enableBtn(aryButton)\r\n{\r\n\tfor (var i = 0; i < btnList.length; i++) {\r\n\t\teval(btnList[i]).disabled = true;\r\n\t}\r\n\t\r\n\tif (aryButton != null) {\r\n\t\tfor (var i = 0; i < aryButton.length; i++) {\r\n\t\t\teval(aryButton[i]).disabled = false;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "54e67391591b6c59ab3e9311339b01fb", "score": "0.56315976", "text": "function disabled() {\r\n }", "title": "" }, { "docid": "f347a29f0b31f11201d55039445cfb2e", "score": "0.5626229", "text": "function clickButton() {\n event.preventDefault(); //prevent browser from refreshing page when button is clicked\n document.getElementById(this.id).disabled = true;\n // document.getElementById(this.id).style.background = \"#d3d3d3\";\n keypressClickHelper(this.id);\n}", "title": "" }, { "docid": "486838ea29867e68301ec8635b629ef7", "score": "0.56259465", "text": "function enableButton(specifiedButtonId) \n { \n document.getElementById(specifiedButtonId).disabled = false;\n }", "title": "" }, { "docid": "4542ee72badded459ed85f5a37708a93", "score": "0.562481", "text": "disable()\n {\n enabled = false;\n }", "title": "" }, { "docid": "0779802eab9a87b7f387ddab22a8bd9f", "score": "0.56219846", "text": "function disableButtons() {\n for (var i = 0; i < btns.length; i++) {\n btns[i].setAttribute(\"disabled\", 'disabled');\n }\n }", "title": "" }, { "docid": "9466daeca6fdfbde88a013ce60ff1e8d", "score": "0.56186724", "text": "function disabled() {\n }", "title": "" }, { "docid": "952a320da1b9b43fb99a175744f66404", "score": "0.5616187", "text": "function disabled() {\n }", "title": "" }, { "docid": "a8d12a88747f482d77efbd8dcd5f2c2b", "score": "0.5615555", "text": "function disableButtons() {\n document.querySelector(\"#arr-size\").disabled = true;\n for (let i = 0; i < buttons.length; i++) {\n buttons[i].disabled = true;\n }\n}", "title": "" }, { "docid": "122f3d939890c85f8fea3e0c418e2d90", "score": "0.5609249", "text": "function disable(){enabled=false;}", "title": "" }, { "docid": "92de0d0fab3f2094fe18e4ecdbfe4603", "score": "0.5607198", "text": "function disable() {\n enabled = false;\n }", "title": "" }, { "docid": "02725fe306d89f3bdd30081e86dc56d2", "score": "0.56024754", "text": "function unlockButtons() {\n\t$(\"#runCode\").attr(\"disabled\", false);\n\t$(\"#runCode\").attr(\"title\", \"Run your program and display the render.\");\n\n\t$(\"#rewind\").attr(\"disabled\", false);\n\t$(\"#rewind\").attr(\"title\", \"Run only the Axiom of the LSystem.\");\n\n\t$(\"#stepCode\").attr(\"disabled\", false);\n\t$(\"#stepCode\").attr(\"title\", \"Run your program step by step.\");\n\n\t$(\"#animate\").attr(\"disabled\", false);\n\t$(\"#animate\").attr(\"title\", \"Play the growth animation.\");\n\n\t$(\"#stop\").attr(\"disabled\", true);\n\t$(\"#stop\").attr(\"title\", \"There is no animation currently processing\");\n}", "title": "" }, { "docid": "fc4eaf99ea54b8320ac67e62941a9064", "score": "0.55952275", "text": "function ug_disabledButtons( currentSliderClass ) {\n\n var slideTotal = ($(\".ug.slider-grid.\" + currentSliderClass + \" .wrapper .slide\").length) - 1,\n currentSlide = parseInt($(\".ug.slider-grid.\" + currentSliderClass).attr(\"slide-shown\"));\n\n if( currentSlide === (slideTotal)){\n $(\".ug.slider-grid.\" + currentSliderClass + \" .next\").addClass(\"disabled\");\n if ( currentSlide !== 0 ){\n $(\".ug.slider-grid.\" + currentSliderClass + \" .prev\").removeClass(\"disabled\");\n }\n } else if( currentSlide === 0 ) {\n $(\".ug.slider-grid.\" + currentSliderClass + \" .prev\").addClass(\"disabled\");\n if ( currentSlide !== slideTotal ){\n $(\".ug.slider-grid.\" + currentSliderClass + \" .next\").removeClass(\"disabled\");\n }\n } else {\n $(\".ug.slider-grid.\" + currentSliderClass + \" .button\").removeClass(\"disabled\");\n }\n\n}", "title": "" }, { "docid": "6789d2591499aa788084261ff0ab2a94", "score": "0.5590436", "text": "function startEnabled(btn) {\r\n btn.style.color = \"#fff\";\r\n btn.style.border = \"2px solid rgb(0, 153, 0)\";\r\n btn.style.backgroundColor = \"rgb(57, 230, 0)\";\r\n btn.disabled = false;\r\n}", "title": "" }, { "docid": "879855370571d5b9e169e79ca68b6d23", "score": "0.55897725", "text": "function disable(button) {\n\tif (button.className.indexOf(\"big\") != -1 && button.className.indexOf(\"bigDisabled\") == -1) button.className += \" bigDisabled\";\n\telse if (button.className.indexOf(\"button\") != -1 && button.className.indexOf(\"buttonDisabled\") == -1) button.className += \" buttonDisabled\";\n\telse if (button.className.indexOf(\"disabled\") == -1) button.className += \" disabled\";\n\tif (button.getElementsByTagName(\"input\")[0]) button.getElementsByTagName(\"input\")[0].disabled = \"true\";\n\telse button.disabled = \"true\";\n}", "title": "" }, { "docid": "88b4f3a7b093c105d4742acc20246233", "score": "0.55834585", "text": "function disabled() {\n }", "title": "" }, { "docid": "9b6b8ab46e0760f1b3dc7fff6292b3a6", "score": "0.5580686", "text": "function enableButton(pButton) {\n\tpButton.setState(true);\n}", "title": "" }, { "docid": "f8ef537c12fc65237f98d66f8b55e7c4", "score": "0.55776876", "text": "function disableButtons() {\n\tfor (var i = 0; i < playlistSize; i++) {\n\t\tdocument.getElementById('del'+i).disabled = true;\n\t\tdocument.getElementById('toTop'+i).disabled = true;\n\t\tdocument.getElementById('up'+i).disabled = true;\n\t\tdocument.getElementById('down'+i).disabled = true;\n\t\tdocument.getElementById('toBottom'+i).disabled = true;\n\t}\n}", "title": "" }, { "docid": "623dd55d7cb91a0fc6d2aa1f79d77330", "score": "0.5573299", "text": "function enable(btn)\n{\n btn.disabled = false;\n btn.style.backgroundColor = \"#33d\";\n btn.style.cursor = \"pointer\";\n}", "title": "" }, { "docid": "fdfc25afec7bc800956cada099ee3386", "score": "0.55711114", "text": "function activateButton(button) {\n button.attr('disabled', false);\n}", "title": "" }, { "docid": "c3206356df5cf537c1e83f7afbce7a6b", "score": "0.5570804", "text": "disable() {\n\t\tthis._disabled = true\n\t}", "title": "" }, { "docid": "e1d9821447d0282548cf1bdbb329fb84", "score": "0.5564998", "text": "get disabledCanFocus(){ return this.__button.disabledCanFocus; }", "title": "" }, { "docid": "ac46e2ff8e22185a8d0d111cc4bcbf98", "score": "0.55647093", "text": "function disabled() {\n\t }", "title": "" }, { "docid": "ac46e2ff8e22185a8d0d111cc4bcbf98", "score": "0.55647093", "text": "function disabled() {\n\t }", "title": "" }, { "docid": "ac46e2ff8e22185a8d0d111cc4bcbf98", "score": "0.55647093", "text": "function disabled() {\n\t }", "title": "" }, { "docid": "ac46e2ff8e22185a8d0d111cc4bcbf98", "score": "0.55647093", "text": "function disabled() {\n\t }", "title": "" }, { "docid": "ac46e2ff8e22185a8d0d111cc4bcbf98", "score": "0.55647093", "text": "function disabled() {\n\t }", "title": "" }, { "docid": "ac46e2ff8e22185a8d0d111cc4bcbf98", "score": "0.55647093", "text": "function disabled() {\n\t }", "title": "" }, { "docid": "ac46e2ff8e22185a8d0d111cc4bcbf98", "score": "0.55647093", "text": "function disabled() {\n\t }", "title": "" }, { "docid": "ac46e2ff8e22185a8d0d111cc4bcbf98", "score": "0.55647093", "text": "function disabled() {\n\t }", "title": "" }, { "docid": "ac46e2ff8e22185a8d0d111cc4bcbf98", "score": "0.55647093", "text": "function disabled() {\n\t }", "title": "" }, { "docid": "ac46e2ff8e22185a8d0d111cc4bcbf98", "score": "0.55647093", "text": "function disabled() {\n\t }", "title": "" }, { "docid": "ac46e2ff8e22185a8d0d111cc4bcbf98", "score": "0.55647093", "text": "function disabled() {\n\t }", "title": "" }, { "docid": "ac46e2ff8e22185a8d0d111cc4bcbf98", "score": "0.55647093", "text": "function disabled() {\n\t }", "title": "" }, { "docid": "ac46e2ff8e22185a8d0d111cc4bcbf98", "score": "0.55647093", "text": "function disabled() {\n\t }", "title": "" }, { "docid": "ac46e2ff8e22185a8d0d111cc4bcbf98", "score": "0.55647093", "text": "function disabled() {\n\t }", "title": "" }, { "docid": "ac46e2ff8e22185a8d0d111cc4bcbf98", "score": "0.55647093", "text": "function disabled() {\n\t }", "title": "" } ]
7c44b7c5cfc250bbab594b40318cff95
Default loader for ajax number fields.
[ { "docid": "b578cc983c653e07510be9191733a4be", "score": "0.65648115", "text": "function loadAjaxNumberFields(parentElement, msgDisplay) {\n parentElement.find('.fieldAjaxnumber').ajaxFormNumber({messageDisplay: msgDisplay});\n}", "title": "" } ]
[ { "docid": "acdd3eb94963dea9e55764a54a1c3268", "score": "0.5861056", "text": "function NumericSpinner(onChange, min, max) {\n if (onChange === void 0) { onChange = function (numericSpinner) { }; }\n if (min === void 0) { min = 0; }\n this.onChange = onChange;\n this.min = min;\n this.max = max;\n this.buildContent();\n this.bindEvents();\n }", "title": "" }, { "docid": "24d022c90602cf34a9ec8f53fbb12e7c", "score": "0.5759704", "text": "validateNumber() {\r\n let $this = this;\r\n let inputs = this.inputs.number = this.formHandler.find('input[type=\"number\"]');\r\n\r\n inputs.on(this.options.events, function () {\r\n let input = $(this);\r\n\r\n $this.number(input);\r\n });\r\n }", "title": "" }, { "docid": "a33f7c547d6a61384cd5b4f7ce1ffcd0", "score": "0.5742224", "text": "function _init(target) {\r\n\t\t$ac(\"spinnernumber-f\", $(target));\r\n\t\tvar opts = $d(target, \"spinnernumber\").options;\r\n\t\t$(target).spinner(opts).numberbox(opts);\r\n\t}", "title": "" }, { "docid": "3373bf932694e9e310f577c09c4464a2", "score": "0.56030935", "text": "function renderNumber(entity, label) {\n\t// ADD DECIMAL/FLOAT VALIDATION\n\n\thtml =\t\tlabel\n\thtml +=\t'\t<div class=\"input-group\">\\n'\n\thtml +=\t'\t\t<input class=\"input-group-field '+entity['id']+'\" id=\"'+entity['domId']+'\" type=\"text\"' + entity['required']+ entity['disabled'] + getPlaceholder(entity)+'\" />\\n'\n html += \t\trenderUnits(entity)\n\thtml +=\t'\t</div>\\n'\n\thtml +=\t\trenderHelp(entity)\n\treturn getFieldWrapper(entity, html)\n\n\treturn html\n}", "title": "" }, { "docid": "1b51bad5000f515046774d827e4d0c9e", "score": "0.5570685", "text": "function beforeUpdateHouseNumber(){\n let input = $('input.zipcheck-housenr');\n let inputContainer = input.parent();\n inputContainer.addClass('loader-active');\n autocomplete(input[0], false);\n }", "title": "" }, { "docid": "14d3905a77ed76f42ffb728868a4fab2", "score": "0.55089766", "text": "function NumberValidation() {\n ExternalValidationUrl.call(this);\n }", "title": "" }, { "docid": "e6a7912836c578aa4eaadc35505e13d5", "score": "0.5396299", "text": "function loadNumericBar()\n {\n logDebug(\"loadNumericBar\") ;\n return partial(initNumericBar) ;\n }", "title": "" }, { "docid": "92b053eb7ffdb66a3213f965e6e9f8c4", "score": "0.539236", "text": "function CargarFormularioPresupuesto() {\n utils.showLoading();\n $.ajax({\n url: urlBase + '/Presupuesto/GenerarPresupuesto',\n data: {\n },\n type: 'POST',\n success: function (result) {\n utils.closeLoading();\n if (result) {\n $(\"#TablaPresupuesto\").html(result);\n // $('#TablaPresupuesto').find(\"input[type=decimal]\").numeric(\",\");\n\n\n $('#TablaPresupuesto').find(\"input[type=decimal]\").on({\n \"focus\": function (event) {\n $(event.target).select();\n },\n \"keyup\": function (event) {\n $(event.target).val(function (index, value) {\n valor = value.replace(/\\D/g, \"\")\n .replace(/([0-9])([0-9]{2})$/, '$1,$2')\n .replace(/\\B(?=(\\d{3})+(?!\\d)\\.?)/g, \".\");\n stringValor = \"$\".concat(valor)\n return stringValor;\n });\n }\n });\n\n }\n }\n });\n}", "title": "" }, { "docid": "6faf377a6ab0f3fb886cbfd2a6c19c26", "score": "0.534831", "text": "function load_property_feature_types(){\n\t$('#div_property_feature_types_loader').oLoader({\n\t\tbackgroundColor:'#fff',\n\t\timage: baseDir+'assets/be/js/plugins/oLoader/images/ownageLoader/loader9.gif',\n\t\tfadeInTime: 500,\n\t\tfadeOutTime: 1000,\n\t\tfadeLevel: 0.8\n\t});\t\t\t\t\n\t$.ajax({\n \turl: baseDir+'be/property_feature_types/loadjs',\n \ttype: 'POST',\n \tdata: '',\n \txhr: function() {\n \t\tvar myXhr = $.ajaxSettings.xhr();\n \t\treturn myXhr;\n \t},\n \tcache: false,\n \tcontentType: false,\n \tprocessData: false,\n \tsuccess: function (result) {\n\t\t\t$(\"#property_feature_types_div\").html(result);\n\t\t\t$('#div_property_feature_types_loader').oLoader('hide');\t\t\t\n \t\t},\n\t\terror: function(){\n\t\t\t$('#div_property_feature_types_loader').oLoader('hide');\n\t\t}\n });\n}", "title": "" }, { "docid": "8b91e5be474d94912e32d03d6285fe74", "score": "0.534509", "text": "function NumberValidation() {}", "title": "" }, { "docid": "d1e48627ddaf04703ccc55f4d375b51f", "score": "0.5308885", "text": "function LoadSpinner(maxvalue) {\n $( \"input#ncases\" ).spinner({\n spin: function( event, ui ) {\n if ( ui.value > maxvalue ) {\n $( this ).spinner( \"value\", 1 );\n return false;\n } else if ( ui.value < 1 ) {\n $( this ).spinner( \"value\", 1 );\n return false;\n }\n }\n });\n}", "title": "" }, { "docid": "5d74c11e6fef92d7fc32b281a1285ceb", "score": "0.52324146", "text": "function ajax_load_articles(current_page, nb_article, nb_article_par_page, mot_cle) {\r\n\t//mettre à jour la pagination\r\n showPagination(current_page, nb_article, nb_article_par_page, mot_cle)\r\n\r\n //affiche ajax loader\r\n showLoader('vdf-listing-articles', 'vdf-pagination');\r\n\r\n //envoie le numero de page et le mot de cle\r\n //status: \"success\", \"notmodified\", \"error\", \"timeout\", or \"parsererror\"\r\n jQuery(\".vdf-listing-articles\").load(\"/get/ajax/vdf-listing-articles-par-mot-cle/\"\r\n + current_page + \"/\"\r\n + nb_article_par_page + \"/\"\r\n + encodeURIComponent(mot_cle), function(response, status, xhr){\r\n if(status != 'success'){\r\n jQuery('.vdf-pagination div').removeClass('active');\r\n }\r\n //ferme ajax loader\r\n hideLoader();\r\n });\r\n\r\n}", "title": "" }, { "docid": "856584216d31a17f3cc1526fd573ee30", "score": "0.52132106", "text": "constructor(data = {}, styles = {}) {\n super(document.createElement('div'), {}, data.focus)\n this.addClass('input-number')\n\n this.inputNode = document.createElement('input')\n this.inputNode.id = getUniqueId(this.inputNode.tagName)\n this.inputNode.type = 'number'\n\n if (typeof data.label === 'string') {\n this.node.appendChild(document.createElement('label'))\n this.node.firstChild.textContent = data.label\n\n this.node.firstChild.setAttribute('for', this.inputNode.id)\n\n this.inputNode.title = data.label\n } else {\n this.inputNode.title = ' '\n }\n\n this.node.appendChild(this.inputNode)\n\n if (typeof data.unit === 'string') {\n let label = document.createElement('label')\n\n label.textContent = data.unit\n label.className = 'unit'\n\n label.setAttribute('for', this.inputNode.id)\n\n this.node.appendChild(label)\n }\n\n addStyles(this, styles)\n\n this.autoFocusNext = false\n if (typeof data.autoFocusNext === 'boolean') {\n this.autoFocusNext = data.autoFocusNext\n }\n\n this._options = {\n min: 0,\n max: 10,\n step: 1,\n\n precision: 3,\n\n popupMin: 0,\n setPopupMin: false,\n\n popupMax: 10,\n setPopupMax: false\n }\n\n this.max = data.max\n this.min = data.min\n this.step = data.step\n this.precision = data.precision\n\n if (typeof data.popupMin === 'number' && isFinite(data.popupMin)) {\n this._options.popupMin = data.popupMin\n this._options.setPopupMin = true\n } else {\n this._options.popupMin = this._options.min\n }\n if (typeof data.popupMax === 'number' && isFinite(data.popupMax)) {\n this._options.popupMax = data.popupMax\n this._options.setPopupMax = true\n } else {\n this._options.popupMax = this._options.max\n }\n\n this._value = 0\n this._oldValue = 0\n\n this.placeholder = data.placeholder\n this.tooltip = data.tooltip\n\n this.disabled = data.disabled\n\n bindFunctions(\n this,\n this.showPopup,\n this.movePopup,\n this.onPopupDrag\n )\n\n this.value = data.value\n\n this.inputNode.addEventListener(\n 'contextmenu',\n exports.contextMenu.enable.bind(null, 'edit')\n )\n\n this.inputNode.addEventListener('focus', () => {\n this._focused = true\n\n this.inputNode.classList.add('active')\n this.inputNode.style.zIndex = '11'\n\n this.openPopup()\n\n if (this._globalFocus === true) {\n body.inputFocused(this, !this._codeFocused)\n }\n\n sendEventTo(\n {\n fromUser: !this._codeFocused,\n from: this\n },\n this.events.focus\n )\n\n this._codeFocused = false\n })\n this.inputNode.addEventListener('blur', () => {\n this._value = parseFloat(this.inputNode.value)\n\n if (isNaN(this._value)) {\n this._value = 0\n }\n\n this._value = round(\n Math.max(\n this._options.min,\n Math.min(this._options.max, this._value)\n ),\n this._options.precision\n )\n\n if (this._value !== parseFloat(this.inputNode.value)) {\n this.inputNode.value = this._value\n }\n\n if (this._value !== this._oldValue) {\n numberPopup.value = this._value\n\n sendEventTo(\n {\n value: this._value,\n oldValue: this._oldValue,\n\n fromUser: true,\n from: this\n },\n this.events.change\n )\n\n this._oldValue = this._value\n }\n })\n\n this.inputNode.addEventListener('input', () => {\n if (this.inputNode.value === '') {\n return false\n }\n\n this._value = parseFloat(this.inputNode.value)\n\n if (isNaN(this._value)) {\n this._value = 0\n }\n\n this._value = round(\n Math.max(\n this._options.min,\n Math.min(this._options.max, this._value)\n ),\n this._options.precision\n )\n\n if (this._value !== parseFloat(this.inputNode.value)) {\n this.inputNode.value = this._value\n }\n\n if (this._value !== this._oldValue) {\n numberPopup.value = this._value\n\n sendEventTo(\n {\n value: this._value,\n oldValue: this._oldValue,\n\n fromUser: true,\n from: this\n },\n this.events.change\n )\n\n this._oldValue = this._value\n }\n })\n this.inputNode.addEventListener('keydown', keyEvent => {\n if (keyEvent.key === 'Enter') {\n sendEventTo(\n {\n value: parseFloat(this.inputNode.value),\n\n fromUser: true,\n from: this\n },\n this.events.enter\n )\n\n this.blur()\n\n if (this.autoFocusNext === true && this.parent) {\n let index = this.parent.items.indexOf(this)\n\n while (index < this.parent.items.length) {\n if (\n typeof this.parent.items[index + 1].focus ===\n 'function'\n ) {\n this.parent.items[index + 1].focus()\n\n break\n } else {\n let exit = true\n\n for (\n let i = 0;\n i < inputAutoFocusSkipClasses.length;\n i++\n ) {\n if (\n this.parent.items[index + 1] instanceof\n inputAutoFocusSkipClasses[i]\n ) {\n index += 1\n exit = false\n }\n }\n\n if (exit) {\n break\n }\n }\n }\n }\n }\n })\n\n body.onEvent('blur', this.blur.bind(this))\n body.onEvent('mousedown', event => {\n if (\n this.node !== event.target &&\n this.node.contains(event.target) === false &&\n numberPopup.node !== event.target &&\n numberPopup.node.contains(event.target) === false\n ) {\n this.blur()\n }\n })\n\n body.onEvent('resize', this.movePopup)\n body.onEvent('scroll', this.movePopup)\n }", "title": "" }, { "docid": "d56f1b0e8caa4fde5651f75711ebd76b", "score": "0.52004355", "text": "function numbersMask(){\n\t$('body').on(\"change keyup input click\",'.js-mask-numbers' ,function(event) {\n\t if (this.value.match(/[^0-9]/g))\n\t this.value = this.value.replace(/[^0-9]/g, '');\n\t});\n}", "title": "" }, { "docid": "5eceb4ce92cea7ad237f0aabfa1c227a", "score": "0.5169399", "text": "static get fieldType() {\n return 'number';\n }", "title": "" }, { "docid": "dab34ae4ee360e9b6cc3adc77291b518", "score": "0.5164593", "text": "static get fieldType() {\n return 'number';\n }", "title": "" }, { "docid": "dab34ae4ee360e9b6cc3adc77291b518", "score": "0.5164593", "text": "static get fieldType() {\n return 'number';\n }", "title": "" }, { "docid": "dab34ae4ee360e9b6cc3adc77291b518", "score": "0.5164593", "text": "static get fieldType() {\n return 'number';\n }", "title": "" }, { "docid": "6ea4fd594d05554035485ca9574effc7", "score": "0.51601714", "text": "function initNumberInput(prop, min, max, step, theSettings) {\n var input = $(\"<input type='number'>\").attr(\"min\", min).attr(\"max\", max).attr(\"step\", step);\n input.val(theSettings[prop]).blur(function() {\n var value = parseFloat($(this).val());\n if ($.isNumeric(min) && value < min || $.isNumeric(max) && value > max) $(this).val(theSettings[prop]);\n else theSettings[prop] = value;\n });\n setIdAndAddItWithLabel(input, prop, theSettings == settings);\n return input;\n }", "title": "" }, { "docid": "27ce5be669183b80795057d0454ffe5b", "score": "0.5146133", "text": "function load_ajax(_t)\n{\n\tvar field = jQuery(_t).attr('_field');\n\tvar url = jQuery(_t).attr('_url');\n\t\n\tjQuery(_t).nstUI(\n\t{\n\t\tmethod:\t\"loadAjax\",\n\t\tloadAjax:{\n\t\t\turl: url,\n\t\t\tfield: {load: field+'_load', show: field+'_show'}\n\t\t}\n\t});\n\t\n\treturn false;\n}", "title": "" }, { "docid": "9647ef719d963072e307165e2de7a734", "score": "0.51420224", "text": "function postInputPageNumber(_page) {\r\n $(\"#\" + selectedRegion).hide();\r\n $(\"#showProgress\").show();\r\n //$(\"#progressBar\").toggle();\r\n var $tab = $(\".ui-tabs-selected a\");\r\n var panel = $(\"#\" + $tab.attr(\"url\"));\r\n var _post = {\r\n pageNumber: _page,\r\n id: _doi,\r\n title: _title,\r\n journalName: _journalNames\r\n };\r\n $(\"#\" + selectedRegion).load(resultURL, _post, function() {\r\n //show progress\r\n $(\"#showProgress\").hide();\r\n $(\"#\" + selectedRegion).show();\r\n });\r\n }", "title": "" }, { "docid": "7ce4a80745f252c9fd44be2647279256", "score": "0.51388645", "text": "function fnsdVerEncuesta(folioEncuesta){\n $.ajax({\n url:\"modules/01HelpDesk/views/encuestas/frm_ver_encuesta.php\",\n type:\"POST\",\n data:{fl:folioEncuesta},\n beforeSend:function(){\n fnloadSpinner(1);\n },\n success:function(data){\n $(\"#modl\").html(data);\n fnloadSpinner(2);\n }\n });\n}", "title": "" }, { "docid": "9c4d4df0af01bab2b7f2880c4e5eb1a5", "score": "0.51295793", "text": "function numeroBlur(campo) {\n\tvar numero = new Number(setNumero(campo.value));\n\tif (numero == 0) campo.value = \"0,00\";\n\telse campo.value = setNumeroFormato(numero, 2, \".\", \",\");\n}", "title": "" }, { "docid": "c1f29be57b40e9e6d3486643dcf49bf4", "score": "0.5126489", "text": "function numeroBlur(campo) {\r\n\tvar numero = new Number(setNumero(campo.value));\r\n\tif (numero == 0) campo.value = \"0,00\";\r\n\telse campo.value = setNumeroFormato(numero, 2, \"\", \".\");\r\n}", "title": "" }, { "docid": "0962280d93acb7716ba70c4e6b397300", "score": "0.5123899", "text": "function numeroBlur(campo) {\r\n\tvar numero = new Number(setNumero(campo.value));\r\n\tif (numero == 0) campo.value = \"0,00\";\r\n\telse campo.value = setNumeroFormato(numero, 2, \".\", \",\");\r\n}", "title": "" }, { "docid": "0962280d93acb7716ba70c4e6b397300", "score": "0.5123899", "text": "function numeroBlur(campo) {\r\n\tvar numero = new Number(setNumero(campo.value));\r\n\tif (numero == 0) campo.value = \"0,00\";\r\n\telse campo.value = setNumeroFormato(numero, 2, \".\", \",\");\r\n}", "title": "" }, { "docid": "fe52bc8b9b0b00a60e26b9c6bbf3b4a5", "score": "0.50954044", "text": "function set_serial_number_input_validation() {\n $('#exch_sent').attr('type', 'number');\n $('#exch_recv').attr('type', 'number');\n}", "title": "" }, { "docid": "09ee69d31d962d985fd26344fa9d6130", "score": "0.50809777", "text": "function loader(){\n $('#cek').attr(\"value\", \"false\");\n $('#bukutamu-div').load('guestbook.php');\n var init = true;\n $(document).ajaxStop(function(){\n if(init){\n enabling();\n init = false;\n }\n });\n return false;\n }", "title": "" }, { "docid": "d4c8c886900bd97a8e87a6146901e307", "score": "0.50144434", "text": "addNumber(title, minValue, maxValue, properties) {\n let props = { FieldTypeKind: 9 };\n if (minValue !== undefined) {\n props = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_2__[\"assign\"])({ MinimumValue: minValue }, props);\n }\n if (maxValue !== undefined) {\n props = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_2__[\"assign\"])({ MaximumValue: maxValue }, props);\n }\n return this.add(title, \"SP.FieldNumber\", Object(_pnp_common__WEBPACK_IMPORTED_MODULE_2__[\"assign\"])(props, properties));\n }", "title": "" }, { "docid": "c995648164384fb1b9f981803562e2ee", "score": "0.5010398", "text": "static initialize(formId, fields) {\n // Create a new NumberFormatter only if needed\n let numberFormatter = window.numberFormatters[formId];\n if (!numberFormatter) {\n numberFormatter = new NumberFormatter(formId, fields);\n\n // Set these variables in the global namespace so it can be accessed from anyhwere in the app\n window.numberFormatters[formId] = numberFormatter;\n }\n\n numberFormatter.applyAutoNumericToFields();\n }", "title": "" }, { "docid": "4935062cb3b95d85e758f3dcda16d3f2", "score": "0.49420252", "text": "function NumberValidator(options) {\n this.title = options.name;\n try {\n this.format = JSON.parse(options.text);\n } catch(ignore) {\n this.format = options.text;\n }\n}", "title": "" }, { "docid": "94d0bad0a636eb0672399c29e1e6be80", "score": "0.49349365", "text": "_formLoading() {\n this.getForm().classList.add(LOADING_CLASS);\n }", "title": "" }, { "docid": "c0f3b12f6d05ab468adf741b50b45296", "score": "0.49233004", "text": "function pg1_loader() {\r\n\t$('.departure_field').hide();\r\n\t$('.date_select').change(function() {\r\n\t\tget_deps( $(this).val() );\r\n\t});\r\n}", "title": "" }, { "docid": "0a7fd754d3f39196bf01e206118ec7ba", "score": "0.49181387", "text": "function LoadableField(loader, updater) {\r\n if (updater === void 0) { updater = defaultUpdater; }\r\n var _this = _super.call(this, loader(null)) || this;\r\n _this.previousLoaded = undefined;\r\n _this.loader = loader;\r\n _this.updater = defaultUpdater;\r\n return _this;\r\n }", "title": "" }, { "docid": "cf34523fdc3c1b684b79af930db8784e", "score": "0.49072066", "text": "function numeroFocus(campo) {\r\n\tvar numero = new Number(setNumero(campo.value));\r\n\tif (numero == 0) campo.value = \"\";\r\n\telse { \r\n\t\tvalor = setNumeroFormato(numero, 2, \"\", \",\");\r\n\t\t\r\n\t\tvar x = new String(valor);\r\n\t\tvar sep = x.split(\",\");\r\n\t\tvar dec = new Number(sep[1]);\r\n\t\tif (dec == 0) campo.value = sep[0];\r\n\t\telse if (dec <= 10) campo.value = setNumeroFormato(numero, 1, \"\", \",\");\r\n\t\telse campo.value = setNumeroFormato(numero, 2, \"\", \",\");\r\n\t}\r\n}", "title": "" }, { "docid": "cf34523fdc3c1b684b79af930db8784e", "score": "0.49072066", "text": "function numeroFocus(campo) {\r\n\tvar numero = new Number(setNumero(campo.value));\r\n\tif (numero == 0) campo.value = \"\";\r\n\telse { \r\n\t\tvalor = setNumeroFormato(numero, 2, \"\", \",\");\r\n\t\t\r\n\t\tvar x = new String(valor);\r\n\t\tvar sep = x.split(\",\");\r\n\t\tvar dec = new Number(sep[1]);\r\n\t\tif (dec == 0) campo.value = sep[0];\r\n\t\telse if (dec <= 10) campo.value = setNumeroFormato(numero, 1, \"\", \",\");\r\n\t\telse campo.value = setNumeroFormato(numero, 2, \"\", \",\");\r\n\t}\r\n}", "title": "" }, { "docid": "5dd1631f13faa363fae368c465fe7cde", "score": "0.4903666", "text": "function numeroFocus(campo) {\n\tvar numero = new Number(setNumero(campo.value));\n\tif (numero == 0) campo.value = \"\";\n\telse { \n\t\tvalor = setNumeroFormato(numero, 2, \"\", \",\");\n\t\t\n\t\tvar x = new String(valor);\n\t\tvar sep = x.split(\",\");\n\t\tvar dec = new Number(sep[1]);\n\t\tif (dec == 0) campo.value = sep[0];\n\t\telse if (dec <= 10) campo.value = setNumeroFormato(numero, 1, \"\", \",\");\n\t\telse campo.value = setNumeroFormato(numero, 2, \"\", \",\");\n\t}\n}", "title": "" }, { "docid": "97b36fb07046848905036515b4048985", "score": "0.48929876", "text": "number() {\n this.checkKey();\n this._fields[this._curKey].validators.push({\n validator: this._validator.isNumber,\n message: this._curKey + ' is not a valid number.',\n code: 'VAL_NUMBER'\n });\n return this;\n }", "title": "" }, { "docid": "cd568cb279a768e88ce6817e29142e5f", "score": "0.48918957", "text": "function numeroFocus(campo) {\r\n\tvar numero = new Number(setNumero(campo.value));\r\n\tif (numero == 0) campo.value = \"\";\r\n\telse { \r\n\t\tvalor = setNumeroFormato(numero, 2, \"\", \".\");\r\n\t\t\r\n\t\tvar x = new String(valor);\r\n\t\tvar sep = x.split(\".\");\r\n\t\tvar dec = new Number(sep[1]);\r\n\t\tif (dec == 0) campo.value = sep[0];\r\n\t\telse if (dec <= 10) campo.value = setNumeroFormato(numero, 1, \"\", \",\");\r\n\t\telse campo.value = setNumeroFormato(numero, 2, \"\", \",\");\r\n\t}\r\n}", "title": "" }, { "docid": "38cea7baf568a6f494161c8c72d4e318", "score": "0.48868048", "text": "function Loader(target, page_size, format_callback, post_load_callback) {\n this.data = [];\n this.next_index = 0;\n\n this.target = target;\n this.page_size = page_size;\n this.format_callback = format_callback;\n this.post_load_callback = post_load_callback || function(count) {}; \n }", "title": "" }, { "docid": "b481f934ef5a9592080f1f273ee0baed", "score": "0.48861814", "text": "function initLoader(type, id) {\n\tlet elem = document.getElementById(\"loader-\" + type + \"-\" + id);\n\t\n\telem.innerHTML = \"<img src='Img/Icone/loader.gif' alt='loading' />\";\n}", "title": "" }, { "docid": "0faa387185db3347b9feae5c6e6016e9", "score": "0.4885348", "text": "number(name, value = null, options = {}) {\n\t\treturn this.input('number', name, value, options)\n\t}", "title": "" }, { "docid": "d94b315935d053527a776b82e411c997", "score": "0.48669636", "text": "function spinnerModifer(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger(\"change\")}}", "title": "" }, { "docid": "a1f0c6c18d46585f24a5fba044c875d5", "score": "0.48662332", "text": "function numFromUI(id) {\n return parseFloat(document.getElementById(id).value, 10);\n}", "title": "" }, { "docid": "e3709f6ce6b1d12d1acb140c4b592538", "score": "0.48662192", "text": "function getLoaderClass(){\n\t\tvar loaderClass;\n\t\tswitch(g_options.slider_loader_type){\n\t\t\tdefault:\n\t\t\tcase 1: loaderClass = \"ug-loader1\";break;\n\t\t\tcase 2: loaderClass = \"ug-loader2\";break;\n\t\t\tcase 3: loaderClass = \"ug-loader3\";break;\n\t\t\tcase 4: loaderClass = \"ug-loader4\";break;\n\t\t\tcase 5: loaderClass = \"ug-loader5\";break;\n\t\t\tcase 6: loaderClass = \"ug-loader6\";break;\n\t\t\tcase 7: loaderClass = \"ug-loader7\";break;\n\t\t\tcase 8: loaderClass = \"ug-loader8\";break;\n\t\t\tcase 9: loaderClass = \"ug-loader9\";break;\n\t\t}\n\t\t\t\t\n\t\tif(g_options.slider_loader_color == \"black\")\n\t\t\tloaderClass += \" ug-loader-black\";\n\t\t\n\t\treturn(loaderClass);\n\t}", "title": "" }, { "docid": "1011e5453e962c1470340ffe72d2e341", "score": "0.4863041", "text": "function useNumberInput(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n _props$focusInputOnCh = _props.focusInputOnChange,\n focusInputOnChange = _props$focusInputOnCh === void 0 ? true : _props$focusInputOnCh,\n _props$clampValueOnBl = _props.clampValueOnBlur,\n clampValueOnBlur = _props$clampValueOnBl === void 0 ? true : _props$clampValueOnBl,\n _props$keepWithinRang = _props.keepWithinRange,\n keepWithinRange = _props$keepWithinRang === void 0 ? true : _props$keepWithinRang,\n _props$min = _props.min,\n min = _props$min === void 0 ? _chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__.minSafeInteger : _props$min,\n _props$max = _props.max,\n max = _props$max === void 0 ? _chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__.maxSafeInteger : _props$max,\n _props$step = _props.step,\n stepProp = _props$step === void 0 ? 1 : _props$step,\n isReadOnly = _props.isReadOnly,\n isDisabled = _props.isDisabled,\n isRequired = _props.isRequired,\n isInvalid = _props.isInvalid,\n _props$pattern = _props.pattern,\n pattern = _props$pattern === void 0 ? \"[0-9]*(.[0-9]+)?\" : _props$pattern,\n _props$inputMode = _props.inputMode,\n inputMode = _props$inputMode === void 0 ? \"decimal\" : _props$inputMode,\n allowMouseWheel = _props.allowMouseWheel,\n id = _props.id;\n _props.onChange;\n _props.precision;\n var name = _props.name,\n ariaDescBy = _props[\"aria-describedby\"],\n ariaLabel = _props[\"aria-label\"],\n ariaLabelledBy = _props[\"aria-labelledby\"],\n onFocusProp = _props.onFocus,\n onBlurProp = _props.onBlur,\n onInvalidProp = _props.onInvalid,\n getAriaValueTextProp = _props.getAriaValueText,\n isValidCharacterProp = _props.isValidCharacter,\n formatValue = _props.format,\n parseValue = _props.parse,\n htmlProps = _objectWithoutPropertiesLoose(_props, _excluded$1);\n\n var onFocus = (0,_chakra_ui_hooks__WEBPACK_IMPORTED_MODULE_4__.u)(onFocusProp);\n var onBlur = (0,_chakra_ui_hooks__WEBPACK_IMPORTED_MODULE_4__.u)(onBlurProp);\n var onInvalid = (0,_chakra_ui_hooks__WEBPACK_IMPORTED_MODULE_4__.u)(onInvalidProp);\n var isValidCharacter = (0,_chakra_ui_hooks__WEBPACK_IMPORTED_MODULE_4__.u)(isValidCharacterProp != null ? isValidCharacterProp : isFloatingPointNumericCharacter);\n var getAriaValueText = (0,_chakra_ui_hooks__WEBPACK_IMPORTED_MODULE_4__.u)(getAriaValueTextProp);\n /**\n * Leverage the `useCounter` hook since it provides\n * the functionality to `increment`, `decrement` and `update`\n * counter values\n */\n\n var counter = (0,_chakra_ui_counter__WEBPACK_IMPORTED_MODULE_5__.useCounter)(props);\n var updateFn = counter.update,\n incrementFn = counter.increment,\n decrementFn = counter.decrement;\n /**\n * Keep track of the focused state of the input,\n * so user can this to change the styles of the\n * `spinners`, maybe :)\n */\n\n var _useBoolean = (0,_chakra_ui_hooks__WEBPACK_IMPORTED_MODULE_3__.useBoolean)(),\n isFocused = _useBoolean[0],\n setFocused = _useBoolean[1];\n\n var isInteractive = !(isReadOnly || isDisabled);\n var inputRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\n var inputSelectionRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\n var incrementButtonRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\n var decrementButtonRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\n var sanitize = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function (value) {\n return value.split(\"\").filter(isValidCharacter).join(\"\");\n }, [isValidCharacter]);\n var parse = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function (value) {\n var _parseValue;\n\n return (_parseValue = parseValue == null ? void 0 : parseValue(value)) != null ? _parseValue : value;\n }, [parseValue]);\n var format = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function (value) {\n var _formatValue;\n\n return ((_formatValue = formatValue == null ? void 0 : formatValue(value)) != null ? _formatValue : value).toString();\n }, [formatValue]);\n (0,_chakra_ui_hooks__WEBPACK_IMPORTED_MODULE_3__.useUpdateEffect)(function () {\n if (counter.valueAsNumber > max) {\n onInvalid == null ? void 0 : onInvalid(\"rangeOverflow\", format(counter.value), counter.valueAsNumber);\n } else if (counter.valueAsNumber < min) {\n onInvalid == null ? void 0 : onInvalid(\"rangeOverflow\", format(counter.value), counter.valueAsNumber);\n }\n }, [counter.valueAsNumber, counter.value, format, onInvalid]);\n /**\n * Sync state with uncontrolled form libraries like `react-hook-form`.\n */\n\n (0,_chakra_ui_hooks__WEBPACK_IMPORTED_MODULE_4__.a)(function () {\n if (!inputRef.current) return;\n var notInSync = inputRef.current.value != counter.value;\n\n if (notInSync) {\n var parsedInput = parse(inputRef.current.value);\n counter.setValue(sanitize(parsedInput));\n }\n }, [parse, sanitize]);\n var increment = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function (step) {\n if (step === void 0) {\n step = stepProp;\n }\n\n if (isInteractive) {\n incrementFn(step);\n }\n }, [incrementFn, isInteractive, stepProp]);\n var decrement = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function (step) {\n if (step === void 0) {\n step = stepProp;\n }\n\n if (isInteractive) {\n decrementFn(step);\n }\n }, [decrementFn, isInteractive, stepProp]);\n /**\n * Leverage the `useSpinner` hook to spin the input's value\n * when long press on the up and down buttons.\n *\n * This leverages `setInterval` internally\n */\n\n var spinner = useSpinner(increment, decrement);\n useAttributeObserver(incrementButtonRef, \"disabled\", spinner.stop, spinner.isSpinning);\n useAttributeObserver(decrementButtonRef, \"disabled\", spinner.stop, spinner.isSpinning);\n /**\n * The `onChange` handler filters out any character typed\n * that isn't floating point compatible.\n */\n\n var onChange = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function (event) {\n var evt = event.nativeEvent;\n if (evt.isComposing) return;\n var parsedInput = parse(event.currentTarget.value);\n updateFn(sanitize(parsedInput));\n inputSelectionRef.current = {\n start: event.currentTarget.selectionStart,\n end: event.currentTarget.selectionEnd\n };\n }, [updateFn, sanitize, parse]);\n\n var _onFocus = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function (event) {\n var _inputSelectionRef$cu, _event$currentTarget$, _inputSelectionRef$cu2;\n\n onFocus == null ? void 0 : onFocus(event);\n if (!inputSelectionRef.current) return;\n /**\n * restore selection if custom format string replacement moved it to the end\n */\n\n event.target.selectionStart = (_inputSelectionRef$cu = inputSelectionRef.current.start) != null ? _inputSelectionRef$cu : (_event$currentTarget$ = event.currentTarget.value) == null ? void 0 : _event$currentTarget$.length;\n event.currentTarget.selectionEnd = (_inputSelectionRef$cu2 = inputSelectionRef.current.end) != null ? _inputSelectionRef$cu2 : event.currentTarget.selectionStart;\n }, [onFocus]);\n\n var onKeyDown = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function (event) {\n if (event.nativeEvent.isComposing) return;\n\n if (!isValidNumericKeyboardEvent(event, isValidCharacter)) {\n event.preventDefault();\n }\n /**\n * Keyboard Accessibility\n *\n * We want to increase or decrease the input's value\n * based on if the user the arrow keys.\n *\n * @see https://www.w3.org/TR/wai-aria-practices-1.1/#keyboard-interaction-17\n */\n\n\n var stepFactor = getStepFactor(event) * stepProp;\n var eventKey = (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__.normalizeEventKey)(event);\n var keyMap = {\n ArrowUp: function ArrowUp() {\n return increment(stepFactor);\n },\n ArrowDown: function ArrowDown() {\n return decrement(stepFactor);\n },\n Home: function Home() {\n return updateFn(min);\n },\n End: function End() {\n return updateFn(max);\n }\n };\n var action = keyMap[eventKey];\n\n if (action) {\n event.preventDefault();\n action(event);\n }\n }, [isValidCharacter, stepProp, increment, decrement, updateFn, min, max]);\n\n var getStepFactor = function getStepFactor(event) {\n var ratio = 1;\n\n if (event.metaKey || event.ctrlKey) {\n ratio = 0.1;\n }\n\n if (event.shiftKey) {\n ratio = 10;\n }\n\n return ratio;\n };\n /**\n * If user would like to use a human-readable representation\n * of the value, rather than the value itself they can pass `getAriaValueText`\n *\n * @see https://www.w3.org/TR/wai-aria-practices-1.1/#wai-aria-roles-states-and-properties-18\n * @see https://www.w3.org/TR/wai-aria-1.1/#aria-valuetext\n */\n\n\n var ariaValueText = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(function () {\n var text = getAriaValueText == null ? void 0 : getAriaValueText(counter.value);\n if (!(0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__.isNull)(text)) return text;\n var defaultText = counter.value.toString(); // empty string is an invalid ARIA attribute value\n\n return !defaultText ? undefined : defaultText;\n }, [counter.value, getAriaValueText]);\n /**\n * Function that clamps the input's value on blur\n */\n\n var validateAndClamp = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function () {\n var next = counter.value;\n if (next === \"\") return;\n\n if (counter.valueAsNumber < min) {\n next = min;\n }\n\n if (counter.valueAsNumber > max) {\n next = max;\n }\n /**\n * `counter.cast` does 2 things:\n *\n * - sanitize the value by using parseFloat and some Regex\n * - used to round value to computed precision or decimal points\n */\n\n\n counter.cast(next);\n }, [counter, max, min]);\n var onInputBlur = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function () {\n setFocused.off();\n\n if (clampValueOnBlur) {\n validateAndClamp();\n }\n }, [clampValueOnBlur, setFocused, validateAndClamp]);\n var focusInput = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function () {\n if (focusInputOnChange) {\n (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__.focus)(inputRef.current, {\n nextTick: true\n });\n }\n }, [focusInputOnChange]);\n var spinUp = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function (event) {\n event.preventDefault();\n spinner.up();\n focusInput();\n }, [focusInput, spinner]);\n var spinDown = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function (event) {\n event.preventDefault();\n spinner.down();\n focusInput();\n }, [focusInput, spinner]);\n (0,_chakra_ui_hooks__WEBPACK_IMPORTED_MODULE_4__.b)(\"wheel\", function (event) {\n var doc = (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(inputRef.current);\n var isInputFocused = doc.activeElement === inputRef.current;\n if (!allowMouseWheel || !isInputFocused) return;\n event.preventDefault();\n var stepFactor = getStepFactor(event) * stepProp;\n var direction = Math.sign(event.deltaY);\n\n if (direction === -1) {\n increment(stepFactor);\n } else if (direction === 1) {\n decrement(stepFactor);\n }\n }, inputRef.current, {\n passive: false\n });\n var getIncrementButtonProps = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function (props, ref) {\n if (props === void 0) {\n props = {};\n }\n\n if (ref === void 0) {\n ref = null;\n }\n\n var disabled = isDisabled || keepWithinRange && counter.isAtMax;\n return _extends({}, props, {\n ref: (0,_chakra_ui_react_utils__WEBPACK_IMPORTED_MODULE_6__.mergeRefs)(ref, incrementButtonRef),\n role: \"button\",\n tabIndex: -1,\n onPointerDown: (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__.callAllHandlers)(props.onPointerDown, function (event) {\n if (!disabled) spinUp(event);\n }),\n onPointerLeave: (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__.callAllHandlers)(props.onPointerLeave, spinner.stop),\n onPointerUp: (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__.callAllHandlers)(props.onPointerUp, spinner.stop),\n disabled: disabled,\n \"aria-disabled\": (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__.ariaAttr)(disabled)\n });\n }, [counter.isAtMax, keepWithinRange, spinUp, spinner.stop, isDisabled]);\n var getDecrementButtonProps = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function (props, ref) {\n if (props === void 0) {\n props = {};\n }\n\n if (ref === void 0) {\n ref = null;\n }\n\n var disabled = isDisabled || keepWithinRange && counter.isAtMin;\n return _extends({}, props, {\n ref: (0,_chakra_ui_react_utils__WEBPACK_IMPORTED_MODULE_6__.mergeRefs)(ref, decrementButtonRef),\n role: \"button\",\n tabIndex: -1,\n onPointerDown: (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__.callAllHandlers)(props.onPointerDown, function (event) {\n if (!disabled) spinDown(event);\n }),\n onPointerLeave: (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__.callAllHandlers)(props.onPointerLeave, spinner.stop),\n onPointerUp: (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__.callAllHandlers)(props.onPointerUp, spinner.stop),\n disabled: disabled,\n \"aria-disabled\": (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__.ariaAttr)(disabled)\n });\n }, [counter.isAtMin, keepWithinRange, spinDown, spinner.stop, isDisabled]);\n var getInputProps = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function (props, ref) {\n var _props$readOnly, _props$readOnly2, _props$required, _props$required2;\n\n if (props === void 0) {\n props = {};\n }\n\n if (ref === void 0) {\n ref = null;\n }\n\n return _extends({\n name: name,\n inputMode: inputMode,\n type: \"text\",\n pattern: pattern,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n \"aria-describedby\": ariaDescBy,\n id: id,\n disabled: isDisabled\n }, props, {\n readOnly: (_props$readOnly = props.readOnly) != null ? _props$readOnly : isReadOnly,\n \"aria-readonly\": (_props$readOnly2 = props.readOnly) != null ? _props$readOnly2 : isReadOnly,\n \"aria-required\": (_props$required = props.required) != null ? _props$required : isRequired,\n required: (_props$required2 = props.required) != null ? _props$required2 : isRequired,\n ref: (0,_chakra_ui_react_utils__WEBPACK_IMPORTED_MODULE_6__.mergeRefs)(inputRef, ref),\n value: format(counter.value),\n role: \"spinbutton\",\n \"aria-valuemin\": min,\n \"aria-valuemax\": max,\n \"aria-valuenow\": Number.isNaN(counter.valueAsNumber) ? undefined : counter.valueAsNumber,\n \"aria-invalid\": (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__.ariaAttr)(isInvalid != null ? isInvalid : counter.isOutOfRange),\n \"aria-valuetext\": ariaValueText,\n autoComplete: \"off\",\n autoCorrect: \"off\",\n onChange: (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__.callAllHandlers)(props.onChange, onChange),\n onKeyDown: (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__.callAllHandlers)(props.onKeyDown, onKeyDown),\n onFocus: (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__.callAllHandlers)(props.onFocus, _onFocus, setFocused.on),\n onBlur: (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__.callAllHandlers)(props.onBlur, onBlur, onInputBlur)\n });\n }, [name, inputMode, pattern, ariaLabelledBy, ariaLabel, format, ariaDescBy, id, isDisabled, isRequired, isReadOnly, isInvalid, counter.value, counter.valueAsNumber, counter.isOutOfRange, min, max, ariaValueText, onChange, onKeyDown, _onFocus, setFocused.on, onBlur, onInputBlur]);\n return {\n value: format(counter.value),\n valueAsNumber: counter.valueAsNumber,\n isFocused: isFocused,\n isDisabled: isDisabled,\n isReadOnly: isReadOnly,\n getIncrementButtonProps: getIncrementButtonProps,\n getDecrementButtonProps: getDecrementButtonProps,\n getInputProps: getInputProps,\n htmlProps: htmlProps\n };\n}", "title": "" }, { "docid": "d7389f3d3c8bb05542d2aa4af548128d", "score": "0.48491454", "text": "function getLoaderClass() {\n var loaderClass;\n switch (g_options.slider_loader_type) {\n default:\n case 1:\n loaderClass = \"ug-loader1\";\n break;\n case 2:\n loaderClass = \"ug-loader2\";\n break;\n case 3:\n loaderClass = \"ug-loader3\";\n break;\n case 4:\n loaderClass = \"ug-loader4\";\n break;\n case 5:\n loaderClass = \"ug-loader5\";\n break;\n case 6:\n loaderClass = \"ug-loader6\";\n break;\n case 7:\n loaderClass = \"ug-loader7\";\n break;\n case 8:\n loaderClass = \"ug-loader8\";\n break;\n case 9:\n loaderClass = \"ug-loader9\";\n break;\n }\n\n if (g_options.slider_loader_color == \"black\")\n loaderClass += \" ug-loader-black\";\n\n return (loaderClass);\n }", "title": "" }, { "docid": "73aabc365b51d883d02e0fd566f10cea", "score": "0.48280704", "text": "function spinner_modifier(fn){return function(){var previous=this.element.val();fn.apply(this,arguments),this._refresh(),previous!==this.element.val()&&this._trigger(\"change\")}}", "title": "" }, { "docid": "e712b3a0c321393b4a7ec0d83a549827", "score": "0.48206586", "text": "function bindPageElements() {\r\n\r\n //page section\r\n bindTabPager();\r\n var pageNo = 1;\r\n var $pageNumberTab=$(\"#pageNumberTab\");\r\n if ($pageNumberTab.val() != \"\") {\r\n pageNo = $pageNumberTab.val();\r\n }\r\n postPageNumberElement(pageNo);\r\n}", "title": "" }, { "docid": "958ad67f0d963286aaed429f2bb0c628", "score": "0.48195812", "text": "function inputOnlyNumber() {\n\t$('.js-input-number').on('keydown', function (e) {\n // Allow: backspace, delete, tab, escape, enter and .\n if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 ||\n // Allow: Ctrl+A, Command+A\n (e.keyCode === 65 && (e.ctrlKey === true || e.metaKey === true)) || \n // Allow: home, end, left, right, down, up\n (e.keyCode >= 35 && e.keyCode <= 40)) {\n // let it happen, don't do anything\n return;\n }\n // Ensure that it is a number and stop the keypress\n if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {\n e.preventDefault();\n }\n });\n}", "title": "" }, { "docid": "adf62f5d93838d2dd7c67ec5f4b25b57", "score": "0.48010585", "text": "function init() {\n\n //Lay tong so trang\n $.ajax({\n url: lang + \"/controller/getNumberDeals\",\n type: \"GET\",\n dataType: \"json\"\n }).done(function (data) {\n options.total = data.total;\n loadData(options.currentPage);\n });\n\n //Gan su kien vao cho btnPrevious - btnNext - txtCurrentPage\n setCurrentPage(options.currentPage);\n\n btnPrevious.on(\"click\", function (e) {\n goPrevious();\n e.stopImmediatePropagation();\n });\n\n btnNext.on(\"click\", function (e) {\n goNext();\n e.stopImmediatePropagation();\n });\n\n txtCurrentPage.on(\"keyup\", function (e) {\n\n if (e.keyCode == 13) {\n var currentPageValue = parseInt($(this).val());\n console.log(currentPageValue);\n if (isNaN(currentPageValue) || currentPageValue <= 0\n || currentPageValue > options.total) {\n alert(\"Gia tri nhap vao khong phu hop\");\n } else {\n loadData(currentPageValue);\n options.currentPage = currentPageValue;\n pageInfo();\n }\n }\n\n });\n $(document).on(\"click\", 'div.pages a', function (e) {\n e.preventDefault();\n data = $(this).data(\"value\");\n goCurrentPage(data);\n e.preventDefault();\n });\n\n }", "title": "" }, { "docid": "423a46d9aab85d5eb9e6f24c01f5836a", "score": "0.47763997", "text": "constructor()\n {\n this._loadCounter = 0; // How many things are currently loading?\n\n // Setup loader div\n this._loaderDiv = $('#loader')\n }", "title": "" }, { "docid": "2ee715dd38495d660b28485346f005c0", "score": "0.47730124", "text": "function validateNumber(id)\n {\n var str = $( \"#\" + id ).val();\n if ( /^\\s*\\d+\\s*$/.test( str ) )\n {\n // Everything's fine.\n }\n else if ( str == \"\" )\n {\n $( \"#\" + id ).val( \"0\" );\n }\n else\n {\n var trueName = id.replace( \"vse_config_\", \"\" );\n $( \"#\" + id ).val( vse.user.config[ trueName ] );\n }\n }", "title": "" }, { "docid": "5621fe3a51e8ab4bff003e6245cd0355", "score": "0.47676322", "text": "function loadInputs() {\n\t\n\t\tmyAjax = getMyAjax('userRequests.php');\n\t\tmyAjax.onreadystatechange=function() {\n\t\t\tif (myAjax.readyState==4 && (myAjax.status==200||\n\t\t\t\t\twindow.location.href.indexOf(\"http\")==-1)) {\n\t\t\t\tfillInputBaraja(myAjax.responseText);\n\t\t\t}\n\t\t};\n\t\tvar cadPOST = \"tipoPeticion=5\";\n\t\tcadPOST += \"&minCartas=3\";\n\t\tcadPOST += \"&maxCartas=0\";\n\t\tcadPOST += \"&orden=numCartas desc\";\n\t\tmyAjax.send(cadPOST);\n\t\n\t\tvar inputCard=document.getElementById('inputCartas');\n\t\tfor (var i=minCartas; i<=maxCartas; i+=2) \n\t\t\tinputCard.options[inputCard.length]=new Option(i,i);\n\t\tinputCard.value=defaultNumCartas;\n\t\tvar inputFilas=document.getElementById('inputFilas');\n\t\tfor (var i=minFilas; i<=maxFilas; i++)\n\t\t\tinputFilas.options[inputFilas.length]=new Option(i,i);\n\t\tinputFilas.value=defaultNumFilas;\n\t\tdocument.getElementById('startButton').disabled=false;\n\t\t\t\t\n\t}", "title": "" }, { "docid": "eb7037532f955366401630f136970ef7", "score": "0.47645077", "text": "loadingData() {}", "title": "" }, { "docid": "eb7037532f955366401630f136970ef7", "score": "0.47645077", "text": "loadingData() {}", "title": "" }, { "docid": "eb7037532f955366401630f136970ef7", "score": "0.47645077", "text": "loadingData() {}", "title": "" }, { "docid": "eb7037532f955366401630f136970ef7", "score": "0.47645077", "text": "loadingData() {}", "title": "" }, { "docid": "eb7037532f955366401630f136970ef7", "score": "0.47645077", "text": "loadingData() {}", "title": "" }, { "docid": "eb7037532f955366401630f136970ef7", "score": "0.47645077", "text": "loadingData() {}", "title": "" }, { "docid": "1f112c005e3aaf01181e3d72c2dacaf2", "score": "0.47536695", "text": "function autoNumericHolder(that, options) {\n\t\tthis.options = options;\n\t\tthis.that = that;\n\t\tthis.$that = $(that);\n\t\tthis.formatted = false;\n\t\tthis.io = autoCode(this.$that, this.options);\n\t\tthis.value = that.value;\n\t}", "title": "" }, { "docid": "451d332f3d03b98fc0ae3ffe4b874f13", "score": "0.47304124", "text": "static renderNumericInput({label, input, meta: { touched, invalid, error }, ...custom }) {\n return (\n <TextField\n label={label}\n type=\"number\"\n placeholder={label}\n error={touched && invalid}\n helperText={touched && error}\n {...input}\n {...custom}\n fullWidth\n />\n )\n }", "title": "" }, { "docid": "e1c72df6d914ba67085fb04dcd54c5a0", "score": "0.47262436", "text": "function look4Loader(type) {\n\n\tif (type == \"n\") {\n\n\t\tif ($(\".\" + d_plusloaderClass).is(\":visible\")) {\n\t\t\tloaderTimer = setTimeout(function() {\n\t\t\t\tlook4Loader(type);\n\t\t\t}, 50);\n\t\t} else {\n\t\t\t$(\"#n_plusFake_img\").hide();\n\t\t\t$(\"#n_plusFake_text\").show();\n\t\t\t$('#n_plusFake').addClass(\"button\");\n\t\t\t$('#n_plusFake').removeClass(\"buttonClear\");\n\t\t\tn_arrange();\n\t\t\tclearTimeout(loaderTimer);\n\t\t}\n\t} else {\n\t\tif ($(\".\" + d_plusloaderClass).is(\":visible\")) {\n\t\t\tloaderTimer = setTimeout(function() {\n\t\t\t\tlook4Loader(type);\n\t\t\t}, 50);\n\t\t} else {\n\t\t\t$(\"#gs_plusFake_img\").hide();\n\t\t\t$(\"#gs_plusFake_text\").show();\n\t\t\t$('#gs_plusFake').addClass(\"button\");\n\t\t\t$('#gs_plusFake').removeClass(\"buttonClear\");\n\t\t\tgs_arrange();\n\t\t\tclearTimeout(loaderTimer);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1c6218c6adfa94a5cfdaa0a20eed9975", "score": "0.47115088", "text": "function get_numero_ingreso(){\n $.ajax({\n url:\"ajax/bodegas.php?op=get_numero_ingreso\",\n method:\"POST\",\n cache:false,\n dataType:\"json\",\n success:function(data)\n {\n $(\"#id_ingreso_c\").html(data.n_ingreso);\n }\n })\n}", "title": "" }, { "docid": "d7bf3efcdf643ce9e7e72ef05fa2ac66", "score": "0.47033247", "text": "function Onloader() {\n OnloadGender();\n OnloadCivilStat();\n OnloadSurfer();\n OnloadHiker();\n OnloadSeniorCitizen()\n // Next Line\n OnloadAgeGroup();\n OnloadVIP();\n OnloadUpsell();\n OnloadDiscount();\n\n}", "title": "" }, { "docid": "890259ac16fb90773095d9b16107d5a5", "score": "0.46974966", "text": "get loadingIndicator() {\n return this._getOption('loadingIndicator');\n }", "title": "" }, { "docid": "07365ed54aa0a8d613a2ef0b38edd5b1", "score": "0.46839914", "text": "function Loader() {\n Loader.prototype.total = 0;\n Loader.prototype.loaded = 0;\n Loader.prototype.percentLoaded = 0;\n\n Loader.prototype.PercentLoaded = function() {\n return Math.round((Loader.prototype.loaded/Loader.prototype.total)*100);\n };\n\n Loader.prototype.Loaded = function() {\n Loader.prototype.loaded++;\n };\n}", "title": "" }, { "docid": "6383bb595f55648c7193b2310877f923", "score": "0.46736467", "text": "function initiliseAjax() {\n $(document).ajaxStart(function () {\n $('.ajax-loading').show(); // show loading indicator\n });\n\n $(document).ajaxStop(function () {\n $('.ajax-loading').hide(); // hide loading indicator\n });\n}", "title": "" }, { "docid": "0b41bc6a08fbe1f162c24c05f36b8e97", "score": "0.4671044", "text": "function handleSubmit(event){\n event.preventDefault();\n setTypedNumber(number);\n fetchContent();\n \n}", "title": "" }, { "docid": "ead5aa95ae7afdd858952b307399e35b", "score": "0.46632525", "text": "function renderLoading(data, type, row, meta) {\n var cutoff = 0.3;\n var inp = $(meta.settings.nTableWrapper).find('.cutoff-inp > input');\n if (inp.length > 0) {\n cutoff = parseFloat(inp.val());\n }\n\n if (Math.abs(data) < cutoff) {\n return \"\";\n } else {\n return data.toFixed(3);\n }\n}", "title": "" }, { "docid": "93f02a1fcf79be99b8ffdbbd523f9098", "score": "0.4650438", "text": "function _getNumberFormatted() {\n\t\t\n\t\t\tvar number = _getOption('number');\n\t\t\t\n\t\t\t// check is numeric\n\t\t\tif (typeof number !== 'number') {\n\t\t\t\n\t\t\t\t$.error('Attempting to render non-numeric value.');\n\t\t\t\treturn '0';\n\t\t\t\t\n\t\t\t} \n\t\t\t\n\t\t\tvar str_number = '';\n\t\t\t\n\t\t\t// Number formatter plugin is being used\n\t\t\tif (_getOption('formatNumberOptions')) \n\t\t\t{\n\t\t\t\n\t\t\t\tif ($.formatNumber) {\n\t\t\t\t \n\t\t\t\t\tstr_number = $.formatNumber(number, _getOption('formatNumberOptions'));\n\t\t\t \n\t\t\t\t} else {\n\t\t\t\t\n\t\t\t\t\t$.error('The numberformatter jQuery plugin is not loaded. This plugin is required to use the formatNumberOptions setting.');\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\n\t\t\t\t// if greater than zero add leading zeros if necessary\n\t\t\t\tif (number >= 0) { \n\t\t\t\t\n\t\t\t\t\tvar num_integral_digits = _getOption('numIntegralDigits');\n\t\t\t\t\tvar num_extra_zeros = num_integral_digits - number.toFixed().toString().length;\n\t\t\t\t\t\n\t\t\t\t\tfor (var i = 0; i < num_extra_zeros; i++) {\n\t\t\t\t\t\n\t\t\t\t\t\tstr_number += '0';\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tstr_number += number.toFixed(_getOption('numFractionalDigits'));\n\t\t\t\t\t\n\t\t\t\t // if less than zero remove leading zeros and add minus sign \n\t\t\t\t} else { \n\t\t\t\t\n\t\t\t\t\tstr_number = '-' + Math.abs(number.toFixed(_getOption('numFractionalDigits')));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t\treturn str_number;\n\n\t\t}", "title": "" }, { "docid": "28377b6043b6acfe8086457cb77fb2cc", "score": "0.46484584", "text": "function getNumber(options) {\n return Object(_dialog__WEBPACK_IMPORTED_MODULE_1__[/* showDialog */ \"b\"])(Object.assign({}, options, { body: new InputNumberDialog(options), buttons: [\n _dialog__WEBPACK_IMPORTED_MODULE_1__[/* Dialog */ \"a\"].cancelButton({ label: options.cancelLabel }),\n _dialog__WEBPACK_IMPORTED_MODULE_1__[/* Dialog */ \"a\"].okButton({ label: options.okLabel })\n ], focusNodeSelector: 'input' }));\n }", "title": "" }, { "docid": "5d7775078f28cfaf1a720bab3e0b903d", "score": "0.46456832", "text": "function getNumber(){\n\treturn;\n}", "title": "" }, { "docid": "7ef95e4456676e737cb6822dd1acece7", "score": "0.46432662", "text": "function setUpLoadingSpinner(id, resultID) {\n createSpinner(id);\n var $loading = $(\"#\" + id).hide();\n var $result = $(\"#\" + resultID);\n \n $(document)\n .ajaxStart(function () {\n showHide($loading, $result);\n })\n .ajaxStop(function () {\n showHide($result, $loading);\n });\n}", "title": "" }, { "docid": "6fcafe57bb48cf16d3f044be5925a76f", "score": "0.46416077", "text": "function LoadCount() {\n var begTime = $(\"#txtBegTime\").val();\n var endTime = $(\"#txtEndTime\").val();\n var giftName = $(\"#txtGiftName\").val();\n var giftStatus = $(\"#optStatus\").val();\n if (giftStatus == \"-1\") giftStatus = \"\";\n\n $.ajax({\n type: \"Post\",\n url: \"/AjaxPages/homeAjax.aspx\",\n data: \"{'action':'queryRewardGiftCount','giftName':'\" + giftName + \"','giftStatus':'\" + giftStatus + \"','begTime':'\" + begTime + \"','endTime':'\" + endTime + \"'}\",\n success: function (resu) {\n if (resu == \"\") {\n return;\n }\n var arry = new Array();\n arry = resu.split(\",\");\n recordCount = arry[0];\n pageCount = arry[1];\n kkpager.generPageHtml({\n lang: {\n firstPageText: 'First',\n firstPageTipText: 'First',\n lastPageText: 'Last',\n lastPageTipText: 'Last',\n prePageText: 'Prev',\n prePageTipText: 'Prev',\n nextPageText: 'Next',\n nextPageTipText: 'Next',\n currPageBeforeText: 'Current page ',\n currPageAfterText: '',\n totalInfoSplitStr: '/',\n totalRecordsBeforeText: '',\n totalRecordsAfterText: '条数据',\n gopageBeforeText: ' 转到',\n gopageButtonOkText: '确定',\n gopageAfterText: '页',\n buttonTipBeforeText: '第',\n buttonTipAfterText: '页'\n },\n pno: 1,\n total: pageCount, //总页码 //总数据条数\n totalRecords: recordCount,\n mode: 'click', //默认值是link,可选link或者click\n click: function (n) {\n page = n;\n LoadPrd();\n this.selectPage(n); //手动选中按钮\n return false;\n }\n });\n },\n error: function (obj) {\n // alert(\"Load failed\");\n }\n });\n}", "title": "" }, { "docid": "81771d495fdfde1e4411bb6620f176c5", "score": "0.4639867", "text": "function loadDatosPersonales(url) {\n jQuery.xajax({\n url: url,\n dataType: 'json',\n success: function(data) {\n\n var form = null;\n\n form = $('#datosPersonalesForm');\n //suponemos que la fecha ya viene en formato dd/mm/aaaa\n writeDate(form.find('#fechaNacimiento'),data.date);\n form.find('#cp').val(data.zipCode);\n $(\"#radio_tipoDatosPersonales_persona\").addClass('active');\n changeCustomSelect(form.find('#select-ul-Provincia li[v=' + data.state + ']'), form);\n if(data.gender == \"M\") {\n form.find('#radio_r_men').click();\n } else if(data.gender == \"F\") {\n form.find('#radio_r_women').click();\n }\n\n form.find('#nif').val(data.nif);\n form.find('#empresa').val(data.nameCompany);\n form.find('#nombre').val(data.firstName);\n if(Inditex.checkMiddleName(data.middleName)) {\n form.find('#middleName').val(data.middleName);\n }\n form.find('#apellido').val(data.lastName);\n form.find('#direccion').val(data.street);\n form.find('#direccion2').val(data.street2);\n form.find('#localidad').val(data.city);\n //suponemos que el formato del telefono es prefijo_espacio_numero\n if (data.phone1 != null && data.phone1 != undefined){\n form.find('#prefijo').val(data.phone1.split(\" \")[0]);\n form.find('#telefono').val(data.phone1.split(\" \")[1]);\n }\n if (data.phone2 != null && data.phone2 != undefined){\n form.find('#prefijo2').val(data.phone2.split(\" \")[0]);\n form.find('#telefono2').val(data.phone2.split(\" \")[1]);\n }\n\n if(form.find('#colony')&&form.find('#colony').length>0){\n form.find('#colony').val(data.colony);\n }\n\n if(form.find('#municipality')&&form.find('#municipality').length>0){\n form.find('#municipality').val(data.municipality);\n }\n if(form.find('#newsletter')&&form.find('#newsletter').length>0){\n if(data.sectionNewsletter){\n form.find('#newsletter').attr(\"checked\",true);\n }\n }\n\n if ($('input[name=\"newsletter\"]').is(':checked')) {\n $('#check_newsletter').addClass('active');\n } else {\n $('#check_newsletter').removeClass('active');\n }\n setScroll();\n }\n });\n}", "title": "" }, { "docid": "77b1c953ed99cae3b885fb4d27072e45", "score": "0.46371892", "text": "function initialize () {\n if ( $B.ua.ANDROID || $B.ua.MOBILE_IOS ) {\n _$input.attr( 'type', 'number' );\n }\n\n _$input.attr( 'aria-live', 'polite' );\n\t\t\t_$input.prop( 'readonly', true );\n\n setEvents();\n _currentValue = getCorrectValue( _this.getValue() );\n _$input.val( _currentValue );\n\n if ( _options.disabled ) {\n _this.disable();\n } else {\n setBtnState();\n }\n }", "title": "" }, { "docid": "876e1c13d3c6d672b4d5af2896a44e20", "score": "0.46329468", "text": "function ajax_loader(key) {\n if (key == \"clear\") {\n $(\".ajax-loader\").remove();\n } else {\n $(\".ajax-loader\").remove();\n $(key).after(\"<span class='ajax-loader'></span>\");\n }\n}", "title": "" }, { "docid": "9ea092246f2ec44710309f92144e32fb", "score": "0.46259415", "text": "function createAutonumeric() {\n if (typeof autonum !== 'undefined')\n removeMultipleAutonumeric();\n\n autonum = new AutoNumeric.multiple(\".input_qty_pindah\", {\n decimalCharacter: \",\",\n digitGroupSeparator: \".\",\n allowDecimalPadding: false,\n decimalPlaces: 0\n });\n}", "title": "" }, { "docid": "88d8cb69f74f249ceacf2bd43544b538", "score": "0.46228668", "text": "function CreateSelectNumber(name,start,end,gap,init)\r\n{\r\n DW(GetSelectNumberHtml(name,start,end,gap,init));\r\n}", "title": "" }, { "docid": "1fa2428aa951195642614ac256b5ea98", "score": "0.46223328", "text": "function varinit()\n {\n varchange();\t\t\n //Variable r1 slider and number input types\n $('#l1slider').slider(\"value\", 135);\t\n $('#l1spinner').spinner(\"value\", 135);\n \n $('#r1slider').slider(\"value\", 10);\t\n $('#r1spinner').spinner(\"value\", 10);\n \n }", "title": "" }, { "docid": "24265fd6555e1f4b9df99e34bb95bcfb", "score": "0.46211532", "text": "function formatoNumero(idcampo) {\nvar res = document.getElementById(idcampo).value; \ndocument.getElementById(\"id\"+idcampo).value = res;\nif (document.getElementById(idcampo).value > 0 && document.getElementById(idcampo).value < 99999999999) { \n\tresultado = parseFloat(res).toFixed(2).toString();\n\tresultado = resultado.split(\".\");\n\tvar cadena = \"\"; cont = 1\n\tfor(m=resultado[0].length-1; m>=0; m--){\n\t\tcadena = resultado[0].charAt(m) + cadena\n\t\tcont%3 == 0 && m >0 ? cadena = \".\" + cadena : cadena = cadena\n\t\tcont== 3 ? cont = 1 :cont++\n\t}\n\tdocument.getElementById(idcampo).value = cadena + \",\" + resultado[1]; \n} else { \n\tdocument.getElementById(idcampo).value = 0;\n\tdocument.getElementById(\"id\"+idcampo).value = 0;\n\talert (\"Debes indicar valores numericos en el campo \"+idcampo);\n\tdocument.getElementById(idcampo).focus();\n} \n}", "title": "" }, { "docid": "25d421a6de88efd3573373123fbf3f6e", "score": "0.4610836", "text": "function set_form_patient(id){\n $('.preloader').fadeIn();\n $.ajax({\n url: \"../patient/\"+id,\n success: async function(result){\n await ajax_wilayah('kd_kota',result.kd_provinsi,'regencies','kota', false);\n\n await ajax_wilayah('kd_kecamatan',result.kd_kota,'districts','kecamatan', false);\n\n await ajax_wilayah('kd_kelurahan',result.kd_kecamatan,'villages','kelurahan', false);\n\n let rrk = result.rt_rw_kodepos!=null?result.rt_rw_kodepos.split('-'):['','',''];\n $('#rt').val(rrk[0]);\n $('#rw').val(rrk[1]);\n $('#kodepos').val(rrk[2]);\n\n $('#'+result.jenis_kelamin).attr('checked', true);\n\n $('#umur').val(calculate_age(new Date(result.tanggal_lahir))+' tahun');\n\n for(i in result){\n $('#'+i).val(result[i]);\n }\n\n $('#s_no_rm').val(id);\n $('#s_nama').val(id);\n $('#select2-s_no_rm-container').text(result.noreg);\n $('#select2-s_nama-container').text(result.nama);\n\n $('#noreg').attr('disabled',true);\n\n $('.preloader').fadeOut();\n }\n })\n}", "title": "" }, { "docid": "b292cd7469a8b33379d8dedc861276e0", "score": "0.46063906", "text": "function loading(x){\r\n if (x == 1){\r\n $(\"#loader\").show();\r\n }\r\n if (x == 0){\r\n $(\"#loader\").hide();\r\n }\r\n}", "title": "" }, { "docid": "3737dc0059b9163682b0b8959623a243", "score": "0.46042857", "text": "function onloadFormular() {\r\n getYear();\r\n setPhoneListener();\r\n}", "title": "" }, { "docid": "ca83d1bbcde46ec0848271f51f680276", "score": "0.46039334", "text": "validNumber(text) {\n\t\tvar clean = text.replace( /[^0-9]+/g, '');\n\t\tthis.number(clean);\n\t}", "title": "" }, { "docid": "ef8f37c3cd736c09ed776e71a677f6c1", "score": "0.46034595", "text": "function ChangeFormToInt(num) {\n return parseInt(num);\n }", "title": "" }, { "docid": "92cd89c191b1fb0496b92645c2fec3d4", "score": "0.46019936", "text": "function useNumberInput(props) {\n if (props === void 0) {\n props = {};\n }\n\n var {\n focusInputOnChange = true,\n clampValueOnBlur = true,\n keepWithinRange = true,\n min = _chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__[\"minSafeInteger\"],\n max = _chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__[\"maxSafeInteger\"],\n step: stepProp = 1,\n isReadOnly,\n isDisabled,\n getAriaValueText,\n isInvalid,\n id\n } = props,\n htmlProps = _objectWithoutPropertiesLoose(props, [\"focusInputOnChange\", \"clampValueOnBlur\", \"keepWithinRange\", \"min\", \"max\", \"step\", \"isReadOnly\", \"isDisabled\", \"getAriaValueText\", \"isInvalid\", \"onChange\", \"id\"]);\n /**\n * Leverage the `useCounter` hook since it provides\n * the functionality to `increment`, `decrement` and `update`\n * counter values\n */\n\n\n var counter = Object(_chakra_ui_counter__WEBPACK_IMPORTED_MODULE_0__[\"useCounter\"])(props);\n var {\n update: updateFn,\n increment: incrementFn,\n decrement: decrementFn\n } = counter;\n /**\n * Keep track of the focused state of the input,\n * so user can this to change the styles of the\n * `spinners`, maybe :)\n */\n\n var [isFocused, setFocused] = Object(_chakra_ui_hooks__WEBPACK_IMPORTED_MODULE_1__[\"useBoolean\"])();\n var inputRef = react__WEBPACK_IMPORTED_MODULE_3__[\"useRef\"](null);\n var isInteractive = !(isReadOnly || isDisabled);\n var increment = react__WEBPACK_IMPORTED_MODULE_3__[\"useCallback\"](function (step) {\n if (step === void 0) {\n step = stepProp;\n }\n\n if (isInteractive) {\n incrementFn(step);\n }\n }, [incrementFn, isInteractive, stepProp]);\n var decrement = react__WEBPACK_IMPORTED_MODULE_3__[\"useCallback\"](function (step) {\n if (step === void 0) {\n step = stepProp;\n }\n\n if (isInteractive) {\n decrementFn(step);\n }\n }, [decrementFn, isInteractive, stepProp]);\n /**\n * Leverage the `useSpinner` hook to spin the input's value\n * when long press on the up and down buttons.\n *\n * This leverages `setInterval` internally\n */\n\n var spinner = Object(_use_spinner__WEBPACK_IMPORTED_MODULE_4__[\"useSpinner\"])(increment, decrement);\n /**\n * The `onChange` handler filters out any character typed\n * that isn't floating point compatible.\n */\n\n var onChange = react__WEBPACK_IMPORTED_MODULE_3__[\"useCallback\"](event => {\n var valueString = event.target.value.split(\"\").filter(_number_input_utils__WEBPACK_IMPORTED_MODULE_5__[\"isFloatingPointNumericCharacter\"]).join(\"\");\n updateFn(valueString);\n }, [updateFn]);\n var onKeyDown = react__WEBPACK_IMPORTED_MODULE_3__[\"useCallback\"](event => {\n /**\n * only allow valid numeric keys\n */\n if (!Object(_number_input_utils__WEBPACK_IMPORTED_MODULE_5__[\"isValidNumericKeyboardEvent\"])(event)) {\n event.preventDefault();\n }\n /**\n * Keyboard Accessibility\n *\n * We want to increase or decrease the input's value\n * based on if the user the arrow keys.\n *\n * @see https://www.w3.org/TR/wai-aria-practices-1.1/#keyboard-interaction-17\n */\n\n\n var stepFactor = getStepFactor(event) * stepProp;\n var eventKey = Object(_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__[\"normalizeEventKey\"])(event);\n\n switch (eventKey) {\n case \"ArrowUp\":\n event.preventDefault();\n increment(stepFactor);\n break;\n\n case \"ArrowDown\":\n event.preventDefault();\n decrement(stepFactor);\n break;\n\n case \"Home\":\n event.preventDefault();\n updateFn(min);\n break;\n\n case \"End\":\n event.preventDefault();\n updateFn(max);\n break;\n\n default:\n break;\n }\n }, [updateFn, decrement, increment, max, min, stepProp]);\n\n var getStepFactor = event => {\n var ratio = 1;\n\n if (event.metaKey || event.ctrlKey) {\n ratio = 0.1;\n }\n\n if (event.shiftKey) {\n ratio = 10;\n }\n\n return ratio;\n };\n /**\n * If user would like to use a human-readable representation\n * of the value, rather than the value itself they can pass `getAriaValueText`\n *\n * @see https://www.w3.org/TR/wai-aria-practices-1.1/#wai-aria-roles-states-and-properties-18\n * @see https://www.w3.org/TR/wai-aria-1.1/#aria-valuetext\n */\n\n\n var ariaValueText = getAriaValueText == null ? void 0 : getAriaValueText(counter.value);\n /**\n * Function that clamps the input's value on blur\n */\n\n var validateAndClamp = react__WEBPACK_IMPORTED_MODULE_3__[\"useCallback\"](() => {\n var next = counter.value;\n if (next === \"\") return;\n\n if (counter.valueAsNumber < min) {\n next = min;\n }\n\n if (counter.valueAsNumber > max) {\n next = max;\n }\n /**\n * `counter.cast` does 2 things:\n *\n * - sanitize the value by using parseFloat and some Regex\n * - used to round value to computed precision or decimal points\n */\n\n\n counter.cast(next);\n }, [counter, max, min]);\n var onBlur = react__WEBPACK_IMPORTED_MODULE_3__[\"useCallback\"](() => {\n setFocused.off();\n\n if (clampValueOnBlur) {\n validateAndClamp();\n }\n }, [clampValueOnBlur, setFocused, validateAndClamp]);\n var focusInput = react__WEBPACK_IMPORTED_MODULE_3__[\"useCallback\"](() => {\n if (focusInputOnChange && inputRef.current) {\n Object(_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__[\"focus\"])(inputRef.current);\n }\n }, [focusInputOnChange]);\n var spinUp = react__WEBPACK_IMPORTED_MODULE_3__[\"useCallback\"](event => {\n event.preventDefault();\n spinner.up();\n focusInput();\n }, [focusInput, spinner]);\n var spinDown = react__WEBPACK_IMPORTED_MODULE_3__[\"useCallback\"](event => {\n event.preventDefault();\n spinner.down();\n focusInput();\n }, [focusInput, spinner]);\n var clickEvent = _chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__[\"isBrowser\"] && !!document.documentElement.ontouchstart ? \"onTouchStart\" : \"onMouseDown\";\n var getIncrementButtonProps = react__WEBPACK_IMPORTED_MODULE_3__[\"useCallback\"](function (props) {\n if (props === void 0) {\n props = {};\n }\n\n return _extends({}, props, {\n role: \"button\",\n tabIndex: -1,\n [clickEvent]: Object(_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__[\"callAllHandlers\"])(props[clickEvent], spinUp),\n onMouseUp: Object(_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__[\"callAllHandlers\"])(props.onMouseUp, spinner.stop),\n onMouseLeave: Object(_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__[\"callAllHandlers\"])(props.onMouseUp, spinner.stop),\n onTouchEnd: Object(_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__[\"callAllHandlers\"])(props.onTouchEnd, spinner.stop),\n disabled: keepWithinRange && counter.isAtMax,\n \"aria-disabled\": Object(_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__[\"ariaAttr\"])(keepWithinRange && counter.isAtMax)\n });\n }, [clickEvent, counter.isAtMax, keepWithinRange, spinUp, spinner.stop]);\n var getDecrementButtonProps = react__WEBPACK_IMPORTED_MODULE_3__[\"useCallback\"](function (props) {\n if (props === void 0) {\n props = {};\n }\n\n return _extends({}, props, {\n role: \"button\",\n tabIndex: -1,\n [clickEvent]: Object(_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__[\"callAllHandlers\"])(props[clickEvent], spinDown),\n onMouseLeave: Object(_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__[\"callAllHandlers\"])(props.onMouseUp, spinner.stop),\n onMouseUp: Object(_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__[\"callAllHandlers\"])(props.onMouseUp, spinner.stop),\n onTouchEnd: Object(_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__[\"callAllHandlers\"])(props.onTouchEnd, spinner.stop),\n disabled: keepWithinRange && counter.isAtMin,\n \"aria-disabled\": Object(_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__[\"ariaAttr\"])(keepWithinRange && counter.isAtMin)\n });\n }, [clickEvent, counter.isAtMin, keepWithinRange, spinDown, spinner.stop]);\n var getInputProps = react__WEBPACK_IMPORTED_MODULE_3__[\"useCallback\"](function (props) {\n if (props === void 0) {\n props = {};\n }\n\n return _extends({}, props, {\n id,\n ref: Object(_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__[\"mergeRefs\"])(inputRef, props.ref),\n value: counter.value,\n role: \"spinbutton\",\n type: \"text\",\n inputMode: \"numeric\",\n pattern: \"[0-9]*\",\n \"aria-valuemin\": min,\n \"aria-valuemax\": max,\n \"aria-disabled\": isDisabled,\n \"aria-valuenow\": isNaN(counter.valueAsNumber) ? undefined : counter.valueAsNumber,\n \"aria-invalid\": isInvalid || counter.isOutOfRange,\n \"aria-valuetext\": ariaValueText,\n readOnly: isReadOnly,\n disabled: isDisabled,\n autoComplete: \"off\",\n autoCorrect: \"off\",\n onChange: Object(_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__[\"callAllHandlers\"])(props.onChange, onChange),\n onKeyDown: Object(_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__[\"callAllHandlers\"])(props.onKeyDown, onKeyDown),\n onFocus: Object(_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__[\"callAllHandlers\"])(props.onFocus, setFocused.on),\n onBlur: Object(_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_2__[\"callAllHandlers\"])(props.onBlur, onBlur)\n });\n }, [ariaValueText, counter.isOutOfRange, counter.value, counter.valueAsNumber, id, isDisabled, isInvalid, isReadOnly, max, min, onBlur, onChange, onKeyDown, setFocused.on]);\n return {\n value: counter.value,\n valueAsNumber: counter.valueAsNumber,\n isFocused,\n isDisabled,\n isReadOnly,\n getIncrementButtonProps,\n getDecrementButtonProps,\n getInputProps,\n htmlProps\n };\n}", "title": "" }, { "docid": "05d1a33a209a5db4782bf97a0523e6ce", "score": "0.45965013", "text": "function fnloadSpinner(opc,idboton){\n\n switch (opc){\n // mostrar fa-Spinner\n case 1:\n $('#'+idboton).prop('disabled',true);\n jsShowWindowLoad(\" espere un momento . .\");\n break;\n case 2:\n // Ocultar fa-Spinner\n $('#'+idboton).prop('disabled',false);\n jsRemoveWindowLoad();\n break;\n default :\n MyAlert(\"error no se encontro la opci&oacute;n solicitada\",\"error\");\n break;\n }\n}", "title": "" }, { "docid": "6f826569e5241bc1c9760efcedf36092", "score": "0.45922098", "text": "function show_data_for_record(id, div_id, type, path){\n if(id == \"\"){\n return false\n }\n loader.prependTo(\"#\"+div_id)\n jQuery.ajax({\n type: type,\n url: path,\n dataType: 'script',\n data: {\n 'id' : id\n },\n success: function(){\n loader.remove();\n }\n });\n}", "title": "" }, { "docid": "7e428ed1f73ac24dba0fb94c489ba567", "score": "0.4590469", "text": "function _init() {\n\t\t\t\t$('.form-group.floating-label').each(function() {\n\t\t\t\t\tvar el = $(this);\n\t\t\t\t\tvar input = $(this).find('input')[0];\n\n\t\t\t\t\tif(input.value.length > 0) {\n\t\t\t\t\t\tel.addClass(valueModifier);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "fa6e8f7e2a44c1b20d2ff5c5f8c67daf", "score": "0.458414", "text": "function formataNumeros(p_elemento){\n g_obj_data = p_elemento;\n setTimeout(\"executarFormatanumeros()\", 1);\n }", "title": "" }, { "docid": "fa6e8f7e2a44c1b20d2ff5c5f8c67daf", "score": "0.458414", "text": "function formataNumeros(p_elemento){\n g_obj_data = p_elemento;\n setTimeout(\"executarFormatanumeros()\", 1);\n }", "title": "" }, { "docid": "fdae940842ad1bac1b05f04be0fde044", "score": "0.45825583", "text": "function refreshLoader(){\n $(\"#num_loaded\").html(num_loaded);\n $(\"#num_loading\").html(num_loading);\n $(\"#num_errors\").html(num_errors);\n\n if(num_loading - (num_loaded + num_errors) > 0){\n showLoadingIcon();\n }\n else if(num_errors > 0){\n showErrorIcon();\n }\n else{\n showLoadedIcon();\n }\n}", "title": "" }, { "docid": "0e3abc358a15ee8ddc8fc23ff4f079fe", "score": "0.45802638", "text": "function loadCircularPagging(recNo,pageNo)\r\n { \r\n var pageSize=4;\r\n $.ajax({\r\n type : \"POST\",\r\n dataType : \"json\",\r\n url : siteUrl+'/proxy',\r\n data : {method:\"loadCircularPagging\", recNo: recNo,pageSize:4,pageNo:pageNo},\r\n success : function(data) \r\n {\r\n var res = data.circularList; \r\n var dataRes = data.dataList; \r\n $(\"#paggingDetails\").html(res);\r\n $(\"#circularRecords\").html(dataRes);\r\n $('.pagingliclass').removeClass('active');\r\n $('#page'+pageNo).addClass('active');//firstLi\r\n if(pageNo==1)\r\n {\r\n //$('#firstLi').hide();\r\n }\r\n \r\n }\r\n });\r\n }", "title": "" }, { "docid": "10fcb0c71091e64ebadc42e3673bf72c", "score": "0.45761275", "text": "function getSerNumber(){ \n var numServer = $('#inputServer').val();\n if (is_int(numServer)==false){\n numServer = 'string';\n }\n return numServer;\n }", "title": "" }, { "docid": "ae4b17c498842dc308ecd459494226ab", "score": "0.45716837", "text": "function _init_job_order_reference_number_field(){\n try{\n var order_reference_number_field = Ti.UI.createTableViewRow({\n className:'set_job_order_reference_number',\n filter_class:'set_job_order_reference_number',\n height:'auto'\n });\n self.job_order_reference_number_content_field = Ti.UI.createTextArea({\n width:(self.is_ipad())?self.screen_width-100:self.screen_width-30,\n height:150,\n textAlign:'left',\n top:5,\n bottom:5,\n left:10,\n right:10,\n value:_order_reference_number,\n color:self.selected_value_font_color,\n font:{\n fontSize:self.normal_font_size\n },\n returnKeyType: Ti.UI.RETURNKEY_RETURN,\n suppressReturn:false\n });\n order_reference_number_field.add(self.job_order_reference_number_content_field);\n self.data.push(order_reference_number_field);\n self.job_order_reference_number_content_field.addEventListener('change',function(e){\n _order_reference_number = e.value;\n });\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _init_job_order_reference_number_field');\n return;\n }\n }", "title": "" }, { "docid": "b8851b8178045ed9fe60d2ea90782325", "score": "0.456967", "text": "function addNewField(num){\n return $.ajax({\n type: 'GET',\n url: '/backend_dev.php/addlineaobra?num='+num,\n async: false\n }).responseText;\n}", "title": "" }, { "docid": "d9260cdf2572d18ff4b8c85a7b3d862f", "score": "0.45687333", "text": "function fxpgdocumento_txtstipo_documento_codigo__init(){\n $(\"#pgdocumento_txtstipo_documento_codigo\").html(\"\");\n $.post(\"../../controller/servicio.php?op=ctrl_apr_web_tipo_documento_select\", function(data, status){\n $(\"#pgdocumento_txtstipo_documento_codigo\").html(data);\n $(\"#pgdocumento_txtstipo_documento_codigo\").selectpicker(\"refresh\");\n });\n}", "title": "" }, { "docid": "f0207b16826aa9d7f87b59fa9c4eb494", "score": "0.45685297", "text": "function disableScrollOnNumberInput() {\r\n $(':input[type=number]').on('mousewheel',function(e){ $(this).blur(); });\r\n }", "title": "" } ]
7adc7aa0df86cb0be1c977c0fd0f70e9
to make this work, simply link it to an on click of your desired element to track for the name, the id usually works best
[ { "docid": "90b57b3fb0d8947d45d82cd171e6afcd", "score": "0.5923881", "text": "function addClickToElement(elementName) {\n var readData;\n var thisNum;\n if(clickTrackerFile.exists) {\n clickTrackerFile.open(\"r\");\n readData = JSON.parse(clickTrackerFile.read());\n clickTrackerFile.close();\n \n thisNum = readData[elementName];\n thisNum++;\n \n readData[elementName] = thisNum;\n \n clickTrackerFile.open(\"w\");\n clickTrackerFile.write(JSON.stringify(readData));\n clickTrackerFile.close();\n }\n }", "title": "" } ]
[ { "docid": "f4f92900f815d9005e1f5c978613db3b", "score": "0.67212814", "text": "renderName (name, id) {\n this.name.innerHTML = name\n this.name.setAttribute('id', id)\n }", "title": "" }, { "docid": "15cdf58384646effc595f59661d354f4", "score": "0.6525958", "text": "elmId(name) { return name + this._uid; }", "title": "" }, { "docid": "6d0fa516eb10b300acee7bc9bc24800f", "score": "0.65173393", "text": "function goToShoe(idName) {\n document.getElementById(idName).addEventListener('click', function() {\n onShoeClick(shoeEnters, `.${idName}`)\n })\n}", "title": "" }, { "docid": "2d28fceb4636ac394000b5365beda145", "score": "0.6477775", "text": "function clickItem(el) {\n var name = el.textContent;\n octopus.updateCurrObj(name);\n octopus.updateCountObj();\n octopus.getItem(name);\n }", "title": "" }, { "docid": "87533a85e88e51cff096330862de9db1", "score": "0.64286095", "text": "function getElementName(id){\n\t\t\t return getById(id).name;\n\t\t\t}", "title": "" }, { "docid": "f003acf0244e9774b16d5734bab99fbc", "score": "0.64201957", "text": "function handleItemNameClick() {\n $('.js-shopping-list').on('click', '.js-shopping-item', event => {\n const id = getItemIdFromElement(event.target);//recognize the id of the clicked object\n itemBeingEdited(id,true);\n renderShoppingList();\n });\n}", "title": "" }, { "docid": "63b765663da99b7110179949d6d69fb8", "score": "0.6397147", "text": "function clickName(event){\r\n var artistListing = event.target;\r\n var targetKey = artistListing.innerText;\r\n targetKey = targetKey.substr(0, targetKey.length-2);\r\n for(var key in artistData) {\r\n if(artistData[key].name==targetKey) {\r\n populatePage(artistData[key]);\r\n }\r\n } document.getElementById(\"nav-title\").style.color = \"black\";\r\n}", "title": "" }, { "docid": "f555a3595849111ba5bca3beed30dfef", "score": "0.63607615", "text": "function addName() {\n console.log(\"addName() ran\");\n\n // See:\n // - https://www.digitalocean.com/community/tutorials/js-innertext-and-innerhtml\n // - https://www.w3schools.com/jsref/prop_node_innertext.asp\n\n let nameElement = document.querySelector(\"#name\");\n}", "title": "" }, { "docid": "9e6773bae378e6aa9c604be6e3c39ff4", "score": "0.63138384", "text": "function clickObject(object_id) {\n document.getElementById(\"object_modal_label\").innerHTML = object_id;\n}", "title": "" }, { "docid": "6e7d89c8939c6d399c3ea5864fa46557", "score": "0.62806225", "text": "function changeName(){\n var name= document.querySelector(\"#name\");\n name.innerText=\"Emile Thigpen\";\n\n}", "title": "" }, { "docid": "9eb1135af676bec054e228888c555f7b", "score": "0.61847156", "text": "function clicked(val) {\n // console.log(val.name)\n }", "title": "" }, { "docid": "636892c136d37d5f7bea1010f7b23460", "score": "0.6145544", "text": "function handleOpenNameEditor() {\n /* console.log('`handleOpenNameEditor` ran'); */\n $('ul').on('click', '.js-shopping-item', function() {\n // replace contents of <div> with output of `nameToInput`\n $(this).closest('.js-shopping-item-name').html(nameToInput($(this).text()));\n });\n}", "title": "" }, { "docid": "c724c12b8d75ec5e954141c5ce184846", "score": "0.61324376", "text": "function setChecklistName(id, name) {\n // update sidebar name\n var sidebarChecklist = getSidebarChecklist(id);\n $(sidebarChecklist).find('.checklist-name').text(name);\n\n // update open checklist\n var openChecklist = getOpenedChecklist(id);\n $(openChecklist).find('.card-header h4').text(name);\n}", "title": "" }, { "docid": "c72fcc1b69c619c2890ffb1d318aa77c", "score": "0.6128618", "text": "myClick(event)\n {\n let id = event.value;\n let name = CITIES[id].name;\n let index = CITIES[id].index;\n\n this.mvc.view.updateTitle(name);\n\n for(let i = 0; i< CITIES.length; i++)\n {\n if(id != i)\n {\n let link = \"https://skiplagged.com/flights/\" + index + \"/\" + CITIES[i].index ;\n let title = \"Flights from \" + name + \" to \" + CITIES[i].name;\n this.mvc.view.updateContent( title, link);\n }\n }\n\n }", "title": "" }, { "docid": "c29a5d84e2646a33169850647dce7e10", "score": "0.61190003", "text": "updateName(newName) {\n let element = this.getElement()\n element.name = newName\n this.name = newName\n }", "title": "" }, { "docid": "5cf9a7ad1cddf31e32182f0ed44b00d7", "score": "0.6074297", "text": "function addSongNameClickEvent(songObj,position) {\n var songName=songObj.fileName;\n var id = '#song' + position;\n $(id).click(function() {\n var audio = document.querySelector('audio');\n var currentSong = audio.src;\n if(currentSong.search(songName) != -1)\n {\n toggleSong();\n }\n else {\n audio.src = songName;\n toggleSong();\n changeCurrentSongDetails(songObj);\n }\n });\n }", "title": "" }, { "docid": "98cf8b5404e93af6876759639f6b6a57", "score": "0.60297084", "text": "function display(argument) {\n\t\t\t// body...\n\t\t\t// debugger;\n\t\t\tvar c=argument.parentNode.id;\n\t\t\t// console.log(c);\n\t\t\tdocument.getElementById(\"businessName\").value=c;\n\t\t}", "title": "" }, { "docid": "f6fc5dfe6b7d4eb1c92a395ed2b2dd02", "score": "0.6023781", "text": "function displayName(data) {\n var Name=data.id;\n console.log(data.id);\n $('p').html(Name);\n }", "title": "" }, { "docid": "3bcf6579082f0f82462860ef29ed6d4f", "score": "0.60225827", "text": "function addName(obj){\n\n let li = document.createElement(\"li\");\n for (let i = 0; i < slots.length; i++){\n let divSelect = document.querySelector(`#${slots[i]}`);\n if (obj.slot === slots[i]){\n li.setAttribute(\"id\", `name${obj.id}`)\n li.appendChild(document.createTextNode(`${obj.name}`))\n divSelect.appendChild(li);\n }\n }\n\n }", "title": "" }, { "docid": "b75a44d2ebad1123a605af6056c64a4d", "score": "0.6013397", "text": "function nameUnit() {\n\n\t\t\t$(\"#unit1_info\").html(\"<p>Name unit?</p><p><button class='btn btn-primary' id='manualName'>Yes</button> <button class='btn btn-primary' id='genRandom'>No; generate random</button>\");\n\n\t\t\t$(\"#manualName\").on(\"click\", function() {\n\t\t\t\t$(\"#unit1_info\").html(\"<p><input type='text' id='nameInput'></p><p><button class='btn btn-primary' id='submit'>Submit</button> <button class='btn btn-primary' id='genRandom'>Get random instead</button></p>\");\n\n\t\t\t\t$(\"#genRandom\").on(\"click\", function() {\n\t\t\t\t\tgetUnitsWithRandomNames();\n\t\t\t\t});\n\n\t\t\t\t$(\"#submit\").on(\"click\", function() {\n\t\t\t\t\tvar temp = $(\"#nameInput\").val();\n\t\t\t\t\tgetUnitsWithRandomNames(temp);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t$(\"#genRandom\").on(\"click\", function() {\n\t\t\t\tgetUnitsWithRandomNames();\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "630be2b872795ee35a8a1293947a0a22", "score": "0.60013056", "text": "function generateListener(elementName) {\n var inputCheckbox = document.getElementById(elementName + '-checkbox');\n inputCheckbox.addEventListener('click', function () {toggleCheckbox({element: inputCheckbox, newListItem: elementName + 'item', textToDisplay: elementName})});\n }", "title": "" }, { "docid": "4680dd7b807f44c69b87efcc780d911c", "score": "0.59913516", "text": "function setSampleName( sampleInfo ){\n $( \"#sampleId\" ).html( \"<p class='navbar-text'><b>Sample:</b> \"+sampleInfo.sampleName+\"</p>\" )\n}", "title": "" }, { "docid": "85205e25d881ad2ce19343ea508f9edc", "score": "0.5990366", "text": "function findTestByNameId(name, id) {\n $('.test').each(function () {\n var t = $(this);\n if (t.find('.test-name').text().trim() == name || t.attr('extentid') == id) {\n $('.analysis > .test-view').click();\n t.click();\n return;\n }\n });\n}", "title": "" }, { "docid": "755141ff9f73acd3909aa91731caea8c", "score": "0.59801847", "text": "function EnterNewTitle(_NameElement, _NameInput)\n{\n $(\"#\" + _NameElement.prop(\"id\")).hide();\n $(\"#\" + _NameInput.prop(\"id\")).show();\n\n _NameInput.val(_NameElement.html());\n _NameInput.focus();\n}", "title": "" }, { "docid": "9652cd43b7e998a5c5666d7f3ffd8b24", "score": "0.5978417", "text": "titleSelection() {\n const titleMrs = $('[id=\"id_gender2\"]');\n titleMrs.click();\n }", "title": "" }, { "docid": "f2577ebec38a78de67ad5c3862002863", "score": "0.59761626", "text": "function trailnameClick(e) {\n console.log(\"trailnameClick\");\n populateTrailsForTrailheadTrailName(e);\n }", "title": "" }, { "docid": "07bbc769004856b2cbc7d5906346db13", "score": "0.5975382", "text": "function setButtonClick(){\n $(\".individualTS\").each(function(){ \n var name = this.title\n this.addEventListener(\"click\", function(){\n displayLinks(name);\n }, false);\n });\n}", "title": "" }, { "docid": "18331cb61d61548f2f37a5d7f099754e", "score": "0.5959918", "text": "function FD_click(str_id) {\n\t$('[id$=\":' + str_id + '\"]').click();\n}", "title": "" }, { "docid": "597de9c3071c07daf86de2e309a11b2e", "score": "0.59592116", "text": "function click_tagnames(ev) {\n ev.preventDefault();\n var target = ev.target;\n var tag = target.innerText;\n if (!tag) return undefined;\n removetag(tag);\n\n force_rerender();\n showtags();\n}", "title": "" }, { "docid": "c52fd1bf4d9b0ff68a42637d1d468c82", "score": "0.5944082", "text": "function onClick(element) {\n id = element.id\n let movie_url = `${url}titles/${id}`\n getMovieData(movie_url)\n document.getElementById(\"modal\").style.display = \"block\";\n}", "title": "" }, { "docid": "87f1e06c599023bab7edd820184fb338", "score": "0.59335417", "text": "updateTitle(){\n this.title = document.getElementById(`name_${this.id}`).value;\n document.getElementById(`title_${this.id}`).innerHTML= `${this.title} (${this.id})`;\n }", "title": "" }, { "docid": "2d165e1a79f4cc774ab22121c76e796e", "score": "0.5929827", "text": "function showTheRenameDialog(id){\n var idBase = id.replace(/renameButton_/g, \"\");\n var titleId = \"titleCell_\" + idBase;\n var oldTitle = $(\"#\" + titleId).html();\n var item = {\n \"name\":oldTitle\n }\n var output = _.template(renameTemplate, {item:item});\n $(\"#contentOfDialog\").html(output);\n $(\"#dialogOk\").attr(\"onclick\", \"updateName('\" + id +\"');\");\n openDialog();\n}", "title": "" }, { "docid": "a614bcc195a71550e8b3079adda4553e", "score": "0.5928383", "text": "function SpiraSelectView(/**string*/ name)\n{\n\tvar xpath = \"//a[@title='\" + name + \"']\";\n\tvar obj = Navigator.SeSFind(xpath);\n\tif (obj)\n\t{\n\t\tobj.object_name = name;\n\t\tobj.DoClick();\n\t}\n\telse\n\t{\n\t\tTester.Assert(\"View button not found: \" + name, false);\n\t}\t\t\n}", "title": "" }, { "docid": "4f1bf88cda5af2f49371fd9b09b8c0bf", "score": "0.5924594", "text": "function navbarNameChanger(name){\n document.getElementById('s-navbar-title').innerHTML=name;\n}", "title": "" }, { "docid": "6f44acfe00cf93ab9e2e7f915d710fed", "score": "0.5918706", "text": "function hisName(){\n \tdocument.getElementById(\"Bruce\").innerHTML = \"My name is Lee, Brrruuuce Lee!\";\n }", "title": "" }, { "docid": "76ececc0f764ac8afbaf187e7ed11b55", "score": "0.591646", "text": "function myFunction() {\n let x = document.getElementById(\"myBtn\").\n attributes[0].name;\n // luu tru thuoc tinh dau tien cua the co #myBtn\n document.getElementById(\"demo\").innerHTML = x;\n\n}", "title": "" }, { "docid": "0815ec53d7a5b61e30ec66cc6f032b24", "score": "0.5890299", "text": "function appendNameTag(el) {\n\t\t\tel.children('.chnr_name_tag').remove();\n\t\t\tel.append('<span class=\"chnr_name_tag\">(' + localStorage['chnr_name_list_' + el.attr('title')] + ')</span>');\n\t\t}", "title": "" }, { "docid": "13cde30b1f3d8156eccd979204709009", "score": "0.5881439", "text": "function clickMe() {\n if (this.textContent === 'Reddit') {\n updateName('Reddit')\n loadRSS('https://www.reddit.com/top.json', redditDataProcessor)\n } else if (this.textContent === 'Mashable') {\n updateName('Mashable')\n loadRSS('https://crossorigin.me/http://mashable.com/stories.json', mashableDataProcessor)\n } else if (this.textContent === 'The New York Times') {\n updateName('The New York Times')\n loadRSS('https://api.nytimes.com/svc/topstories/v2/home.json?api-key=292be8f89bfb4a96921390a6946d011a', nytDataProcessor)\n }\n }", "title": "" }, { "docid": "4c4558145d484184c690cc4f79e06ccb", "score": "0.5879431", "text": "function addSongNameClickEvent(songObj,position) {\n\tvar songName = songObj.fileName;\n var id = '#song' + position;\n$(id).click(function() {\nvar audio = document.querySelector('audio');\nvar currentSong = audio.src;\nif(currentSong.search(songName) != -1)\n{\ntoggleSong();\n}\nelse {\naudio.src = songName;\ntoggleSong();\nchangeCurrentSongDetails(songObj);\n}\n});\n}", "title": "" }, { "docid": "3c98e97517dc2c68a828a049b3f777b3", "score": "0.587384", "text": "function setEventHandlers(id, name) {\n $('#pin' + id)\n .click(() => {\n var top = $('#list').scrollTop() + $('#div' + id).position().top;\n $('#list').animate({ scrollTop: top }, () => {\n $('#div' + id).fadeOut().fadeIn();\n });\n })\n .attr('data-toggle', 'tooltip')\n .attr('title', name)\n .tooltip();\n}", "title": "" }, { "docid": "7c108ffca43f3827ddbde628f4289b13", "score": "0.58718544", "text": "function onChangeNameClick(ev, id) {\n showMessage();\n let newCountryName = $(ev.target).prev().val();\n $.ajax({\n method: 'PUT',\n url: baseUrl + 'countries/' + id,\n headers: {\n Authorization: authString\n },\n data: {\n countryName: newCountryName\n },\n success: onListAllCountriesClick\n });\n }", "title": "" }, { "docid": "f159d2af51e40b1240635c463bce5195", "score": "0.58666134", "text": "_renderCardName() {\n let element = this.sRoot.querySelector(\".name\");\n if (!element) return;\n element.textContent = this.dataset.name;\n }", "title": "" }, { "docid": "d0113c5b572afe9611e20b5385b59374", "score": "0.5864232", "text": "function addSongNameClickEvent(songObj,position) {\n var songName = songObj.fileName; // New Variable \n var id = '#song' + position;\n $(id).click(function() {\n var audio = document.querySelector('audio');\n var currentSong = audio.src;\n if(currentSong.search(songName) != -1)\n {\n toggleSong();\n }\n else {\n audio.src = songName;\n toggleSong();\n changeCurrentSongDetails(songObj); // Function Call\n }\n });\n}", "title": "" }, { "docid": "2e4315ae28d6859b44041cd05309563c", "score": "0.58412963", "text": "function merchClick(){\n var mItem = $(this).attr('name')\n displayModal(mItem);\n }", "title": "" }, { "docid": "2cdce1f9f235c5bc802b73fad8a590be", "score": "0.58306617", "text": "function ChangeTitle(_NameElement, _NameInput)\n{\n _NameElement.html(_NameInput.val());\n\n $(\"#\" + _NameElement.prop(\"id\")).show();\n $(\"#\" + _NameInput.prop(\"id\")).hide();\n\n SaveGrid();\n}", "title": "" }, { "docid": "1ca448d636b3bc48fe783fde27dcddde", "score": "0.58296573", "text": "function logedIconName(name) {\n\tlet userBtn = document.querySelector('#userBtn span');\n\tuserBtn.classList.add('p-3');\n\tuserBtn.textContent = name.toUpperCase();\n}", "title": "" }, { "docid": "afffc18249035ad78cc6a02c7ff83f1f", "score": "0.5825079", "text": "function SayMyName2 (yourName){\n document.getElementById(\"someText\").innerHTML = \"Hello \" + yourName;\n }", "title": "" }, { "docid": "7c5073a45b81ce02170541243103e836", "score": "0.5823304", "text": "handleRename(){\n document.getElementById('span_'+this.props.file.id).style.display = \"none\"\n const input = document.getElementById('input_'+this.props.file.id)\n input.style.display = \"inline\"\n input.focus();\n }", "title": "" }, { "docid": "9517aef1cfe510579cde4dcdabc31426", "score": "0.58221155", "text": "get name() {\n\t\treturn this._element.name;\n\t}", "title": "" }, { "docid": "ca3a2e06baea89c7ab1f1cc3cbb974d2", "score": "0.58185077", "text": "function setGroupName(group){\n const div=document.getElementById('group-name');\n div.innerText=group;\n}", "title": "" }, { "docid": "51cf47b6debb69bd53c53c06f6937b6f", "score": "0.5814863", "text": "function newClickMe() {\r\n alert(this.name + \"has been clicked\");\r\n}", "title": "" }, { "docid": "9aaff0fc1dbd1cadcc09f4a835643c30", "score": "0.5814345", "text": "_onClick(event){\n const name=event.target.name;\n this._onClickByName(name);\n }", "title": "" }, { "docid": "e7bd35d4593741c0945e36153730dd8a", "score": "0.58104503", "text": "function nameClick() {\n const selfie = document.getElementById(\"title\");\n\n function clickAlert() {\n alert('That\\'s my name, don\\'t wear it out');\n }\n \n selfie.addEventListener('click', clickAlert);\n}", "title": "" }, { "docid": "379df94b6054d860a0bba9e1bd5fc7c2", "score": "0.5809416", "text": "function elementName(x){\n var elementName = document.getElementById(x);\n return elementName; \n }", "title": "" }, { "docid": "379df94b6054d860a0bba9e1bd5fc7c2", "score": "0.5809416", "text": "function elementName(x){\n var elementName = document.getElementById(x);\n return elementName; \n }", "title": "" }, { "docid": "2f248adca74b3bb344e3d73b060bfa09", "score": "0.58043236", "text": "saveCard() {\n // get card Id from event\n let cardId = event.target.id.split(\"--\")[1];\n let category = event.path[1].id.split(\"--\")[0]\n let cardToSave = document.querySelector(`#${category}--${cardId} > #name`).textContent;\n results.addToItinerary(cardToSave, category)\n}", "title": "" }, { "docid": "bbae3aec7e95c9451c38d074ac94b7ae", "score": "0.5802994", "text": "function showInfoId(clicked_id){\n\tvar getId=clicked_id;\n\tnn = getId.substr(getId.length - 1);\n\tvar desc = $('#siteLanguage'+nn).html();\n\topenMoreInfo();\n\t$('.moreInfoText').html('<div class=\"schlProfile\"></div>'+'<h19>'+desc+'</h19>'+'<h16>Attention</h16>'+'<h19>'+desc+'</h19>');\n}", "title": "" }, { "docid": "2def9ee2bc9872cc232313355aa757f6", "score": "0.5797604", "text": "function updateName(name) {\n switcherName.innerHTML = name;\n }", "title": "" }, { "docid": "dbcbaaa680769bc56bbed1fb5b9a1fd6", "score": "0.57961017", "text": "function setTitle(id) {\n const titleName = document.getElementById('titleName');\n const listObj = gameList[id];\n document.getElementById('gameName').value = listObj.longName;\n document.getElementById('gameID').value = listObj.clientAppID;\n document.getElementById('updateStatus').disabled = false;\n titleName.value = id;\n titleName.innerHTML = '<i class=\"fas fa-check\"></i>&nbsp;&nbsp;Game selected ';\n}", "title": "" }, { "docid": "a71c5f32656895ddd9875320bf6f9364", "score": "0.5795918", "text": "function locate(name){\n var cmd = \"\\<Locate target='\" + name + \"'/>\";\n selectedModel = bridgeworks.registry.find(name); //Sets the selectedModel to whatever the name is of the model you click in the list.\n setColorPicker();\n console.log(cmd);\n bridgeworks.updateScene(cmd);\n setObject(name);\n}", "title": "" }, { "docid": "3fd251dd0adeb916c28e834ab2ca45c1", "score": "0.5783511", "text": "function displayNamePlayer(i, name){\n $('#player_name_'+i).text(name);\n}", "title": "" }, { "docid": "129423180de9e514fc53adb2165164c1", "score": "0.5766987", "text": "function modifyNameText(identifier){\n let targetElement = document.querySelectorAll('.comments__comment-text__name');\n console.log(targetElement);\n for (let i = 0; i < targetElement.length; i++){\n targetElement[i].innerText = obj[i].name;\n }\n }", "title": "" }, { "docid": "4d298aa975e33fdd3e73e2b0f8ce9b07", "score": "0.5760286", "text": "function textName(name) {\n document.title = \"_bibleinfo:::\"+name;\n}", "title": "" }, { "docid": "c6e26dba630d6b7a8ec1894697c85abe", "score": "0.57555366", "text": "function selectById(id) {\n $(\".pw-slide#\" + id.toString()).click();\n }", "title": "" }, { "docid": "8ba8db9854e9e05ca95c279fbbf90560", "score": "0.5754047", "text": "function handleNameChange(e) {\n currentTeam.name = e.target.value;\n document.title = \"Team Maker - \".concat(currentTeam.name);\n }", "title": "" }, { "docid": "6fdf4b5c57afda3baf38ee2e1108682d", "score": "0.57515806", "text": "function clickElementByID(id){\r\n document.getElementById(id).click();\r\n}", "title": "" }, { "docid": "19794cdd3d12aceede0cc7f96b34e433", "score": "0.5743779", "text": "static dropDownSelect(clickedElement, id) {\n let selection = Utils.getChildsWithClassName(document.getElementById(id), \"dropdown-selection\")[0];\n selection.innerHTML = clickedElement.innerHTML;\n }", "title": "" }, { "docid": "0545b5fcea4bccd5914e283d1072a570", "score": "0.5723571", "text": "\"click #editPlayer\" (event){\n event.preventDefault();\n Session.set(NB_ACTIVE_ELEMENT_KEY, _getUserNbFromLink($(event.target).parent()));\n Session.set(PLAYERS_ACTIVE_ELEMENT_KEY, EDIT_PLAYER_ACTIVE_TEMPLATE_NAME);\n\n }", "title": "" }, { "docid": "7383e65d582d47235646a6bd7ef42ffd", "score": "0.57219577", "text": "_changeName () {\n this.sections.addEventListener('input', event => {\n if (event.target.classList.contains('section__name')) {\n this._temporaryName = event.target.innerHTML\n }\n })\n }", "title": "" }, { "docid": "1d85ed9e36c343d0754078f42699123c", "score": "0.570939", "text": "get nameElement() {\n return this.targets.find(\"name\");\n }", "title": "" }, { "docid": "71df03d8532f6beb05b5c498e1988148", "score": "0.5707831", "text": "function handleStateClick(e) {\n var target = e.target\n var display = document.getElementById('display')\n display.innerHTML = target.dataset.name\n}", "title": "" }, { "docid": "40315d76576687f4f7cb71a4c013ca22", "score": "0.5707766", "text": "function nameEvent() {\n\tif(isNamePresent()) {\n\t\t$fullName.next().hide();\n\t} else {\n\t\t$fullName.next().fadeIn(\"fast\");\n\t}\n}", "title": "" }, { "docid": "c95e900359fe2db84210959b6477a767", "score": "0.5694051", "text": "function getName(){\r\n\tlet BotName = document.getElementById(\"name\");\r\n\t//show the form\r\n\tBotName.classList.remove(\"hidden\");\r\n\tBotName.classList.add(\"EnterName\");\r\n}", "title": "" }, { "docid": "81aa85508e47806ac97d07e3465f0b6d", "score": "0.5693272", "text": "addPhotographerName() {\n let myTitle = document.createElement('h2')\n let myName = document.createElement('h2')\n\n myTitle.textContent = \"Contactez-moi\"\n myName.textContent = this.name\n\n modal.prepend(myName)\n modal.prepend(myTitle) \n }", "title": "" }, { "docid": "92fc5fd72e4c0d93b5d51d6808d2379d", "score": "0.56920594", "text": "function setId(elem, text){\n elem.id = text;\n return elem;\n}", "title": "" }, { "docid": "927da73b81288b8cc1c0b4894f040949", "score": "0.56911266", "text": "function triggerAMouseEvent(idName)\n{\n // keep \"bubbles\" true... required\n var event = new MouseEvent('click', { 'view': window,'bubbles': true,'cancelable': false });\n document.getElementById(idName).dispatchEvent(event);\n}", "title": "" }, { "docid": "93fd2fd1879e099db429899587340244", "score": "0.5684749", "text": "function getNameWithoutUser(name) {\n\tdocument.getElementById(\"apended-name\").innerText = name;\n\tsecondPartAnimation();\n}", "title": "" }, { "docid": "9b9e9185185cf57a15d31dc9a07d7804", "score": "0.5679321", "text": "function getName(elem) {\n return elem.name;\n}", "title": "" }, { "docid": "e7636ad26f47b5e5250d6955fafbc0c3", "score": "0.5679233", "text": "setName(title = this.title) { $(\"#rec_list_title_text\").text(title); }", "title": "" }, { "docid": "8350b65e949398e6e1a12ba78de4b692", "score": "0.56771404", "text": "function getName(elem) {\n return elem.name;\n}", "title": "" }, { "docid": "8350b65e949398e6e1a12ba78de4b692", "score": "0.56771404", "text": "function getName(elem) {\n return elem.name;\n}", "title": "" }, { "docid": "8350b65e949398e6e1a12ba78de4b692", "score": "0.56771404", "text": "function getName(elem) {\n return elem.name;\n}", "title": "" }, { "docid": "8350b65e949398e6e1a12ba78de4b692", "score": "0.56771404", "text": "function getName(elem) {\n return elem.name;\n}", "title": "" }, { "docid": "8350b65e949398e6e1a12ba78de4b692", "score": "0.56771404", "text": "function getName(elem) {\n return elem.name;\n}", "title": "" }, { "docid": "8350b65e949398e6e1a12ba78de4b692", "score": "0.56771404", "text": "function getName(elem) {\n return elem.name;\n}", "title": "" }, { "docid": "8350b65e949398e6e1a12ba78de4b692", "score": "0.56771404", "text": "function getName(elem) {\n return elem.name;\n}", "title": "" }, { "docid": "5ad76eb1511eda228322bc1e0cc475fc", "score": "0.5673569", "text": "function updateName(name) {\n\n if (currentDiv == \"#div2\") {\n previousName1 = document.getElementById(\"t1\").firstChild.data;\n document.getElementById(\"t1\").firstChild.data = name;\n } else if (currentDiv == \"#div3\") {\n previousName2 = document.getElementById(\"t2\").firstChild.data;\n document.getElementById(\"t2\").firstChild.data = name;\n }\n}", "title": "" }, { "docid": "1af7539278e9719a834c7ed579c0994d", "score": "0.5670409", "text": "function instructionFive(){\n let btn = $('<button>Show My Name</button>');\n let aDiv = $('<div></div>');\n aDiv.css({background: 'goldenrod', 'textAlign': 'center'});\n $('#instructionFive').after(btn);\n btn.after(aDiv);\n btn.click(function (){\n let myNameSpan = $('<span>Jonathan</span>');\n aDiv.append(myNameSpan);\n });\n}", "title": "" }, { "docid": "e0e427c8b1289f0fee60e986e4712241", "score": "0.5668477", "text": "function populateNameHeader(name_id, specialty_id , name_data, specialty_data)\n{\n document.getElementById(name_id).innerHTML = name_data;\n document.getElementById(specialty_id).innerHTML = specialty_data;\n}", "title": "" }, { "docid": "d927a078517cfb8850015150dceacd7a", "score": "0.5663516", "text": "function setUeberschrift(name) {\n let subName = name.substr(0, name.length - 5);\n document.querySelector(\"#model\").innerHTML = subName;\n setFocus(name);\n}", "title": "" }, { "docid": "6d3e7c9e70cbb95f22adc5e190698d6f", "score": "0.56606054", "text": "function switchItem(itemName) {\n\tlet itemTitle = document.getElementById('modalTitle');\n\titemTitle.innerHTML = itemName;\n}", "title": "" }, { "docid": "c4682c6dad0e383b1e8e0d40e6c598b5", "score": "0.5656058", "text": "function displayData(name) {\n element(\"search-data\").innerHTML = \"<p>\" + name + \"</p>\";\n hideSearchResults();\n }", "title": "" }, { "docid": "3343e99f0c05a541f8ff6646c7a3fd56", "score": "0.56553435", "text": "function textOnClick () {\n\n // getting id of text\n let thisText = this.getAttribute(\"id\")\n\n // getting the id of the respective header\n let thistextTitleId = thisText[4];\n let titleIn = document.getElementById(parseInt(thistextTitleId))\n\n if (thisText.innerHTML != \"\") {\n this.innerHTML = \"\";\n titleIn.innerHTML = headings[parseInt(thistextTitleId)];\n }\n}", "title": "" }, { "docid": "6a8228dec571f97457ebc2b52319db37", "score": "0.56521606", "text": "function showAllDogs(dog){\n\nlet dogSpan = document.createElement('span')\ndogSpan.id = dog.id\ndogSpan.innerText = dog.name\ndogBar.appendChild(dogSpan)\ndogSpan.addEventListener(\"click\", (e) => showDog(dog))\n\n}", "title": "" }, { "docid": "e384436610f21a26c6c8a0289e9494af", "score": "0.56497", "text": "function updatePreviewSpan(element) {\n var preview = document.getElementById(\"name-span\");\n var letterLabels = document.getElementsByClassName('slider-label');\n var name = \"\";\n\n for (let i = 0; i < letterLabels.length; i++) {\n let letter = letterLabels[i].innerText;\n name = name + letter;\n }\n\n preview.innerText = name;\n}", "title": "" }, { "docid": "b2babe6585415c5b2c4904ad8263ba18", "score": "0.5649214", "text": "function getName(elem) {\n\t return elem.name;\n\t}", "title": "" }, { "docid": "11fe1f14e58da34f927e401080053839", "score": "0.5648278", "text": "function genTitleDom(name) {\r\n var title = c$('div').appendTo(popupElt.content).css({\r\n 'margin-top': 10,\r\n 'border-bottom': '1px solid rgb(85, 85, 85)',\r\n 'text-align': 'left'\r\n });\r\n c$('span').css('margin-left', 20).text(name).appendTo(title);\r\n \r\n // name is used for id reference now, so lower case it\r\n name = name.toLowerCase();\r\n \r\n // checkbox div for show craftable only\r\n c$('div').appendTo(title).css({\r\n 'float': 'right',\r\n 'margin-right': 15\r\n }).append(\r\n $('<input type=\"checkbox\" id=\"showcraftable_'+name+'\">')\r\n // onclick checkbox fires it, if checked hide no craftable items.\r\n .click(function() {\r\n var name = this.id.match(/showcraftable_(.+)/)[1];\r\n if (this.checked) {\r\n $('div[id^=' + name + '_list_item_]').each(function(index, domElement) {\r\n if (/<a\\shref=\"http/.test(crafts[name][domElement.id].button)) \r\n $(domElement).show();\r\n else \r\n $(domElement).hide();\r\n });\r\n \r\n }\r\n else\r\n $('div[id^='+name+'_list_item_]').show(); \r\n })\r\n ).append(c$('label').text('Show Craftable Only.').attr('for', 'showcraftable_'+name));\r\n \r\n // add ajax loader while it's first load.\r\n c$('div', name+'_div').height(120).appendTo(popupElt.content)\r\n .append(c$('img').attr('src', global.resource.ajax_loader)).css('padding', 10);\r\n }", "title": "" }, { "docid": "dce725dd2a0a98495d6b3e757f80a25f", "score": "0.56445074", "text": "function namein() {\n\tvar name = input2.value();\n\n\tvar data = {\n\t\tid: blob.id,\n\t\tname: name\n\t};\n\n\tsocket.emit('name', data);\n\tbutton2.hide();\n\tinput2.hide();\n\n\tbutton3 = createButton('Rename Character');\n\tbutton3.position((resolutionW*(0.7/20)), (resolutionH*(0.7/20)));\n\tbutton3.mousePressed(rename);\n}", "title": "" }, { "docid": "ee5c8011e910b234be5aeb39cee391f3", "score": "0.56348467", "text": "function zid(e){return document.getElementById(e)}", "title": "" }, { "docid": "ee5c8011e910b234be5aeb39cee391f3", "score": "0.56348467", "text": "function zid(e){return document.getElementById(e)}", "title": "" } ]
c42e68828dc938a23081cc4e740798d0
T U E 100 200 REST PARAMS use 'rest params' as array. SPREAD SYNTAX use nnumber of FIRST PARAMS as array.
[ { "docid": "70f929b44ddefe63c155661e7a0d35c2", "score": "0.5099933", "text": "function spreadAndRestParams(firstChar, secondChar, ...lastArray) {\n console.log(firstChar, secondChar, lastArray);\n}", "title": "" } ]
[ { "docid": "59b8c6915d5edbb975387d15ffb79e29", "score": "0.69667065", "text": "function restParams5(...rest) {\n return rest[5]; // CHANGE ME\n}", "title": "" }, { "docid": "57f43cf2df029d3b9b6f5a136c1af03a", "score": "0.6378944", "text": "function restParam(param1, param2, ...restParams) {\n // arguments is just like called\n}", "title": "" }, { "docid": "8f91f203c23a52e5625242c08a62d81f", "score": "0.62949425", "text": "function test_rest(object, ...rest_params){\n\tlet result = Object.create(null);\n\tconsole.log(rest_params.length)\n\n\tfor(let i=0;i<rest_params.length;i++){\n\t\tresult[rest_params[i]] = object[rest_params[i]];\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "df6eb3791d4a186e1eeba909744ff887", "score": "0.6174048", "text": "function miListaREST(a, b, ...otherElements){\n console.log(\"REST-ES6\"); \n console.log(\"a=\"+a);\n console.log(\"b=\"+b);\n console.log(\"All elemets list: \", otherElements); \n console.log(\"Tamaño: \"+otherElements.length);\n console.log(otherElements[2]);\n}", "title": "" }, { "docid": "b54d53f17b25d4949bb45c087058dfba", "score": "0.60411966", "text": "function parameterRest(...args) {\r\n console.log('Args: ', args);\r\n console.log('args[0]: ', args[0]);\r\n console.log('args[1]: ', args[1]);\r\n}", "title": "" }, { "docid": "3fe738d47496f27bf7be221130e33f30", "score": "0.60172063", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex\n return function() {\n var length = Math.max(arguments.length - startIndex, 0)\n var rest = Array(length)\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex]\n }\n switch (startIndex) {\n case 0:\n return func.call(this, rest)\n case 1:\n return func.call(this, arguments[0], rest)\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n }\n }", "title": "" }, { "docid": "b196ba4f796c330cae0fb56d364823fc", "score": "0.5951208", "text": "function _restParam(func,startIndex){startIndex=startIndex==null?func.length-1:+startIndex;return function(){var length=Math.max(arguments.length-startIndex,0);var rest=Array(length);for(var index=0;index<length;index++){rest[index]=arguments[index+startIndex];}switch(startIndex){case 0:return func.call(this,rest);case 1:return func.call(this,arguments[0],rest);}// Currently unused but handle cases outside of the switch statement:\n// var args = Array(startIndex + 1);\n// for (index = 0; index < startIndex; index++) {\n// args[index] = arguments[index];\n// }\n// args[startIndex] = rest;\n// return func.apply(this, args);\n};}", "title": "" }, { "docid": "151ab93f4047c717903af290dd439a4d", "score": "0.5947594", "text": "function add(...rest_params) {return rest_params.reduce((i, n) => {return i + n})}", "title": "" }, { "docid": "538c456b7740f1eee01282dec4f5c733", "score": "0.5928135", "text": "function _restParam(func, startIndex) {\n\t startIndex = startIndex == null ? func.length - 1 : +startIndex;\n\t return function() {\n\t var length = Math.max(arguments.length - startIndex, 0);\n\t var rest = Array(length);\n\t for (var index = 0; index < length; index++) {\n\t rest[index] = arguments[index + startIndex];\n\t }\n\t switch (startIndex) {\n\t case 0: return func.call(this, rest);\n\t case 1: return func.call(this, arguments[0], rest);\n\t }\n\t // Currently unused but handle cases outside of the switch statement:\n\t // var args = Array(startIndex + 1);\n\t // for (index = 0; index < startIndex; index++) {\n\t // args[index] = arguments[index];\n\t // }\n\t // args[startIndex] = rest;\n\t // return func.apply(this, args);\n\t };\n\t }", "title": "" }, { "docid": "538c456b7740f1eee01282dec4f5c733", "score": "0.5928135", "text": "function _restParam(func, startIndex) {\n\t startIndex = startIndex == null ? func.length - 1 : +startIndex;\n\t return function() {\n\t var length = Math.max(arguments.length - startIndex, 0);\n\t var rest = Array(length);\n\t for (var index = 0; index < length; index++) {\n\t rest[index] = arguments[index + startIndex];\n\t }\n\t switch (startIndex) {\n\t case 0: return func.call(this, rest);\n\t case 1: return func.call(this, arguments[0], rest);\n\t }\n\t // Currently unused but handle cases outside of the switch statement:\n\t // var args = Array(startIndex + 1);\n\t // for (index = 0; index < startIndex; index++) {\n\t // args[index] = arguments[index];\n\t // }\n\t // args[startIndex] = rest;\n\t // return func.apply(this, args);\n\t };\n\t }", "title": "" }, { "docid": "538c456b7740f1eee01282dec4f5c733", "score": "0.5928135", "text": "function _restParam(func, startIndex) {\n\t startIndex = startIndex == null ? func.length - 1 : +startIndex;\n\t return function() {\n\t var length = Math.max(arguments.length - startIndex, 0);\n\t var rest = Array(length);\n\t for (var index = 0; index < length; index++) {\n\t rest[index] = arguments[index + startIndex];\n\t }\n\t switch (startIndex) {\n\t case 0: return func.call(this, rest);\n\t case 1: return func.call(this, arguments[0], rest);\n\t }\n\t // Currently unused but handle cases outside of the switch statement:\n\t // var args = Array(startIndex + 1);\n\t // for (index = 0; index < startIndex; index++) {\n\t // args[index] = arguments[index];\n\t // }\n\t // args[startIndex] = rest;\n\t // return func.apply(this, args);\n\t };\n\t }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.59167117", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.59167117", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.59167117", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.59167117", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.59167117", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.59167117", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.59167117", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.59167117", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.59167117", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.59167117", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.59167117", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.59167117", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.59167117", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.59167117", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.59167117", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.59167117", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.59167117", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.59167117", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.59167117", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.59167117", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.59167117", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "a4994fe1da55f1dee5cc461d9a737b16", "score": "0.5905643", "text": "restParams(...data){\n return data.length;\n }", "title": "" }, { "docid": "c56ccef0256012ae610d41da374d56cb", "score": "0.58936834", "text": "function restParams4(...rest) {\n // console.log(rest);\n return rest[0] === \"first\" && rest[1] === \"second\" && rest[2] === \"third\"; // CHANGE ME\n}", "title": "" }, { "docid": "c2a884133bce141851df7d20066b6534", "score": "0.58494556", "text": "function rest(...args) { //Actual array, and allows for acceptance of any number of values for iteration\n return args;\n}", "title": "" }, { "docid": "6fe4e2b3554da410374fa596d73e66d6", "score": "0.5847245", "text": "function restParameterDemo() {\n function foo(a, b, ...c) {\n log(`a = ${a}. typeof a = ${typeof a}`);\n log(`b = ${b}. typeof b = ${typeof b}`);\n log(`c = ${c}. typeof c = ${typeof c}`);\n }\n\n foo();\n foo(1);\n foo(1, 2);\n foo(1, 2, 3);\n foo(1, 2, 3, 4);\n}", "title": "" }, { "docid": "9087166d86afb7246fba1b338fabd75c", "score": "0.57453144", "text": "function restParams(x, ...y) {\n console.log( x * y.length );\n}", "title": "" }, { "docid": "fc4a31770744b1d3c3a7b4ba489cc23c", "score": "0.5672786", "text": "function agrsRestParams(a,...x) {\n console.log(`args length ${arguments.length} , x.length ${x.length}`);\n //console.log(arguments);\n //console.log(arguments.length===x.length)\n }", "title": "" }, { "docid": "8da23897eac617eed8da5060321db457", "score": "0.55752534", "text": "function checkParams(req, res, resource, paramsCount, callback) {\n var params = [];\n for (var i = 0; i < paramsCount; i++) {\n var param = req.params[resource.ids[i]];\n if (!param) {\n return common.handleNoParam(res, resource.ids[i]);\n }\n params.push(param);\n }\n callback(params);\n }", "title": "" }, { "docid": "b7f91247f5917e872aa2c4eac2cb5e16", "score": "0.5488962", "text": "function restParams2(first, ...rest) {\n // console.log(first, rest);\n return first === \"first\" && rest[0] === \"second\" && rest[1] === \"third\";\n}", "title": "" }, { "docid": "9b47989cf613f58f85a7ff39e92a20ed", "score": "0.5453802", "text": "static get params () {\n return [\n 'all',\n 'json',\n 'long',\n 'parseable',\n 'global',\n 'workspace',\n ]\n }", "title": "" }, { "docid": "54d1dc44ec0058c5054c85bc59850524", "score": "0.5369017", "text": "function restParams3(first, ...rest) {\n return (\n first === \"first\" &&\n rest[0] === \"second\" &&\n rest[1] === \"third\" &&\n rest[2] === undefined\n );\n }", "title": "" }, { "docid": "fe9d08a69de2286edf3ae84b622c6dec", "score": "0.53256154", "text": "function testRest(arg1, arg2, ...otherArgs) {\r\n console.log(arg1); // 1\r\n console.log(arg2); // 2\r\n console.log(otherArgs); // [3, 4, 5]\r\n}", "title": "" }, { "docid": "cc733fdf09e132094d1c218a60e32850", "score": "0.5316059", "text": "function rest(...tstArr) {\n console.log(tstArr[5]);\n}", "title": "" }, { "docid": "0250094600a882a3c4d13a64eca415ce", "score": "0.527778", "text": "function makeParams(count) {\n var answer = [];\n for (var i = 0; i < count; i++) {\n answer.push('p' + i);\n }\n return answer;\n }", "title": "" }, { "docid": "7194a17c68173cae59da263e38742dd2", "score": "0.52573955", "text": "function formatRequest(type, params) {\n if(type === \"list\") {\n if(params) {\n return API_URL + '?api_key=' + config.API_KEY + params + '&limit=100'\n } else {\n return API_URL + '?api_key=' + config.API_KEY + '&limit=100'\n }\n } else {\n return API_URL + params + '?api_key=' + config.API_KEY\n }\n}", "title": "" }, { "docid": "b8810e92461de02437401293534ca22f", "score": "0.52218276", "text": "getParams(paramArray = []) {\n let params = {}\n paramArray.forEach(paramName => {\n params[paramName] = this.getParam(paramName)\n })\n return params\n }", "title": "" }, { "docid": "88f9d458518240f98251ab4e5551cc7b", "score": "0.51944596", "text": "rpc(fn, params, { count = null } = {}) {\n const rest = this._initPostgRESTClient();\n return rest.rpc(fn, params, { count });\n }", "title": "" }, { "docid": "0ce0299126bf94af69b3274f4a33e884", "score": "0.51859725", "text": "function server_params() {\n var params = {};\n parameters.forEach(function(p) {\n if (p.key == 'page') {\n params.start = (parameter('page').value - 1) * parameter('per_page').value;\n } else if (p.key == 'per_page') {\n // Some views use `range` to mean `per_page` and some use\n // `numResults`. So emit both.\n params.range = parameter('per_page').value;\n params.numResults = parameter('per_page').value;\n } else {\n params[p.key] = p.value;\n }\n });\n return params;\n }", "title": "" }, { "docid": "c7fb3dd98781a6ec6bc230861e4ba036", "score": "0.5182834", "text": "function queryParamsToRestQueryStringParameters(queryParams) {\n const qs = {};\n\n if (queryParams.isDefault()) {\n return qs;\n }\n\n let orderBy;\n\n if (queryParams.index_ === PRIORITY_INDEX) {\n orderBy = \"$priority\"\n /* PRIORITY_INDEX */\n ;\n } else if (queryParams.index_ === VALUE_INDEX) {\n orderBy = \"$value\"\n /* VALUE_INDEX */\n ;\n } else if (queryParams.index_ === KEY_INDEX) {\n orderBy = \"$key\"\n /* KEY_INDEX */\n ;\n } else {\n (0, _util.assert)(queryParams.index_ instanceof PathIndex, 'Unrecognized index type!');\n orderBy = queryParams.index_.toString();\n }\n\n qs[\"orderBy\"\n /* ORDER_BY */\n ] = (0, _util.stringify)(orderBy);\n\n if (queryParams.startSet_) {\n qs[\"startAt\"\n /* START_AT */\n ] = (0, _util.stringify)(queryParams.indexStartValue_);\n\n if (queryParams.startNameSet_) {\n qs[\"startAt\"\n /* START_AT */\n ] += ',' + (0, _util.stringify)(queryParams.indexStartName_);\n }\n }\n\n if (queryParams.endSet_) {\n qs[\"endAt\"\n /* END_AT */\n ] = (0, _util.stringify)(queryParams.indexEndValue_);\n\n if (queryParams.endNameSet_) {\n qs[\"endAt\"\n /* END_AT */\n ] += ',' + (0, _util.stringify)(queryParams.indexEndName_);\n }\n }\n\n if (queryParams.limitSet_) {\n if (queryParams.isViewFromLeft()) {\n qs[\"limitToFirst\"\n /* LIMIT_TO_FIRST */\n ] = queryParams.limit_;\n } else {\n qs[\"limitToLast\"\n /* LIMIT_TO_LAST */\n ] = queryParams.limit_;\n }\n }\n\n return qs;\n}", "title": "" }, { "docid": "474336f74e3444687c02ce82324321ae", "score": "0.51820153", "text": "async function n(n,m,a){m=_tasks_support_LengthsParameters_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].from(m);const p=Object(_tasks_operations_lengths_js__WEBPACK_IMPORTED_MODULE_2__[\"lengthsToRESTParameters\"])(m),f=Object(_utils_js__WEBPACK_IMPORTED_MODULE_1__[\"parseUrl\"])(n),i={...f.query,f:\"json\",...p},u=Object(_utils_js__WEBPACK_IMPORTED_MODULE_1__[\"asValidOptions\"])(i,a);return Object(_request_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(f.path+\"/lengths\",u).then((({data:t})=>t))}", "title": "" }, { "docid": "3ed58febcb5c8bef7e57671b7379abb4", "score": "0.51751924", "text": "getParams() {}", "title": "" }, { "docid": "d9dffd09d34c232025f24c034c40a308", "score": "0.5153995", "text": "function listadoFrutas(fruta1, fruta2,...resto_de_furtas){ // ... es el parametro REST. se usa delante del parametro opcional\n // para mostrar el resto de los elementos (coco, melon, pera)\n console.log(\"Fruta 1 es: \" + fruta1);\n console.log(\"Fruta 2 es: \" + fruta2);\n console.log(resto_de_furtas);\n\n}", "title": "" }, { "docid": "0023ddd3a95d935aba9b2fb973f67c59", "score": "0.5094191", "text": "function restFunction(...args) {\n const p1 = args[0];\n const p2 = args[1];\n const p3 = args[2];\n // Code\n }", "title": "" }, { "docid": "a3ae3b16151072267ead5338d9fec173", "score": "0.5086777", "text": "function findParameters(state) {\n // https://github.com/octokit/routes/issues/332\n if (state.gheVersion && state.gheVersion <= 2.15) {\n const param = {\n name: \"labels\",\n type: \"string\",\n required: true,\n description: \"labels parameter\",\n location: \"body\"\n };\n Object.assign(PARAMETERS_TO_INPUT, {\n \"PUT /repos/:owner/:repo/issues/:issue_number/labels\": param,\n \"POST /repos/:owner/:repo/issues/:issue_number/labels\": param\n });\n }\n findInBlocks(state);\n recomposeObjects(state);\n findInRoutePath(state);\n addPaginationParameters(state);\n normalizeDescription(state);\n addRequestBody(state);\n mapToInput(state);\n\n // check for duplicate names\n // https://github.com/octokit/routes/issues/48\n state.routes.forEach(route => {\n const map = {};\n route.operation.parameters.forEach(param => {\n if (map[param.name]) {\n throw new Error(\n `Duplicate parameter name: ${param.name} in ${route.operation.summary}`\n );\n }\n\n map[param.name] = 1;\n });\n });\n}", "title": "" }, { "docid": "797f45bcdaf24c5b5085d586365833e6", "score": "0.5086291", "text": "function generateOAPIParameters() {\n\n return [];\n\n}", "title": "" }, { "docid": "3604c9706f57e9909a8dfaaae53c5e16", "score": "0.50853586", "text": "function restPatterns (inp) {\n return commaSeparated(restPattern, inp, multiRestCallback());\n }", "title": "" }, { "docid": "5e54746cec2e770318359fe60732f70a", "score": "0.5073863", "text": "function multiRestCallback () {\n var count = 0;\n return function (res, inp) {\n if ((res.type === \"rest\" || res.type === \"restIdentifier\") && ++count > 1) {\n // Put the pattern back on the buffer so the error reporting points to\n // the beginning of the rest instead of at the end since its already\n // been consumed.\n inp.put(res.pattern);\n syntaxError(inp, \"Multiple ...'s not allowed\");\n }\n return true;\n };\n }", "title": "" }, { "docid": "4f6b6587669312e437f322d17399da8c", "score": "0.5062779", "text": "list(request,response,next) {\n return arguments;\n }", "title": "" }, { "docid": "a71fcf92f100e4bc915c23e539162394", "score": "0.49972057", "text": "function queryParamsToRestQueryStringParameters(queryParams) {\n var qs = {};\n if (queryParams.isDefault()) {\n return qs;\n }\n var orderBy;\n if (queryParams.index_ === PRIORITY_INDEX) {\n orderBy = \"$priority\" /* PRIORITY_INDEX */;\n }\n else if (queryParams.index_ === VALUE_INDEX) {\n orderBy = \"$value\" /* VALUE_INDEX */;\n }\n else if (queryParams.index_ === KEY_INDEX) {\n orderBy = \"$key\" /* KEY_INDEX */;\n }\n else {\n Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"assert\"])(queryParams.index_ instanceof PathIndex, 'Unrecognized index type!');\n orderBy = queryParams.index_.toString();\n }\n qs[\"orderBy\" /* ORDER_BY */] = Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"stringify\"])(orderBy);\n if (queryParams.startSet_) {\n qs[\"startAt\" /* START_AT */] = Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"stringify\"])(queryParams.indexStartValue_);\n if (queryParams.startNameSet_) {\n qs[\"startAt\" /* START_AT */] +=\n ',' + Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"stringify\"])(queryParams.indexStartName_);\n }\n }\n if (queryParams.endSet_) {\n qs[\"endAt\" /* END_AT */] = Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"stringify\"])(queryParams.indexEndValue_);\n if (queryParams.endNameSet_) {\n qs[\"endAt\" /* END_AT */] +=\n ',' + Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"stringify\"])(queryParams.indexEndName_);\n }\n }\n if (queryParams.limitSet_) {\n if (queryParams.isViewFromLeft()) {\n qs[\"limitToFirst\" /* LIMIT_TO_FIRST */] = queryParams.limit_;\n }\n else {\n qs[\"limitToLast\" /* LIMIT_TO_LAST */] = queryParams.limit_;\n }\n }\n return qs;\n}", "title": "" }, { "docid": "d9b047d0583c8de6b6fa3acf66ba5f9a", "score": "0.49935788", "text": "function getURLParamters(req) {\n var params = url.parse(req.url,true).query;\n console.log(params);\n\n\n var coeffs = [];\n var xvals = [];\n //check if parameters are defined\n if (typeof params['coeffs'] !== 'undefined' && typeof params['xvals'] !== 'undefined') {\n coeffs = params['coeffs'].split(\",\");\n xvals = params['xvals'].split(\",\");\n } else {\n return createSampleParams();\n }\n var params = { coeffs: coeffs, xvals: xvals};\n return params;\n}", "title": "" }, { "docid": "dd4fb4268374f2e41a1448947ed37472", "score": "0.49924678", "text": "function saludarRest(saludo, ...nombres){\n\tfor(i in nombres){\n\t\tconsole.log(`${saludo} ${nombres[i]}`);\n\t}\n}", "title": "" }, { "docid": "0768fc87154affe61af393d59b425048", "score": "0.4952449", "text": "function queryParamsToRestQueryStringParameters(queryParams) {\n var qs = {};\n if (queryParams.isDefault()) {\n return qs;\n }\n var orderBy;\n if (queryParams.index_ === PRIORITY_INDEX) {\n orderBy = \"$priority\" /* PRIORITY_INDEX */;\n }\n else if (queryParams.index_ === VALUE_INDEX) {\n orderBy = \"$value\" /* VALUE_INDEX */;\n }\n else if (queryParams.index_ === KEY_INDEX) {\n orderBy = \"$key\" /* KEY_INDEX */;\n }\n else {\n (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.assert)(queryParams.index_ instanceof PathIndex, 'Unrecognized index type!');\n orderBy = queryParams.index_.toString();\n }\n qs[\"orderBy\" /* ORDER_BY */] = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.stringify)(orderBy);\n if (queryParams.startSet_) {\n qs[\"startAt\" /* START_AT */] = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.stringify)(queryParams.indexStartValue_);\n if (queryParams.startNameSet_) {\n qs[\"startAt\" /* START_AT */] +=\n ',' + (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.stringify)(queryParams.indexStartName_);\n }\n }\n if (queryParams.endSet_) {\n qs[\"endAt\" /* END_AT */] = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.stringify)(queryParams.indexEndValue_);\n if (queryParams.endNameSet_) {\n qs[\"endAt\" /* END_AT */] +=\n ',' + (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.stringify)(queryParams.indexEndName_);\n }\n }\n if (queryParams.limitSet_) {\n if (queryParams.isViewFromLeft()) {\n qs[\"limitToFirst\" /* LIMIT_TO_FIRST */] = queryParams.limit_;\n }\n else {\n qs[\"limitToLast\" /* LIMIT_TO_LAST */] = queryParams.limit_;\n }\n }\n return qs;\n}", "title": "" }, { "docid": "e00d26d54c60a4e932d60cf08855f1a0", "score": "0.49492905", "text": "function myFunc(param1, param2, ...restParam) {\n console.log([...arguments]); // [ 'please', 'help', 'me', 'I', 'am', 'all', 'alone' ]\n console.log(restParam); // [ 'me', 'I', 'am', 'all', 'alone' ]\n}", "title": "" }, { "docid": "0552ebe6b58119a75dbbdf959efe1e4d", "score": "0.4948232", "text": "function rest(a, b, ...c) {\n\n }", "title": "" }, { "docid": "ddbe27b0fca6d646fcb9b97139647024", "score": "0.49472648", "text": "function ListadoDeNombres(Nombre1 , Nombre2 ,...Resto_de_nombres)\n{\n console.log(\"Nombre1: \" , Nombre1);\n console.log(\"Nombre2: \" , Nombre2);\n console.log(Resto_de_nombres);\n}", "title": "" }, { "docid": "084dfa0bdf08af0e0f4bd31fdc0570b1", "score": "0.49466464", "text": "function saludarRest(saludo, ...nombres){\n for (i in nombres){\n console.log(`${saludo} ${nombres[i]}` )\n }\n}", "title": "" }, { "docid": "6068848283c604697ec3a1bb4e5cca7d", "score": "0.4935725", "text": "httpFastPage(successCallback, errorCallback) {\n\n if (!isInteger(this.page)) {\n this.page = 1\n }\n\n if (!isInteger(this.pageSize)) {\n this.pageSize = 10\n }\n\n let params = {\n page: this.page,\n pageSize: this.pageSize\n }\n\n for (let i = 0; i < this.filters.length; i++) {\n let filter = this.filters[i]\n\n if (filter.getParam() !== null && filter.getParam() !== '') {\n params[filter.key] = filter.getParam()\n }\n }\n\n\n this.httpCustomPage(this.URL_PAGE, params, successCallback, errorCallback)\n\n }", "title": "" }, { "docid": "5250eafbeb59f645300b8e5ea4ac943e", "score": "0.49196294", "text": "function simpleGetWithParams(callback) {\n request(\n {\n method: \"GET\",\n url: \"https://postman-echo.com/get\", qs: {\"foo\": \"bar\", \"program\": \"camp2\", \"people\": [\"Frieda\", \"Francis\"]}}\n ,\n function (error, response, body) {\n callback(JSON.parse(body).args);\n });\n}", "title": "" }, { "docid": "d7faa8d711b3d93647883e99809eba4c", "score": "0.49188694", "text": "paramsRequest () {\n\t\t\tthis.search(false) // busca-se na página atual\n\t\t}", "title": "" }, { "docid": "8714039425dca7d3633c2433efd198d4", "score": "0.49010354", "text": "function call_api(rest_url) { // advance users can define api_config for advance calls\n// the api_config variable defaults to {method:'GET', header:[], body:{}}\nvar xhttp = new XMLHttpRequest(); xhttp.open(api_config.method, rest_url, false);\nfor (var item=0;item<api_config.header.length;item++) { // process headers\nif (api_config.header[item] == '') continue; // skip if header is not defined\nvar header_value_pair = api_config.header[item].split(':'); // format is 'Header_name: header_value'\nxhttp.setRequestHeader(header_value_pair[0].trim(),header_value_pair[1].trim());}\nxhttp.send(JSON.stringify(api_config.body)); return xhttp.responseText;}", "title": "" }, { "docid": "57f4b6e84efeb8b7d64becd9759e8fde", "score": "0.48990268", "text": "function action0(params){\n\tlog('Info: action0(): start')\n\ttry{\n\t\tvar width=params.width;\n\t\tvar height=params.height;\n\t\tvar data=[];\n\t\tfor(var i=0;i<height;i++){\n\t\t\tvar row=[];\n\t\t\tfor(var j=0;j<width;j++){\n\t\t\t\trow.push(j);\n\t\t\t}\n\t\t\tdata.push(row);\n\t\t}\n\t\tret=data;\n\t}catch(e){\n\t\tres.Error=e.toString();\n\t}\n\tprint(\"Content-Type: application/json\\n\\n\");\n\tprint(JSON.stringify(ret));\n\tlog('Info: action0(): end')\n}", "title": "" }, { "docid": "eb9fea1a6c07bdc397797b9dc7176764", "score": "0.48654982", "text": "function list(start, number, params) {\n var deferred = $q.defer();\n \n if(!params.search.predicateObject){\n params.search.predicateObject = {};\n params.search.predicateObject.pageNum = start/number+1;\n params.search.predicateObject.pageSize = number;\n }else{\n params.search.predicateObject.pageNum = start/number+1;\n params.search.predicateObject.pageSize = number;\n }\n $http.post(config.endpoints.sos.InvitationRemind+'/list',params.search.predicateObject).success(function(response, status, headers, config) {\n deferred.resolve({\n data: response.data.list,\n numberOfPages: response.data.pages\n });\n }).error(function(response, status, headers, config) {\n console.log('Failed to get InvitationRemind : ' + JSON.stringify(response));\n deferred.reject(response.error);\n }\n );\n return deferred.promise;\n }", "title": "" }, { "docid": "ef83033f553c955e7db2d83046651071", "score": "0.48530963", "text": "list({ params }, res) {\n getAllData(db, (err, data) => {\n res.json({ result: data });\n });\n }", "title": "" }, { "docid": "add08f6bd3da1f07cf2ea497328eaa19", "score": "0.48393533", "text": "function test_rest_arguments() {\n function baz(...rest) { return rest; }\n return baz(100);\n}", "title": "" }, { "docid": "c5676b6df4f6b61855142c16a7fdf815", "score": "0.4814548", "text": "function getParameters( query, zip, offset, cata ){\n\tvar para = [];\n\tpara.push(['term', query]);\n\tpara.push(['location', zip]);\n\tpara.push(['offset', offset]);\n\tif (typeof(cata) != 'undefined' && cata.length > 2)\n\t\tpara.push(['category_filter', cata]);\n\tpara.push(['callback', 'cb']);\n\tpara.push(['oauth_consumer_key', auth.consumerKey]);\n\tpara.push(['oauth_consumer_secret', auth.consumerSecret]);\n\tpara.push(['oauth_token', auth.accessToken]);\n\tpara.push(['oauth_signature_method', 'HMAC-SHA1']);\n\treturn para;\n}", "title": "" }, { "docid": "d1a9c9a2be1847add3193d57f994d693", "score": "0.47850826", "text": "function abstractListCtrl(Restangular, $scope, ngTableParams) {\n // Support for minification\n abstractListCtrl.$inject = ['Restangular', '$scope', 'ngTableParams'];\n\n var dataKey = \"data\";\n\n // Initialize the controller before using it\n $scope.initCtrl = function(sonItemKey) {\n dataKey = sonItemKey;\n };\n\n /* Handle table params */\n\n // Initialize the setting object for ngTable + default filters\n $scope.initTableParams = function(showOnStartup, isLive, filterDefault, sortDefault) {\n // Show/hide the filter UI on startup\n $scope.show_filter_toggle = showOnStartup;\n\n $scope.tableParams = new ngTableParams({\n page: 1, // Show first page\n total: 0, // Total elements (not paginated)\n count: 0, // Items per page (chunk size)\n filter: filterDefault, // Default filter config\n sorting: sortDefault, // Default sort-by config\n $liveFiltering: isLive, // Filter as-you-type on/off\n counts: [] // Don't allow to change page size\n });\n };\n\n // TODO: Allow to toggle filter UI on/off, needs ng-tables official support\n\n /* Handle data from REST API */\n\n // When data is received - update the data object and numeric metadata\n $scope.updateDataAndTotal = function(newData) {\n $scope[dataKey] = newData;\n if ($scope.tableParams) {\n $scope.tableParams.total = ($scope[dataKey] ? $scope[dataKey].metadata.count : 0);\n if ($scope.tableParams.count === 0) {\n $scope.tableParams.count = ($scope[dataKey] ? $scope[dataKey].length : 0);\n }\n }\n };\n\n // Main function for initializing the data for this controller\n // Example: initData('tasks') will init 'tasks/' (as a list)\n // Optional: dataKeyName to change $scope[\"data\"] to $scope[\"tasks\"]\n $scope.initData = function(resourceEndpointName, dataKeyName) {\n // Save the new data key name, if one was provided\n if (dataKeyName !== undefined) { dataKey = dataKeyName; };\n\n $scope[dataKey] = {};\n $scope.tableParams = {};\n $scope.currentPage = 1;\n $scope.baseEndpoint = Restangular.all(resourceEndpointName);\n $scope.refreshData();\n };\n\n // Allows refreshing the data using the current base endpoint\n // This function is used internally but could also be used\n // externally - when a forced refresh is needed.\n $scope.refreshData = function() {\n $scope.baseEndpoint.getList().then(function(newData) {\n $scope.updateDataAndTotal(newData);\n $scope.$broadcast(\"event:parentLoaded\", []);\n });\n };\n\n /* Handle data/params updates */\n\n // Convert the client-side tableParams to GET query params\n $scope.get_query_params = function(params) {\n var query_params = {};\n\n if (params.sorting) {\n query_params['ordering'] = params.orderBy();\n query_params['ordering'] = $.map(query_params['ordering'], function(val, idx) {\n return val.replace(/^\\+/, '');\n });\n }\n if (params.filter) {\n // TODO: Change to angular's foreach\n for (var field in params.filter) {\n // Add fields that are not empty, for string fields, trim them.\n // If it's an array, only add items that are not empty\n if (params.filter[field]) {\n if ($.type(params.filter[field]) === \"string\" && !params.filter[field].trim()) {\n continue;\n }\n if ($.type(params.filter[field]) === \"array\") {\n for (var i=0; i<params.filter[field].length; i++) {\n if (!params.filter[field][i]) {\n params.filter[field].splice(i, 1);\n }\n }\n if (!params.filter[field].length) {\n continue;\n }\n }\n query_params[field]= params.filter[field];\n }\n }\n }\n if (params.page) {\n query_params['page'] = params.page;\n }\n return query_params;\n };\n\n // Watch for changed view parameters -> fetch new data -> refresh display\n $scope.$watch('tableParams', function(params) {\n if (params !== undefined) {\n // Init query params\n var query_params = $scope.get_query_params(params);\n $scope.loading = true;\n\n // Fetch the data\n $scope[dataKey] = {};\n $scope.baseEndpoint.customGETLIST('', query_params).then(function(newData) {\n $scope.loading = false;\n $scope.updateDataAndTotal(newData);\n });\n }\n }, true);\n\n /* Events */\n\n // When a single item from the list is deleted, delete from the list as well\n $scope.$on(\"event:sonDeleted\", function(e, data) {\n var deletedItem = data[0];\n $scope[dataKey].splice($scope[dataKey].indexOf(deletedItem), 1);\n });\n\n // When a single item from the list is added, add it to the list as well\n $scope.$on(\"generic-item:saved\", function(e, data) {\n if (data) {\n var addedItem = data[0];\n var reversed = data[1];\n if (!reversed) {\n $scope[dataKey].push(addedItem);\n }\n else {\n $scope[dataKey].unshift(addedItem);\n }\n }\n })\n}", "title": "" }, { "docid": "a80e008e23a4a13971873322bf24d246", "score": "0.47776338", "text": "function extendParams(params) {\r\n\t\t\t\tparams.method = params.method || config.defaultHttpMethod;\r\n\t\t\t\tparams.url = (params.baseUrl || service.baseUrl) + (params.url || '');\r\n\t\t\t\tparams.data = parse(params.data, params);\r\n\r\n\t\t\t\tif (config.debug) {\r\n\t\t\t\t\tconsole.log('aac.api | extendParams() | return', angular.copy(params));\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn params;\r\n\t\t\t}", "title": "" }, { "docid": "a5f026a6531d05eda5d2a1d0ce97b7e2", "score": "0.477714", "text": "function listBooks() {\n \n let q = '?_limit=20'\n let path = route + q\n \n request(path, (err, res, body) => {\n if (err) {\n return console.log(err)\n }\n let data = JSON.parse(body)\n for (let i = 0; i < data.length; i++){\n console.log(`${data[i].id} ${data[i].name}`)\n }\n return\n })\n\n}", "title": "" }, { "docid": "a0e0834b3d8db1bb6ac3cb8bb2d1f5d8", "score": "0.47752854", "text": "function queryParamsToRestQueryStringParameters(queryParams) {\n var qs = {};\n if (queryParams.isDefault()) {\n return qs;\n }\n var orderBy;\n if (queryParams.index_ === PRIORITY_INDEX) {\n orderBy = \"$priority\";\n } else if (queryParams.index_ === VALUE_INDEX) {\n orderBy = \"$value\";\n } else if (queryParams.index_ === KEY_INDEX) {\n orderBy = \"$key\";\n } else {\n _firebaseUtil.assert(queryParams.index_ instanceof PathIndex, 'Unrecognized index type!');\n orderBy = queryParams.index_.toString();\n }\n qs[\"orderBy\"] = _firebaseUtil.stringify(orderBy);\n if (queryParams.startSet_) {\n qs[\"startAt\"] = _firebaseUtil.stringify(queryParams.indexStartValue_);\n if (queryParams.startNameSet_) {\n qs[\"startAt\"] += ',' + _firebaseUtil.stringify(queryParams.indexStartName_);\n }\n }\n if (queryParams.endSet_) {\n qs[\"endAt\"] = _firebaseUtil.stringify(queryParams.indexEndValue_);\n if (queryParams.endNameSet_) {\n qs[\"endAt\"] += ',' + _firebaseUtil.stringify(queryParams.indexEndName_);\n }\n }\n if (queryParams.limitSet_) {\n if (queryParams.isViewFromLeft()) {\n qs[\"limitToFirst\"] = queryParams.limit_;\n } else {\n qs[\"limitToLast\"] = queryParams.limit_;\n }\n }\n return qs;\n}", "title": "" }, { "docid": "1ffb5aede2e17c334662b799b6360a5b", "score": "0.4771178", "text": "function rest(array, n, guard) {\n return __WEBPACK_IMPORTED_MODULE_0__setup_js__[\"q\" /* slice */].call(array, n == null || guard ? 1 : n);\n}", "title": "" }, { "docid": "1ffb5aede2e17c334662b799b6360a5b", "score": "0.4771178", "text": "function rest(array, n, guard) {\n return __WEBPACK_IMPORTED_MODULE_0__setup_js__[\"q\" /* slice */].call(array, n == null || guard ? 1 : n);\n}", "title": "" }, { "docid": "007a73b915a3fb60b84f3627a39b5355", "score": "0.47695655", "text": "function parameters_parseParameters(spec, ctx, params) {\n params = params || {};\n var key, value;\n\n for (key in spec) {\n value = spec[key];\n\n params[key] = Object(vega_util[\"A\" /* isArray */])(value)\n ? value.map(function(v) { return parameters_parseParameter(v, ctx, params); })\n : parameters_parseParameter(value, ctx, params);\n }\n return params;\n}", "title": "" }, { "docid": "19e75bcb47ebf344aba0ff5bc096d9f8", "score": "0.47641727", "text": "static get paramIds () { return [] }", "title": "" }, { "docid": "988c7ebcf1cc680602b0fba030a3a516", "score": "0.47503352", "text": "function parseParametersType() {\n var params = [], optionalSequence = false, expr, rest = false, startIndex, restStartIndex = index - 3, nameStartIndex;\n\n while (token !== Token.RPAREN) {\n if (token === Token.REST) {\n // RestParameterType\n consume(Token.REST);\n rest = true;\n }\n\n startIndex = previous;\n\n expr = parseTypeExpression();\n if (expr.type === Syntax.NameExpression && token === Token.COLON) {\n nameStartIndex = previous - expr.name.length;\n // Identifier ':' TypeExpression\n consume(Token.COLON);\n expr = maybeAddRange({\n type: Syntax.ParameterType,\n name: expr.name,\n expression: parseTypeExpression()\n }, [nameStartIndex, previous]);\n }\n if (token === Token.EQUAL) {\n consume(Token.EQUAL);\n expr = maybeAddRange({\n type: Syntax.OptionalType,\n expression: expr\n }, [startIndex, previous]);\n optionalSequence = true;\n } else {\n if (optionalSequence) {\n utility.throwError('unexpected token');\n }\n }\n if (rest) {\n expr = maybeAddRange({\n type: Syntax.RestType,\n expression: expr\n }, [restStartIndex, previous]);\n }\n params.push(expr);\n if (token !== Token.RPAREN) {\n expect(Token.COMMA);\n }\n }\n return params;\n }", "title": "" }, { "docid": "988c7ebcf1cc680602b0fba030a3a516", "score": "0.47503352", "text": "function parseParametersType() {\n var params = [], optionalSequence = false, expr, rest = false, startIndex, restStartIndex = index - 3, nameStartIndex;\n\n while (token !== Token.RPAREN) {\n if (token === Token.REST) {\n // RestParameterType\n consume(Token.REST);\n rest = true;\n }\n\n startIndex = previous;\n\n expr = parseTypeExpression();\n if (expr.type === Syntax.NameExpression && token === Token.COLON) {\n nameStartIndex = previous - expr.name.length;\n // Identifier ':' TypeExpression\n consume(Token.COLON);\n expr = maybeAddRange({\n type: Syntax.ParameterType,\n name: expr.name,\n expression: parseTypeExpression()\n }, [nameStartIndex, previous]);\n }\n if (token === Token.EQUAL) {\n consume(Token.EQUAL);\n expr = maybeAddRange({\n type: Syntax.OptionalType,\n expression: expr\n }, [startIndex, previous]);\n optionalSequence = true;\n } else {\n if (optionalSequence) {\n utility.throwError('unexpected token');\n }\n }\n if (rest) {\n expr = maybeAddRange({\n type: Syntax.RestType,\n expression: expr\n }, [restStartIndex, previous]);\n }\n params.push(expr);\n if (token !== Token.RPAREN) {\n expect(Token.COMMA);\n }\n }\n return params;\n }", "title": "" }, { "docid": "c5ca6280e130b7dbae2e1121df2afb49", "score": "0.4750156", "text": "buildURLParams({ pagination = {}, filters = {}, query = this.query }) {\n let params = {}\n\n Object.entries(Object.assign({}, pagination, query)).forEach(pair => {\n if (pair[1] === undefined || pair[1] === null) {\n return\n }\n\n params[pair[0]] = pair[1]\n })\n\n Object.assign(params, this.buildFilters(filters, true))\n\n return params\n }", "title": "" }, { "docid": "68e0a0cb559d8933ca7bae95d33b6ef9", "score": "0.47452262", "text": "function doReqs(){\n for(var i = 2; i < argvSize; i++){\n httpGet(i);\n }\n}", "title": "" }, { "docid": "7d6277540bff7fa5467c90b0453e1517", "score": "0.47417518", "text": "getParam(params) {\n let values = {};\n let orderBy = {};\n let fields = {};\n params.split(\"&\").forEach(parametru => {\n if (parametru.includes(\"=\")) {\n const parametrii = parametru.split(\"=\");\n let camp = parametrii[0];\n let valoare = parametrii[1];\n if (!camp.match(MyURLparser.id_name)) {\n camp = camp.toUpperCase();\n }\n switch (MyURLparser.getCommandCode(camp)) {\n case 0:\n if (camp == \"AN\" || camp == \"TOTALVEHICULE\")\n values[camp] = Number.parseInt(valoare.replace(/%20/g, \" \").toUpperCase());\n else\n values[camp] = valoare.replace(/%20/g, \" \").toUpperCase();\n break;\n case 1:\n orderBy[camp.split(MyURLparser.order_by)[1]] = parseInt(valoare);\n break;\n case 2:\n if (valoare == undefined)\n fields[camp.split(MyURLparser.field_name)[1]] = 1;\n else\n fields[camp.split(MyURLparser.field_name)[1]] = parseInt(valoare);\n break;\n }\n }\n });\n return [values, fields, orderBy];\n }", "title": "" }, { "docid": "0ef58c05c2daa36cc8de5675a701ed3d", "score": "0.47390807", "text": "r(...cmdparams){\n cmdparams.splice(1,0,this.k);\n return request(cmdparams);\n }", "title": "" }, { "docid": "0ef58c05c2daa36cc8de5675a701ed3d", "score": "0.47390807", "text": "r(...cmdparams){\n cmdparams.splice(1,0,this.k);\n return request(cmdparams);\n }", "title": "" }, { "docid": "0ef58c05c2daa36cc8de5675a701ed3d", "score": "0.47390807", "text": "r(...cmdparams){\n cmdparams.splice(1,0,this.k);\n return request(cmdparams);\n }", "title": "" }, { "docid": "fa520bb6cdc20d57e71d60923434b142", "score": "0.4738996", "text": "function iterate (i) {\n var line = stack[i]\n , mint;\n\n if (!line) return finish();\n\n function next (err, result) {\n if (false === err && !result) {\n return finish(false);\n } else if (err || result) {\n return finish(err, result)\n } else {\n iterate(++req.index);\n }\n }\n\n req.index = i;\n req.params = line.route.params(path);\n mint = res ? [ req, res, next ] : [ req, next ];\n line.fn.apply(null, mint);\n }", "title": "" }, { "docid": "241de6a5ca87849c43fef31cbb6e0fe1", "score": "0.47347885", "text": "function GetRequestParameters(req){\r\n var nameValueArray = [];\r\n for (var param in req.query){\r\n nameValueArray.push({'name':param,'value':req.query[param]})\r\n }\r\n return nameValueArray;\r\n}", "title": "" }, { "docid": "d11630cd949cab2327baf0647c820060", "score": "0.47334155", "text": "function doTest(a, b = 10, ...params){//...params is going to give us all of the other params as an array\n console.log(a + b);\n console.log(params)\n}", "title": "" }, { "docid": "1a427157b0824fc00fe3bbb0eb4da131", "score": "0.47265974", "text": "function getRequestParams() {\n // host\n if (GetParam('host') != null || GetParam('host') != \"\") {\n host = GetParam('host');\n } else {\n host = '';\n }\n\n // port\n if (GetParam('port') != null || GetParam('port') != \"\") {\n port = GetParam('port');\n } else {\n port = '';\n }\n\n // memberId\n if (GetParam('member') != null || GetParam('member') != \"\") {\n memberId = GetParam('member');\n } else {\n memberId = '';\n }\n\n // memberName\n if (GetParam('memberName') != null || GetParam('memberName') != \"\") {\n memberName = GetParam('memberName');\n } else {\n memberName = '';\n }\n \n //regionFullPath\n if (GetParam('regionFullPath') != null || GetParam('regionFullPath') != \"\") {\n regionFullPath = GetParam('regionFullPath');\n } else {\n regionFullPath = '';\n }\n}", "title": "" }, { "docid": "b98fe35a7f08f9127fa8ca76c8530568", "score": "0.47251436", "text": "function parseParameters(spec, params) {\n params = params || {};\n const ctx = this;\n\n for (const key in spec) {\n const value = spec[key];\n params[key] = (0, _vegaUtil.isArray)(value) ? value.map(v => parseParameter(v, ctx, params)) : parseParameter(value, ctx, params);\n }\n\n return params;\n}", "title": "" }, { "docid": "064ed07c80bc6b3a95502d3d3a5e68bc", "score": "0.47140604", "text": "function restArgs(func, startIndex) {\n\tstartIndex = startIndex == null ? func.length - 1 : +startIndex;\n\treturn function () {\n\t\tvar length = Math.max(arguments.length - startIndex, 0),\n\t\t rest = Array(length),\n\t\t index = 0;\n\t\tfor (; index < length; index++) {\n\t\t\trest[index] = arguments[index + startIndex];\n\t\t}\n\t\tswitch (startIndex) {\n\t\t\tcase 0:\n\t\t\t\treturn func.call(this, rest);\n\t\t\tcase 1:\n\t\t\t\treturn func.call(this, arguments[0], rest);\n\t\t\tcase 2:\n\t\t\t\treturn func.call(this, arguments[0], arguments[1], rest);\n\t\t}\n\t\tvar args = Array(startIndex + 1);\n\t\tfor (index = 0; index < startIndex; index++) {\n\t\t\targs[index] = arguments[index];\n\t\t}\n\t\targs[startIndex] = rest;\n\t\treturn func.apply(this, args);\n\t};\n}", "title": "" }, { "docid": "308fbe2085d0bf014a6c522aa4b21ab2", "score": "0.47112244", "text": "paramsSerializer(params) {\n return querystring_1.default.stringify(params);\n }", "title": "" }, { "docid": "308fbe2085d0bf014a6c522aa4b21ab2", "score": "0.47112244", "text": "paramsSerializer(params) {\n return querystring_1.default.stringify(params);\n }", "title": "" } ]
46f55b731c17b8e4f933c6ef493c3904
el formulario de Login
[ { "docid": "56b43b0e2d71b0851ffbac56925082cf", "score": "0.63106716", "text": "function Login(props) {\n const [form, setForm] = useState({ email: '', password: '' });\n const update = (({ target }) => setForm({ ...form, [target.name]: target.value }))\n return (\n <React.Fragment>\n\t <div className=\"container is-fluid\">\n\n <section data-section-id=\"1\" data-category=\"sign-in\" className=\"section\">\n <div className=\"container has-text-centered\">\n <div className=\"columns is-centered\">\n <div className=\"column is-5 is-4-desktop\">\n\t\t\t\n\t\t\t <Field>\n\t\t\t\t<Control>\n\t\t\t\t <Label>Email</Label>\n\t\t\t\t <Input name=\"email\" value={form.email} onChange={update} />\n\t\t\t\t</Control>\n\t\t\t </Field>\n\t\t\t <Field>\n\t\t\t\t<Control>\n\t\t\t\t <Label>Password</Label>\n\t\t\t\t <Input name=\"password\" type=\"password\" value={form.password} onChange={update} />\n\t\t\t\t</Control>\n\t\t\t </Field>\n\t\t\t <Button.Group>\n\t\t\t\t<Button fullwidth rounded color=\"primary\" onClick={() => props.login(form)}>Login</Button>\n\t\t\t </Button.Group>\n\t \n\t\t </div>\n\t\t </div>\n\t </div>\n\t </section>\n\t </div>\n </React.Fragment>\n );\n}", "title": "" } ]
[ { "docid": "9a6dae195be4fddbb6d5f7be89ab2e25", "score": "0.76384974", "text": "login() {\n this.provider.login(this.form.value);\n }", "title": "" }, { "docid": "a5791cfe165d4289347251b338d66e56", "score": "0.71379304", "text": "login (email, password) {\n this.email.type(email)\n this.password.type(password)\n this.submit.click()\n \n }", "title": "" }, { "docid": "3565dfd17b20e1def2457bddf432b19d", "score": "0.71271807", "text": "function loginForm(){\r\n\tauthServer({username:app.loginuser, password:app.loginpass});\r\n\tapp.loginpass = '';\r\n\t\r\n}", "title": "" }, { "docid": "51ec021e691e3fdb1b111161eb4e67cc", "score": "0.71239245", "text": "function auth() {\r\n\tif ($F('username') == '') {\r\n\t\t$('username').focus();\r\n\t}\r\n\telse if ($F('password') == '') {\r\n\t\t$('password').focus();\r\n\t}\r\n\telse {\r\n\t\t$('flogin').submit();\r\n\t}\r\n}", "title": "" }, { "docid": "0818bc2d2596fa708b3f213351ee8bb2", "score": "0.7095399", "text": "function checkFormLogin() {\n\t//eseguiamo i controlli dui due campi, e ritorniamo l'AND dei loro risultati\n\treturn (check(user,\"Username\") && check(pass,\"Password\"));\n\t//in questo modo, se uno dei due ritorna false, la form non verrà sottomessa\n}", "title": "" }, { "docid": "c74a3145ac6055ca3bf166588262065f", "score": "0.70842934", "text": "login(username, password) {\n this.fillField('username', username)\n this.fillField('password', password)\n this.click('Log in')\n }", "title": "" }, { "docid": "44c352963dd06892a14c1925e966519c", "score": "0.7067498", "text": "function login(){\n toLogin(userField.value);\n}", "title": "" }, { "docid": "b2063cdc26c0f450e4edd621e59a59d7", "score": "0.7044041", "text": "function login() {\n //\n // Extract login credentials from login view\n //\n const loginData = document.getElementsByName(\"logindata\");\n //\n // Validate credentials if provided\n //\n if (loginData[0].value !== '' && loginData[1].value !== '') {\n //\n // Validate login credentials\n //\n validate(loginData, (validUser) => {\n var user = validUser.body;\n var auth = validUser.x-auth;\n //\n // Close login View\n //\n toggleView(\"viewLogin\");\n toggleView(\"navLogin\");\n //\n // Display user id in system header\n //\n document.getElementById(\"user\").innerHTML = \"User: \" + user.email;\n //\n // Display Role View\n //\n openRoleView(user);\n });\n }\n else {\n //\n // No login credentials provided\n //\n const prompt = \"No login information ... please enter\";\n document.getElementById(\"prompt\").innerHTML = prompt;\n }\n}", "title": "" }, { "docid": "9c191ff19b9fd079899b088eb7f19397", "score": "0.69469", "text": "login (username, password) {\n this.inputUsername.setValue(username);\n this.inputPassword.setValue(password);\n this.btnSubmit.click(); \n }", "title": "" }, { "docid": "3e4361591feb409b543472774a9e96c9", "score": "0.6920593", "text": "login(username, password){\n this.UsernameTxt.setValue(username);\n this.PasswordTxt.setValue(password);\n this.LoginLnk.click();\n\t}", "title": "" }, { "docid": "fea5f789ea4755e5d12a52be3253315d", "score": "0.6913985", "text": "function showLoginForm() {\n $('.login-section').removeClass('hide');\n\n // reset the login form\n $('.login-form :input:visible').val('');\n resetButton();\n\n // focus the first input field\n $('.login-form :input:visible:first').focus();\n }", "title": "" }, { "docid": "e9baee0b6c95b9c080ed965380aebd4a", "score": "0.6900235", "text": "onLoginClicked() {\n const self = this;\n const nameInput = document.getElementById('name');\n const passInput = document.getElementById('pass');\n this.setCurrentTemplate('loading');\n App.AuthControl.logIn(nameInput.value, passInput.value).then(()=>{});\n }", "title": "" }, { "docid": "86f3f12aa656761c7f87e04a991a73a0", "score": "0.68914616", "text": "function showLoginForm() {\n http('/login/ajax').then(\n response => {\n const forms = document.querySelector('.logIn .forms');\n forms.appendChild(document.createElement('div')).innerHTML = response;\n\n const switchToReg = document.querySelector('#toReg');\n if (switchToReg) {\n switchToReg.addEventListener('click', () => {\n empty('.logIn .forms');\n showRegisterForm();\n });\n }\n }\n );\n }", "title": "" }, { "docid": "1db7033a21aca8adfbf6f166eadba538", "score": "0.6807907", "text": "static loginForm(req, res, next) {\n res.render('pages/login/login', {\n page: {\n title: 'Login',\n status: false\n },\n err: null,\n register: null\n })\n }", "title": "" }, { "docid": "c4fc6b0eb051e327ac506e89142e694c", "score": "0.6780537", "text": "function createLoginForm() {\n new GeoNetwork.LoginForm({\n renderTo : 'login-form',\n catalogue : catalogue\n });\n\n catalogue.on('afterBadLogin', loginAlert, this);\n }", "title": "" }, { "docid": "b8b52a096a2d1012d8d0cde9bb5f5106", "score": "0.67796713", "text": "function login() {\n let form = $('#formLogin');\n const username = form.find('input[name=\"username\"]').val();\n const password = form.find('input[name=\"passwd\"]').val();\n const loginData = {\n username,\n password\n };\n\n userService.login(loginData)\n .then(response => {\n saveSession(response);\n viewController.showView('viewAds');\n handler.showInfo('Successfully logged in!');\n }).catch(handler.handleError);\n }", "title": "" }, { "docid": "c9c0c0783a7eafb56f7a9c712af6d0ae", "score": "0.6773394", "text": "login() {\n let self = this;\n self.loader.show();\n /**\n * I copy this data to have ability to clear form before request come back\n * @type {*|{login: string, password: string}}\n */\n let copied = angular.copy(self.userLogin);\n self.defaultValues();\n self.UserService.login(copied).then(\n // Success\n (data)=> {\n self.loader.hide();\n self.$state.go('center');\n self.notie.alert(1, 'Success!', 1);\n },\n // Errors\n (err)=> {\n self.loader.hide();\n let msg;\n switch (err.status) {\n case 500:\n msg = 'Błąd serwera ;('\n break;\n case 404:\n msg = 'Nie znaleziono zasobu'\n break;\n case 400:\n msg = 'Podane dane są nieprawidłowe'\n break;\n case 403:\n msg = err.data.message;\n break;\n default:\n msg = `Niepoprawne dane`;\n break;\n }\n notie.alert(3, msg, 3);\n $('#loginField').focus();\n\n });\n }", "title": "" }, { "docid": "944d35dabe366d1d153fb00c9cefc4d1", "score": "0.67664444", "text": "onLogin(){\r\n\r\n\t\tif($.value('.login-email') == '' || $.value('.login-password') == ''){\r\n\r\n\t\t\t$.toast({text : 'Make Sure All Credential Fields Are Filled', time : 4000});\r\n\r\n\t\t}else{\r\n\r\n\t\t\t$.req({method : 'POST', url : this.getUrl().login, form : new FormData($.get('.login-form')), bar : false}, (response) => {\r\n\t\t\t\t\r\n\t\t\t\tthis.onResponse(response);\r\n\r\n\t\t\t});\r\n\r\n\t\t}\r\n\r\n\t}", "title": "" }, { "docid": "941bc03d32022c141ae1867817194b41", "score": "0.6764851", "text": "render() { // = the visuel\n\n return (\n <div className=\"loginForm_container\">\n <Header />\n <form className=\"login\" onSubmit={this.handleSubmit}>\n <div className=\"login_loginForm\">\n <input\n placeholder=\"Pseudo\"\n className=\"loginForm_pseudo\"\n value={this.state.pseudo}\n onChange={this.onPseudoChange}\n required\n />\n <input\n type=\"password\"\n className=\"loginForm_password\"\n id=\"1stPassword\"\n placeholder=\"Mot de passe\"\n value={this.state.password}\n onChange={this.onPasswordChange}\n required\n />\n <input\n type=\"password\"\n className=\"loginForm_password\"\n id=\"ConfirmPassword\"\n placeholder=\"Retaper le mot de passe\"\n value={this.state.confirmPassword}\n onChange={this.onConfirmPassword}\n required\n />\n\n <input\n type=\"email\"\n className=\"loginForm_pseudo\"\n placeholder=\"email\"\n value={this.state.email}\n onChange={this.onEmailChange}\n required\n />\n\n <button type=\"submit\" className=\"loginForm_validButton\"><div className=\"validButton_validLogin\">M'inscrire</div></button>\n </div>\n </form>\n <Footer />\n </div>\n );\n }", "title": "" }, { "docid": "0278a0a27cdf4de9adad62f6eae926e6", "score": "0.6726134", "text": "function login(){\n\tvalidateUser()\n}", "title": "" }, { "docid": "cd59529b2ba30da1ceb92c6e490a8249", "score": "0.6723727", "text": "function handleLoginForm(){\n var username = $(\"#username\").val();\n var password = $(\"#password\").val();\n User.login(username, password);\n}", "title": "" }, { "docid": "42b184fb4804d1fb1485372bd414866a", "score": "0.6719429", "text": "function frmLogin() {\n \n var frm = \"#frmLogin\";\n\t\n\t$('#btn-login').click(function(){\n\t\t$(frm).submit();\n\t});\n\t\n\t$('#txtUsuario, #txtSenha').keyup(function(e){\n\t\tif( e.keyCode == 13)\n\t\t\t$(frm).submit();\n\t});\n\t\n if ($(frm).length > 0) { \n\t\tvar open = true;\n\t\t$(frm).validate({\n\t\t\terrorPlacement:function(error,element) {\n\t\t\t\t$('.login-msg').append(error);\n\t\t\t},\n\t\t\twrapper: \"ul\",\n\t\t\terrorElement: \"li\",\n\t\t\tmessages: {\n\t\t\t\ttxtUsuario: \"O campo usuário é campo obrigatório!\",\n\t\t\t\ttxtSenha: \"O campo senha é obrigatório!\"\n\t\t\t}\n\t\t});\n }\n\n}", "title": "" }, { "docid": "8148f8825df77061e3385d135b00cfe2", "score": "0.669398", "text": "function loginUsuario(forma,accion)\n{\n var usuario = forma.usuario;\n var contrasenna = forma.contrasenna;\n\n if(usuario.value=='')\n {\n alert('Favor de Introducir Usuario');\n }\n else\n {\n if(contrasenna.value=='')\n {\n alert('Favor de Introducir Password');\n }\n else\n {\n forma.accion.value = accion;\n forma.submit();\n }\n }\n \n return false;\n}", "title": "" }, { "docid": "de19cbf72a4c4b1f43ccefa9e4f244b7", "score": "0.6682196", "text": "function formLogin(evt) {\n /*focus()\nJavascript focus() methods helps to highlight a HTML form element. It sets the element as an active element in the current document. In current documentation, focus can be applied to only one single element. The focus can be applied either to a text, a button, etc. \n\nsyntax\nelement.focus(options);*/\nevt.preventDefault();\n\n if (name.value == \"\") {\n window.alert(\"Please enter your name.\");\n name.focus();\n return false;\n }\n\nif (password.value == \"\") {\n window.alert(\"please enter the correct password\");\n password.focus();\n return false;\n }\nif (email.value == \"\"){\n window.alert(\"please enter a valid email-address\");\n email.focus();\n return false;\n }\nif(password.value === \"yalda\") {\n hidden.classList.remove('hidden');\n hide1.classList.remove('formStyle1'); \n return true;\n \n \n}\n \n\n}", "title": "" }, { "docid": "b72b728237d2edbdbd257141b1b842b1", "score": "0.6666041", "text": "function display_input_login(user,pass){\n\t\tdocument.getElementById('user').value = user;\n\t\tdocument.getElementById('pass').value = pass;\n\t}// END", "title": "" }, { "docid": "9eb1e2bb00d6fcd83e2e62db2183a856", "score": "0.66414887", "text": "_handleLogin() {\n if (this.$.loginForm.validate()) {\n let loginPostObj = { phoneNumber: parseInt(this.$.username.value), password: this.$.password.value };\n this.$.loginForm.reset();\n this.action = 'list';\n this._makeAjax(`http://10.117.189.181:9090/lifelinehealthcare/login`, 'post', loginPostObj);\n }\n }", "title": "" }, { "docid": "d079c2386a843611c54e5616a3cf3dd7", "score": "0.66190636", "text": "function login(context) {\n const username = this.params['username-login'];\n const password = this.params['password-login'];\n\n userModel.login(username, password)\n .then(function (res) {\n userModel.saveSession(res);\n handler.showInfo(`Successfully logged in!`);\n context.redirect('#/editor');\n }).catch((err) => {\n handler.handleError(err);\n $('input[name=\"username-login\"]').val('');\n $('input[name=\"password-login\"]').val('');\n });\n }", "title": "" }, { "docid": "2b4c481aee9edd221a7f41a54efb7e38", "score": "0.659542", "text": "loginByEmailAndPass(email, password){\n this.setEmail(email);\n this.setPassword(password);\n this.clickLoginButton();\n }", "title": "" }, { "docid": "d548546661878789d20fb792f5347731", "score": "0.659361", "text": "function validateLogin(){\n if (account.userName === admin.admuser && account.password === admin.admpassword){\n closeModal();\n navigation.navigate('Home');\n } else {\n setWrongModal(true); //En caso de ser incorrecto, abrirá un nuevo Modal.\n }\n }", "title": "" }, { "docid": "6d9c6ef1f1b6f581259495962067a2ea", "score": "0.65805197", "text": "login (password) {\n this.inputPassword.setValue(password);\n this.btnSubmit.click(); \n }", "title": "" }, { "docid": "ced658d2d744170e3a993d2469fb4d0d", "score": "0.6579147", "text": "function viewIniciarSesion() {\r\n $scope.verFomularioLogin = true;\r\n $scope.verFomularioRegistrarse = false;\r\n $scope.verFomularioRecuperarPass = false;\r\n $scope.limpiarErroresFomulario();\r\n $scope.datosFormulario = {};\r\n }", "title": "" }, { "docid": "a7a40e9140de4f6452d75023da1ef23f", "score": "0.6570812", "text": "function Login() {\n // OBTENGO VALORES DESDE FORMULARIO\n let nombre = document.getElementById(\"login-email\");\n let contraseña = document.getElementById(\"login-password\");\n if (nombre.value != \"\" && contraseña.value != \"\") {\n let data = JSON.parse(localStorage.getItem(\"session\"));\n if (data != null) {\n if (nombre.value == data.correo && contraseña.value == data.contraseña) {\n document.getElementById(\"login__warning\").style.display = \"none\";\n localStorage.setItem(\"logged\", \"true\");\n CheckSession();\n } else {\n document.getElementById(\"login__warning\").textContent = \"Datos incorrectos\";\n document.getElementById(\"login__warning\").style.display = \"block\";\n localStorage.setItem(\"logged\", \"false\");\n }\n }\n } else {\n document.getElementById(\"login__warning\").style.display = \"block\";\n document.getElementById(\"login__warning\").textContent = \"Ingresa los datos\";\n }\n}", "title": "" }, { "docid": "f5ef388a612f43af8ae60865928b6007", "score": "0.65579784", "text": "function checkLogin() {\n\t\n\tif(users[username.value] != undefined) {\n\t\n\t\tif(password.value != pwd) {\n\t\t\talert('Mot de passe invalide!');\n\t\t} else {\n\t\t\t//Username ET Mdp acceptés : login\n\t\t\tuser = username.value;\n\t\t\tconsole.log('logged in');\n\t\t\tusername.value = '';\n\t\t\tpassword.value = '';\n\t\t\t\n\t\t\t//Modification du DOM après connexion\n\t\t\tfrm.style.display = 'none';\n\t\t\tdisplayAllWines();\n\t\t\t\n\t\t\t//Création du bouton de déconnexion\n\t\t\tlet button = document.createElement('button');\n\t\t\tbutton.innerHTML = 'Se déconnecter';\n\t\t\tbutton.classList.add('btn');\n\t\t\tbutton.classList.add('btn-outline-primary');\n\t\t\t\n\t\t\t//Déconnexion via bouton\n\t\t\tbutton.addEventListener('click', function() {\n\t\t\t\tuser = null;\n\t\t\t\tthis.remove();\n\t\t\t\tfrm.style.display = 'block';\n\t\t\t\tdisplayAllWines();\n\t\t\t\tconsole.log('logged out');\n\t\t\t});\n\t\t\tlet header = document.querySelector('header');\n\t\t\theader.appendChild(button);\t\t\n\t\t}\n\t} else {\n\t//Pas trouvé d'utilisateur correspondant\n\t\talert('Utilisateur non trouvé!');\n\t}\n}", "title": "" }, { "docid": "bea7f534aae1e79e141dae9fade92d11", "score": "0.6550061", "text": "function view_login() {\n\tvar self = this;\n\n\tif (!self.query.token) {\n\t\tself.view('login');\n\t\treturn;\n\t}\n\n\tGETSCHEMA('Login').workflow2('token', self, function(err, response) {\n\t\tconsole.log(\"default.js - function view_login GETSCHEMA('Login'), err = \", err, \", response = \", response);\n\t\tif (err)\n\t\t\treturn self.view('login');\n\t\tself.redirect('/account/?password=1');\n\t});\n}", "title": "" }, { "docid": "365e200eb2f5131025e0a6d15ea418d6", "score": "0.654945", "text": "function returntologin() {\n regolog = 'log';\n for (var i = 0; i < inpus.length; i++) {\n addclass([inpus[i]], 'hide');\n }\n removeclass([btnLogin, useroremailarea, btnRegadapta], 'hide');\n addclass([btnReturntoLogin, btnSignUp, divdecheck], 'hide');\n}", "title": "" }, { "docid": "acd480086a71fbee2fb1258111a5ef26", "score": "0.6545653", "text": "render(){\n return (\n <form onSubmit={this.handleLogin}>\n <fieldset>\n <h3>Sign In</h3>\n <div className=\"login\">\n <label htmlFor=\"inputUsername\">Username</label>\n <input onChange={this.handleFieldChange} type=\"username\"\n id=\"username\"\n placeholder=\"Username\"\n required=\"\"\n autoFocus=\"\" />\n <label htmlFor=\"inputPassword\">Password</label>\n <input onChange={this.handleFieldChange} type=\"password\"\n id=\"password\"\n placeholder=\"Password\"\n required=\"\" />\n </div>\n <Button variant=\"light\" type=\"submit\">Sign In</Button>\n </fieldset>\n </form>\n )\n }", "title": "" }, { "docid": "3a1bd3cdff98c029be8942c6a7b2e736", "score": "0.65434194", "text": "handleLogin() {\r\n if (this.$.loginForm.validate()) {\r\n this.email = this.emailId;\r\n let password = this.password;\r\n this._makeAjax(`${Window.BaseUrl}/users?email=${this.email}&&password=${password}`, \"get\", null);\r\n this.waiting = true;\r\n this.logout=true;\r\n }\r\n else {\r\n this.message = \"Please enter valid Details\";\r\n this.$.toast.open();\r\n }\r\n\r\n }", "title": "" }, { "docid": "481f16fade6cc24561fc6fab302275a0", "score": "0.6537918", "text": "function loginForm(){\n\tresetVisibility(\"menu-content\");\n\tupdateVisibility(\"login-content\");\n}", "title": "" }, { "docid": "3461ee496c1f6fbf630a374510216809", "score": "0.6528666", "text": "function login() {\n var userData = { \"username\": vm.username, \"password\": vm.password };\n $scope.indexCtrl.login(userData);\n }", "title": "" }, { "docid": "948d392964e50f682a9a459357b871ca", "score": "0.6523835", "text": "function loginUser()\r\n{\r\n var username = document.querySelector('#login-username')\r\n .value;\r\n var password = document.querySelector('#login-password')\r\n .value;\r\n loginController.login(username, password);\r\n}", "title": "" }, { "docid": "0a4ca688427c81b480b9b0977a72fce4", "score": "0.65198404", "text": "static login(login, password) {}", "title": "" }, { "docid": "a79057e40b33140ffa03d2999bb032f4", "score": "0.6515015", "text": "function showLogin(e){\n \n if(typeof e != 'undefined'){\n e.preventDefault();\n }\n\n hideEl(signUpForm);\n hideEl(regHeading);\n hideEl(ctaReg);\n hideEl(showLoginLink);\n showEl(loginForm);\n showEl(loginHeading);\n showEl(ctaLogin);\n showEl(showRegLink);\n\n\n document.title = \"Login ~ Team virgo\";\n}", "title": "" }, { "docid": "cf2646b26a0450f47105af16e5de8940", "score": "0.64991826", "text": "function login() {\n V.util.setData(\"vLogin\",\"true\");\n volLogin.loginStatus = \"true\";\n html.classList.add(\"v-logged-in\");\n }", "title": "" }, { "docid": "782acbc8c581f81ecd5da1043c40dfc7", "score": "0.64958733", "text": "login (ev) {\n ev.preventDefault();\n\n // get the form\n const form = ev.target;\n\n // login credentials\n const email = form.email.value;\n const password = form.password.value;\n\n // clear the form\n form.email.value = \"\";\n form.password.value = \"\";\n\n // attempt login\n Fire.loginEmailPassword(email, password, app.loginSuccessCallback, app.loginErrorCallback);\n\n // close the signupModal\n this.toggleSignupModal(false);\n }", "title": "" }, { "docid": "e600f883d2bd001c0941a28018e78ba3", "score": "0.649253", "text": "function loginAndSubmitForm() {\n // hide the forms for logging in and signing up\n $loginForm.hide();\n $createAccountForm.hide();\n\n // reset those forms\n $loginForm.trigger(\"reset\");\n $createAccountForm.trigger(\"reset\");\n\n // show the stori\n $allStoriesList.show();\n\n // update the navigation bar\n showNavForLoggedInUser();\n }", "title": "" }, { "docid": "f46eddc968a66487d433edbf7c1c3b83", "score": "0.6492481", "text": "submitLogin(e) {\n e.preventDefault();\n\n const { login_user, login_password } = this.state;\n\n if (this.state.login_user === \"\") {\n this.showValidationErr(\"login_user\", \"Введите логин!\");\n }\n\n if (this.state.login_password === \"\") {\n this.showValidationErr(\"login_password\", \"Введите пароль!\");\n }\n\n if (\n !(login_user === \"mirsoft\" && login_password === \"mywordismypassword\")\n ) {\n return this.showValidationErr(\n \"data_error\",\n \"Неправильный логин или пароль!\"\n );\n }\n\n // Login user\n auth.login();\n\n // Redirect to cabinet\n this.props.history.push(\"/cabinet\");\n }", "title": "" }, { "docid": "e646fa92b2e8d5a6e5236ed4d47bf708", "score": "0.64900434", "text": "function abrirLogin() {\n var dialog = $(\"#dialog-form\").dialog({\n width: 280,\n maxWidth: 280,\n height: 'auto',\n modal: true,\n fluid: true,\n resizable: false\n });\n dialog.dialog(\"open\");\n thisForm = new Formulario();\n\n teclado.generarTeclado();\n}", "title": "" }, { "docid": "8e46c2269fc2d4adf16a4da87e1b1e64", "score": "0.6483866", "text": "function displayLogin() {\n messagesFlag = false;\n displayForm('.login', '.chat');\n }", "title": "" }, { "docid": "2e089b4e3314af598af8015f25defe51", "score": "0.64742297", "text": "function loginAndSubmitForm() {\n // hide the forms for logging in and signing up\n $loginForm.hide();\n $createAccountForm.hide();\n\n // reset those forms\n $loginForm.trigger(\"reset\");\n $createAccountForm.trigger(\"reset\");\n\n // show the stories\n $allStoriesList.show();\n\n // update the navigation bar\n showNavForLoggedInUser();\n\n generateUserInfo();\n }", "title": "" }, { "docid": "c7bcae4a8f497ad9d532f16c181d0340", "score": "0.647131", "text": "function loginAndSubmitForm() {\n $loginForm.hide();\n $createAccountForm.hide();\n $loginForm.trigger(\"reset\");\n $createAccountForm.trigger(\"reset\");\n $allStoriesList.show();\n showNavForLoggedInUser();\n syncCurrentUserToLocalStorage();\n generateProfile();\n }", "title": "" }, { "docid": "6237dfc8be5e6213800d32f25892a4b9", "score": "0.64705217", "text": "function runLogin() {\n document.getElementById(\"message-1\").style.display = \"none\";\n document.getElementById(\"username\").innerText = \"\";\n document.getElementById(\"user\").value = \"\";\n showPanel(\"login-panel\");\n document.getElementById(\"user\").focus();\n}", "title": "" }, { "docid": "273ae72600d29414deca87053b8d588d", "score": "0.64657277", "text": "function validateFormLogovanje(){\n var username=document.getElementById(\"username\").value;\n var password=document.getElementById(\"password\").value;\n \n if( (username==null || username==\"\") || (password==null || password==\"\")){\n alert(\"Molimo Vas da unesete oba polja.\");\n return false;\n }else{\n return true;\n }\n }", "title": "" }, { "docid": "fb0760052f74168315f27c2bbc98521a", "score": "0.6452683", "text": "function desenharLogin(){\n\t\t$(\"#conteudo\").html(\n\t\t\t'<div id=\"msg\"></div>'+\n\t\t\t'<div id=\"formLogin\">'+\n\t\t\t'<form class=\"form-horizontal\">'+\n\t\t\t\t'<h4><p class=\"textologin\">Buscar Seu Perfil</p></h4><br>'+\n \t\t\t'<div class=\"control-group\">'+\n \t\t\t'<label class=\"control-label\" for=\"loginn\">Login</label>'+\n \t\t\t'<div class=\"controls\">'+\n \t\t\t\t'<input type=\"text\" placeholder=\"tonySilva_\" id=\"loginn\">'+\n \t\t\t'</div><br>'+\n \t\t\t'<label class=\"control-label\" for=\"senha\">Senha</label>'+\n \t\t\t'<div class=\"controls\">'+\n \t\t\t\t'<input type=\"text\" placeholder=\"123321\" id=\"senha\">'+\n \t\t\t'</div><br>'+\n \t\t\t'</div>'+\n\t\t '</form>'+\n\t\t '<button class=\"btn btn-primary textologin\" id=\"butgetUsu\">Buscar</button>'+\n\t\t '<br><br><p class=\"textologin\">Não possui cadastro? Cadastre <a href=\"#cadastro\">AGORA!<a></p><br>'+\n\t\t\t'</div>'\n\t\t);\n\t\tmsgInfo(\"O servidor está com problemas e o usuário não pode ser buscado!\");\n\n\t\t// Desenha menu de cadastro de usuario\n\t\t$(\"a[href=#cadastro]\").click(function(){\n\t\t\t$(\".active\").removeClass(\"active\")\t\n\t\t\tdesenharCadastroUsuario();\n\t\t});\n\t}", "title": "" }, { "docid": "0ce664e42cdcbcf91b7264eeacf4da6f", "score": "0.6447321", "text": "render() {\n const { showLoginForm } = this.state;\n return (\n <div>\n <div className=\"login\">\n {showLoginForm == false ?\n <div onClick={this.showLoginForm} className=\"login-lock\"><span className=\"ti-lock\"></span></div> : null}\n <h1>HAII</h1>\n <div className=\"ca-logo\"></div>\n {showLoginForm == true ?\n <div> <input className=\"form-control transparent-bg\" type=\"text\" onChange={this.userNameChange} placeholder=\"Username\" required=\"required\" />\n <input className=\"form-control transparent-bg\" type=\"password\" onChange={this.onPasswordChanged} placeholder=\"Password\" required=\"required\" />\n <button onClick={this.login} className=\"submit-icon\">\n <i className=\"ti-angle-right\"></i>\n </button> </div> : null}\n\n </div>\n\n <div className=\"copy-right\">All rights reserved CA 2014 - 2017 </div>\n </div>\n );\n }", "title": "" }, { "docid": "d332d70916a45832c091d754ab50f3d8", "score": "0.6441603", "text": "function Login({ email, senha , handleChangeE, handleChangeS, handleSubmit}) {\n return (\n <div className=\"row\">\n <form className=\"col s12\" onSubmit={handleSubmit}>\n\t\t\t\t<label>Email: \n <input type=\"email\" value={email} onChange={handleChangeE} className=\"validate\"/>\n </label>\n\t\t\t\t<label>Senha:\n <input type=\"password\" value={senha} onChange={handleChangeS} className=\"validate\" />\n </label>\n <br/>\n\t\t\t <div className=\"row center-align\">\n\t\t\t\t {/*<a className=\"waves-effect waves-light btn teal darken-2\" id=\"buttonSignIn\">Login</a>*/}\n <input type=\"submit\" value=\"Login\" />\n\t\t\t </div>\n </form>\n\t\t\t<div className=\"row center-align\">\n\t\t\t\tE novo?<a href=\"/cadastro\"> Crie uma conta.</a>\n </div>\n\t\t</div>\n );\n}", "title": "" }, { "docid": "cfe43cb78ac895921c0b5effa1f5f0a0", "score": "0.64162964", "text": "function login() {\n if (\n document.querySelector(\".input-div__form__button\")\n .innerHTML === \"Register\"\n ) {\n document.querySelector(\".input-div__form__button\")\n .innerHTML = \"Login\";\n let form = document.querySelector(\".login-registration__form\");\n form.removeChild(document.querySelector(\"#confirmPassword\"));\n form.removeChild(document.querySelector(\"#confirmPasswordLabel\"));\n }\n}", "title": "" }, { "docid": "ada7a0a06fce44dc841bdf21f083ee8b", "score": "0.6415714", "text": "function App() {\n return (\n <div className=\"App\">\n \n <header className=\"App-header\">\n \n <form className=\"formulario\">\n <h2>\n Área de Cadastro! Login \n </h2>\n <p>Name:</p>\n <input \n type=\"text\" \n className=\"nome\" \n placeholder=\"Nome Completo\" \n required\n />\n <p>Email:</p>\n <input \n type=\"email\" \n className=\"email\" \n placeholder=\"Email Principal\" \n required\n />\n <p>Senha:</p>\n <input \n id=\"password\"\n type=\"password\" \n className=\"password\" \n placeholder=\"senha de 8 dígitos\" \n // value={password}\n required\n /> <br />\n <input \n type=\"submit\" \n className=\"btn\" \n placeholder=\"enviar\" \n />\n </form>\n <p>\n Site &#174; <a href=\"admistrador.js\">www.progrmadorz.com.br</a>\n </p>\n <p id=\"paragrafo\">\n Cadastre-se e receba promoções e descontos.\n </p>\n <p id=\"paragrafo\">\n Esse site é para todos que deseja contratar um \n <strong> programdor! </strong>.E para quem busca conhecimento na área \n da ciência da computação.\n </p>\n \n </header>\n </div>\n );\n}", "title": "" }, { "docid": "b1bad925bb1a46bdbb0a7b08e55722d0", "score": "0.64134115", "text": "render() {\n return (\n <div className=\"App\">\n <form>\n <label>username</label>\n <input value={this.state.username} placeholder='username' onChange={this.handleInputChange} name='username' />\n <label>Password</label>\n <input value={this.state.password} placeholder='password' onChange={this.handleInputChange} name='password' type='password' />\n <button className='log-button' onClick={this.handleSubmit} >Login</button>\n </form>\n </div>\n );\n }", "title": "" }, { "docid": "6f7aa95afbaca3c90029805f8e7b46e7", "score": "0.6412674", "text": "render(){\n return (\n <form id=\"login-card\" className=\"_Theme_outerBorder_Default_ _Theme_login_Default_\"\n onSubmit={\tthis.login.bind(this)\t} >\n\n\t\t\t\t<div id=\"login-form\"\tclassName=\"h-center-margin\">\n\n\t \t\t\t<contentTitle>\tLog in\t</contentTitle>\n\n\t \t\t\t<annotation>\tEmail Address / Username\t</annotation>\n\t \t\t\t<input name=\"username\" type=\"text\" className=\"form-control\" required\n\t \t\t\t\t\t placeholder='e.g. \" david.smith@example.com \", \" david_smith72 \"... '\n\t ref={\t(this_elem) => (this.username_email_field = this_elem) }/>\n\n\t \t\t\t<annotation>\tPassword\t</annotation>\n\t \t\t\t<input name=\"password\" type=\"password\" className=\"form-control\" required\n\t ref={\t(this_elem) => (this.pwd_field = this_elem) } />\n\n\t <contentLine>\n\t <label className=\"align-left\">\n\t Remember me\n\t <input type=\"checkbox\" name=\"remember\" />\n\t </label>\n\n\t <Link to=\"/forgetPass\" className=\"align-right\" type=\"text/html\">Forget Password?</Link>\n\t </contentLine>\n\n\t {this.state.button}\n\n\t <a className=\"contentLink\t\th-center-margin\" href=\"javascript:void(0)\" onClick={this.flip.bind(this)}>\tI would like to join </a>\n\n\t\t\t\t</div>\n\n\t\t\t</form>\n );\n }", "title": "" }, { "docid": "d82cba93b9b68baf1196cf8bd7a241fc", "score": "0.64107436", "text": "function login() {\r\n var loginFormDt = document.querySelector('#login-form');\r\n var logEmail = loginFormDt.querySelector('input[type=\"email\"]');\r\n var logPass = loginFormDt.querySelector('input[type=\"password\"]');\r\n var error = document.querySelector('#login');\r\n if (db.email == logEmail.value && db.password == logPass.value) {\r\n window.location = '../html/dashboard.html';\r\n return false;\r\n } else {\r\n var errtxt = document.createTextNode('username and password are incorrect');\r\n var errorP = document.createElement('p');\r\n error.appendChild(errorP);\r\n errorP.appendChild(errtxt);\r\n return false;\r\n }\r\n\r\n}", "title": "" }, { "docid": "6db054101317d6734fcf39ad09ffbd12", "score": "0.63936406", "text": "function myLogin(a_text, action, repeat, user) {\n\n gebi('hgsmodl_bbb').innerHTML = '';\n gebi('hgsmodl_bbb').innerHTML = '<h1 style=text-align:center;\">' + a_text.replace(/\\n/gi, \"<br>\") + '</h1>';\n positionDialog('hgsmodl_aaa');\n if (repeat) {\n gebi('passwd2hide').style.display = '';\n gebi('user').value = user;\n }\n gebi('hgsmodl_bbb_ok').form.action = action;\n gebi('hgsmodl_bbb_ok').onclick = function () {\n loDiv.style.display = 'none';\n veil.veilOff();\n window.onkeydown = keyDown;\n };\n gebi('hgsmodl_bbb_ok').focus();\n window.onkeydown = handleKeyDown;\n return;\n }", "title": "" }, { "docid": "87c6caff89a95fec3b4b5876f8e3f7a2", "score": "0.6391152", "text": "function handleLoginForm(e) {\n e.preventDefault();\n loginForm.classList.add(HIDDEN_TAG);\n const username = loginInput.value;\n localStorage.setItem(USER_NAME, username);\n greeting.innerText = `Hello ${username}`;\n greeting.classList.remove(HIDDEN_TAG);\n}", "title": "" }, { "docid": "2e654782677353762c7ce8e55ab8e67d", "score": "0.6384019", "text": "function showLogin() {\n openLoginDialog();\n }", "title": "" }, { "docid": "0ed2e1ca46546c58effc1c55ac850c39", "score": "0.6382865", "text": "function loginCheck()\r\n{\r\n\tvar user = document.getElementById('username');\r\n\tvar pwd = document.getElementById('pwd');\r\n\r\n\tnotEmpty(user, 'Πρέπει να βάλετε το username σας');\r\n\tnotEmpty(pwd, 'Πρέπει να βάλετε τον κωδικό σας');\r\n}", "title": "" }, { "docid": "a3fb238ae6de13a92a5bbeaae4ef6496", "score": "0.637286", "text": "function Login() {\n return (\n <Col colSize={`col-xs-12 col-sm-8 offset-sm-2 col-md-6 offset-md-3`}>\n <Context.Consumer>\n {({currentUser, forms: {loginForm},...rest}) => {\n if(currentUser) return <Redirect to=\"/home\" />\n return <Form form={loginForm} formName={\"loginForm\"} {...rest} />\n }}\n </Context.Consumer>\n </Col>\n );\n}", "title": "" }, { "docid": "2e7a328b03a6a821616fc98bbf709100", "score": "0.63670695", "text": "function login() {\n var ourdata = $(\"form\").serializeArray();\n $g_username = ourdata[0][\"value\"];\n if ($g_username === null || $g_username === \"\") {\n reset();\n return;\n }\n $(\"#login\").hide();\n $(\"#navbar\").show();\n $(\"#navbar\").html('<span class=\"remove\" id=\"reset\">logout</a>');\n /* shouldn't be here, but it's here because it works. Will fix later. */\n $(\"#reset\").off().on(\"mousedown\", function() {\n reset();\n return false;\n });\n startup();\n return;\n}", "title": "" }, { "docid": "09198ff9c40e5ca07b0bcfce3031f5a0", "score": "0.6364687", "text": "function validarLogin()\n{\n\tvar estado=true;\n\tvar nombre = document.getElementById('lnombre').value;\n\tif ((nombre.length == 0) || (nombre.length >30) || (/^\\s+$/.test(nombre)) || (!isNaN(nombre)))\n\t{\t\n\t\tdocument.getElementById('mostrarError').innerHTML=\"Nombre obligatorio.\";\n\t\tdocument.getElementById('mostrarError').style.color=\"red\";\n\t\testado=false;\n\t}\n\telse\n\t{\n\t\tdocument.getElementById('mostrarError').innerHTML=\"\";\n\t}\n\n\tvar contrasena = document.getElementById('lcontrasena').value;\n\tif ((contrasena.length > 8) || (contrasena.length < 4)) \n\t{\n\t\terrorTexto(datos,error,literal);\t\n\t\tdocument.getElementById('mostrarError').innerHTML=\"Contraseña obligatoria.\";\n\t\tdocument.getElementById('mostrarError').style.color=\"red\";\n\t\testado=false;\n\t}\n\telse\n\t{\n\t\tdocument.getElementById('mostrarError').innerHTML=\"\";\n\t}\t\n\treturn estado;\n}", "title": "" }, { "docid": "e262ad1fb0455e7607b628bd169b9f25", "score": "0.636447", "text": "async login (username, password) {\n await this.inputUsername.setValue(username);\n await this.inputPassword.setValue(password);\n await this.btnSubmit.click();\n }", "title": "" }, { "docid": "f33f4d2fe377be6ba278d51ff1422f1e", "score": "0.6364338", "text": "_onLoginSubmit(event) {\n const data = FormSerializeUtil.serializeJson(this._form);\n if (!data.useWebAuthn) {\n return; // Use regular password based login\n }\n\n event.preventDefault();\n PageLoadingIndicatorUtil.create();\n console.log('Requesting login options from server');\n this._sendRequest(this.options.loginChallengeUrl, {username: data.username}, this._getCredential.bind(this));\n }", "title": "" }, { "docid": "d49830c62c1b82acfafd268a58bb9dc0", "score": "0.6358354", "text": "static login(username, password) {\n\n }", "title": "" }, { "docid": "d00c44bfefb17adefb184807d33e0c47", "score": "0.6356914", "text": "function CamposLogin(props){ \n const [user, setUser] = useState()\n const [pass, setPass] = useState()\n const [userLogName] = useState(props.nameShow)\n\n if(IsLogged() === false){ \n return (\n <Form className=\"form-inline my-2 my-lg-0\">\n <Input className=\"form-control mr-sm-2\" \n value={user} onChange={e => setUser(e.target.value)} \n type=\"mail\" placeholder=\"Usuário\" \n aria-label=\"Usuário\" \n onKeyPress={e => pressEnter(e, user, pass )}\n />\n <Input className=\"form-control mr-sm-2\" \n value={pass} onChange={e => setPass(e.target.value)} \n type=\"password\" placeholder=\"Senha\" aria-label=\"Senha\" \n onKeyPress={e => pressEnter(e, user, pass) }\n />\n <Button className=\"btn my-2 my-sm-0\" outline color='success' \n onClick={e => login(user, pass)}\n >Login</Button>\n </Form> \n )\n }else{ \n return ( \n <Form className=\"form-inline my-2 my-lg-0\"> \n <span style={{marginRight:'10px'}}> Bem vindo {userLogName} </span>\n <Button className=\"btn my-2 my-sm-0\" \n onClick={ e => logOut() } \n outline color='danger' \n >Sair</Button> \n </Form>\n )\n }\n}", "title": "" }, { "docid": "330349840ed2e6a93ee073e040eb4a30", "score": "0.63561237", "text": "function loginAndSubmitForm() {\n // hide the forms for logging in and signing up\n $loginForm.hide();\n $createAccountForm.hide();\n\n // reset those forms\n $loginForm.trigger(\"reset\");\n $createAccountForm.trigger(\"reset\");\n\n // show the stories\n $allStoriesList.show();\n\n // update the navigation bar\n showNavForLoggedInUser();\n }", "title": "" }, { "docid": "330349840ed2e6a93ee073e040eb4a30", "score": "0.63561237", "text": "function loginAndSubmitForm() {\n // hide the forms for logging in and signing up\n $loginForm.hide();\n $createAccountForm.hide();\n\n // reset those forms\n $loginForm.trigger(\"reset\");\n $createAccountForm.trigger(\"reset\");\n\n // show the stories\n $allStoriesList.show();\n\n // update the navigation bar\n showNavForLoggedInUser();\n }", "title": "" }, { "docid": "330349840ed2e6a93ee073e040eb4a30", "score": "0.63561237", "text": "function loginAndSubmitForm() {\n // hide the forms for logging in and signing up\n $loginForm.hide();\n $createAccountForm.hide();\n\n // reset those forms\n $loginForm.trigger(\"reset\");\n $createAccountForm.trigger(\"reset\");\n\n // show the stories\n $allStoriesList.show();\n\n // update the navigation bar\n showNavForLoggedInUser();\n }", "title": "" }, { "docid": "67d765af4d1ee10e5b524dbb96877a71", "score": "0.63560903", "text": "function login(){\n\t$(\"#ui_notification\").empty();\n\n\t// validate all inputs to see if there is any error (frontend validation)\n\tif (login_validate() == 1){\n\t\t$(\"#password\").val(\"\");\n\t\treturn;\n\t}\n\t// update the authorization header so it can be sent to the server correctly\n\tcredentials = { \n\t\t\"username\": $(\"#username\").val(), \n\t\t\"password\": $(\"#password\").val() \n\t};\n\tlogin_send_request(); // make a post request to the server and retrieve all the information\n}", "title": "" }, { "docid": "ea51655343987d4f7b05167f320cd75d", "score": "0.63546693", "text": "function Login(){\n\t/*\n\t * Este es le metodo constructor de la clase\t\n\t */\n\tthis.init = function(login){\n\t\t$('#msg_error').hide();\n\t\t$('#usr_name').keypress(function(){\n\t\t\t$('#msg_error').hide(500);\n\t\t\t$('#usr_name').css({\n\t\t\t\t'border':'1px solid #A8A8A5'\n\t\t\t});\n\t\t});\n\t\t$('#usr_password').keypress(function(){\n\t\t\t$('#msg_error').hide(500);\n\t\t\t$('#usr_password').css({\n\t\t\t\t'border':'1px solid #A8A8A5'\n\t\t\t});\n\n\t\t});\n\n\t\t/// Estos son los eventos de teclado\n\n\t\t$('#usr_name').keypress(function(event){\n\t\t\tvar keycode = (event.keyCode ? event.keyCode : event.which);\n\t\t\tif(keycode == '13'){\n\t\t\t\t//var login = new Login();\n\t\t\t\tlogin.verifyAccount();\n\t\t\t}\n\t\t});\n\n\t\t$('#usr_password').keypress(function(event){\n\t\t\tvar keycode = (event.keyCode ? event.keyCode : event.which);\n\t\t\tif(keycode == '13'){\n\t\t\t\t//var login = new Login();\n\t\t\t\tlogin.verifyAccount();\n\t\t\t}\n\t\t});\n\n\n\t\t//$('#bt_ingresar').click(new Login().verifyAccount);\n\t}\n\t/**\n\t * Metodo encargado de verificar la cuenta\n\t */\n\tthis.verifyAccount= function(){\n\t\tif($('#usr_name').val() == ''){\n\t\t\t$('#msg_error').hide();\n\t\t\t$('#msg_error').empty();\n\t\t\t$('#msg_error').html('<p><img src=\"images/24x24/notawarning.png\" align=\"absmiddle\">El campo <b>Nombre</b> no puede estar vacio por favor complete la informaci&oacute;n.</p>');\n\t\t\t$('#msg_error').show(500);\n\t\t\t$('#usr_name').css('border', '1px solid red');\n\t\t}else if($('#usr_password').val() == ''){\n\t\t\t$('#msg_error').hide();\n\t\t\t$('#msg_error').empty();\n\t\t\t$('#msg_error').html('<p><img src=\"images/24x24/notawarning.png\" align=\"absmiddle\">El campo <b>Clave</b> no puede estar vacio por favor complete la informaci&oacute;n.</p>');\n\t\t\t$('#msg_error').show(500);\n\t\t\t$('#usr_password').css('border', '1px solid red');\n\t\t}else{\n\t\t\tvar dataString = new FormData();\n\t\t\tdataString.append('usr_name', $('#usr_name').val());\n\t\t\tdataString.append('usr_password', $('#usr_password').val());\n\t\t\t$.ajax({\n\t\t\t\turl:'valida_psw_tb.php',\n\t\t\t\ttype:'POST',\n\t\t\t\tdataType:\"json\",\n\t\t\t\tdata:dataString,\n\t\t\t\tprocessData:false,\n\t\t\t\tcontentType:false,\n\t\t\t\tcache: false,\n\t\t\t\tbeforeSend: function(data){\n\t\t\t\t\tif(data && data.overrideMimeType) {\n\t\t\t\t\t\tdata.overrideMimeType(\"application/json;charset=UTF-8\");\n\t\t\t\t\t}\n\t\t\t\t\t$('#fomulario_login').hide();\n\t\t\t\t\t$('#fomulario_login').empty();\n\t\t\t\t\t$('#fomulario_login').html('<p><br><br><img src=\"img/loading.gif\"></p>');\n\t\t\t\t\t$('#fomulario_login').show(100);\n\t\t\t\t},\n\t\t\t\tsuccess: function(data){\n\t\t\t\t if(data.msg == 'menu_s'){\n\t\t\t\t\t\t$(location).attr('href', 'menu_s.php');\n\t\t\t\t\t\t//console.log('Esta dirigiendo a menu_s.php');\n\t\t\t\t }else if(data.msg == 'no'){\n\t\t\t\t \t $('#msg_error').hide();\n\t\t\t\t\t\t$('#msg_error').empty();\n\t\t\t\t\t\t$('#msg_error').html('<p><img src=\"images/24x24/notawarning.png\" align=\"absmiddle\">Usted no es usuario del sistema intente con otra cuenta por favor.</p>');\n\t\t\t\t\t\t$('#msg_error').show(500);\n\t\t\t\t\t\tvar dataForm = ' <table> <tr><td >Nombre:</td><td ><input type=\"text\" name=\"login\" id=\"usr_name\"></td></tr><tr><td >Clave:</td><td ><input type=\"password\" name=\"clave\" id=\"usr_password\"></td></tr><tr><td><br></td><td></td></tr></table><input name=\"enviar\" type=\"submit\" value=\"Ingresar\" id=\"bt_ingresar\" onClick=\"new Login().verifyAccount()\"> ';\n\t\t\t\t\t\t$('#fomulario_login').hide();\n\t\t\t\t\t\t$('#fomulario_login').empty();\n\t\t\t\t\t\t$('#fomulario_login').html(dataForm);\n\t\t\t\t\t\t$('#fomulario_login').show(500);\n\t\t\t\t\t\t$('#usr_name').keypress(function(){\n\t\t\t\t\t\t\t$('#msg_error').hide(500);\n\t\t\t\t\t\t\t$('#usr_name').css({\n\t\t\t\t\t\t\t\t'border':'1px solid #A8A8A5'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t\t$('#usr_password').keypress(function(){\n\t\t\t\t\t\t\t$('#msg_error').hide(500);\n\t\t\t\t\t\t\t$('#usr_password').css({\n\t\t\t\t\t\t\t\t'border':'1px solid #A8A8A5'\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t});\n\t\t\t\t\t\t$('#usr_name').keypress(function(event){\n\t\t\t\t\t\t\tvar keycode = (event.keyCode ? event.keyCode : event.which);\n\t\t\t\t\t\t\tif(keycode == '13'){\n\t\t\t\t\t\t\t\tvar login = new Login();\n\t\t\t\t\t\t\t\tlogin.verifyAccount();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t$('#usr_password').keypress(function(event){\n\t\t\t\t\t\t\tvar keycode = (event.keyCode ? event.keyCode : event.which);\n\t\t\t\t\t\t\tif(keycode == '13'){\n\t\t\t\t\t\t\t\tvar login = new Login();\n\t\t\t\t\t\t\t\tlogin.verifyAccount();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\n\n\t\t\t\t }\t\n\t\t\t\t},\n\t\t\t\terror: function(data){\n\t\t\t\t\t$('#msg_error').hide();\n\t\t\t\t\t$('#msg_error').empty();\n\t\t\t\t\t$('#msg_error').html('<p><img src=\"images/24x24/notawarning.png\" align=\"absmiddle\">Ocurrio un error en el sistema por favor vuelva a intentarlo.</p>');\n\t\t\t\t\t$('#msg_error').show(500);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4973b9a344d641b256d6428aa842dc44", "score": "0.6354038", "text": "function updateLogin(){\r\n \t//clear the whole form first\r\n \t// in case the existing information in the switch situation\r\n \tform.reset();\r\n\t\t$('#login_fields').show();\r\n $('#new_login_fields').hide();\r\n $('#submit').hide();\r\n }", "title": "" }, { "docid": "ebf7f05ada6f994120fcbc9a979b389d", "score": "0.63445526", "text": "function LoginPanel() {\n var container = document.createElement('section');\n container.className = 'login';\n\n var title = document.createElement('h2');\n // var titleText = document.createTextNode('Login');\n // title.appendChild(titleText);\n title.innerText = 'Login';\n container.appendChild(title);\n\n var form = document.createElement('form');\n form.className = 'login__form';\n container.appendChild(form);\n\n form.addEventListener('submit', function (event) {\n event.preventDefault();\n\n var inputs = form.getElementsByTagName('input');\n\n var emailInput = inputs[0];\n var passwordInput = inputs[1];\n\n var email = emailInput.value;\n var password = passwordInput.value;\n\n this.onLogin(email, password);\n\n // var errorPanel = document.getElementsByClassName('login__error')[0];\n\n // try {\n // login(email, password, function (user) {\n // emailInput.value = '';\n // passwordInput.value = '';\n\n // errorPanel.style.display = 'none';\n // errorPanel.innerText = '';\n\n // loginSection.hide();\n // welcomeSection.show();\n // welcomeName.innerText = user.name;\n // });\n // } catch (err) {\n // errorPanel.show();\n // errorPanel.innerText = err.message;\n // }\n }.bind(this));\n\n var emailLabel = document.createElement('label');\n emailLabel.setAttribute('for', 'email');\n emailLabel.innerText = 'E-mail:';\n form.appendChild(emailLabel);\n\n var emailInput = document.createElement('input');\n emailInput.type = 'email';\n emailInput.name = 'email';\n emailInput.placeholder = 'email';\n form.appendChild(emailInput);\n\n var passwordLabel = document.createElement('label');\n passwordLabel.setAttribute('for', 'password');\n passwordLabel.innerText = 'Password:';\n form.appendChild(passwordLabel);\n\n var passwordInput = document.createElement('input');\n passwordInput.type = 'password';\n passwordInput.name = 'password';\n passwordInput.placeholder = 'password';\n form.appendChild(passwordInput);\n\n var submitButton = document.createElement('button');\n submitButton.type = 'submit';\n submitButton.innerText = 'Login';\n form.appendChild(submitButton);\n\n var error = document.createElement('section');\n error.className = 'login__error';\n container.appendChild(error);\n\n var registerLink = document.createElement('a');\n registerLink.href = '#';\n registerLink.innerText = 'Register'\n registerLink.className = 'login__register-link';\n container.appendChild(registerLink);\n\n this.element = container;\n}", "title": "" }, { "docid": "00ed523b889d283577ca5849b095223c", "score": "0.63404846", "text": "login(username, password) {\n\t\tthis.inputUsername.waitForDisplayed({ timeout: 3000 });\n\t\tthis.inputUsername.setValue(username);\n\t\tthis.inputPassword.setValue(password);\n\t\tthis.btnSignIn.click();\n\t}", "title": "" }, { "docid": "7e0f86d5243323cdee4c8323fd879c0a", "score": "0.63350016", "text": "function FormValidationLogin() {\n var form = $(\"#formLogin\");\n form.validate({\n lang: 'es',\n errorElement: \"span\",\n errorClass: \"help-block help-block-error\",\n focusInvalid: true,\n ignore: \"\",\n rules: {\n idUsuario: {\n maxlength: 20,\n required: function (element) {\n return $(\"#correo\").is(':blank');\n },\n },\n correo: {\n email: true,\n maxlength: 100,\n required: function (element) {\n return $(\"#idUsuario\").is(':blank');\n },\n },\n clave: {\n required: true,\n maxlength: 20\n },\n }, highlight: function (e) {\n $(e).closest(\".form-group\").addClass(\"has-error\");\n }, unhighlight: function (e) {\n $(e).closest(\".form-group\").removeClass(\"has-error\");\n }, success: function (e) {\n e.closest(\".form-group\").removeClass(\"has-error\");\n }, submitHandler: function (e) {\n //Validamos el drag and drop\n if (validationDragDrop()) {\n //Hacemos el submit del formulario con la llamada a la funcion\n $scope.login();\n }\n }});\n }", "title": "" }, { "docid": "3b4373a985bfca4465229a0c83cfbe83", "score": "0.63338435", "text": "render() {\n return (\n <div>\n <form className='login_form' onSubmit={this.login}>\n <input\n className='input'\n type='text'\n name='email'\n value={this.state.credentials.username}\n placeholder='UserName'\n onChange={this.handleChange}\n required\n />\n <input\n className='input'\n type='password'\n name='password'\n value={this.state.credentials.password}\n placeholder='Password'\n onChange={this.handleChange}\n required\n />\n <select name=\"role\">\n <option value=\"student\">Student</option>\n <option value=\"helper\">Helper</option>\n </select>\n <button>Please Log In</button>\n </form>\n </div>\n )\n }", "title": "" }, { "docid": "58839e36dbcd28f5afd28083402892f8", "score": "0.6327645", "text": "function page_LOGIN() {\r\n //if (!$(\"form > p.error:visible\").length && settings[\"autologin\"]) {\r\n // No previous log in error - attempt to log in\r\n console.log(\"Setting username\");\r\n $(\"input#user\").val(settings[\"nw_username\"]);\r\n console.log(\"Setting password\");\r\n $(\"input#pass\").val(settings[\"nw_password\"]);\r\n console.log(\"Clicking Login Button\");\r\n $(\"div#login > input\").click();\r\n //}\r\n dfdNextRun.resolve(delay.LONG);\r\n }", "title": "" }, { "docid": "7471ddfcc65878e159bd941847314da6", "score": "0.63264465", "text": "function handleLoginFormSubmit(e) {\n e.preventDefault();\n const id = document.querySelector('#logonId').value;\n const pass = document.querySelector('#logonPassword').value;\n LogOn(id, pass);\n return false;\n}", "title": "" }, { "docid": "a9b45dc00146bd244a1b4955bde70b36", "score": "0.63240916", "text": "function showLoginForm(e) {\n if (e.keyCode == 13) {\n $(\"#login-view .info\").addClass(\"fadeOut\");\n $(\"#login-view .form-login\").addClass(\"fadeIn\");\n $(\".form-login #username\").focus();\n } \n }", "title": "" }, { "docid": "dba680b067df4eed9edd99e436114d18", "score": "0.63202304", "text": "function login() {\n\tlet user = document.getElementById(\"username\").value;\n\tlet pass = document.getElementById(\"password\").value;\n\tpass = md5(pass);\n\n\tmakeRequest(\n\t\tPOST,\n\t\t\"https://arcgis-backend.herokuapp.com/api/users/login\", {\n\t\t\tusername: user,\n\t\t\tpassword: pass\n\t\t}, loginSuccessCallback,\n\t\tloginErrorCallback\n\t)\n}", "title": "" }, { "docid": "f5e7a3c3f1f79cc9f2ce8dacb95fed4e", "score": "0.6316971", "text": "function ready_login() {\n $('.modal-button').click(function() {\n $('.login-form').submit();\n });\n }", "title": "" }, { "docid": "7d5fd2b5d390ef975de656c0b9f24929", "score": "0.63121283", "text": "function checkFormValues(name, password) {\r\n if (name == \"\" && password == \"\") {\r\n document.querySelector(\"#username\").style.border = \"3px solid crimson\";\r\n document.querySelector(\"#password\").style.border = \"3px solid crimson\";\r\n return;\r\n } else if (name == \"\" || name.length < 6) {\r\n\r\n document.querySelector(\"#username\").style.border = \"3px solid crimson\"\r\n\r\n return;\r\n\r\n } else if (password == \"\" || password.length < 6) {\r\n document.querySelector(\"#password\").style.border = \"3px solid crimson\"\r\n return;\r\n } else {\r\n document.querySelector(\".sign-in\").style.display = \"none\";\r\n document.querySelector(\".playlist\").style.display = \"grid\";\r\n\r\n }\r\n\r\n\r\n}", "title": "" }, { "docid": "2c851ed8797639167355c26347aad16b", "score": "0.63116246", "text": "function login_config(componentId, componentPadre){\n var title= \"Login\";\n var labelButton = \"Ingresar\";\n var placeholderUser= \"Ingrese su Email\";\n var placeholderPass= \"Ingrese su Contraseña\";\n var labelCheck= \"Recordarme\";\n if(componentId != 0 && componentId != null){\n var elem= $(\"#modalConfiguracion\");\n title= elem.find(\"input[name='title']\").val(); \n labelButton= elem.find(\"input[name='labelButton']\").val(); \n placeholderUser= elem.find(\"input[name='placeholderUser']\").val();\n placeholderPass= elem.find(\"input[name='placeholderPass']\").val();\n labelCheck= elem.find(\"input[name='labelCheck']\").val();\n }\n var json= '{\\n\\\n \"nombre\": \"login\",\\n\\\n \"configuracion\": {\\n\\\n \"method\": \"POST\",\\n\\\n \"action\": \"url\",\\n\\\n \"title\": \"' + title + '\",\\n\\\n \"labelButton\": \"' + labelButton + '\", \\n\\\n \"user\": {\\n\\\n \"placeholder\": \"' + placeholderUser + '\",\\n\\\n \"name\": \"email\"\\n\\\n },\\n\\\n \"pass\": {\\n\\\n \"placeholder\": \"' + placeholderPass + '\",\\n\\\n \"name\": \"pass\"\\n\\\n },\\n\\\n \"check\": {\\n\\\n \"name\": \"check\",\\n\\\n \"value\": \"check\",\\n\\\n \"label\": \"' + labelCheck + '\"\\n\\\n }\\n\\\n }\\n\\\n }';\n \n var datos = {nombre:\"Login Form\", form:\"form_login\", fn_datos:\"login_datos\", inComponent:false, sortable: false, \n components: false, options: false, preferences: true};\n configurar_y_llamar(json, datos, componentId, componentPadre);\n}", "title": "" }, { "docid": "8f1f7ea500d6cea58bce4cebe93c0b1a", "score": "0.63098603", "text": "function login(){\n Model.setStorageType(); // based on 'remember me'\n\n // begin the login\n var login = Auth.login.submit({\n email: Model.formEmail,\n password: Model.formPassword\n });\n\n // login promise (start loading action?)\n login.$promise.then(function(data){\n Model.setJwtString(data.jwt_token);\n Model.updateUser();\n $location.path(Model.getPrevPath());\n // todo toast user login possibly?\n });\n }", "title": "" }, { "docid": "c0d1ff10491c3b4c55a3154d355244f4", "score": "0.63098335", "text": "function LoginForm() {\n return h(\n \"form\",\n {\n id: \"loginForm\",\n onsubmit: (event) => {\n event.preventDefault();\n const email = event.target.elements.email.value;\n const password = event.target.elements.password.value;\n login(email, password).then((user) => {\n // save the access token in localStorage so the user stays logged in\n window.localStorage.setItem(\"dogs-token\", user.access_token);\n\n // show the welcome message instead of the form\n const messageEl = h(\"span\", {}, `Hello ${user.name}`);\n welcomeEl.innerHTML = \"\";\n welcomeEl.append(messageEl, logoutEl);\n loginFormEl.replaceWith(welcomeEl);\n });\n },\n },\n h(\"label\", { for: \"email\" }, \"Email\"),\n h(\"input\", {\n id: \"email\",\n type: \"email\",\n name: \"email\",\n placeholder: \"Email\",\n }),\n h(\"label\", { for: \"password\" }, \"Password\"),\n h(\"input\", {\n id: \"password\",\n type: \"password\",\n name: \"password\",\n placeholder: \"Password\",\n \"aria-label\": \"Password\",\n }),\n h(\"button\", {}, \"Log in\")\n );\n}", "title": "" }, { "docid": "3d48b8b419e2ca9dbaaa09619dcbde61", "score": "0.6307545", "text": "render() {\n return (\n <form onSubmit={this.props.handleSubmit} className=\"loginForm\">\n <Field\n name=\"userName\"\n type=\"text\"\n component={LoginFormInput}\n label=\"Email\"\n className=\"loginForm__input\"\n validate={[required, minLength, maxLength]}\n />\n <Field\n name=\"password\"\n type=\"password\"\n component={LoginFormInput}\n label=\"Password\"\n className=\"loginForm__input\"\n validate={[required]}\n />\n <Field\n name=\"remember\"\n type=\"checkbox\"\n component={LoginFormInput}\n label=\"Remember me?\"\n className=\"loginForm__input--inline\"\n />\n <button type=\"submit\" className=\"loginForm__btn\">\n Log In\n </button>\n </form>\n );\n }", "title": "" }, { "docid": "2fc5b4b2eac3958c9b8ee1f1f8f661fb", "score": "0.6299729", "text": "login(userid, password) {\n this.inputUserID.waitForDisplayed();\n this.inputUserID.setValue(userid);\n this.inputPassword.setValue(password);\n this.btnLogin.click();\n }", "title": "" }, { "docid": "1f40af0b8d651099654a71aaddae259c", "score": "0.62983394", "text": "function login() {\n var a = document.getElementById(\"inputEmail\").value;\n var b = document.getElementById(\"inputPassword\").value;\n if (a == null || a == \"\", b == null || b == \"\") { \n alert(\"Complete los campos\");\n return false;\n }\n \n localStorage.setItem('usuario', a);\n\n document.location.href=\"index.html\";\n \n return true;\n}", "title": "" }, { "docid": "ab8f58ed30ca1007a85b0227631661cd", "score": "0.62931377", "text": "function LoginPage(){}", "title": "" }, { "docid": "e324437b7e2ecce295e089347ead78a8", "score": "0.62915576", "text": "render() {\r\n return (\r\n <div className=\"container\">\r\n <hr className=\"mt-5\"></hr>\r\n <h3 className=\"text-primary text-center\">Login</h3>\r\n <div className=\"\">\r\n <div className=\"card mt-4 shadow mb-5\">\r\n <div className=\"card-body\">\r\n\r\n {/* JSX for showing form fields start */}\r\n <form className=\"container\" onSubmit={this.handleFormSubmit}>\r\n <div className=\"\">\r\n <div className=\"\">\r\n <Input\r\n type={'text'}\r\n changed={this.handleChange}\r\n title={'Email Address'}\r\n value={this.state.login.userName.value}\r\n touched={this.state.login.userName.touched}\r\n valid={this.state.login.userName.valid}\r\n name={'userName'} />\r\n </div>\r\n <div className=\"\">\r\n <Input\r\n type={'password'}\r\n changed={this.handleChange}\r\n value={this.state.login.password.value}\r\n touched={this.state.login.password.touched}\r\n valid={this.state.login.password.valid}\r\n title={'Password'}\r\n name={'password'} />\r\n </div>\r\n </div>\r\n <a href=\"\" className=\"\">Reset my password</a><br></br>\r\n <p>New Member?<NavLink to=\"/\" className=\"\">Register Now</NavLink></p>\r\n <Button title={'LOGIN'} disab={!this.state.formIsValid}></Button>\r\n </form>\r\n {/* JSX for showing form fields end */}\r\n \r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n }", "title": "" }, { "docid": "e8d7d48aac3eeef274265d530b53c01f", "score": "0.62913585", "text": "loginPortal() {\r\n this.login.firstName.type(data.username)\r\n this.login.lastName.type(data.password)\r\n this.login.submitBtn.click()\r\n}", "title": "" }, { "docid": "e21317d0308042afbebca867b609f370", "score": "0.62898755", "text": "function loginAndSubmitForm() {\n // hide the forms for logging in and signing up\n $loginForm.hide();\n $createAccountForm.hide();\n\n // reset those forms\n $loginForm.trigger(\"reset\");\n $createAccountForm.trigger(\"reset\");\n\n // show the stories\n $allStoriesList.show();\n \n // update the navigation bar\n showNavForLoggedInUser();\n createUserProfile();\n }", "title": "" }, { "docid": "13d1306ecba86c64b846ab615ccb5a77", "score": "0.6283933", "text": "function newLogIn() {\n\n // make the input field blank\n document.querySelector(\"#user\").value = \"\";\n document.querySelector(\"#pwd\").value = \"\";\n\n // class added to hide and removed to show.\n show(loginFormField);\n hide(signUpFormField);\n hide(boxField);\n}", "title": "" }, { "docid": "1e1b036dcc7c265975c7244ebfcde88c", "score": "0.6283688", "text": "function renderForm()\n{\n var html = \"\";\n html += '<div class=\"form-group\" id=\"formLogin\">';\n html += '<input type=\"text\" id=\"username\" class=\"form-control username\" placeholder=\"Nombre de usuario:\">';\n html += '</div>';\n html += '<div class=\"form-group\" id=\"formLogin\">';\n html += '<input type=\"password\" id=\"password\" class=\"form-control password\" placeholder=\"Contraseña (8 caracteres o más):\">';\n html += '</div>';\n html += '<button type=\"submit\" class=\"btn btn-primary btn-large\" id=\"loginBtn\">Entrar</button>';\n return html;\n}", "title": "" }, { "docid": "b787f41fe5ad2e63dd2833b5e8496e35", "score": "0.627557", "text": "async login (username, password) {\n await (await this.inputUsername).setValue(username);\n await (await this.inputPassword).setValue(password);\n await (await this.btnSubmit).click();\n }", "title": "" } ]
0da06b90d0b702715e43b06239f7fa78
See API for function description.
[ { "docid": "11f6138fe5fe1d77392e136d8456f5ff", "score": "0.0", "text": "function getCapabilities() {\n var capabilities = [];\n // Get capabilities objects from the container.\n for (var i = 0; i < _capabilitiesContainer.length; ++i) {\n capabilities.push(_capabilitiesContainer[i].capabilities);\n }\n return capabilities;\n }", "title": "" } ]
[ { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.6372456", "text": "function miFuncion(){}", "title": "" }, { "docid": "ac54ce770b0cd27b0ae6243ee1905e7c", "score": "0.6127683", "text": "XXX() {\n\t\treturn 0;\n\t}", "title": "" }, { "docid": "4ba42df549fe9202b5539891c3e199f7", "score": "0.60167515", "text": "function alhorithm() {\n\n}", "title": "" }, { "docid": "e0de678e54e666185d40c3ff0f027db7", "score": "0.5918052", "text": "function apiCall() {\n\t\t\n\t}", "title": "" }, { "docid": "7bdc44dea711dd49d8f1246f5120cff5", "score": "0.5858128", "text": "function Params () {\n}", "title": "" }, { "docid": "cc19ea3383415487c787be9c2c73b823", "score": "0.5794155", "text": "function Parametros(){\n }", "title": "" }, { "docid": "cf0e8c3cadb65602323c4187184bcf27", "score": "0.5783774", "text": "function fc(){}", "title": "" }, { "docid": "cf0e8c3cadb65602323c4187184bcf27", "score": "0.5783774", "text": "function fc(){}", "title": "" }, { "docid": "f364f1f55d8f906b69460292ebfec13c", "score": "0.57318646", "text": "function Mooficator() {\n }", "title": "" }, { "docid": "df9393c6a6fdd0ac474c681b7eed250d", "score": "0.5727787", "text": "function ha(){}", "title": "" }, { "docid": "e781346e6560962caf08135219e521b7", "score": "0.5704394", "text": "function ordenada(){}", "title": "" }, { "docid": "98950fc4c81ba8af723c911057b98d42", "score": "0.5689574", "text": "apply() {\n \n }", "title": "" }, { "docid": "07a935f7782f54e50a0b3a1d827bec12", "score": "0.5662174", "text": "function Parametros(){\n }", "title": "" }, { "docid": "b58939bef8483458b69110907e830f52", "score": "0.56589675", "text": "function miFuncion(){\n\n}", "title": "" }, { "docid": "a92e7a566c0693bfee0f0aa764c85102", "score": "0.56525743", "text": "function accessesingData2() {\n\n}", "title": "" }, { "docid": "a17958321ab3f3dbf14159cbc1362830", "score": "0.5648083", "text": "function FunctionDescription() { }", "title": "" }, { "docid": "cc80e1e52a1ed24d352b2e05536776fd", "score": "0.5642726", "text": "method() {\n }", "title": "" }, { "docid": "6463afec96f82e628b0ff67ebb450302", "score": "0.5631227", "text": "function pa(){}", "title": "" }, { "docid": "d226c7579de02bf4f64ce013efb3d5bf", "score": "0.5627148", "text": "method(){}", "title": "" }, { "docid": "d226c7579de02bf4f64ce013efb3d5bf", "score": "0.5627148", "text": "method(){}", "title": "" }, { "docid": "d4660a3abffc193ab87c442a51a05107", "score": "0.5626436", "text": "function generic()\r\n{\r\n \r\n}", "title": "" }, { "docid": "b577e9f1e7743e2ba38743599787dab2", "score": "0.56210613", "text": "function wgld(){}", "title": "" }, { "docid": "aa4633098ce13f615c2b021cb0d28d42", "score": "0.56089497", "text": "function private_function(){\n\t\t\n\t}", "title": "" }, { "docid": "cd2e2bff1ce0f145aea071f562e95ad4", "score": "0.5605988", "text": "inizializza() {\n\n }", "title": "" }, { "docid": "a105f6359a28c77add73acc0095d8247", "score": "0.5603941", "text": "function getInfo()\n{\n\n}", "title": "" }, { "docid": "5b71ec0a75859531ac157bafbe1ca4e5", "score": "0.5553399", "text": "function ct(){}", "title": "" }, { "docid": "66009e8db01f28a049c62db56ba65bda", "score": "0.5548749", "text": "function Main()\n {\n \n }", "title": "" }, { "docid": "f7bf1e473925738834909df3a9fec8ab", "score": "0.5547379", "text": "processPlaceHolder() {\n return 0;\n }", "title": "" }, { "docid": "6fa8661d5fb11e21d3f67e03efbc2be1", "score": "0.55365014", "text": "function funcName(){}", "title": "" }, { "docid": "c58110784c35a33879371b4fc3956c94", "score": "0.55325854", "text": "function foo() {\n\n }", "title": "" }, { "docid": "55dc82bd74db8f541cf53e2136015d74", "score": "0.55312926", "text": "function dummy(){}", "title": "" }, { "docid": "55dc82bd74db8f541cf53e2136015d74", "score": "0.55312926", "text": "function dummy(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5527324", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5527324", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5527324", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5527324", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5527324", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5527324", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5527324", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5527324", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5527324", "text": "function r(){}", "title": "" }, { "docid": "2243e9fb55b5cbda9f5aab926ab34311", "score": "0.552685", "text": "function TrackByFunction() { }", "title": "" }, { "docid": "2243e9fb55b5cbda9f5aab926ab34311", "score": "0.552685", "text": "function TrackByFunction() { }", "title": "" }, { "docid": "2243e9fb55b5cbda9f5aab926ab34311", "score": "0.552685", "text": "function TrackByFunction() { }", "title": "" }, { "docid": "2243e9fb55b5cbda9f5aab926ab34311", "score": "0.552685", "text": "function TrackByFunction() { }", "title": "" }, { "docid": "172ee5659cb55e9f3fd46b10cb7d341b", "score": "0.55103904", "text": "function foo () {\n \n }", "title": "" }, { "docid": "66fe60e0a1f675f24eb100b2156801c2", "score": "0.5486472", "text": "function accessesingData1() {\n\n}", "title": "" }, { "docid": "341dec073afba581e0adca853b880e02", "score": "0.548351", "text": "static method(){}", "title": "" }, { "docid": "e383232da17e1ad89ee5ac79b14eae6a", "score": "0.5475161", "text": "function Interfas() {}", "title": "" }, { "docid": "edaf9644020839e0a03917cd76d34512", "score": "0.5471351", "text": "function func() {}", "title": "" }, { "docid": "edaf9644020839e0a03917cd76d34512", "score": "0.5471351", "text": "function func() {}", "title": "" }, { "docid": "d6004cf84eee0f389674d3672f5ec6c9", "score": "0.546903", "text": "function API() { }", "title": "" }, { "docid": "1e95f4775258e98246653515bf7d39d5", "score": "0.5465013", "text": "function _ap() {\n\n}", "title": "" }, { "docid": "14f7cb6469ed203b35ecfd60ccae49e7", "score": "0.5452784", "text": "function w(){}", "title": "" }, { "docid": "57c561f5ce64234cd6a6991ddea73b37", "score": "0.5433625", "text": "function name(parameters){\n return;\n }", "title": "" }, { "docid": "344fef91be254a51983517c7b30520c4", "score": "0.5431933", "text": "function _0x43bb6f(_0x443d96,_0x3852e2){0x0;}", "title": "" }, { "docid": "d94d16c5caa4a52e9d294b3a4aa4d195", "score": "0.5424879", "text": "function te(){}", "title": "" }, { "docid": "6b2c3365475968136d6cb24401fef205", "score": "0.5420212", "text": "function ba(){}", "title": "" }, { "docid": "6b2c3365475968136d6cb24401fef205", "score": "0.5420212", "text": "function ba(){}", "title": "" }, { "docid": "6b2c3365475968136d6cb24401fef205", "score": "0.5420212", "text": "function ba(){}", "title": "" }, { "docid": "3baae90dd35f220f4573faf381ba3605", "score": "0.5411851", "text": "function affiche() {}", "title": "" }, { "docid": "55c7f28b08471b20a08f620336c9adeb", "score": "0.54021674", "text": "getData() {}", "title": "" }, { "docid": "6401d928cec14b0919dd6a4e1782d6ef", "score": "0.53956836", "text": "function TrackByFunction(){}", "title": "" }, { "docid": "7ad248aa650608db6a91a71401ad8da8", "score": "0.5384167", "text": "function Interfaz() {}", "title": "" }, { "docid": "7ad248aa650608db6a91a71401ad8da8", "score": "0.5384167", "text": "function Interfaz() {}", "title": "" }, { "docid": "7ad248aa650608db6a91a71401ad8da8", "score": "0.5384167", "text": "function Interfaz() {}", "title": "" }, { "docid": "20e21e988882ebc698864c830b29ada3", "score": "0.538206", "text": "function Rd() {\n}", "title": "" }, { "docid": "eb377607ebb19e4a5c680b18f7ac0458", "score": "0.53756744", "text": "apply () {}", "title": "" }, { "docid": "2a8857a40fa007c6cc3bdf88ff9ba560", "score": "0.53491503", "text": "function results() {}", "title": "" }, { "docid": "d5b00f210f263a324b8df747bbb09e6d", "score": "0.53260404", "text": "function said_to_utter(said) {\n\n}", "title": "" }, { "docid": "8fcc83393fb0e7709b477ae081e7e33b", "score": "0.5325795", "text": "function TrackByFunction() {}", "title": "" }, { "docid": "8fcc83393fb0e7709b477ae081e7e33b", "score": "0.5325795", "text": "function TrackByFunction() {}", "title": "" }, { "docid": "8fcc83393fb0e7709b477ae081e7e33b", "score": "0.5325795", "text": "function TrackByFunction() {}", "title": "" }, { "docid": "8fcc83393fb0e7709b477ae081e7e33b", "score": "0.5325795", "text": "function TrackByFunction() {}", "title": "" }, { "docid": "fccd53fea33762e4acdf47701adf0324", "score": "0.5325575", "text": "function doSomething() {\n\n }", "title": "" }, { "docid": "413307a66a2e19827e52672f3b3677b6", "score": "0.53219926", "text": "function rc(){}", "title": "" }, { "docid": "f6b3ebb60d61ea955f285ea99c9dd480", "score": "0.5320229", "text": "function getinfo(){\r\n\r\n\r\n}", "title": "" }, { "docid": "b252bb6892fa7c4f1fef2df685bb2f2e", "score": "0.53174955", "text": "function callSomething() {\n \n}", "title": "" }, { "docid": "59863c63e68998e2975fd1a48dc75941", "score": "0.53100055", "text": "function stuff(){\n\t\n}", "title": "" }, { "docid": "631161f924e8a36efb47422abb825b2e", "score": "0.5306404", "text": "foo(){\n\n }", "title": "" }, { "docid": "746b681991691c650a7dc60d5757b06e", "score": "0.53044575", "text": "function DemoInfo() {}", "title": "" }, { "docid": "fd13e5dc5c2653b47d8977a03b008517", "score": "0.5299034", "text": "function something() {\n\n }", "title": "" }, { "docid": "ae3762a9d8d7cfe1883991ea41f25e5f", "score": "0.5295995", "text": "result() {}", "title": "" }, { "docid": "af6e29f0615400d5a5392d7f61a70186", "score": "0.5287525", "text": "function ex09_0() {\n\n}", "title": "" }, { "docid": "367265316a9a2311e792bc44067539c1", "score": "0.5279505", "text": "Encapsulate() {}", "title": "" }, { "docid": "ca4b442a4779ac2515d1b8c9fc80a9e1", "score": "0.52722824", "text": "*method(){}", "title": "" }, { "docid": "1c26527edaf578ce84f713e32e1d2bca", "score": "0.5268972", "text": "_update() {}", "title": "" }, { "docid": "13d962699c156a2866a75384833bf18e", "score": "0.5264144", "text": "function Mechanism() {\n }", "title": "" }, { "docid": "13d962699c156a2866a75384833bf18e", "score": "0.5264144", "text": "function Mechanism() {\n }", "title": "" }, { "docid": "13d962699c156a2866a75384833bf18e", "score": "0.5264144", "text": "function Mechanism() {\n }", "title": "" }, { "docid": "13d962699c156a2866a75384833bf18e", "score": "0.5264144", "text": "function Mechanism() {\n }", "title": "" }, { "docid": "d88b911e0eb01e89262419d0629d6522", "score": "0.52635944", "text": "function doStuff(arg)\r\n {\r\n }", "title": "" }, { "docid": "6c5a53bf946ffe731fdd062534b8391f", "score": "0.5260241", "text": "selfUpdated() { }", "title": "" }, { "docid": "2d00e9a26637a06a2270cb02759f9554", "score": "0.5259681", "text": "change () {}", "title": "" }, { "docid": "4846f7442387d0797edb680641658aba", "score": "0.5255821", "text": "function callback(){}", "title": "" }, { "docid": "aabd46650ab68064cde7ba62b0a85fd7", "score": "0.5253275", "text": "function worthless(){\n}", "title": "" }, { "docid": "80068fd9c4ecc7909911f4817971b1ff", "score": "0.52464867", "text": "apply() {}", "title": "" }, { "docid": "80068fd9c4ecc7909911f4817971b1ff", "score": "0.52464867", "text": "apply() {}", "title": "" }, { "docid": "7e0faf942f4f44a251b609865365620d", "score": "0.5229398", "text": "function fn() {\n\n}", "title": "" }, { "docid": "a72dcc12d9299f3ab1ac88647036273e", "score": "0.5228718", "text": "function Nothing(){}", "title": "" }, { "docid": "97f25759ff2312b34f735a2a774e7cd5", "score": "0.5224774", "text": "function util() {\n\n}", "title": "" } ]
8e61ea05f0758a477096e46998078d01
Function for making the hot spot background visible
[ { "docid": "eac8c3489c63f91cb289f09e0e1ac9e6", "score": "0.7828869", "text": "function makeHotSpotBackgroundsVisible()\r\n\t\t\t{\r\n\t\t\t\t// Alter the CSS (SmoothDivScroll.css) if you want to customize\r\n\t\t\t\t// the look'n'feel of the visible hot spots\r\n\t\t\t\t\r\n\t\t\t\t// The left hot spot\r\n\t\t\t\t$mom.find(options.scrollingHotSpotLeft).addClass(\"scrollingHotSpotLeftVisible\");\r\n\r\n\t\t\t\t// The right hot spot\r\n\t\t\t\t$mom.find(options.scrollingHotSpotRight).addClass(\"scrollingHotSpotRightVisible\");\r\n\t\t\t}", "title": "" } ]
[ { "docid": "3d68a178d28e1a6134e311a4b8520f0a", "score": "0.6617614", "text": "function hideHotSpotBackgrounds()\r\n\t\t\t{\r\n\t\t\t\tclearInterval($mom.hideHotSpotBackgroundsInterval);\r\n\t\t\t\t\r\n\t\t\t\t// Fade out the left hot spot\r\n\t\t\t\t$mom.find(options.scrollingHotSpotLeft).fadeTo(\"slow\", 0.0, function(){\r\n\t\t\t\t\t$mom.find(options.scrollingHotSpotLeft).removeClass(\"scrollingHotSpotLeftVisible\");\r\n\t\t\t\t});\r\n\r\n\t\t\t\t// Fade out the right hot spot\r\n\t\t\t\t$mom.find(options.scrollingHotSpotRight).fadeTo(\"slow\", 0.0, function(){\r\n\t\t\t\t\t$mom.find(options.scrollingHotSpotRight).removeClass(\"scrollingHotSpotRightVisible\");\r\n\t\t\t\t});\r\n\t\t\t}", "title": "" }, { "docid": "bf32b38d32c5f5788ce2be57805e35e3", "score": "0.64687365", "text": "function show_ground(){\n for(var s = 0; s < wid; s= s + im_ground.width){\n imageMode(CORNER);\n image(im_ground, s,800-110, im_ground.width , 110 );\n }\n }", "title": "" }, { "docid": "6f01575fc001b5cf04ef95c37c80adf2", "score": "0.646457", "text": "function drawbg() {\n\n}", "title": "" }, { "docid": "e380801e32d6dff7d5e17a8ffed80b3e", "score": "0.6389544", "text": "function EV_Show_bgDiv(){ \r\n var background=document.getElementById(\"EV_bgModeAlertDiv\"); \r\n var bgWidth=EV_myClientWidth(); \r\n var bgHeight=EV_myClientHeight(); \r\n var bgTop=EV_myScrollTop(); \r\n var bgLeft=EV_myScrollLeft(); \r\n background.style.position = \"absolute\"; \r\n background.style.top = bgTop+\"px\"; \r\n background.style.left = bgLeft+\"px\"; \r\n background.style.width = bgWidth + \"px\"; \r\n background.style.height = bgHeight + \"px\"; \r\n background.style.zIndex = \"10000\"; \r\n background.style.background = \"#777\"; \r\n background.style.filter = \"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=60,finishOpacity=60);\"; \r\n background.style.opacity = \"0.6\"; \r\n}", "title": "" }, { "docid": "b0e62ca2bdd5537be9b6c02196e5fa51", "score": "0.63660604", "text": "function controlerhotspot (){\n hotspot.style.width = state.mywidth + \"px\";\n hotspot.style.height = state.myheight + \"px\";\n hotspot.style.top = state.myY + \"px\";\n hotspot.style.right = state.myX + \"px\";\n }", "title": "" }, { "docid": "0b9009fe0a7801d0bc67a57e491274bf", "score": "0.63566214", "text": "_drawBackground() {\r\n imageMode(CORNER)\r\n image(images.PAGE_BACKGROUND, 0, 0)\r\n }", "title": "" }, { "docid": "5f56f3d829480d2681f9bd848a18638f", "score": "0.624222", "text": "bedroom(){\r\n background(bedroom, 500, 500);\r\n }", "title": "" }, { "docid": "aa4572c48fa1e7a09e68a82d96f5c6aa", "score": "0.62125844", "text": "function renderBackground() {\n \n if (bgposition1 <= -bgwidth) {\n bgposition1 = 0;\n };\n ctx.drawImage(Resources.get('images/view.png'), bgposition1, 0);\n }", "title": "" }, { "docid": "8a18639a298dc16b1043a63771fe38fb", "score": "0.61490345", "text": "onScreen(){\n if(0 <= this.x && this.x <= 900){\n this.displayed = true;\n } else {\n this.displayed = false;\n }\n }", "title": "" }, { "docid": "b1eb7634da13b7d5e8079d51810e03bd", "score": "0.6118497", "text": "display() {\n image(bg_hall, 0, 0);\n drawSprites(hallObjects);\n }", "title": "" }, { "docid": "19e0e4bd68800913d0901a30c948d1c3", "score": "0.60969734", "text": "function mask() {\n var lay = document.createElement('div');\n document.body.appendChild(lay);\n lay.id = 'overLay'; \n lay.style.position = 'absolute';\n lay.style.width = window.innerWidth + 'px';\n lay.style.height = 687 + 'px';\n lay.style.top = 0 + 'px';\n lay.style.left = window.pageXOffset + 'px';\n lay.style.zIndex = 990;\n lay.style.opacity = 0.9;\n lay.style.backgroundColor = '#000';\n }", "title": "" }, { "docid": "2507cad45d1849247bd09055244a8242", "score": "0.60927725", "text": "function scrollingBackground() {\n image(world.image, world.imageX + width/2, world.imageY + height/2, world.WIDTH, world.HEIGHT);\n}", "title": "" }, { "docid": "f0789a52787684d3e18a0786c160b40d", "score": "0.60802656", "text": "function refreshBackground(){\n background(255);\n}", "title": "" }, { "docid": "1783f61763a4d2886bfe0eda3e70b727", "score": "0.60619897", "text": "setBackgroundGray(){\n\t\tthis.cameras.main.setAlpha(0.2);//Phaser.Display.Color.RGBStringToColor('rgb(200,200,200)')\n\t\tthis.grayRectangle.visible=true;\n\t\tthis.cameras.main.backgroundColor=Phaser.Display.Color.RGBStringToColor('rgb(100,100,100)');\n\t\t//this.cameras.main.fadeOut(1000,200,200,200);\n\t}", "title": "" }, { "docid": "f3a7b8f94d27a26b69fee45eb2c18f1c", "score": "0.6051135", "text": "function setHomeBg() {\n let sp = 25; // Spacing\n background(0);\n fill(255);\n textAlign(CENTER);\n // Title text\n push();\n textSize(36);\n // By using translate is easier to move all the text at once\n translate(width / 2, height / 8);\n text(\"Wordplay\", 0, 0);\n textSize(18);\n text(subtitle, 0, 0 + sp);\n pop();\n // Commands text\n push();\n sp = 20;\n translate(width / 2, height - height / 6);\n textSize(16);\n textAlign(LEFT);\n textStyle(BOLD);\n text(\"Commands\", 0, 0);\n textStyle(NORMAL);\n text(\"Right Arrow:\\tNext Movie\", 0, sp);\n text(\"Left Arrow:\\t Previous Movie\", 0, sp * 2);\n text(\"Backspace:\\t Back to home (image mode)\", 0, sp * 3);\n text(\"S:\\t\\t\\t\\t\\t\\tSave Artwork as a .png\", 0, sp * 4);\n pop();\n}", "title": "" }, { "docid": "71aadcfee326f0cc099f85e60038716f", "score": "0.6050138", "text": "function backgrnd() {\r\n infiniteground.addImage(backgroundimg);\r\n infiniteground.velocityX = -4\r\n infiniteground.x = infiniteground.width/2;\r\n infiniteground.scale = 1.5; \r\n}", "title": "" }, { "docid": "4b07a3b3983f5c6126a289fd955a8ea9", "score": "0.60413957", "text": "function setBg () \r\n\t{\r\n\t\tvar x = '0px';\r\n\t\tvar y = '0px';\r\n\r\n\t\tfor (var i = 0; i < puzzlePieces.length; i++) //iterates over the puzzle piece and specifies the part of the image to be shown\r\n\t\t{\r\n\t\t\tpuzzlePieces[i].style.backgroundPosition = x + \" \" + y;\r\n\r\n\t\t\tif (parseInt (x, 10) > -300)\r\n\t\t\t{\r\n\t\t\t\tx = parseInt (x, 10) + -100 + 'px';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tx = '0px';\r\n\t\t\t\ty = parseInt (y, 10) + -100 + 'px';\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "57bd7e20047a22e5ea9a68cfca7623c7", "score": "0.60343957", "text": "show() {\r\n push();\r\n translate(this.pos.x, this.pos.y);\r\n rectMode(CENTER);\r\n imageMode(CENTER);\r\n noStroke();\r\n strokeWeight(1);\r\n fill(this.col);\r\n rect(0, 0, this.SIZE, this.SIZE);\r\n if (this.village) {\r\n tint(this.village.owner.colour);\r\n image(img.village, 0, 0, this.SIZE, this.SIZE)\r\n };\r\n pop();\r\n if (this.hit()) {\r\n this.highlight(this.hitCol);\r\n } else if (this.hasFocus) {\r\n this.highlight(darken(this.hitCol));\r\n }\r\n }", "title": "" }, { "docid": "57bd7e20047a22e5ea9a68cfca7623c7", "score": "0.60343957", "text": "show() {\r\n push();\r\n translate(this.pos.x, this.pos.y);\r\n rectMode(CENTER);\r\n imageMode(CENTER);\r\n noStroke();\r\n strokeWeight(1);\r\n fill(this.col);\r\n rect(0, 0, this.SIZE, this.SIZE);\r\n if (this.village) {\r\n tint(this.village.owner.colour);\r\n image(img.village, 0, 0, this.SIZE, this.SIZE)\r\n };\r\n pop();\r\n if (this.hit()) {\r\n this.highlight(this.hitCol);\r\n } else if (this.hasFocus) {\r\n this.highlight(darken(this.hitCol));\r\n }\r\n }", "title": "" }, { "docid": "c11f0497262f52a1c5c4ace31b7f40aa", "score": "0.6030661", "text": "function backgroundFelt() {\n main_background = new createjs.Bitmap(\"/images/pokerfelt.jpg\");\n stage.addChild(main_background);\n createjs.Ticker.addEventListener(\"tick\", handleTick);\n\n function handleTick(event) {\n stage.update();\n }\n}", "title": "" }, { "docid": "877d596ae6363128ea2deb7a5435c1ca", "score": "0.6026943", "text": "$createBackground() {\n const background = new Sprite(this, `background-${store.getState().world}`);\n store.dispatch(addBackground(background));\n background.setScaleMinMax(1, 1, 1, 1);\n background.add(0, 0);\n }", "title": "" }, { "docid": "6da6f78d440cbacff85acca082f4a871", "score": "0.60059655", "text": "function loadBackground()\n{\n background.cargaOK = true;\n draw();\n}", "title": "" }, { "docid": "36d6117e7498d4408397c94dd07d90a2", "score": "0.5999768", "text": "function drawBackground() {\n // Hinzufügen der Linie\n var line = new createjs.Shape();\n line.graphics.setStrokeStyle(2);\n line.graphics.beginStroke(\"#201d1b\");\n line.graphics.moveTo(mousezone-1, 0);\n line.graphics.lineTo(mousezone-1, 500);\n line.graphics.endStroke();\n stage.addChild(line);\n // Zeichen des Käfighintergrundes\n var cage_bg = new createjs.Bitmap(\"/data/img/play/cage_bg.png\");\n cage_bg.x = mousezone;\n cage_bg.y = 0;\n stage.addChild(cage_bg);\n\n var mouse_bg = new createjs.Bitmap(\"/data/img/play/background_mice_cage.png\");\n mouse_bg.x = 0;\n mouse_bg.y = 0;\n stage.addChild(mouse_bg);\n\n // Zeichnen der Pfeile\n //\n // TODO Schönere Bilder\n var arrowUP = new createjs.Bitmap(\"/data/img/play/ArrowUP.png\");\n arrowUP.x = 600;\n arrowUP.y = 0;\n\n arrowUP.on(\"click\", function(evt) {\n for (var i = 0; i < arrCage.length; i++) {\n arrCage[i].cagecontainer.y += 72;\n if (arrCage[i].cagecontainer.y >= 40 && arrCage[i].cagecontainer.y <= 400 ){\n arrCage[i].cagecontainer.visible = true;\n } else {\n arrCage[i].cagecontainer.visible = false;\n }\n };\n });\n stage.addChild(arrowUP);\n\n var arrowDown = new createjs.Bitmap(\"/data/img/play/ArrowDown.png\");\n arrowDown.x = 600;\n arrowDown.y = 485;\n\n arrowDown.on(\"click\", function(evt) {\n for (var i = 0; i < arrCage.length; i++) {\n arrCage[i].cagecontainer.y -= 72;\n if (arrCage[i].cagecontainer.y >= 40 && arrCage[i].cagecontainer.y <= 400){\n arrCage[i].cagecontainer.visible = true;\n } else {\n arrCage[i].cagecontainer.visible = false;\n }\n };\n });\n stage.addChild(arrowDown);\n\n // current FPS\n fpsText = new createjs.Text(\"-- fps\", \"10px Arial\", \"#FFF\");\n fpsText.x = 10;\n fpsText.y = 10;\n stage.addChild(fpsText);\n}", "title": "" }, { "docid": "ccbedb5126a5848b1e8d2d31b28f4403", "score": "0.59920186", "text": "function makeNight() {\n // landCanvas.style.background = nightColor;\n landCanvas.className = \"land-night\";\n}", "title": "" }, { "docid": "00be12aeeac06f8a9ec858e7995636a9", "score": "0.5984741", "text": "function activateGhost(){\r\n\tgame.global.myPlayer.image.alpha = 0.25;\r\n\tquitbutton.alpha = 1;\r\n\tquitbutton.inputEnabled = true;\r\n}", "title": "" }, { "docid": "9dc1b4277fc9a8e4a1cf7bc001a240b4", "score": "0.5957144", "text": "function showBackground() {\n let amountAllowed = _cardsAmount * 2;\n for (let i = 0; i < amountAllowed; i++) {\n let background = document.getElementById(i.toString());\n background.style.opacity = \"100\";\n background.style.color = \"#99cc00\";\n }\n }", "title": "" }, { "docid": "a65dc7b637a1a56ea201c4787f79ee45", "score": "0.5940356", "text": "function draw() {\n background(bg);\n\n}", "title": "" }, { "docid": "08ff8f35542ee76fb0086d73487b1fd2", "score": "0.593732", "text": "function nightView() {\n\tdocument.getElementById('wrapper').style.backgroundImage = \"url(../images/night_view.jpg)\";\n\tdocument.getElementById('main_footer').style.backgroundColor = \"red\";\n\tdocument.getElementById('main_header').style.color = \"red\";\n\tdocument.getElementById('wrapper').style.color = \"white\";\n\tdocument.getElementById('main_header').style.fontFamily = \"script\";\n}", "title": "" }, { "docid": "fb59e042a3177af2a6ff3b34c6e81c93", "score": "0.5935793", "text": "function displayBackground() {\n for (let i = 0; i < Math.ceil(width / height); i++) {\n image(backgrounds[backgroundSelection[i]], height / 2 + height * i, height/2, height, height);\n }\n}", "title": "" }, { "docid": "f8fcbe2cb4cee832afec9ef53b7e1dc0", "score": "0.59351206", "text": "_updateScenery() {\r\n\t\tthis.elements.frameBG[0].style.opacity = this.sharedState.scenery ? '1' : '0';\r\n\t\tthis.elements.sidebarBG[0].style.opacity = this.sharedState.scenery ? '1' : '0';\r\n\t}", "title": "" }, { "docid": "5f10efbd321f32fd0d4158665fe81ac1", "score": "0.59145766", "text": "function transparenttt() { //Floor when dropdown\r\n transparent = true\r\n transparentt()\r\n }", "title": "" }, { "docid": "de3205735579a10535b51a3314d2bf5f", "score": "0.5912881", "text": "function paintBackground(){\n\tpaintMap();\n\tpaintMessages();\n}", "title": "" }, { "docid": "5a939b80dfb99b20da0c874c64d30205", "score": "0.5909141", "text": "function drawFG(){\n transparentImg.loadPixels();\n colorToAlpha(transparentImg,colorToRemove,sliderThresh.value(),0,sliderTol.value());\n transparentImg.updatePixels();\n const fitR = fitStretched(transparentImg,canvas);\n image(transparentImg,fitR.left,fitR.top, fitR.width, fitR.height);\n}", "title": "" }, { "docid": "0c81712d35a9e018195174d9c2019843", "score": "0.5904545", "text": "function switchScreen() {\n canvas.style.backgroundColor = 'transparent';\n canvas.style.opacity = 1\n canvas.style.background = 'url(\"./images/nacht-illustratie-met-volle-maan-en-sterren_104785-352.jpg\") no-repeat';\n canvas.style.backgroundSize = \"cover\"; \n}", "title": "" }, { "docid": "ff06de2eb946a57944324399520bb4f2", "score": "0.5900536", "text": "function drawBackground() {\n\tdrawSky();\n\tdrawRoad1();\n\tdrawRoadLine();\n\tdrawRoad2();\n}", "title": "" }, { "docid": "4dfea1f21c7e551e58c19147e4bab8c5", "score": "0.58788705", "text": "function placeBg(){\n\t\n\t// start with full width for display size\n\tbgImgObj.displayWidth = window.innerWidth;\n\tbgImgObj.displayHeight = \tbgImgObj.displayWidth *\n\t\t\t\t\t\t\t\tbgImgObj.height /\n\t\t\t\t\t\t\t\tbgImgObj.width;\n\tif(bgImgObj.displayHeight >= window.innerHeight){\n\t\t// is full width and scrolling\n\t\t\n\t\t//scroll offset \n\t\tvar posY = (0-window.scrollY)*bgImgObj.Parallax;\n\t\t//max out on scroll down\n\t\tif(posY < -1 * (bgImgObj.displayHeight - window.innerHeight) ){\n\t\t\tposY = -1 * (bgImgObj.displayHeight - window.innerHeight);\n\t\t}\n\t\t//min on scroll up\n\t\tif(posY > 0){\n\t\t\tposY = 0;\n\t\t}\n\t\t// set resolved position \n\t\tdocument.body.style.backgroundPositionY = posY + \"px\";\n\t\tdocument.body.style.backgroundPositionX = \"0px\";\n\t}else{\n\t\t// is full height and centered\n\t\tbgImgObj.displayHeight = window.innerHeight;\n\t\tbgImgObj.displayWidth = bgImgObj.displayHeight *\n\t\t\t\t\t\t\t\tbgImgObj.width /\n\t\t\t\t\t\t\t\tbgImgObj.height;\n\n\t\t// find x that centers the background\n\t\tvar newX = window.width - bgImgObj.displayWidth;\n\t\t\tnewX /= 2;\n\n\t\t//set the resolved position\n\t\tdocument.body.style.backgroundPositionY = \"0px\";\n\t\tdocument.body.style.backgroundPositionX = newX + \"px\";\n\t}\n\t//set the resolved size \n\tdocument.body.style.backgroundSize = bgImgObj.displayWidth+\"px \"+ bgImgObj.displayHeight+\"px\";\n}", "title": "" }, { "docid": "b99fa90c0cf66a3f1cca6c4af7855037", "score": "0.58516353", "text": "function showpwtopView( aquest, viure ) {\n\n if (viure==1) {\n\n aquest.style.backgroundColor = \"#a529254d\";\n aquest.style.boxShadow = \"0px 0px 1px 3px rgba(165, 41, 37, 0.3)\";\n\n } else {\n\n showpwtop.style.boxShadow = \"none\";\n showpwtop.style.backgroundColor = \"transparent\";\n\n }\n\n}", "title": "" }, { "docid": "34be61b567e25c34f7b79676978561f7", "score": "0.5850128", "text": "setbackground() {\n push()\n imageMode(CORNER);\n image(this.backgroundImg, width, height);\n background(this.backgroundImg)\n pop()\n }", "title": "" }, { "docid": "7221b7efa07e08cf117cfd2f9255c476", "score": "0.5849275", "text": "function showHeatMap() {\n setupRectGrid(bounds);\n}", "title": "" }, { "docid": "07721a5e8b3d1e9f38439c4b73ff1072", "score": "0.58460677", "text": "function waterColorHome(){\n document.getElementById(\"lndPge\").style.display=\"block\";\n document.getElementById(\"wcPge\").style.display=\"none\";\n}", "title": "" }, { "docid": "789c1f693ea7182635b73be22af5e17d", "score": "0.581008", "text": "show() {\n IBGReplies.show();\n }", "title": "" }, { "docid": "af57ca1766ab657ccf7de2ac36b80c36", "score": "0.5794338", "text": "function paintingPgeHome(){\n document.getElementById(\"lndPge\").style.display=\"block\";\n document.getElementById(\"pntPge\").style.display=\"none\"; \n}", "title": "" }, { "docid": "bed201473ef94c36d5c6fd5370c975bb", "score": "0.5794187", "text": "bg_toggle() {\n return this._sendCommand({\n method: 'bg_toggle',\n params: []\n })\n }", "title": "" }, { "docid": "93fdcec2b47ec9173e8fc4975a4fe600", "score": "0.5792497", "text": "transparentMarker(){\n\t\tthis.moveableSprites.forEach(moveableFocus =>{\n\t\t\tmoveableFocus.alpha -= 0.7;\n\t\t})\n\t\tthis.hitmarker.forEach(hit =>{\n\t\t\thit.alpha -= 0.2;\n\t\t})\n\t}", "title": "" }, { "docid": "8e2159ca72e863e9fbf463fba0f272af", "score": "0.5786108", "text": "function hotspot(hotSpotDiv, args) {\n const span = document.createElement('span');\n span.innerHTML = args;\n hotSpotDiv.appendChild(span);\n // span.style.width = span.scrollWidth - 20 + 'px';\n // span.style.marginLeft = -(span.scrollWidth - hotSpotDiv.offsetWidth) / 2 + 'px';\n // span.style.marginTop = -span.scrollHeight - 12 + 'px';\n}", "title": "" }, { "docid": "c30e007b7860d4b9f9b11645aea52f33", "score": "0.57736045", "text": "function drawBackground() {\n image(imgBackground, width / 2, height / 2); // dimensions: 100 X 56\n\n // table for tray\n rectMode(CORNER);\n fill(\"#B8F4FA\"); // light blue\n rect(0, height - 30, width, 30);\n\n image(imgTray, trayX, trayY); // tray dimensions: 130 X 78\n\n displayScore();\n drawStacked();\n}", "title": "" }, { "docid": "1f65ff30e6a73dcfaf711e800e8690c8", "score": "0.577005", "text": "function ShowHotSpot(evt,hotspotid){\n // console.log('ShowHotSpot');\n // console.log(evt); // Mouse event\n\tvar svgDocument = evt.target.ownerDocument;\n // console.log('svgDocument');\n // console.log(svgDocument);\n\tvar strId = \"hotspot.\"+hotspotid;\n\tvar hotspot = svgDocument.getElementById(strId);\n // console.log('hotspot');\n // console.log(hotspot);\n\tif(hotspot)\n\t\thotspot.setAttribute(\"opacity\",\".5\");\n}", "title": "" }, { "docid": "d75536d81c5a6f14143dcc649eb7ed01", "score": "0.57697517", "text": "function drawFlicker(){\n\n if (lvlsflicker > 100){\n background(random(255));\n } else {\n background(40);\n }\n}", "title": "" }, { "docid": "7522e347a4d07f4ba635e7c43b54a5c5", "score": "0.57680047", "text": "function setBackgroundImage() {\n\n newWeatherUI.addBackgroundImage();\n}", "title": "" }, { "docid": "e391d404499e18c3db5c917a1088fb79", "score": "0.57613975", "text": "function showScanner() {\n angular.element(document.querySelector('#main-content-pane'))[0].style.backgroundColor = 'transparent';\n angular.element(document.querySelector('#side-menu-left'))[0].style.display = 'none';\n\n if (angular.element(document.querySelector('#scan'))[0]) {\n \t angular.element(document.querySelector('#scan'))[0].style.backgroundColor = 'transparent';\n \t }\n\t}", "title": "" }, { "docid": "87b087cf0415efa83ca70828c15338c6", "score": "0.57512873", "text": "function drawBG() {\n image(space,width/2,height/2); //space background\n for(var i=0; i<stars.length; i++) {\n stars[i].shine();\n \tstars[i].display();\n }\n image(panel,width/2,height/2-25);\n noStroke();\n fill(255,100);\n rect(width/2+15,height/2-22,600,400);\n}", "title": "" }, { "docid": "435ad5be831e64e51ebec51b506ab9e1", "score": "0.5740125", "text": "function mousePressed() {\n background(250, 250, 100);\n\n}", "title": "" }, { "docid": "7ddcfde832ab9031b98914115e061f08", "score": "0.5735145", "text": "function menu(){\n //Move the background\n sprites.bg.tilePosition.x -= sprites.bg.vx;\n\n //TODO implement code to show a play button and a logo, maybe?\n}", "title": "" }, { "docid": "a3b8dcfac2f28071c904c9d82ae074c7", "score": "0.57349926", "text": "function background(gl) {\n return createVignette(gl, {\n color1: rgb(80),\n color2: rgb(20),\n noiseAlpha: 0.1,\n coloredNoise: false,\n scale: [1.15, 1.15]\n })\n}", "title": "" }, { "docid": "00c5cb67f394ab86546805f9d154d6aa", "score": "0.57348984", "text": "onBeforeFrameRendered() {\n super.onBeforeFrameRendered();\n this.invisibleHotspots.forEach(hotspot => hotspot.visible = false);\n }", "title": "" }, { "docid": "c37cad889336fd0b004cebdcaf25de0a", "score": "0.573141", "text": "function draw() {\n\nbackground(255);\n}", "title": "" }, { "docid": "cb8a098d5f896e55eb47b86b1df3c94f", "score": "0.5728184", "text": "_createBackground() {\n const background = new Sprite.from(\"playScene\");\n background.anchor.set(0.5);\n scaleXY(background, config.backgroundImage.scale);\n this.addChild(background);\n }", "title": "" }, { "docid": "36c5fc6097551e9cc6d8884b3fa3a6d5", "score": "0.5725365", "text": "function drawBg() {\n var bgImg = require(\"heatshrink\").decompress(atob(\"2E7wINKn///+AEaIVUgIUB//wCs/5CtRXrCvMD8AVTg4LFCv4VZ/iSLCrwWMCrMOAQMPCp7cBCojjFCo/xFgIVQgeHCopABCpcH44Vuh/AQQX/wAV7+F/Cq/nCsw/CCqyvRCvgODCqfAgEDCp4QCSIIVQgIOBDQgGDABX/NgIECCp8HCrM/CgP4CqKaCCqSfCCqq1BCqBuB54VqgYVG/gCECp0BwgCDCp8HgYCDCo/wCo0MgHAjACBj7rDABS1Bv4lBv4rPAAsPCo3+gbbPJAIVFiAXMFZ2AUQsAuAQHiOAgJeEA\"));\n g.reset();\n g.drawImage(bgImg,0,101);\n}", "title": "" }, { "docid": "cf3e91b598b5570a7f752d1f0ea57b34", "score": "0.5722591", "text": "function updateBackground(){\n\t\tworldBackground.position = camera.viewPosition;\n\t}", "title": "" }, { "docid": "793ad4d0a686e4aa881e91e6593ebfc8", "score": "0.5706063", "text": "function drawBackground()\r\n{\r\n ctx.drawImage(background, backgroundXPosition, backgroundYPosition);\r\n ctx.drawImage(background, backgroundXPosition2, backgroundYPosition);\r\n if(backgroundXPosition < -1200)\r\n {\r\n backgroundXPosition = 1192;\r\n }\r\n if(backgroundXPosition2 < -1200)\r\n {\r\n backgroundXPosition2 = 1192;\r\n }\r\n backgroundXPosition -= 8;\r\n backgroundXPosition2 -= 8;\r\n}", "title": "" }, { "docid": "fad65eab9da744c22a99429bb73d4421", "score": "0.57053155", "text": "function mainMenuScreen() {\n resetEntities();\n backgroundScroll = background.width * 0.175;\n new Entity(0, new Rect(0, 0, canvas.width, canvas.height), new Sprite(titleScreen, 1080, 2220, 0, 0, 1, 1, 0, 0, false));\n}", "title": "" }, { "docid": "5cdc8dd6e2d503d24f09c6804e4cd33d", "score": "0.57045406", "text": "function ajustBackground() {\r\n var newScroll =$(window).scrollTop();\r\n if (newScroll <= 200 && newScroll >= 90) {\r\n $('header').css('background-position', '50% ' + 'calc(50% + ' + (newScroll - 90) + 'px)');\r\n }\r\n else if (newScroll < 90){\r\n $('header').css('background-position', '50% 50%');\r\n }\r\n else {\r\n $('header').css('background-position', '50% calc(50% + 110px');\r\n }\r\n }", "title": "" }, { "docid": "e5dad98134185b29caf0fe669e9aac63", "score": "0.5696778", "text": "function draw_background() {\r\n var my_gradient = ctx.createLinearGradient(0, 0, 670, 0);\r\n my_gradient.addColorStop(0, \"darkslategrey\");\r\n my_gradient.addColorStop(0.5, \"teal\");\r\n my_gradient.addColorStop(1, \"darkslategrey\");\r\n ctx.fillStyle = my_gradient;\r\n ctx.fillRect(0, 20, 700, 475);\r\n ctx.strokeRect(0, 20, 700, 475);\r\n ctx.strokeRect(700, 20, mycanv.width - 700, 475);\r\n if (typeof(Storage) !== \"undefined\") {\r\n //ctx.fillText(\"Leader board can be saved\", mycanv.width - 530, 17);\r\n } else {\r\n ctx.fillText(\"Leader board cannot be saved\", mycanv.width - 530, 17);\r\n }\r\n }", "title": "" }, { "docid": "b1ed013399e3ff1cdcc72fa067d58d4b", "score": "0.56948715", "text": "function drawBackground() {\n background(0, 0, 80);\n fill(30, 80, 80);\n rect(width/4, 0, width/2, height);\n}", "title": "" }, { "docid": "5fc9fc62c1f8019588b8f3e6584ab758", "score": "0.5694408", "text": "function showHideHotSpots()\r\n\t\t\t{\r\n\t\t\t\t// When you can't scroll further left\r\n\t\t\t\t// the left scroll hot spot should be hidden\r\n\t\t\t\t// and the right hot spot visible\r\n\t\t\t\tif($mom.find(options.scrollWrapper).scrollLeft() === 0)\r\n\t\t\t\t{\r\n\t\t\t\t\thideLeftHotSpot();\r\n\t\t\t\t\tshowRightHotSpot();\r\n\t\t\t\t}\r\n\t\t\t\t// When you can't scroll further right\r\n\t\t\t\t// the right scroll hot spot should be hidden\r\n\t\t\t\t// and the left hot spot visible\r\n\t\t\t\telse if(($mom.scrollableAreaWidth) <= ($mom.find(options.scrollWrapper).innerWidth() + $mom.find(options.scrollWrapper).scrollLeft()))\r\n\t\t\t\t{\r\n\t\t\t\t\thideRightHotSpot();\r\n\t\t\t\t\tshowLeftHotSpot();\r\n\t\t\t\t}\r\n\t\t\t\t// If you are somewhere in the middle of your\r\n\t\t\t\t// scrolling, both hot spots should be visible\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tshowRightHotSpot();\r\n\t\t\t\t\tshowLeftHotSpot();\r\n\t\t\t\t}\r\n\r\n\t\t\t}", "title": "" }, { "docid": "91db978101eb3a595b763dfaf4a70470", "score": "0.56789225", "text": "function preview() {\n\t//whiteClick(5, 1, 'hvr');\n}", "title": "" }, { "docid": "21e426387e09ae3a116fc7dccd4e9371", "score": "0.56767255", "text": "function sunnyweather(){\n document.body.background = \"clothes/background.jpg\";\n }", "title": "" }, { "docid": "3afe60e7414ebb97658c26d6117ec99f", "score": "0.5670338", "text": "show() {\r\n push();\r\n translate(this.position.x, this.position.y);\r\n if (this.activated) {\r\n if (this.hit()) {\r\n tint('orange');\r\n } else {\r\n tint('blue');\r\n }\r\n } else {\r\n tint(darken(this.imgBaseTint));\r\n }\r\n imageMode(CENTER);\r\n image(this.img, 0, 0, this.w, this.h);\r\n if (this.label) {\r\n if (this.labelFont) {\r\n textFont(this.labelFont);\r\n }\r\n textSize(this.labelFontSize);\r\n textAlign(CENTER, TOP);\r\n fill(this.labelFontColour);\r\n text(this.label, 0, this.h / 2)\r\n }\r\n pop();\r\n }", "title": "" }, { "docid": "6291810d1384d9a3df45f7eafd0b0488", "score": "0.5669748", "text": "function addBackground(){\n // Always show player1 symbol if it's a single player game.\n if(players === 1){\n this.style.backgroundImage = `url(${player1.symbol})`;\n } else {\n this.style.backgroundImage = `url(${currentPlayer.symbol}`;\n }\n }", "title": "" }, { "docid": "8b10eb0545e1f31a892d7c6cf83ab13e", "score": "0.5669437", "text": "show() {\n if (this.alive == true) {\n image(shroom_pic, this.position_x, this.position_y, this.resolution, this.resolution);\n } else {\n image(shroom_pic_bw, this.position_x, this.position_y, this.resolution, this.resolution);\n }\n }", "title": "" }, { "docid": "4381fe73eb452f15e054980672cbf8da", "score": "0.5656289", "text": "function backgroundSetup() {\n \"use strict\";\n var panes = [], aquarium;\n \n aquarium = new Sprite();\n aquarium.setSrc(\"aquariumBackground.jpg\");\n aquarium.setSpriteAttributes(0, 0, 800, 500, \"attributesPane\");\n panes.push(aquarium);\n \n return panes;\n}", "title": "" }, { "docid": "56846f3fb2b331047d5062afabd1d8c7", "score": "0.56555367", "text": "function renderBackground() {\n // Target divs\n var todayWeather = $(\"#todayWeather\");\n // Get cityHour in 24-hr format\n var cityHour = cityDateInstance.getHours();\n // Adjust color based on the city's local hour\n if (cityHour >= 6 && cityHour < 19) {\n todayWeather.css(\"background-image\", \"var(--daytime)\");\n currentWeatherDescription.addClass(\"uk-mute\");\n } else {\n todayWeather.css(\"background-image\", \"var(--nighttime)\");\n currentWeatherDescription.addClass(\"uk-light\");\n }\n }", "title": "" }, { "docid": "c19c356b0930cfcd6e42ab07ac261b38", "score": "0.5654909", "text": "function displayBackground(background)\n{\n\t'use strict';\n\t\n\t// Get the canvas and the context\n\tvar canvas = document.getElementById(\"canvas\");\n\tvar c = canvas.getContext(\"2d\");\n\t\n\t// Use the background image as a pattern for fillStyle and use it to draw a canvas-sized rectangle\n\tc.fillStyle = background;\n\tc.fillRect(0, 0, canvas.width, canvas.height);\n}", "title": "" }, { "docid": "4eff111e16948bec4563114252b5dab3", "score": "0.5654697", "text": "function initBackground(stage)\n{\n var background=new Kinetic.Layer();\n \n var rect=new Kinetic.Image({\n x: 0,\n y: 0,\n width: 1080,\n height: 800,\n scale: [0.8, 0.8],\n image: images.background,\n });\n \n background.add(rect);\n\n stage.add(background);\n}", "title": "" }, { "docid": "7a97b3f9c8882b655134a00ebb3410fc", "score": "0.5650027", "text": "function setupBackground() {\n\n var img = images.bg.src,\n ele = document.createElement(\"div\");\n\n ele.id = \"background\";\n ele.style.backgroundImage = \"url(\" + img + \")\";\n\n document.getElementById(\"IWGholder\").appendChild(ele);\n\n }", "title": "" }, { "docid": "d2afd02c9118f6a8de608bab6e9d30c3", "score": "0.5644731", "text": "pintar() {\n\n this.app.imageMode(this.app.CENTER);\n this.app.image(this.hover, this.x, this.y);\n\n\n }", "title": "" }, { "docid": "a91687dc6e7ef7df152f6d36fed70034", "score": "0.5643936", "text": "function canvClick() {\n clear();\n background(245);\n cycle = 0;\n loop();\n}", "title": "" }, { "docid": "c959e09fba22be990f0d40a84e64554a", "score": "0.56431645", "text": "function startScreenBackgroundWithParalax() {\n\n let paralaxX = map(mouseX, 0, canvasSpecs.x, -1, 1);\n paralaxX = constrain(paralaxX, -0.5, 1.5);\n let paralaxY = map(mouseY, 0, canvasSpecs.y, -1, 1);\n paralaxY = constrain(paralaxY, -0.5, 1.5);\n\n image(startScreenBackground, startScreenBackgroundSpecs.x + paralaxX * startScreenBackgroundSpecs.paralaxX, startScreenBackgroundSpecs.y + paralaxY * startScreenBackgroundSpecs.paralaxY, startScreenBackgroundSpecs.width, startScreenBackgroundSpecs.height);\n\n}", "title": "" }, { "docid": "97a39999f6e3920cd2a1f3b6f70c9eed", "score": "0.56415164", "text": "display1(){\r\n var pos = this.body.position;\r\n fill(\"white\");\r\n stroke(\"white\");\r\n rect(pos.x,pos.y,this.width,this.height);\r\n image(this.image,pos.x-105,pos.y-212,210,200);\r\n }", "title": "" }, { "docid": "b70dd23b870154c4050edc0ff8ed2193", "score": "0.56377727", "text": "addBackground () {\n if (window.canvas && window.ctx) { // check if canvas and ctx variable are accessible\n const slimeBG = new Image(); // create a new image object\n slimeBG.src = \"images/screen/slime.png\"; // assign source to new image object\n this.background = slimeBG; // set background to new image object\n }\n }", "title": "" }, { "docid": "71644252806cd3630386d8ec24556a49", "score": "0.56282556", "text": "function loadBackground() {\n background(computerBackground);\n console.log(\"DONT TRUST IT DONT TRUST IT DONT TRUST IT DONT TRUST IT DONT TRUST IT DONT TRUSNIT IT SODNBT DRUST ITN DONT DTURS T IT\")\n }", "title": "" }, { "docid": "1594b3faf2c72e4af8c174ac2ac65388", "score": "0.5628057", "text": "function drawingPgehome(){\n document.getElementById(\"lndPge\").style.display=\"block\";\n document.getElementById(\"drwPge\").style.display=\"none\";\n}", "title": "" }, { "docid": "473b475721eefc68c7ea5e75dd5e9a49", "score": "0.5627779", "text": "function flashYellow() {\n topLeft.style.backgroundColor = \"#ffff00\";\n topRight.style.backgroundColor = \"#ffff00\";\n bottomLeft.style.backgroundColor = \"#ffff00\";\n bottomRight.style.backgroundColor = \"#ffff00\";\n }", "title": "" }, { "docid": "7f4fe6a39df312fef51848ed65a2c57e", "score": "0.56253946", "text": "function newPictureMichelle() {\n document.body.style.backgroundImage = \"url('./photos/unsplash.jpg')\";\n document.getElementById(\"heading\").style.visibility = \"hidden\";\n document.getElementById(\"sam\").style.visibility = \"hidden\";\n document.getElementById(\"pedro\").style.visibility = \"hidden\";\n document.getElementById(\"fernando\").style.visibility = \"hidden\";\n document.getElementById(\"linda\").style.visibility = \"hidden\";\n document.getElementById(\"tiago\").style.visibility = \"hidden\";\n}", "title": "" }, { "docid": "62d576088eb09bc3cfe776a01ab57141", "score": "0.5621847", "text": "function visibleScreen() {\n document.getElementById(\"body-container\").classList.remove(\"blurry\");\n startB.classList.add(\"hidden\");\n}", "title": "" }, { "docid": "56c0834bdfd114b9b3e8acd71cdd4243", "score": "0.56196535", "text": "function SetNextWindowBgAlpha(alpha) { bind.SetNextWindowBgAlpha(alpha); }", "title": "" }, { "docid": "78099f93026525af6d2be3bf5a921036", "score": "0.56160635", "text": "function Template() {\n\n new Background(\n {\n id: \"background\",\n layer: 0,\n background: \"url('https://s1.qwant.com/thumbr/0x380/b/3/e0305e2ad2553f13cb419a5f602563dcd6e5dd57256ff747f8fa345a69727e/319089-drawing-sky-clouds.jpg?u=https%3A%2F%2Fwallup.net%2Fwp-content%2Fuploads%2F2016%2F04%2F10%2F319089-drawing-sky-clouds.jpg&q=0&b=1&p=0&a=1')\",\n //background: \"radial-gradient(circle, rgba(193,229,255,1) 0%, rgba(126,212,255,1) 64%, rgba(22,172,246,1) 100%)\",\n size: \"100%\",\n }\n );\n\n new Text(\n {\n id: \"title\",\n layer: 100,\n x: 385,\n y: 50,\n width: 500,\n height: 100,\n rotation: 0,\n type: \"any\",\n text: \"TheFatRat & Anjulie\",\n font_size: 30,\n color: \"#fff\",\n text_shadow: \"0px 0px 5px #fff\",\n }\n );\n\n new Text(\n {\n id: \"subtitle\",\n layer: 100,\n x: 385,\n y: 100,\n width: 500,\n height: 100,\n rotation: 0,\n type: \"any\",\n text: \"Close To The Sun\",\n font_size: 50,\n color: \"#fff\",\n text_shadow: \"0px 0px 5px #fff\",\n }\n );\n\n new Image(\n {\n id: \"sun\",\n layer: 50,\n x: 540,\n y: 260,\n width: 200,\n height: 200,\n rotation: 0,\n background: \"radial-gradient(circle, rgba(255,255,139,1) 0%, rgba(255,255,135,1) 35%, rgba(255,255,172,1) 100%)\",\n size: \"\",\n border_radius: \"100px\",\n box_shadow: \"rgb(253, 253, 186) 0px 0px 100px\",\n }\n );\n\n new Visualizer(\n {\n id: \"sun-rays\",\n layer: 45,\n x: 390,\n y: 110,\n width: 500,\n height: 500,\n rotation: 0,\n radius: 100,\n type: \"circular\",\n points_count: 50,\n analyser_range: [100, 500],\n color: \"rgb(255, 255, 121)\",\n bar_thickness: 2,\n border_radius: \"1px\",\n box_shadow: \"0px 0px 2px #ffff0c\",\n }\n );\n\n new ParticleFlow(\n {\n id: \"particle_flow\",\n layer: 5,\n x: 0,\n y: 0,\n width: 1280,\n height: 720,\n particle_radius_range: [1, 2],\n type: \"radial\",\n center: {\n x: 640,\n y: 360,\n },\n particle_direction: 0,\n max_spawn_probability: 0.4,\n color: \"#f6f6f6\",\n }\n );\n\n new Image(\n {\n id: \"ground\",\n layer: 40,\n x: 0,\n y: 650,\n width: 1280,\n height: 70,\n rotation: 0,\n background: \"linear-gradient(0deg, rgb(44, 167, 35) 0%, rgb(36, 225, 48) 64%, rgb(38, 255, 62) 100%)\",\n size: \"\",\n border_radius: \"\",\n box_shadow: \"\",\n }\n );\n\n new Visualizer(\n {\n id: \"hills\",\n layer: 40,\n x: -100,\n y: 600,\n width: 1480,\n height: 50,\n rotation: 0,\n radius: 0,\n type: \"straight-wave\",\n points_count: 20,\n analyser_range: [0, 200],\n color: \"rgb(38, 255, 62)\",\n bar_thickness: 0,\n border_radius: \"\",\n box_shadow: \"\",\n }\n );\n\n new Timer(\n {\n id: \"timer\",\n layer: 50,\n x: 100,\n y: 690,\n width: 1080,\n height: 10,\n rotation: 0,\n type: \"bar\",\n color: \"rgb(126, 251, 115)\",\n border_to_bar_space: 2,\n border_thickness: 2,\n border_radius: \"10px\",\n box_shadow: \"0px 0px 2px rgb(126, 251, 115)\",\n }\n );\n\n new Text(\n {\n id: \"time\",\n layer: 60,\n x: 545,\n y: 660,\n width: 200,\n height: 50,\n rotation: 0,\n type: \"time\",\n text: \"\",\n font_size: 20,\n color: \"rgb(194, 255, 188)\",\n text_shadow: \"0px 0px 2px rgb(194, 255, 188)\",\n }\n );\n\n}", "title": "" }, { "docid": "12ac26e2c594fa9d55944afc254a2d39", "score": "0.5613258", "text": "function computerGeek() {\n\tdocument.getElementById('wrapper').style.backgroundImage = \"url(../images/code.gif)\";\n\tdocument.getElementById('main_footer').style.backgroundColor = \"#c0c0c0\";\n\tdocument.getElementById('main_header').style.color = \"#c0c0c0\";\n\tdocument.getElementById('wrapper').style.color = \"white\";\n}", "title": "" }, { "docid": "268d63a1bc7a46be297982a42b0d2c69", "score": "0.56017923", "text": "drawBackground() {\n const context = this.context;\n const width = this.width;\n const height = this.height;\n\n context.fillStyle = 'transparent';\n context.fillRect(0, 0, width, height);\n }", "title": "" }, { "docid": "0b74ca1cef005ddca82fe2a74ea85f75", "score": "0.5601145", "text": "function Demo_backgroundimage() {\r\n var background = false;\r\n background = getbackgroundimage();\r\n\r\n if (background == true) {\r\n document.body.style.background = 'url(../images/newimages/watermark-demo.gif)';\r\n\r\n if (document.getElementById('cell_content_content') != null) {\r\n document.getElementById('cell_content_content').id = 'cell_content_content_opacity';\r\n\r\n }\r\n }\r\n}", "title": "" }, { "docid": "a8e51a8ef65a5b1e2d21a238cf5244a8", "score": "0.5600762", "text": "function background() {\n\tvar num=0;\n \t// Create gradient\n \tvar grd = ctx.createLinearGradient(0,0,canvasSize,0);\n \tgrd.addColorStop(0,\"#D68910\");\n\tfor (i = 0; i < 20; i++) {\n\t\tnum = i / 20;\n \t\tgrd.addColorStop(num,\"#D68910\");\t\n\t\tgrd.addColorStop(num + 0.02,\"#B9770E\");\n \t\tgrd.addColorStop(num + 0.04,\"#D68910\");\n \t} \n \tgrd.addColorStop(1,\"#D68910\");\n \t// Fill with gradient\n \tctx.fillStyle = grd;\n \tctx.fillRect(0,0,canvasSize,canvasSize);\n}", "title": "" }, { "docid": "6ceddac2f8f13fb475e4904adcb0522f", "score": "0.5596979", "text": "function spotlight() {\n $('.oldspotlight').fadeIn(5000);\n }", "title": "" }, { "docid": "6ec79858d8b4c9b99bf399deabc6ae58", "score": "0.5593228", "text": "function show() {\n document.querySelector(\".hurry-up\").classList.add(\"opacity\");\n document.querySelector(\".end-menu\").classList.remove(\"opacity\");\n document.querySelector(\".end-menu\").classList.add(\"z-index\");\n document.querySelector(\".overlay\").classList.remove(\"opacity\");\n document.querySelector(\".time\").classList.add(\"x-index\");\n document.getElementById(\"memory-board\").classList.add(\"x-index\");\n}", "title": "" }, { "docid": "2ef6bb2176503343c9e668735fcb0fe3", "score": "0.558934", "text": "function constBG(){\n\tif (isBG == 1){\n\t\tbackground(255, 105, 97);\n\t} else if (isBG == 2){\n\t\tbackground(178, 234, 255);\n\t} else if (isBG == 3){\n\t\tbackground(253, 253, 150);\n\t} else if (isBG == 4){\n\t\tbackground(177, 156, 217);\n\t}\n\toutPut();\n}", "title": "" }, { "docid": "361c36b1e4650122471393a1894a4d4a", "score": "0.55888873", "text": "function switchBackground() {\n owner = publicPhotos[index].owner;\n photoURL = mapUrlLink(publicPhotos[index]);\n setBackground();\n }", "title": "" }, { "docid": "afd8b880e6e7218adbeed9ccdda0e334", "score": "0.55812675", "text": "function back_to_admap(obj_id) {\n var show_item = document.getElementById(obj_id);\n var width = show_item.offsetWidth;\t\n show_item.style.backgroundPosition = width + 'px' ;\n return true;\n}", "title": "" }, { "docid": "57a88caa41f462a4008c9f77cc7e3533", "score": "0.55757225", "text": "function drawbg() {\n\tpalset = curbg;\n\tloadRomPal();\n\n\tvar bf = getrdbuf();\n\tvar bf2 = getrdbuf();\n\tlet addr = bgAddress[curbg] + bgScene * 12;\t// bgAddressSkip\n\n\tbf.position(addr);\n\tlet w = bf.getShort();\n\tlet h = bf.getShort();\n\tlet addr2 = bf.getInt();\n\t\n\tlabelInfo.innerText += ' '+ w + 'x' + h + ' addr:' + addr.toString(16).toUpperCase();\n\n\tdrawbgbasemslug(addr2, w, h);\n}", "title": "" }, { "docid": "799a0bc73ddd3229626bc281d92808d5", "score": "0.5571669", "text": "function colorBackground() {\r\n mainElement.style.backgroundColor = 'rgba(183, 28, 28, 0.8)';\r\n}", "title": "" }, { "docid": "cc5d935e25437c3dd429afa0daf8d52e", "score": "0.5567638", "text": "function printBackground(ctx) {\n ctx.fillStyle = 'black';\n ctx.fillRect(0, 0, 27, 23);\n }", "title": "" }, { "docid": "7e3d3319c8bdced7617864e19f0b5f7c", "score": "0.556723", "text": "function clearScreen(){\n\tbackground(backgroundColour);\n}", "title": "" } ]
6d79d236c19dc99f63fdb31a66331f31
eslintdisable noalert SLICE 1
[ { "docid": "2885a7ab67d73d30fda755c3a48918fb", "score": "0.0", "text": "function updateCoffeeView(coffeeQty) {\n //grab coffee counter span and store in var\n const coffeeCounter = document.getElementById('coffee_counter');\n //take the passed in coffee quantity and make it the new text of the span\n coffeeCounter.innerText = coffeeQty;\n}", "title": "" } ]
[ { "docid": "d8b4133fc964556a39720dd0472f1b1c", "score": "0.65968776", "text": "function warning(){\n alert(`Please pick the correct answer.`);\n}", "title": "" }, { "docid": "5c86eca3f7e632b95d52cfa3425d15a9", "score": "0.65915525", "text": "raiseWarning(e) {\n e.preventDefault();\n Alert.info(\n \"Make sure to save your changes before returning to the Main Menu\",\n {\n position: \"top\",\n timeout: \"none\",\n onClose: function () {\n console.log(\"onClose Fired!\");\n },\n }\n );\n }", "title": "" }, { "docid": "3cee5ece8bf944c6c0714f4ee1c9da88", "score": "0.6469758", "text": "warn() {\n window.alert(\"You will be logged out automatically in 1 minute.\");\n }", "title": "" }, { "docid": "e23c98aeae3c7690ff1fb7a44545bd97", "score": "0.64079595", "text": "function button1 () { // eslint-disable-line no-unused-vars\n\talert('Hi from function button1!');\n}", "title": "" }, { "docid": "3d255b6918fde48242266ca409914aa4", "score": "0.635897", "text": "_rejectQuestWarn() {\n Alert.alert(\n 'Reject Quest',\n 'Are you sure you want to reject this quest? 😱',\n [\n { text: 'Cancel', onPress: () => {}, style: 'cancel' },\n { text: 'I\\'m sure', onPress: this._rejectQuest },\n ],\n { cancelable: false }\n )\n }", "title": "" }, { "docid": "d6fe43d39109317e996fec7496e85dcf", "score": "0.6334917", "text": "function Warning() {\n alert(\"Always remember to continue breathing, in and out.\");\n}", "title": "" }, { "docid": "dbff0f7635cdb74fa089f9a6f3473db9", "score": "0.62985957", "text": "function warningMessage(message) {\n setAlert('warning');\n setMessage(message);\n}", "title": "" }, { "docid": "47a1c273ff43134b4416471ae1af0b35", "score": "0.6278716", "text": "myAlert() {\n\t\talert('this is your alert');\n\t}", "title": "" }, { "docid": "eeced9950d463127d0cc8d96d500c698", "score": "0.62166154", "text": "function swallowError() {\r\n 'use strict';\r\n}", "title": "" }, { "docid": "d8bedd1e08f00b949c194d9bf8f376ec", "score": "0.6207829", "text": "function my_alert(msg) {\n afficher_message(\"Alert\", msg);\n}", "title": "" }, { "docid": "400d228a9457fd1ab8af98287efc2398", "score": "0.6192997", "text": "notice() {}", "title": "" }, { "docid": "04ffeffc9f69f05e7c89c32fc32b4d57", "score": "0.6179611", "text": "function alert() {\r\n\r\n}", "title": "" }, { "docid": "392d99a000c44d30af20941c666c54d3", "score": "0.6132363", "text": "alertErrorEnable(tituto, nombreModuloPlural) {\n Swal.fire({\n icon: \"error\",\n title: \"Error al activar \" + tituto,\n text: \"Administración de \" + nombreModuloPlural,\n confirmButtonText: '<i class=\"fa fa-check\"></i> Aceptar',\n showCloseButton: true,\n focusConfirm: true,\n footer: process.env.REACT_APP_FOOTER_ALERTAS,\n });\n }", "title": "" }, { "docid": "144fc0032b82ca8e7073e59107d47ec1", "score": "0.6101664", "text": "function warnUser() {\n console.log(\"This is my warning message\");\n }", "title": "" }, { "docid": "f58617c304366fb00fd6fadd0c34c0c7", "score": "0.60961103", "text": "function warning(msg) {\n\talert(\"WARNING: \" + msg);\n}", "title": "" }, { "docid": "d39f881ab6820963f0b4d8e204120f3d", "score": "0.60880965", "text": "function showSpecialWarning() {\r\n return true;\r\n}", "title": "" }, { "docid": "fc1363e500f51c6bb3e59484b0451245", "score": "0.6063554", "text": "alert(title, content) {\n //console.log('API.alert ===', title, content);\n if (content === undefined && title && title.length > 0) {\n Alert.alert('Thông báo', title);\n return;\n }\n\n if (content && content.length > 0) {\n if (title && title.length > 0) {\n Alert.alert(title, content);\n } else {\n Alert.alert('Thông báo', content);\n }\n }\n }", "title": "" }, { "docid": "55e6b8929133e77c424c74e03571b154", "score": "0.6016072", "text": "function warnUser() {\n console.log(\"This is my warning message\");\n}", "title": "" }, { "docid": "4780d2495d49b6e17f8dd8081f94f95c", "score": "0.6014069", "text": "function setAlert() {\n alert('HAMMERTIME');\n}", "title": "" }, { "docid": "2b355621d9db8fd841c2028aa6f312bc", "score": "0.6012211", "text": "function openAlert() {\n const data = {\n type: \"danger\",\n seconds:5,\n // icon: \"fa fa-times-circle\",\n title: \"This is a warning message\",\n details: \"Warning\",\n };\n\n window.alertPanel(data);\n }", "title": "" }, { "docid": "7f4e131c630b2c1c068b62e6bf580b5e", "score": "0.60083467", "text": "function alert () {\n\t\t\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\t\t\ttitle: 'Not Allowed!',\n\t\t\t\t\t\t\t\t\t\t\t\ttext: \"The current vacation balance for this Employee is not enough to accept this request!\",\n\t\t\t\t\t\t\t\t\t\t\t\ticon: 'warning',\t\n\t\t\t\t\t\t\t\t\t\t\t\tdangerMode: true,\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t}", "title": "" }, { "docid": "6f801541fa322094abe8799fa6fe0330", "score": "0.6006893", "text": "function sayAvoid() {\n alert(\"HAHAHA!!!!! Great agility!! They couldn't touch us\");\n }", "title": "" }, { "docid": "28cc90a84a49587f3bf505fb9b8be39d", "score": "0.600327", "text": "setAutoAlert(e) {\n this.setState({ autoAlert: e.target.checked });\n\n // Disable auto alert checkbox \n this.setState({ manualDisabled: !this.state.manualDisabled });\n }", "title": "" }, { "docid": "fdb897c0c3f832fbcf96b59d4342e628", "score": "0.59887004", "text": "function alerta() {\n \n alert(\"Que hay de nuevo bro\");\n}", "title": "" }, { "docid": "b997f0262a3757336af085ca2cf6978e", "score": "0.59834933", "text": "function tysubmisAlert() {\r\n\talert(\"Thank you for your request for more information. We will contact you soon.\")\r\n\t}", "title": "" }, { "docid": "bf2dd1c5630eba185cd98088dfd0fe0e", "score": "0.59814173", "text": "function warning(title){\n swal({\n title: title,\n type: \"warning\",\n confirmButtonColor: \"#DD6B55\",\n confirmButtonText: \"Aceptar!\",\n closeOnConfirm: true\n });\n }", "title": "" }, { "docid": "8b30a8cf8c24e36442d0139c2940e7dc", "score": "0.5976186", "text": "function createAlert() {\n Alert.alert(\n \"Tarefa 1\",\n \"Informe um ID válido\",\n [\n { text: \"OK\", onPress: () => console.log(\"OK Pressed\") }\n ],\n { cancelable: false }\n );\n}", "title": "" }, { "docid": "917dd78833d718d88b9a04bfe10a92c3", "score": "0.59218127", "text": "function alert(warning) {\n console.log(this);\n return warning;\n}", "title": "" }, { "docid": "0e4f87776eba272eb212313ae2dc20ac", "score": "0.5916447", "text": "function alertNotAllow() {\n\tvar messVar = new Array();\n\t$message = getMessage(\"E002\", messVar);\n\talert($message);\n}", "title": "" }, { "docid": "9df4c251b721a1576c6aa3dee8e13357", "score": "0.5910603", "text": "function alertCallback() {\n \"use strict\";\n alert (\"Notification done\");\n}", "title": "" }, { "docid": "c78f83ae04c3a1659a1eeb29bffa5ced", "score": "0.59015477", "text": "function Alert(title, message, status) {\n swal({\n title: title,\n text: message,\n icon: status\n });//FIN DEL SWEET ALERT\n}//FIN FUNCION", "title": "" }, { "docid": "abd48750b114fad47df62b1528758a05", "score": "0.59002006", "text": "function warningMsg(msg) {\r\n\talert(\"WARNING: \" + msg);\r\n}", "title": "" }, { "docid": "ca8182da2cfb53a16ca80e5f8956c26c", "score": "0.5899794", "text": "function okWarn(dialog) {\n var ui = SpreadsheetApp.getUi();\n var response = ui.alert(dialog, ui.ButtonSet.OK);\n}", "title": "" }, { "docid": "3b4bcfd8b12d60d3be3b6b7a5a6feb2b", "score": "0.5897424", "text": "alert() {\n\t\t\t// preventDefault();\n\t\t\talert(\"BRUH!\");\n }", "title": "" }, { "docid": "4ca757e24a5480b76730a12ca6b0c214", "score": "0.58960223", "text": "function AlertType(){}", "title": "" }, { "docid": "6c6289a0d677eeeee8c8e9619e660b0c", "score": "0.58955455", "text": "function warnUser() {\n alert(\"This is my warning message\");\n}", "title": "" }, { "docid": "c13fbd2113742537d43d2ebccf4508f8", "score": "0.58758664", "text": "function a(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "title": "" }, { "docid": "aeac65c386b5134f1106c8848a69ec2c", "score": "0.5859889", "text": "alertErrorUpdate(tituto, nombreModuloPlural) {\n Swal.fire({\n icon: \"error\",\n title: \"Error al actualizar \" + tituto,\n text: \"Administración de \" + nombreModuloPlural,\n confirmButtonText: '<i class=\"fa fa-check\"></i> Aceptar',\n showCloseButton: true,\n focusConfirm: true,\n footer: process.env.REACT_APP_FOOTER_ALERTAS,\n });\n }", "title": "" }, { "docid": "edba87c48d89b5056b7e75945c7d4bf0", "score": "0.5857608", "text": "function alert_msg(type, msg) {\n Toast.fire({\n type: type,\n title: msg\n })\n}", "title": "" }, { "docid": "144e06bddbb405354d80402acdd872b8", "score": "0.58575916", "text": "function customalerting(alTitle,alText){\n\t\nvar ALERT_TITLE = \"Oops!\";\nvar ALERT_BUTTON_TEXT = \"Ok\";\nif(document.getElementById) {\n\twindow.alert = function(ALERT_TITLE) {\n\t\tcreateCustomAlert(ALERT_TITLE);\n\t}\n}\t\n}", "title": "" }, { "docid": "700b081158220d8ab2f57e3567d80bc5", "score": "0.58527577", "text": "function alert(message) {\n if (message && message != '')\n Alertify.alert(message);\n }", "title": "" }, { "docid": "8d76e48490b46b92ca8b5b132e90ed6e", "score": "0.5850033", "text": "function toastr_alert(alert, message, title) {\n toastr[alert](message, title)\n\n toastr.options = {\n \"closeButton\": false,\n \"debug\": false,\n \"newestOnTop\": true,\n \"progressBar\": true,\n \"positionClass\": \"toast-top-right\",\n \"preventDuplicates\": false,\n \"onclick\": null,\n \"showDuration\": \"300\",\n \"hideDuration\": \"1000\",\n \"timeOut\": \"5000\",\n \"extendedTimeOut\": \"1000\",\n \"showEasing\": \"swing\",\n \"hideEasing\": \"linear\",\n \"showMethod\": \"fadeIn\",\n \"hideMethod\": \"fadeOut\"\n }\n}", "title": "" }, { "docid": "ac6a30e373d57668f24d0cae09557685", "score": "0.58483726", "text": "alertErrorServer() {\n Swal.fire({\n icon: \"error\",\n title: \"Error al conectar con el servidor \",\n text:\n \"Es posible que no tenga conexión a internet ó el servidor esté fuera de linea, si el problema persiste contactese con el administrador.\",\n confirmButtonText: '<i class=\"fa fa-check\"></i> Aceptar',\n showCloseButton: true,\n focusConfirm: true,\n footer: process.env.REACT_APP_FOOTER_ALERTAS,\n });\n }", "title": "" }, { "docid": "06602b772113fbb9aa6d5a404f765e92", "score": "0.58474183", "text": "function alertUser(evt) {\n evt.preventDefault();\n alert('Sorry, this hasn\\'t been built yet');\n }", "title": "" }, { "docid": "e0c7341d892f5f7e0343fc9e16cb608b", "score": "0.58384264", "text": "alertEmpty(titulo_principal, texto, tipo) {\n Swal.fire({\n icon: tipo,\n title: titulo_principal,\n allowOutsideClick: false,\n text: texto,\n confirmButtonText: '<i class=\"fa fa-check\"></i> Aceptar',\n showCloseButton: true,\n focusConfirm: true,\n footer: process.env.REACT_APP_FOOTER_ALERTAS,\n });\n }", "title": "" }, { "docid": "7445002dc24306cdfd75e7218a0ca1e1", "score": "0.58354276", "text": "function issueWarning(func, msg) {\r\n event.rc = true;\r\n if (event.willCommit) {\r\n if (!func(event, event.value)){\r\n app.alert(msg, 1);\r\n console.println(\"trigger for: \" + msg);\r\n event.rc = false;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "0940e63dff2ad1fa95989ebe2b94a364", "score": "0.5830192", "text": "warnNotSetup() {\n warn(\"An action was fired before the editor was set up\", { id: \"rdfa-editor.not-setup\" } );\n }", "title": "" }, { "docid": "728617ac8ada9acbd2a75db5b90f6522", "score": "0.58225685", "text": "alertErrorSave(nombreModulo, nombreModuloPlural) {\n Swal.fire({\n icon: \"error\",\n title: \"Error al guardar \" + nombreModulo,\n text: \"Administración de \" + nombreModuloPlural,\n confirmButtonText: '<i class=\"fa fa-check\"></i> Aceptar',\n showCloseButton: true,\n focusConfirm: true,\n footer: process.env.REACT_APP_FOOTER_ALERTAS,\n });\n }", "title": "" }, { "docid": "3ffb87505789c7f30f30e907c2de26be", "score": "0.5821456", "text": "function $alert(type,methode,error,msg){contactTxt=\"\\nContact. : Please contact the owner/scripter about this problem.\";if(typeof(console)!=\"undefined\"&&type!='g'&&type!='n'){var consoleErrorTxt=\"Error Nr : \"+error+\" (console)\\n\"+\"Message : \"+msg+contactTxt;var consoleInfoTxt=\"Error Nr : \"+error+\" (console)\\n\"+\"Message : \"+msg;if(methode==1)console.debug(consoleInfoTxt);else if(methode==2)console.info(consoleInfoTxt);else if(methode==3)console.warn(consoleErrorTxt);else if(methode==4)console.error(consoleErrorTxt);else console.warn(consoleErrorTxt);}if(typeof(US_log)!=\"undefined\"&&type!='c'&&type!='n'){US_log(\"Error Nr. : \"+error+\" (US_log)\\n\"+\"Message : \"+msg+contactTxt);}if(type!='c'&&type!='g')alert(\"Error Nr. : \"+error+\" (normal)\\n\"+\"Message : \"+msg+contactTxt);}", "title": "" }, { "docid": "8ddad0b2aedd79db9ace8fb5fc1aeff2", "score": "0.5819379", "text": "function btnAlert() {\n\talert(`Hey, the button works! I guess that's a stretch!`);\n}", "title": "" }, { "docid": "2acd0ff433065067b8696c76c63ad001", "score": "0.5811298", "text": "QuickAlert(ToastText, ToastType) {\n // UIHelper.QuickAlert(\"test\",\"info\");\n // debugger;\n try {\n const UserOptions = WebApp.AppPrefs.UserOptions;\n if (UserOptions.UI.IgnoreToast) {\n UserOptions.UI.IgnoreToast = false;\n }\n\n if (UserOptions.UI.IgnoreToast == true) {\n console.log('---- >ignoring toasts:', ToastText);\n } else {\n Metro.toast.create(ToastText, null, 4000, ToastType);\n }\n } catch (errAlert) {\n // debugger;\n console.warn(errAlert);\n }\n\n\n }", "title": "" }, { "docid": "d6274838a03257206c0e69126826d16e", "score": "0.58003813", "text": "function annoyingAlert() { \n alert(\"YOU CLICKED ON THE BUTTON!\");\n }", "title": "" }, { "docid": "ad5d4b8e447c7b2b2d9cf07c7794cd7f", "score": "0.5795778", "text": "alert(){\n this.showAlert=true;\n }", "title": "" }, { "docid": "51c1af2367d378269ea6f1afa00041fc", "score": "0.5794234", "text": "function display_alert(){\n alert(\"This is my alert!\")\n}", "title": "" }, { "docid": "5730fe01273cca5babdb881cf18c3767", "score": "0.5783133", "text": "showWarningAlert(msg) {\n return tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"](this, void 0, void 0, function* () {\n const alert = yield this.alertCtrl.create({\n header: 'Warning',\n message: msg,\n buttons: ['OK']\n });\n yield alert.present();\n });\n }", "title": "" }, { "docid": "fc778a5301a8e96f79952d05c0d9d7e9", "score": "0.5778485", "text": "function setOffAlerts() {\n}", "title": "" }, { "docid": "0b6c690414049071a26e83dd60c1d795", "score": "0.57746613", "text": "rejected() {\n }", "title": "" }, { "docid": "a5aaf644678ad0848bd44ab69b80342f", "score": "0.5759883", "text": "function a(e, t) {\n\"undefined\" != typeof console && (console.warn(\"[vue-i18n] \" + e), t && console.warn(t.stack))\n}", "title": "" }, { "docid": "4c2f5bd364b7d3743c171fe5e8d2f02a", "score": "0.5756559", "text": "Confirm() {}", "title": "" }, { "docid": "93be14bb728c3c6dad108ebf397abe43", "score": "0.57526153", "text": "function customAlert(msg){\n\n// alert user.\n\n alert(msg);\n\n }", "title": "" }, { "docid": "b2c98364f3f7ccd209e16af5c64bf3a9", "score": "0.5751963", "text": "function alertDismissed() {}", "title": "" }, { "docid": "3a78ba8bc8f1370e0421b80060cfe9c5", "score": "0.57506603", "text": "showAlert() {\n swal(\"Error\", \"Hay datos requeridos vacios\", \"error\");\n }", "title": "" }, { "docid": "be5a35f31a416d1023ed6e062e325e02", "score": "0.5732695", "text": "function we(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "title": "" }, { "docid": "5451c144996d1bf8fff718f4ed968c15", "score": "0.57273215", "text": "function e(A,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+A),t&&console.warn(t.stack))}", "title": "" }, { "docid": "125dc3638c0b417b2c059216cf97f0e9", "score": "0.57241815", "text": "function error(err) {\r\n alert(`ERROR(${err.code}): ${err.message}`)\r\n console.warn(`ERROR(${err.code}): ${err.message}`);\r\n}", "title": "" }, { "docid": "abc8c69041bc9b1f8b3af50133453762", "score": "0.5721725", "text": "function showAlert(){\n alert(\"Confirm to book your ticket?\");\n}", "title": "" }, { "docid": "4b2e555b7e566944f68e056f32a12006", "score": "0.5719241", "text": "function aceptarNotificacion(){\r\n\r\n}", "title": "" }, { "docid": "b10e9f5edb2cbe6446f2705892afbf2a", "score": "0.57112354", "text": "function unused() {\n \"use strict\";\n}", "title": "" }, { "docid": "407c64fd1ff95fa22f416a6291955775", "score": "0.5706995", "text": "function dangerMessage(message) {\n setAlert('danger');\n setMessage(message);\n}", "title": "" }, { "docid": "9d134595a0a9f60b384ab985f078c1c6", "score": "0.5706986", "text": "function useIonAlert() {\n const controller = useController('IonAlert', core.alertController);\n function present(messageOrOptions, buttons) {\n if (typeof messageOrOptions === 'string') controller.present({\n message: messageOrOptions,\n buttons: buttons !== null && buttons !== void 0 ? buttons : [\n {\n text: 'Ok'\n }\n ]\n });\n else controller.present(messageOrOptions);\n }\n return [\n present,\n controller.dismiss\n ];\n}", "title": "" }, { "docid": "e12a74a222214d2b7bd41f5116c814df", "score": "0.5700701", "text": "onHandleAlerts () {\n if (this.state.error) {\n return <div className=\"alert alert-danger\" role=\"alert\">{this.state.error.message}</div>\n }\n }", "title": "" }, { "docid": "1f2a41d405db0c22bd651e885b58cc72", "score": "0.56982034", "text": "function privacyPolicyFunction(){ \n\n toastr.options = {\n \"closeButton\": true,\n \"debug\": false,\n \"newestOnTop\": false,\n \"progressBar\": false,\n \"positionClass\": \"toast-top-full-width\",\n \"preventDuplicates\": true,\n \"onclick\": null,\n \"showDuration\": \"300\",\n \"hideDuration\": \"1000\",\n \"timeOut\": 0,\n \"extendedTimeOut\": 0,\n \"showEasing\": \"swing\",\n \"hideEasing\": \"linear\",\n \"showMethod\": \"fadeIn\",\n \"hideMethod\": \"fadeOut\",\n \"tapToDismiss\": true\n }\n\n toastr[\"warning\"](\"Do you agree to our Privacy Policy?<br /><br /><button type='button' class='btn clear'>Yes</button>\", \"Info\");\n}", "title": "" }, { "docid": "01619c791d657146198d13a0cb97268a", "score": "0.56845975", "text": "function Alert(){\n // 이벤트 핸들러 정의\n /**\n * Cancel Alert when clicked X button\n * @param {Object} event - user event \n */ \n function handleAlertCancel(event){\n // css pseudo element 는 자바스크립트로 클릭할 수 없어서 X 버튼 주변 영역을 클릭했을때 이벤트 처리함\n if(event.offsetX > this.offsetWidth - 50 && event.offsetY > this.offsetHeight - 50){\n updateElement('alert-component', {'className': 'alert-component'})\n updateElement('alert-msg', {}, [''])\n }\n }\n \n // 컴포넌트 생성\n /**\n * Build specific component */\n function buildComponent(){ \n const alertComponent = buildElement('div', {'id': 'alert-component', 'className': 'alert-component'}, [\n buildElement('div', {'id': 'alert-msg'}, ['']),\n ]);\n\n updateElement('profile-alert', {}, [alertComponent]);\n }\n // 이벤트 핸들러 연결\n /**\n * Attach event handlers related to specific component\n */\n function attachHandlers(){\n searchElement('alert-msg').addEventListener('click', handleAlertCancel)\n }\n /**\n * initialize component when rendering on browser\n */\n function init(){\n buildComponent();\n attachHandlers();\n }\n init();\n}", "title": "" }, { "docid": "f8b66e516e21b45236fc8a862b202dfd", "score": "0.5682765", "text": "function Bc(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "title": "" }, { "docid": "e0c6c09250ba980c56c21938b2af89a9", "score": "0.5678813", "text": "static confirmAlert() {\n if (browser.getAlertText()) {\n browser.acceptAlert();\n }\n }", "title": "" }, { "docid": "d4ea58a69a35f7337a99c571ec938278", "score": "0.56762797", "text": "handleShowAlert() {\n this.setState({ showAlert: true });\n }", "title": "" }, { "docid": "1905c39e340938eb1c2b2c9de6ff6912", "score": "0.56671923", "text": "handleOnAlertClose() {\n const { actions } = this.props;\n\n actions.alert.destroyAlert();\n }", "title": "" }, { "docid": "51a7659cc43d3eeb59ff346cd4060f7c", "score": "0.5667018", "text": "function n(e,t){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "title": "" }, { "docid": "08f5b62475026b3a677a38087d2a1f98", "score": "0.56606466", "text": "function showAlert(message = \"Oops! Something went wrong, please try again.\") {\n alert(message);\n}", "title": "" }, { "docid": "bb7d4901c2520ae4cf91d1e069030af6", "score": "0.5657295", "text": "LogWarning() {}", "title": "" }, { "docid": "0c84acf4230a7703bb396ae9e01fd7e5", "score": "0.5655643", "text": "lanzarAlerta(){\nalert('Me clickeaste!')\n }", "title": "" }, { "docid": "8acfadb6d6febcee55e80af0ade46b58", "score": "0.5654106", "text": "gamingAlert(e) {\n if (this.state.showedGamingAlert) return null\n if (!this.props.isSampleJob) {\n this.props.errorAction({\n position: 'fixed',\n title: 'About locked fields:',\n message: \"The name on this job is editable until the first time you model. The address is only editable at the time of job creation. Please contact Support if you need assistance.\",\n timeout: 20000\n })\n }\n this.setState({showedGamingAlert: true})\n return e\n }", "title": "" }, { "docid": "1767adb79ce2cd6f5d2618205b9981d2", "score": "0.56529856", "text": "function sn(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "title": "" }, { "docid": "1767adb79ce2cd6f5d2618205b9981d2", "score": "0.56529856", "text": "function sn(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "title": "" }, { "docid": "cc88f508183b59a8b0ca6455de9d15c4", "score": "0.5650391", "text": "function l(e,t){if(typeof console!==\"undefined\"){console.warn(\"[vue-i18n] \"+e);if(t){console.warn(t.stack)}}}", "title": "" }, { "docid": "8acf4d88e6836a616e1bf9e2f0df1f97", "score": "0.56468034", "text": "function getUserRightsMessageError() {\n toastr.info(\"No rights to perform actions. Please contact Administrator.\");\n}", "title": "" }, { "docid": "0e180cdcefb13cced73518a4dcc03588", "score": "0.5646633", "text": "function n(t,e){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "title": "" }, { "docid": "0e180cdcefb13cced73518a4dcc03588", "score": "0.5646633", "text": "function n(t,e){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "title": "" }, { "docid": "8031cdb40aafdd19223a2fbed3aab17f", "score": "0.5643958", "text": "function showAlert(title, msg) {\n return lib.ShowAlert(title, msg);\n}", "title": "" }, { "docid": "f688a81986016ca3ac20904a95275d22", "score": "0.564373", "text": "function p(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "title": "" }, { "docid": "4dfa4a5d9417a53cbb5351c2d0333072", "score": "0.5640957", "text": "function n(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "title": "" }, { "docid": "4dfa4a5d9417a53cbb5351c2d0333072", "score": "0.5640957", "text": "function n(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "title": "" }, { "docid": "73deb11867e39cbf8f8630da39f1e29e", "score": "0.56340146", "text": "function onFail(message) {\n // alert('Failed because: ' + message);\n}", "title": "" }, { "docid": "7fe980773c997c0939708ed5013ec5bc", "score": "0.563201", "text": "rejected() {\n }", "title": "" }, { "docid": "7cc7e2461339e01a9c43e237e160a268", "score": "0.5630335", "text": "function AlertME() {\n console.log(alert(\"Hello Nikhil\"));\n}", "title": "" }, { "docid": "bec456a3069bb6a0c0d3df3816ede4a9", "score": "0.56270665", "text": "function n(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "title": "" }, { "docid": "bec456a3069bb6a0c0d3df3816ede4a9", "score": "0.56270665", "text": "function n(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "title": "" }, { "docid": "79f7ed9df08dfa96e565bf694f27c44b", "score": "0.56227595", "text": "heightWarningAlert() {\n Alert.alert(\n \"You input height as \" + this.state.height + \"cm. Is this accurate? It seems too high.\"\n )\n }", "title": "" }, { "docid": "7394bbdec211fac86a2a5b969f1f2a72", "score": "0.56142175", "text": "handleOnErrorAlertClose() {\n const { actions } = this.props;\n\n actions.errorHandler.destroyError();\n actions.alert.destroyAlert();\n }", "title": "" }, { "docid": "bdc00edf988eeb85b7cc85e370f6a381", "score": "0.5611973", "text": "function resetAlerts() {\n}", "title": "" }, { "docid": "86d4e65d01b79ea9b027475cbc961bf7", "score": "0.56118697", "text": "function showAlerthanhcong() {\n // goi ham chung de show alert: ID = alert-danger\n showAlert('#alert-thanhcong')\n}", "title": "" } ]
711eb04ea9a4ca50048d0bba6c594455
For Node v0.10 support. Remove this eventually.
[ { "docid": "40d9d01aaaa4b330d7a22f1c44271f73", "score": "0.0", "text": "function isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}", "title": "" } ]
[ { "docid": "82ede7fecff156cb3cfac6b553d6e865", "score": "0.5760611", "text": "function NodeModule() {\n}", "title": "" }, { "docid": "60f97f51026b80566d0fec120b1f7bf5", "score": "0.55544066", "text": "function NodeFsHandler() {}", "title": "" }, { "docid": "60f97f51026b80566d0fec120b1f7bf5", "score": "0.55544066", "text": "function NodeFsHandler() {}", "title": "" }, { "docid": "60f97f51026b80566d0fec120b1f7bf5", "score": "0.55544066", "text": "function NodeFsHandler() {}", "title": "" }, { "docid": "60f97f51026b80566d0fec120b1f7bf5", "score": "0.55544066", "text": "function NodeFsHandler() {}", "title": "" }, { "docid": "60f97f51026b80566d0fec120b1f7bf5", "score": "0.55544066", "text": "function NodeFsHandler() {}", "title": "" }, { "docid": "e27aea1af2d2b9b3adf609f742117ac1", "score": "0.5354225", "text": "if (Object.freeze) {\n Object.freeze(returnNode);\n }", "title": "" }, { "docid": "23c456980a5333ec250339bb791b0946", "score": "0.5346567", "text": "static from() { return undefined; }", "title": "" }, { "docid": "4c2c537b7c4f0d86267575ed44b6688d", "score": "0.5320159", "text": "function NodeOpenable() {}", "title": "" }, { "docid": "3224076c79aed8652f7011f9c0c3dea4", "score": "0.5317947", "text": "function NodePlatform() {\n}", "title": "" }, { "docid": "8aea9d981f063cfa1db4f0752960981e", "score": "0.5260183", "text": "_read() {\n return undefined;\n }", "title": "" }, { "docid": "512ba6ee99f12199f0e7905f752d3260", "score": "0.52058023", "text": "get legacy() {}", "title": "" }, { "docid": "5e364b2a24e27e2ddf7faaa3ba28439d", "score": "0.51281303", "text": "function RNode() {}", "title": "" }, { "docid": "5e364b2a24e27e2ddf7faaa3ba28439d", "score": "0.51281303", "text": "function RNode() {}", "title": "" }, { "docid": "16370b80820bd5f4d08d706480525b44", "score": "0.5087849", "text": "extend(config, ctx) {\n config.node = {\n fs: \"empty\",\n };\n }", "title": "" }, { "docid": "920a4de6f3652b5c6df25d3ce11efe1a", "score": "0.5087259", "text": "function NodeLogger() {}", "title": "" }, { "docid": "920a4de6f3652b5c6df25d3ce11efe1a", "score": "0.5087259", "text": "function NodeLogger() {}", "title": "" }, { "docid": "480947dcfa391c2c5b879cb1f56ca8ad", "score": "0.5072706", "text": "function NodeLogger() { }", "title": "" }, { "docid": "480947dcfa391c2c5b879cb1f56ca8ad", "score": "0.5072706", "text": "function NodeLogger() { }", "title": "" }, { "docid": "480947dcfa391c2c5b879cb1f56ca8ad", "score": "0.5072706", "text": "function NodeLogger() { }", "title": "" }, { "docid": "480947dcfa391c2c5b879cb1f56ca8ad", "score": "0.5072706", "text": "function NodeLogger() { }", "title": "" }, { "docid": "1a2493483a7444102be755ef403ce63e", "score": "0.5068706", "text": "getNode() {\n throw new Error(\"Must be implemented\");\n }", "title": "" }, { "docid": "e543f3984bb318ca7d3b2fadb6ca2943", "score": "0.50506115", "text": "static of() { return undefined; }", "title": "" }, { "docid": "e0b6457df3a9d70152b7f2579e0fe187", "score": "0.5037997", "text": "function printtest() {\n console.log(\"Node.js is evil!\");\n}", "title": "" }, { "docid": "368aa45500459707665242e60222ef06", "score": "0.50298", "text": "function NodeLogger(){}", "title": "" }, { "docid": "a565d13cc3c0db60e2d0e099bac9b8aa", "score": "0.50017494", "text": "function sayHello(){\n console.log('Hello NodeJs !!');\n \n}", "title": "" }, { "docid": "efbe10b8f13ee2b23125b4715ce22e48", "score": "0.49900672", "text": "shortlinkRe() {\n throw new Error('Not implemented.');\n }", "title": "" }, { "docid": "7a0d1772fcc3c1f33a91877a72ea55aa", "score": "0.49886307", "text": "static onThisNode(cbk) {\n return (node) => {\n };\n }", "title": "" }, { "docid": "2a62fa88192bdd7643980cc02da08731", "score": "0.49840045", "text": "function RNode(){}", "title": "" }, { "docid": "c1becb4b95460da703c4b3e5ea94380a", "score": "0.4974277", "text": "getType() {\r\n return 'NODE'\r\n }", "title": "" }, { "docid": "75550aecf9471faf2aadbf91183ba25d", "score": "0.49733278", "text": "process(node, result) {\n return super.process(node, result)\n }", "title": "" }, { "docid": "75550aecf9471faf2aadbf91183ba25d", "score": "0.49733278", "text": "process(node, result) {\n return super.process(node, result)\n }", "title": "" }, { "docid": "6b383e43e017cdbfcd12f8f9c4c1a872", "score": "0.4971995", "text": "function node() {\n}", "title": "" }, { "docid": "264c8a0aef842b893bede8eba2f37167", "score": "0.49660948", "text": "function error(err) {\n\tconsole.log(err);\n}", "title": "" }, { "docid": "bb2b25070c22e198f86ecef63b254428", "score": "0.49593347", "text": "clone() {\n throw new Error('Cannot clone node');\n }", "title": "" }, { "docid": "308bc83138d32ba1a2b0d2dd8b34360e", "score": "0.49541897", "text": "function rc() {}", "title": "" }, { "docid": "b62432ba82772c9bde98370fc8693f90", "score": "0.4949551", "text": "function TNode() {}", "title": "" }, { "docid": "b62432ba82772c9bde98370fc8693f90", "score": "0.4949551", "text": "function TNode() {}", "title": "" }, { "docid": "cf357cd91d8c21bc3e148c9f17c87c5c", "score": "0.49438068", "text": "upgrade() {\n // Empty\n }", "title": "" }, { "docid": "76da376ef681711f7d7616326ee3d3dc", "score": "0.4916484", "text": "function NWTNode() {\n\t\n}", "title": "" }, { "docid": "3063e6a66f2f4c641291df0d195d807f", "score": "0.49152297", "text": "extend(config, { isDev, isClient }) {\n config.node = {\n fs: 'empty'\n }\n }", "title": "" }, { "docid": "e062a4071fe27bb81178b95c1490d1fd", "score": "0.49056554", "text": "extend(config, ctx) {\n config.node = {\n fs: 'empty'\n }\n }", "title": "" }, { "docid": "a620117ac5f20130f7121f2fae662830", "score": "0.4904091", "text": "function _nodeVer() { return \"Node \" + process.version + \" running on \" + process.platform + \" \" + process.arch; }", "title": "" }, { "docid": "42b61a874f2d79eb6a0903f87de6da9b", "score": "0.49031475", "text": "function inNodeJs()/*:boolean*/ {\n try {\n return Object.prototype.toString.call(process) === '[object process]' \n } catch(e) { return false; }\n}", "title": "" }, { "docid": "ef385b1ecd3b8a0ed99f2f6400f769e7", "score": "0.48980445", "text": "function getBasicNodeMethods() {\n return ['get', 'post', 'put', 'head', 'delete', 'options', 'trace', 'copy', 'lock', 'mkcol', 'move', 'purge', 'propfind', 'proppatch', 'unlock', 'report', 'mkactivity', 'checkout', 'merge', 'm-search', 'notify', 'subscribe', 'unsubscribe', 'patch', 'search', 'connect'];\n}", "title": "" }, { "docid": "7aadd94e31a089937679253229639a97", "score": "0.48801708", "text": "function cb() {// ...\n }", "title": "" }, { "docid": "8869350ddeb45f023cb5b5d0b720670f", "score": "0.48794827", "text": "linux() {}", "title": "" }, { "docid": "8571ea7a6594c1c07486e8158bf384fa", "score": "0.48758933", "text": "_read() {}", "title": "" }, { "docid": "8571ea7a6594c1c07486e8158bf384fa", "score": "0.48758933", "text": "_read() {}", "title": "" }, { "docid": "62e1eeec4fdee80f3055708e418971a8", "score": "0.48614085", "text": "function checkNodeVersion() {\n if (process.version > 'v8.4.0' || process.version.indexOf('.') > 2) {\n var log = require('npmlog');\n log.warn('napajs binding', 'Thanks for using Napa.js.');\n log.warn('napajs binding', 'There is a compatibility issue on Node v8.5.0 and above.');\n log.warn('napajs binding', 'The flag \"--noincremental-marking\" is set to disable V8 incremental marking as a workaround.');\n log.warn('napajs binding', 'We are working with Node.js team on a fix in newer Node versions.');\n\n require('v8').setFlagsFromString('--noincremental-marking');\n } else if (process.version < 'v4.5') {\n var errorMessage = 'Napa.js is not supported on Node version lower than v4.5';\n require('npmlog').error('napajs binding', errorMessage);\n throw new Error(errorMessage);\n }\n}", "title": "" }, { "docid": "8eb33bb8d1a0b473c67a3109118cd39d", "score": "0.48495322", "text": "function deprecate(fn,msg){// Allow for deprecating things in the process of starting up.\nif(isUndefined(global$1.process)){return function(){return deprecate(fn,msg).apply(this,arguments);};}var warned=false;function deprecated(){if(!warned){{console.error(msg);}warned=true;}return fn.apply(this,arguments);}return deprecated;}", "title": "" }, { "docid": "b2eb063a0122fcea81846e25cba89b77", "score": "0.48364002", "text": "patcherConstructorForNode(node: Node): ?Class<NodePatcher> { // eslint-disable-line no-unused-vars\n return null;\n }", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48342466", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48342466", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48342466", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48342466", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48342466", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48342466", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48342466", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48342466", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48342466", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48342466", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48342466", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48342466", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48342466", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48342466", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48342466", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48342466", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48342466", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48342466", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48342466", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48342466", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.48342466", "text": "function r(){}", "title": "" }, { "docid": "f6c0b339570adf1d7bd60bfda657b125", "score": "0.48252276", "text": "function initFunction(node, isAsync) {\n node.id = null;\n node.params = [];\n if (options.ecmaVersion >= 6) {\n node.defaults = [];\n node.rest = null;\n node.generator = false;\n }\n if (options.ecmaVersion >= 7) {\n node.async = isAsync;\n }\n }", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.48001215", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.48001215", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.48001215", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.48001215", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.48001215", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.48001215", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.48001215", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.48001215", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "4540d71adab18ca1f54167347e771b66", "score": "0.4790043", "text": "static async version() {\n // not implemented\n return -1\n }", "title": "" }, { "docid": "8b263eb9ce3fdf23d991ac5a1eadd238", "score": "0.47742835", "text": "if (e.errno !== 19) {\n throw e;\n }", "title": "" }, { "docid": "8b263eb9ce3fdf23d991ac5a1eadd238", "score": "0.47742835", "text": "if (e.errno !== 19) {\n throw e;\n }", "title": "" }, { "docid": "4662ffdb51de066e6a7c2b9520c7ea6e", "score": "0.4770289", "text": "function getBasicNodeMethods() {\n\t return [\n\t 'get',\n\t 'post',\n\t 'put',\n\t 'head',\n\t 'delete',\n\t 'options',\n\t 'trace',\n\t 'copy',\n\t 'lock',\n\t 'mkcol',\n\t 'move',\n\t 'purge',\n\t 'propfind',\n\t 'proppatch',\n\t 'unlock',\n\t 'report',\n\t 'mkactivity',\n\t 'checkout',\n\t 'merge',\n\t 'm-search',\n\t 'notify',\n\t 'subscribe',\n\t 'unsubscribe',\n\t 'patch',\n\t 'search',\n\t 'connect'\n\t ];\n\t}", "title": "" }, { "docid": "4662ffdb51de066e6a7c2b9520c7ea6e", "score": "0.4770289", "text": "function getBasicNodeMethods() {\n\t return [\n\t 'get',\n\t 'post',\n\t 'put',\n\t 'head',\n\t 'delete',\n\t 'options',\n\t 'trace',\n\t 'copy',\n\t 'lock',\n\t 'mkcol',\n\t 'move',\n\t 'purge',\n\t 'propfind',\n\t 'proppatch',\n\t 'unlock',\n\t 'report',\n\t 'mkactivity',\n\t 'checkout',\n\t 'merge',\n\t 'm-search',\n\t 'notify',\n\t 'subscribe',\n\t 'unsubscribe',\n\t 'patch',\n\t 'search',\n\t 'connect'\n\t ];\n\t}", "title": "" }, { "docid": "4662ffdb51de066e6a7c2b9520c7ea6e", "score": "0.4770289", "text": "function getBasicNodeMethods() {\n\t return [\n\t 'get',\n\t 'post',\n\t 'put',\n\t 'head',\n\t 'delete',\n\t 'options',\n\t 'trace',\n\t 'copy',\n\t 'lock',\n\t 'mkcol',\n\t 'move',\n\t 'purge',\n\t 'propfind',\n\t 'proppatch',\n\t 'unlock',\n\t 'report',\n\t 'mkactivity',\n\t 'checkout',\n\t 'merge',\n\t 'm-search',\n\t 'notify',\n\t 'subscribe',\n\t 'unsubscribe',\n\t 'patch',\n\t 'search',\n\t 'connect'\n\t ];\n\t}", "title": "" }, { "docid": "5ca9e7d2186546cabccc8ddbf33fcf7b", "score": "0.47672993", "text": "function isNode() {\n return (\n typeof process === 'object' &&\n typeof process.versions === 'object' &&\n typeof process.versions.node !== 'undefined' &&\n process.type !== 'renderer');\n}", "title": "" }, { "docid": "c4d1468bae3268f9f3eeecdb7221cf79", "score": "0.47642508", "text": "function getBasicNodeMethods() {\n return [\n 'get',\n 'post',\n 'put',\n 'head',\n 'delete',\n 'options',\n 'trace',\n 'copy',\n 'lock',\n 'mkcol',\n 'move',\n 'purge',\n 'propfind',\n 'proppatch',\n 'unlock',\n 'report',\n 'mkactivity',\n 'checkout',\n 'merge',\n 'm-search',\n 'notify',\n 'subscribe',\n 'unsubscribe',\n 'patch',\n 'search',\n 'connect'\n ];\n}", "title": "" }, { "docid": "c4d1468bae3268f9f3eeecdb7221cf79", "score": "0.47642508", "text": "function getBasicNodeMethods() {\n return [\n 'get',\n 'post',\n 'put',\n 'head',\n 'delete',\n 'options',\n 'trace',\n 'copy',\n 'lock',\n 'mkcol',\n 'move',\n 'purge',\n 'propfind',\n 'proppatch',\n 'unlock',\n 'report',\n 'mkactivity',\n 'checkout',\n 'merge',\n 'm-search',\n 'notify',\n 'subscribe',\n 'unsubscribe',\n 'patch',\n 'search',\n 'connect'\n ];\n}", "title": "" }, { "docid": "c4d1468bae3268f9f3eeecdb7221cf79", "score": "0.47642508", "text": "function getBasicNodeMethods() {\n return [\n 'get',\n 'post',\n 'put',\n 'head',\n 'delete',\n 'options',\n 'trace',\n 'copy',\n 'lock',\n 'mkcol',\n 'move',\n 'purge',\n 'propfind',\n 'proppatch',\n 'unlock',\n 'report',\n 'mkactivity',\n 'checkout',\n 'merge',\n 'm-search',\n 'notify',\n 'subscribe',\n 'unsubscribe',\n 'patch',\n 'search',\n 'connect'\n ];\n}", "title": "" }, { "docid": "c4d1468bae3268f9f3eeecdb7221cf79", "score": "0.47642508", "text": "function getBasicNodeMethods() {\n return [\n 'get',\n 'post',\n 'put',\n 'head',\n 'delete',\n 'options',\n 'trace',\n 'copy',\n 'lock',\n 'mkcol',\n 'move',\n 'purge',\n 'propfind',\n 'proppatch',\n 'unlock',\n 'report',\n 'mkactivity',\n 'checkout',\n 'merge',\n 'm-search',\n 'notify',\n 'subscribe',\n 'unsubscribe',\n 'patch',\n 'search',\n 'connect'\n ];\n}", "title": "" }, { "docid": "c4d1468bae3268f9f3eeecdb7221cf79", "score": "0.47642508", "text": "function getBasicNodeMethods() {\n return [\n 'get',\n 'post',\n 'put',\n 'head',\n 'delete',\n 'options',\n 'trace',\n 'copy',\n 'lock',\n 'mkcol',\n 'move',\n 'purge',\n 'propfind',\n 'proppatch',\n 'unlock',\n 'report',\n 'mkactivity',\n 'checkout',\n 'merge',\n 'm-search',\n 'notify',\n 'subscribe',\n 'unsubscribe',\n 'patch',\n 'search',\n 'connect'\n ];\n}", "title": "" }, { "docid": "c4d1468bae3268f9f3eeecdb7221cf79", "score": "0.47642508", "text": "function getBasicNodeMethods() {\n return [\n 'get',\n 'post',\n 'put',\n 'head',\n 'delete',\n 'options',\n 'trace',\n 'copy',\n 'lock',\n 'mkcol',\n 'move',\n 'purge',\n 'propfind',\n 'proppatch',\n 'unlock',\n 'report',\n 'mkactivity',\n 'checkout',\n 'merge',\n 'm-search',\n 'notify',\n 'subscribe',\n 'unsubscribe',\n 'patch',\n 'search',\n 'connect'\n ];\n}", "title": "" }, { "docid": "c4d1468bae3268f9f3eeecdb7221cf79", "score": "0.47642508", "text": "function getBasicNodeMethods() {\n return [\n 'get',\n 'post',\n 'put',\n 'head',\n 'delete',\n 'options',\n 'trace',\n 'copy',\n 'lock',\n 'mkcol',\n 'move',\n 'purge',\n 'propfind',\n 'proppatch',\n 'unlock',\n 'report',\n 'mkactivity',\n 'checkout',\n 'merge',\n 'm-search',\n 'notify',\n 'subscribe',\n 'unsubscribe',\n 'patch',\n 'search',\n 'connect'\n ];\n}", "title": "" }, { "docid": "c4d1468bae3268f9f3eeecdb7221cf79", "score": "0.47642508", "text": "function getBasicNodeMethods() {\n return [\n 'get',\n 'post',\n 'put',\n 'head',\n 'delete',\n 'options',\n 'trace',\n 'copy',\n 'lock',\n 'mkcol',\n 'move',\n 'purge',\n 'propfind',\n 'proppatch',\n 'unlock',\n 'report',\n 'mkactivity',\n 'checkout',\n 'merge',\n 'm-search',\n 'notify',\n 'subscribe',\n 'unsubscribe',\n 'patch',\n 'search',\n 'connect'\n ];\n}", "title": "" }, { "docid": "c4d1468bae3268f9f3eeecdb7221cf79", "score": "0.47642508", "text": "function getBasicNodeMethods() {\n return [\n 'get',\n 'post',\n 'put',\n 'head',\n 'delete',\n 'options',\n 'trace',\n 'copy',\n 'lock',\n 'mkcol',\n 'move',\n 'purge',\n 'propfind',\n 'proppatch',\n 'unlock',\n 'report',\n 'mkactivity',\n 'checkout',\n 'merge',\n 'm-search',\n 'notify',\n 'subscribe',\n 'unsubscribe',\n 'patch',\n 'search',\n 'connect'\n ];\n}", "title": "" }, { "docid": "c4d1468bae3268f9f3eeecdb7221cf79", "score": "0.47642508", "text": "function getBasicNodeMethods() {\n return [\n 'get',\n 'post',\n 'put',\n 'head',\n 'delete',\n 'options',\n 'trace',\n 'copy',\n 'lock',\n 'mkcol',\n 'move',\n 'purge',\n 'propfind',\n 'proppatch',\n 'unlock',\n 'report',\n 'mkactivity',\n 'checkout',\n 'merge',\n 'm-search',\n 'notify',\n 'subscribe',\n 'unsubscribe',\n 'patch',\n 'search',\n 'connect'\n ];\n}", "title": "" }, { "docid": "c4d1468bae3268f9f3eeecdb7221cf79", "score": "0.47642508", "text": "function getBasicNodeMethods() {\n return [\n 'get',\n 'post',\n 'put',\n 'head',\n 'delete',\n 'options',\n 'trace',\n 'copy',\n 'lock',\n 'mkcol',\n 'move',\n 'purge',\n 'propfind',\n 'proppatch',\n 'unlock',\n 'report',\n 'mkactivity',\n 'checkout',\n 'merge',\n 'm-search',\n 'notify',\n 'subscribe',\n 'unsubscribe',\n 'patch',\n 'search',\n 'connect'\n ];\n}", "title": "" }, { "docid": "c4d1468bae3268f9f3eeecdb7221cf79", "score": "0.47642508", "text": "function getBasicNodeMethods() {\n return [\n 'get',\n 'post',\n 'put',\n 'head',\n 'delete',\n 'options',\n 'trace',\n 'copy',\n 'lock',\n 'mkcol',\n 'move',\n 'purge',\n 'propfind',\n 'proppatch',\n 'unlock',\n 'report',\n 'mkactivity',\n 'checkout',\n 'merge',\n 'm-search',\n 'notify',\n 'subscribe',\n 'unsubscribe',\n 'patch',\n 'search',\n 'connect'\n ];\n}", "title": "" } ]
8afef9fb9f02efcd69d7ce49055e9dc5
Get all blank coordinates from board
[ { "docid": "8d5011f7cf98931c99110239adbb2a30", "score": "0.84945273", "text": "getBlankCoordinates(board) {\n const blankCoordinates = [];\n \n for (let r = 0; r < board.length; r++) {\n for (let c = 0; c < board[r].length; c++) {\n if (board[r][c] === 0) {blankCoordinates.push([r, c])}\n }\n }\n \n return blankCoordinates;\n }", "title": "" } ]
[ { "docid": "dd942c10a10bbbb9e0b4c48f0330f636", "score": "0.7752392", "text": "function getEmptyPlaces(board) {\r\n var emptyPlaces = []\r\n\r\n for (var i = 0; i < board.length; i++) {\r\n for (var j = 0; j < board[i].length; j++) {\r\n var cell = board[i][j]\r\n if (!cell.isShown && !cell.isMine && !cell.isMarked) {\r\n if (gStartLoc.i !== i && gStartLoc.j !== j) {\r\n emptyPlaces.push({ i, j })\r\n }\r\n }\r\n }//END FOR\r\n }//END FOR\r\n return emptyPlaces\r\n}", "title": "" }, { "docid": "abae64305539dc5fc10d5f9bd44b7010", "score": "0.76262194", "text": "emptyCells() {\n const result = [];\n for (let i = 0; i < 4; i++) {\n for (let j = 0; j < 4; j++) {\n if (this.boardState[i][j].val === null) {\n result.push([i,j]);\n }\n }\n }\n return result;\n }", "title": "" }, { "docid": "06723d42e3b6e790825bfa4b16a08bb1", "score": "0.75585616", "text": "getEmptyCells() {\n return this.board.map((row, rowInd) => {\n return row.map((cell, cellInd) => {\n if (cell === 0) {\n return [rowInd, cellInd];\n }\n });\n }).reduce((a, b) => {\n return a.concat(b);\n }).filter((cell) => {\n return typeof cell !== 'undefined';\n });\n }", "title": "" }, { "docid": "bae9c0804a934a65cbc7f8d6d92de7d2", "score": "0.724582", "text": "function getemptyCells(state) {\n\tvar cells = [];\n\tfor (var x = 0; x < 4; x++) {\n\t\tfor (var y = 0; y < 4; y++) {\n\t\t\tif (state[x][y] == 0)\n\t\t\t\tcells.push([x, y]);\n\t\t}\n\t}\n\n\treturn cells;\n}", "title": "" }, { "docid": "c304192e8fc6f58b622d49987c09e47c", "score": "0.7184048", "text": "function getemptyCells(state) {\n\tvar cells = [];\n\tfor (var x = 0; x < 3; x++) {\n\t\tfor (var y = 0; y < 3; y++) {\n\t\t\tif (state[x][y] == 0)\n\t\t\t\tcells.push([x, y]);\n\t\t}\n\t}\n\n\treturn cells;\n}", "title": "" }, { "docid": "f6208868c2d635019e8afefc0a4a005a", "score": "0.71791553", "text": "function emptyCells(board) {\n return board.filter(element => typeof element === 'number');\n}", "title": "" }, { "docid": "a0bc7d83e095fbb51dcd6a32a7eeece9", "score": "0.7129864", "text": "function findBlankNeighbors(board, blank) {\n let neighbors = [];\n //Above\n if (blank[0] !== 0) {\n let coords = [blank[0] - 1, blank[1]];\n neighbors.push(coords);\n }\n //Left\n if (blank[1] !== 0) {\n let coords = [blank[0], blank[1] -1];\n neighbors.push(coords);\n }\n //Right\n if (blank[1] !== board.length -1) {\n let coords = [blank[0], blank[1] + 1];\n neighbors.push(coords);\n }\n //Below\n if (blank[0] !== board.length - 1) {\n let coords = [blank[0] + 1, blank[1]];\n neighbors.push(coords);\n }\n return neighbors;\n}", "title": "" }, { "docid": "b059b1de74c6591433422be430283c07", "score": "0.6963525", "text": "getEmptyBoard() {\n return Array.from(\n {length: ROWS}, () => Array(COLS).fill(0)\n );\n }", "title": "" }, { "docid": "6649587450bef4416eb98c2e76474de1", "score": "0.6959863", "text": "function emptyCells(state) {\n var cells = [];\n for (var x = 0; x < 3; x++) {\n for (var y = 0; y < 3; y++) {\n if (state[x][y] == 0)\n cells.push([x, y]);\n }\n }\n\n return cells;\n}", "title": "" }, { "docid": "b57d227bfa5fbe5a5cecdf54f57ef1db", "score": "0.6948589", "text": "function checkCells(board) {\n const arrayCells = [true]\n\n board.forEach(a => a.forEach(function(b) {\n if (b !== null && b !== 'x' && b !== 'o') { arrayCells[0] = false }\n\n }));\n return arrayCells[0];\n}", "title": "" }, { "docid": "11078640f82dc34cfc2c1b118d038c96", "score": "0.6945089", "text": "function emptySpots() {\n return originalBoard.filter(s => typeof s == 'number');\n}", "title": "" }, { "docid": "f7a9b85eb13e840b69c8733b38b8ae27", "score": "0.6939724", "text": "function getEmptyVals(board) {\n\tvar empties = [];\n\tfor (var i = 1; i < board.length - 1; i++) {\n\t\tfor (var j = 1; j < board[0].length - 1; j++) {\n\t\t\tif (board[i][j].gameElement === null) empties.push({ i: i, j: j });\n\t\t}\n\t}\n\tempties.push({ i: 0, j: 5 }, { i: 9, j: 5 }, { i: 5, j: 0 }, { i: 5, j: 11 })\n\treturn empties;\n}", "title": "" }, { "docid": "b72c23824db9dcd435712a8818eb1175", "score": "0.69354945", "text": "function getBlankPuzzle(schema) {\n var row;\n var col;\n for(var i = 0; i < 4; i++){\n col = schema[i].indexOf(16);\n row = i;\n if(col != -1){\n break;\n }\n }\n return [row,col];\n}", "title": "" }, { "docid": "d1326033ea913d32f400cd47a0257789", "score": "0.687706", "text": "function emptyIndexies(board) {\n return board.filter(s => s != \"O\" && s != \"X\");\n}", "title": "" }, { "docid": "9544938975c03ecff54282be8d55a276", "score": "0.68390924", "text": "function emptySquares(){\n\t//returning all empty squares\n\treturn board.filter(x => typeof x == 'number');\n}", "title": "" }, { "docid": "c0ec176325bad32d28d28811d408d791", "score": "0.68128073", "text": "function emptyIndexies(board){\n return board.filter(s => s != \"O\" && s != \"X\");\n}", "title": "" }, { "docid": "5de779909d9a5a0dd4642207d04a013e", "score": "0.6798447", "text": "function findEmptySquare(board) {\n for (let i = 0; i < 9; i++) {\n for (let j = 0; j < 9; j++) {\n if (board[i][j] == 0) {\n return [i, j];\n }\n }\n }\n}", "title": "" }, { "docid": "2852b5ac8e5c86a072fcf07104d6f43e", "score": "0.67761207", "text": "emptyList() {\n let list = [];\n\n for (let i = 0; i < 3; i++) {\n for (let j = 0; j < 3; j++) {\n if (this.board[i][j] === 0) {\n list.push([i, j]);\n }\n }\n }\n\n return list\n }", "title": "" }, { "docid": "ddf4ca6c6bf4931e467c2e9593184094", "score": "0.67112845", "text": "emptyIndexies(board){\n return board.filter(s => s !== \"O\" && s !== \"X\");\n }", "title": "" }, { "docid": "95fc6bb334bb8778cd8e6028c81bff3d", "score": "0.6688837", "text": "function emptyCells() {\n var emptyCells = [];\n var emptyCell = {}\n for (var i = 0; i < gBoard.length; i++) {\n for (var j = 0; j < gBoard[i].length; j++) {\n if (gBoard[i][j] === EMPTY) {\n emptyCell.i = i\n emptyCell.j = j\n emptyCells.push(emptyCell)\n }\n }\n }\n return emptyCells\n}", "title": "" }, { "docid": "6245e16cae119c9e2dba3916ee98bf43", "score": "0.66486686", "text": "function findEmptyCells() {\r\n var emptyCells = [];\r\n for (var i = 0; i < horizontalCellsCount; i++) {\r\n for (var j = 0; j < verticalCellsCount; j++) {\r\n if (map[i][j] == blankSymbol) {\r\n var emptyCell = new Cell(i, j);\r\n emptyCells.push(emptyCell);\r\n }\r\n }\r\n }\r\n return emptyCells;\r\n }", "title": "" }, { "docid": "e5f98a965407577fcc62b72f67c83e56", "score": "0.6647404", "text": "buildCandidateCells(board, width, height) {\n let cells = []\n\n for (var j = 1; j < height - 1; j++) {\n for (var i = 1; i < width - 1; i++) {\n let index = j * width + i\n if (board[index] == 0) {\n if (Helper.checkAdjacent(board, width, height, i, j, this.id)) {\n cells.push({x: i, y: j, index: index})\n }\n }\n }\n }\n\n return cells\n }", "title": "" }, { "docid": "2ef276ee5c8ecdd42324f4e9893cd3b6", "score": "0.66470987", "text": "function findRandomEmptyCell(board) {\n\tvar i = Math.floor(Math.random() * (BOARD_HEIGHT-1)+1);\n\tvar j = Math.floor(Math.random() * (BOARD_WIDTH-1)+1);\n\twhile (board[i][j] != 0) { // add ghostboard[i][j] != 0 when finish\n\t\ti = Math.floor(Math.random() * (BOARD_HEIGHT-1)+1);\n\t\tj = Math.floor(Math.random() * (BOARD_WIDTH-1)+1);\n\t}\n\treturn [i, j];\n}", "title": "" }, { "docid": "acc2b096edb692996b9039e0f9aaa376", "score": "0.66191703", "text": "function getNeighbors() {\n var up = \"peice_\" + empty_x + \"_\" + (empty_y - 1);\n var down = \"peice_\" + empty_x + \"_\" + (empty_y + 1);\n var left = \"peice_\" + (empty_x - 1) + \"_\" + empty_y;\n var right = \"peice_\" + (empty_x + 1) + \"_\" + empty_y;\n\n var peice = [up, down, left, right];\n var realpeice = [];\n\n for (var i = 0; i < peice.length; i++) {\n if (document.getElementById(peice[i]) != null) {\n realpeice.push(peice[i]);\n }\n }\n return realpeice;\n }", "title": "" }, { "docid": "d72811a2716aa0be7c03982dcc4d8f2d", "score": "0.66126966", "text": "getLegalMoves()\r\n {\r\n if (this.outcome != ONGOING)\r\n return null;\r\n\r\n var movesList = new Array();\r\n \r\n for (let c = 0; c < this.#cols; c++)\r\n {\r\n if (this.board[this.#rows - 1][c] === EMPTY)\r\n {\r\n movesList.push(c);\r\n }\r\n }\r\n\r\n return movesList;\r\n }", "title": "" }, { "docid": "a40456cb0604d54c8c6bdf27701c1087", "score": "0.6591279", "text": "function getEmptySpaces () {\n let toReturn = [];\n for( let i = 0; i < GRID_SIZE; i++){\n for( let j = 0; j < GRID_SIZE; j++){\n if(table[i][j].value == null){\n toReturn.push(table[i][j]);\n }\n }\n }\n return toReturn;\n}", "title": "" }, { "docid": "cb99c8f3f25d58a06d0fdcd32820de15", "score": "0.65393126", "text": "function emptyIndexies(board){\n let arr = []\n board.forEach(function callback(val, index) {\n if(val == null) arr.push(index)\n })\n return arr\n}", "title": "" }, { "docid": "ca92509cc9c9b4c7b1bd9c4cba739b41", "score": "0.65301776", "text": "isEmptyAt(coords) {\n return this.board[coords[0]][coords[1]] === 0;\n }", "title": "" }, { "docid": "0fb8952a5bf8c329e34921224e89ce5d", "score": "0.652516", "text": "getEmptySquares(grid) {\n let empties = [];\n for (let i = 0; i < grid.length; i++) {\n if (grid[i] === 0) {\n empties.push(i);\n }\n }\n return empties;\n }", "title": "" }, { "docid": "194ba3d6b3fbbc1525ec19222c20a240", "score": "0.6520714", "text": "getNeighbors(cell) {\n let neighboringPositions = [\n new Position(cell.position.x - 1, cell.position.y - 1),\n new Position(cell.position.x, cell.position.y - 1),\n new Position(cell.position.x + 1, cell.position.y - 1),\n new Position(cell.position.x - 1, cell.position.y),\n new Position(cell.position.x + 1, cell.position.y),\n new Position(cell.position.x - 1, cell.position.y + 1),\n new Position(cell.position.x, cell.position.y + 1),\n new Position(cell.position.x + 1, cell.position.y + 1)\n ]\n\n return neighboringPositions\n .map((position) => this.getCell(position))\n .filter((optionalCell) => optionalCell.isDefined())\n .map((optionalCell) => optionalCell.get())\n }", "title": "" }, { "docid": "64dbd8002c75515e797612bf90220a99", "score": "0.648889", "text": "function findEmptySquares() {\n const snakePositions = snake.tail;\n const squares = Array.from(gameBoard.children);\n let emptySquares = squares.filter(square => !snakePositions.includes(Number(square.id))).map(square => square.id);\n return emptySquares;\n}", "title": "" }, { "docid": "85c168d4316b5a0e05bfc2ea18cc063b", "score": "0.6463083", "text": "function emptySpaces(board){\n return board.filter(function(val){return val != \"X\" && val != \"O\";});\n}", "title": "" }, { "docid": "db9e621f2722130202e3bdc0ae10a120", "score": "0.6447451", "text": "getRidOfUnecessaryWalls() {\n for(let x = 0; x < this.width; x++) {\n for(let y = 0; y < this.height; y++) {\n if(!this.isAdjacentToGround(x, y)) {\n let tile = this.map[x][y];\n tile.class = \"tile-null\";\n }\n }\n }\n }", "title": "" }, { "docid": "07aec314685703e101ed565b403cd4f4", "score": "0.6439471", "text": "function getMoves(board) {\n var moves = [];\n for(var x = 0; x < 7; x++){\n var y = 0;\n while(y <= 5 && board[y][x] == \" \") {\n y++;\n }\n \n //Don't push a move if the column is filled up\n if (y != 0) \n moves.push([y - 1, x]);\n }\n return moves;\n}", "title": "" }, { "docid": "be32386de7dddd0a8fa1499a41c049fc", "score": "0.6415585", "text": "function emptySquares() {\n\treturn origBoard.filter(s => typeof s == 'number'); //filter all elements on the board to see if it is a number, if it is then return it.\n}", "title": "" }, { "docid": "46d09f1a7ddd9809a77a52363d6b7d72", "score": "0.6412738", "text": "function getArray() {\n for (var i = 0; i < 9; i++)\n for (var j = 0; j < 9; j++) {\n if (a[i][j] === '') {\n res.push({x: i, y: j});\n }\n }\n}", "title": "" }, { "docid": "109e3dae660e81e08f4d3da8c9a1b863", "score": "0.6400996", "text": "function emptySquares() {\n return initBoard.filter((s) => typeof s == \"number\");\n}", "title": "" }, { "docid": "7b3aa1d8960e5b7514f47b80a0c954bc", "score": "0.6400506", "text": "function getAllEmptyCellsIndexes(currBdSt) {\n return currBdSt.filter(i => i != \"O\" && i != \"X\");\n}", "title": "" }, { "docid": "8f360a6bc55fe599e79c93540f1f4301", "score": "0.63946444", "text": "findEmpty(grid) {\n /**er word gekeken of integer 0 kleiner is dan de grid length zo ja word het met incrementeel verhoogt*/\n for (let i = 0; i < grid.length; i++) {\n for (let j = 0; j < grid[i].length; j++) {\n /**er word hier gekeken of de grid position empty is zo ja word er een nummer in geplaats */\n if (grid[i][j] === 0) return { i, j };\n }\n }\n return false;\n }", "title": "" }, { "docid": "f99e8a0dace93b50151f41f3419d7202", "score": "0.63879204", "text": "makeEmptyBoard() {\n let board = [];\n\n // Outer loop goes through the rows\n for (let y = 0; y < this.rows; y++) {\n // Set each row to an empty array\n board[y] = [];\n\n // Inner loop goes through the columns\n for (let x = 0; x < this.cols; x++) {\n // This makes all the cells start off as \"dead\"\n board[y][x] = false;\n }\n }\n\n return board;\n }", "title": "" }, { "docid": "4b3b953fcc983c508dc514d1980683db", "score": "0.638585", "text": "getChildMoves() {\n const moves = [];\n for (let i = 0; i < BOARD_SIZE; i++)\n for (let j = 0; j < BOARD_SIZE; j++)\n if (this.state[i][j] === Players.BLANK) moves.push([i, j]);\n\n return moves;\n }", "title": "" }, { "docid": "595f6e7cd8bb430970f24c8a3320b619", "score": "0.6376124", "text": "function findPossibilities() {\r\n\t\tlet allPieces = document.querySelectorAll(\".puzzleTile\");\r\n\t\tlet valid = [];\r\n\t\tfor(let i = 0; i < allPieces.length; i++){\r\n\t\t\tif(emptyNeighbor(allPieces[i])) {\r\n\t\t\t\tvalid.push(allPieces[i]);\r\n\t\t\t}\r\n\t\t} \r\n\t\treturn valid;\r\n\t}", "title": "" }, { "docid": "74cbc5a75cd5b409f323a46f6cc9820a", "score": "0.63520604", "text": "function findEmptyCells(board) {\n let emptyCells = []\n let possibleNumbers = []\n for (let i = 0; i < board.length; i++) {\n for (let j = 0; j < board[i].length; j++) {\n if (board[i][j] == 0) {\n let totalSolutions = 0\n let invalidNumbers = []\n for (let m = 1; m <= 9; m++) {\n const isRowValid = validateRows(m, board, [i, j])\n const isColumnValid = validateColumn(m, board, [i, j])\n const isCubeValid = validateCube(m, board, [i, j])\n if (isRowValid && isColumnValid && isCubeValid) {\n totalSolutions++\n } else {\n invalidNumbers.push(m)\n }\n }\n possibleNumbers.push([totalSolutions, [i, j], invalidNumbers])\n }\n }\n }\n for (let i = 1; i <= 9; i++) {\n possibleNumbers.forEach(item => {\n if (item[0] == i) {\n emptyCells.push([item[1], item[2]])\n }\n })\n }\n return emptyCells\n}", "title": "" }, { "docid": "bbda65c261c40d19e223d92494d92489", "score": "0.63394773", "text": "function emptyCells(state){\n var cells = [];\n for (var i = 1; i<=9; i++){\n if(state[i] == 0)\n cells.push(i);\n }\n return cells;\n}", "title": "" }, { "docid": "08068a6108d1192e0bcb3557522dcc4c", "score": "0.6338003", "text": "getAvailableMoves(board) {\n var possibleMoves = new Array();\n for (let i = 0; i < this.boardArray.length; i++) {\n if (this.boardArray[i].occupiedBy === NOBODY)\n possibleMoves.push(i);\n }\n return possibleMoves;\n }", "title": "" }, { "docid": "9e54915dce688ce36e52a2e9eb6c7d71", "score": "0.6329953", "text": "function mandatoryCapture(board, playerTurn) {\n var moves = [];\n\n for (var i = 0; i < board.length; i++) {\n var temp_board = board[i];\n\n for (var j = 0; j < board.length; j++) {\n var piece = board[i][j];\n if (piece == playerTurn) {\n var temp = [];\n if (i + 2 < 8 && j + 2 < 8) {\n var xAxis = i + 1;\n var yAxis = j + 1;\n if (board[xAxis][yAxis] != playerTurn && board[xAxis][yAxis] != 0) {\n if (board[xAxis + 1][yAxis + 1] == 0) { // this is assuming the empty spaces are integers like 0\n temp.push(xAxis + 1);\n temp.push(yAxis + 1);\n moves.push(temp);\n }\n }\n }\n }\n else if( piece == 3){\n var temp = [];\n if (i + 2 < 8 && j + 2 < 8) {\n var xAxis = i + 1;\n var yAxis = j + 1;\n if (board[xAxis][yAxis] != playerTurn && board[xAxis][yAxis] != 0) {\n if (board[xAxis + 1][yAxis + 1] == 0) { // this is assuming the empty spaces are integers like 0\n temp.push(xAxis + 1);\n temp.push(yAxis + 1);\n moves.push(temp);\n }\n }\n }\n }\n\n }\n }\n return moves;\n }", "title": "" }, { "docid": "844c226d901e6b71f59330a70c4f6fb3", "score": "0.6307969", "text": "function getEmptyCoordinate() {\n if (snakeList.length > 0) {\n //GENERATE INITIAL LIST OF POSSIBLE COORDINATES\n let possibleCoords = [];\n for (let i = 0; i < gridSize; i++) {\n for (let j = 0; j < gridSize; j++) {\n possibleCoords.push(new Coordinate(i, j))\n }\n }\n \n //FOR EACH SNAKE IN SNAKELIST\n snakeList.forEach(s => {\n //FOR EACH POSITION IN SNAKE\n s.position.forEach(c => {\n //COMPARE WITH EVERY VALUE IN POSSIBLE COORDINATES \n possibleCoords.forEach((pc, idx) => {\n //IF MATCHES, REMOVE FROM POSSIBLE COORDINDATES\n if (c.i == pc.i && c.j == pc.j) {\n possibleCoords.splice(idx, 1);\n }\n });\n });\n });\n\n let randIdx = Math.floor(Math.random()*possibleCoords.length);\n return possibleCoords[randIdx];\n } else {\n return new Coordinate(Math.floor(Math.random() * gridSize), Math.floor(Math.random() * gridSize));\n }\n}", "title": "" }, { "docid": "914e97309f8be17153504b92b517ef9e", "score": "0.629541", "text": "createEmptyBoard() {\n const board = [];\n const {rows, columns} = this.state;\n // iterate over the each row\n for (let y = 0; y < rows; y++) {\n board[y] = [];\n // iterate over each tile in given column\n for (let x = 0; x < columns; x++) {\n // set tile to false \n board[y][x] = false;\n }\n }\n return board;\n }", "title": "" }, { "docid": "c6ad08859dcab5eecfac172fbb0cda80", "score": "0.62818193", "text": "getPossilbeLifeCells() {\n const livingCells = this.getAliveCells();\n\n return _.chain(livingCells)\n .map(([x,y]) => this.getNeighbors(x,y))\n .flatten()\n .concat(livingCells)\n .uniqWith(_.isEqual)\n .value();\n }", "title": "" }, { "docid": "22c6d4e182a937212bbb22ca9862f75b", "score": "0.626472", "text": "function getLocations(board, coordI, coordJ) {\r\n var locations = []\r\n for (var i = 0; i < board.length; i++) {\r\n for (var j = 0; j < board[0].length; j++)\r\n if (i === coordI && j === coordJ) continue;\r\n else locations.push({ i, j });\r\n }\r\n return locations;\r\n}", "title": "" }, { "docid": "07ee1d6c967f6436c7d36ac3d538c947", "score": "0.6250899", "text": "function check2Full(board) {\n var indexy;\n var indexx;\n var whereFree = [];\n var check = \"123,147,159,258,369,357,456,789\";\n check = check.split(\",\");\n var countO;\n var countX;\n var k = 0;\n var flag;\n for (var i = 0; i < board.length - 1; ++i) {\n countX = 0;\n countO = 0;\n flag = 0\n for (var j = 0; j < 3; ++j) {\n if (board[check[i][j] - 1] == \"X\") {\n countX++;\n } else if (board[check[i][j] - 1] == \"0\") {\n flag = 1;\n indexx = check[i][j] - 1;\n }\n }\n if (countX == 2 && flag) {\n whereFree[k++] = indexx;\n }\n }\n return whereFree;\n }", "title": "" }, { "docid": "9f89e3b2133a4f18ff2a8508ee6e7d97", "score": "0.6249512", "text": "function setBoard() {\r\n boardParts = new Array(tileCount);\r\n for (var i = 0; i < tileCount; ++i) {\r\n boardParts[i] = new Array(tileCount);\r\n for (var j = 0; j < tileCount; ++j) {\r\n boardParts[i][j] = new Object;\r\n boardParts[i][j].x = (tileCount - 1) - i;\r\n boardParts[i][j].y = (tileCount - 1) - j;\r\n }\r\n }\r\n emptyLoc.x = boardParts[tileCount - 1][tileCount - 1].x;\r\n emptyLoc.y = boardParts[tileCount - 1][tileCount - 1].y;\r\n solved = false;\r\n}", "title": "" }, { "docid": "aff796e62e03392b0ca370befa47c940", "score": "0.6247745", "text": "function anyUnassigned(grid, rc) //why do I need row and col?\r\n{\r\n findMostNeighbors(grid,rc);\r\n for (var r = 0; r < grid.length; r++){\r\n for (var c = 0; c < grid.length; c++){\r\n if (grid[r][c] == '_') {\r\n rc[0] = r;\r\n rc[1] = c;\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "015027602462c80adbe592e413c55fa1", "score": "0.6246933", "text": "function getMineCells() {\n var mineCells = [];\n for (var i = 0; i < gBoard.length; i++) {\n for (var j = 0; j < gBoard[0].length; j++) {\n if (gBoard[i][j].isMine) {\n mineCells.push({ i: i, j: j });\n }\n }\n }\n return mineCells;\n}", "title": "" }, { "docid": "9861b68a00f33d3c013620bfdcabf45a", "score": "0.6236273", "text": "function hasBlankSlot(board) {\n let hasBlank = false;\n board.map(r => {\n r.map(c => {\n if (!c) hasBlank = true;\n });\n });\n return hasBlank;\n}", "title": "" }, { "docid": "dc0af3fd85f8d95ff0e13b72b110d9e2", "score": "0.62359923", "text": "get emptyRandomPosition() {\n if (this._game._board.isFull) {\n throw \"Cannot find a move because the board is full.\";\n }\n let position = this.randomPosition;\n while (!this._game._board.isEmptyAt(position.row, position.column)) {\n position = this.randomPosition;\n }\n return position;\n }", "title": "" }, { "docid": "e56dabc71fb46f6bc12bef7e3aa8e868", "score": "0.62233824", "text": "function allCellsAroundCellActualWithNoWalls(cellActual) {\n\n let result = [];\n for (let i = 0; i<cellActual.walls.length; i++) {\n if (!cellActual.walls[i]) {\n switch (i) {\n case 0 : result.push(getCaseByCoordinate(cellActual.posX-1, cellActual.posY));//haut\n break;\n case 1 : result.push(getCaseByCoordinate(cellActual.posX, cellActual.posY+1));//droite\n break;\n case 2 : result.push(getCaseByCoordinate(cellActual.posX+1, cellActual.posY));//bas\n break;\n case 3 : result.push(getCaseByCoordinate(cellActual.posX, cellActual.posY-1));//gauche\n }\n }\n }\n return result;\n}", "title": "" }, { "docid": "9c39a29c70a3bd684de894f033063e9f", "score": "0.6213008", "text": "getNeighbors(row, col) {\n let neighbors = [];\n for(let i = row - 1; i <= row + 1; i++) {\n for(let j = col - 1; j <= col + 1; j++) {\n if(i === row && j === col) continue;\n if(this.grid[i] && this.grid[i][j]) {\n neighbors.push(this.grid[i][j]);\n }\n }\n }\n\n return neighbors;\n }", "title": "" }, { "docid": "fa4273c272214b46eb1be8bdfe22541a", "score": "0.6197798", "text": "function get_coords(cell)\r\n{\r\n var row_num = Math.floor(cell / 30); // 22 Rows total\r\n var col_num = cell % 30; // 30 Columns total\r\n return [col_num, row_num];\r\n}", "title": "" }, { "docid": "e929b316efde754f4c4741f3a3589100", "score": "0.61931336", "text": "function filter() {\n for (let box of board) {\n filteredBoardIndexes = [...board\n .entries()]\n .filter(([_, boxValue]) => boxValue !== \"\")\n .map(([boxIndex]) => boxIndex);\n\n }\n}", "title": "" }, { "docid": "a372e9c310558249a566ad6b016ceade", "score": "0.6183464", "text": "validPawnPosition(id) {\n var string = \"player\" + this.player + id;\n var index = this.scene.game.returnPrologBoardAtom(string);\n\n for (let i = 0; i < this.scene.game.board.length; i++) {\n for (let j = 0; j < this.scene.game.board[i].length; j++) {\n if (this.scene.game.board[i][j] == index) {\n var z = i;\n var x = j;\n }\n }\n }\n\n return [z, x];\n }", "title": "" }, { "docid": "344f8f58f69d8c59518f36c0412eb884", "score": "0.6172658", "text": "function emptySquares() {\r\n var newKeys = [];\r\n for (var i = 0; i < 9; i++) {\r\n if (gameBoard.squares[i] === empty) {\r\n newKeys.push(i);\r\n }\r\n }\r\n return newKeys;\r\n }", "title": "" }, { "docid": "e092107fdeaf17500880f234ef4a1b72", "score": "0.61622375", "text": "function emptyPieces() {\n const pieces = document.querySelectorAll('#board .piece')\n if (pieces.length > 0) pieces.forEach(piece => piece.remove());\n makeBoard();\n}", "title": "" }, { "docid": "c9ce21de55dea1e918296018cd99a2a1", "score": "0.6136968", "text": "function findGridZeros(grid) {\n\tlet empties = [];\n\tfor (let r = 0; r < 9; r++) {\n\t\tfor (let c = 0; c < 9; c++) {\n\t\t\tif (grid[r][c] === 0) {\n\t\t\t\tempties.push(grid[r][c]);\n\t\t\t}\n\t\t}\n\t}\n\treturn empties;\n}", "title": "" }, { "docid": "7459023757e801911658bd60060389b9", "score": "0.6127374", "text": "getNeighbors() {\n let neighbors = [];\n\n let top = grid[index(this.i, this.j - 1)];\n let right = grid[index(this.i + 1, this.j)];\n let bottom = grid[index(this.i, this.j + 1)];\n let left = grid[index(this.i - 1, this.j)];\n\n if (top && !this.walls.Top) {\n neighbors.push(top);\n }\n if (right && !this.walls.Right) {\n neighbors.push(right);\n }\n if (bottom && !this.walls.Bottom) {\n neighbors.push(bottom);\n }\n if (left && !this.walls.Left) {\n neighbors.push(left);\n }\n\n return neighbors\n }", "title": "" }, { "docid": "03211fdc905e45d89067ea00fbb51f51", "score": "0.6095479", "text": "function board(){\n return [\n [ false, false, false ],\n [ false, false, false ],\n [ false, false, false ],\n ];\n}", "title": "" }, { "docid": "df46ab9c51f385a02e87e338eaf38fda", "score": "0.60931575", "text": "getNeighbors() {\n let neighbors = [], x = this.x, y = this.y;\n\n // Neighbor on top\n if (y > 0 && !grid[x][y - 1].walls.bottom) {\n neighbors.push(grid[x][y - 1]);\n }\n\n // Neighbor to the right\n if (x + 1 < cols && !grid[x + 1][y].walls.left) {\n neighbors.push(grid[x + 1][y]);\n }\n\n // Neighbor below\n if (y + 1 < rows && !grid[x][y + 1].walls.top) {\n neighbors.push(grid[x][y + 1]);\n }\n\n // Neighbor to the left\n if (x > 0 && !grid[x - 1][y].walls.right) {\n neighbors.push(grid[x - 1][y]);\n }\n return neighbors;\n }", "title": "" }, { "docid": "6bc236e28ebc290e9d612bf5bca1b403", "score": "0.60823774", "text": "function getExampleBoard() {\n return [['', 'X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O'],\n ['O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X'],\n ['X', 'X', 'O', 'X', 'X', 'O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O'],\n ['O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X'],\n ['X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O'],\n ['O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X'],\n ['X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O'],\n ['O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X'],\n ['X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O'],\n ['O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X'],\n ['X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O'],\n ['O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X'],\n ['X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O'],\n ['O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X'],\n ['X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O'],\n ['O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X'],\n ['X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O'],\n ['O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X'],\n ['X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O', 'O', 'X', 'X', 'X', 'X', 'X', 'O', 'O', 'O', 'O']];\n }", "title": "" }, { "docid": "d21f967f5d88d7e62b39c5601c2bb5b4", "score": "0.60752475", "text": "function getValidNeighbours(x, y, map) {\n const sizeY = map[0].length;\n const sizeX = map.length;\n const tiles = [];\n // N\n if (y > 0) {\n const conn = OW.CAN_CONNECT[map[x][y - 1]].N;\n tiles.push([map[x][y - 1], conn]);\n }\n // S\n if (y < sizeY - 1) {\n const conn = OW.CAN_CONNECT[map[x][y + 1]].S;\n tiles.push([map[x][y + 1], conn]);\n }\n // E\n if (x < sizeX - 1) {\n const conn = OW.CAN_CONNECT[map[x + 1][y]].E;\n tiles.push([map[x + 1][y], conn]);\n }\n // W\n if (x > 0) {\n const conn = OW.CAN_CONNECT[map[x - 1][y]].W;\n tiles.push([map[x - 1][y], conn]);\n }\n return tiles;\n}", "title": "" }, { "docid": "453633dd3ed38e997a8022d317fbd3f3", "score": "0.6071203", "text": "getNeighbors(row, col)\r\n {\r\n var empties = 0;\r\n var whites = 0;\r\n var blacks = 0;\r\n \r\n console.assert((col >= 0) && (row >= 0) && (col <= this.#cols) && (row <= this.#rows));\r\n\r\n for (let r = Math.max(row - 1,0); r <= Math.min(row + 1, this.#rows - 1); r++)\r\n {\r\n for (let c = Math.max(col - 1,0); c <= Math.min(col + 1, this.#cols - 1); c++)\r\n {\r\n if ((r == row) && (c == col))\r\n continue;\r\n\r\n switch(this.board[r][c])\r\n {\r\n case WHITE:\r\n whites++;\r\n break;\r\n case BLACK:\r\n blacks++;\r\n break;\r\n default:\r\n empties++;\r\n }\r\n }\r\n }\r\n return {whites, blacks, empties};\r\n }", "title": "" }, { "docid": "d0cacad635bab80b23c6d30f20972003", "score": "0.6068357", "text": "function get_neighbours(x,y){\n var neighbours=[];\n var index=((y-1)*no_columns)+(x-1);\n //top neighbour\n if(y-1>0 && !grids[index-no_columns].classList.contains('obstacle')){\n neighbours.push([x,(y-1)]);\n };\n //right neighbour\n if(x+1<=no_columns && !grids[index+1].classList.contains('obstacle')){\n neighbours.push([(x+1),y]);\n };\n //bottom neighbour\n if(y+1<=no_rows && !grids[index+no_columns].classList.contains('obstacle')){\n neighbours.push([x,(y+1)]);\n };\n //left neighbour\n if(x-1>0 && !grids[index-1].classList.contains('obstacle')){\n neighbours.push([(x-1),y]);\n };\n return neighbours;\n }", "title": "" }, { "docid": "13fd67594b6f175f4e8b90d283e0866a", "score": "0.60679543", "text": "_getEmptySpotPositionIfAround(i, j)\r\n {\r\n let emptySpot = {i:null, j:null};\r\n\r\n // Check we didn't click the empty spot directly\r\n if (this.pieces[i][j].canvas != null)\r\n {\r\n\r\n // Check all four adjacent tiles if they exist for the empty spot\r\n if (i > 0)\r\n {\r\n if (this.pieces[i - 1][j].canvas == null)\r\n {\r\n emptySpot.i = i - 1;\r\n emptySpot.j = j;\r\n }\r\n }\r\n if (j > 0)\r\n {\r\n if (this.pieces[i][j - 1].canvas == null)\r\n {\r\n emptySpot.i = i;\r\n emptySpot.j = j - 1;\r\n }\r\n }\r\n if (i + 1 < this.divideBy)\r\n {\r\n if (this.pieces[i + 1][j].canvas == null)\r\n {\r\n emptySpot.i = i + 1;\r\n emptySpot.j = j;\r\n }\r\n }\r\n if (j + 1 < this.divideBy)\r\n {\r\n if (this.pieces[i][j + 1].canvas == null)\r\n {\r\n emptySpot.i = i;\r\n emptySpot.j = j + 1;\r\n }\r\n }\r\n }\r\n return emptySpot;\r\n }", "title": "" }, { "docid": "4008717832a81088fab8312fef91425e", "score": "0.60653543", "text": "get_movable_neighbors(x,y) {\n let neigh = [ [x+1,y+1], [x+1,y-1],\n [x-1, y+1], [x-1, y-1] ];\n let movable = []\n for ( let idx=0; idx<neigh.length; idx++ ) {\n let n_x = neigh[idx][0];\n let n_y = neigh[idx][1];\n if ( this.is_inside(n_x, n_y) && this.is_empty(n_x, n_y) )\n movable.push(neigh[idx]); \n }\n return movable;\n }", "title": "" }, { "docid": "1acea7cab0f36a75faae5b1511e1ba41", "score": "0.60563326", "text": "function assignMissingValues() {\n for (var i=0;i<GRIDSIZE;i++)\n board[i] = [...answer[i]];\n\n for (var i=0;i<numBlank;i++) {\n var blank = Math.floor(Math.random()*81);\n var row = Math.floor(blank/GRIDSIZE);\n var col = blank % GRIDSIZE;\n while (board[row][col] === 0) {\n blank = Math.floor(Math.random()*81);\n row = Math.floor(blank/GRIDSIZE);\n col = blank % GRIDSIZE;\n }\n board[row][col] = 0;\n }\n}", "title": "" }, { "docid": "2d5782c99649eadb851ff138d38772a5", "score": "0.6051021", "text": "function checkFilled(col, row) {\n let points = board.getPoints();\n for (let i = points.length - 1; i >= 0; i--) {\n let point = points[i][col];\n if (point.color == null) {\n point.setColor(c);\n return [i, col];\n }\n }\n}", "title": "" }, { "docid": "e0fd9e02e978cca8f39daea46628cbb8", "score": "0.60416067", "text": "function emptyboxes() {\n\treturn myBoard.filter(s => typeof s == 'number'); //return # of box becuas it is empty\n}", "title": "" }, { "docid": "6aa9e79c48624b84b842e65859dd94c5", "score": "0.60414404", "text": "makeCells() {\n // Create an empty array for the cell to live in\n let cells = [];\n\n // Outer loop goes through the rows\n for (let y = 0; y < this.rows; y++) {\n // Inner loop goes through the columns\n for (let x = 0; x < this.cols; x++) {\n // If the board exists at that position...\n if (this.board[y][x]) {\n // Place the cell at that position\n cells.push({ x, y });\n }\n }\n }\n\n return cells;\n }", "title": "" }, { "docid": "6211e196c5bb1a08f936860f6303d66b", "score": "0.6038198", "text": "function emptySquaresLeftOnMap()\n{\n\tvar c;\n\tvar r;\n\tfor(c = 0;c<3;c++)\n\t{\n\t\tfor(r = 0;r<3;r++)\n\t\t{\n\t\t\tif (map[c][r] == 0)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\n\t\t}\n\t}\n\t\n\treturn false;\n}", "title": "" }, { "docid": "f417a71aadfa1f0b12b7e3f05374e37b", "score": "0.6032434", "text": "function getPossible()\n {\n var arr = [];\n $(\"#puzzlecont > div\").each(function(){\n x = Number.parseInt($(this).css(\"left\")); \n y = Number.parseInt($(this).css(\"top\"));\n coor=x+y;\n xb = Number.parseInt(blankx);\n yb = Number.parseInt(blanky);\n blankcoor = xb + yb;\n if((x===xb || y === yb) && Math.abs(coor-blankcoor)===150)\n arr.push($(this).attr(\"id\"));\n });\n return arr;\n }", "title": "" }, { "docid": "09bdc2ef3460d43b3c2811addba7c310", "score": "0.6030185", "text": "get_map_surrounding_tiles_pixel_coords(x_pos, y_pos) {\r\n\r\n var surrounding_tiles = [\r\n { key: 'UP', value: ''},\r\n { key: 'RIGHT', value: ''},\r\n { key: 'DOWN', value: ''},\r\n { key: 'LEFT', value: ''},\r\n { key: 'TL', value: ''},\r\n { key: 'TR', value: ''},\r\n { key: 'BR', value: ''},\r\n { key: 'BL', value: ''},\r\n ];\r\n\r\n // Up down left right\r\n surrounding_tiles[0].value = this.get_map_tile_pixel_coords(x_pos, (y_pos - this.map.tile_height)); // Up\r\n surrounding_tiles[2].value = this.get_map_tile_pixel_coords(x_pos, (y_pos + this.map.tile_height)); // Down\r\n surrounding_tiles[1].value = this.get_map_tile_pixel_coords((x_pos + this.map.tile_width), y_pos); // Right \r\n surrounding_tiles[3].value = this.get_map_tile_pixel_coords((x_pos - this.map.tile_width), y_pos); // Left\r\n\r\n\r\n // Figure out corner\r\n surrounding_tiles[4].value = this.get_map_tile_pixel_coords((x_pos - this.map.tile_width), (y_pos - this.map.tile_height)); // TL\r\n surrounding_tiles[5].value = this.get_map_tile_pixel_coords((x_pos + this.map.tile_width), (y_pos - this.map.tile_height)); // TR\r\n surrounding_tiles[6].value = this.get_map_tile_pixel_coords((x_pos + this.map.tile_width) , (y_pos + this.map.tile_height)); //BR\r\n surrounding_tiles[7].value = this.get_map_tile_pixel_coords((x_pos + this.map.tile_width) , (y_pos + this.map.tile_height)); //BL\r\n\r\n return surrounding_tiles;\r\n\r\n }", "title": "" }, { "docid": "fb394f4cd633d2e6482d1329c8c33ebe", "score": "0.6025081", "text": "emptyGrid()\n {\n for (var y = 0; y < this.squares.length; y++)\n {\n for (var x = 0; x < this.squares[y].length; x++)\n {\n this.squares[y][x].setEmpty();\n }\n }\n }", "title": "" }, { "docid": "49aacbd30d58e31e907bce61de3ec202", "score": "0.6017069", "text": "getBoard() {\n if (this.board.length !== 8) {\n throw new UserInputError(\"Mitäs vittua tapahtu\")\n }\n const returnedBoard = this.board.map(row => {\n if (row.length !== 8) {\n throw new UserInputError(\"Mitäs vittua tapahtu\")\n }\n const returnedRow = row.map(piece => {\n return piece ? {\n type: piece.getType(),\n side: piece.getSide(),\n location: { row: piece.row, column: piece.column},\n id: piece.id,\n availableMoves: piece.getAvailableMoves(this),\n } : null\n })\n return returnedRow\n })\n return returnedBoard\n }", "title": "" }, { "docid": "44749d4c0b40cb5f67cd91a719f19e11", "score": "0.601388", "text": "createTiles() {\n const tiles = [];\n const {rows, columns} = this.state;\n for (let y = 0; y < rows; y++) {\n for (let x = 0; x < columns; x++) {\n if (this.board[y][x]) {\n tiles.push({ x, y });\n }\n }\n }\n return tiles;\n }", "title": "" }, { "docid": "ddfeae925750d11905e560892746a340", "score": "0.6010535", "text": "function checkCells(all) {\n for (let i = 0; i < board.length; i++){\n for (let j = 0; j < board.length; j++){\n //\n if (board[i][j] == \"-\") {\n //\n let horizontalLine = [];\n let verticalLine = [];\n let group = tripleGroups.find(gr => gr.find(a => a.i === i && a.j === j));\n let possibles = [];\n \n // removing the cell's itself from group\n \n group = group.filter(p => p.i !== i || p.j !== j);\n if (all) {\n group = group.filter(pair => board[pair.i][pair.j] == \"-\");\n group = group.map(pair => ({i:pair.i,j:pair.j,val: pair.val,possibles: allPossibles.find(a => a.i == pair.i && a.j == pair.j).possibles}))\n }\n\n // defining horizantal line \n \n for (let h = 0; h < board.length; h++) {\n if (h !== j) {\n if (all && board[i][h] == \"-\") horizontalLine.push({i,j:h,val: board[i][h],possibles: allPossibles.find(a => a.i == i && a.j == h).possibles})\n else if (!all) horizontalLine.push({val: board[i][h]})\n } \n }\n\n // defining vertical line \n\n for (let h = 0; h < board.length; h++) {\n if (h !== i) {\n if(all && board[h][j] == \"-\") verticalLine.push({i:h,j,val: board[h][j],possibles: allPossibles.find(a => a.i == h && a.j == j).possibles})\n else if (!all) verticalLine.push({val: board[h][j]});\n }\n }\n\n if (!all) nums.forEach(num => horizontalLine.every(a => a.val != num) && verticalLine.every(a => a.val != num) && group.every(a => a.val != num ) && possibles.push(num));\n else possibles = allPossibles.find(a => a.i == i && a.j == j).possibles\n\n // recognizing which cell is appropriate\n \n if (!all) allPossibles.push({possibles,i,j}); \n else if (possibles.length == 1 || possibles.find(num => verticalLine.every(a => a.possibles.every(b => b !== num)) || horizontalLine.every(a => a.possibles.every(b => b !== num)) || group.every(a => a.possibles.every(b => b !== num)))) { \n let num = possibles.length == 1 ? possibles[0] : possibles.find(num => verticalLine.every(a => a.possibles.every(b => b !== num)) || horizontalLine.every(a => a.possibles.every(b => b !== num)) || group.every(a => a.possibles.every(b => b !== num)));\n board[i][j] = num.toString();\n allPossibles = allPossibles.filter(gr => gr.i !== i || gr.j !== j);\n allPossibles = allPossibles.map(pos => {\n let found = false;\n for (let a = 0; a < verticalLine.length; a++) {\n if (pos.i === verticalLine[a].i && pos.j === j) found = true;\n }\n for (let a = 0; a < horizontalLine.length; a++) {\n if (pos.i === i && pos.j === horizontalLine[a].j) found = true;\n }\n for (let a = 0; a < group.length; a++) {\n if (pos.i === group[a].i && pos.j === group[a].j) found = true;\n }\n if (found) return {possibles: pos.possibles.filter(n => n != num), i:pos.i,j:pos.j};\n else return pos;\n })\n \n // checking process and debugging\n // console.log(\" \")\n // console.log(\"----------------\")\n // console.log({i,j,num}, allPossibles)\n // console.log(\" \")\n // console.log(board[0].join(\"|\"))\n // console.log(board[1].join(\"|\"))\n // console.log(board[2].join(\"|\"))\n // console.log(board[3].join(\"|\"))\n // console.log(board[4].join(\"|\"))\n // console.log(board[5].join(\"|\"))\n // console.log(board[6].join(\"|\"))\n // console.log(board[7].join(\"|\"))\n // console.log(board[8].join(\"|\"))\n // console.log(\" \")\n // console.log(\"----------------\")\n // console.log(\" \")\n }\n\n else {\n for (let possibleNum = 0; possibleNum < possibles.length; possibleNum++) {\n let num = possibles[possibleNum];\n\n if (possibles.length == 2) {\n\n if (verticalLine.find(v => v.possibles.length == 2 && v.possibles[0] == possibles[0] && v.possibles[1] == possibles[1])) {\n let same = verticalLine.find(v => v.possibles.length == 2 && v.possibles[0] == possibles[0] && v.possibles[1] == possibles[1])\n let tempVertical = verticalLine.filter(ver => ver.i !== same.i || ver.j !== same.j);\n allPossibles = allPossibles.map(pos => {\n let found = false;\n for (let a = 0; a < tempVertical.length; a++) {\n if (pos.i == tempVertical[a].i && pos.j == j) found = true;\n }\n if (found) return {possibles: pos.possibles.filter(n => n != possibles[0] && n != possibles[1]), i:pos.i,j:pos.j};\n else return pos;\n })\n }\n\n if (horizontalLine.find(v => v.possibles.length == 2 && v.possibles[0] == possibles[0] && v.possibles[1] == possibles[1])) {\n let same = horizontalLine.find(v => v.possibles.length == 2 && v.possibles[0] == possibles[0] && v.possibles[1] == possibles[1])\n let tempHorizontal = horizontalLine.filter(ver => ver.i !== same.i || ver.j !== same.j);\n allPossibles = allPossibles.map(pos => {\n let found = false;\n for (let a = 0; a < tempHorizontal.length; a++) {\n if (pos.i === i && pos.j === tempHorizontal[a].j) found = true;\n }\n if (found) return {possibles: pos.possibles.filter(n => n != possibles[0] && n != possibles[1]), i:pos.i,j:pos.j};\n else return pos;\n })\n }\n\n if (group.find(v => v.possibles.length == 2 && v.possibles[0] == possibles[0] && v.possibles[1] == possibles[1])) {\n let same = group.find(v => v.possibles.length == 2 && v.possibles[0] == possibles[0] && v.possibles[1] == possibles[1])\n let tempGroup = group.filter(ver => ver.i !== same.i || ver.j !== same.j);\n allPossibles = allPossibles.map(pos => {\n let found = false;\n for (let a = 0; a < tempGroup.length; a++) {\n if (pos.i == tempGroup[a].i && pos.j == tempGroup[a].j) found = true;\n }\n if (found) return {possibles: pos.possibles.filter(n => n != possibles[0] && n != possibles[1]), i:pos.i,j:pos.j};\n else return pos;\n })\n }\n } else {\n // check group\n if (group.find(b => b.possibles.includes(num)) && group.filter(c => c.possibles.includes(num)).length == 1) {\n let pair = group.find(v => v.possibles.includes(num))\n if (horizontalLine.find(ho => ho.i == pair.i && ho.j == pair.j)) {\n let tempHorizontal = horizontalLine.filter(ho => ho.i != pair.i || ho.j !== pair.j);\n allPossibles = allPossibles.map(pos => {\n let found = false;\n for (let a = 0; a < tempHorizontal.length; a++) {\n if (pos.i === i && pos.j === tempHorizontal[a].j) found = true;\n }\n if (found) return {possibles: pos.possibles.filter(n => n != num), i:pos.i,j:pos.j};\n else return pos;\n })\n } \n else if (verticalLine.find(ve => ve.i == pair.i && ve.j == pair.j)) {\n let tempVertical = verticalLine.filter(ver => ver.i !== pair.i || ver.j !== pair.j);\n allPossibles = allPossibles.map(pos => {\n let found = false;\n for (let a = 0; a < tempVertical.length; a++) {\n if (pos.i == tempVertical[a].i && pos.j == j) found = true;\n }\n if (found) return {possibles: pos.possibles.filter(n => n != num), i:pos.i,j:pos.j};\n else return pos;\n })\n }\n } \n\n // another possibility (for expert level (max) )\n\n if (group.filter(a => a.possibles.includes(num)).length > 0) {\n let groupMems = group.filter(a => a.possibles.includes(num))\n let sameVertical = groupMems.filter(mem => mem.j == j);\n let sameHorizontal = groupMems.filter(mem => mem.i == i);\n if (sameVertical.length > 0) {\n let tempVer = verticalLine.filter(a => sameVertical.length == 2 ? a.i != sameVertical[0].i && a.i != sameVertical[1].i : a.i != sameVertical[0].i)\n if(!tempVer.find(a => a.possibles.includes(num))) {\n let tempGroup = group.filter(a => sameVertical.length == 2 ? a.i != sameVertical[0].i && a.i != sameVertical[1].i : a.i != sameVertical[0].i)\n allPossibles = allPossibles.map(pos => {\n let found = false;\n for (let a = 0; a < tempGroup.length; a++) {\n if (pos.i == tempGroup[a].i && pos.j == tempGroup[a].j) found = true;\n }\n if (found) return {possibles: pos.possibles.filter(n => n != num), i:pos.i,j:pos.j};\n else return pos;\n })\n }\n }\n if (sameHorizontal.length > 0) {\n let tempHor = horizontalLine.filter(a => sameHorizontal.length == 2 ? a.j != sameHorizontal[0].j && a.i != sameHorizontal[1].j : a.j != sameHorizontal[0].j)\n if(!tempHor.find(a => a.possibles.includes(num))) {\n let tempGroup = group.filter(a => sameHorizontal.length == 2 ? a.j != sameHorizontal[0].j && a.j != sameHorizontal[1].j : a.j != sameHorizontal[0].j)\n allPossibles = allPossibles.map(pos => {\n let found = false;\n for (let a = 0; a < tempGroup.length; a++) {\n if (pos.i == tempGroup[a].i && pos.j == tempGroup[a].j) found = true;\n }\n if (found) return {possibles: pos.possibles.filter(n => n != num), i:pos.i,j:pos.j};\n else return pos;\n })\n }\n }\n \n }\n\n }\n }\n \n }\n \n }\n }\n } \n }", "title": "" }, { "docid": "024f88084c31acb03b3c18d2cb7a553d", "score": "0.6001528", "text": "function findPositions(piece) {\n const positions = []\n for (let y = 0; y < 8; y++) {\n for (let x = 0; x < 8; x++) {\n if (board[y][x] === (whitesTurn ? piece.toLowerCase() : piece)) {\n positions.push([y, x])\n }\n }\n }\n return positions\n}", "title": "" }, { "docid": "d09c7988ccd27f4e9ece172df8e15e08", "score": "0.59977543", "text": "function getAllCoords(extr) {\n const allCoords = [];\n for (let i = extr.up; i <= extr.down; i++) {\n for (let j = extr.left; j <= extr.right; j++) {\n allCoords.push({ x: i, y: j });\n }\n }\n return allCoords;\n}", "title": "" }, { "docid": "14820f35f22ef6687746a72432699fa9", "score": "0.5994609", "text": "nextEmptyCell() {\n for (var y = 1; y <= this.height; y++) {\n for (var x = 1; x <= this.width; x++) {\n if ( this.cellIsEmpty(x,y) ) {\n return {x: x, y: y};\n }\n }\n }\n throw new Error(`No empty cells available.`);\n }", "title": "" }, { "docid": "014daae4a0b90cfb1ba93bf1afd3b97b", "score": "0.59856933", "text": "function fullBoard(){\n var state = getCurrentBoard()\n return $.inArray('', state)\n}", "title": "" }, { "docid": "f8ef4ee5304c667dd839675531c770d3", "score": "0.5984802", "text": "function getLocation(square) {\n\n for (r = 0; r < height; r++) {\n for (c = 0; c < width; c++) {\n if (board[r][c] == square) {\n return [r, c]\n }\n }\n }\n}", "title": "" }, { "docid": "6e8a4142f397129d69829ca661e729de", "score": "0.5978246", "text": "function possibleMoves(localBoard)\n{\n //if(win(localBoard)!=0) return \"\";\n var moves=[];\n for (var i=0; i<3; i++)\n for (var j=0; j<3; j++)\n if(localBoard[i][j]==0)\n moves.push([i,j]);\n return moves;\n}", "title": "" }, { "docid": "5ed4f9d5e87e2ded63c4a6a56b03e259", "score": "0.5971151", "text": "getMoves(board) {\n var movesArray = new Array();\n //Case 1. 2 Up, 1 Left\n if ((this.getXCoordinate() - 1 >= 1) && (this.getYCoordinate() + 2 <= 8)) {\n console.log(\"trip case one\", this.getXCoordinate()-1, this.getYCoordinate() +2 )\n if (board[this.getXCoordinate() - 1][this.getYCoordinate() + 2].getPiece().getColor() != this.getColor()) {\n movesArray.push([(this.getXCoordinate() - 1), (this.getYCoordinate() + 2)])\n }\n }\n // Case 2. 2 Up, 1 Right\n if ((this.getXCoordinate() + 1 <= 8) && (this.getYCoordinate() + 2 <= 8)) {\n if (board[this.getXCoordinate() + 1][this.getYCoordinate() + 2].getPiece().getColor() != this.getColor()) {\n movesArray.push([(this.getXCoordinate() + 1),(this.getYCoordinate() + 2)])\n }\n }\n // Case 3. 2 Right, 1 Up\n if ((this.getXCoordinate() + 2 <= 8) && (this.getYCoordinate() + 1 <= 8)) {\n if (board[this.getXCoordinate() + 2][this.getYCoordinate() + 1].getPiece().getColor() != this.getColor()) {\n movesArray.push([(this.getXCoordinate() + 2), (this.getYCoordinate() + 1)])\n }\n }\n // Case 4. 2 Right, 1 Down\n if ((this.getXCoordinate() + 2 <= 8) && (this.getYCoordinate() - 1 >= 1)) {\n if (board[this.getXCoordinate() + 2][this.getYCoordinate() - 1].getPiece().getColor() != this.getColor()) {\n movesArray.push([(this.getXCoordinate() + 2),(this.getYCoordinate() - 1)])\n }\n }\n // Case 5. 2 Down, 1 Right\n if ((this.getXCoordinate() + 1 <= 8) && (this.getYCoordinate() - 2 >= 1)) {\n if (board[this.getXCoordinate() + 1][this.getYCoordinate() - 2].getPiece().getColor() != this.getColor()) {\n movesArray.push([(this.getXCoordinate() + 1),(this.getYCoordinate() - 2)])\n }\n }\n // Case 6. 2 Down, 1 Left\n if ((this.getXCoordinate() - 1 >= 1) && (this.getYCoordinate() - 2 >= 1)) {\n if (board[this.getXCoordinate() - 1][this.getYCoordinate() - 2].getPiece().getColor() != this.getColor()) {\n movesArray.push([(this.getXCoordinate() - 1),(this.getYCoordinate() - 2)])\n }\n }\n // Case 7. 2 Left, 1 Down\n if ((this.getXCoordinate() - 2 >= 1) && (this.getYCoordinate() - 1 >= 1)) {\n if (board[this.getXCoordinate() - 2][this.getYCoordinate() - 1].getPiece().getColor() != this.getColor()) {\n movesArray.push([(this.getXCoordinate() - 2), (this.getYCoordinate() - 1)])\n }\n }\n // Case 8. 2 Left, 1 Up\n if ((this.getXCoordinate() - 2 >= 1) && (this.getYCoordinate() + 1 <= 8)) {\n if (board[this.getXCoordinate() - 2][this.getYCoordinate() + 1].getPiece().getColor() != this.getColor()) {\n movesArray.push([(this.getXCoordinate() - 2), (this.getYCoordinate() + 1)])\n }\n }\n console.log(\"knight moves\")\n return movesArray\n }", "title": "" }, { "docid": "0ebd904eafcf7944ae930fc0ee9aac85", "score": "0.5969201", "text": "findNearestEmpty(x, y) {\n let worker_at = [];\n this.workers.forEach(function (worker) {\n let x = worker.x;\n let y = worker.y;\n if (worker.moving) {\n x = worker.dest_x;\n y = worker.dest_y;\n }\n worker_at[x] = worker_at[x] || [];\n worker_at[x][y] = true;\n });\n let board = this;\n function test(x, y, only_hp) {\n if (board.mapGet(x, y, 'state') !== 'green') {\n return;\n }\n if (only_hp && !board.mapGet(x, y, 'hp')) {\n return;\n }\n if (!worker_at[x] || !worker_at[x][y]) {\n return [x, y];\n }\n }\n let d = 1;\n while (true) {\n let r;\n let vvs = [\n [-1, -1],\n [-1, 1],\n [1, -1],\n [1, 1],\n ];\n for (let ii = 0; ii <= d; ++ii) {\n for (let kk = 0; kk < 2; ++kk) {\n for (let jj = 0; jj < vvs.length; ++jj) {\n if ((r = test(x + vvs[jj][0] * ii, y + vvs[jj][1] * d, !kk))) {\n return r;\n }\n if ((r = test(x + vvs[jj][0] * d, y + vvs[jj][1] * ii, !kk))) {\n return r;\n }\n }\n }\n }\n ++d;\n }\n }", "title": "" }, { "docid": "6ad7fe61e77ee3ee1f925e94e696a3b5", "score": "0.596171", "text": "createBoard() {\n const boardArray = [];\n for (let y = 0; y < 3; y++) {\n const row = [];\n for (let x = 0; x < 3; x++) {\n row.push(null);\n }\n boardArray.push(row);\n }\n return boardArray;\n }", "title": "" }, { "docid": "81aec6f158f470c85f66be18240b3b15", "score": "0.59593654", "text": "function notVotePosition() {\n return [\n {cx: 32.2, cy: 474.8},\n {cx: 78.2, cy: 474.8},\n {cx: 121.2, cy: 474.8},\n {cx: 165.2, cy: 474.8},\n {cx: 210.2, cy: 474.8},\n ];\n}", "title": "" }, { "docid": "fa645f8dd63a0ce7d1cdef29470c6ae7", "score": "0.59535927", "text": "checkZero() {\n let x = [...this.state.currentLocation]\n let count = 0\n for (let row = 0; row < x.length; row++) {\n let subArr = x[row]\n for (let col = 0; col < subArr.length; col++) {\n let i = x[row][col]\n if (i === 0) {\n return { row, col }\n }\n }\n }\n }", "title": "" }, { "docid": "39e15525902f3475a0da366d2115b17b", "score": "0.5952682", "text": "function getSurroundingBlanks(neighbors) {\n var blanks = [];\n for(var i = 0; i < neighbors.length; i++) if(board[neighbors[i]] == 0 && !displayed[neighbors[i]]) blanks.push(neighbors[i]);\n return blanks;\n}", "title": "" }, { "docid": "41cc99205940fee3581fe5cfd0c259b0", "score": "0.59493446", "text": "get neighbors() {\n return [\n this.north,\n this.east,\n this.south,\n this.west\n ].filter(Boolean);\n }", "title": "" }, { "docid": "cc9f0f4008691085fbdcf137bf1b1e1d", "score": "0.59480786", "text": "function getEmptyAdjacentSquare(square){\n\t\t//Gets all adj sqaures\n\t\tvar adj = getAdjacentSquares(square);\n\n\t\t//Search for empty cell\n\t\tfor(var i = 0; i < adj.length; i++){\n\t\t\tif(adj[i].className == \"empty\"){\n\t\t\t\treturn adj[i];\n\t\t\t}\n\t\t}\n\n\t\t//Empty square not found\n\t\treturn false;\n\t}", "title": "" }, { "docid": "10c0261353c261265b0ba84670e19144", "score": "0.594398", "text": "toCells() {\n this.cells = [];\n for (var y = 0; y < 20; y++) {\n for (var x = 0; x < 10; x++) {\n if (this.rows[y][x] !== 'empty') {\n this.cells.push(new Cell(x, y, this.rows[y][x]));\n }\n }\n }\n }", "title": "" }, { "docid": "c6b0363bafa1e9afa867e45ad0556740", "score": "0.594382", "text": "checkNeighbors() {\n let neighbors = [], x = this.x, y = this.y,\n top = (y > 0) ? grid[x][y - 1] : null,\n right = (x < cols - 1) ? grid[x + 1][y] : null,\n bottom = (y < rows - 1) ? grid[x][y + 1] : null,\n left = (x > 0) ? grid[x - 1][y] : null;\n\n if (top && !top.visited) {\n neighbors.push(top);\n }\n if (right && !right.visited) {\n neighbors.push(right);\n }\n if (bottom && !bottom.visited) {\n neighbors.push(bottom);\n }\n if (left && !left.visited) {\n neighbors.push(left);\n }\n\n if (neighbors.length > 0) {\n return neighbors[Math.floor(Math.random() * neighbors.length)];\n }\n else {\n return undefined;\n }\n }", "title": "" } ]
e709b079a31c6760440e50e5564d9cf9
Displays the video feed that would normally be visible if the app. The DefaultVideoFeed generally shows feeds based on their volume level.
[ { "docid": "b8f41eab44b98d4c5090d348c3e3bb06", "score": "0.7425924", "text": "function showDefaultFeed() {\n\n // Remove the highlighting.\n if (currentHighlightedParticipantId) {\n google.hangout.av.clearAvatar(currentHighlightedParticipantId);\n }\n\n currentHighlightedParticipantId = null;\n\n var feed = google.hangout.layout.getDefaultVideoFeed();\n var canvas = google.hangout.layout.getVideoCanvas();\n\n canvas.setVideoFeed(feed);\n canvas.setWidth(600);\n canvas.setPosition(300, 50);\n canvas.setVisible(true);\n\n // Update the text\n //updateDisplayedParticipant();\n }", "title": "" } ]
[ { "docid": "6a9929bc2f33b33e2921b14de5c59cbb", "score": "0.66274816", "text": "function publicFeed(){\n if(navigator.getUserMedia) { // Standard\n navigator.getUserMedia(videoObj, function(stream) {\n p.video.src = stream;\n p.video.play();\n }, errBack);\n } else if(navigator.webkitGetUserMedia) { // WebKit-prefixed\n navigator.webkitGetUserMedia(videoObj, function(stream){\n p.video.src = window.webkitURL.createObjectURL(stream);\n p.video.play();\n }, errBack);\n }\n else if(navigator.mozGetUserMedia) { // Firefox-prefixed\n navigator.mozGetUserMedia(videoObj, function(stream){\n p.video.src = window.URL.createObjectURL(stream);\n p.video.play();\n }, errBack);\n }\n }", "title": "" }, { "docid": "cf8426312c3bea9282003b9986dca7f4", "score": "0.6449815", "text": "function startVideoFeed() {\n navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;\n if (navigator.getUserMedia) {\n navigator.getUserMedia({ audio: false, video: true },\n function (stream) {\n videoFeed.srcObject = stream;\n videoFeed.onloadedmetadata = function (e) {\n videoFeed.play();\n };\n },\n function (err) {\n console.log(\"ERROR: The following error occurred: \" + err.name);\n if (userVideoTracking) {\n endExam('cameraNotAllowed')\n }\n }\n );\n } else {\n console.log(\"ERROR: getUserMedia not supported, try another device and give all necessary permissions.\")\n if (userVideoTracking) {\n endExam('cameraNotFound')\n }\n }\n}", "title": "" }, { "docid": "dc9ad238870e2300173c5a2966bd81c5", "score": "0.5769207", "text": "function startLocalPreview() {\n log_d(\"Starting local video\");\n var succHandler = function (sinkId) {\n log_d(\"Local video started. Setting up renderer\");\n var rendererContent = RENDER_LOCAL_TMPL.replace('#', '_local');\n $('.feeds-wrapper').append($(rendererContent));\n CDO.renderSink({\n sinkId:sinkId,\n containerId:'userFeed_local',\n mirror:true,\n windowless:true\n });\n };\n CDO.getService().startLocalVideo(CDO.createResponder(succHandler));\n }", "title": "" }, { "docid": "602c28ba350d4ab2e0f92435e1f8e26d", "score": "0.5744513", "text": "function cnnLiveVideo( strWhich ) {\r\n\tif(!strWhich) {\r\n\t\tstrWhich = '1';\r\n\t}\r\n\tvar strVidLoc = 'http://weather.edition.cnn.com/video/live/live.html?stream=stream' + strWhich;\r\n\tif(html5Check) { strVidLoc = 'http://weather.edition.cnn.com/video/flashLive/live.ipad_nf.html'; }\r\n\tCNN_openPopup(strVidLoc,'liveplayer','scrollbars=yes,resizable=yes,width=672,height=540');\r\n}", "title": "" }, { "docid": "0fd88dc9b965b2dd9575ef5724c3da9a", "score": "0.57398814", "text": "function displayPage() {\n\t\tfor (var i = 0; i < PANEL_CAPACITY; i++) {\n\t\t\tvar v = videos[pageIndex][i];\n\t\t\tvar thumb = document.querySelector('#video0' + i);\n\t\t\tif (v) {\n\t\t\t\t// console.log('video thumbnail url', v);\n\t\t\t\tthumb.setAttribute('visible', true);\n\t\t\t\tthumb.setAttribute('src', v.ThumbnailImageUrl);\n\t\t\t} else {\n\t\t\t\tthumb.setAttribute('visible', false);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "7f22d5e785eec681d6dd298e951f1dd2", "score": "0.5738565", "text": "function addItems() {\n var i,\n iMax,\n video,\n pubdate,\n videoURL,\n thumbnailURL,\n doThumbnail = true;\n if (videoData.length > 0) {\n mrssStr += sChannel;\n mrssStr += '<atom:link href=\"' + feedURL.value.replace(/&/g, '&amp;') + '\" rel=\"self\" type=\"application/rss+xml\" />';\n mrssStr += sTitle + feedname + eTitle;\n mrssStr += sDescription + sCdata + feedDescription.value + eCdata + eDescription;\n mrssStr += sLink + siteURL.value.replace(/&/g, \"&amp;\") + eLink;\n iMax = videoData.length;\n for (i = 0; i < iMax; i += 1) {\n doThumbnail = true;\n video = videoData[i];\n\n // video may not have a valid source\n if (isDefined(video.source) && isDefined(video.source.src)) {\n videoURL = video.source.src.replace(/&/g, \"&amp;\");\n } else {\n // no source; skip this videos\n continue;\n }\n // depending on when/how the video was created, it may have different thumbnail properties or none at all\n if (isDefined(video.thumbnail)) {\n thumbnailURL = encodeURI(video.thumbnail.replace(/&/g, \"&amp;\"));\n } else {\n doThumbnail = false;\n }\n\n pubdate = new Date(video.created_at).toGMTString();\n mrssStr += sItem;\n mrssStr +=\n sLink +\n \"https://players.brightcove.net/\" +\n account_id +\n \"/default_default/index.html?videoId=\" +\n video.id +\n eLink;\n mrssStr += sPubDate + pubdate + ePubDate;\n mrssStr += sGuid + video.id + eGuid;\n mrssStr +=\n sMediaContent +\n ' url=\"' +\n videoURL +\n '\" fileSize=\"' +\n video.source.size +\n '\" type=\"video/quicktime\" medium=\"video\" duration=\"' +\n video.duration / 1000 +\n '\" isDefault=\"true\" height=\"' +\n video.source.height +\n '\" width=\"' +\n video.source.width +\n '\"' + eMediaContent;\n mrssStr +=\n sMediaPlayer +\n ' url=\"' +\n \"https://players.brightcove.net/\" +\n account_id +\n \"/default_default/index.html?videoId=\" +\n video.id +\n '\"' +\n eMediaPlayer;\n mrssStr += sMediaTitle + video.name + eMediaTitle;\n mrssStr += sMediaDescription + sCdata + video.description + eCdata + eMediaDescription;\n if (doThumbnail) {\n mrssStr += sMediaThumbnail + ' url=\"' + thumbnailURL + '\"';\n if (isDefined(video.images)) {\n mrssStr +=\n ' height=\"' +\n video.images.thumbnail.sources[0].height +\n '\" width=\"' +\n video.images.thumbnail.sources[0].width +\n '\"' +\n eMediaThumbnail;\n } else {\n mrssStr += eMediaThumbnail;\n }\n }\n mrssStr += eItem;\n }\n mrssStr += eChannel + \"</rss>\";\n feed.textContent = vkbeautify.xml(mrssStr);\n }\n }", "title": "" }, { "docid": "fb03cb7337c9b7bb272256e6b971f72b", "score": "0.57375854", "text": "displayVideo() {\n background(0);\n push();\n imageMode(CENTER);\n tint(this.tint.r, this.tint.g, this.tint.b);\n image(this.vid, this.x, this.y, this.w, this.h);\n pop();\n }", "title": "" }, { "docid": "25fff83f0374235c862772040817e31b", "score": "0.569251", "text": "showFeed(){\n\t\tconst data = this.sliceFeed();\n\t\tthis.handleEmptyResult(data);\n\t\tthis.handlePagination(data);\n\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t// console.log('- ' + data[i].user.name);\n\t\t\tthis.generateDOM(data[i]);\n\t\t}\n\t}", "title": "" }, { "docid": "df381a5d1a545c2e02e3c232ba3f1783", "score": "0.5688497", "text": "function ViewVid() {\n $('#vod').bind('inview', function (event, visible) {\n if (visible && action === true) {\n $(this).get(0).play();\n } else {\n $(this).get(0).pause();\n }\n });\n }", "title": "" }, { "docid": "20a9f7ece6ec8f9e354dec555ffcb125", "score": "0.5678696", "text": "function render(videos, initialRender) {\r\n let thumbnail;\r\n let description;\r\n msg.hide();\r\n videos.forEach(function (video, index) {\r\n if (video.state === 'ACTIVE') {\r\n thumbnail = video.images.thumbnail ? video.images.thumbnail.src : video.images.poster.src;\r\n description = video.description ? video.description : '';\r\n unorderedList.append(`<li id='${video.id}'>\r\n <section class=\"img-wrapper\"><img src='${thumbnail}' alt=\"image-6\"></section>\r\n <span class=\"title\"> ${video.name}</span> \r\n <p>${description}</p></li>`);\r\n }\r\n });\r\n\r\n var initialValue = (extensionField && extensionField.field && extensionField.field.getData()) ? extensionField.field.getData() : null;\r\n\r\n if (initialValue) {\r\n if (initialValue.includes('blt'))\r\n initialValue = initialValue.replace('blt', '');\r\n\r\n $('.discription_box ul').empty();\r\n request.getInitialVideo(initialValue).then((video) => {\r\n thumbnail = video.images.thumbnail ? video.images.thumbnail.src : video.images.poster.src;\r\n description = video.description ? video.description : '';\r\n $('.discription_box ul').append(`<li id='${video.id}'>\r\n <section class=\"img-wrapper\"><img src='${thumbnail}' alt=\"image-6\"></section>\r\n <span class=\"title\">${video.name}</span>\r\n <p>${description}</p></li>`);\r\n });\r\n\r\n $('.discription_box ul li a').click(function (e) {\r\n e.preventDefault();\r\n });\r\n setTimeout(function () {\r\n if (!initialRender) {\r\n extensionField.window.updateHeight();\r\n }\r\n }, 1000);\r\n }\r\n\r\n if ($(\".list_section ul li\").length === parseInt(totalVideos.text()) || $(\".list_section ul li\").length >= parseInt(totalVideos.text())) {\r\n loadMoreBtn.hide();\r\n } else {\r\n loadMoreBtn.show();\r\n }\r\n\r\n $('.load-more').removeClass('load-spinner');\r\n $('.discription_box').show();\r\n // on click function choose video button\r\n $('.choose_video').click(function (e) {\r\n $('.list_section').show();\r\n });\r\n domChangeListner();\r\n}", "title": "" }, { "docid": "7d551fe7927342c461e1f36b47b4317a", "score": "0.56598943", "text": "_renderVideo(publication) {\n return (\n <View style={{ flex: 1 }}>\n {this._header(publication)}\n <Image\n style={{ position: 'absolute', width: '100%', height: '100%' }}\n source={{ uri: publication.poster }}\n resizeMode={'cover'}\n blurRadius={35}\n />\n\n <Video\n onReadyForDisplay={() => this.setState({ displayVideo: true })}\n source={{ uri: publication.file }}\n resizeMode={\"contain\"}\n repeat={true}\n minLoadRetryCount={5}\n volume={0.1}\n style={styles.backgroundVideo} />\n\n {!this.state.displayVideo ?\n\n <FastImage\n style={{ width: '100%', height: '100%', flex: 1 }}\n source={{ uri: publication.poster, priority: FastImage.priority.normal }}\n resizeMode={FastImage.resizeMode.cover}\n />\n : null\n }\n {this._footer(publication)}\n\n\n </View>\n )\n }", "title": "" }, { "docid": "fedc067de581f1e6d623a44181d54b4e", "score": "0.55846816", "text": "function main() {\n if (isTwitter()) {\n const videos = getVideos_twitter();\n for (const video of videos) {\n addButtonOverVideo(video);\n }\n }\n else if (isTweetdeck()) {\n const videos = getVideos_tweetdeck();\n for (const video of videos) {\n if (!video.src) {\n continue;\n }\n video.videoContainer.setAttribute('data-dtv-video', video.src);\n }\n }\n }", "title": "" }, { "docid": "e68315c316f245d6c5a6645349667665", "score": "0.5568388", "text": "function interfaceUpdatedLatestFeed() { \n\tshowLatestFeed(); \n }", "title": "" }, { "docid": "15fd0abd3d7269a6f0809a1dd413211a", "score": "0.55657905", "text": "renderVideo(videoData) {\n const title = videoData.snippet.title;\n const channel = videoData.snippet.channelTitle;\n const description = videoData.snippet.description.length > 50 ? videoData.snippet.description.substring(0, 50) + \"...\" : videoData.snippet.description;\n const imageUrl = videoData.snippet.thumbnails.default.url;\n const tag = videoData.etag;\n\n return (\n <VideoListItem \n onQueueVideo={this.props.onQueueVideo} \n videoData={videoData}\n key={tag}\n title={title} \n channel={channel}\n description={description}\n imageUrl={imageUrl} />\n );\n }", "title": "" }, { "docid": "ff63bc3fd1014c1ce5d0e104f5a5d18d", "score": "0.5539192", "text": "function displayVideo(item){\n\treturn `\n\t<iframe src=\"https://www.youtube.com/embed/${item.id.videoId}\" frameborder=\"0\" allowfullscreen></iframe>\n\t`\n}", "title": "" }, { "docid": "e6a39d1e0035e0e27724cef3c50f60f6", "score": "0.5502427", "text": "function initializeVideoStream() {\n StreamService.getVideoStream(optionsVideo);\n }", "title": "" }, { "docid": "da0e5a161e97ba2fe0b0e4f411ae9b8d", "score": "0.5464512", "text": "function displaySelectedVideo() {\n var srcVideoInfo =\n \"https://www.youtube.com/embed/\" +\n ytSearchArray[ytArrayNum].ytVideo +\n \"?controls=0\";\n var videoFrame = $(\"<iframe>\");\n videoFrame\n .attr(\"width\", \"640\")\n .attr(\"height\", \"390\")\n .attr(\"src\", srcVideoInfo);\n\n $(\"#video-playback\").append(videoFrame);\n }", "title": "" }, { "docid": "34c56dec81ad6e89387fdb41a9d723d4", "score": "0.5453976", "text": "render(){\n\t\treturn(\n\t\t\t<div className='video-area'>\n\t\t\t\t<video className=\"_localVideo\" id=\"localVideo\" autoPlay playsinline muted></video>\n <video className=\"_remoteVideo\" id=\"remoteVideo\" autoPlay playsinline></video>\n <button onClick={this.showFriendsFace} type=\"button\" className=\"btn btn-primary btn-lg\">Accept</button>\n <button onClick={this.showMyFace} type=\"button\" className=\"btn btn-primary btn-lg\">Call</button>\n\t\t\t</div>\n\t\t)\n\t}", "title": "" }, { "docid": "040f4d89e716a4e6ea4a34b20eb9d1b4", "score": "0.5421847", "text": "function show()\n{\n // Refresh feed if 15 minutes have passed since the last update\n var now = (new Date).getTime();\n if ((now - lastUpdated) > 15 * 60 * 1000) {\n refreshFeed();\n }\n}", "title": "" }, { "docid": "c72a8768ddaaf1d583e3a37ad5c09ff4", "score": "0.54184747", "text": "function showVideo() {\n\t\t\t\n\t\t\t$('#models').css(\"display\", \"none\");\n\t\t\t$('#viewbut').css(\"display\", \"none\");\n\t\t\t$('#video').css(\"display\", \"inline-block\");\n\t\t\tvar video = $('#mainVid');\n\t\t\tvar vidH = (window.innerWidth*1080)/1920;\n\t\t\tvar playTop = vidH/2 - 20;\n\t\t\t$(playBut).css(\"top\", playTop + \"px\");\n\t\t\t$('#vidcover').css(\"height\", vidH);\n\t\t\t$('#savebut').css(\"display\", \"inline\");\n\t\t\t\n\t\t\tvar seek = document.getElementById(\"seek-bar\");\n\t\t\tvar video = document.getElementById(\"mainVid\");\n\t\t\tvar volume = document.getElementById(\"volume-bar\");\n\t\t\t\n\t\t\t// change the video time when seek bar is changed\n\t\t\tseek.addEventListener(\"change\", function() {\n\t\t\t\tvar time = video.duration * (seek.value/100);\n\t\t\t\tvideo.currentTime = time;\n\t\t\t});\n\t\t\tconsole.log(\"showing video2\");\n\t\n\t\t\t// change where the seek bar handle is\n\t\t\tvideo.addEventListener(\"timeupdate\", function() {\n\t\t\t\tvar value = (100/video.duration) * video.currentTime;\n\t\t\t\tseek.value = value;\n\t\t\t});\n\t\t\t\n\t\t\t// make the video not try to play as seek handle moves\n\t\t\tseek.addEventListener(\"mousedown\", function() {\n\t\t\t\tvideo.pause();\n\t\t\t\tplaying = false;\n\t\t\t\t$('#playBut').attr(\"src\", \"img/play.png\");\n\t\t\t\t$('#vidcover').css(\"opacity\", 1);\n\t\t\t\t$('#seek').css(\"opacity\", 1);\n\t\t\t\t$('#volume').css(\"opacity\", 1);\n\t\t\t});\n\t\t\t\n\t\t\t// now the volume\n\t\t\tvolume.addEventListener(\"change\", function() {\n\t\t\t\tvideo.volume = volume.value;\n\t\t\t});\n\t}", "title": "" }, { "docid": "f7d89e00c3af9dfd0285cd54a86013a6", "score": "0.54181045", "text": "onPopulateVideoInfo(res) {\n this.videoTitleTab.innerHTML = `${\n res.items[0].snippet.title\n } | Videotainment`;\n this.videoDescription.innerHTML = res.items[0].snippet.description;\n this.titleDiv.innerHTML = res.items[0].snippet.title;\n this.channelTitle.innerHTML = res.items[0].snippet.channelTitle;\n\n this.viewCount =\n res.items[0].statistics.viewCount == undefined\n ? (this.viewCount.innerHTML = \"\")\n : (this.viewCount.innerHTML =\n res.items[0].statistics.viewCount\n .toString()\n .replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\") + \" views\");\n\n this.onChannelInfo(res);\n this.onFormatLinks(res);\n this.onFormatVideoTags(res);\n }", "title": "" }, { "docid": "c56c952d6db0b3f5e4f43426c709dae0", "score": "0.54139125", "text": "function viewVideo(video, context){\n context.drawImage(video, 0, 0, context.width, context.height);\n socket.emit('stream', canvas.toDataURL('image/webp'));\n }", "title": "" }, { "docid": "21fec798fdda351123d3785c50d9eb9b", "score": "0.5400365", "text": "async function getVideoSources() {\n const inputSources = await desktopCapturer.getSources({\n types: ['window', 'screen'],\n thumbnailSize: {\n width: 150,\n height: 150\n }\n });\n\n const videoOptionsMenu = Menu.buildFromTemplate(\n inputSources.map(source => {\n return {\n label: source.name,\n click: () => selectSource(source)\n };\n })\n );\n\n videoOptionsMenu.popup();\n}", "title": "" }, { "docid": "944edb33412a405795fad4da3923dbb9", "score": "0.5391993", "text": "showPlayer_() {\n const videoBar = document.getElementById('video-bar');\n this.showNode_(videoBar);\n this.closeError_();\n this.video_.poster = shakaDemo.Main.mainPoster_;\n\n // Scroll to the top of the page, so that if the page is scrolled down,\n // the user won't need to manually scroll up to see the video.\n videoBar.scrollIntoView({behavior: 'smooth', block: 'start'});\n }", "title": "" }, { "docid": "18f778942e7b1dcef8b7eae965e90871", "score": "0.53857803", "text": "render() {\n if (!this.props.stream) {\n return 'Loading...';\n }\n return (\n <div>\n <video\n ref={this.videoRef} style={{ width: '100%' }}\n controls='true'>\n </video>\n <h1>{this.props.stream.title}</h1>\n <h5>{this.props.stream.description}</h5>\n </div>\n )\n }", "title": "" }, { "docid": "51d1d671c1c7dc43550d704afa656c37", "score": "0.5379791", "text": "renderVideo() {\n\n\t\t// Draw the video frame on the board\n\t\tthis.ctx.drawImage(this.$video, 0, 0, this.dimen.width, this.dimen.height);\n\n\t\t// Process current frame\n\t\tthis.frameProcessing();\n\n\t\t// Next frame\n\t\twindow.requestAnimationFrame(this.renderVideo);\n\t}", "title": "" }, { "docid": "9d53bac6035917ca68390171e6696242", "score": "0.5356478", "text": "isVideo () {\n return this.type.startsWith('video');\n }", "title": "" }, { "docid": "1529ce273d17df5ccb16686ffd779c5f", "score": "0.5326355", "text": "async function getVideoSources() {\r\n const inputSources = await desktopCapturer.getSources({\r\n types: ['window', 'screen']\r\n });\r\n\r\n const videoOptionsMenu = Menu.buildFromTemplate(\r\n inputSources.map(source => {\r\n return {\r\n label: source.name,\r\n click: () => selectSource(source)\r\n };\r\n })\r\n );\r\n\r\n\r\n videoOptionsMenu.popup();\r\n}", "title": "" }, { "docid": "75e47c691b61750b88a236bb71711bbd", "score": "0.5321979", "text": "render() {\n return (\n <div class='stream-preview'>\n <a href={'/streams/' + this.props.data.id.videoId + '/'}>\n <img src={this.props.data.snippet.thumbnails.medium.url} alt={this.props.data.snippet.title}></img>\n <div class='live-stream-title'>{this.props.data.snippet.title}</div>\n <div class='live-stream-channel'>{this.props.data.snippet.channelTitle}</div>\n </a>\n </div>\n );\n }", "title": "" }, { "docid": "faa563c2ecf4f75aaec06b18353f8b8a", "score": "0.53089386", "text": "function load_video_feed(){\n\t\t$(\"#ytapiplayer\").css(\"display\", \"block\");\n\t\t\n\t\tvar params = {\n\t\t\tallowScriptAccess: \"always\",\n\t\t\tbgcolor: \"#cccccc\"\n\t\t};\n\t\tvar atts = {\n\t\t\tid: \"myytplayer\"\n\t\t};\n\t\tswfobject.embedSWF(\"http://www.youtube.com/apiplayer?enablejsapi=1&playerapiid=ytplayer\", \"ytapiplayer\", \"640\", \"390\", \"8\", null, null, params, atts);\n\t\t\n\t\tsetTimeout(testtest, 3000);\n\t\t\n\t\t/*\n\t\t * TOKBOX CODE\n\t\t */\n\t\t\n\t\tTB.addEventListener(\"exception\", exceptionHandler);\n\t\t\n\t\tif (TB.checkSystemRequirements() != TB.HAS_REQUIREMENTS) {\n\t\t\talert(\"You don't have the minimum requirements to run this application.\" +\n\t\t\t\"Please upgrade to the latest version of Flash.\");\n\t\t}\n\t\telse {\n\t\t\tsession = TB.initSession(sessionId);\n\t\t\tsession_driver = TB.initSession(sessionId_driver);\n\t\t\tsession.addEventListener('sessionConnected', sessionConnectedHandler);\n\t\t\tsession.addEventListener('sessionDisconnected', sessionDisconnectedHandler);\n\t\t\tsession.addEventListener('connectionCreated', connectionCreatedHandler);\n\t\t\tsession.addEventListener('connectionDestroyed', connectionDestroyedHandler);\n\t\t\tsession.addEventListener('streamCreated', streamCreatedHandler);\n\t\t\tsession.addEventListener('streamDestroyed', streamDestroyedHandler);\n\t\t\t\n\t\t\tsession_driver.addEventListener('sessionConnected', sessionConnectedHandler_driver);\n\t\t\tsession_driver.addEventListener('sessionDisconnected', sessionDisconnectedHandler);\n\t\t\tsession_driver.addEventListener('connectionCreated', connectionCreatedHandler);\n\t\t\tsession_driver.addEventListener('connectionDestroyed', connectionDestroyedHandler);\n\t\t\tsession_driver.addEventListener('streamCreated', streamCreatedHandler_driver);\n\t\t\tsession_driver.addEventListener('streamDestroyed', streamDestroyedHandler_driver);\n\t\t\t\n\t\t\tif(usr_type == 'artist') {\n\t\t\t\tq=setTimeout(show_button,5000);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "c77fa7929755a7325cbcb337f815801a", "score": "0.5284379", "text": "function resultsdisplayfeed(result) {\n if (!result.error) {\n var thefeeds = result.feed.entries;\n for (var i = 0; i < thefeeds.length; i++)\n Showresults.rssoutput += \"<li><a href='\" + thefeeds[i].link + \"'>\" + thefeeds[i].title + \"</a></li>\";\n Showresults.rssoutput += \"</ul>\";\n Showresults.feedcontainer.innerHTML = Showresults.rssoutput;\n } else\n console.log(\"Error fetching feeds!\");\n}", "title": "" }, { "docid": "4d103f6ea6b81bc3cc851843d9df1459", "score": "0.5277405", "text": "function gotStream(stream) {\n\tvideo.src = window.URL.createObjectURL(stream);\n\t/*\n\tvideo.onloadedmetadata = function() {\n\t\t\n\t};\n\t*/\n\tdocument.getElementById('app').hidden = false;\n}", "title": "" }, { "docid": "09dfd06b28a6465e3d49d8d06f3a2fa1", "score": "0.5269371", "text": "function testChannel() {\n var videos = getVideos ('TefalCZSK')\n Logger.log(videos[0]);\n}", "title": "" }, { "docid": "2fe443b86af19237522a39548a08c4d9", "score": "0.5265691", "text": "enableShareContent() {\n if (this.mainVideoId) {\n this.returnLargeToGrid();\n }\n // don't set until above called to take person out of this vie\n this.setShareContentDisplay(true);\n this.showContentView();\n }", "title": "" }, { "docid": "0a6efd0e2d7df8de98b448973ecbec43", "score": "0.5265241", "text": "function searchVideos(data) {\n\tvar feed = data.feed;\n\tvar entries = feed.entry || false;\n\n\tvar html;\n\n\tif (entries) {\n\n\t\thtml = ['<ul class=\"videos\">'];\n\t \t\t\n\t\tfor (var i = 0; i < entries.length; i++) {\n\t\t\tvar entry = entries[i];\n\t\t\tvar title = entry.title.$t.substr(0, 50);\n\t\t\tvar thumbnailUrl = entries[i].media$group.media$thumbnail[0].url;\n\n\t\t\tvar videoID = entries[i].media$group.yt$videoid.$t;\n\n\t\t\tvar playerUrl = entries[i].media$group.media$content[0].url + \"&rel=0\";\n\t\t\t//console.log(entries[i].media$group.media$content[0].duration);\n\n\t\t\t// html.push('<li onclick=\"loadVideo(\\'', playerUrl, '\\', true)\">', '<span class=\"titlec\">', title, '...</span><br /><img src=\"',thumbnailUrl, '\" width=\"130\" height=\"97\"/>', '</span></li>');\n\t\t\t\n\t\t\thtml.push('<li onclick=\"addToPlaylist(\\'' + videoID + '\\',\\'' + title + '\\')\">', '<span class=\"titlec\">', title, '...</span><br /><img src=\"', thumbnailUrl, '\" width=\"130\" height=\"97\"/>', '</span></li>');\n\t\t}\n\n\t\thtml.push('</ul><br style=\"clear: left;\"/>');\n\t\thtml = html.join('');\n\n\t} else { \n\t\thtml = '<p>No results!</p>';\n\t}\n \t \t\n \tdocument.getElementById('searchResults').innerHTML = html;\n}", "title": "" }, { "docid": "936a829165b0f02b4f5f4f0cfc6a1cf8", "score": "0.52335036", "text": "function getVideoUrl() {\n var videoUrl = ytswf.getVideoUrl();\n updateHTML('videoUrl', videoUrl);\n }", "title": "" }, { "docid": "c9d3eca580a7f36c85365cd018bb429a", "score": "0.52334815", "text": "function videosList(data) {\n\n // Arrow function to fill each article with data for each video\n data.items.forEach(item => {\n let thumbNail = item.snippet.thumbnails.medium.url;\n let title = item.snippet.title;\n let description = item.snippet.description;\n let id = item.id.videoId;\n\n // Screen size decides whether to display a long or short description for the videos in the list\n let screenSize = window.matchMedia('(max-width: 450px) and (max-height: 840px)');\n\n if (screenSize.matches) {\n description = description.substr(0, 80) + '...';\n }\n\n // The HTML of an article to be injected into the videos list with the data from the for each arrow function below\n let vidsListHtml = `<article class=\"vid-article\" data-id=\"${id}\" data-title=\"${title}\" data-descr=\"${description}\">\n <h4 class=\"vid-title smaller-green-text\">${title}</h4>\n <img class=\"thumbn\" src=\"${thumbNail}\" alt=\"click to view the video in the main window\"></img>\n <p aria-label=\"Description for video\">${description}</p>\n </div>\n </article>`;\n\n // Set the videos section to contain the HTML above\n let videosSection = document.querySelector('#videos-section');\n videosSection.insertAdjacentHTML('afterBegin', vidsListHtml);\n });\n\n // Get all articles and fill them with the data from the API.\n let articles = document.querySelectorAll('.vid-article');\n\n // Dataset is used in the HTML to identify attributes to be displayed in the main video when clicked apon.\n articles.forEach(article => {\n article.addEventListener('click', function () {\n let newVidId = article.dataset.id;\n let newVidTitle = article.dataset.title;\n let newVidDescr = article.dataset.descr;\n mainVideo(newVidId, newVidTitle, newVidDescr);\n });\n });\n}", "title": "" }, { "docid": "4748a5ba2d88e919e2d34687a6a0ab90", "score": "0.52283585", "text": "startVideoPreview() {\n IrisRtcSdk.startPreview();\n }", "title": "" }, { "docid": "01414068142f4556734ee3a83b785f1e", "score": "0.5219047", "text": "function updateVisibility() {\n\t if (player.tech_ && player.tech_['featuresVolumeControl'] === false) {\n\t this.addClass('vjs-hidden');\n\t } else {\n\t this.removeClass('vjs-hidden');\n\t }\n\t }", "title": "" }, { "docid": "5ee748d136b00effeea2d11e379495a6", "score": "0.52132475", "text": "function startVideo() {\n // Replace the source of the video element with the stream from the camera\n try {\n navigator.webkitGetUserMedia({'audio':true, 'video':true }, successCallback, errorCallback);\n } catch (e) {\n navigator.webkitGetUserMedia(\"video,audio\", successCallback, errorCallback);\n }\n\n function successCallback(stream) {\n scope.SETTINGS.sourceVideo.src = window.webkitURL.createObjectURL(stream);\n\n localStream = stream;\n waitForLocalVideo();\n }\n\n function errorCallback(error) {\n console.log('An error occurred: [CODE ' + error.code + ']');\n }\n\n }", "title": "" }, { "docid": "0285c576ca3294f21c4ed82dc17f6b18", "score": "0.5197204", "text": "function showMore () {\n\t\t\tif (self.showall = !self.showall) {\n\t\t\t\tthis.style.color = \"#000\";\n\t\t\t\tself.videoList.style.padding = \"80px 0\";\n\t\t\t} else {\n\t\t\t\tthis.style.color = null;\n\t\t\t\tself.videoList.style.padding = \"\";\n\t\t\t}\n\t\t\tself.buildList();\n\t\t}", "title": "" }, { "docid": "0bac11a30119694587edad9ae66833e9", "score": "0.5196567", "text": "function startVideo() {\n if (stream.current !== null) {\n // console.log(\"Inside Start Video\");\n stream.current.getVideoTracks()[0].enabled = true;\n }\n }", "title": "" }, { "docid": "6ad10191b66e47a79a2dac61f0962651", "score": "0.51953846", "text": "function getLatestVideo(callback, req, res) {\n var service = google.youtube('v3');\n\n channel = req.query.search;\n update_widget(req.query.id_bdd, channel);\n service.search.list({\n key: key.youtube.token,\n part: 'snippet',\n channelId: channel,\n maxResults : \"10\",\n order: \"date\",\n type: \"video\"\n }, function (err, response) {\n if (err) {\n console.log('The API returned an error:widget ' + err);\n return;\n }\n var videos = response.data.items;\n if (videos.length == 0) {\n console.log('No channel found.');\n } else {\n callback(videos, req, res)\n }\n });\n}", "title": "" }, { "docid": "d5df3325d1df5f423a8cc8be7d5b3a2d", "score": "0.5188954", "text": "get videoStream() {\n return this._videoStream;\n }", "title": "" }, { "docid": "bbe3490e7d25c131536cbb931834d722", "score": "0.5170487", "text": "function displayVideo(videoUrl) {\n\n console.log(\"CLICKED\");\n videoUrl+=\".mp4\";\n document.querySelector('#myvideo').src = \"videos/\"+videoUrl;\n document.querySelector('#myvideo').style.display = \"block\";\n document.querySelector('#myvideo').style.height = \"400px\";\n requestAnimationFrame(opacity);\n}", "title": "" }, { "docid": "6810832867c96a6abcd1ac3cd10f744f", "score": "0.51704013", "text": "playLiveStream(data) {\n console.log('Live streaming...');\n \n // Create an instance of the Player object\n var player = new Player();\n \n // Create an instance of MediaItem with the URL provided in the data\n var video = new MediaItem('video', data.videoURL);\n \n // Set title, subtitle and description\n video.title = data.title;\n video.subtitle = data.subtitle;\n video.description = data.description;\n \n // Create an instance of the Playlist object and push the MediaItem\n player.playlist = new Playlist();\n player.playlist.push(video);\n \n \n let options = {\n 'accountCode': 'haivision',\n 'content.resource': data.videoURL,\n 'content.title': 'Eastview Live Stream',\n 'content.isLive': true,\n 'background.enabled': false,\n 'extraparam.1': '2703737825',\n };\n \n youbora.pluginInstance = new youbora.Plugin(options, new youbora.adapters.AppleTV3());\n youbora.pluginInstance.getAdapter().begin();\n \n youbora.pluginInstance.getAdapter().fireStart()\n \n // Play the video\n player.play();\n }", "title": "" }, { "docid": "5d8ffbf279a7f786242bc44b8fe455bd", "score": "0.51650536", "text": "function databindVideos(json) { // debug, videos\n\t\tif (json.debug) { log('fn ' + model.config.programName + '.databindVideos'); }\n\n\t\tvar sharedWidgetType = (json.sharedWidgetType) ? json.sharedWidgetType : json.widgetType;\n\n\t\t// This will be databound 1x per C11, M2, M3 or V2 widget that's on the page.\n\t\tif ((typeof(eonline) !== 'undefined') \n\t\t&& (typeof(eonline.mWidgetsOnly.videoPlayerEngine) !== 'undefined')\n\t\t&& (typeof(eonline.widgets[sharedWidgetType]) !== 'undefined')\n\t\t&& (typeof(eonline.mWidgetsOnly.carousel) !== 'undefined') // This prevents an \"undefined\" widgetId race condition in the widgets[sharedWidgetType].js script & on the video detail page, even though it's not referenced here.\n\t\t) {\n\t\t\teonline.mWidgetsOnly.videoPlayerEngine.setData('videos.' + json.widgetIdShort, json.videos);\n\t\t\tif (typeof(eonline.widgets[sharedWidgetType].setData) !== 'undefined') {\n\t\t\t\teonline.widgets[sharedWidgetType].setData('socialMediaIcons', json.socialMediaIcons, json);\n\t\t\t\teonline.widgets[sharedWidgetType].setData('sectionType.' + json.widgetIdShort + '.className', json.sectionTypeClass);\n\t\t\t\teonline.widgets[sharedWidgetType].setData('sectionType.' + json.widgetIdShort + '.text', json.sectionTypeText);\n\t\t\t}\n\t\t\teonline.widgets[sharedWidgetType].init(json);\n\t\t} else {\n\t\t\tif (json.debug) { log('Still waiting....'); }\n\t\t\tsetTimeout(function() {\n\t\t\t\tdatabindVideos(json);\n\t\t\t}, 50);\n\t\t}\n\t}", "title": "" }, { "docid": "17d792b45e453d652c16e76a576c5eb3", "score": "0.5164915", "text": "function showVideo(id){\n $.getJSON(\"https://api.themoviedb.org/3/movie/\" + id + \"/videos?api_key=\" + api_key + \"&language=en-US\", function(data){ \n var first_video = false;\n $.each(data.results, function() {\n $('#video').html('<iframe id=\"video-size\" width=\"887\" height=\"500\" src=\"https://www.youtube.com/embed/' + this.key + '\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>')\n first_video = true;\n return (first_video !== true)\n });\n });\n}", "title": "" }, { "docid": "fa08315278ec7405c1e5b4d0071e1251", "score": "0.5157187", "text": "function fullscreenVideo(videoId) {\n var actives = activeVideos.slice();\n for (id in actives) {\n if (actives[id] !== videoId) {\n $(actives[id]).parent().hide();\n hiddenVideos.push(actives[id]);\n removeItemFromArray(activeVideos, actives[id]);\n }\n }\n\n // setTimeout(applyColumnClassesToVideo, 200);\n applyColumnClassesToVideo();\n}", "title": "" }, { "docid": "8ca901ecf986ae8794487730e8dcabdc", "score": "0.51466864", "text": "videoVisibilityChanged_() {\n if (this.loaded_) {\n this.loadedVideoVisibilityChanged_();\n }\n }", "title": "" }, { "docid": "3f5f26704b1d15392a2d355ad9565277", "score": "0.51451993", "text": "function seeAll () {\n\t\t\tobjLoop(self.videos, function (video) {\n\t\t\t\tvideo.see();\n\t\t\t});\n\t\t\tsaveList();\n\t\t}", "title": "" }, { "docid": "24fbc83c0809d907206f30ef61694644", "score": "0.513843", "text": "function show(req, res) {\n db.Video.findById(req.params.videoId, function(err, foundVideo) {\n if(err) { console.log('videosController.show error', err); }\n console.log('videosController.show responding with', foundVideo);\n res.json(foundVideo);\n });\n}", "title": "" }, { "docid": "ccfab671b2401c053f4369c592d642fc", "score": "0.513611", "text": "function showViewURL() {\r\n //if no viewer stream id is provided, path to viewer not shown.\r\n if (!!accountId) {\r\n let vTxt = document.getElementById('viewerUrl');\r\n let href = (location.href).split('?')[0];\r\n console.log('href:', href, ', indexOF ', href.indexOf('htm'), 'lastindex /', href.lastIndexOf('/'));\r\n if (href.indexOf('htm') > -1) {\r\n href = href.substring(0, href.lastIndexOf('/') + 1);\r\n }\r\n let url = yourUrl + '?account=' + accountId + '&id=' + streamName;\r\n //let url = href + 'viewer.html?accountId=' + accountId + '&streamName=' + streamName;\r\n vTxt.innerText = 'Viewer Path:\\n' + url;\r\n vTxt.setAttribute('href', url);\r\n }\r\n\r\n //disable publish button.\r\n /* let btn = document.getElementById('publishBtn');\r\n btn.innerHTML = 'BROADCASTING LIVE';\r\n btn.disabled = true; */\r\n\r\n //hide form\r\n document.getElementById('form').setAttribute(\"style\", \"display: none;\");\r\n }", "title": "" }, { "docid": "a275fa3e03aa542585cec160cdfe9170", "score": "0.5135013", "text": "function updateVisibility() {\n if (player.tech_ && player.tech_.featuresVolumeControl === false) {\n this.addClass('vjs-hidden');\n } else {\n this.removeClass('vjs-hidden');\n }\n }", "title": "" }, { "docid": "a275fa3e03aa542585cec160cdfe9170", "score": "0.5135013", "text": "function updateVisibility() {\n if (player.tech_ && player.tech_.featuresVolumeControl === false) {\n this.addClass('vjs-hidden');\n } else {\n this.removeClass('vjs-hidden');\n }\n }", "title": "" }, { "docid": "40d01281c549ec6011b0e2dbbcd128ab", "score": "0.5134547", "text": "function render_latest_video(data, req, res){\n res.render('../views/services/google/youtube/widget-latest-video', {data: data});\n}", "title": "" }, { "docid": "c7e48146f736f5d627802166ba5e2aa9", "score": "0.51302403", "text": "function updateVisibility() {\r\n if (player.tech_ && player.tech_.featuresVolumeControl === false) {\r\n this.addClass('vjs-hidden');\r\n } else {\r\n this.removeClass('vjs-hidden');\r\n }\r\n }", "title": "" }, { "docid": "2102f15fb6efc00b53e9186c103ede73", "score": "0.51244074", "text": "function renderRightVideo()\r\n{\r\n\t//Ninemsn.Global.ContentManager.GetContent(\"http://catalog.video.msn.com/videoByTag.aspx?mk=en-au&ns=MSNVideo_Top_Cat&tag=AUEOnline_AUENews&responseEncoding=json&callbackName=vidJSONCallback&cache=\" + parseInt((new Date()).getTime()/1000/60/60*10), function(){});\r\n\tinjectJSONInRightCol(\"http://edge1.catalog.video.msn.com/videoByTag.aspx?mk=en-au&ns=MSNVideo_Top_Cat&tag=AUEOnline_AUENews&responseEncoding=json&callbackName=vidJSONCallback\");\r\n}", "title": "" }, { "docid": "595e943c82eb7a375a6b2d73f021beb5", "score": "0.5122503", "text": "function startVideoPlayer( el, media ) {\n var video = document.createElement(\"video\"),\n idevice = /ip(hone|ad|od)/i.test(navigator.userAgent),\n noflash = flashembed.getVersion()[0] === 0,\n simulate = !idevice && noflash &&\n\t!!(video.canPlayType('video/mp4; codecs=\"avc1.42E01E, mp4a.40.2\"').replace(/no/, ''));\n\n $(el).flowplayer( \"/static/flowplayer/flowplayer-3.2.16.swf\", {\n\tclip: {\n\t url: 'mp4:amazons3/viblio-mediafiles/' + media.views.main.uri,\n\t ipadUrl: encodeURIComponent(media.views.main.url),\n\t // URL for sharing on FB, etc.\n\t pageUrl: site_server + '/shared/flowplayer/' + media.uuid,\n\t scaling: 'fit',\n\t provider: 'rtmp'\n\t},\n\tplugins: {\n\t rtmp: {\n\t\turl: '/static/flowplayer/flowplayer.rtmp-3.2.12.swf',\n\t\tnetConnectionUrl: 'rtmp://ec2-54-214-160-185.us-west-2.compute.amazonaws.com/vods3'\n\t },\n\t viral: {\n\t\turl: '/static/flowplayer/flowplayer.viralvideos-3.2.13.swf',\n\t\tshare: { \n\t\t description: 'Video highlight by Viblio',\n\t\t facebook: true,\n\t\t twitter: true,\n\t\t myspace: false,\n\t\t livespaces: true,\n\t\t digg: false,\n\t\t orkut: false,\n\t\t stumbleupon: false,\n\t\t bebo: false\n\t\t},\n\t\tembed: false,\n\t\temail: false\n\t }\n\t},\n\tcanvas: {\n\t backgroundColor:'#254558',\n\t backgroundGradient: [0.1, 0]\n\t}\n }).flowplayer().ipad({simulateiDevice: simulate});\n}", "title": "" }, { "docid": "d09730d24212c360644524d95d6b2051", "score": "0.5120116", "text": "function threadViewHandler() {\n if (!threadFeed) {\n changeFeed(true);\n } else {\n changeFeed(false);\n }\n }", "title": "" }, { "docid": "f08c06523e90cfac9aebe143d4123554", "score": "0.5119741", "text": "refreshPreview() {\n\t\tconst { attributes } = this.props;\n\t\tconst { categories, videosToShow } = attributes;\n\n\t\tconst basePath = '/newspack-blocks/v1/video-playlist';\n\t\tconst path = addQueryArgs( basePath, {\n\t\t\tcategories,\n\t\t\tvideosToShow,\n\t\t} );\n\n\t\tthis.setState( { isLoading: true }, () => {\n\t\t\tapiFetch( {\n\t\t\t\tpath,\n\t\t\t} )\n\t\t\t\t.then( response => {\n\t\t\t\t\tconst { html } = response;\n\t\t\t\t\tthis.setState( {\n\t\t\t\t\t\tembed: html,\n\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t} );\n\t\t\t\t} )\n\t\t\t\t.catch( error => {\n\t\t\t\t\tthis.setState( {\n\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t\terror: error.message,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t} );\n\t}", "title": "" }, { "docid": "3d56fec6f68017e025988b6366aabd82", "score": "0.5106303", "text": "function videoInfo(seriesCallback) {\n seriesCallback(null, {\n videoData: [\"vid1\", \"vid2\", \"vid3\"]\n });\n}", "title": "" }, { "docid": "6ac83d368131919d8e54f8a78d8ba952", "score": "0.5098231", "text": "get video() {\n if (this.isVideo) {\n return this.message.video;\n }\n\n return null;\n }", "title": "" }, { "docid": "a60294c317cd65d677cadb04cf2b609e", "score": "0.508469", "text": "function getVideo(callback, req, res) {\n var service = google.youtube('v3');\n video = req.query.search;\n update_widget(req.query.id_bdd, video);\n service.videos.list({\n key: key.youtube.token,\n part: 'snippet,contentDetails,statistics,status',\n id: video,\n }, function (err, response) {\n if (err) {\n console.log('The API returned an error:widget ' + err);\n return;\n }\n var channels = response.data.items;\n if (channels.length == 0) {\n console.log('No channel found.');\n } else {\n callback(channels[0], req, res)\n }\n });\n}", "title": "" }, { "docid": "e9b03b4c35e487295a4471c6f6990214", "score": "0.5084642", "text": "function getVideos(url, playlist, callback){\n\t\t$.getJSON(url, function(data){\n\t\t\t$.each(data.feed.entry, function(i, item){\n\t\t\t\tvar entry = {};\n\t\t\t\t\n\t\t\t\t//containing playlist\n\t\t\t\tentry.playlist = playlist;\n\t\t\t\t\n\t\t\t\t//id\n\t\t\t\tentry.id = item.media$group.yt$videoid.$t;\n\t\t\t\t\n\t\t\t\t//title\n\t\t\t\tentry.title = item.title.$t;\n\t\t\t\t\n\t\t\t\t//thumbnail\n\t\t\t\tif (item.media$group && item.media$group.media$thumbnail){\n\t\t\t\t\tentry.thumb = item.media$group.media$thumbnail[0].url;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tentry.thumb = \"images/fallback_thumb.jpg\";\n\t\t\t\t}\n\n\t\t\t\t//category of video\n\t\t\t\tif (item.category[1] && item.category[1].term){\n\t\t\t\t\tentry.category = item.category[1].term;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tentry.category = \"-\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//duration in minutes\n\t\t\t\tif (item.media$group && item.media$group.yt$duration){\n\t\t\t\t\tvar seconds = item.media$group.yt$duration.seconds;\n\t\t\t\t\tvar min = Math.floor(seconds / 60); \n\t\t\t\t\tvar remSec = (seconds % 60);\n\t\t\t\t\tif (remSec===0){ \n\t\t\t\t\t\tentry.duration = min + \":00\";\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tentry.duration = min + \":\" + remSec;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tentry.duration = \"-\";\n\t\t\t\t}\n\n\t\t\t\t//number of views\n\t\t\t\tif (item.yt$statistics && item.yt$statistics.viewCount){\n\t\t\t\t\tentry.views = item.yt$statistics.viewCount;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tentry.views = \"-\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//ratings and likes\n\t\t\t\tif (item.yt$rating && item.yt$rating.numLikes){\n\t\t\t\t\tentry.likes = item.yt$rating.numLikes;\n\t\t\t\t\tentry.dislikes = item.yt$rating.numDislikes;\n\t\t\t\t\tentry.average = Math.floor(entry.likes / entry.dislikes);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tentry.likes = \"-\";\n\t\t\t\t\tentry.dislikes = \"-\";\n\t\t\t\t\tentry.average = \"-\";\n\t\t\t\t}\n\n\t\t\t\tcallback(entry);\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "18558ac2161c4ff284d0192c2816e3ef", "score": "0.5068553", "text": "function onVideoStopped() {\n streaming = false;\n button.innerText = 'Start Video';\n\n // stop the timer\n clearInterval(refreshIntervalId);\n}", "title": "" }, { "docid": "00fccd34ec5db36f2afc206edb371c97", "score": "0.5065516", "text": "function videoInit() {\n // Subscribe camera count\n CrComLib.subscribeState('n', CAMERA_LIST, function (noOfCameras) {\n previousItemsCount < noOfCameras ? addSubscriptions(previousItemsCount, noOfCameras) : removeSubscriptions(previousItemsCount, noOfCameras);\n previousItemsCount = noOfCameras;\n });\n\n // Add click listener for the video list\n addClickListeners();\n }", "title": "" }, { "docid": "b9e42e53911d3256f03f0e341240cf06", "score": "0.5063614", "text": "function searchLiveVideos(status, category_id, callback, maxResults) {\n if (arguments.length == 2) {\n callback = printToConsole;\n maxResults = 25;\n } else if (arguments.length == 3) {\n maxResults = 25;\n }\n var SEARCH_URL = YOUTUBE_BASE_URL + 'search/';\n var query = {\n key: 'AIzaSyCtbQ7eOypMc7OKBSGFs46aIL6Ozmmeygw',\n part: 'snippet',\n type: 'video',\n eventType: status, // completed,live,upcoming\n // order: 'viewCount',\n maxResults: maxResults\n };\n // ;\n if (category_id != 'all') {\n query.videoCategoryId = category_id;\n }\n $.getJSON(SEARCH_URL, query, callback);\n}", "title": "" }, { "docid": "7f6cd2b4fabb1b293f0ba95e20982c21", "score": "0.50602096", "text": "function HDYV_ProcessPlaylistVerticalView()\r\n{\r\n\tvar bEditMode = window.location.search.indexOf(\"action_edit=1\") >= 0;\r\n\r\n\tvar strLiNodeXPath = \"//div[@id='gh-activityfeed']/ol//li[not(.//p[@class='video-details'])]\";\r\n\tif (bEditMode)\r\n\t\tstrLiNodeXPath = \"//ol[@id='playlist-video-items']/li[not(.//p[@class='video-details'])]\";\r\n\r\n\r\n\t// Reset internal data\r\n\tHDYV_m_listBrokenURLs = new Array();\r\n\r\n\t// Extract deleted videos\r\n\tvar liNodes = document.evaluate(strLiNodeXPath, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n\tfor(var i=0; i<liNodes.snapshotLength; i++)\r\n\t{\r\n\t\t// Deleted item\r\n\t\tvar liNode = liNodes.snapshotItem(i);\r\n\r\n\t\t// Extract all <a> tags to fix them\r\n\t\t//var strVideoID = \"\";\r\n\t\tvar strTitle = \"\";\r\n\t\tvar strType = \"\";\r\n\t\tvar bMissingData = false;\r\n\t\tvar aNodes = document.evaluate(\".//a\", liNode, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n\t\tfor(var j=0; j<aNodes.snapshotLength; j++)\r\n\t\t{\r\n\t\t\tvar aNode = aNodes.snapshotItem(j);\r\n\r\n\t\t\t// Extract Video ID\r\n\t\t\tif (j == 0)\r\n\t\t\t{\r\n\t\t\t\tvar strVideoLink = aNode.href;\r\n\t\t\t\tstrVideoLink = HDYV_ExtractVideoLink(strVideoLink);\r\n\t\t\t\tif (strVideoLink == \"\")\r\n\t\t\t\t{\r\n\t\t\t\t\tbMissingData = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstrTitle = aNode.getAttribute(\"title\");\r\n\t\t\t\tstrType = strTitle;\r\n\t\t\t\tif (strTitle == \"\")\r\n\t\t\t\t{\r\n\t\t\t\t\tbMissingData = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tstrTitle += \" : click to retrieve the original name of this video (opens a new tab)\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Change Title\r\n\t\t\t\tvar spanNode = document.evaluate(\"./span\", aNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\r\n\t\t\t\tif (!spanNode)\r\n\t\t\t\t{\r\n\t\t\t\t\tbMissingData = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tspanNode.childNodes[0].nodeValue = strVideoLink;\r\n\t\t\t}\r\n\r\n\t\t\t// Remove tooltip and href links...\r\n\t\t\taNode.removeAttribute(\"title\");\r\n\t\t\taNode.removeAttribute(\"href\");\r\n\r\n\r\n\t\t}\r\n\t\tif (bMissingData)\r\n\t\t\tcontinue;\r\n\r\n/*\r\n\t\t// ... and add attributes on the parent item\r\n\t\tliNode.setAttribute(\"title\", strTitle);\r\n\t\tliNode.setAttribute(\"style\", \"background-color: #FFCCCC\");\r\n\r\n\t\t// Finally, move the main item under an <a> tab to add the link to Google Search\r\n\t\tvar newANode = document.createElement(\"a\");\r\n\t\tvar strVideoID = HDYV_ExtractVideoID(strVideoLink);\r\n\t\tnewANode.setAttribute(\"href\", HDYV_m_strSearchURL + strVideoID);\r\n\t\tnewANode.setAttribute(\"target\", \"_blank\");\r\n\t\tvar parentNode = liNode.parentNode;\r\n\t\tparentNode.insertBefore(newANode, parentNode.childNodes[HDYV_m_listBrokenURLs.length]);\r\n\t\tparentNode.removeChild(liNode);\r\n\t\tnewANode.appendChild(liNode);\r\n\r\n\t\t// Store the Video ID to be looked for\r\n\t\tHDYV_m_listBrokenURLs.push(strVideoID);\r\n*/\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t\t\t\t// ... and add the color attribute on the parent item\r\n\t\t\t\t\t\tvar strVideoIDOnly = HDYV_ExtractVideoIDOnly(strVideoLink);\r\n\t\t\t\t\t\tvar strColor = \"#FFCCCC\";\r\n\t\t\t\t\t\tvar strThumbnail = \"; background-image:url('http://i.ytimg.com/vi/\" + strVideoIDOnly + \"/default.jpg'); background-repeat:no-repeat; background-position:right;\";\r\n\t\t\t\t\t\t//if (secondaryArea)\r\n\t\t\t\t\t\t//\tstrColor = \"#FFD8D8\";\r\n\t\t\t\t\t\tif ((strType == strLangBG2) || (strType == strLangHR2) || (strType == strLangCS2) || (strType == strLangEN2) || (strType == strLangDA2) || (strType == strLangNL2) || (strType == strLangFI2) || (strType == strLangFR2) || (strType == strLangDE2) || (strType == strLangEL2) || (strType == strLangHU2) || (strType == strLangIT2) || (strType == strLangJA2) || (strType == strLangKO2) || (strType == strLangLV2) || (strType == strLangLT2) || (strType == strLangNO2) || (strType == strLangPL2) || (strType == strLangPT2) || (strType == strLangRO2) || (strType == strLangRU2) || (strType == strLangSR2) || (strType == strLangSK2) || (strType == strLangSL2) || (strType == strLangES2) || (strType == strLangSV2) || (strType == strLangUK2))\r\n\t\t\t\t\t\t liNode.setAttribute(\"style\", \"background-color: \" + strColor + strThumbnail);\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t liNode.setAttribute(\"style\", \"background-color: \" + strColor);\r\n\t\t\t\t\t\t//if (secondaryArea && secondaryArea.children.length > 0)\r\n\t\t\t\t\t\t//\tsecondaryArea.children[0].setAttribute(\"style\", \"background: none; background-color: \" + strColor + \"; border-left-color: \" + strColor);\r\n\r\n\t\t\t\t\t\t// Sorting out the unavailable videos at the top of the list\r\n\t\t\t\t\t\tvar parentNode = liNode.parentNode;\r\n\t\t\t\t\t\tparentNode.removeChild(liNode);\r\n\t\t\t\t\t\tparentNode.insertBefore(liNode, parentNode.childNodes[HDYV_m_listBrokenURLs.length]);\r\n\r\n\t\t\t\t\t\t// Then add a link to the Google Search\r\n\t\t\t\t\t\tvar newANode = document.createElement(\"a\");\r\n\t\t\t\t\t\tvar strVideoID = HDYV_ExtractVideoID(strVideoLink);\r\n\t\t\t\t\t\tnewANode.setAttribute(\"href\", HDYV_m_strSearchURL + strVideoID);\r\n\t\t\t\t\t\tnewANode.setAttribute(\"target\", \"_blank\");\r\n\t\t\t\t\t\tnewANode.setAttribute(\"title\", strTitle);\r\n\r\n\t\t\t\t\t\t// But into a new <span> element around the thumbnail and video details to customize it\r\n\t\t\t\t\t\t// without hiding the chekbox behaviour\r\n\t\t\t\t\t\tvar wrappingNode = document.createElement(\"span\");\r\n\t\t\t\t\t\tnewANode.appendChild(wrappingNode);\r\n\r\n\t\t\t\t\t\t// Move the thumbnail and following markups into this new wrapper element\r\n\t\t\t\t\t\t//var nodesToMove = document.evaluate(\".//div[@class='vm-thumb'] | .//div[@class='vm-thumb']/following-sibling::node()\", liNode, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); // If someone has an idea about how to simplify this expression, please contact me :)\r\n\t\t\t\t\t\tvar nodesToMove = document.evaluate(\".//div[contains(@class, 'playlist-video-item-base-content')] | .//div[contains(@class, 'playlist-video-item-base-content')]/following-sibling::node()\", liNode, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); // If someone has an idea about how to simplify this expression, please contact me :)\r\n\t\t\t\t\t\tfor(var j=0; j<nodesToMove.snapshotLength; j++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Node to move into the wrapping node\r\n\t\t\t\t\t\t\tvar nodeToMove = nodesToMove.snapshotItem(j);\r\n\r\n/*\r\n\t\t\t\t\t\t\t// Check if the video contains infos\r\n\t\t\t\t\t\t\tvar nodesVideoInfos = document.evaluate(\".[name()='DIV' and contains(@class, 'vm-video-info-container')]/*\", nodeToMove, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n\t\t\t\t\t\t\tif (nodesVideoInfos.snapshotLength == 1)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t// Add blank items to spread the div height in the parent's area\r\n\t\t\t\t\t\t\t\tvar dummySpanNode = document.createElement(\"span\");\r\n\t\t\t\t\t\t\t\tdummySpanNode.setAttribute(\"class\", \"vm-video-info\");\r\n\t\t\t\t\t\t\t\tdummySpanNode.appendChild(document.createTextNode(\" \"));\r\n\t\t\t\t\t\t\t\tnodeToMove.appendChild(dummySpanNode);\r\n\t\t\t\t\t\t\t\tnodeToMove.appendChild(dummySpanNode.cloneNode());\r\n\t\t\t\t\t\t\t\tnodeToMove.appendChild(dummySpanNode.cloneNode());\r\n\t\t\t\t\t\t\t}\r\n*/\r\n\r\n\t\t\t\t\t\t\tparentNode = nodeToMove.parentNode;\r\n\t\t\t\t\t\t\tparentNode.removeChild(nodeToMove);\r\n\t\t\t\t\t\t\twrappingNode.appendChild(nodeToMove);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tparentNode.appendChild(newANode);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Store the Video ID to be looked for\r\n\t\t\t\t\t\tHDYV_m_listBrokenURLs.push(strVideoID);\r\n\r\n\r\n\r\n\r\n\r\n\t}\r\n\r\n\r\n\t// Add the button if needed only\r\n\tif (HDYV_m_listBrokenURLs.length > 0)\r\n\t{\r\n\t\tvar strDivNodeXPath = \"//div[contains(@class, 'playlist-actions')]\";\r\n\t\tif (bEditMode)\r\n\t\t\tstrDivNodeXPath = \"//div[@class='playlist-actions']\";\r\n\t\tvar buttonsArea = document.evaluate(strDivNodeXPath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\r\n\t\tif (!buttonsArea)\r\n\t\t\treturn false;\r\n\t\tHDYV_CreateSearchAllButton(buttonsArea, false);\r\n\t}\r\n\r\n\treturn true;\r\n}", "title": "" }, { "docid": "341bb366cb0e8b544629d97092d40cff", "score": "0.50588185", "text": "function videoShow() {\n\n $(\"#videoContainer\").hide()\n\n $(\".vg-general-button\").click(function () {\n let videoLink = this.value;\n $(\"#videoPlayer\").html(`\n <iframe src=\"${videoLink}\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" id=\"videoContent\" allowfullscreen></iframe>\n `);\n\n $(\"#videoContainer\").show()\n });\n\n $(\"#videoCloseButton\").click(function () {\n //code from https://stackoverflow.com/a/9040667\n let video = $(\"#videoContent\").attr(\"src\");\n $(\"#videoContent\").attr(\"src\", \"\");\n $(\"#videoContent\").attr(\"src\", video);\n $(\"#videoContainer\").hide()\n })\n}", "title": "" }, { "docid": "778f9d1599cb0d67a2f5c8756fd8bb2b", "score": "0.50579435", "text": "showSharedVideoButton () {\n if (UIUtil.isButtonEnabled('sharedvideo')\n && config.disableThirdPartyRequests !== true) {\n $('#toolbar_button_sharedvideo').css({display: \"inline-block\"});\n } else {\n $('#toolbar_button_sharedvideo').css({display: \"none\"});\n }\n }", "title": "" }, { "docid": "b2ae3fef909c9b4184671ada667c0aa1", "score": "0.5054777", "text": "function fullScreenMode() {\n video.requestFullscreen();\n }", "title": "" }, { "docid": "e96da55ee62fa0619fbd2c77608cf9f5", "score": "0.50481606", "text": "function viewerTvShows(dataViewer) {\n let { age, country, likeSports } = dataViewer;\n\n let message = {\n ufc: \"UFC.\",\n simpsons: \"The Simpsons.\",\n madagascar: \"The Penguins of Madagascar.\",\n fishing: \"Sport Fishing.\",\n notFound: \"Não foi possível dizer o que ela deve assistir.\",\n };\n\n let checkCountry = {\n brasil: country.toUpperCase() === \"BRASIL\",\n chile: country.toUpperCase() === \"CHILE\",\n };\n\n if (age >= 16 && checkCountry.brasil) {\n if (likeSports) return message.ufc;\n return message.simpsons;\n }\n\n if (age < 16) {\n if (checkCountry.chile && !likeSports) return message.madagascar;\n if (!checkCountry.chile && likeSports) return message.fishing;\n }\n\n return message.notFound;\n}", "title": "" }, { "docid": "26c5422f9e30955dec813c44ee69f521", "score": "0.504039", "text": "function viewVideos(videoJSON){\n // if there is a videoJSON or if its not empty or undefined\n if(videoJSON != null && videoJSON != {} && videoJSON != undefined){\n //total number of videos\n var totalNumberOfVideos = Object.keys(videoJSON).length;\n // template string to add the videos\n var videoHtml = ``;\n // If there are videos present in the videoJSON\n if(totalNumberOfVideos){\n //html content to be appended in html file\n videoHtml = `<div class=\"row ml-2\">`;\n\n $.each(videoJSON, function(videoKeyName, video){\n var videoIndex = parseInt(videoKeyName.replace('video',''));\n var videoSrc = video.url;\n\n videoHtml = `${videoHtml}<div class=\"card col-lg-3 border-primary\" style=\"padding:10px;\">\n <video style=\"max-width:100%;\" controls>\n <source src=\"${videoSrc}\">\n </video>\n </div>\n <div class=\"col-lg-1\"></div>`;\n\n if(videoIndex % 3 == 0){\n videoHtml = `${videoHtml}</div>`;\n\n if(videoIndex < totalNumberOfVideos){\n videoHtml = `${videoHtml}<br> <div class=\"row ml-2\">`;\n }\n }\n })\n }\n // If there are no videos uploaded\n else{\n videoHtml = `<h3>No Videos.</h3>`\n }\n // Appending the template literal to the videos section\n $(\"#videos-section\").html(videoHtml);\n }\n // if there are no videos\n else {\n $(\"#videos-section\").append(`<h3>No Videos.</h3>`);\n }\n}", "title": "" }, { "docid": "3b067a8fa7c5871ee0b9d17ad1a64c36", "score": "0.5039762", "text": "onVideoCanPlay() {\n sensorCamera.video.play();\n requestAnimationFrame(sensorCamera.renderFrame);\n }", "title": "" }, { "docid": "458d41c03e27216d6ff752269a329b13", "score": "0.5034026", "text": "filter(filter){\n// console.log(\"FILTER VIDEO\")\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(this),\n ProcessingUIVideoPlayer.Commands.filterVideo,\n [filter]\n )\n }", "title": "" }, { "docid": "307962f01e398d5cbb70306eb1cbfca2", "score": "0.5031186", "text": "function unFullscreenVideo() {\n\n for (id in hiddenVideos) {\n activeVideos.push(hiddenVideos[id]);\n }\n hiddenVideos = [];\n\n $('video').parent().show();\n // setTimeout(applyColumnClassesToVideo, 200);\n applyColumnClassesToVideo();\n}", "title": "" }, { "docid": "95aa0d5993046b4cc95ce271f28f56e4", "score": "0.5030671", "text": "function runVideo( URL, isExternal )\n {\n leaveVideo();\n if( isExternal ) {\n runExternal(URL);\n } else {\n runInternal(URL);\n }\n }", "title": "" }, { "docid": "fd29a9fa7ca8855f835b27f1f3aef383", "score": "0.5029688", "text": "function onVideoStarted() {\n streaming = true;\n button.innerText = 'Stop Video';\n\n // start the timer\n refreshIntervalId = setInterval('clusterVideo();', 50);\n}", "title": "" }, { "docid": "9cc24ac7b7ba3cce280b9541abd5f219", "score": "0.502643", "text": "function cbcdisplayfeed(result) {\n if (!result.error) {\n var thefeeds = result.feed.entries;\n for (var i = 0; i < thefeeds.length; i++)\n CBC.rssoutput += \"<li><a href='\" + thefeeds[i].link + \"'>\" + thefeeds[i].title + \"</a></li>\";\n CBC.rssoutput += \"</ul>\";\n CBC.feedcontainer.innerHTML = CBC.rssoutput;\n } else\n alert(\"Error fetching feeds!\");\n}", "title": "" }, { "docid": "3cb5878e0e45e8b1b08e7a95cd3b766f", "score": "0.5024844", "text": "function hideVideo(){\n\t\t$('#div-video').addClass(\"hidden\");\n\t}", "title": "" }, { "docid": "b972cf1b786f2260f96c0feac5877b67", "score": "0.50229585", "text": "function video(divBlock,idVideo, itemVideo = 0) {\n divBlock.innerHTML='<iframe src=\"https://www.youtube.com/embed/'+idVideo[itemVideo]+'\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>'\n }", "title": "" }, { "docid": "3ffa399100c780de38a5a2d0ca6c0635", "score": "0.50218374", "text": "function selectVideoFromList(videoId) {\n videoID = videoId;\n if (player) {\n player.loadVideoById(videoId);\n }\n displayVideo();\n launchVideo();\n document.getElementById(\"forcecentered\").style.display = \"none\";\n document.getElementById(\"exit\").style.display = \"none\";\n}", "title": "" }, { "docid": "07174240446432112f229553b7a443a1", "score": "0.50172985", "text": "function chooseVideo(){\n player.loadVideoById(data.id.videoId);\n window.postMessage({videoId:data.id.videoId},\"*\");\n }", "title": "" }, { "docid": "889d98322ef7b412d7d42c885ac5ab0d", "score": "0.5016522", "text": "function applyVideoBox() {\n\t\t\t\t$('.video-link').fancybox({\n\t\t\t\t\t'frameWidth': 640,\n\t\t\t\t\t'frameHeight': 385,\n\t\t\t\t\t'hideOnContentClick': false,\n\t\t\t\t\t'centerOnScroll': true,\n\t\t\t\t\t'imageScale': true,\n\t\t\t\t\t'padding': 5\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "ea299bcd5c94fbad244ad2e516ae1e7e", "score": "0.5016005", "text": "function startVideo () {\n const video = document.createElement('video')\n\n video.src = getRandomArrayEntry(VIDEOS)\n video.autoplay = true\n video.loop = true\n video.style = 'width: 100%; height: 100%;'\n\n document.body.appendChild(video)\n}", "title": "" }, { "docid": "eaab0947d5d7a8d5e37fa10566e770de", "score": "0.50140184", "text": "function videoTracks(){\n\tvar track = v.textTracks[0];\n\t\n\ttrack.mode = \"showing\";\n}", "title": "" }, { "docid": "5106af62747ee93982c0c1c2b652391f", "score": "0.5010423", "text": "function liveVideoHandler(category_id) {\n searchLiveVideos('live', category_id, function (resp) {\n state.search_results = resp;\n resetPageNumber();\n displayResults(resp);\n }, 50);\n}", "title": "" }, { "docid": "528dd843946ce40a5fed5578eac681eb", "score": "0.5005252", "text": "showSharedVideoButton () {\n let id = 'toolbar_button_sharedvideo';\n let shouldShow = UIUtil.isButtonEnabled('sharedvideo')\n && !config.disableThirdPartyRequests;\n\n if (shouldShow) {\n let el = document.getElementById(id);\n UIUtil.setTooltip(el, 'toolbar.sharedvideo', 'right');\n }\n UIUtil.setVisible(id, shouldShow);\n }", "title": "" }, { "docid": "d71e6af86ecf78342e437751f42727c7", "score": "0.50009036", "text": "function popUpVideoConsole(url) {\n var detWindow=\"\";\n detWindow=window.open(url,'videoConsole','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,width=1050,height=723');\n }", "title": "" }, { "docid": "ab82965f638a99e1961b4b5ce29982ae", "score": "0.49929088", "text": "function startVideo() {\n navigator.getUserMedia(\n {video: {}},\n stream => video.srcObject = stream,\n err => console.error(err)\n )\n}", "title": "" }, { "docid": "a4d0c5f834a1a5f05aded57f6333ab91", "score": "0.4988372", "text": "function getStream() {\n return videoStream;\n}", "title": "" }, { "docid": "adce0066a0014771ddb27fe6414ae938", "score": "0.49848604", "text": "function showVideo(id) {\n\n if(media == null || media[id] == null) {\n console.log(\"Variable media was not loaded upon calling showVideos()\");\n return;\n }\n\n // Find the video data box and fill it\n $('#' + descriptionId)\n // Add title\n .html(`<h3 class=\"custom-media-title\">${media[id].title}</h3>\n <a href=\"${media[id].drive}\" class=\"custom-media-link\" target=\"_blank\">\n <span class=\"fa fa-link\" aria-hidden=\"true\"></span>\n </a>`)\n // And the description\n .append(media[id].description);\n\n // Find the thumbnails at the bottom, and on each of them...\n $('#' + thumbnailsId).children().each(function(i) {\n // ... if they're the clicked one, add selected class\n if(i == id){\n $(this).addClass(selectedClass);\n // ... otherwise, remove it\n } else {\n $(this).removeClass(selectedClass);\n }\n });\n\n // Finally, change the source of the shown media to the clicked one\n $('#' + playerId).attr('src', media[id].url);\n\n} // showVideo(id)", "title": "" }, { "docid": "ba05d6d41a30247b1e73f52f034bceab", "score": "0.49762908", "text": "function showViewURL() {\r\n //if no viewer stream id is provided, path to viewer not shown.\r\n if (!!accountId) {\r\n let vTxt = document.getElementById('viewerUrl');\r\n let href = (location.href).split('?')[0];\r\n console.log('href:', href, ', indexOF ', href.indexOf('htm'), 'lastindex /', href.lastIndexOf('/'));\r\n if (href.indexOf('htm') > -1) {\r\n href = href.substring(0, href.lastIndexOf('/') + 1);\r\n }\r\n let url = href + 'player/?accountId=' + accountId + '&streamName=' + streamName;\r\n vTxt.innerText = 'Viewer Path:\\n' + url;\r\n vTxt.setAttribute('href', url);\r\n }\r\n\r\n}", "title": "" }, { "docid": "03dc4483bae7359fc61f9c50c7a350d9", "score": "0.4973697", "text": "keep_hd_video() {\n\n\t\tif (this.chat.context.get('smokemotes.keep_hd_video')) {\n\n\t\t\ttry {\n\t\t\t\tObject.defineProperty(document, 'hidden', { value: false, writable: false });\n\t\t\t} catch (err) {\n\t\t\t\tthis.log.warn('Unable to install document visibility hook.', err);\n\t\t\t}\n\n\t\t} else {\n\n\t\t\ttry {\n\t\t\t\tObject.defineProperty(document, 'hidden', { value: false, writable: true });\n\t\t\t} catch (err) {\n\t\t\t\tthis.log.warn('Unable to install document visibility hook.', err);\n\t\t\t}\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "bf52f81052603bad4adc5dc40131b519", "score": "0.4973475", "text": "render() {\n return (\n <aside className='next-video'>\n <div className='next-video__image-wrapper'> {/**Start of video image wrapper */}\n <img src={this.props.image} className='next-video__image' alt='Thumbnail of the video'/>\n </div> {/**End of video image wrapper */}\n <div className='next-video__info-wrapper'> {/**Start of video info wrapper */}\n <div className='next-video__title-container'> {/** Container for the title to display only two lines of the title when in mobile */}\n <h3 className='next-video__title'>{this.props.title}</h3>\n </div> {/**End of video title container */}\n <p className='next-video__channel'>{this.props.channel}</p>\n </div> {/**End of video info wrapper */}\n </aside>\n );\n }", "title": "" }, { "docid": "ec360bbd4d7ab3e085eece0fd4a0f7aa", "score": "0.49704564", "text": "function Receiver() {\n const { callAccepted } = useContext(SocketContext);\n const { otherStreamRef } = useContext(StreamContext);\n\n let PartnerVideo;\n if (callAccepted) {\n PartnerVideo = (\n <Video\n aria-label=\"receiver-video\"\n id=\"partner-video\"\n playsInline\n ref={otherStreamRef}\n autoPlay\n />\n );\n }\n\n return <>{PartnerVideo}</>;\n}", "title": "" }, { "docid": "98aa1c8e90ead1adcd8daae4b7f0f51b", "score": "0.4969091", "text": "function show_data_on_screen() {\n window.setTimeout(function () {\n track1 = window.player.getVideoTracks()[0];\n vid1_data.innerHTML = track1.width + \"x\" + track1.height + \", Active:\" + track1.active;\n track2 = window.player.getVideoTracks()[1];\n vid2_data.innerHTML = track2.width + \"x\" + track2.height + \", Active:\" + track2.active;\n track3 = window.player.getVideoTracks()[2];\n vid3_data.innerHTML = track3.width + \"x\" + track3.height + \", Active:\" + track3.active;\n show_data_on_screen();\n }, 1000)\n }", "title": "" }, { "docid": "10bbe15dc86dc6b12c901023fcab0db0", "score": "0.49596617", "text": "function getVideo() {\n // Ask for webcam permission\n navigator\n .mediaDevices\n .getUserMedia({ video: true, audio: false })\n .then((localMediaStream) => {\n // Send stream to video player\n video.srcObject = localMediaStream;\n video.play();\n // When fully loaded, store dimensions and send to canvas\n video.onloadedmetadata = () => paintToCanvas();\n })\n .catch((err) => {\n console.error(err);\n strip.innerHTML = 'Webcam permission required.';\n });\n}", "title": "" }, { "docid": "39fcaddab92fcef4da9b4b1471246d62", "score": "0.49586347", "text": "function displayResult(videoSnippet) {\r\n \"use strict\";\r\n var videoId = videoSnippet.resourceId.videoId,\r\n videoURL = videoId,\r\n info = \"\";\r\n if (center) {\r\n info = anchor;\r\n } else {\r\n info = left;\r\n }\r\n info += videoURL + frameEnd;\r\n if (!center) {\r\n info += leftEnd;\r\n }\r\n info += '\\n';\r\n list[i] = info;\r\n videoList[i] = videoURL;\r\n i++;\r\n}", "title": "" } ]
da6c89b80482a34455d46192934b385f
console.log(buscarPosicion("a")); ///////////// Ejercicio 3
[ { "docid": "0d1e6ed61b938e64a1708aba968450a2", "score": "0.0", "text": "function obtenerPrecioConIva(precio){\r\n iva = precio * 0.19;\r\n precio = precio + iva;\r\n return precio;\r\n}", "title": "" } ]
[ { "docid": "8899795ba52e51c9470550f66b338bb8", "score": "0.7208335", "text": "function pozdravi(a){\n console.log(\"Dobro dosli,\" + \" \" + a)\n}", "title": "" }, { "docid": "0fbbfee4c10c5bb609d9f0a257a77e82", "score": "0.68732965", "text": "function valoracion(valor) {\r\n console.log(valor);\r\n}", "title": "" }, { "docid": "a7ef2931edf2160963b378ac20615cdc", "score": "0.66736764", "text": "function marco(){\n//returns \"polo\"\n return \"polo\"\n}", "title": "" }, { "docid": "c5696e4462afb2aed1f079e3cd2e2fef", "score": "0.6645796", "text": "function unaFuncionQueDevuelveValor () {\r\n console.log('Cuatro');\r\n return 19;\r\n console.log('Cinco');\r\n console.log('Seis');\r\n return 'La funcion ha retornado una cadena de texto';\r\n}", "title": "" }, { "docid": "3aebb35dee3a6183f26f25be25c9d937", "score": "0.6643402", "text": "function somar(a, b) {\n //código\n let numero = 32;\n console.log('Estou somando...');\n console.log(numero);\n return a + b;\n}", "title": "" }, { "docid": "e0296f7238355413b3e3e5a47d398f21", "score": "0.6556855", "text": "function estoEsUnaFuncion() {\n\tconsole.log(\"uno\");\n\tconsole.log(\"dos\");\n\tconsole.log(\"tres\");\n}", "title": "" }, { "docid": "5df0979dab37cdb8f8461fe7174ae26d", "score": "0.6549291", "text": "function decirHola(nombrecito){ //nombrecito es el parametro\r\n console.log(`Hola, mi nombre es ${nombrecito}`); // acá aun sigue vacio\r\n}", "title": "" }, { "docid": "a9f42a8f1f94a2619e16e98e9a4e0bfc", "score": "0.65463525", "text": "function estoEsUnaFuncion () {\r\n console.log('Uno');\r\n console.log('Dos');\r\n console.log('Tres');\r\n}", "title": "" }, { "docid": "897fce6b88691c955ef2244344b173c0", "score": "0.650094", "text": "function funcionQueDevuelveValor() {\n console.log('uno');\n return 1;\n console.log('dos');\n console.log('tres');\n return 'La funcion ha retornado una cadena de texto';\n}", "title": "" }, { "docid": "28f84dbe278448c73914edaf0bf8a9f4", "score": "0.6466121", "text": "function nombre(nombre){\n saludo();\n}", "title": "" }, { "docid": "c38950737520c61008e092eec5137f08", "score": "0.6454147", "text": "function estoEsUnaFuncion() {\n console.log(\"uno\");\n console.log(\"dos\");\n console.log(\"tres\");\n}", "title": "" }, { "docid": "b8d95f5ecb76c98198244918ce6c5cc4", "score": "0.64477223", "text": "function CercarCaracter()\r\n{\r\n for (i=0; i<cadenadeLetras.length; i++)\r\n { if (cadenadeLetras.charAt(posicionCadena)==\"a\") \r\n {\r\n resultado[posicionCaracter] = posicionCadena+1;\r\n posicionCaracter++;\r\n \r\n } \r\n posicionCadena++\r\n } \r\n if (resultado == 0) \r\n {\r\n resultado.toString();\r\n resultado = \" No se ha encontrado ninguna letra A en su frase frase\"; \r\n }\r\n return resultado;\r\n}", "title": "" }, { "docid": "300551c72c769209922a23f4a80b48c3", "score": "0.6403325", "text": "function SaludoMensaje() {\n console.log('que hace caesa??');\n}", "title": "" }, { "docid": "94ea3dfab36dc1e1d8f9fb9dbd835628", "score": "0.6375955", "text": "function nombreFuncion(){\n //CODIGO\n}", "title": "" }, { "docid": "2d8724420f2db8ec72728c6c8314a20b", "score": "0.6370981", "text": "function ispis(poruka){\n console.log(`Element niza je: ${poruka}`);\n}", "title": "" }, { "docid": "f2fc66bcbe29c35ea9ba35117e3e43d3", "score": "0.6368861", "text": "function printMetinisPajamuDydis(a){\n\n console.log(\"Atlyginimas yra: \" + a);\n}", "title": "" }, { "docid": "1e2d0fc91309fa5fc18d76fad2c53e75", "score": "0.6354195", "text": "function obtener_casilla(pos){\n\tvar partes=pos.split(',');\n\tvar fin=obtener_casillero(partes[0],partes[1]);\n\treturn fin;\n}", "title": "" }, { "docid": "c33da33bd5550f84b2016a7bca7b8300", "score": "0.6353959", "text": "function Saludar(saludo) {\n console.log(\"Hola, \" + saludo);\n}", "title": "" }, { "docid": "3ea13d5de4e44ca9af1998993785bbc2", "score": "0.6342982", "text": "function teste() {\n var oi = 'Oi mundo!';\n\n console.log(oi);\n}", "title": "" }, { "docid": "e24125409985591490166ac5ea0b7a8a", "score": "0.6342495", "text": "function saludo (nombre = 'desconocido', edad = '0') {\r\n console.log(`Hola mi nombre es ${nombre} y tengo ${edad} años.` );\r\n}", "title": "" }, { "docid": "c040ad6d03a5f0abec36a60ae140c6b2", "score": "0.6277209", "text": "function duasVezesNoEscopo(){\n var nome = \"marcos\"\n var nome = \"fernando\"\n\n console.log(nome, nome)\n }", "title": "" }, { "docid": "6447ab61e645b90caeb7b0c0564e4ce2", "score": "0.62730885", "text": "function nombreCompleto() {\n console.log(`${nombre} ${apellido} y su edad es: ${edad}`);\n}", "title": "" }, { "docid": "ea89f8f7ff80dcd8c0a9ecd8e572279d", "score": "0.62673235", "text": "function saludar(nombre, apellido) {\n console.log(`Hola ${nombre} ${apellido}`);\n}", "title": "" }, { "docid": "920fdaef78b1c01bcd3dd5e85febe80a", "score": "0.62671256", "text": "function saludar(unNombre, otroNombre) {\n console.log('hola'+ ' ' + unNombre + ' ' + otroNombre);\n \n}", "title": "" }, { "docid": "c9a3fa4a3569336551da8e2877a06002", "score": "0.62649286", "text": "function retornaId(pos) {\n console.log(pos)\n\tpagina = window.location.href;\n\t//console.log(\"Página: \"+pagina);\n p = pagina.split(\"/\");\n console.log('-----')\n console.log(p)\n console.log('-----')\n\tconsole.log(\"Posição: \" + p[pos] );\n\treturn p[pos];\n}", "title": "" }, { "docid": "051f40f0527a9c366d2d628bfb2e04e5", "score": "0.6263104", "text": "curar(paciente) {\n\n }", "title": "" }, { "docid": "488bd7ef6458769efb9ed04b982b5bf5", "score": "0.6215625", "text": "function retorno2(numero){\r\n return numero;\r\n}", "title": "" }, { "docid": "46edca70ac6117799e4c871e5808dc53", "score": "0.6205932", "text": "function lanzarMetodosBusqueda(){\n console.log(\"----- EJEMPLO METODOS -----\");\n alert(\"----- EJEMPLO METODOS -----\");\n var texto=\"esta es una fras \";\n alert(\"La frase a analizar es: \"+texto);\n alert(\"La primera vez que se encuentra la palabra \\\"es\\\": \"+texto.indexOf(\"es\"));\n alert(\"Reemplazamos la palabra una por cualquier: \"+texto.replace(\"una\",\"cualquier\"));\n alert(\"Devolvemos el string a partir de la posicion 4: \"+texto.substr(4));\n }", "title": "" }, { "docid": "3896f2b06243c221881f88387a4fd532", "score": "0.6205053", "text": "valor()\n {\n switch(this.listaTokens2[this.posicionLista].Tipo)\n {\n case 'digito':\n var vaLor = this.listaTokens2[this.posicionLista].Token;\n this.match('digito');\n return ''+vaLor;\n case 'decimal':\n var vaLor = this.listaTokens2[this.posicionLista].Token; \n this.match('decimal');\n return ''+vaLor;\n case 'stringCadena': \n var vaLor = this.listaTokens2[this.posicionLista].Token;\n this.match('stringCadena');\n return ''+vaLor;\n case 'charCadena':\n var vaLor = this.listaTokens2[this.posicionLista].Token;\n this.match('charCadena');\n return ''+vaLor;\n case 'true':\n var vaLor = this.listaTokens2[this.posicionLista].Token;\n this.match('true');\n return ''+vaLor;\n case 'false':\n var vaLor = this.listaTokens2[this.posicionLista].Token;\n this.match('false');\n return ''+vaLor;\n case 'id':\n var vaLor = this.listaTokens2[this.posicionLista].Token;\n this.match('id');\n return ''+vaLor;\n default:\n return false;\n }\n }", "title": "" }, { "docid": "11141bebcbef5a9a3762b40613b4a0bb", "score": "0.6188016", "text": "function saludar2(name) {\n console.log('Hola', name, 'desde la función tradicional');\n}", "title": "" }, { "docid": "ae389407cbbf4edc892047871b1c8df4", "score": "0.6186649", "text": "function valorLetra(cadena, pos) {\n return parseInt(cadena.substr(pos, 1));\n}", "title": "" }, { "docid": "b301bff5c5fde35c8c7fac773c141bb3", "score": "0.61767244", "text": "function getValor() {\n\tconsole.log(\"uno\");\n\tconsole.log(\"dos\");\n\tconsole.log(\"tres\");\n\treturn \"La funcion retorna una cadena de texto\";\n}", "title": "" }, { "docid": "c1782dbd8e7184879c5aaa96cda2f417", "score": "0.61710435", "text": "function saludar3(nombre){\n return \"Hola \" + nombre;\n}", "title": "" }, { "docid": "2a9623467609154acb3e871a362277f8", "score": "0.6166369", "text": "function saludo () {\n\n\nconsole.log(\"Hola Mundo\")\n\n}", "title": "" }, { "docid": "4d67fc08a0477388e653ac4db9801ad2", "score": "0.6159583", "text": "function blabla() {\n return \"je suis une fonction qui dit coucou\"\n}", "title": "" }, { "docid": "15ab331c8c00f164bd5331d14b3d92f2", "score": "0.6156078", "text": "function saludar(){\r\n console.log(\"HOLA MI NOMBRE ES ERNESTO\")\r\n}", "title": "" }, { "docid": "c006ab23011cc58e73fb78c6d9fb7741", "score": "0.61554843", "text": "function EsteNombreFuncion(){\n return 'este es el return de la funcion EsteNombreFuncion'; \n}", "title": "" }, { "docid": "44fa37fea1b17bad057586773d0c6b33", "score": "0.61429286", "text": "function calculadora(){\n\tconsole.log(\"hola soy la calculadora!!\");\n\t// return \"hola soy la calculadora\".. devuelve algo a la funcion\n}", "title": "" }, { "docid": "55da1126fb9be8aa70e6893a4d0e6661", "score": "0.6131241", "text": "function saludar(nombre){\n console.log(`Bienvenido ${nombre}`);\n}", "title": "" }, { "docid": "fe322f80c65b94a15f3f63087ff8f2cd", "score": "0.612775", "text": "function saludo(){\r\n console.log('Hola!!!!');\r\n}", "title": "" }, { "docid": "41bbec22d81a7c0c9aea936f26798a8e", "score": "0.61254793", "text": "function dizerOla(nome) {\n //console.log(\"Olá \" + nome); igual ao debaixo\n console.log(\"Ol\\u00E1 \" + nome);\n}", "title": "" }, { "docid": "3bc9a2871a108464f4fa78c99d7d22d8", "score": "0.61238116", "text": "voar() {\n console.log('Não sabe voar');\n }", "title": "" }, { "docid": "555f08d508ed27444b2b58ceacb9d356", "score": "0.61208713", "text": "function retorno2(numero) {\n\n return numero;\n\n\n}", "title": "" }, { "docid": "29a5ea1967a9d5f9440127439cfb6f56", "score": "0.60883486", "text": "function mostrarSaludo(){\n let mensaje = 'Hola... Este código se ejecuta en una función';\n\n console.log(mensaje);\n}", "title": "" }, { "docid": "eec90fcf60af818f92249c285a8584ae", "score": "0.60753417", "text": "function saludar(estudiante){ //Parametro estudiante \n console.log(estudiante);\n }", "title": "" }, { "docid": "773d3716b0e7e1576b3b84a34b0893df", "score": "0.60721475", "text": "function obtener_posicion(para){\n\tvar x,y;\n\t//obtengo la letra con el index\n\tx=obtener_letra(para);\n\t//obtengo la altura con el index\n\ty=obtener_altura(para);\n\tvar resp=x+','+y;\n\treturn resp;\n}", "title": "" }, { "docid": "236da19c3995c2f98000c9e99eeb9a91", "score": "0.6014245", "text": "function satu(){\n var nama = 'Gunawan';\n console.log(nama);\n}", "title": "" }, { "docid": "9aa5fe47e6be40c3030c9a230a0c0e0e", "score": "0.6003243", "text": "function wypisywanie( owoc ) { //owoc to w tym przypadku zmienna var owoc = \"marchewka\"\r\n\tconsole.log(\"moja funkcja \" + owoc) //plus to dodanie stringu\r\n\tvar sok = \"miksowanie\" + owoc;\r\n\treturn sok;\r\n}", "title": "" }, { "docid": "feaeb687be76c963b06887a26014d438", "score": "0.6002769", "text": "function trouverpos(x /*caractere*/ ) {\n\n //cette fonction retourne l'entier correspondant a la position de la lettre\n\n var alphabet/*chaine de caractere*/;\n\n var pos/*entier*/;\n\n var i/*entier*/;\n\n alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\n pos = -1;\n\n for (i = 0; i < Longueur(alphabet); i = i + 1)\n\n if (CaractereEn(alphabet, i) == x) {\n\n pos = i;\n\n }\n\n return (pos);\n\n}", "title": "" }, { "docid": "21903e4b453fc2efc683e9fc64860ba6", "score": "0.60023963", "text": "function bonjour(napel = \"Jacque\"){\n console.log(\"Bonjour \" + napel)\n}", "title": "" }, { "docid": "197d7c62ee576ec81f552c776066ea5d", "score": "0.5988488", "text": "function facil(){\r\n console.log(\"facil\");\r\n crearJuego(4)\r\n}", "title": "" }, { "docid": "0f5d47bdd4ca6d3bb49d22340214d3cc", "score": "0.5986941", "text": "saludar(fn){\n var {nombre,apellido} = this\n console.log (`Hola me llamo ${nombre} ${apellido}`)\n if (fn){\n //si nos pasaron algo por fn se ejecuta\n //aunque el elemento este vacio ({}) sera siempre verdadero,lo mismo con array, un string, pero no string vacio que va a ser siempre false, 0, null\n fn (nombre,apellido) //lo omitimos\n //le estamos pasando nombre, apellido\n }\n }", "title": "" }, { "docid": "2f80949375b1ad63a00e10dbec330efb", "score": "0.5985658", "text": "function ExibirNomeHard(){\r\n console.log('meunome')\r\n}", "title": "" }, { "docid": "c3c3e40bf43f8411356f0f319bb1c0ef", "score": "0.59808505", "text": "function retorno2(numero) {\n return numero;\n}", "title": "" }, { "docid": "bab7ebc241bd5ed8c5926bc129b2c763", "score": "0.59685063", "text": "function yaz1(a){\n return \"yazı yazıldı.\" + a;\n}", "title": "" }, { "docid": "90bf38be6e6a03d929e39ccac970935b", "score": "0.59625953", "text": "function aku(){\n return 'Karin';\n}", "title": "" }, { "docid": "a645a400188e8b0197564aef5908fc75", "score": "0.59595317", "text": "function nombre() {\n var miApellido = \"Pocon\";\n console.log(miNombre + \" \" + miApellido );\n}", "title": "" }, { "docid": "ba814833a607da7b93c027f9b8d17e79", "score": "0.594991", "text": "function exercice2(){\n\n let nombre = readlineSync.question('Donner un nombre');\n\n function carre(reponse){\n let carreNombre = reponse*reponse;\n console.log(carreNombre);\n }\n\ncarre(nombre);\n}", "title": "" }, { "docid": "6a40e6b8b70b7147833e7c61136a3de7", "score": "0.5946574", "text": "diagnostica(paciente) {}", "title": "" }, { "docid": "38106439e446c70129e321d9ecd5faf3", "score": "0.5942862", "text": "function texto(x){\n return x + \" SOLVAM\";\n}", "title": "" }, { "docid": "018ad3a33970dd6d73fa2a8aee84f091", "score": "0.59406245", "text": "sacar(valor){\n let taxa = 1.1;\n //USANDO O SUPER OU O THIS DÁ NA MESMA NESSE BLOCO\n return this._sacar(valor, taxa);\n //SE NÃO ENTRAR NO IF ELE RETORNA SALDO 0\n}", "title": "" }, { "docid": "230b5f56c00cf309852bfb94e65f4eca", "score": "0.5933677", "text": "function iniciarSesion() {\n\n}", "title": "" }, { "docid": "dc1b516e04e48c44b195bdf8aecbd7a4", "score": "0.59237313", "text": "function saludar(nombre, edad) {\n console.log(`Hola mi nombre es ${nombre} y tengo ${edad} años`);\n}", "title": "" }, { "docid": "a069ad74921e9b32f2301767a1e03412", "score": "0.59235334", "text": "sacar(valor){\n throw new Error(\"O método Sacar da conta é abstrato\"); \n }", "title": "" }, { "docid": "51f3fb93277312c0c40ee509e38a3834", "score": "0.59140813", "text": "function obtenerDatos() {\r\n offset = parseInt(document.getElementById('movimientos', 10).value);\r\n string = document.getElementById('cifrarlo').value;\r\n}", "title": "" }, { "docid": "852f36fffb1c0a18adb3ffc7ef032096", "score": "0.5902689", "text": "function miNombre(){\n // En este caso al llamar la variable an tes de declararla js lo signa undefined\n return nombre;\n}", "title": "" }, { "docid": "1fd3754404eebd53db762682d25665f8", "score": "0.5902583", "text": "function funkcjaNazwa() {\n console.log(\"blabla\");\n}", "title": "" }, { "docid": "f6ace5a539b93da0dded49157f5212d5", "score": "0.5899304", "text": "function saludo(a){\n let edad= Prompt(\"Cuantos años tienes?: \")\n // tanto \"a\" como \"edad\" pertenecen al SCOPE local\n\n console.log(\"Hola soy \" + a + \" y tengo \" + edad + \" años.\")\n\n}", "title": "" }, { "docid": "9b8f9f3b656e71615a82befdf9fac89a", "score": "0.5892985", "text": "function getNombreNuevo(){\n\t\"use strict\";\n\tnombre22222 = \"Juan\"\n\treturn nombre22222\n}", "title": "" }, { "docid": "e3eedb77324fb9d1a9778a4389beac7b", "score": "0.5888892", "text": "function EscreveMeuNome() {\n\tvar nome = \"Diego\";\n\tconsole.log(nome);\n}", "title": "" }, { "docid": "e2034a074944cb55d5db86507c8b3b5c", "score": "0.5884462", "text": "function afficherCar(cinq, n){\n var select = cinq.charAt(n-1);\n return select;\n}", "title": "" }, { "docid": "6918629b14eb5ee51c9466af0ea5f903", "score": "0.58738405", "text": "function chefe(){\n var vetor = []\n entrada(vetor)\n console.log(vetor) \n soma10(vetor)\n console.log(`Valor final do vetor ${vetor}`)\n }", "title": "" }, { "docid": "d5b18d45c16522c19a132000b2e9a281", "score": "0.58724415", "text": "funcionLlamadaMetodo()\n {\n var identificador = this.listaTokens2[this.posicionLista].Token;\n this.match('id');\n this.match('(');\n if(this.listaTokens2[this.posicionLista].Tipo==')')\n {\n this.match(')');\n this.match(';');\n return ''+identificador+'()';\n }\n else\n {\n var retornoPARAMETROS = this.parametroJava();\n this.match(')');\n this.match(';');\n return ''+identificador+'('+retornoPARAMETROS+')';\n } \n }", "title": "" }, { "docid": "3c4e9f2b0c8d5a25fbf7357eee3c58ae", "score": "0.58634627", "text": "bloqueInstruccionInterfaze()\n {\n if(this.listaTokens2[this.posicionLista].Tipo=='public')\n {\n var retornoMETODOINT = this.metodosInterface();\n //recursividad\n if(this.listaTokens2[this.posicionLista].Tipo=='public')\n {\n var bloqueRecursivoInterfaze = this.bloqueInstruccionInterfaze();\n return '\\t'+retornoMETODOINT+'\\n'+bloqueRecursivoInterfaze;\n }\n return '\\t'+retornoMETODOINT;\n }\n else\n {\n return '';\n }\n }", "title": "" }, { "docid": "202eb1f1f7490e66b2835aabed6b8589", "score": "0.58552796", "text": "function sumar() { // function nombreFunc (argunments) { cuerpo de la funcion }\n console.log(10+10);\n}", "title": "" }, { "docid": "d4f0bdd4e08f649809efe86edeeacb38", "score": "0.585072", "text": "saludar(){\n console.log(`Hola me llamo ${this.nombre} ${this.apellido}`)\n }", "title": "" }, { "docid": "f0a5c03f0528616d002c7c4c602f31de", "score": "0.58438325", "text": "function leerDatosCurso(curso){\n console.log(curso);\n}", "title": "" }, { "docid": "fbddf78cfd1717c64d065ee53fb05dbf", "score": "0.584028", "text": "function namaku(c){\n console.log(c+ ' Susilo');\n}", "title": "" }, { "docid": "795d5dbb0eebb746f18d9101cc8b82fa", "score": "0.58382905", "text": "function lo_vamos_a_petar(pet,ar) {\n\tconsole.log(\"Gerard como molo\");\n}", "title": "" }, { "docid": "e74ca9f5ed5f0ebd65b75c8a52ab4386", "score": "0.5835715", "text": "function saluda(name){\n\tconsole.log(\"hola \" + name);\n}", "title": "" }, { "docid": "1132480b7fa55eae4a19d21bd08ee450", "score": "0.5832831", "text": "function ispisKonzola(poruka){\n console.log(poruka);\n}", "title": "" }, { "docid": "45dbd794f3314dabf2c3fc0823d75428", "score": "0.582936", "text": "function cogeLetra(cadena, pos) {\n return cadena.substr(pos, 1);\n}", "title": "" }, { "docid": "b14541fa41391cb65ebd531c99e8841e", "score": "0.58211094", "text": "function calculaperimetroCuadrado(){\n const input = document.getElementById(\"InputCuadrado\")\n const value = input.value\n alert(perimetrocuadrado(value))\n}", "title": "" }, { "docid": "85908f254271d31c661dbbed7ae1044c", "score": "0.58201885", "text": "function spausdintiPasisveikinima() {\n console.log(\"Hi,\", vardas);\n}", "title": "" }, { "docid": "b9011792674c270ac7562973801a56d2", "score": "0.5819371", "text": "function retorno1() {\n var numero = 5;\n return numero;\n}", "title": "" }, { "docid": "d8071e4906b815751d657c37818ca004", "score": "0.58153343", "text": "saludar() {console.log(`Hola, me llamo ${this.nombre}${this.apellido} y soy desarrollador`)}", "title": "" }, { "docid": "fc64727196aad25931239f7a812b6065", "score": "0.5814644", "text": "saludar(){\n console.log(`Hola me llamo ${this.nombre} ${this.apellido} y soy programador`)\n }", "title": "" }, { "docid": "1928f327b3077027540c28c4c6c38ea5", "score": "0.5814045", "text": "function direBonjour() {\n console.log(\"Bonjour !\");\n }", "title": "" }, { "docid": "3106faddfda516883d8dcb317ea2b05f", "score": "0.5805838", "text": "saludar(fn){\n// var nombre = this.nombre\n// var apellido = this.apellido\n var {nombre, apellido}= this /**Desestructuro el nombre ya pellido*/\n\n console.log(`Hola me llamo ${nombre} ${apellido}`)\n\n if(fn){ // En caso de si recibir una funcion como parametro y que sea definida\n fn(nombre, apellido, false) \n }\n }", "title": "" }, { "docid": "69f344c834fb2dec69d69ac87e27964d", "score": "0.5804662", "text": "function Mostrar(){\n return producto;\n}", "title": "" }, { "docid": "69f344c834fb2dec69d69ac87e27964d", "score": "0.5804662", "text": "function Mostrar(){\n return producto;\n}", "title": "" }, { "docid": "69f344c834fb2dec69d69ac87e27964d", "score": "0.5804662", "text": "function Mostrar(){\n return producto;\n}", "title": "" }, { "docid": "6155fc72e4d978cc5536f4089943c38f", "score": "0.58045197", "text": "function estaPresente(valor){\n\treturn {resultado: valor.length>0, mensaje:\"Debe ingresar alg\\u00FAn caracter\"};\n}", "title": "" }, { "docid": "af5ecf10cdfad2745a03594620cad473", "score": "0.58031183", "text": "function identificarOcupacion(claveP,claveS,texto_dictado)\n {\n //si no se dicto nada no ejecutar codigo\n if(texto_dictado==\"\"){ return 0; }\n\n var ocupacion=\"\";\n //texto dictado Evaluar y buscar el texto Indicado\n if(texto_dictado.indexOf(claveP)!=-1){\n comienzaEn=texto_dictado.indexOf(claveP);\n }\n else if(texto_dictado.indexOf(claveS)!=-1){\n comienzaEn=texto_dictado.indexOf(claveS);\n }\n else{\n comienzaEn=-1;//no se encuentra la palabra clave\n }\n\n //si encuentra la cadena\n if(comienzaEn!=-1)\n {\n //console.log(\"encontre la clave\"+claveP);\n //empezar a recorrer apartir de la posicion que empieza la palabra clave en sentido inverso\n espacios=0;\n for(var i=(comienzaEn-1);i>=0;i--){\n if(texto_dictado[i]==\" \"){ espacios++; }\n else{ //si no hay espacios alamcenar\n ocupacion+=texto_dictado[i];\n }\n if(espacios>=2){break;}//cuando encuentre dos espacios que representan el corte de cadena deja de concatenar a el numero de adultos\n }\n\n //si contiene datos la variable de numero de adultos\n if(ocupacion!=\"\"){\n var x=ocupacion.length;\n cadenaInvertida=\"\";\n //console.log('n adulots== '+num_adultos); console.log('n letras= '+x);\n while (x>=0) {\n cadenaInvertida +=ocupacion.charAt(x);\n x--;\n }\n cadenaInvertida=identificarCantidadNumerica(cadenaInvertida);//convertir el texto a Numero\n //ocupacion=cadenaInvertida;\n\n //si no es numerico\n if(isNaN(cadenaInvertida)){\n cadenaInvertida=0;\n }\n\n return cadenaInvertida;//retornar el valor numerico\n }\n }\n else{\n //console.log(\"no se encontro la clave\");\n //si no se encuentra el texto Solicitado retornar cero\n return 0;\n }\n }", "title": "" }, { "docid": "cc0965a558fc814033c159674e4b25ea", "score": "0.5786763", "text": "function movimientosPosibles(celda) {\n let arrayMovimientos = [];\n console.log(celda);\n\n //console.log(String(celda).charAt(3));\n //console.log(String(celda).charAt(1));\n let conversionCeldaC = String(celda).charAt(2);\n let columnaCelda = Number(conversionCeldaC);\n let conversionCeldaF = String(celda).charAt(1);\n let filaCelda = Number(conversionCeldaF);\n\n let stringNumeroCelda = conversionCeldaF + conversionCeldaC;\n let numeroCelda = Number(stringNumeroCelda);\n\n console.log(\"general columna: \" + columnaCelda);\n //****VALIDACIONES SI ES LA PRIMERA FILA****\n\n if (celda.substring(1) < 10) {\n console.log(\"No definido\");\n //PRIMERA FILA ABAJO\n if (celda.substring(1) < 10) {\n let idCeldaSig = \"c\" + (1) + filaCelda;\n\n let celdaElement = document.getElementById(idCeldaSig);\n let idCelda = String(1) + String(filaCelda);\n if (idCelda != 91 && idCelda != 10) {\n //VALIDAR SI HAY UN PERSONAJE\n if (celdaElement.personajeActivo === null || celdaElement.personajeActivo === undefined || celdaElement.personajeActivo === '') {\n //SE INTRODUCE LA POSIBILIDAD\n arrayMovimientos.push(idCeldaSig);\n }\n\n }\n }\n\n //PRIMERA FILA IZQUIERDA\n if (filaCelda - 1 > 0 && filaCelda - 1 <= 9) {\n let idCeldaSig = \"c\" + (filaCelda - 1);\n\n let celdaElement = document.getElementById(idCeldaSig);\n let idCelda = String(filaCelda - 1);\n if (idCelda != 91 && idCelda != 10) {\n //VALIDAR SI HAY UN PERSONAJE\n if (celdaElement.personajeActivo === null || celdaElement.personajeActivo === undefined || celdaElement.personajeActivo === '') {\n //SE INTRODUCE LA POSIBILIDAD\n arrayMovimientos.push(idCeldaSig);\n }\n\n }\n }\n\n //PRIMERA FILA DERECHA\n if (filaCelda + 1 > 0 && filaCelda + 1 <= 9) {\n let idCeldaSig = \"c\" + (filaCelda + 1);\n\n let celdaElement = document.getElementById(idCeldaSig);\n let idCelda = String(filaCelda + 1);\n if (idCelda != 91 && idCelda != 10) {\n //VALIDAR SI HAY UN PERSONAJE\n if (celdaElement.personajeActivo === null || celdaElement.personajeActivo === undefined || celdaElement.personajeActivo === '') {\n //SE INTRODUCE LA POSIBILIDAD\n arrayMovimientos.push(idCeldaSig);\n }\n\n }\n }\n\n\n //****FIN VALIDACIONES SI ES LA PRIMERA FILA****\n } else {\n if (columnaCelda == 0) {\n //--VALIDACIONES SI ES LA ULTIMA COLUMNA--\n //ARRIBA ULTIMA COLUMNA\n if (columnaCelda == 0) {\n let idCeldaSig = \"c\" + (filaCelda - 1) + 0;\n let celdaElement = document.getElementById(idCeldaSig);\n let idCelda = String(filaCelda - 1) + String(0);\n //console.log(\"Arriba: \" + idCelda);\n if (idCelda != 91 && idCelda != 10) {\n //VALIDAR SI HAY UN PERSONAJE\n if (celdaElement.personajeActivo === null || celdaElement.personajeActivo === undefined || celdaElement.personajeActivo === '') {\n //SE INTRODUCE LA POSIBILIDAD\n arrayMovimientos.push(idCeldaSig);\n }\n\n }\n }\n //ABAJO ULTIMA COLUMNA\n if (columnaCelda == 0) {\n let idCeldaSig = \"c\" + (filaCelda + 1) + 0;\n let celdaElement = document.getElementById(idCeldaSig);\n let idCelda = String(filaCelda + 1) + String(0);\n if (idCelda != 91 && idCelda != 10) {\n //VALIDAR SI HAY UN PERSONAJE\n if (celdaElement.personajeActivo === null || celdaElement.personajeActivo === undefined || celdaElement.personajeActivo === '') {\n //SE INTRODUCE LA POSIBILIDAD\n arrayMovimientos.push(idCeldaSig);\n }\n\n }\n }\n //IZQUIERDA ULTIMA COLUMNA\n if (columnaCelda == 0) {\n let celdaNueva = numeroCelda - 1;\n //console.log(\"Nueva celda: \" + celdaNueva);\n let conversionColumna = String(celdaNueva).charAt(1);\n let columnaCelda = Number(conversionColumna);\n let conversionFila = String(celdaNueva).charAt(0);\n let filaCelda = Number(conversionFila);\n\n let idCeldaSig = \"c\" + (filaCelda) + (columnaCelda);\n\n let celdaElement = document.getElementById(idCeldaSig);\n let idCelda = String(filaCelda) + String(columnaCelda);\n\n if (idCelda != 91 && idCelda != 10) {\n //VALIDAR SI HAY UN PERSONAJE\n if (celdaElement.personajeActivo === null || celdaElement.personajeActivo === undefined || celdaElement.personajeActivo === '') {\n //SE INTRODUCE LA POSIBILIDAD\n arrayMovimientos.push(idCeldaSig);\n }\n\n }\n } else {\n //VALIDAR DERECHA \n if (columnaCelda + 1 > 0 && columnaCelda + 1 <= 9) {\n\n //DERECHA ULTIMA COLUMNA\n if (columnaCelda == 9) {\n let idCeldaSig = \"c\" + (filaCelda + 1) + 0;\n let celdaElement = document.getElementById(idCeldaSig);\n let idCelda = String(filaCelda + 1) + String(0);\n if (idCelda != 91 && idCelda != 10) {\n //VALIDAR SI HAY UN PERSONAJE\n if (celdaElement.personajeActivo === null || celdaElement.personajeActivo === undefined || celdaElement.personajeActivo === '') {\n //SE INTRODUCE LA POSIBILIDAD\n arrayMovimientos.push(idCeldaSig);\n }\n\n }\n }\n let idCeldaSig = \"c\" + (filaCelda) + (columnaCelda + 1);\n let celdaElement = document.getElementById(idCeldaSig);\n let idCelda = String(filaCelda) + String(columnaCelda + 1);\n if (idCelda != 91 && idCelda != 10) {\n //VALIDAR SI HAY UN PERSONAJE\n if (celdaElement.personajeActivo === null || celdaElement.personajeActivo === undefined || celdaElement.personajeActivo === '') {\n //SE INTRODUCE LA POSIBILIDAD\n arrayMovimientos.push(idCeldaSig);\n }\n\n }\n }\n }\n\n //--FIN VALIDACIONES ULTIMA COLUMNA--\n\n }\n\n //VALIDACIONES SI ES LA SEGUNDA FILA (11-20)\n if (numeroCelda >= 10 && numeroCelda <= 20) {\n console.log(\"entra segunda fila\");\n\n //VALIDAR ARRIBA\n if (columnaCelda >= 1 && columnaCelda <= 9) {\n let idCeldaSig = \"c\" + (columnaCelda);\n let celdaElement = document.getElementById(idCeldaSig);\n let idCelda = String(columnaCelda);\n if (idCelda != 91 && idCelda != 10) {\n //VALIDAR SI HAY UN PERSONAJE\n if (celdaElement.personajeActivo === null || celdaElement.personajeActivo === undefined || celdaElement.personajeActivo === '') {\n //SE INTRODUCE LA POSIBILIDAD\n arrayMovimientos.push(idCeldaSig);\n }\n\n }\n }\n\n\n }\n\n //DERECHA ULTIMA COLUMNA\n if (columnaCelda == 9) {\n let idCeldaSig = \"c\" + (filaCelda + 1) + 0;\n let celdaElement = document.getElementById(idCeldaSig);\n let idCelda = String(filaCelda + 1) + String(0);\n if (idCelda != 91 && idCelda != 10) {\n //VALIDAR SI HAY UN PERSONAJE\n if (celdaElement.personajeActivo === null || celdaElement.personajeActivo === undefined || celdaElement.personajeActivo === '') {\n //SE INTRODUCE LA POSIBILIDAD\n arrayMovimientos.push(idCeldaSig);\n }\n\n }\n }\n\n\n //---VALIDACIONES NORMALES---\n\n //VALIDAR DERECHA \n\n if (columnaCelda != 0) {\n if (columnaCelda + 1 > 0 && columnaCelda + 1 <= 9) {\n\n //NORMAL\n let idCeldaSig = \"c\" + (filaCelda) + (columnaCelda + 1);\n let celdaElement = document.getElementById(idCeldaSig);\n let idCelda = String(filaCelda) + String(columnaCelda + 1);\n if (idCelda != 91 && idCelda != 10) {\n //VALIDAR SI HAY UN PERSONAJE\n if (celdaElement.personajeActivo === null || celdaElement.personajeActivo === undefined || celdaElement.personajeActivo === '') {\n //SE INTRODUCE LA POSIBILIDAD\n arrayMovimientos.push(idCeldaSig);\n }\n\n }\n }\n }\n\n //VALIDAR ARRIBA\n if (filaCelda - 1 >= 1 && filaCelda - 1 <= 9) {\n console.log(\"arriba normal\");\n let idCeldaSig = \"c\" + (filaCelda - 1) + (columnaCelda);\n let celdaElement = document.getElementById(idCeldaSig);\n let idCelda = String(filaCelda - 1) + String(columnaCelda);\n if (idCelda != 91 && idCelda != 10) {\n //VALIDAR SI HAY UN PERSONAJE\n if (celdaElement.personajeActivo === null || celdaElement.personajeActivo === undefined || celdaElement.personajeActivo === '') {\n //SE INTRODUCE LA POSIBILIDAD\n arrayMovimientos.push(idCeldaSig);\n }\n\n }\n }\n\n\n //VALIDAR IZQUIERDA \n if (columnaCelda - 1 > 0 && columnaCelda - 1 <= 9) {\n console.log(\"izq normal\");\n let idCeldaSig = \"c\" + (filaCelda) + (columnaCelda - 1);\n let celdaElement = document.getElementById(idCeldaSig);\n let idCelda = String(filaCelda) + String(columnaCelda - 1);\n if (idCelda != 91 && idCelda != 10) {\n //VALIDAR SI HAY UN PERSONAJE\n if (celdaElement.personajeActivo === null || celdaElement.personajeActivo === undefined || celdaElement.personajeActivo === '') {\n //SE INTRODUCE LA POSIBILIDAD\n arrayMovimientos.push(idCeldaSig);\n }\n\n }\n }\n\n\n\n\n\n //VALIDAR ABAJO\n if (filaCelda + 1 >= 1 && filaCelda + 1 <= 9) {\n console.log(\"Entra abajo\");\n let idCeldaSig = \"c\" + (filaCelda + 1) + (columnaCelda);\n let celdaElement = document.getElementById(idCeldaSig);\n let idCelda = String(filaCelda + 1) + String(columnaCelda);\n if (idCelda != 91 && idCelda != 10) {\n //VALIDAR SI HAY UN PERSONAJE\n if (celdaElement.personajeActivo === null || celdaElement.personajeActivo === undefined || celdaElement.personajeActivo === '') {\n //SE INTRODUCE LA POSIBILIDAD\n console.log(\"Entra abajo 2\");\n arrayMovimientos.push(idCeldaSig);\n }\n\n }\n }\n\n\n }\n\n\n\n return arrayMovimientos;\n}", "title": "" }, { "docid": "0829ea7aca3229b4172c0f0abda08929", "score": "0.57828265", "text": "function botao(num) {\n\n // verifica se o botao clicado foi o de parentesis\n if ((num == 'parentesis') && !parentesis_aberto){\n // variavel de controle dos parentesis\n num = '(';\n parentesis_aberto = true;\n // adiciona o parentesis e troca o estado\n } else if ((num == 'parentesis') && (parentesis_aberto)){\n num = ')';\n parentesis_aberto = false;\n // adiciona o parentesis e troca o estado\n }\n\n // visor da calculadora\n var visor = document.getElementById('visor');\n\n // se for o numero no display for diferente de 0 incrementa novo numero\n \n if (visor.innerText.startsWith('0')){\n visor.innerText = num;\n } else {\n // senao sobrescreve o 0 por outro\n visor.innerText += num;\n }\n\n}", "title": "" }, { "docid": "83e4f54954c29b3d3568c4224a23ef61", "score": "0.57827693", "text": "function saludar(nombre = \"desconocido\", edad = 0) {\n console.log(`hola ${nombre} y tiens ${edad}años`);\n}", "title": "" }, { "docid": "edf6b3559013c7c1299f408526c3757d", "score": "0.5782348", "text": "saludar(){\n console.log(`Hola me llamo ${this.nombre} ${this.apellido}`)\n }", "title": "" }, { "docid": "37b8e79b9fcd85ae7780b5882d4f6a48", "score": "0.5781349", "text": "function archit(para) {\n console.log(para);\n console.log(\"Hii chiks\");\n para();\n}", "title": "" }, { "docid": "50819d2e3486f22744979b8a54d9fa1a", "score": "0.5780678", "text": "function calculadora(){\n console.log(\"Hola, soy la Calculadora\");\n console.log(\"Si, soy yo.\")\n return \"Hola soy la calculadora!!\";\n}", "title": "" }, { "docid": "5e4828f1ff7cdfbf922b64a72ce56bfa", "score": "0.5767061", "text": "function falaOi(){\n return 'oi';\n}", "title": "" } ]
400b39f0165819530d447ef742d992bb
Set the slider value.
[ { "docid": "50ade92e5dcb3e757977153cfb4fa80a", "score": "0.0", "text": "function valueSet ( input, fireSetEvent ) {\n\n\t\tvar values = asArray(input);\n\t\tvar isInit = scope_Locations[0] === undefined;\n\n\t\t// Event fires by default\n\t\tfireSetEvent = (fireSetEvent === undefined ? true : !!fireSetEvent);\n\n\t\tvalues.forEach(setValue);\n\n\t\t// Animation is optional.\n\t\t// Make sure the initial values were set before using animated placement.\n\t\tif ( options.animate && !isInit ) {\n\t\t\taddClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n\t\t}\n\n\t\t// Now that all base values are set, apply constraints\n\t\tscope_HandleNumbers.forEach(function(handleNumber){\n\t\t\tsetHandle(handleNumber, scope_Locations[handleNumber], true, false);\n\t\t});\n\n\t\tsetZindex();\n\n\t\tscope_HandleNumbers.forEach(function(handleNumber){\n\n\t\t\tfireEvent('update', handleNumber);\n\n\t\t\t// Fire the event only for handles that received a new value, as per #579\n\t\t\tif ( values[handleNumber] !== null && fireSetEvent ) {\n\t\t\t\tfireEvent('set', handleNumber);\n\t\t\t}\n\t\t});\n\t}", "title": "" } ]
[ { "docid": "11c5f131fedd881fba0d2e07e1bfc537", "score": "0.7653699", "text": "setSliderValue(id, value) {\n const slider = this.sliders[id];\n if (value <= slider.min) {\n slider.endAngle = this.startAngle;\n slider.ang_degrees = 0;\n slider.normalizedValue = 0;\n } else if (value >= slider.max) {\n slider.endAngle = this.endAngle;\n slider.ang_degrees = 360;\n slider.normalizedValue = slider.max;\n } else {\n //value = (value / slider.step >> 0) * slider.step;\n slider.endAngle = 2 * Math.PI * (value - slider.min) / (slider.max - slider.min) - Math.PI / 2;\n slider.ang_degrees = Slider.radToDeg(Slider.normalizeTan(slider.endAngle));\n slider.normalizedValue = value;\n }\n\n this.drawAll();\n }", "title": "" }, { "docid": "e160299ef8d0ca2beda7b0b5a786b405", "score": "0.76072544", "text": "function valorPeso(newVal){\n pesoSlider.value = newVal;\n}", "title": "" }, { "docid": "6bf6926ed75f228475faecffffcf2938", "score": "0.73610795", "text": "function setSlider(value, objectReference) {\n updatePreferences(objectReference, value);\n}", "title": "" }, { "docid": "c033b3ffb4a62e3893ea5a463e2a6cb4", "score": "0.72546405", "text": "sliderChanged(e) {\n const value = +e.target.value;\n this.setValue(value);\n }", "title": "" }, { "docid": "9e2d5ed3aeb6c6fa3c746bb66007c8f9", "score": "0.7202001", "text": "function setSliderBoxValue(currentValue){\r\n $(\"#sliderValueBox\").val(currentValue/10);\r\n}", "title": "" }, { "docid": "8ed128c3f8f488eeec25efcd337d9e3e", "score": "0.71415347", "text": "setValue(value) {\n this.value = value;\n }", "title": "" }, { "docid": "8f0f9d6748d2344aa6bdfce646c2d911", "score": "0.71015376", "text": "set value(value) { this.setValue(value); }", "title": "" }, { "docid": "1c0878b7309b737a5f5f79f7735fd938", "score": "0.7092109", "text": "setValue(value) {\n this._value = value;\n }", "title": "" }, { "docid": "eb65a149a597ea33913e2b918efe52f3", "score": "0.6977928", "text": "changeValue(value) {\n this.setValue(value);\n }", "title": "" }, { "docid": "ee05cb12af58905b55895a39b987a169", "score": "0.6921794", "text": "function setTime(value) {\n // console.log('value...', value, new Date(uwb_start + (value * 1000)).getTime())\n sliderValue.innerHTML = Math.floor(value);\n slider.value = Math.floor(value);\n layer.renderer = createRenderer(value);\n }", "title": "" }, { "docid": "29aa7e120d007fea8d579c4087e48494", "score": "0.68937415", "text": "function setValue(val,num,vertical) {\n\tdocument.getElementById(\"slider\"+num).value = val;\n showValue(val,num,vertical);\n // if (val === 500) {\n // document.getElementById(\"sliderthumb1\").classList.add('maxval');\n // document.getElementById(\"slidervalue1\").innerHTML = '+' + this.value + 'm&#178';\n // } else {\n // document.getElementById(\"sliderthumb1\").classList.remove('maxval')\n // }\n}", "title": "" }, { "docid": "cc025a7080239bb3678e669078dc7eb3", "score": "0.68001014", "text": "set value(value) {\n this._value = value;\n }", "title": "" }, { "docid": "34fd518aee2e3666b33b8e594d97e344", "score": "0.67273945", "text": "function setCurrentValue(sliderElement, displayElement) {\n displayElement.innerHTML = `Current Value: ${sliderElement.value}`;\n}", "title": "" }, { "docid": "951e769e7668de08c7aab0e216f8df9a", "score": "0.67024654", "text": "function setValue(value) {\n if (value > max) {\n val = max;\n } else {\n val = value;\n }\n _setInitialValue();\n }", "title": "" }, { "docid": "1a49206ac58d3ce9eb7b8a17686205d6", "score": "0.66964614", "text": "function setValue(sliderElement, displayElement) {\n displayElement.innerHTML = `Value: ${sliderElement.value}`;\n}", "title": "" }, { "docid": "9167bd4aa8712207af5f25c0b0df75da", "score": "0.66960526", "text": "function setVolume(value) {\n var oldval = initgui;\n initgui = true;\n $(\"#volumeslider\").val(value).slider('refresh');\n initgui = oldval;\n}", "title": "" }, { "docid": "ec5174bea3f64c70b1e20f98aeb0ace1", "score": "0.66894084", "text": "set value(v) {\r\n this.setValue(v);\r\n }", "title": "" }, { "docid": "b4885f26776ea8ebe4bd85e6764ab509", "score": "0.66688776", "text": "__setValue (newValue) {\r\n let percentage = Math.round((newValue/this.goalValue) * 100)\r\n\r\n if (percentage < 0) {\r\n newValue = 0;\r\n }\r\n if (percentage > 100) {\r\n newValue = 100;\r\n }\r\n\r\n this.value = newValue;\r\n this.__update();\r\n }", "title": "" }, { "docid": "8415e9f72214a09fceb528f9d4de5fa2", "score": "0.66662514", "text": "function updateInputVal(val) {\n $element.parent().find('.range-slider-exact-val').val(formatNumber(val));\n }", "title": "" }, { "docid": "43f140ae58bb20a78381bbb42825bc2e", "score": "0.6650267", "text": "function valueSet ( input ) {\r\n\r\n\t\t// LibLink: don't accept new values when currently emitting changes.\r\n\t\tif ( $Target[0].LinkIsEmitting ) {\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tvar count, values = asArray( input );\r\n\r\n\t\t// The RTL settings is implemented by reversing the front-end,\r\n\t\t// internal mechanisms are the same.\r\n\t\tif ( options.dir && options.handles > 1 ) {\r\n\t\t\tvalues.reverse();\r\n\t\t}\r\n\r\n\t\t// Animation is optional.\r\n\t\t// Make sure the initial values where set before using animated\r\n\t\t// placement. (no report, unit testing);\r\n\t\tif ( options.animate && $Locations[0] !== -1 ) {\r\n\t\t\taddClassFor( $Target, Classes[14], 300 );\r\n\t\t}\r\n\r\n\t\t// Determine how often to set the handles.\r\n\t\tcount = $Handles.length > 1 ? 3 : 1;\r\n\r\n\t\tif ( values.length === 1 ) {\r\n\t\t\tcount = 1;\r\n\t\t}\r\n\r\n\t\tsetValues ( count, values );\r\n\r\n\t\t// Fire the 'set' event. As of noUiSlider 7,\r\n\t\t// this is no longer optional.\r\n\t\tfireEvents(['set']);\r\n\r\n\t\treturn this;\r\n\t}", "title": "" }, { "docid": "43f140ae58bb20a78381bbb42825bc2e", "score": "0.6650267", "text": "function valueSet ( input ) {\r\n\r\n\t\t// LibLink: don't accept new values when currently emitting changes.\r\n\t\tif ( $Target[0].LinkIsEmitting ) {\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tvar count, values = asArray( input );\r\n\r\n\t\t// The RTL settings is implemented by reversing the front-end,\r\n\t\t// internal mechanisms are the same.\r\n\t\tif ( options.dir && options.handles > 1 ) {\r\n\t\t\tvalues.reverse();\r\n\t\t}\r\n\r\n\t\t// Animation is optional.\r\n\t\t// Make sure the initial values where set before using animated\r\n\t\t// placement. (no report, unit testing);\r\n\t\tif ( options.animate && $Locations[0] !== -1 ) {\r\n\t\t\taddClassFor( $Target, Classes[14], 300 );\r\n\t\t}\r\n\r\n\t\t// Determine how often to set the handles.\r\n\t\tcount = $Handles.length > 1 ? 3 : 1;\r\n\r\n\t\tif ( values.length === 1 ) {\r\n\t\t\tcount = 1;\r\n\t\t}\r\n\r\n\t\tsetValues ( count, values );\r\n\r\n\t\t// Fire the 'set' event. As of noUiSlider 7,\r\n\t\t// this is no longer optional.\r\n\t\tfireEvents(['set']);\r\n\r\n\t\treturn this;\r\n\t}", "title": "" }, { "docid": "8ebc7f2c466ec93ce81d204917aa9d79", "score": "0.66438603", "text": "set value(value){\n this._value=value;\n }", "title": "" }, { "docid": "f9fc63a36a4153754afa4d5c4d6268dd", "score": "0.6640105", "text": "function updateSlider(slideAmount , sliderAmountVar) {\n var slider = document.getElementById(sliderAmountVar);\n\tslider.value = slideAmount;\n}", "title": "" }, { "docid": "d9fd5ba2d0de3d5351eb7d02d72ef321", "score": "0.662873", "text": "setValue(value) {\n this.$input.val(value);\n }", "title": "" }, { "docid": "f8f7f7922436df087967f000158dfe64", "score": "0.6619646", "text": "function calculateSliderValue() {\n var val = scale / zoomController.ZOOM_STEP - 1;\n view.setSliderValue(val);\n }", "title": "" }, { "docid": "8c2abc71894cb6301056d18860867a55", "score": "0.6595025", "text": "function setSlider(slider, sliderText, value, unit){\n if(!(typeof slider === \"undefined\")){ //if(!(typeof.., not if(! typeof..\n slider.value=value;\n sliderText.innerHTML=\"&nbsp;\"+value+unit;\n }\n}", "title": "" }, { "docid": "732dd81a904d045a1b63e0d8599ae092", "score": "0.6590076", "text": "function handleSliderChange(name, value) {\n setVal({ ...val, [name]: value });\n }", "title": "" }, { "docid": "497eb315280ffd2073aa35257d6402ad", "score": "0.65660924", "text": "function handleSliderChange(e) {\n props.setSliderValue(parseInt(e.target.value))\n }", "title": "" }, { "docid": "c8197bfbb10be52f71d21dcdc2b480c4", "score": "0.6559012", "text": "function updateSlider(){\n\t\tslider.slider(\"value\", controller_timeline.progress() *100);\n\t}", "title": "" }, { "docid": "b46e29afc2b954ebd313924563bc2daf", "score": "0.6555162", "text": "set value(value) {\n var changed = value !== this._value;\n this._value = value;\n if (changed) {\n this.onValueChanged();\n }\n }", "title": "" }, { "docid": "b46e29afc2b954ebd313924563bc2daf", "score": "0.6555162", "text": "set value(value) {\n var changed = value !== this._value;\n this._value = value;\n if (changed) {\n this.onValueChanged();\n }\n }", "title": "" }, { "docid": "435a7799649663eca85c141ba42b7b81", "score": "0.6555066", "text": "_setWidgetValue()\n\t{\n\t\tif (this._data.editable)\n\t\t\tthis._widgetHtml.val(this._data.value);\n\t\telse\n\t\t\tthis._widgetHtml.value = this._data.value;\n\n\t\t// Trigger event\n\t\tthis._triggerEvent();\n\t}", "title": "" }, { "docid": "68847ecaef932c684b0ff650281356c9", "score": "0.65390056", "text": "function setTempo(){\n tempo = jQuery(\"#tempo-slider\").slider(\"value\");\n jQuery(\"#tempo\").text(tempo);\n}", "title": "" }, { "docid": "6c7c1969588ba803eea41935214535c5", "score": "0.65245867", "text": "_setWidgetValue()\n\t{\n\t\tthis._widgetHtml.value = this._data.value;\n\n\t\t// Trigger event\n\t\tthis._triggerEvent();\n\t}", "title": "" }, { "docid": "83cd7beec03954f80a7859e38ba402c7", "score": "0.6519085", "text": "setValue(value: number): void {\n this.stopAnimations();\n this.model = value;\n this.flush();\n }", "title": "" }, { "docid": "001ec4c236572d68c3e6d378c3b771a6", "score": "0.6508026", "text": "valueChanged() {\n this.emitStyle();\n this.ionChange.emit({ value: this.value });\n }", "title": "" }, { "docid": "001ec4c236572d68c3e6d378c3b771a6", "score": "0.6508026", "text": "valueChanged() {\n this.emitStyle();\n this.ionChange.emit({ value: this.value });\n }", "title": "" }, { "docid": "b571e4977fb0e4152394c09e55622a65", "score": "0.65038735", "text": "set value(value) {\n this._value = value;\n const stringValue = value ? value.toString() : '';\n\n this._renderer.setProperty(this._element.nativeElement, 'value', stringValue);\n\n this._group.onRadioValueUpdate();\n }", "title": "" }, { "docid": "0b8da35ea508f437e64d691bdb405593", "score": "0.64905924", "text": "_setWidgetValue()\n\t{\n\t\tif (this._data.editable)\n\t\t\tthis._innerWidget.value(this._data.value);\n\t\telse\n\t\t\tthis._widgetHtml.value = this._data.value;\n\n\t\t// Trigger event\n\t\tthis._triggerEvent();\n\t}", "title": "" }, { "docid": "0b8da35ea508f437e64d691bdb405593", "score": "0.64905924", "text": "_setWidgetValue()\n\t{\n\t\tif (this._data.editable)\n\t\t\tthis._innerWidget.value(this._data.value);\n\t\telse\n\t\t\tthis._widgetHtml.value = this._data.value;\n\n\t\t// Trigger event\n\t\tthis._triggerEvent();\n\t}", "title": "" }, { "docid": "0b8da35ea508f437e64d691bdb405593", "score": "0.64905924", "text": "_setWidgetValue()\n\t{\n\t\tif (this._data.editable)\n\t\t\tthis._innerWidget.value(this._data.value);\n\t\telse\n\t\t\tthis._widgetHtml.value = this._data.value;\n\n\t\t// Trigger event\n\t\tthis._triggerEvent();\n\t}", "title": "" }, { "docid": "61344732e0592e57293bf11738358cb2", "score": "0.64844775", "text": "_setValue(value) {\n const that = this;\n\n that.value = value;\n that.$.input.value = value;\n\n that._number = that._numericProcessor.createDescriptor(value, true);\n\n that._setDropDownOptions();\n }", "title": "" }, { "docid": "f9e2849b192708dd7a55e4b4f30a2617", "score": "0.64796543", "text": "set newValue(value) {\n this.#value = value;\n }", "title": "" }, { "docid": "d37f2787e20ab5b15f5b5f11d84e0892", "score": "0.6461015", "text": "handleSlide(event, ui) {\n this.setState({ sliderValue: ui.value });\n }", "title": "" }, { "docid": "f2333df6c560c89668be1e1930bd603e", "score": "0.6447422", "text": "function setValue(val) {\n value = val;\n notify(value);\n }", "title": "" }, { "docid": "630689bcc78d98d0dfdb0a1a85ccab93", "score": "0.6444636", "text": "valueChanged() {\n this.emitStyle();\n this.ionChange.emit({\n value: this.value == null ? this.value : this.value.toString()\n });\n }", "title": "" }, { "docid": "ac05725e4df5cc8326a8adf9523c181e", "score": "0.6406989", "text": "function setSpeed(s) {\n speed = s;\n speedSlider.value = speed;\n}", "title": "" }, { "docid": "d2bfb4d2b5083051bf4ffe136b23446d", "score": "0.64027184", "text": "setValue(val) { }", "title": "" }, { "docid": "6f362742d663828c414c31ca3f491d59", "score": "0.6375611", "text": "valueChanged() {\n const nativeInput = this.nativeInput;\n const value = this.getValue();\n if (nativeInput && nativeInput.value !== value) {\n nativeInput.value = value;\n }\n this.runAutoGrow();\n this.emitStyle();\n this.ionChange.emit({ value });\n }", "title": "" }, { "docid": "e0330d02530b5c4a1a8d028835eb42d1", "score": "0.635621", "text": "function setSmokeAmount(sliderValue) {\n\tsmokeAmount = sliderValue;\n\tdocument.getElementById(\"smokeAmount\").innerHTML = \"\" + smokeAmount;\n}", "title": "" }, { "docid": "34a1001999b3d7e4231351915a5ef174", "score": "0.63521284", "text": "valueChanged() {\n this.updateDatetimeValue(this.value);\n this.emitStyle();\n this.ionChange.emit({\n value: this.value\n });\n }", "title": "" }, { "docid": "a4ab1efb03346794f24a3f119ec2e594", "score": "0.63513744", "text": "function sliderSetAmount(event, ui) {\n $(this).next().text(ui.value);\n\n if (typeof event.originalEvent != \"undefined\") {\n if (currMode == \"Grayscale\") {\n balanceGrayStimules( this.id.substring(\"slider-a\".length), ui.value );\n }\n\n if (event.type == \"slidechange\") {\n applyTransformations();\n }\n }\n }", "title": "" }, { "docid": "f022eadfdb1aeb842f9b37cc07e03e7e", "score": "0.6343243", "text": "value(value) {\n this.newValue = value;\n }", "title": "" }, { "docid": "b46784ad0645695cd8a3bd48517061d4", "score": "0.63065475", "text": "valueChanged() {\n const nativeInput = this.nativeInput;\n const value = this.getValue();\n\n if (nativeInput && nativeInput.value !== value) {\n nativeInput.value = value;\n }\n\n this.runAutoGrow();\n this.emitStyle();\n this.ionChange.emit({\n value\n });\n }", "title": "" }, { "docid": "951eae4a250b6773a8a179e04aa7ddaa", "score": "0.6298798", "text": "valueChanged() {\n this.updateDatetimeValue(this.value);\n this.emitStyle();\n this.ionChange.emit({\n value: this.value\n });\n }", "title": "" }, { "docid": "11462272ec716703aed0d3b1f507eed9", "score": "0.6289796", "text": "handleChange(value) {\n return () => {\n $('#slider').slider('value', this.state.sliderValue + value);\n this.setState({ sliderValue: this.state.sliderValue + value });\n };\n }", "title": "" }, { "docid": "fdfb0d511ca338e45ca040b14230472b", "score": "0.6275309", "text": "setRate(event) {\n this.rate = document.querySelector(\"#sliderCmpt\").value;\n }", "title": "" }, { "docid": "fa6cbc6683f226d66089edc57268c6cf", "score": "0.6272476", "text": "function sliderChange(value){\n var slider = document.getElementById(\"slider\").value;\n document.getElementById('sliderStatus').innerHTML = slider;\n}", "title": "" }, { "docid": "c3a304cc5a45c4f1fa9615d427956ce2", "score": "0.6269526", "text": "valueChanged(value) {\n this.onValueChange(value, this);\n }", "title": "" }, { "docid": "4ec6752da20103f751b1d3ed84b1ac47", "score": "0.62676203", "text": "function setValue($elem, value) {\n $elem.val(value).change();\n }", "title": "" }, { "docid": "7e9b913ec18f8f172b3b0250c22ed89f", "score": "0.6260239", "text": "setValue(value) {\n Native.callUIFunction(this, 'setValue', [value]);\n }", "title": "" }, { "docid": "bbd6aae6b02a1ae886a4f162d5795eb3", "score": "0.6255089", "text": "function setValueDirect (ev){\n\t\t\n// \t\tev.preventDefault(); // input range IOS better ?\n\t\t\n\t\tez.value = ev.target.value; // call value setter\n\t\tez.action(ez);\n\t}", "title": "" }, { "docid": "b811dfbe94d910f682d91464adfe957c", "score": "0.62544274", "text": "function setSliderCurbPreferred() {\n /*\n var sliderCurbPreferredValue = document.getElementById(\"sliderCurbPreferred\").value;\n document.getElementById(\"sliderParkingSpotPreferred\").value = 100 - sliderCurbPreferredValue;\n */\n}", "title": "" }, { "docid": "07aa1c4b4b3042b006dc820a192e2a81", "score": "0.62535775", "text": "function updateTextInput(val, slider) {\n document.getElementById(slider).value = val;\n}", "title": "" }, { "docid": "c3e0292e1bdcf8e134397a0db465f9ac", "score": "0.62375766", "text": "setValue(value) {\n const oldValue = this._value;\n if (typeof value === 'string') {\n value = Number.parseInt(value, 2);\n }\n this._value = int16(value);\n this.emit('change', this._value, oldValue);\n }", "title": "" }, { "docid": "d0b42f6bf1eb1e0af65b1c32e740869b", "score": "0.6225425", "text": "setValue(value) {\n this.value = value;\n return this;\n }", "title": "" }, { "docid": "6f2c5b81d6f47c86e1e67fb14ee5b17f", "score": "0.6224241", "text": "function setSlider(idHTMLSlider, idHTMLTextSlider, max, index) {\n document.getElementById(idHTMLSlider).value = index;\n document.getElementById(idHTMLTextSlider).innerHTML = \"Step \" + index + \" of \" + max;\n}", "title": "" }, { "docid": "8bdbb86d73a5a2cf1cbe048393f33036", "score": "0.6223646", "text": "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "title": "" }, { "docid": "8bdbb86d73a5a2cf1cbe048393f33036", "score": "0.6223646", "text": "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "title": "" }, { "docid": "8bdbb86d73a5a2cf1cbe048393f33036", "score": "0.6223646", "text": "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "title": "" }, { "docid": "b4190fc143536264546fd993d6477716", "score": "0.6210819", "text": "_valueChanged() {\n\t\t\tif (this._isVertical) {\n\t\t\t\tthis._knob.style.top = this.VMARGIN + this._valueToPos(this._value) + 'px';\n\t\t\t} else {\n\t\t\t\tthis._knob.style.left = this.VMARGIN + this._valueToPos(this._value) + 'px';\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "f4dc2100103db6159776b21cefa2fbb4", "score": "0.6201074", "text": "function valueSet ( input ) {\n\n\t\tvar count, values = asArray( input ), i;\n\n\t\t// The RTL settings is implemented by reversing the front-end,\n\t\t// internal mechanisms are the same.\n\t\tif ( options.dir && options.handles > 1 ) {\n\t\t\tvalues.reverse();\n\t\t}\n\n\t\t// Animation is optional.\n\t\t// Make sure the initial values where set before using animated placement.\n\t\tif ( options.animate && scope_Locations[0] !== -1 ) {\n\t\t\taddClassFor( scope_Target, Classes[14], 300 );\n\t\t}\n\n\t\t// Determine how often to set the handles.\n\t\tcount = scope_Handles.length > 1 ? 3 : 1;\n\n\t\tif ( values.length === 1 ) {\n\t\t\tcount = 1;\n\t\t}\n\n\t\tsetValues ( count, values );\n\n\t\t// Fire the 'set' event for both handles.\n\t\tfor ( i = 0; i < scope_Handles.length; i++ ) {\n\t\t\tfireEvent('set', i);\n\t\t}\n\t}", "title": "" }, { "docid": "f4dc2100103db6159776b21cefa2fbb4", "score": "0.6201074", "text": "function valueSet ( input ) {\n\n\t\tvar count, values = asArray( input ), i;\n\n\t\t// The RTL settings is implemented by reversing the front-end,\n\t\t// internal mechanisms are the same.\n\t\tif ( options.dir && options.handles > 1 ) {\n\t\t\tvalues.reverse();\n\t\t}\n\n\t\t// Animation is optional.\n\t\t// Make sure the initial values where set before using animated placement.\n\t\tif ( options.animate && scope_Locations[0] !== -1 ) {\n\t\t\taddClassFor( scope_Target, Classes[14], 300 );\n\t\t}\n\n\t\t// Determine how often to set the handles.\n\t\tcount = scope_Handles.length > 1 ? 3 : 1;\n\n\t\tif ( values.length === 1 ) {\n\t\t\tcount = 1;\n\t\t}\n\n\t\tsetValues ( count, values );\n\n\t\t// Fire the 'set' event for both handles.\n\t\tfor ( i = 0; i < scope_Handles.length; i++ ) {\n\t\t\tfireEvent('set', i);\n\t\t}\n\t}", "title": "" }, { "docid": "004a4644066d04d0892039a7dd8f9e45", "score": "0.61957586", "text": "_changeValue(){\n let val = Number(this.getRef('element').value);\n this.numericValue = val;\n if (this.currentUnit) {\n val += this.currentUnit;\n }\n this.emitInput(val);\n }", "title": "" }, { "docid": "8a8a7e984ef007bf5d1e423ee6e21aee", "score": "0.6194888", "text": "set value(value) {}", "title": "" }, { "docid": "8d0e2c7c0416e0fb8732afac8583e95b", "score": "0.6190556", "text": "set value(value) {\n if (this._value !== value) {\n this._value = value;\n this.setHtml(value);\n }\n }", "title": "" }, { "docid": "df407829bc11aa1c3a058f2004b6f907", "score": "0.6180983", "text": "function updateSag() {\n window.console.log(\"Sag is going to ..\"+vol.indexX);\n jQuery('#Sag_slider').slider(\"option\", \"value\",vol.indexX);\n}", "title": "" }, { "docid": "d18f880d40cf1cd54f4610c2e0b7a3b0", "score": "0.61779875", "text": "onValueChanged() {\n if (this._valueChanged) {\n this._valueChanged.raise();\n }\n this.onFieldValueChanged('value', this.value);\n }", "title": "" }, { "docid": "d18f880d40cf1cd54f4610c2e0b7a3b0", "score": "0.61779875", "text": "onValueChanged() {\n if (this._valueChanged) {\n this._valueChanged.raise();\n }\n this.onFieldValueChanged('value', this.value);\n }", "title": "" }, { "docid": "124475d8cf0f10c5050824b8c2be7593", "score": "0.6176015", "text": "function valueSet ( input ) {\n\n\t\tvar count, values = asArray( input ), i;\n\n\t\t// The RTL settings is implemented by reversing the front-end,\n\t\t// internal mechanisms are the same.\n\t\tif ( options.dir && options.handles > 1 ) {\n\t\t\tvalues.reverse();\n\t\t}\n\n\t\t// Animation is optional.\n\t\t// Make sure the initial values where set before using animated placement.\n\t\tif ( options.animate && scope_Locations[0] !== -1 ) {\n\t\t\taddClassFor( scope_Target, cssClasses[14], 300 );\n\t\t}\n\n\t\t// Determine how often to set the handles.\n\t\tcount = scope_Handles.length > 1 ? 3 : 1;\n\n\t\tif ( values.length === 1 ) {\n\t\t\tcount = 1;\n\t\t}\n\n\t\tsetValues ( count, values );\n\n\t\t// Fire the 'set' event for both handles.\n\t\tfor ( i = 0; i < scope_Handles.length; i++ ) {\n\t\t\tfireEvent('set', i);\n\t\t}\n\t}", "title": "" }, { "docid": "5cf5d77673ffcc59558efc2583343b04", "score": "0.61745644", "text": "changeValue(date) {\n this.setValue(date);\n }", "title": "" }, { "docid": "854b1912bdddd8c9e3c98bf0823a53b6", "score": "0.616924", "text": "function changeValue(val) {\n\t\t\t\tvalue = val;\n\t\t\t\tstarChange(val);\n\t\t\t}", "title": "" }, { "docid": "854b1912bdddd8c9e3c98bf0823a53b6", "score": "0.616924", "text": "function changeValue(val) {\n\t\t\t\tvalue = val;\n\t\t\t\tstarChange(val);\n\t\t\t}", "title": "" }, { "docid": "94ead83b24714d73ae23336b15c9b1f4", "score": "0.6167636", "text": "function resetValue() {\n\t var remainder = Site.scrollPane.width() - Site.scrollContent.width();\n\t var leftVal = Site.scrollContent.css( \"margin-left\" ) === \"auto\" ? 0 :\n\t parseInt( Site.scrollContent.css( \"margin-left\" ) );\n\t var percentage = Math.round( leftVal / remainder * 100 );\n\t Site.scrollbar.slider( \"value\", percentage );\n\t }", "title": "" }, { "docid": "c041e215cf0051275b6b48f044af786d", "score": "0.61565787", "text": "function setPriceValues() {\n let priceStartValue;\n let priceEndValue;\n if (priceStart.value != '') {\n priceStartValue = priceStart.value;\n }\n if (priceEnd.value != '') {\n priceEndValue = priceEnd.value;\n }\n priceSlider.noUiSlider.set([priceStartValue, priceEndValue]);\n }", "title": "" }, { "docid": "f9358724c89f9f58499e83532b3e587f", "score": "0.6156498", "text": "function c(e,t){(t=t||{})[\"aria-only\"]||m.slider(\"value\",e),S&&S.attr(\"aria-valuenow\",e)}", "title": "" }, { "docid": "a88f75cb230076fc45661e4106c07f5c", "score": "0.61470824", "text": "set value(value){\n this.element.value = value; \n }", "title": "" }, { "docid": "7b43df1bc4b9f32df9ad7de0a13a8990", "score": "0.61435205", "text": "function changeSensiValue() {\n let slider = document.getElementById('sensitivity-slider');\n let sensiValue = document.getElementById('nilai-sensi');\n sensiValue.innerHTML = slider.value;\n}", "title": "" }, { "docid": "63efa63c7258ffba6b3d67428cb9463b", "score": "0.61420316", "text": "writeValue(value) {\n this.setProperty('value', parseFloat(value));\n }", "title": "" }, { "docid": "a6e140e9f9be6e135a19aa2f05ae05d9", "score": "0.6135682", "text": "function setButton(_id,_v){ // update slider\nmyselect = $(\"#\"+_id);\n myselect.val(_v);\n myselect.slider('refresh');\n}", "title": "" }, { "docid": "40b05bd8d1dec2fbd4e7c75fcee4ffc5", "score": "0.61287403", "text": "function YGenericSensor_set_valueRange(newval)\n { var rest_val;\n rest_val = newval;\n return this._setAttr('valueRange',rest_val);\n }", "title": "" }, { "docid": "1aa78b414eb983d2174bbd410bf64d1a", "score": "0.61227703", "text": "writeValue(value) {\n this.setProperty('value', parseFloat(value));\n }", "title": "" }, { "docid": "202115a897dfc5e115657cd34d2dc444", "score": "0.61151385", "text": "function handleValue(val) {\n console.log(val);\n setValue(val);\n }", "title": "" }, { "docid": "9c0a16de4262b37e579e3669e886bfd7", "score": "0.61108345", "text": "function setValue( /*newValue*/ ) {\n if ( self.ignoreUpdates ) { return; }\n render();\n }", "title": "" }, { "docid": "74de51c4964b2f836f10f8c98906c89d", "score": "0.6109788", "text": "valueChanged() {\n const nativeInput = this.nativeInput;\n const value = this.getValue();\n if (nativeInput && nativeInput.value !== value) {\n nativeInput.value = value;\n }\n this.ionChange.emit({ value });\n }", "title": "" }, { "docid": "15529e6130555ef5e33e77cbd1c0c15a", "score": "0.60777515", "text": "function slide(evt, x, val, isSetValue) {\n\n // calculate value based on slide position\n if (val === undefined) {\n val = x / len * range;\n\n // x is calculated based on val. we need to strip off min during calculation\n } else if (isSetValue) {\n val -= conf.min;\n }\n\n // increment in steps\n if (step) {\n val = Math.round(val / step) * step;\n }\n\n // count x based on value or tweak x if stepping is done\n if (x === undefined || step) {\n x = val * len / range;\n }\n\n // crazy value?\n if (isNaN(val)) { return self; }\n\n // stay within range\n x = Math.max(0, Math.min(x, len));\n val = x / len * range;\n\n if (isSetValue || !vertical) {\n val += conf.min;\n }\n\n // in vertical ranges value rises upwards\n if (vertical) {\n if (isSetValue) {\n x = len -x;\n } else {\n val = conf.max - val;\n }\n }\n\n // precision\n val = round(val, precision);\n\n // onSlide\n var isClick = evt.type == \"click\";\n if (fireOnSlide && value !== undefined && !isClick) {\n evt.type = \"onSlide\";\n fire.trigger(evt, [val, x]);\n if (evt.isDefaultPrevented()) { return self; }\n }\n\n // speed & callback\n var speed = isClick ? conf.speed : 0,\n callback = isClick ? function() {\n evt.type = \"change\";\n fire.trigger(evt, [val]);\n } : null;\n\n if (vertical) {\n handle.animate({top: x}, speed, callback);\n if (conf.progress) {\n progress.animate({height: len - x + handle.height() / 2}, speed);\n }\n\n } else {\n handle.animate({left: x}, speed, callback);\n if (conf.progress) {\n progress.animate({width: x + handle.width() / 2}, speed);\n }\n }\n\n // store current value\n value = val;\n pos = x;\n\n // se input field's value\n input.val(val);\n\n return self;\n }", "title": "" }, { "docid": "67c42df47d11b0b6087d612b218b51fb", "score": "0.60539997", "text": "function setButton(_id,_v){ // update slider\n myselect = $(\"#\"+_id);\n myselect.val(_v);\n myselect.slider('refresh');\n}", "title": "" }, { "docid": "61aafaae880c93acda7afee0e9e0ecbc", "score": "0.6031353", "text": "function sliderOnSlide(event, ui) {\n // Last parameter passed to setParameterValue() will be 'true'\n // so that the function knows we are a slider, and it can\n // change the our value back in the case when the new value is\n // invalid for some reason.\n if (state.setParameterValue(paramName, ui.value, sliderDiv, true, 'slide') === undefined) {\n console.log('ERROR: Could not update the parameter named \"' + paramName + '\" with the value \"' + ui.value + '\".');\n }\n }", "title": "" }, { "docid": "13a3e3a813d89b624d6b577001e3d47f", "score": "0.6026505", "text": "function setInputValue(value) {\n //clear();\n \n if(USE_GUPPY) {\n guppy.import_text(value);\n guppy.activate();\n }\n else {\n //textInput.val(value);\n editor.setValue(value);\n } \n }", "title": "" }, { "docid": "3ac15bd1e0e67eeb1a79109907f4b34f", "score": "0.60220116", "text": "set Continuous(value) {}", "title": "" }, { "docid": "3ac15bd1e0e67eeb1a79109907f4b34f", "score": "0.60220116", "text": "set Continuous(value) {}", "title": "" } ]
603f089628e8b523e8830f4f938f629b
function to delete row on clicking each row.
[ { "docid": "2a86add8ab22cf50b6f5046e3070e553", "score": "0.0", "text": "function remove_row(th) {\n $(\"input[id=\\'\"+th.id+\"\\']\")[0].checked = false;\n $(th).remove();\n addition_of_nutrition();\n}", "title": "" } ]
[ { "docid": "6101a5a59be74a35c8cb2f955b5a8a9d", "score": "0.80456716", "text": "function deleteRow(e) {\n var row = e.target.parentElement.parentElement;\n row.parentElement.removeChild(row);\n }", "title": "" }, { "docid": "867e5837d50339c45700b409b847cec4", "score": "0.790097", "text": "function deleteRowClicked(e) {\n e.target.parentElement.parentElement.remove();\n highlightSaveBtn();\n}", "title": "" }, { "docid": "d6a4e2fed02b438490caaedba16446f2", "score": "0.78488094", "text": "function deleteRow(e)\n\t{\n\t\tfor(i in contactList)\n\t\t{\n\t\t\tif(e.target.id == contactList[i].contactId) // If the row's ID matches a contact with the same ID\n\t\t\t{\n\t\t\t\tcontactList.splice(i, 1); // Remove i from the array list\n\t\t\t\tregenerateTable();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "782a566478c6246778e64a2148903b1d", "score": "0.78161144", "text": "function deleteRow(e) {\n // funcionar funciona... pero me parece el codigo peor escrito de la historia. \"parentNodeparentNodeparentNodepare...\"\n const rowToDelete = e.currentTarget.parentNode.parentNode.parentNode\n const rowParent = rowToDelete.parentNode\n rowParent.removeChild(rowToDelete)\n}", "title": "" }, { "docid": "41343e7fd8f94620983fe7cb147a8f07", "score": "0.7771483", "text": "function deleteRow(e) {\n if (!e.target.classList.contains('deleteBtn')) {\n return;\n }\n e.target.closest('tr').remove();\n}", "title": "" }, { "docid": "1685d7aa20f8538861cc9be7828f76de", "score": "0.7591144", "text": "function deleteRow(row) {\n\t\t/*\n\t\tvar i = row.parentNode.rowIndex;\n\t\tdocument.getElementById(\"playlistTable\").deleteRow(i);\n\t\t*/\n\t\t\n\t\tvar p = row.parentNode;\n\t\tp.innerHTML = '';\n\t}", "title": "" }, { "docid": "e7d3e6d907e17f85bf3bc2b1d75ff815", "score": "0.75768703", "text": "function removeRow() {\n database.ref().child($(this).attr(\"id\")).remove();\n }", "title": "" }, { "docid": "1019f6df419d21eb052c2b2e08089780", "score": "0.75626737", "text": "function assignment43_48Q3(){\r\n var table = document.getElementById('myTbl'),rIndex,cIndex;\r\n for (var i = 1; i < table.rows.length; i++) {\r\n for (var j = 0; j < table.rows[i].cells.length; j++) {\r\n table.rows[i].cells[3].onclick = function () {\r\n rIndex = this.parentElement.rowIndex;\r\n table.deleteRow(rIndex);\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "aa6f122e0052ef01407dd55c78e88a27", "score": "0.7538359", "text": "function deleteRow() {\n tbl.deleteRow(-1);\n rows--;\n}", "title": "" }, { "docid": "c47698e8bab46c6f49f9af7ba8b24e36", "score": "0.75184894", "text": "function deleteRow(event) {\n console.log('Oi, you clicked the delete button!')\n\n //Have JQuery grab the delete button that was clicked!\n let theDeleteButton = $(event.target);\n\n //Travel up the DOM to the row we are deleting!\n let targetRow = theDeleteButton.closest('tr');\n\n //Then remove it from the DOM!\n targetRow.remove();\n\n } //End deleteRow function!", "title": "" }, { "docid": "89582751001e3d9e5530ba25dae1c279", "score": "0.7440821", "text": "function deleteRow(row) {\n \n var item = dataView.getItem(row);\n dataView.deleteItem(item.id);\n callback('delete', {'nid': item.id}, true);\n \n }", "title": "" }, { "docid": "8f3caf751f7db6a2d4b93a23294470ac", "score": "0.7419996", "text": "function tableDeleteButtonTask(rowId) {\n if (confirm(\"Do you want to delete current row?\")) {\n users.splice(rowId, 1);\n // regenerating table\n removeTableData();\n loadTable();\n }\n}", "title": "" }, { "docid": "257a59cca907a05843467fa8e6a5aa25", "score": "0.7399492", "text": "function delete_Row(currentRow) {\n var row = currentRow.parentNode.parentNode;\n\n var i = row.rowIndex;\n var tableRef = document.getElementById(\"awardsTable\");\n\n \n //var tbody = row.parentNode;\n \n tableRef.deleteRow(i);\n tableRef.deleteRow(i);\n btnCounter--;\n if(btnCounter==0){\n disableBtn();\n }\n \n}", "title": "" }, { "docid": "4ac4d30784af217a2cc559e7e170a9de", "score": "0.7353439", "text": "function delete_row(target){\n console.log(\"hit delete\"); // if delete button was clicked delete the row\n var td = target.parentNode; // move up to td\n var tr = td.parentNode; // move up to tr\n var row_index = tr.rowIndex; // get the index of the Delete button's row\n console.log(\"ROW INDEX \" + tr.rowIndex);\n recipe_table.deleteRow(row_index); // delete the row\n}", "title": "" }, { "docid": "143e0d2a168c9c178a873bf7f6012291", "score": "0.7331591", "text": "function delete_row(position)\n{\n document.getElementById('my_table').lastChild.removeChild(document.getElementById(\"row\" + position));\n}", "title": "" }, { "docid": "fc4c4d3087292ea87c4aa94e3e2321af", "score": "0.73302245", "text": "deleteRow(e) {\n if (this.pageID !== GC.id_home) {\n //beforeEditingNameEventEmit();\n this.showRelatedData(e);\n }\n else {\n this.modalContent = h(\"div\", null);\n }\n this.target = e.target.parentElement;\n this.modalTitle = this.headerTitles[e.target.cellIndex];\n changeDeleteRowColor(e, this.tableBody);\n this.targetName = e.target.parentElement.childNodes[0].innerText;\n this.isDelete = true;\n M.Modal.getInstance(this.modal).open();\n }", "title": "" }, { "docid": "b25cc1dca0176c363cdaa6c31149e000", "score": "0.7322228", "text": "function delete_row_new(row){\n \n var box = $(\"#mb-remove-row\");\n\t//debugger;\n box.addClass(\"open\");\n \tvar x = $('#delete-data').attr('controller'); \n // debugger;\n // console.log(this);\n // var x = $(this).attr('controller'); \n //var urln = x+'/'+row;\n var urln = x\n\t\t\n\t\tvar lastChar = urln.substr(-1); // Selects the last character\n\t\tif (lastChar != '/') { // If the last character is not a slash\n\t\t urln = urln +'/'+row; // Append a slash to it.\n\t\t}\n\t\telse{\n\t\t\turln = urln + row; \n\t\t}\t\t\n\t\t//return false;\n box.find(\".mb-control-yes\").on(\"click\",function(){\n //window.location.href= x+'/'+row;\n window.location.href= urln;\n });\n\t }", "title": "" }, { "docid": "015492e48c9f362ae9a187af5afeb7f6", "score": "0.72799027", "text": "function tableRowDelete() {\n const table = getActiveSection().getElementsByClassName(\"table\")[0]; // Gets the first table found in the active / open sections\n\n $(this).parent().parent().remove(); // Remove selected table row0\n\n let tableRows = table.getElementsByClassName(\"row0-text\");\n\n if(tableRows.length === 0)\n $(table).remove();\n }", "title": "" }, { "docid": "bd3ab6445611b8ee1020aace18c5a999", "score": "0.72499996", "text": "function deleteRow() {\n const parentTableBody = this.parentNode.parentNode.parentNode;\n let rowCount = parentTableBody.rows.length;\n if (rowCount > 1) {\n const currentRow = this.parentNode.parentNode;\n parentTableBody.removeChild(currentRow);\n rowCount--;\n setRowNumbers();\n } else {\n return;\n }\n }", "title": "" }, { "docid": "5e9372f9080a2ccd87c05f96cbe170b2", "score": "0.72495776", "text": "function delete_acc_row(data_table_id, row_no){\n row_no -= 1;\n $(\"#\"+data_table_id+\" tr[id=\"+row_no+\"]\").remove();\n accused_list.splice(row_no, 1);\n $(\"#accused_table\").html(build_rows_acc(accused_list));\n}", "title": "" }, { "docid": "cbd25cb545f8f35e64a57bb135a6a750", "score": "0.72445416", "text": "function delete_row_act(data_table_id, row_no){\n row_no -= 1;\n $(\"#\"+data_table_id+\" tr[id=\"+row_no+\"]\").remove();\n if(act_sec_list[row_no]['from_db'] == 'Yes'){\n act_sec_list[row_no]['soft_delete'] = \"Yes\";\n }else{\n act_sec_list.splice(row_no, 1);\n }\n $(\"#arrest_act_sec\").html(build_rows_act(act_sec_list));\n}", "title": "" }, { "docid": "af3ad7f1e5a2b156650d651ffeaa3276", "score": "0.7226867", "text": "function deleteSelectedRow(deleteButton) {\n var p = deleteButton.parentNode.parentNode;\n p.parentNode.removeChild(p);\n \n saveToDoList();\n}", "title": "" }, { "docid": "c2fcbda6295b8eed2c107c7154a0bb41", "score": "0.7226305", "text": "function _fnOnRowDelete(event) {\n iDisplayStart = _fnGetDisplayStart();\n if ($('tr.' + properties.sSelectedRowClass + ' td', oTable).length == 0) {\n //oDeleteRowButton.attr(\"disabled\", \"true\");\n _fnDisableDeleteButton();\n return;\n }\n var id = fnGetCellID($('tr.' + properties.sSelectedRowClass + ' td', oTable)[0]);\n if (properties.fnOnDeleting($('tr.' + properties.sSelectedRowClass, oTable), id, _fnDeleteRow)) {\n _fnDeleteRow(id);\n }\n }", "title": "" }, { "docid": "edfc23f370296c8d200aaf8c5dd31ac1", "score": "0.72142464", "text": "function deleteRowOnClick() {\r\n var myTable = document.getElementById(\"ticketTable\");\r\n var rowCount = myTable.rows.length; while(--rowCount) myTable.deleteRow(rowCount);\r\n $.get(\"deletetickets.php\");\r\n return false;\r\n}", "title": "" }, { "docid": "6e5ae97450e1757b4399ee22fa42eb85", "score": "0.7212819", "text": "function deleteStepRowTable(){\n\t$(this).closest(\"tr\").remove();\n}", "title": "" }, { "docid": "2286bef30172b671b304afc50b172380", "score": "0.7189117", "text": "function deleteRow(rowId){\n\tyesNo(mainTable.attr(\"data-cfn-delUrl\") + rowId, true, language_JSON[locale][\"deleteInform\"]);\n}", "title": "" }, { "docid": "7abcd0569021b9f3be192ca4597c62c2", "score": "0.71711785", "text": "function deleteRows() {\n\tvar tbl = document.getElementById('data_table'), // table reference\n\t\t\tlastRow = tbl.rows.length - 1, // set the last row index\n\t\t\ti;\n\ttbl.deleteRow(lastRow);\n}", "title": "" }, { "docid": "e44bbd827d2a7c4e60e7359162f160bb", "score": "0.7170549", "text": "function DeleteRows() {\n var rowCount = currentSchedule.rows.length;\n for (var i = rowCount - 1; i > 0; i--) {\n currentSchedule.deleteRow(i);\n }\n\n $(\".input-name-current\").empty();\n }", "title": "" }, { "docid": "90efab70037c4eef47f9d7fdc2f24282", "score": "0.7166569", "text": "function removeRow() {\n $(event.target).closest(\"tr\").remove();\n}", "title": "" }, { "docid": "3e5e0e69cb310ca4c612174803a72483", "score": "0.71657777", "text": "function delete_Maniputaltion(row,_st) {\r\n const id = row[0].children[0].getAttribute(\"data\")\r\n if (confirm(\"are you sure?\")) request.deleteFromDb(id,_st)\r\n }", "title": "" }, { "docid": "26c749faecc95f14f53798b24b1629d6", "score": "0.71624166", "text": "function deleteRow1(){\n document.getElementById(\"row1\").remove();\n}", "title": "" }, { "docid": "5878aa6aafd7c77b4f3926ea93d381fa", "score": "0.7150067", "text": "function deleteRow(id) {\n var index = '#' + id;\n datatableApi.row(index).remove().draw();\n showTotalPrice();\n}", "title": "" }, { "docid": "fa1dd687239cc5df5693ef31c56c9e98", "score": "0.7143226", "text": "function deleteRow(id){\n console.log(id);\n}", "title": "" }, { "docid": "b2a41124dc3f15910175d230eda73292", "score": "0.71353775", "text": "function deleteRow(r) {\n var i = r.parentNode.parentNode.rowIndex;\n document.getElementById(\"myTable\").deleteRow(i);\n}", "title": "" }, { "docid": "d780b26a1bb7175b128788e7dc399d96", "score": "0.7127011", "text": "function deleteData(element) {\n document.getElementById(\"etable\").deleteRow(element.parentNode.parentNode.rowIndex);\n}", "title": "" }, { "docid": "d108b63101fce9f74dad38442618ddfe", "score": "0.71117836", "text": "function removeRow(oButton) {\r\n var fjTab = document.getElementById(\"fruit-basket\");\r\n fjTab.deleteRow(oButton.parentNode.parentNode.rowIndex); // buttton -> td -> tr\r\n}", "title": "" }, { "docid": "624bab8fd7be8fbbff631ef708e9e3ec", "score": "0.70918995", "text": "function removeRow(event){\n\t$(event).closest('span.row').remove();\t\n}", "title": "" }, { "docid": "53a8db7f6965636af9622d86f67c9890", "score": "0.7080222", "text": "function removeRow(oButton) {\n var empTab = document.getElementById('sentimentTable');\n empTab.deleteRow(oButton.parentNode.parentNode.rowIndex); // buttton -> td -> tr\n}", "title": "" }, { "docid": "799b236f288c7ee8b81b00f36a02d768", "score": "0.7078233", "text": "function removeRow (trArray) {\n let btnDelete = document.createElement('input');\n let td = document.createElement('td');\n btnDelete.type = 'button';\n btnDelete.value = \"Delete\";\n td.appendChild(btnDelete);\n\n trArray[trArray.length - 1].appendChild(td);\n\n btnDelete.onclick = function (e) {\n //remove object from array according to index\n let index = e.target.parentNode.parentNode.rowIndex;\n if(index !== -1) {\n tableArray.splice(index - 1, 1);\n }\n\n //remove row in which the button was clicked\n table.removeChild(e.target.parentNode.parentNode);\n };\n}", "title": "" }, { "docid": "0dee52a1735888390b247861bc04ece7", "score": "0.7077004", "text": "function onDelete(td) {\n row = td.parentElement.parentElement;\n document.getElementById(\"employeeList\").deleteRow(row.rowIndex);\n resetForm();\n \n}", "title": "" }, { "docid": "65ba112e954932577c270e377c594d57", "score": "0.70645297", "text": "function deleteRow() {\n\talert(redFlags);\n\t\t\t\t// try {\n\t\t\t\t// \tlet table = document.getElementById(redFlags.id);\n\t\t\t\t// \tlet rowCount = table.rows.length;\n\n\t\t\t\t// \tfor(let i=0; i<rowCount; i++) {\n\t\t\t\t// \t\tlet row = table.rows[i];\n\t\t\t\t// \t\tlet chkbox = row.cells[0].childNodes[0];\n\t\t\t\t// \t\tif(null != chkbox && true == chkbox.checked) {\n\t\t\t\t// \t\t\ttable.deleteRow(i);\n\t\t\t\t// \t\t\trowCount--;\n\t\t\t\t// \t\t\ti--;\n\t\t\t\t// \t\t}\n\t\t\t\t// \t}\n\t\t\t\t// }\n\t\t\t\t// catch(e) {\n\t\t\t\t// \talert(e);\n\t\t\t\t// }\n\t\t\t}", "title": "" }, { "docid": "3f1bbcaeb121bc776145fa3f9f6c2f96", "score": "0.7059602", "text": "function onDelete(td) {\n if (confirm('Are you sure to delete this record ?')) {\n // TO_DO Add code to find index of item need to remove\\\n // TO_DO add code to remove item from main array\n row = td.parentElement.parentElement;\n document.getElementById(\"datalist\").deleteRow(row.rowIndex);\n resetForm();\n }\n}", "title": "" }, { "docid": "4d3a6f62cfc3651ebbee6910384feba0", "score": "0.70576805", "text": "function removeContact(i) {\n \n document.getElementById('contacts').deleteRow(i);\n \n\n\n\n} // end delete Contact function", "title": "" }, { "docid": "4d3a6f62cfc3651ebbee6910384feba0", "score": "0.70576805", "text": "function removeContact(i) {\n \n document.getElementById('contacts').deleteRow(i);\n \n\n\n\n} // end delete Contact function", "title": "" }, { "docid": "988425601a034bad5259a111254eabd5", "score": "0.7055944", "text": "function delRow(){\n\tvar table=document.getElementById('dynaTable');\n\tvar rcount=table.rows.length; //No.of rows\n\ttable.deleteRow(rcount-1); //Deletes a row from the last.\n\tcalcCount();\n}", "title": "" }, { "docid": "c19c6b500b5d2e4b212507d326bee413", "score": "0.70436823", "text": "function deleteFlights (button, id_num, row) {\n\t\n\tbutton.id = \"delete\" + id_num; \n\t\n\tbutton.appendChild(document.createTextNode('Delete This Flight'));\n\tbutton.onclick = function() {\n\t\tsendDeleteFlight(row);\t\n\t\trow.parentNode.removeChild(row);\n\t}\n}", "title": "" }, { "docid": "384f42e2205ef1a72d1a75d4d53da211", "score": "0.7040324", "text": "function deleteRowTable(obj)\r\n{\r\n\tvar tbl= document.getElementById(obj); \r\n\tvar isSelected=false;\r\n\tfor(var i=1;i<tbl.rows.length;i++)\r\n\t{\r\n\t\tif(tbl.rows[i].cells[0].className == \"rowRev\")\r\n\t\t{\r\n\t\t\tisSelected=true;\r\n\t\t\tif(i>1)\r\n\t\t\t{\r\n\t\t\t tbl.deleteRow(i);\r\n\t\t\t //colAllTotal('voucherDetail_debitAmount','voucherDetail_creditAmount','debitTotal','creditTotal');\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\t\t\t \r\n\t\t\t bootbox.alert(\"You cannot delete this row\"); \r\n\t\t\t return false;\r\n\t\t\t}\r\n\t\t}\r\n\t } \r\n\t if(!isSelected)\r\n\t {\r\n\t bootbox.alert(\"Select the row to be deleted.\");\r\n\t return;\r\n\t }\r\n \r\n}", "title": "" }, { "docid": "de67d31551213e5b9193832385bdb6c1", "score": "0.70332676", "text": "function delete_row(table, fldname,id) {\n\t\tBootstrapDialog.show({\n\t\t\t\t\ttitle: 'Confirm delete',\n\t\t\t\t\tmessage: 'Delete row with ' + fldname + ' matching ' + id + ' from ' + table + '?',\n\t\t\t\t\tbuttons: [{\n\t\t\t\t\t\tlabel: 'Delete',\n\t\t\t\t\t\taction: function(dialogItself){\n\t\t\t\t\t\t\tvar url = \"api/api.php\";\n\t\t\t\t\t\t\tvar method = \"POST\";\n\t\t\t\t\t\t\toptions = { 'view': 'delete-' + table, \n\t\t\t\t\t\t\t 'field': fldname, \n\t\t\t\t\t\t\t\t\t\t'id': id};\n\t\t\t\t\t\t\tajax_proxy(url, method, options, funcSuccess);\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Cancel',\n\t\t\t\t\t\taction: function(dialogItself){\n\t\t\t\t\t\t\tdialogItself.close();\n\t\t\t\t\t\t}\n\t\t\t\t\t}]\n\t\t\t\t});\t\n}", "title": "" }, { "docid": "2a78a8fca1c8959f866cb7df5cec54d1", "score": "0.7027494", "text": "function removeRow(ev) {\n var $target = $(this);\n var rowIndex = $target.attr('data-rowIndex');\n var placeholders = [];\n\n for (var i = 0; i < l[rowIndex].columns.length; i += 1) {\n placeholders.push(l[rowIndex].columns[i].properties.placeholder);\n }\n\n $wrapper[0].dispatchEvent(new CustomEvent('checkForContent', {\n bubbles: true,\n detail: {\n type: 'row',\n placeholders: placeholders,\n rowIndex: rowIndex\n }\n }));\n } // handle when content is allowed for deletion", "title": "" }, { "docid": "b69696363b847c296fbb20378d2d55f4", "score": "0.7025101", "text": "function limpiarTabla(){ \n let numRow = document.getElementById(\"prueba\").childElementCount\n for( let i = 1; i< numRow; i++){\n Tregistro.deleteRow(1)\n }\n \n}", "title": "" }, { "docid": "9520472d36609b2a3430cf7dfd549998", "score": "0.7012466", "text": "function del_row(table_key_value, target, $this) {\n callAjax(\"delete\", table_key_value, {}, function (res) {\n hideLoader();\n if (res.success) {\n jqSuccessAlert(target + \" Removed Successfully\");\n $this.closest(\"tr\").remove();\n } else {\n jqErrorAlert(\"Unable To Remove \" + target);\n }\n });\n}", "title": "" }, { "docid": "9e70deb04238a1d5dbea54b0a8837072", "score": "0.70061344", "text": "function eliminar_row(row) {\n var rowIndex = row.parentNode.parentNode.parentNode.rowIndex;\n document.getElementById(\"tablaEditarVentas\").deleteRow(rowIndex);\n calcularTotal()\n}", "title": "" }, { "docid": "b71a12d0aea463a3a061e2bb0eb5c877", "score": "0.70029116", "text": "function attach_delete(){\n $('.delete').click(function(){\n $(this).closest('.row').remove();\n create_name_attributes();\n });\n}", "title": "" }, { "docid": "91493e278307ed5f47f2036e96cb2ded", "score": "0.6999554", "text": "function deleteRow(obj) {\n var index = obj.parentNode.parentNode.rowIndex;\n var table = document.getElementById(\"user_table\");\n table.deleteRow(index);\n }", "title": "" }, { "docid": "bf5ef167ee905e0f73cf280bc0ec104d", "score": "0.6978995", "text": "function remove_row () {\r\n\t\t\r\n\t\tvar row_number = $(this).attr('name').replace('remove_', '');\r\n\t\tvar row_id = 'row_' + row_number;\r\n\t\t$('#' + row_id).remove();\r\n\t\t\r\n\t\t//Update total row\r\n\t\tvar total_row = $('#total_row').val();\r\n\t\t$('#total_row').val(parseInt(total_row) - parseInt(1));\r\n\r\n\t\t\r\n\t}", "title": "" }, { "docid": "034d81f4799064acb1de89ce45694f70", "score": "0.69651973", "text": "function deleteButtonClick (event) {\n var current = event.target\n var btnIndex = current.dataset.index\n\n coolPeople.splice(btnIndex, 1)\n tableBuildFunc()\n}", "title": "" }, { "docid": "43c418e04ff4be7f6b9f0b725859a2ca", "score": "0.69505143", "text": "function onDelete(td) \r\n{\r\n if (confirm('Are you sure to delete this record ?')) {\r\n row = td.parentElement.parentElement;\r\n document.getElementById(\"userlist\").deleteRow(row.rowIndex);\r\n resetForm();\r\n }\r\n}", "title": "" }, { "docid": "fa39060f673babefdccfb78f9cd76c7e", "score": "0.6946456", "text": "function deleteRow(item, id) {\n var row = item.parentNode.parentNode;\n //first set the checkbox to false so that it will take care of all the actions related to CSS and submit button\n row.cells[0].childNodes[0].checked = false;\n toggleCheckBox(row.cells[0].childNodes[0]);\n\n //finally delete the row\n\n if (document.getElementById(id).style.display == \"table-row\") {\n document.getElementById(id).style.display = \"none\";\n }\n row.parentNode.removeChild(row);\n}", "title": "" }, { "docid": "04d076ad5b635fb95f81d097a551108e", "score": "0.6929811", "text": "function deleteRow($element) {\n\tif ($element.prevObject) {\n\t\tlet $tr = $element.parent().parent();\n\t\tlet rno = $tr.children('td')[1].textContent;\n\t\t$tr.remove();\n\t\tlet index = students.findIndex(student => student.rno == rno);\n\t\tstudents.splice(index, 1);\n\t} else {\n\t\tswal({\n\t\t\ttitle: 'Are you sure?',\n\t\t\ttext: 'You are about to delete an entry!',\n\t\t\ttype: 'warning',\n\t\t\tshowCancelButton: true,\n\t\t\tconfirmButtonColor: '#3085d6',\n\t\t\tcancelButtonColor: '#d33',\n\t\t\tconfirmButtonText: 'Delete!'\n\t\t}).then(function () {\n\t\t\tlet $tr = $element.parent().parent();\n\t\t\tlet rno = $tr.children('td')[1].textContent;\n\t\t\t$tr.remove();\n\t\t\tlet index = students.findIndex(student => student.rno == rno);\n\t\t\tstudents.splice(index, 1);\n\t\t\tserialize();\n\t\t}).catch(swal.noop);\n\t}\n}", "title": "" }, { "docid": "283af056148d3a8f63dbb0e31ba41159", "score": "0.6926802", "text": "function deleteWordRow(row){\n var d = row.parentNode.parentNode.rowIndex;\n document.getElementById('tblWords').deleteRow(d);\n}", "title": "" }, { "docid": "b77a03f1cbd46bdb8e1e7d4d38525dcd", "score": "0.69185543", "text": "function deleteProduct(e) {\n // Selects the product row (tr) from the delete button that was clicked.\n let product = e.currentTarget.parentNode.parentNode;\n product.parentNode.removeChild(product);\n}", "title": "" }, { "docid": "902d25879fc95e5a5c1f6bd600a19a20", "score": "0.6917052", "text": "function deleteCertificateRow(e,f) {\n\tvar dataID = e;\n\tvar $obj = $(f).find('tr[data-id=\"' + dataID + '\"]');\n\tvar $btn = $obj.find('td').find('a');\n\n\t$obj.addClass('deleted');\n\t$obj.find('input').attr('readonly', 'true');\n\n\t$obj.find('.custom-select').attr('disabled', 'disabled'); // disables the selectboxes\n\n\t$btn.addClass('deleted');\n\t$btn.find('.hubitat').addClass('undo');\n\taddAlert('alert-danger', '<strong>&#x2715;</strong> Delete row #'+dataID);\n}", "title": "" }, { "docid": "01a43bbbb58c80ba391f97c198b7913f", "score": "0.69164854", "text": "function DELETE(index) {\r\n let rowNum = \"row\" + (index + 1);\r\n let deleteBtnText = $(\"#\" + rowNum + \" .deleteBtn\").text();\r\n if (deleteBtnText === \"Cancel\") {\r\n cancelFunc(index);\r\n } else {\r\n deleteFunc(index);\r\n }\r\n}", "title": "" }, { "docid": "bc99c1cb80fb69cfbcdd1cb6fbe7b70f", "score": "0.6888929", "text": "function removeRow(event){\n\t$(event).closest('span').remove();\t\n}", "title": "" }, { "docid": "386cdfe1905335fa2518ca58575c6bd7", "score": "0.6886816", "text": "function deleteSetup(){\n var deleteButtons= document.querySelectorAll('.rm button');\n //Add event to every button\n for (var i = 0; i<deleteButtons.length; i++) {\n var $button = deleteButtons[i];\n $button.addEventListener(\"click\", function(){\n var $row = event.currentTarget.closest('tr');\n var $body = $row.parentNode;\n $body.removeChild($row); \n });\n }\n}", "title": "" }, { "docid": "c133682d7bc03c1182d2a46805c4cc3c", "score": "0.68801504", "text": "function deleteTableDataRow(id) {\r\n\t$(id).remove();\r\n}", "title": "" }, { "docid": "ff6ee4e1e026baa44fd1fcb714520723", "score": "0.68515986", "text": "function deleteRow(obj) {\n var index = obj.parentNode.parentNode.rowIndex;\n var table = document.getElementById(\"myTableData\");\n table.deleteRow(index);\n}", "title": "" }, { "docid": "faee76c3792233f956816c5ed5f8d61b", "score": "0.68361044", "text": "function iconDelete(){\n\t\tvar tablerow = $(this).parents(\"tr\");\n\t\tconsole.log(tablerow.length);\n\t\tvar id = tablerow.attr(\"data-ID\");\n\n\t\t//TODO: some kind of confirmation dialog\n\t\t//Server: send delete to server\n\t\t$.getJSON( \"../xml/pizza.php\", //The URL to perform the lookup\n\t\t\t{action : \"delete\", id : id}, //The data you send\n\t\t\tfunction (result){ //The function to fire upon return\n\t\t\t\tconsole.log(\"delete: \" + result);\n\t\t});\n\n\t\t//Update tablesorter\n\t\tupdateTable();\n\n\n\t\ttablerow.remove();\n\t}", "title": "" }, { "docid": "13b363054bd2e2b3ce2fdc7bd0e1bbb9", "score": "0.683299", "text": "function deleteSpyRecord() {\n //deletes entire spy row\n $(this).parent().remove();\n}", "title": "" }, { "docid": "41efe800b4a5fafe7760e1e2d2c117e7", "score": "0.6826384", "text": "function deleteObjectRow(id) {\n\n var row = $(\"#\" + id);\n row.remove();\n\n \n}", "title": "" }, { "docid": "c6c58954510afa04ea618bbf6023b402", "score": "0.68190634", "text": "rowClickDelete(event) {\n\t\tvar result = confirm(\"Want to delete?\");\n\t\tif (result) {\n\t\t\tevent.preventDefault();\n\t\t\tvar data = new FormData();\n\t\t\tif(event.target.id !=\"\" ){\t\t\t\n\t\t\t\tdata.append('json',JSON.stringify({id : event.target.id}));\n\t\t\t\t//this.fetchPost('http://buzzle.chrysalis.world/buzzleConceptCards-api/index.php/client/deleteClassCourse?key=htn6ASfBr4X7GF29uCciOPeDaysWjJMx',data);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\talert(\"ID is missing. Unable to delete. Please contact admin\")\n\t\t\t}\n\t\t}\n \n }", "title": "" }, { "docid": "eb73796bab3bafbe9971663db6e2d20d", "score": "0.68125945", "text": "function Remove(row) {\n var name = $(row).parents('table').attr('id');\n\n var t = $('#' + name).DataTable();\n\n var tableRow = t.row($(row).parents('tr'));\n\n t.row(tableRow).remove().draw(false);\n\n}", "title": "" }, { "docid": "09abae6dd39f6fa108506c4c9023831a", "score": "0.68123096", "text": "function deleteRow(id) {\n var deleteList = $('.delete-row')\n var current = deleteList.index(id);\n var row = document.getElementsByTagName('tr')[current + 1];\n row.remove();\n reIndexRows();\n countTableRows();\n}", "title": "" }, { "docid": "22dd6eff33f15c13f4e4cd8fa5331f6f", "score": "0.6807589", "text": "function delRow()\n{\n _MenuGrid.delRow();\n displayGridValues();\n updateGridRow(); \n// EnableDisableUpDownBtns();\n// EnableDisableAddDelBtns(); \n}", "title": "" }, { "docid": "fedbfd3268cd871ff4b3570f6a185937", "score": "0.6806993", "text": "function deleteRow() {\n var grid = $(\"#TestCaseProceduresGrid\");\n var rowIds = grid.jqGrid('getGridParam', 'selarrrow');\n $.each(rowIds, function (index, rowid) {\n $(\"tr#\" + rowid).remove();\n });\n grid.resetSelection();\n reorder();\n}", "title": "" }, { "docid": "dd800831bcd4e7c90eb2f656e0134252", "score": "0.68064386", "text": "function deleteRow(event) {\n let buttonClicked = event.target; //checking when the trash button is clicked\n\n if (buttonClicked.classList[0] == \"trashButtonClass\") {\n let row = buttonClicked.parentElement.parentElement; //Trash Button's parent -> Table Data's Parent -> Table Row\n row.classList.add(\"deleteRowAnimation\");\n\n row.addEventListener(\"transitionend\", () => {\n row.remove(); //Deleting the row class once the transition finishes\n });\n }\n\n}", "title": "" }, { "docid": "bb2659eb5acb468b2b8a3d28750409a6", "score": "0.68020266", "text": "function deleteTableRow($id) {\n var tableRow = $('tr[data-id=\"' + modalSongId + '\"]');\n tableRow.remove();\n }", "title": "" }, { "docid": "7aeaf223399c2c1d2173faa0f70bd351", "score": "0.68004763", "text": "function delete_table(){\n var table = document.getElementById(\"user-list\");\n while(table.rows.length > 1) {\n table.deleteRow(1);\n }\n}", "title": "" }, { "docid": "166dd250a0a309894625706777629033", "score": "0.67983174", "text": "function removeRow(table, rowId) {\r\n\tconsole.log('removeClicked');\r\n\t\r\n\tvar lastId = document.getElementById(table).getElementsByTagName(\"tr\").length-3;\r\n\t\r\n\tif (lastId != 0) {\r\n\t\tvar element = document.getElementById(rowId+\"[\"+lastId+\"]\");\r\n\t\telement.outerHTML = \"\";\r\n\t\tdelete element;\r\n\t}\r\n}", "title": "" }, { "docid": "a0882a5fc5fa7651060885669ed59955", "score": "0.6796587", "text": "function deleteButton(tableid){\n\t\n\tvar seqTable = document.getElementById(tableid);\n\tvar numOfRows = seqTable.rows.length;\n\t\n\tvar trId = tableid + \"_\" + (numOfRows-1);\n//\tif(!($('#' + trId)[0].id)){\n//\t\talert($('#' + trId)[0].id);\n\t$('#' + trId).remove();\n//\t}\n}", "title": "" }, { "docid": "2aa40e06278e386f248f0bb90404f0bd", "score": "0.6790943", "text": "function deleteRowDetalladoIdrPlagicidas(r){\n\tvar i = r.parentNode.parentNode.rowIndex;\n\tvar analito = $(r).parents(\"tr\").find(\"td\").eq(0).html();\n\tif (confirm('Seguro Eliminar el Analito ['+analito+']')){\n \t\tdocument.getElementById(\"idTablaIDRPlaguicidas\").deleteRow(i); \t\t\n }\n}", "title": "" }, { "docid": "f3d51632e8756a2cc9b7b9244a28f3ca", "score": "0.67846835", "text": "function eliminaEntrata(row, e) {\n e.preventDefault();\n $('#pulsanteProseguiElimina').substituteHandler('click', function(e) {\n e.preventDefault();\n eliminaRiga('Entrata', row);\n });\n $('#modaleElimina').modal('show');\n }", "title": "" }, { "docid": "bdc7fecc65023cd0f2cda95e776f897d", "score": "0.6778427", "text": "function deleteEmployee() {\n console.log('in deleteEmployee');\n //create variable to hold array[i] when delete button pressed\n let removeEmployee = $(this).closest(`tr`).index();\n console.log('Remove employee:', removeEmployee);\n\n //remove array[i] \n employeeInfoArray.splice(removeEmployee, 1);\n\n //re-render page\n render();\n} //end deleteEmployee", "title": "" }, { "docid": "2cc5ad3dbbc9358588ac853c052978d4", "score": "0.6776781", "text": "function deleteSelected() {\n\tlet $tr = $('tr.table-danger');\n\tswal({\n\t\ttitle: 'Are you sure?',\n\t\ttext: `You are about to delete ${$tr.length} entries!`,\n\t\ttype: 'warning',\n\t\tshowCancelButton: true,\n\t\tconfirmButtonColor: '#3085d6',\n\t\tcancelButtonColor: '#d33',\n\t\tconfirmButtonText: 'Confirm!'\n\t}).then(function () {\n\t\t$tr.each(function (index) {\n\t\t\tdeleteRow($(this).children().children('a:first-child'));\n\t\t});\n\t\ttoggleDelBtn();\n\t\tserialize();\n\t\tswal(\n\t\t\t'Deleted!',\n\t\t\t`${$tr.length} entries deleted!`,\n\t\t\t'success'\n\t\t);\n\t}).catch(swal.noop);\n}", "title": "" }, { "docid": "a5aa28b992056b00b17652912b3c881d", "score": "0.67649245", "text": "function deleteRow(){\n var con = document.getElementById('con');\n var lastChild = con.children[con.children.length-1];\n con.removeChild(lastChild);\n}", "title": "" }, { "docid": "5a3c3ea6085410c7b42e94a2ce640241", "score": "0.67637795", "text": "function create_delete_button(td) {\n // Replace checkbox with image\n td.find(\"input:checkbox\").hide();\n td.append('<a class=\"delete\" href=\"#\">' + delete_link_html + \"</a>\");\n\n td.find(\"a.delete\")\n .click(function () {\n current_row = $(this).parent(\"td\").parent(\"tr\");\n table = current_row.parent().parent();\n if (current_row.is(\".has_original\")) {\n // This row has already been saved once, so we must keep checkbox\n $(this).prev(\"input\").attr(\"checked\", true);\n current_row.addClass(\"deleted_row\").hide();\n } // This row has never been saved so we can just remove the element completely\n else {\n current_row.remove();\n }\n\n update_positions(table, true);\n })\n .removeAttr(\"href\")\n .css(\"cursor\", \"pointer\");\n}", "title": "" }, { "docid": "7074b5da63528ab28d1af32a29cc88a3", "score": "0.6762842", "text": "function deletebtn() {\n let id = parseInt(event.target.dataset.id);\n db.products.delete(id);\n table();\n\n}", "title": "" }, { "docid": "05501cf53365d2fbd802a4e99592cf74", "score": "0.67610466", "text": "function deleteCell(button) {\n var activeRow = button.parentNode.parentNode.rowIndex;\n var tab = samples_table.rows[activeRow];\n let sample_id_td = tab.getElementsByTagName(\"td\")[1].innerText\n console.log(sample_id_td);\n deleteData(sample_id_td);\n}", "title": "" }, { "docid": "c8b7bb361dfdcf955f9bb48fe7fe59c7", "score": "0.6756368", "text": "function deleteRowTable(indexRow) {\n let conf = confirm('Deseja realmente excluir esse registro?');\n if (conf == true) {\n let idsArray = [];\n $(\"tr[data-index-row='\" + indexRow + \"'] td\").each(function (index) {\n if ($(this).attr('data-id-item')) {\n idsArray[index] = $(this).attr('data-id-item');\n }\n });\n if (idsArray) {\n $.ajax({\n type: \"POST\",\n url: \"\",\n data: { mod: 'window', action: 'deleteDataArray', param: idsArray },\n error: function () { alert(\"Não foi possível atender sua requisição.\"); },\n success: function (data, textStatus, jqXHR) {\n if (data.indexOf('ok') != -1) {\n $(\"tr[data-index-row='\" + indexRow + \"']\").remove();\n alert('Registro deletado!');\n } else {\n alert(data);\n }\n }\n });\n } else {\n alert('Não há IDs no array, ERROR!');\n }\n }\n}", "title": "" }, { "docid": "c31e4019c0d3ab1700daaff3006805de", "score": "0.6756319", "text": "function deleteProductHandler(event) {\n let findTableRow = event.currentTarget.parentElement.parentElement\n findTableRow.remove()\n}", "title": "" }, { "docid": "bf108ab9d2a43dea287fab276b233b82", "score": "0.675527", "text": "function deleteSocial(tblId, x) {\n document.getElementById(tblId).deleteRow(x.parentNode.parentNode.rowIndex);\n}", "title": "" }, { "docid": "f5d4f671a987682c088ad30aee5742fd", "score": "0.6741731", "text": "function deletedRow(table_id, row_id)\r\n{\r\n\t//remove from data-model\r\n\tfor(var demand_id in demands_supplies)\r\n\t{\r\n\t\t//found demand: delete\r\n\t\tif(demand_id == row_id){ delete demands_supplies[demand_id]; break;}\r\n\t\t\r\n\t\t//check if its within supply\r\n\t\tfor(var supply_id in demands_supplies[demand_id][\"Supplies\"]){ if(row_id==supply_id){ delete demands_supplies[demand_id][\"Supplies\"][supply_id]; break;} }\r\n\t}\r\n\t\r\n\t//update the google data-model\r\n\tdelete flat_data_model[row_id];\r\n\trefreshChartData();\r\n}", "title": "" }, { "docid": "cbe8c4efad1b30b78689e5c5e878da83", "score": "0.6739613", "text": "function deleteRow(tableId, buttonId) {\n\n //Get the table and determine the number of rows\n var table = document.getElementById(tableId);\n var rowCount = table.rows.length;\n\n //Create a string that matches format of the delete button id\n var deleteString = 'row'+buttonId;\n\n //Keep track of the row index\n var rowIndex = -1;\n\n //Iterate through the table to find the matching row index of the delete button clicked\n for(var i = 1; i < rowCount; i++) {\n //Get the row\n var row = table.rows[i];\n //Get the children (cells) of that row\n var rowCells = row.getElementsByTagName('td');\n //Grab the string value of the hidden label of that row (last element)\n var delButtonCell = rowCells[rowCells.length - 1];\n var rowString = delButtonCell.children[0].innerHTML;\n //Delete the row when a match is found\n if(rowString == deleteString) {\n rowIndex = i;\n if(rowIndex == -1) {\n console.log('DELETE ERROR');\n }\n else {\n table.deleteRow(rowIndex);\n break;\n }\n }\n }\n\n //Open the delete request to delete on the backend\n var req = new XMLHttpRequest();\n var param = '/delete-plans';\n req.open(\"DELETE\", param+\"?id=\"+buttonId, true);\n req.addEventListener(\"load\",function(){\n if(req.status >= 200 && req.status < 400){\n console.log('DELETE REQUEST SENT');\n } else {\n console.log('DELETE REQUEST ERROR');\n }\n });\n\n //Send the request\n req.send(param+\"?id=\"+buttonId);\n\n}", "title": "" }, { "docid": "e90408684a4fc73d246e8c85472cfac7", "score": "0.6738616", "text": "function deleteRow(obj, id) {\n var index = obj.parentNode.parentNode.rowIndex;\n var table = document.getElementById(\"myTableData\");\n table.deleteRow(index);\n ajaxDelete(id);\n }", "title": "" }, { "docid": "450c27e6e04cbbbf1170bf26de9131e1", "score": "0.67233217", "text": "function deleteRowDetalladoIdrPlagicidasAgua(r){\n\tvar i = r.parentNode.parentNode.rowIndex;\n\tvar analito = $(r).parents(\"tr\").find(\"td\").eq(0).html();\n\tif (confirm('Seguro Eliminar el Analito ['+analito+']')){\n \t\tdocument.getElementById(\"idTablaIDRPlaguicidas\").deleteRow(i); \t\t\n }\n}", "title": "" }, { "docid": "3c2ff4fca23572364e8a5812339b4c51", "score": "0.672289", "text": "function addRowHandlers() {\n var table = document.getElementById(\"table\");\n var rows = table === null || table === void 0 ? void 0 : table.getElementsByTagName(\"tr\");\n var x = rows === null || rows === void 0 ? void 0 : rows.length;\n for (var i = 1; i < x; i++) {\n console.log(i);\n var currentRow = table.rows[i];\n var createClickHandler = function (row) {\n return function () {\n var cell = row.getElementsByTagName(\"td\")[0];\n idtoDelete = cell.innerHTML;\n if (idtoDelete == undefined) {\n alert(\"choose a brand\");\n return;\n }\n else\n alert(\"id:\" + idtoDelete);\n };\n };\n currentRow.onclick = createClickHandler(currentRow);\n }\n}", "title": "" }, { "docid": "a60c43d1e3dffd399a9a262511ac218e", "score": "0.67216915", "text": "function delete_record(id) { //DELETE\n document.getElementById(\"delete-button-\" + id).innerHTML = `<div class=\"delete-loader\"></div>`; //replacing delete icon with loader \n row = document.getElementById(\"record-\" + id);\n row.parentNode.removeChild(row);\n}", "title": "" }, { "docid": "f2f857058cf7196c971463a6f9d6888f", "score": "0.671331", "text": "function removeRow(src)\n{\t \n //window.alert(src.date);\n var oRow = src.parentNode.parentNode; \n var tb=document.getElementById(\"mytbd\").deleteRow(oRow.rowIndex);\n testi--;\n /* if(testi==0)\n {\n var table=document.getElementById(\"mytb\");//when all row delete, table invisible.\n\n table.style.visibility='hidden';\n\n } */\n\n}", "title": "" }, { "docid": "f2f857058cf7196c971463a6f9d6888f", "score": "0.671331", "text": "function removeRow(src)\n{\t \n //window.alert(src.date);\n var oRow = src.parentNode.parentNode; \n var tb=document.getElementById(\"mytbd\").deleteRow(oRow.rowIndex);\n testi--;\n /* if(testi==0)\n {\n var table=document.getElementById(\"mytb\");//when all row delete, table invisible.\n\n table.style.visibility='hidden';\n\n } */\n\n}", "title": "" }, { "docid": "1967300a36bd6c295118697100151acb", "score": "0.67050856", "text": "function f_del() {\n if (tableau.rows.length) {\n tableau.removeChild(tableau.lastChild);\n }\n\n}", "title": "" }, { "docid": "6fae9771141d5cb12cdbdf6bf784da14", "score": "0.6686873", "text": "function removeRow1(src)\n{\t \n //window.alert(src.date);\n var oRow = src.parentNode.parentNode; \n var tb=document.getElementById(\"mytbd\").deleteRow(oRow.rowIndex);\n testi--;\n /* if(testi==0)\n {\n var table=document.getElementById(\"mytb\");//when all row delete, table invisible.\n\n table.style.visibility='hidden';\n\n } */\n\n}", "title": "" } ]
da65f80f1a4d7cbdc952dd1a35bec5bb
inform if userGuess isn't a vowel
[ { "docid": "c36fd4101389f7cc81264e1c11154bb7", "score": "0.74465036", "text": "function notVowel() {\n message.innerHTML = \"'\" + userGuess + \"'\" + \" is not a vowel.<br/>Guess again.\";\n return;\n}", "title": "" } ]
[ { "docid": "04685207a75fe977efe42a54fdcf735f", "score": "0.71731216", "text": "function isVowel(c){\n switch (c.toLowerCase()){\n case 'a':\n return true;\n case 'e':\n return true;\n case 'i':\n return true;\n case 'o':\n return true;\n case 'u':\n return true;\n case 'y':\n //sometimes y!\n return (Math.random() >= 0.5);\n }\n }", "title": "" }, { "docid": "93bbbc454c846abe7b0d666f40cc87e8", "score": "0.70717865", "text": "function isVowel(char){\n if (char === 'a'||char === 'e'||char === 'i'||char === 'o'||char === 'u'){\n return true;\n }\n else {\n return false;\n }\n // Your answer here\n}", "title": "" }, { "docid": "dcaab541e975feaa39bfe179bb328652", "score": "0.7038681", "text": "function isVowel(char){\n // Your answer here\n if (char == 'a'){\n return true;\n } else if (char == 'e'){\n return true;\n } else if (char == 'i'){\n return true;\n } else if (char == 'o'){\n return true;\n } else if (char == 'u'){\n return true;\n } else if (char == 'y'){\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "0188d83f38fcd493ae8392e1d27cc9e1", "score": "0.6983111", "text": "function task12_13_4(){\n \nvar str = prompt(\"Enter a char to check if its a vowel\");\nstr = str.toLowerCase();\nstr = str.slice(0,1);\nif(str === 'a' || str === 'e' || str =='i' || str=== 'o' || str == 'u'){\nalert(\"True its a vowel\");\n}else{\n alert(\"False not Vowel\");\n}\n}", "title": "" }, { "docid": "382716c6a1b8295acdf5a686807a65d0", "score": "0.6946309", "text": "function isVowel(char){\n // Your answer here\n if (isVowel==\"a\"||\"i\"||\"o\"||\"u\") {\n return (true); }\n else {\n return (false); }\n }", "title": "" }, { "docid": "1c44b7413c8c6998ad4d66d26d6410dd", "score": "0.6944549", "text": "function isVowel(char){\n if ((char) === (\"a\") || (char) === (\"e\") || (char) === (\"i\") || (char) === (\"o\") || (char) === (\"u\"))\n \treturn true;\n else \n \treturn false;\n}", "title": "" }, { "docid": "1265b0c6be38785f67842a96850c0b32", "score": "0.69409144", "text": "function isVowel(letter){\n return letter === \"a\" ||\n letter === \"e\" || \n letter === \"i\" || \n letter === \"o\" || \n letter === \"u\"\n}", "title": "" }, { "docid": "2378bef2b485721a2285f78db125df4f", "score": "0.6938117", "text": "function isVowel(char){\n if (char==='a' || char==='e' || char==='i' || char==='o' || char==='u') {\n return true;\n } else if (char==='y') {\n return \"maybe true!\";\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "86053e75f911813824877a1c8cba7855", "score": "0.6921698", "text": "function isVowel(char){\n if ((char === \"a\") || (char === \"e\") || (char === \"i\") || (char === \"o\") || (char === \"u\")) {\n return true;\n } else {\n return false;\n };\n}", "title": "" }, { "docid": "71a7329a3ef4c413fe6619aae58e5574", "score": "0.6917666", "text": "function isVowel(char){\n //...\n if (char === \"a\" || char === \"e\" || char === \"i\" || char === \"o\" || char === \"u\") {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "c61a572f31dd90ad6279a05b7e14fdad", "score": "0.68727005", "text": "function isVowel(letter) {\n if (letter == \"a\" || letter == \"e\" || letter == \"i\" || letter == \"o\" || letter == \"u\") {\n\n return true;\n } else {\n\n return false;\n }\n }", "title": "" }, { "docid": "05b4246ab22f7f161843968bf6b9def0", "score": "0.68668306", "text": "function isVowel(word){\n if (word.indexOf(a) > -1){\n return true;\n } else if (word.indexOf(e) > -1){\n return true;\n }else if (word.indexOf(i) > -1){\n return true;\n }else if (word.indexOf(o) > -1){\n return true;\n }else if (word.indexOf(u) > -1){\n return true;\n } else{\n return false;\n }\n}", "title": "" }, { "docid": "5d6cceb16aa56ba0507c0b4d500fed07", "score": "0.6857608", "text": "function isVowel(letter){\n let testLetter = letter.toLowerCase();\n if ((testLetter === 'a') || \n (testLetter === 'e') || \n (testLetter === 'i') || \n (testLetter === 'o') || \n (testLetter === 'u')) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "136631310565feb99fe8e0741ef5d62b", "score": "0.68218935", "text": "function isVowel(char){\n // return 'aeiou'.indexOf(char) != -1\n // Your answer here\n if(char == \"a\" || char == \"e\" || char == \"i\" || char == \"o\" || char == \"u\"){\n return true;\n }else{\n return false;\n }\n}", "title": "" }, { "docid": "08097363f0f17f7665a52492b0bdd496", "score": "0.6803215", "text": "function isVowel(char){\n \"use strict\";\n //...\n if (char != 'b'){\n return true;\n }else{\n return false;\n }\n}", "title": "" }, { "docid": "7289488cf819afa3e5040fdbb19491f2", "score": "0.67942846", "text": "function isVowel(char){\n\tif (\"char\" === \"a\"||\"e\"||\"i\"||\"o\"||\"u\"||\"A\"||\"E\"||\"I\"||\"O\"||\"U\"){\n\t\treturn true\n\t}\n\telse {\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "5c1fd079f3c95bf88700f4c9d67aa610", "score": "0.679295", "text": "function isVowel(char){\n if ( char == \"a\" ||char == \"e\" || char == \"i\" || char == \"o\" || char == \"u\" ) {\n return \"true\";\n }\n else {\n return \"false\"\n }\n}", "title": "" }, { "docid": "2cdded558630ccb7abf4accd7f60af01", "score": "0.6790243", "text": "function isVowel(char){\n var consonants = [\n \"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"z\",\n ];\n if (consonants.includes(char)) {\n return false;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "a304484043b3b4905b61c7fffe182e20", "score": "0.67690736", "text": "function isVowel(c){\n if(c==='a'|| c==='e'||c==='i'||c==='o'||c==='u'){\n return true;\n }\n else \n return false;\n\n}", "title": "" }, { "docid": "6485e4a46c1a683e164ff1efcb593c7e", "score": "0.67658323", "text": "function isVowel(char){\n\n if ( char === 'a' ||char === 'e' ||char === 'i' ||char === 'o' ||char === 'u') {\n return true;\n }else{\n return false;\n }\n //...\n}", "title": "" }, { "docid": "f999a0b93cd2f36b8e1d2657578d623b", "score": "0.6763587", "text": "function vowel(character) {\n character = char(character)\n\n return (\n character === 'A' ||\n character === 'E' ||\n character === 'I' ||\n character === 'O' ||\n character === 'U'\n )\n}", "title": "" }, { "docid": "515bdd612db139456ed2e4e2a62c19f5", "score": "0.67630655", "text": "function isVowel (char) {\n\tchar = char.toLowerCase();\n\treturn ( \"aeiou \".indexOf(char) != -1 )\n}", "title": "" }, { "docid": "8de89872553e28c97706d68a282ee839", "score": "0.6762342", "text": "function isVowel(character){\n if(typeof(character)==='number'){\n return false\n }\n\telse if ((character==='a')||(character==='o')||(character==='i')||(character==='e')||(character==='u')||(character==='y')||(character==='A')||(character==='O')||(character==='I')||(character==='E')||(character==='U')||(character==='Y')){\n\t\treturn true\n\t}\n\telse{\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "e8e83a0fc74fce752fb5f55be7c4b82e", "score": "0.6747376", "text": "function vowel(c) {\n return \"aeiouy\".includes(c);\n}", "title": "" }, { "docid": "c88e7354d1d033c3edd70133a5123178", "score": "0.67435175", "text": "function isVowel(char) {\n if (char === 'a')\n {return true;\n if (char === 'e')\n return true;\n if (char === 'i')\n return true;\n if (char === 'o')\n return true;\n if (char === 'u')\n return true;\n} else\n return false\n}", "title": "" }, { "docid": "24de5a01dc217e0760806cb8754decb3", "score": "0.67418003", "text": "function isVowel(char){\n if(char==='a'){\n return true\n }\n else if(char==='e'){\n return true\n }\n else if(char==='i'){\n return true\n }\n else if(char==='o'){\n return true\n }\n else if(char==='u'){\n return true\n }\n else{\n return false\n }\n}", "title": "" }, { "docid": "dea668495dbd4a170ff9ad69dc57d54d", "score": "0.67392653", "text": "function isVowel(char){\n\tvar vowel=char.toLowerCase();\n if (vowel===\"a\"){\n return true;\n }else if (vowel===\"e\"){\n return true;\n }else if (vowel===\"i\"){\n return true;\n }else if (vowel===\"o\"){\n return true;\n }else if(vowel===\"u\"){\n return true;\n }else{\n return false;\n }\n \n}", "title": "" }, { "docid": "c74e292d09555448a06b91e45db60be3", "score": "0.6735001", "text": "function isVowel(char){\n if (char.toLowerCase() === \"a\" ||\n char.toLowerCase() === \"e\" ||\n char.toLowerCase() === \"i\" ||\n char.toLowerCase() === \"o\" ||\n char.toLowerCase() === \"u\" ||\n char.toLowerCase() === \"y\"){\n return true;\n }\n else {\n return false;\n }\n}", "title": "" }, { "docid": "38bd387991e7f69cad518545116087f1", "score": "0.6731762", "text": "function isVowel(letter) {\n console.log(\"*********** Question3***********\")\n var res = false;\n if(letter===\"a\" || letter===\"i\"|| letter===\"o\"|| letter===\"u\"|| letter===\"e\") { res =true}\n console.log(\" isvowel of \"+letter+\" is :\" + res)\n}", "title": "" }, { "docid": "db0000cf2f72c59ee5547fbf115fd9a5", "score": "0.67305607", "text": "function isVowel(char) {\n if (char === \"a\" || char === \"e\" || char === \"i\" || char === \"o\" || char === \"u\"){\n return true\n } else {\n return false\n }\n}", "title": "" }, { "docid": "2c252c6771a409902ee849d2056d8d2a", "score": "0.67300314", "text": "function isVowel(char){\n if(char === \"a\" || char === \"e\" || char === \"i\" || char === \"o\" || char === \"u\" ||\n char === \"A\" || char === \"E\" || char === \"I\" || char === \"O\" || char === \"U\"){\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "e797eedc638ba23363646c5aff9c4a2b", "score": "0.6729662", "text": "function isVowel(char){\n char = char.toLowerCase();\n if (char == \"a\" || char === \"e\" || char === \"i\" || char === \"o\" || char === \"u\") {\n return true;\n } return false;\n }", "title": "" }, { "docid": "2c005d7188e91d05f0d65f30282b68c0", "score": "0.6719616", "text": "function isVowel(char) {\n return char === 'a' || char === 'e' || char === 'i' || char === 'o' || char === 'u' || false;\n}", "title": "" }, { "docid": "64bff797d7a74d0c63784b5b4ead81bb", "score": "0.6700898", "text": "function isVowel(char) {\n if ((char === 'a') || (char === 'e') || (char === 'i') || (char === 'o') || (char === 'u')) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "9a7563b502381f2d0fc58807c171da46", "score": "0.6686433", "text": "function isVowel(a) {\n if (\n a == \"a\" ||\n a == \"e\" ||\n a == \"i\" ||\n a == \"o\" ||\n a == \"u\" ||\n a == \"A\" ||\n a == \"E\" ||\n a == \"I\" ||\n a == \"O\" ||\n a == \"U\"\n ) {\n return true\n } else {\n return false\n }\n}", "title": "" }, { "docid": "aaff8f77d39163b16db78e68ff938a93", "score": "0.6685951", "text": "function isVowel(char){\n var char = char.toLowerCase();\n if (char === \"a\" || char === \"e\" || char === \"i\" || char === \"o\" || char === \"u\") {\n return true;\n } return false;\n}", "title": "" }, { "docid": "8e705540e5b7553d0928bd3dc62af385", "score": "0.6680391", "text": "function isVowel(char) {\n return \"aeiou\".includes(char);\n}", "title": "" }, { "docid": "96fe700a586589fa9b5cd06faaaa2f37", "score": "0.6673947", "text": "function absentVowel(x){\n if (!x.includes('a')) {\n return 0\n } else if (!x.includes('e')) {\n return 1\n } else if (!x.includes('i')) {\n return 2\n } else if (!x.includes('o')) {\n return 3\n } else if (!x.includes('u')) {\n return 4\n }\n}", "title": "" }, { "docid": "6e92fb0a23541391847fce7808a8c075", "score": "0.6663835", "text": "function isVowel(a){\n \"use strict\";\n if(typeof a !== \"string\"){throw 'Invalid Input';}\n if(a.length!==1){throw 'Invalid Input';}\n if(a===\"y\"){throw 'Only Sometimes';}\n if(a===\"Y\"){throw 'Only Sometimes';}\n if(a.toLowerCase() === \"a\"){return true;}\n if(a.toLowerCase() === \"e\"){return true;}\n if(a.toLowerCase() === \"i\"){return true;}\n if(a.toLowerCase() === \"o\"){return true;}\n if(a.toLowerCase() === \"u\"){return true;}\n else{return false;}\n\n // if char isAVowel return true;\n //...\n}", "title": "" }, { "docid": "4c0ef9738364e2e6bfb120e50356f714", "score": "0.66637933", "text": "function isVowel(character) {\n if(character === 'a' || character == 'e' || character == 'i' || character == 'o' || character == 'u') {\n return 'true';\n } else {\n return 'false';\n }\n}", "title": "" }, { "docid": "dfb24a0ec7f3a9f6a604f2ca48a41ae5", "score": "0.6658232", "text": "function isVowel(char){\n char = char.toLowerCase();\n if (char === 'a' || char === 'e' || char === 'i' || char === 'o' || char === 'u') {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "87f8ef870173c9fd1898adc967db5ee4", "score": "0.66577375", "text": "function isVowel(char) {\n if (char == 'a' | char == 'e' | char == 'i' | char == 'o' | char == 'u') {\n return true;\n } else\n return false;\n}", "title": "" }, { "docid": "1095b11128ad2e15a884e3301de708ae", "score": "0.6650162", "text": "function isVowel (singleLowerCaseChar){\n if (singleLowerCaseChar === 'a') {\n return true;\n } else if (singleLowerCaseChar === 'e') {\n return true;\n } else if (singleLowerCaseChar === 'i') {\n return true;\n } else if (singleLowerCaseChar === 'o') {\n return true;\n } else if (singleLowerCaseChar === 'u') {\n return true;\n } else return false;\n}", "title": "" }, { "docid": "3733cd31002b5d1f919080c378941f70", "score": "0.6649377", "text": "function vowelCheck(a) {\n a = a.toLowerCase();\n switch(a) {\n case \"a\":\n case \"e\":\n case \"i\":\n case \"o\":\n case \"u\":\n console.log(\"Is a vowel\");\n break;\n default:\n console.log(\"Is not a vowel\");\n }\n\n}", "title": "" }, { "docid": "600e4cc16c245ef207d65bede5f81405", "score": "0.66295475", "text": "function isVowel(char) {\n\n if (char[0] === 'a' || char[0] === 'e' || char[0] === 'i' || char[0] === 'o' || char[0] === 'u') {\n return true\n } else {\n return false\n }\n}", "title": "" }, { "docid": "d4d6b024a022d7b7121641f45cd87fea", "score": "0.66272783", "text": "function isVowel(char){\n var vow = [\"A\", \"E\", \"I\", \"O\", \"U\", \"Y\", \"a\", \"e\", \"i\", \"o\", \"u\", \"y\"];\n if(char = vow.indexOf(char) > -1){\n return true;\n } else{\n return false;\n }\n}", "title": "" }, { "docid": "b4587d2b057b3227c5aa463387cd4633", "score": "0.6616071", "text": "function isVowel(char){\n \"use strict\";\n //...\n if (char === \"a\" || char === \"e\" || char === \"i\" || char === \"o\" || char === \"u\") {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "d1f5c5da7e16f0d744bc249f4a69ecbb", "score": "0.6615646", "text": "function vowel(n) {\n if (n === \"a\" || n === \"e\" || n === \"i\" || n === \"o\" || n === \"u\") {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "02ed6c52a1bcb250ca3e83a603684cf1", "score": "0.6610769", "text": "function vowel(c) {\n return ['a', 'e', 'i', 'o', 'u'].indexOf(c) !== -1\n}", "title": "" }, { "docid": "724a268f8cb9ad9132e4cb58c09d1040", "score": "0.6599989", "text": "function isVowel(char){\n char = char.toLowerCase();\n if (char == 'a' || char == 'e' || char == 'i' || char == 'o' || char == 'u') return true;\n else return false;\n}", "title": "" }, { "docid": "d8cf43e328e85b4f36b4ed0396d18f7b", "score": "0.6599951", "text": "function isVowel(char){\n\n \tvar vowels = [\"A\",\"E\",\"I\",\"O\",\"U\"]\n\n \tchar = String(char).toUpperCase()\n\n \tif (vowels.includes(char)){\n \t\treturn true\n \t}\n \telse{\n \t\treturn false\n \t}\n\n }", "title": "" }, { "docid": "409c41780151bee986a47016c4f01581", "score": "0.65934163", "text": "function isVowel(character) {\n return character !== undefined && (\n character === 'a'\n || character === 'e'\n || character === 'i'\n || character === 'o'\n || character === 'u'\n );\n}", "title": "" }, { "docid": "c5bc4c03de106b1e9ab126e47447a578", "score": "0.6591524", "text": "function isVowel(char) {\n // Returns -1 if the index being checked is not in this string.\n // Right below the checked answer https://stackoverflow.com/questions/26926994/javascript-check-if-character-is-a-vowel\n return (\"aeiouAEIOU\".indexOf(char) !== -1);\n }", "title": "" }, { "docid": "19c5c0dfcbf81c5f7db27aee6f807696", "score": "0.6585003", "text": "function isVowel(char){\n var temp= char.toString().toLocaleLowerCase();\n\n\n if(temp==='a' || temp==='e' || temp==='i' || temp==='o' ) {\n return true;\n }\n\n else{\n return false;\n\n }\n }", "title": "" }, { "docid": "d9bf253af5ad8fddf9b74e989a1edf75", "score": "0.6555341", "text": "function isVowel(input) {\n // take first charactor of whatever is inputted and convert to lowercase for strict equality:\n firstLetter = input.charAt(0).toLowerCase();\n\n if (\n firstLetter === \"a\" ||\n firstLetter === \"e\" ||\n firstLetter === \"i\" ||\n firstLetter === \"o\" ||\n firstLetter === \"u\"\n ) {\n return \"true\";\n } else {\n return \"false\";\n }\n}", "title": "" }, { "docid": "2c291826a23f8dc1c52f6e13f156a0cc", "score": "0.6552602", "text": "function checkGuess() {\n\tfor (i = 0; i < displayedWord.letterArray.length; i++) {\n\t\tif (displayedWord.letterArray[i].value.toUpperCase() === userGuess.toUpperCase()) {\n\t\t\tconsole.log(\"\\nCorrect!\\n\");\n\t\t\treturn;\n\t\t}\t\t\n\t}\n\tguessesRemaining--;\n\tconsole.log(\"\\nIncorrect! You have \" + guessesRemaining + \" guesses remaining!\\n\");\n}", "title": "" }, { "docid": "699a394379c6fc8f918729da88f5e938", "score": "0.65399706", "text": "function isVowel(maybe) {\n // turn problem into a boolean\n if (\n maybe === 'a' ||\n maybe === 'e' ||\n maybe === 'i' ||\n maybe === 'o' ||\n maybe === 'u' ||\n maybe === 'A' ||\n maybe === 'E' ||\n maybe === 'I' ||\n maybe === 'O' ||\n maybe === 'U'\n ) {\n return true\n } else {\n return false\n }\n\n // filter lowercase and uppercase vowels\n // return true or false based on conditions\n}", "title": "" }, { "docid": "eced21fa1453ce824e08b96abd274d8b", "score": "0.65334535", "text": "function vowels(char) {\n\treturn 'aeiou'.includes(char);\n}", "title": "" }, { "docid": "3c9de86bfcb36f4806fc13b915f625e6", "score": "0.65278184", "text": "function isVowel(char){\n \"use strict\";\n var vowelTruthy;\n // var char = a;\n\n if (char == 'a' ||\n char == 'e'||\n char == 'i' ||\n char == 'o' ||\n char == 'u'){\n vowelTruthy = true;\n } else {\n vowelTruthy = false;\n }\n return vowelTruthy;\n}", "title": "" }, { "docid": "d5aaab8c0b5457be4ee5994427f7c668", "score": "0.651255", "text": "function isVowel(char){\n\n var letter = false;\n\n var vowels = [\"a\",\"e\",\"i\",\"o\",\"u\", \"A\", \"Y\"];\n\n if(vowels.indexOf(char) != -1)\n letter = true;\n\n return letter;\n\n}", "title": "" }, { "docid": "394f51ef69813b826ec698fec72fe3f1", "score": "0.6511337", "text": "function isVowel(ch){\n\tvar checkVowel=false;\n\tif(ch=='a' || ch=='A' || ch=='e'\n\t|| ch=='E' || ch=='i' || ch=='I' || ch=='o' || ch=='O' || ch=='u' || ch=='U'){\n\t\tcheckVowel=true; \n\t}\n\treturn checkVowel;\n}", "title": "" }, { "docid": "6f151cfe0f55dab9892ded8a94108959", "score": "0.65012276", "text": "function isVowel(s) {\n var result;\n if(s == \"a\" || s == \"e\" || s == \"i\" || s == \"o\" || s == \"u\") {\n result = true;\n } else {\n result = false;\n }\n return result\n}", "title": "" }, { "docid": "e26780f48d97fa8dfa2c2154d9d79d58", "score": "0.64995396", "text": "function vowel(x) {\n if(x === \"a\" || x === \"e\" || x === \"i\" || x === \"o\" || x === \"u\") {\n console.log(true);\n } else {\n console.log(false);\n }\n}", "title": "" }, { "docid": "c2ed48c8cf970b7db0808a8412cc09f8", "score": "0.64987314", "text": "function isVowel (letter) {\n //returns true if a vowel, false if not.\n //preconditions: assumes 'letter' is truly a letter\n var found=false;\n var vowel= new Array(\"A\", \"E\", \"I\", \"O\", \"U\");\n for (var i=0; i < vowel.length; i++) {\n if (vowel.indexOf(letter.toUpperCase()) >= 0)\n found=true;\n }\n return found;\n }", "title": "" }, { "docid": "6a12de2f2f7bff03376147f9cd4ca021", "score": "0.6491412", "text": "function isVowel(char){\n \"use strict\";\n\n // Bail if char is not length of 1\n if(char.length != 1){\n return false;\n }\n\n return 'aeiouAEIOU'.indexOf(char) == -1 ? false : true;\n}", "title": "" }, { "docid": "416f3701d2871fa60d4586b006f8a25d", "score": "0.64910764", "text": "function isVowel(char){\n var lowerChar = char.toLowerCase();\n if (lowerChar === \"a\") {\n // (char === \"a\") || \"A\"\n // => true || \"A\"\n // => false || \"A\"\n // char === (\"a\" || \"A\")\n // => char === (\"a\")\n return true;\n } else if (lowerChar === \"e\") {\n return true;\n } else if (lowerChar === \"i\") {\n return true;\n } else if (lowerChar === \"o\") {\n return true;\n } else if (char === \"u\") {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "8623349bf7007ae543f130a754a8382c", "score": "0.64697003", "text": "function isVowel(num){\n num = num.toLowerCase();\n return (num == \"a\" ||num == \"e\" || num == \"i\" || num == \"o\" || num == \"u\");\n}", "title": "" }, { "docid": "1f19435795a372a4a52ed5030b91ffdd", "score": "0.64600754", "text": "function is_vowel(chr) {\n switch (chr) {\n case 'a': case 'e': case 'i': case 'o': case 'u': case 'R': return true;\n default: return false;\n }\n}", "title": "" }, { "docid": "87360a119f7a68f53c732e18db983972", "score": "0.6443101", "text": "function checkIfVowel(inputStr, i) { \n \n if(inputStr.toLowerCase().charAt(i) == 'a' || inputStr.toLowerCase().charAt(i) == 'e' || inputStr.toLowerCase().charAt(i) == 'i' || inputStr.toLowerCase().charAt(i) == 'o' || inputStr.toLowerCase().charAt(i) == 'u') // checks if the letter/character in the string is a vowel\n {\n return true;\n }\n else\n {\n return false;\n }\n\n}", "title": "" }, { "docid": "08634a5f3742c3073552dfaddfcb87bd", "score": "0.6382319", "text": "function isVowel (char) {\n let vowels = ['A', 'E', 'I', 'O', 'U']\n let input = char.toUpperCase()\n for (i = 0; i < vowels.length; i++) {\n if (input === vowels[i]) {\n return true\n }\n }\n return false\n }", "title": "" }, { "docid": "6f39370c6b611eaa9acd58c616c863cc", "score": "0.6378365", "text": "function isVowel(char){\n \"use strict\";\n if(!_.isString(char)){\n throw 'The argument must be a string';\n }\n if(arguments.length > 1 || arguments.length < 1) {\n throw 'The argument must be one character long';\n }\n\n switch (char) {\n case 'a':\n return 'Vowel';\n case 'e':\n return 'Vowel';\n case 'i':\n return 'Vowel';\n case 'o':\n return 'Vowel';\n case 'u':\n return 'Vowel';\n }\n}", "title": "" }, { "docid": "d6cb7f44e5c918a336094e762882d4db", "score": "0.6375973", "text": "function isValidGuess(guess) {\n var isLetter = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\".indexOf(guess) !== -1;\n var retVal = (isLetter && !guessedArr.includes(guess.toUpperCase()));\n return retVal;\n }", "title": "" }, { "docid": "b3f94e1740697eeff74653656d0cb41b", "score": "0.6372896", "text": "function isVowel(c) {\n\treturn ['a', 'e', 'i', 'o', 'u'].indexOf(c.toLowerCase()) !== -1;\n}", "title": "" }, { "docid": "d056f71652577afea26567e2792194af", "score": "0.6366552", "text": "function isVowel (char, idx, s) {\n expect(s[idx]).toBe(char);\n\n return ~\"aeiouAEIOU\".indexOf(char);\n }", "title": "" }, { "docid": "f49247706d7adfbd58ae53f1fa1f5ec9", "score": "0.6336071", "text": "function isVowel(x){\n if (x === \"a\" || x === \"e\" || x === \"i\" || x === \"o\" || x === \"u\" || x=== \" \"){\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "f2c785ceafac13b7a76474532512d02a", "score": "0.63266253", "text": "function isVowel(symbol){\n\n\t// if symobl is not a character that equals to a vowel return false and otherwise its true\n // YOUR CODE HERE\n\n var vowels = ['a', 'E']\n \n if(vowels.indexOf(symbol) === -1)\n \t\treturn false\n\n \treturn true\n\n}", "title": "" }, { "docid": "62590f57d76e0850d4cabbdfac67dd50", "score": "0.6298278", "text": "function isThisAVowel (letter) {\n //your code here\n if (letter === 'a' || letter === 'e' || letter === 'i' || letter === 'o' || letter === 'u') {\n return true;\n } else {\n return 'false';\n }\n}", "title": "" }, { "docid": "fecab8df6908d83aeb2131c42b8b60dd", "score": "0.62964314", "text": "function isVowel (s) {\n\tvar vowels = ['a', 'e', 'i', 'o', 'u']\n\tif (vowels.indexOf(s) === -1) {\n\t\treturn false\n\t} else {\n\t\treturn true\n\t}\n}", "title": "" }, { "docid": "32dafb5150792a53c5f875b36d46070c", "score": "0.6295157", "text": "function letterGuess(strGuess) {\n var strLetter = document.getElementById(strGuess);\n strLetter.disabled = true;\n if(strWord.indexOf(strGuess) != -1) {\n //Function to show letter to user and check if game is won\n letterGuessCorrect(strGuess, gameMessage);\n } else {\n //Function to show next hangman image and check if game is lost\n letterGuessWrong(gameMessage);\n }\n}", "title": "" }, { "docid": "eb2427d9197707dafb82126f2009dd27", "score": "0.62901664", "text": "function verifyLetter(toLog,randomSongString){\n\n //determine if user guessed sucessfully or no\n var preGuess = randomSongString.displayWord();\n //check if letter is correct\n randomSongString.guess(toLog);\n\n //after running te guess function...\n\n var postGuess = randomSongString.displayWord();\n\n\n //conditional to reduce remaining Guesses or not: \n\n if (preGuess===postGuess){\n console.log(\"Incorrect Guess\");\n guessesRemaining--;\n }\n\n else{\n console.log(\"Correct Guess!\");\n }\n\n //console.log the word with underscores and letter that have been guessed so far\n return console.log(postGuess);\n \n }", "title": "" }, { "docid": "f6ba9ca0765a219b4645f5488d36b183", "score": "0.62859386", "text": "function isCharAVowel(char){\n char = char.toLowerCase(); //with strings, converting to lower or upper is needed\n return ('aeiouy'.indexOf(char) > -1) // checking string 'aeiouy' for character passed into char argument \n}", "title": "" }, { "docid": "824489593474a8f208f9545ea05f8632", "score": "0.62824893", "text": "function absentVowel(x){\n const splitArr = x.split('');\n if (!splitArr.includes('a')){\n return 0\n };\n if (!splitArr.includes('e')){\n return 1\n };\n if (!splitArr.includes('i')){\n return 2\n };\n if (!splitArr.includes('o')){\n return 3\n };\n if (!splitArr.includes('u')){\n return 4\n };\n }", "title": "" }, { "docid": "86fc598c8efe7f6a8e5a156e1d5ca471", "score": "0.628232", "text": "function vowelChecker(x) {\n\n // vowelChecker will grab the first letter (character)...\n var firstChar = x.toLowerCase().charAt(0);\n\n // Then check if that first letter is a vowel.\n if (firstChar === \"a\" || firstChar === \"e\" || firstChar === \"i\" || firstChar === \"o\" || firstChar === \"u\") {\n\n // If so... it will log that.\n console.log(\"OMG. The first letter is a vowel!\");\n\n }\n\n else {\n\n // If not... it will log that.\n console.log(\"First letter is NOT a vowel. *sadface*\");\n\n }\n }", "title": "" }, { "docid": "98b94d1660e7119d80f0a33ff94ca47a", "score": "0.62735015", "text": "function checkLetterChosen(letter) {\n i=0; youFind=0;\n for (elem of wordToGuest) {\n if (letter===wordToGuest[i] || (letter===\"e\" && (\"é\" === wordToGuest[i] || \"è\" === wordToGuest[i] ||\n \"ê\" === wordToGuest[i] || \"ë\" === wordToGuest[i])) || (letter===\"a\" && (\"à\" === wordToGuest[i] || \"â\" === wordToGuest[i]\n || \"ä\" === wordToGuest[i] || \"á\" === wordToGuest[i])) || (letter===\"u\" && (\"ú\" === wordToGuest[i] ||\n \"ù\" === wordToGuest[i] || \"û\" === wordToGuest[i] || \"ü\" === wordToGuest[i])) || (letter===\"i\" &&\n (\"í\" === wordToGuest[i] || \"ì\" === wordToGuest[i] || \"î\" === wordToGuest[i] || \"ï\" === wordToGuest[i])) ||\n (letter===\"o\" && (\"ó\" === wordToGuest[i] || \"ò\" === wordToGuest[i] || \"ô\" === wordToGuest[i] || \"ö\" === wordToGuest[i]))) {\n youFind++; numberLetterToGuest--;\n document.getElementById(\"letter\"+i).textContent=wordToGuest[i];\n document.getElementById(letter).className=\"letterPickGood\";\n }\n document.querySelector(\"#\"+letter).dataset.status=\"1\";\n i++;\n }\n if (youFind===0) {\n document.getElementById(letter).className=\"letterPickBad\";\n statutHangman=document.querySelector(\"#hangman\").dataset.status;\n statutHangman++; chanceLeft--;\n document.getElementById(\"hangman\").src=\"../assets/img/\" + statutHangman + \".png\";\n document.getElementById(\"hangman\").alt=\"You have \" + chanceLeft + \" chances left\";\n document.querySelector(\"#hangman\").dataset.status=statutHangman;\n if (statutHangman===7) {\n endGame(\"lose\");\n }\n }\n if (numberLetterToGuest===0) {\n endGame(\"win\");\n }\n }", "title": "" }, { "docid": "f52e704505c795d8e238a11fe286c225", "score": "0.626973", "text": "function isVowel(char){\n var arr = [\"a\",\"e\",\"i\",\"o\",\"u\"]\n for(var i = 0; i < arr.length; i ++){\n \tif (char == arr[i]) {\n \t\treturn true\n \t}\n }\n return false\n}", "title": "" }, { "docid": "c6aa4acb753c64a4dd187515d81ac24a", "score": "0.6268626", "text": "function validateUserGuess(userInput, expected) {\n if(userInput.toUpperCase() === expected){\n return true; \n } else {\n return false;\n }\n }", "title": "" }, { "docid": "3b5088a1777d2eea5ab18fe83234752a", "score": "0.62621593", "text": "function isVowel(letter){\n var vowel = [\"a\", \"e\", \"i\", \"o\", \"u\", \"y\"];\n for(var i=0; i<vowel.length; i++){\n if (vowel[i] === letter){\n return true;\n }\n }return false;\n}", "title": "" }, { "docid": "70383af48e89db4b67460e3e6afa22ad", "score": "0.6257352", "text": "function isVowel(str){\n\tif (str == 'a' || str == 'e' || str == 'i' || str == 'o' || str == 'u'){\n\t\treturn(true);\n\t} else {\n\t\treturn(false);\n\t}\n}", "title": "" }, { "docid": "f2a15b6e8ed909751c872096997684d7", "score": "0.6249704", "text": "function isCharacterAVowel (a){\n character = a.toLowerCase();\n\n let message = false;\n\n if(character.length > 1){\n process.stdout.write('Please enter a character: ');\n }\n else if(character >= 0 && character <= 9){\n process.stdout.write(character + ' is a number, Please enter a character');\n }\n else if( (character >='a' && character <= 'z') || (character >='A' && character <= 'Z') ){\n if(character == 'a' || character == 'e' || character == 'o' || character == 'u' || character == 'i'){\n message = true;\n }\n }\n return message;\n }", "title": "" }, { "docid": "4f0223d0dc4a6f74f44f9ec03042a45f", "score": "0.6234792", "text": "function isCorrectGuess(word, letter){\n return new RegExp(letter, \"gi\").test(word)\n}", "title": "" }, { "docid": "b37b57f2e068c3ca2d4777201ccfa653", "score": "0.62342316", "text": "function isOkGuess(guess) {\n if (guess.length === 0) {\n alert(\"You didn't guess anything!\");\n return false;\n }\n if (!isLetter(guess)) {\n alert('That is not a letter!');\n return false;\n }\n if (guesses.indexOf(guess) >= 0) {\n alert(\"You already guessed that!\");\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "7c3c55a57770703cd398b85cdf49dc29", "score": "0.6212613", "text": "checkLetter() {\n const guess = this.input.value;\n\n if(this.addToGuesses(guess)) {\n const ind = this.checkArray(guess);\n \n if(ind.length > 0) {\n this.showLetters(ind); \n } else {\n this.showHangman();\n this.answers.incorrect += 1;\n }\n }\n super.toggleErrorState(this.input, false);\n this.checkAnswer();\n }", "title": "" }, { "docid": "ffb05dcfef6600829778161ba227472a", "score": "0.6189675", "text": "function vowel(character){\n var vowels = ['a','e','i','o','u']\n for (var i = 0; i < vowels.length; i += 1) {\n if (character == vowels[i]) {\n return true\n }\n }\n return false\n}", "title": "" }, { "docid": "733accbe2c43a4c19001102876a8bb2e", "score": "0.6184713", "text": "function isCharacterAVowel(character) {\n\n if (character === \"a\"){\n \treturn true;\n }\n else if (character === \"e\"){\n \treturn true;\n }\n else if (character === \"i\"){\n return true;\n }\n else if (character === \"o\"){\n return true;\n }\n else if (character === \"u\"){\n return true;\n }\n\n}", "title": "" }, { "docid": "23eea08cdea895a4a97ea593bb127022", "score": "0.61844814", "text": "function revealLetter() {\n\t\t\tuserGuessIndex = word.indexOf(userGuess);\n\t\t\tfor (i=0; i < word.length; i++) {\n\t\t\t\tif (word[i] === userGuess) {\n\t\t\t\t\thide = hide.split(\"\");\n\t\t\t\t\thide[i] = userGuess;\n\t\t\t\t\thide = hide.join(\"\");\n\t\t\t\t\ttargetA.innerHTML = hide;\n\n\t\t\t\t}\n\t\t\t}\t\n\t\t}", "title": "" }, { "docid": "94280796e1a2188759ade4b8328dba8a", "score": "0.61812156", "text": "function isVowel(char) {\n let vowels = ['a', 'e', 'i', 'o', 'u'];\n return vowels.includes(char);\n}", "title": "" }, { "docid": "000972671428596abb66110e7c7d1b9c", "score": "0.6178511", "text": "function verifyLetter(){\n\t\t\t\tfor (var i = 0; i < guessedLetters.length; i++) {\n\t\t\t\t\tif(guess == guessedLetters[i]){\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\telse{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "6d30653083622daa408236e8e8454a03", "score": "0.6173808", "text": "function isVowel(c) {\n c = c.toLowerCase();\n let vowel = false;\n switch (c) {\n case 'a':\n case 'e':\n case 'i':\n case 'o':\n case 'u':\n vowel = true;\n break;\n }\n return vowel;\n\n // return ['a', 'e', 'i', 'o', 'u'].indexOf(c.toLowerCase()) !== -1;\n}", "title": "" }, { "docid": "42911ba7bfe35b5255ed6eb95151335f", "score": "0.61711186", "text": "function matchLogic() {\n var inArray = letters.includes(userGuess);\n if (inArray === false) {\n notVowel();\n } else if (guessesLeft > 0 && userGuess === computerPick) {\n win();\n } else if (guessesLeft > 1 && userGuess !== computerPick) {\n pickedEffect();\n wrongGuess();\n } else if (guessesLeft === 1 && userGuess !== computerPick) {\n loss();\n }\n}", "title": "" }, { "docid": "69931580ed1e6c02c6475c8e0410209a", "score": "0.6163455", "text": "function vowel(str) {\n return str.length === 1 && /[aeiou]/i.test(str);\n}", "title": "" } ]
3cec76ca6cff8e0731d2f0ddfd348c0b
Updates the position of the bullet each cycle
[ { "docid": "99d03e96344cffed47d59f45fd6119ce", "score": "0.0", "text": "update() { }", "title": "" } ]
[ { "docid": "1d7b5a6743340529fae33d42cc5299cd", "score": "0.72966367", "text": "function updateBullet(event)\n{\n var delta = event.delta / 1000;\n \n bullet.x -= delta * bullet_speed * 3;\n \n if(bullet.x + bullet.image.width < 0)\n resetBullet();\n}", "title": "" }, { "docid": "d5aa420041ae0e8f9cab5767a7ffa2d1", "score": "0.7238789", "text": "function updateBullet(bullet) {\n // Update the bullet's position by adding its velocity\n bullet.x += bullet.dx;\n bullet.y += bullet.dy;\n\n // Wrap the bullet around the edges of the canvas\n if (bullet.x < 0) {\n bullet.x = canvas.width;\n }\n if (bullet.x > canvas.width) {\n bullet.x = 0;\n }\n if (bullet.y < 0) {\n bullet.y = canvas.height;\n }\n if (bullet.y > canvas.height) {\n bullet.y = 0;\n }\n\n // Decrease the bullet's lifetime by one\n bullet.lifetime--;\n\n // If the bullet's lifetime is zero, remove it from the bullets array\n if (bullet.lifetime == 0) {\n var index = bullets.indexOf(bullet); // find the index of the bullet in the array\n if (index != -1) { // if the index is valid\n bullets.splice(index, 1); // remove the bullet from the array\n }\n }\n}", "title": "" }, { "docid": "c58e7acb7707f81e0df0e8eb5428406d", "score": "0.7199948", "text": "function moveBulletsPlayer() {\n bullets.forEach(function (bullet) {\n bullet.y -= 10;\n bullet.rotation += 0.5;\n });\n}", "title": "" }, { "docid": "b602f896a4f3cdcec4dd8a245b09dec9", "score": "0.7139077", "text": "function setBullet() {\n bullet.posX = 0;\n bullet.posY = 0;\n bullet.height = 4;\n bullet.width = 4;\n }", "title": "" }, { "docid": "c0924c36ba68272d2847be7f790af2c9", "score": "0.71063304", "text": "function moveBullets() {\n // Go through all bullets\n\n bulletsClass.forEach(function (item, i) {\n let node = item.node;\n // Update the position of the bullet\n let x = parseInt(node.getAttribute(\"x\"));\n if (item.faceRight) {\n node.setAttribute(\"x\", x + BULLET_SPEED);\n }\n else {\n node.setAttribute(\"x\", x - BULLET_SPEED);\n }\n\n // If the bullet is not inside the screen delete it from the group\n if (x > SCREEN_SIZE.w || x < 0) {\n node.parentNode.removeChild(node);\n bulletsClass.splice(i, 1);\n i--;\n }\n\n });\n}", "title": "" }, { "docid": "9319de4dff855b8fd894e4e4e421e533", "score": "0.7089608", "text": "function fire() {\r\n for (var i = 1; i <= bulletCount; i++) {\r\n setTimeout(setInterval, 1000 * i, bulletTravel, 100, \"bullet\" + i);\r\n }\r\n }", "title": "" }, { "docid": "3df5302e8ed5de3286b9dfacbb4ee7e4", "score": "0.7083097", "text": "function updateBullets() {\n bulletList.resetIterator();\n while (bulletList.peekNext() !== null) {\n bulletList.getNext().updateSpecial();\n }\n}", "title": "" }, { "docid": "1c31facb7cd955f661f3df05bd52d1c4", "score": "0.6898655", "text": "fire() {\n if(frameCount - this.lastBulletFiredTimestamp > this.bulletInterval) { //frameCount is an invisible no., it refers to the no. of frames rendered\n bullets.push(new Bullet(this.xAxis, this.yAxis - (this.spaceshipHeight), 1));\n this.lastBulletFiredTimestamp = frameCount; //to record the timestamp\n }\n }", "title": "" }, { "docid": "a587607d5b6fbe1dd3daf8cb972ad6b0", "score": "0.68807566", "text": "function drawBullets() {\n\tfor (var i=0; i<bullets.length; i++) {\n\t\tvar b = bullets[i];\n\n\t\tcontext.fillStyle = b.color;\n\t\tcontext.fillRect(b.x, b.y, b.width, b.height);\n\t\tbullets[i].y = b.y - b.speed;\n\n\t\tif (bullets[i].y < 0) { // went off the canvas\n\t\t\tbullets.splice(i,1);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1e7153547a720e48b9d4a4038ceef5a4", "score": "0.68717015", "text": "function draw_bullet(i){\n\tctx.drawImage(bulletImage, bullets.x[i]+25/3, bullets.y[i]- 357/8, 25/2, 357/8);\n}", "title": "" }, { "docid": "5ef8b66577df1ddf193fd2beaeb48264", "score": "0.6867239", "text": "function updateBulletMovement(){\n $(\".playerBullet\").each(function(){\n // Get current position\n var posx = $(this).x();\n var posy = $(this).y();\n\n // Check if out of bounds\n if(posx < 0 || posx > PLAYGROUND_WIDTH || posy > PLAYGROUND_HEIGHT || posy < 0){\n $(this)[0].bullet.fired = false;\n $(this).fadeOut(0,0);\n return;\n }\n // Check if there was a collision\n var collided = $(this).collision(\".enemy,.\"+$.gQ.groupCssClass);\n var collider = $(this);\n\n handleEnemyDamage(collided, \"enemy\", collider, \"playerBullet\");\n\n // Figure out the next position\n var nextX = Math.round(Math.cos($(this)[0].bullet.direction) * BULLET_SPEED + posx);\n var nextY = Math.round(Math.sin($(this)[0].bullet.direction) * BULLET_SPEED + posy);\n\n // Move the bullet\n $(this).x(nextX);\n $(this).y(nextY);\n\n });\n}", "title": "" }, { "docid": "ee97942b09ad417f00bbc4921ebbe60d", "score": "0.6861463", "text": "function moveBullets() {\r\n // Go through all bullets\r\n var bullets = svgdoc.getElementById(\"bullets\");\r\n for (var i = 0; i < bullets.childNodes.length; i++) {\r\n var node = bullets.childNodes.item(i);\r\n\r\n // Update the position of the bullet\r\n var x = parseInt(node.getAttribute(\"x\"));\r\n\r\n //+ BULLET_SPEED towards left\r\n //- BULLET_SPEED towards right\r\n if(node.getAttribute(\"motion\") == \"LEFT\")\r\n node.setAttribute(\"x\", x - BULLET_SPEED);\r\n else if (node.getAttribute(\"motion\") ==\"RIGHT\")\r\n node.setAttribute(\"x\", x + BULLET_SPEED);\r\n\r\n // If the bullet is not inside the screen delete it from the group\r\n if (x > SCREEN_SIZE.w) { // off the screen on the right\r\n bullets.removeChild(node);\r\n i--;\r\n }\r\n if ( x < 0 ) { // off the screen on the left\r\n bullets.removeChild(node);\r\n i--;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "a262dd8537cf61d8d39451ad69f436ed", "score": "0.68575966", "text": "draw_bullet()\n {\n push();\n imageMode( CENTER );\n translate(this.x, this.y);\n rotate( Math.atan2( this.dy, this.dx ));\n image( bullet_img, 0, 0 );\n pop();\n \n this.x += this.speed * cos( this.angle );\n this.y += this.speed * sin( this.angle );\n }", "title": "" }, { "docid": "df4ac76e25d8254a52156f453a56f993", "score": "0.68396986", "text": "function resetBullet()\n{\n bullet_speed = Math.random() * 30 + 60;\n bullet.x = stage.canvas.width + bullet.image.width;\n \n}", "title": "" }, { "docid": "e2f4d3a298309af4803fa763c84ca5ec", "score": "0.66489923", "text": "function update(){\n\tfor(var i = 0; i < bullets.x.length; i ++){\n\t\tif(bullets.y[i] <= -318/8){\t\t\n\t\t\tbullets.x.splice(i,1);\n\t\t\tbullets.y.splice(i,1);\n\t\t}\n\t}\n\tfor(var i = 0; i < enemy.x.length; i ++){\n\t\tif(enemy.y[i] >= main.height){\n\t\t\tenemy.x.splice[i,1];\n\t\t\tenemy.y.splice[i,1];\n\t\t}\n\t}\n\tfor(var i = 0; i < bullets.x.length; i ++){\n\t\tbullets.y[i] -=1;\n\t\tdraw_bullet(i);\n\t}\n\tfor(var i = 0; i < enemy.x.length; i ++){\n\t\tenemy.y[i] += 1;\n\t\tdraw_enemy(i);\n\t}\n}", "title": "" }, { "docid": "2a88c3f74df7634e49e18b2c4214d56e", "score": "0.6637956", "text": "function bulletCollideWithTile() {\n for (let i = 0; i<bullets.length; i++) {\n if (bullets[i].isMoveable === true) {\n bullets[i].update(); \n }\n else {\n bullets.splice(i, 1);\n }\n }\n}", "title": "" }, { "docid": "2ec7e232441e52aed2cae1c5562ea996", "score": "0.65922743", "text": "function moveBullets() {\n // Go through all bullets\n var bullets = svgdoc.getElementById(\"bullets\");\n for (var i = 0; i < bullets.childNodes.length; i++) {\n var bulletNode = bullets.childNodes.item(i);\n\n // Update the position of the bullet\n var x = parseInt(bulletNode.getAttribute(\"x\"));\n if (bulletNode.getAttribute(\"movingLeft\") === 'true')\n bulletNode.setAttribute(\"x\", x - BULLET_SPEED);\n else\n bulletNode.setAttribute(\"x\", x + BULLET_SPEED);\n\n // If the bullet is not inside the screen delete it from the group\n if (x > SCREEN_SIZE.w || x < 0){\n if (bulletNode.getAttribute(\"killMonster\")){\n monsterBulletOnScreen = false;\n }\n bullets.removeChild(bulletNode);\n i--;\n }\n }\n}", "title": "" }, { "docid": "dd191ad27392a06f5127ec66efbb5a5c", "score": "0.65660197", "text": "function moveBullets() {\n for (var i = 0; i < bulletArray.length; i++) {\n var bullet = bulletArray[i];\n if (bullet.enemy == undefined) {\n bullet.reachedEnemy = true;\n break;\n }\n // Getting the bullet and enemy positions difference\n var dx = bullet.enemy.posX - bullet.posX;\n var dy = bullet.enemy.posY - bullet.posY;\n\n // Getting the angle\n var angle = Math.atan2(dy, dx);\n\n // Getting the X and Y velocity\n var velX = bullet.speed * Math.cos(angle);\n var velY = bullet.speed * Math.sin(angle);\n\n if (dx > -5 && dx < 5 && dy > -5 && dy < 5) {\n bullet.reachedEnemy = true;\n dealDamage(bullet);\n\n // If the bullet is a rocket, creating a rocket explosion animation\n if (bullet.type == \"rockets\") {\n createRocketExplosion(bullet.enemy.posX, bullet.enemy.posY);\n }\n }\n\n // Adding the velocities to x and y axis\n bullet.posX += velX;\n bullet.posY += velY;\n }\n}", "title": "" }, { "docid": "817101a32695cd66329a31aecf21033e", "score": "0.6503532", "text": "bulletMovement() {\n this.count++;\n\n let deltatimeBullet = TIME_INTERVAL / 1000;\n this.bulletX += this.veloX;\n\n this.bulletZ =\n this.bulletZ - this.Vo * Math.cos(this.angle) * deltatimeBullet;\n\n this.bulletY += this.veloY;\n\n this.element.style.left = this.bulletX + \"px\";\n\n this.shadowBullet.style.left = this.bulletX + \"px\";\n\n this.element.style.top = this.bulletY + \"px\";\n\n this.element.style.transform = `translateZ(${this.bulletZ}px)`;\n this.shadowBullet.style.transform = `translateZ(${this.bulletZ}px)`;\n\n if (\n this.bulletZ < -500 ||\n this.bulletX > WINDOWINNERWIDTH ||\n this.bulletX < 0 ||\n this.bulletY > WINDOWINNERHEIGHT ||\n this.bulletY < 0\n ) {\n this.element.remove();\n this.shadowBullet.remove();\n delete bulletsUsed[this.id];\n }\n\n let fishArr = Object.values(fishCreated);\n console.log(\"fishArr\", fishArr);\n\n for (let i = 0; i < fishArr.length; i++) {\n let fishRadio = fishCreated[fishArr[i].id].element.offsetWidth / 2;\n console.log(\"fishRadio\", fishRadio);\n\n let contactRadio = fishRadio;\n\n if (\n Math.abs(this.bulletX - fishArr[i].x) < contactRadio &&\n Math.abs(this.bulletY - fishArr[i].y) < contactRadio &&\n Math.abs(this.bulletZ - fishArr[i].z) < contactRadio\n ) {\n console.log(\"this.bulletX\", this.bulletX, \"fishArr[i].x\", fishArr[i].x);\n console.log(\"this.bulletY\", this.bulletY, \"fishArr[i].y\", fishArr[i].y);\n console.log(\"this.bulletZ\", this.bulletX, \"fishArr[i].z\", fishArr[i].z);\n\n this.element.remove();\n delete bulletsUsed[this.id];\n this.shadowBullet.remove();\n fishCreated[fishArr[i].id].shadow.remove();\n fishCreated[fishArr[i].id].element.remove();\n delete fishCreated[fishArr[i].id];\n }\n }\n }", "title": "" }, { "docid": "60be9318dda76c72e240839e70e2aed2", "score": "0.64897645", "text": "function nextStep(){\n for(let i=0; i<bullets.length; i++){\n bullets[i][1] = bullets[i][1] - 1;\n }\n}", "title": "" }, { "docid": "685d5522b2557dbb11e56d9a23951d56", "score": "0.6478571", "text": "function Bullet(x, y, direction) {\n this.x = x;\n this.y = y;\n this.dir = direction;\n}", "title": "" }, { "docid": "b1b581557e8774612886c2d7072c1ea6", "score": "0.64610785", "text": "showBullet()\n {\n this.bullet.css('left', this.left+'px');\n this.bullet.css('top', this.top+'px');\n this.bullet.show();\n }", "title": "" }, { "docid": "9584750b0064d01b9d4a6a1545c4a69f", "score": "0.6442448", "text": "function generate_slide_bullet()\n {\n sbullets = frsWrapper.find('ul.frs-sbullets');\n\n bulletsWalkingWidth = 0;\n bulletsMaxShowedIndex = 0;\n bulletsBackChild = 0;\n bulletsNextChild = 0;\n bulletsOffsetWidth = 0;\n bulletsPosition = 0; \n bulletsOffsetEnable = false; \n bulletsWidth = sbullets.parent().outerWidth(true);\n\n if(bulletsWidth > total_width)\n {\n each_width = bulletsWidth / numberSlides;\n total_width = each_width * numberSlides;\n }\n \n sbullets.parent().css('overflow', 'hidden');\n sbullets.css('background-color', sbullets.children('li').last().css(\"background-color\"));\n sbullets.children('li.frs-slideshow-nav-bullets').css('width',each_width + 'px'); \n sbullets.css('width', total_width + 'px');\n\n sbullets.find('li').each(function() {\n bulletsWalkingWidth += each_width;\n\n if (bulletsWalkingWidth + each_width > bulletsWidth) \n {\n bulletsNextChild = $(this).index();\n bulletsMaxShowedIndex = bulletsNextChild;\n }\n \n if (bulletsWalkingWidth > bulletsWidth) \n {\n $(this).addClass('frs-bullet-sliding-next');\n bulletsOffsetWidth = bulletsWalkingWidth - bulletsWidth;\n\n /* detect if bullets offset is too large */\n if(bulletsOffsetWidth < each_width)\n {\n bulletsOffsetEnable = true;\n }\n\n return false;\n }\n });\n }", "title": "" }, { "docid": "5671b832487f96c2a8eb0c44dd99571d", "score": "0.64415306", "text": "function bullet(x, y, speedX, speedY) {\n this.x = x;\n this.y = y;\n this.speedX = speedX;\n this.speedY = speedY;\n}", "title": "" }, { "docid": "bbd4dcd2cedc5749f0847d97411d4ec5", "score": "0.6436828", "text": "function fireBullet () {\n if (game.time.now > bulletTime) {\n bullet = bullets.getFirstExists(false);\n\n if (bullet) {\n\n bullet.reset(player.x, player.y - 16);\n bullet.body.velocity.y = -400;\n bullet.body.velocity.x = player.body.velocity.x / 4\n bulletTime = game.time.now + 200;\n }\n }\n}", "title": "" }, { "docid": "16cc7ba40171d30963a578ac9e41583c", "score": "0.6434623", "text": "update(time, delta){ \n //Has been initialised to 0, start counting.\n this.counter++;\n\n //If bullet exists.\n if(this){\n if (this.direction == \"r\") {\n this.x += this.speed * delta;\n } else if (this.direction == \"l\") {\n this.x -= this.speed * delta; \n }\n //Speed is the same as its current speed multiplied by delta (passed from GameScene)\n }\n /*If modulus returns 0, so the same*/\n /*Destroying bullets after some time to stop them showing on the screen\n if they didn't hit an enemy*/\n if (this.counter >50){\n console.log('destroying bullet')\n this.setActive(false);\n this.setVisible(false);\n this.destroy();\n //Reset to 0 for the next bullet.\n this.counter = 0;\n }\n }", "title": "" }, { "docid": "d78d051a2cff041ff3cd29a3e5c6bbbb", "score": "0.64007694", "text": "update() {\n\n // skip if destroyed\n if (this._state == StickyBullet.DESTROYED)\n return;\n\n // if stickiness enabled\n if (this.is_sticky) {\n\n // update stick timer\n this._stick_timer.update();\n\n // destroy the bullet if stick timer is up\n if (this._stick_timer.stopped)\n this.destroy();\n\n // stick if stick timer has started\n if (this._stick_timer.started)\n this.stick();\n }\n\n // update bullet\n super.update();\n }", "title": "" }, { "docid": "bf696a63c1e096038ac949f03f466a21", "score": "0.6399305", "text": "function bulletPath(){\n $('.shooter-fire').css('bottom','+=5px');\n // console.log($('.shooter-fire'));\n }", "title": "" }, { "docid": "d1df36bc2c68299e89db513003d2fdb5", "score": "0.6387502", "text": "update()\n {\n // Counters\n var dead = 0, moving = 0;\n\n // Updates positions and draws \n for (var p of this.list)\n {\n var d = p.displacement();\n if (d.dy!=0 || d.dx!=0)\n {\n moving++;\n p.move(d, 0xFFFFFFFF);\n }\n else\n {\n dead++;\n p.move(d);\n }\n }\n\n status(`list length ${this.list.length}, ${moving} moving, ${dead} dead`);\n }", "title": "" }, { "docid": "258b64789a02aa10719f3f580d1af7e2", "score": "0.6353848", "text": "function Bullet() {\n this.srcX = 120;\n this.srcY = 500;\n this.drawX = -20;\n this.drawY = 0;\n this.width = 13;\n this.height = 8;\n this.explosion = new Explosion();\n}", "title": "" }, { "docid": "d59ed459d7e018703aa5224878ab1aa3", "score": "0.63362604", "text": "renderBullets() {\n this.bullets=this.bullets.filter((bullet) => {\n return bullet.alive===true\n })\n this.bullets.forEach((bullet)=>{\n bullet.update();\n bullet.render();\n })\n }", "title": "" }, { "docid": "6563e46a02495109d923697e64332ff0", "score": "0.62957114", "text": "function moveBullet () {\n\t\t\t\tif ($scope.bulletAlive) {\n\t\t\t\t\tif(bullet.direction == 'Up') {\n\t\t\t\t\t\t$scope.bulletTop -= bullet.speed;\n\t\t\t\t\t} else if (bullet.direction == 'Down') {\n\t\t\t\t\t\t$scope.bulletTop += bullet.speed;\n\t\t\t\t\t} else if (bullet.direction == 'Left') {\n\t\t\t\t\t\t$scope.bulletLeft -= bullet.speed;\n\t\t\t\t\t} else if (bullet.direction == 'Right') {\n\t\t\t\t\t\t$scope.bulletLeft += bullet.speed;\n\t\t\t\t\t}\n\t\t\t\t}\n \n //hide the bullet if it goes out of game world\n\t\t\t\tif($scope.bulletTop < 0 || $scope.bulletTop > screenHt || $scope.bulletLeft < 0 || $scope.bulletLeft > screenWd) {\n\t\t\t\t\t$scope.bulletAlive = false;\n\t\t\t\t}\n }", "title": "" }, { "docid": "d248e3452331eb983ef083db0ba646df", "score": "0.6292178", "text": "function createBullet () {\n\t\t\t\tif(!$scope.bulletAlive) { //if the previous bullet is no more alive\n\t\t\t\t\tvar rand = Math.floor(Math.random() * 99);\n\t\t\t\t\tif(rand % 2 == 0) {\n\t\t\t\t\t\tbullet.direction = $scope.direction;\n\t\t\t\t\t\tif(bullet.direction == 'Up') {\n\t\t\t\t\t\t\t$scope.bulletTop = $scope.top - bullet.size/2;\n\t\t\t\t\t\t\t$scope.bulletLeft = $scope.left + size / 2 - bullet.size/2;\n\t\t\t\t\t\t} else if (bullet.direction == 'Down') {\n\t\t\t\t\t\t\t$scope.bulletTop = $scope.top + size + bullet.size/2;\n\t\t\t\t\t\t\t$scope.bulletLeft = $scope.left + size / 2 - bullet.size/2;\n\t\t\t\t\t\t} else if (bullet.direction == 'Left') {\n\t\t\t\t\t\t\t$scope.bulletTop = $scope.top + size / 2 - bullet.size/2;\n\t\t\t\t\t\t\t$scope.bulletLeft = $scope.left - bullet.size/2;\n\t\t\t\t\t\t} else if (bullet.direction == 'Right') {\n\t\t\t\t\t\t\t$scope.bulletTop = $scope.top + size / 2 - bullet.size/2;\n\t\t\t\t\t\t\t$scope.bulletLeft = $scope.left + size + bullet.size/2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$scope.bulletAlive = true;\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t}", "title": "" }, { "docid": "225ddb36e871b75756af7b0423fc61e4", "score": "0.6288003", "text": "function fire(){ //fire bullet from mouse.x on x axis, y axis, width, height, speed\r\n for (var _ = 0; _<1; _++){\r\n var x = mouse.x-bullet_width/2;\r\n var y = mouse.y-player_height;\r\n var __bullet = new Bullet(x, y, bullet_width, bullet_height, bullet_speed);\r\n _bullets.push(__bullet); //push bullet to my array of bullets\r\n //shot.play();\r\n }\r\n }", "title": "" }, { "docid": "c51af4d325c5f107ff0fbb45a9958146", "score": "0.62746716", "text": "function Bullet() {\r\n this.srcX = 100;\r\n this.srcY = 500;\r\n this.drawX = -20;\r\n this.drawY = 0;\r\n this.width = 5;\r\n this.height = 5;\r\n this.speed = 30;\r\n this.explosion = new Explosion ();\r\n}", "title": "" }, { "docid": "d3b9873087abae4a781590ee1f75da95", "score": "0.6238248", "text": "update() {\n this.x += this.dx;\n this.y += this.dy;\n this.timeSinceLastBullet += tickRate;\n\n // Check if the player has moved off the screen\n if (this.x < 0) {\n this.x = 0;\n }\n else if (this.x + this.width > virtualWidth) {\n this.x = virtualWidth - this.width;\n }\n if (this.y < 0) {\n this.y = 0;\n }\n else if (this.y + this.height > virtualHeight) {\n this.y = virtualHeight - this.height;\n }\n\n // Bullet destroying\n if(this.bullets.length > 0){\n if(this.bullets[0].destroy){\n this.bullets.shift();\n }\n }\n \n //Update the players bullets\n for (let i=0; i < this.bullets.length; i++) {\n if(this.enemys.length > 0){\n for (let index = 0; index < this.enemys.length; index++) {\n if(this.enemys[index].health > 0){\n if(this.bullets[i].hit(this.enemys[index])){\n this.bullets[i].destroy = true;\n this.enemys[index].takeDamage();\n }\n }\n }\n }\n this.bullets[i].update();\n }\n }", "title": "" }, { "docid": "b630d2ab0463a8c76a54e33325e34dca", "score": "0.6229189", "text": "function makeBullets() {\n for (let i=0; i<bullets.length; i++) {\n bullets[i].displayBullets();\n bullets[i].shootBullets();\n bullets[i].collideWithTile();\n }\n}", "title": "" }, { "docid": "293e8bf43ec8f474ddba65aedb708149", "score": "0.6227396", "text": "function create_bullet(){\n\t\tbullets.x.push(spaceship.x);\n\t\tbullets.y.push(spaceship.y);\n}", "title": "" }, { "docid": "4a8b738f7a0f6daea151ce93d0747cf0", "score": "0.6224362", "text": "function updateBulletBounds(obj){\r\n\tobj.x1 = obj.x;\r\n\tobj.y1 = obj.y;\r\n\tobj.x2 = obj.x;\r\n\tobj.y2 = obj.y;\r\n}", "title": "" }, { "docid": "f2b177bddde47a39dbf94892094babb0", "score": "0.6223344", "text": "function BulletList(){\n this.list = [];\n this.draw = function(){\n for(var i=0;i<this.list.length;i++){\n this.list[i].draw();\n }\n }\n this.move = function(){\n for(var i=0;i<this.list.length;i++){\n this.list[i].move();\n if(this.list[i].delete){\n this.list.splice(i,1);\n i--;\n }\n }\n }\n\n\n}", "title": "" }, { "docid": "cb5efa082a70c3fda45ede7c748e7173", "score": "0.6215572", "text": "function spawnBullet (xPos, yPos, angle, affili, bType) {\n bullets.push({x: xPos, y: yPos, ang: angle, affil: affili, stat: \"live\", type: bType})\n rumble ++\n}", "title": "" }, { "docid": "00be16155aa26126281224c44e063aa3", "score": "0.6213713", "text": "function shoot() {\n if (bulletK.left < window.innerWidth - bulletK.size && bulletK.top == 0) {\n bulletK.moveRight();\n }\n document.getElementById(\"bullet\").innerHTML = bulletK.getBullet();\n setTimeout(shoot, 150);\n}", "title": "" }, { "docid": "aa7556976ec204af061c62f3778855b5", "score": "0.61974055", "text": "function bullet_setoff()\n{\n for ( var i = 0; i < bullet.length; i++ )\n {\n bullet[ i ].draw_bullet();\n\n if ( bullet[ i ].x <= 0 || bullet[ i ].y <= 0 || bullet[ i ].x >= width+20 || bullet[ i ].y >= height )\n {\n bullet.splice( i, 1 );\n } //if ball goes out of frame, delete the ball from the array.\n }\n}", "title": "" }, { "docid": "eb3da33c00e5544acb28514aefef7c00", "score": "0.61964375", "text": "function Bullet(x,y) {\n\tCircle.call(this,x,y,1,'#CCC');\n}", "title": "" }, { "docid": "e9f829373e8dbf4f3e976e2fd62c2cb8", "score": "0.6194479", "text": "function updateBullets() {\n var validBullets = [];\n bullets.forEach(function(bullet) {\n switch(bullet.dir) { //rotate based on direction\n case KEYS.W: \n bullet.y -= bulletSpeed;\n break;\n case KEYS.A: \n bullet.x -= bulletSpeed;\n break;\n case KEYS.S: \n bullet.y += bulletSpeed;\n break;\n case KEYS.D: \n bullet.x += bulletSpeed;\n break;\n }\n\n if(!(bullet.x <= 0) && !(bullet.x >= gameWidth) && !(bullet.y <= 0) && !(bullet.y >= gameHeight)) { //collision with left barrier\n validBullets.push(bullet);\n }\n enemies.forEach(function(enemy){\n if(!enemy.isDead) {\n var collision = false; \n if(bullet.dir === KEYS.W || bullet.dir === KEYS.S) { //draw vertical line\n collision = collideLineCircle(bullet.x,bullet.y,bullet.x,bullet.y+bulletSize,enemy.x,enemy.y,enemy.size);\n } else if (bullet.dir === KEYS.A || bullet.dir === KEYS.D) { //draw horizontal line\n collision = collideLineCircle(bullet.x,bullet.y,bullet.x+bulletSize,bullet.y,enemy.x,enemy.y,enemy.size);\n } \n if(collision) {\n enemy.isDead = true;\n score++;\n return;\n }\n }\n });\n });\n bullets = validBullets;\n}", "title": "" }, { "docid": "c9ba1feb0bd3eba5f2ac394c9798538f", "score": "0.6172189", "text": "function createBullet() {\n randTime = Math.floor(Math.random() * 100);\n if (randTime % 10 == 0) {\n getAliens();\n fieldLeft = document.getElementById(\"game_field\").getBoundingClientRect().left;\n fieldTop = document.getElementById(\"game_field\").getBoundingClientRect().top;\n randAlien = Math.floor(Math.random() * alienCoordinates.length);\n raBottom = alienCoordinates[randAlien][2] - fieldTop;\n raLeft = alienCoordinates[randAlien][0] - fieldLeft + 15;\n bullet = document.createElement('IMG');\n bullet.src = 'images/bullet.png';\n bullet.id = 'bullet' + bulletList.length;\n bullet.className='bullet';\n bullet.style.position = 'absolute';\n bullet.style.width = '10px';\n bullet.style.top = raBottom + 11 + 'px';\n bullet.style.left = raLeft + 'px';\n document.getElementById('game_field').appendChild(bullet);\n bulletList.push(bullet);\n }\n\n}", "title": "" }, { "docid": "70e8b81a673d34e65da41cb2923f9f8f", "score": "0.6167502", "text": "function shootBullet() {\r\n // Disable shooting for a short period of time\r\n canShoot = false;\r\n setTimeout(\"canShoot = true\",SHOOT_INTERVAL);\r\n\r\n // Create the bullet using the use node\r\n\r\n\r\n\r\n var bullet = svgdoc.createElementNS(\"http://www.w3.org/2000/svg\", \"use\");\r\n\r\n if (player.motion == motionType.LEFT)\r\n bullet.setAttribute(\"motion\",\"LEFT\");\r\n else\r\n bullet.setAttribute(\"motion\",\"RIGHT\");\r\n\r\n\t svgdoc.getElementById(\"bullets\").appendChild(bullet);\r\n\r\n\t bullet.setAttributeNS(\"http://www.w3.org/1999/xlink\", \"xlink:href\", \"#bullet\");\r\n\r\n var bullet_x;\r\n\r\n if (player.motion == motionType.LEFT)\r\n bullet_x = player.position.x - PLAYER_SIZE.w/2.0 - BULLET_SIZE.w/2.0;\r\n else {\r\n bullet_x = player.position.x + PLAYER_SIZE.w/2.0 - BULLET_SIZE.w/2.0;\r\n }\r\n\t var bullet_y = player.position.y + PLAYER_SIZE.h/2.0 - BULLET_SIZE.h/2.0;\r\n\t bullet.setAttribute(\"x\", bullet_x);\r\n\t bullet.setAttribute(\"y\", bullet_y);\r\n\r\n if(openCheat == false)\r\n RemainingShoot = RemainingShoot - 1;\r\n}", "title": "" }, { "docid": "b58037a20a071a6f4784fabc14cff704", "score": "0.6147249", "text": "stick() {\n\n // temporary simple method\n //this.position = this._host.get_center();\n\n // stop the bullet from moving\n this.speed = 0;\n this.acceleration = 0;\n\n // translate pos difference\n this.position = Nickel.v2d.sub(this._host.get_center(), this._dp);\n\n // rotate around host origin by rot difference\n /** @todo note: not so accurate...turn matching needs fixing 6/10/2019 **/\n var nxtr = this._host.get_dir() - this._dr;\n var dr = nxtr - this.direction;\n this.sprite.rotate_around(dr, this._host.get_center());\n this.direction = nxtr;\n\n // scale only the position from host origin by scale difference\n //...TODO\n }", "title": "" }, { "docid": "7b443b4095b4684c4ed0da9e7d120615", "score": "0.6146417", "text": "update() {\n this.prev = this.pos.copy();\n let dv = this.vel.copy();\n dv.mult(dt);\n this.pos.add(dv);\n }", "title": "" }, { "docid": "6c956410038f0371fba934f546abcd7c", "score": "0.6144661", "text": "function shootBullet() {\n if (cheatMode) {\n nofBullets++;\n }\n\n if (nofBullets <= 0) return;\n \n shootSound.pause();\n shootSound.currentTime = 0;\n shootSound.play();\n\n canShoot = false;\n \n nofBullets = nofBullets-1\n\n svgdoc.getElementById(\"nofBullets\").textContent = nofBullets;\n setTimeout(\"canShoot = true\", SHOOT_INTERVAL);\n\n var bullet = svgdoc.createElementNS(\"http://www.w3.org/2000/svg\", \"use\");\n bullet.setAttribute(\"x\", player.position.x + PLAYER_SIZE.w / 2-BULLET_SIZE.w /2);\n bullet.setAttribute(\"y\", player.position.y + PLAYER_SIZE.h / 2-BULLET_SIZE.h /2);\n bullet.setAttribute(\"killMonster\", true);\n\n bullet.setAttribute(\"movingLeft\",playerIsMovingLeft);\n\n bullet.setAttributeNS(\"http://www.w3.org/1999/xlink\", \"xlink:href\", \"#bullet\");\n svgdoc.getElementById(\"bullets\").appendChild(bullet);\n}", "title": "" }, { "docid": "86de8168d5922d52f6e2ea62e970165a", "score": "0.6140609", "text": "function game_activity_start(){\n var game_tm=window.setInterval(game_update,30);\n function game_update(){\n var blocks=document.querySelectorAll(\".blocks img\");\n for(var i=0;i<blocks.length;i++){\n block_move(blocks[i]);\n \n }\n // block move\n var bullets_list=document.querySelectorAll(\".bullet_cn img\");\n for(var i=0;i<bullets_list.length;i++){\n var pos=bullets_list[i].getAttribute(\"data-pos\")-0;\n if(pos > 100){\n bullets_list[i].remove();\n if(document.querySelectorAll(\".bullets img\").length == 0 ){\n \n window.setTimeout(function(){game_end();},1000);\n }\n // game is over\n }\n // destroy the bullet after go top\n else{\n bullets_list[i].setAttribute(\"data-pos\",pos+1.5);\n bullets_list[i].style.top=\"calc(\"+(100 - pos)+\"% - 100px)\";\n for(var a=0;a<blocks.length;a++){\n var temp_node=blocks[a];\n var bottom_pos=window.getComputedStyle(temp_node, null).getPropertyValue(\"top\").replace(\"px\",\"\") - 0;\n var bullet_position=window.getComputedStyle(bullets_list[i], null).getPropertyValue(\"top\").replace(\"px\",\"\") - 0 ;\n if(bullet_position > bottom_pos && bullet_position < bottom_pos+50){\n var left_pos=(window.getComputedStyle(temp_node, null).getPropertyValue(\"left\").replace(\"px\",\"\") - 0 ) - 75;\n var right_pos=(window.getComputedStyle(temp_node, null).getPropertyValue(\"left\").replace(\"px\",\"\") - 0 ) ;\n var bullet_left_pos=window.getComputedStyle(bullets_list[i], null).getPropertyValue(\"left\").replace(\"px\",\"\") - 0 ;\n if(bullet_left_pos > left_pos && bullet_left_pos < right_pos ){\n if(environment==\"development\"){\n console.log(left_pos+\"-->\"+right_pos+\"=\"+bullet_left_pos);\n var test=document.querySelector(\".test\");\n var bullet_test=document.querySelector(\".bullet_test\");\n test.style.left=left_pos+\"px\";\n test.style.top=bottom_pos+\"px\";\n test.style.display=\"block\";\n bullet_test.style.left=bullet_left_pos+\"px\";\n bullet_test.style.top=bullet_position+\"px\";\n bullet_test.style.display=\"block\";\n }\n else{\n bullets_list[i].remove();\n temp_node.style.display=\"none\";\n var score=document.querySelector(\".score span\");\n var score_html=document.querySelector(\".score_html span\");\n var score_count=score_html.getAttribute(\"data-score\") -0;\n score_html.setAttribute(\"data-score\",score_count+1);\n score.innerHTML=score_count+1;\n score_html.innerHTML=score_count+1;\n\n }\n // environment setup\n \n }\n // horizonal target matching\n \n }\n // verticle target matcing\n }\n // checking all blocks\n }\n // bullet is on it's way\n }\n // bullet move\n }\n // update all move of blockes after 30 milisecond \n}", "title": "" }, { "docid": "7e65304cb8d32f965250cc36cb81f82e", "score": "0.6131239", "text": "function updateBullets() {\n player.weapon.bullets.forEach((item, index) => {\n\n if(item.originalPosition.distanceTo(item.bullet.position) > 250) { // Restrict the bullet from travelling past 250 units\n removeBullet(player, item.bullet, index);\n return; // Iterate to the next bullet\n }\n\n item.bullet.translateZ(-300 * clock.delta); // Move the bullet away from the player\n item.bullet.getWorldPosition(item.raycaster.ray.origin); // Update the ray's new origin as the bullet's current position\n item.raycaster.ray.set(item.raycaster.ray.origin, item.raycaster.ray.direction);\n\n // scene.add(new THREE.ArrowHelper(item.raycaster.ray.direction, item.raycaster.ray.origin, 1));\n let intersects = item.raycaster.intersectObjects(bulletCollidableMeshList, true);\n\n if(intersects.length > 0) {\n let intersect = intersects[0];\n let distance_one = intersect.distance;\n let distance_twoVec = new THREE.Vector3();\n distance_twoVec.subVectors(item.bullet.position, item.lastPosition);\n let distance_two = distance_twoVec.length();\n\n if(distance_one <= distance_two) { // Hit\n \n if(intersect.object.parent.parent.name != null) {\n switch(intersect.object.parent.parent.name) { // The name of the model that the hitbox mesh is attached to\n case \"alien1\":\n if(item.box >= alien1.canShoot.box) { // Only allow the player's bullet to deal damage if the player is in the same bounding box as the alien\n audioCollection.hitmarker.play();\n damageAlien(alien1, intersect, item.type);\n removeBullet(player, item.bullet, index); // Remove the bullet from the scene after hitting an alien\n }\n break;\n case \"alien2\":\n if(item.box >= alien2.canShoot.box) {\n audioCollection.hitmarker.play();\n damageAlien(alien2, intersect, item.type);\n removeBullet(player, item.bullet, index);\n }\n break;\n case \"alien3\":\n if(item.box >= alien3.canShoot.box) {\n audioCollection.hitmarker.play();\n damageAlien(alien3, intersect, item.type);\n removeBullet(player, item.bullet, index);\n }\n break;\n case \"alien4\":\n if(item.box >= alien4.canShoot.box) {\n audioCollection.hitmarker.play();\n damageAlien(alien4, intersect, item.type);\n removeBullet(player, item.bullet, index);\n }\n break;\n case \"alien5\":\n if(item.box >= alien5.canShoot.box) {\n audioCollection.hitmarker.play();\n damageAlien(alien5, intersect, item.type);\n removeBullet(player, item.bullet, index);\n }\n break;\n case \"alien6\":\n if(item.box >= alien6.canShoot.box) {\n audioCollection.hitmarker.play();\n damageAlien(alien6, intersect, item.type);\n removeBullet(player, item.bullet, index);\n }\n break;\n case \"boss\": // Boss\n if(!bossFightStarted || intro || bossRoaring) return; // Prevent player from shooting boss before combat is enabled or while boss is roaring\n audioCollection.hitmarker.play();\n damageBoss(item.type);\n removeBullet(player, item.bullet, index);\n break;\n }\n }\n }\n }\n\n if(currentLevel == 4 && !intro) {\n let intersects = item.raycaster.intersectObjects(orbCollidableMeshList, true);\n\n if(intersects.length > 0) {\n let intersect = intersects[0];\n let distance_one = intersect.distance;\n let distance_twoVec = new THREE.Vector3();\n distance_twoVec.subVectors(item.bullet.position, item.lastPosition);\n let distance_two = distance_twoVec.length();\n \n if(distance_one <= distance_two) { // Hit\n if(intersect.object.visible) {\n audioCollection.hitmarker.play();\n crosshair.style.background = \"url(hud/crosshairs/crosshair_hitmarker.svg)\";\n setTimeout(() => {\n crosshair.style.background = \"url(hud/crosshairs/crosshair.svg)\";\n crosshair.style.filter = \"none\";\n }, 300);\n \n switch(intersect.object.name) {\n case \"orbOne\":\n orbOne.active = false;\n orbOne.statusMesh.material.color.setHex(0xff0000);\n healingRayArray[0].visible = false;\n orbOne.mesh.visible = false;\n orbOne.mesh.children[0].visible = false;\n\n if(audioCollection.orbExplosion.isPlaying) {\n audioCollection.orbExplosion.stop();\n }\n audioCollection.orbExplosion.play();\n break;\n case \"orbTwo\":\n orbTwo.active = false;\n orbTwo.statusMesh.material.color.setHex(0xff0000);\n healingRayArray[1].visible = false;\n orbTwo.mesh.visible = false;\n orbTwo.mesh.children[0].visible = false;\n\n if(audioCollection.orbExplosion.isPlaying) {\n audioCollection.orbExplosion.stop();\n }\n audioCollection.orbExplosion.play();\n break;\n case \"orbThree\":\n orbThree.active = false;\n orbThree.statusMesh.material.color.setHex(0xff0000);\n healingRayArray[2].visible = false;\n orbThree.mesh.visible = false;\n orbThree.mesh.children[0].visible = false;\n\n if(audioCollection.orbExplosion.isPlaying) {\n audioCollection.orbExplosion.stop();\n }\n audioCollection.orbExplosion.play();\n break;\n case \"orbFour\":\n orbFour.active = false;\n orbFour.statusMesh.material.color.setHex(0xff0000);\n healingRayArray[3].visible = false;\n orbFour.mesh.visible = false;\n orbFour.mesh.children[0].visible = false;\n\n if(audioCollection.orbExplosion.isPlaying) {\n audioCollection.orbExplosion.stop();\n }\n audioCollection.orbExplosion.play();\n break;\n }\n }\n }\n }\n }\n item.lastPosition.copy(item.bullet.position); // Set the bullet's last position as the bullet's current position\n });\n\n if(player.weapon.cooldown > 0) {\n /** Handle weapon cooldown bar */\n player.weapon.cooldown -= 1;\n weaponCooldownBar.setAttribute(\"style\", \"width:\" + player.weapon.cooldown / 50.0 + \"%\");\n\n /** Handle recoil of the weapon */\n if(player.weapon.model.rotation.x < 0) {\n player.weapon.model.rotation.x = 0;\n player.weapon.recoil.reachedBottom = true;\n player.weapon.recoil.direction = \"up\";\n }\n if(player.weapon.model.rotation.x > 0.2) {\n player.weapon.model.rotation.x = 0.2;\n player.weapon.recoil.reachedTop = true;\n player.weapon.recoil.direction = \"down\";\n }\n\n if(player.weapon.recoil.direction == \"up\" && !player.weapon.recoil.reachedTop) {\n player.weapon.model.rotation.x += 0.05;\n }\n else if(player.weapon.recoil.direction == \"down\" && !player.weapon.recoil.reachedBottom) {\n player.weapon.model.rotation.x -= 0.02;\n }\n \n }\n}", "title": "" }, { "docid": "e067ef1f49216978098a088f70492f1a", "score": "0.6125675", "text": "function fireBullet () {\n\t\tif (game.time.now > bulletTime) {\n\t\t\tbullet = bulletSnacks.getFirstExists(false);\n\t\t\tif (bullet) {\n\t\t\t\tbullet.reset(playerBag.x, playerBag.y + 8);\n\t\t\t\tbullet.body.velocity.y = -400;\n\t\t\t\tbulletTime = game.time.now + 200;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "baf7abf5cc1bb733cc44745f50d6cc1a", "score": "0.611491", "text": "function addBullet(x, y, angle) {\n var bullet = bullets.get();\n if (bullet)\n {\n bullet.fire(x, y, angle);\n }\n}", "title": "" }, { "docid": "9ae0c4578edd8c19d870fcb3be05904a", "score": "0.61085355", "text": "function updateBullets() {\n\ttheBullets.forEach ( function(i, j) {\n\t\t\n\t\tvar rocketHit = false;\n\t\t// has the range been reached\n\t\tif (getDistance(i.xSource, i.ySource, i.x, i.y) > i.range) {\n\t\t\tif (i.type === 3) {\n\t\t\t\tcreateExplosion(i.x, i.y, 150, i.power);\n\t\t\t}\n\t\t\ttheBullets.splice(j, 1);\n\t\t\treturn\n\t\t}\n\t\t\t\n\t\t//collision with walls\n\t\tif (checkBulletWallCollision(i, j) ){\n\t\t\tif (i.type === 3) {\n\t\t\t\tcreateExplosion(i.x, i.y, 150, i.power);\n\t\t\t}\n\t\t\ttheBullets.splice(j, 1);\n\t\t\treturn\t\n\t\t}\n\t\tif (checkBulletCivilianCollision(i, j) ){\n\t\t\tif (i.type === 3) {\n\t\t\t\tcreateExplosion(i.x, i.y, 150, i.power);\n\t\t\t}\n\t\t\tif (i.type !== 2) {\n\t\t\t\ttheBullets.splice(j, 1);\n\t\t\t\treturn\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (checkBulletZombieCollision(i, j) ){\n\t\t\tif (i.type === 3) {\n\t\t\t\tcreateExplosion(i.x, i.y, 150, i.power);\n\t\t\t}\n\t\t\tif (i.type !== 2) {\n\t\t\t\ttheBullets.splice(j, 1);\n\t\t\t\treturn\t\n\t\t\t}\n\t\t}\n\n\n\t\ti.x += i.xtarget * i.xVelocity;\n\t\ti.y += i.ytarget * i.yVelocity;\n\t\t\n\t});\n\tif (theExplosions.length > 0) {\n\t\tupdateExplosions();\n\t}\n}", "title": "" }, { "docid": "e966129e958a3c0ed340d5b3a8756e30", "score": "0.61085093", "text": "function Update(){\n \n ctx.clearRect(0, 0, canvas.width, canvas.height); //clear whole canvas\n\n if(ticks % Alien.speed == 0){\n Alien.think();\n }\n\n player.Draw();\n aliens.forEach(alien => {\n alien.Draw();\n });\n\n bullets.forEach(bullet => {\n bullet.Think(); //making bullets move up\n bullet.Draw();\n });\n\n ticks++;\n window.requestAnimationFrame(Update);\n}", "title": "" }, { "docid": "307829ccda94f994a780a30db186a283", "score": "0.6098603", "text": "function Start () {\n // Get the rigidbody component\n var r2d = GetComponent(\"Rigidbody2D\");\n\n // Make the bullet move upward\n r2d.velocity.y = speed;\n}", "title": "" }, { "docid": "daf100b2e4cf3ec906760dd2cd4d9c42", "score": "0.60775095", "text": "function update(){\n // Case: difference smaller than frame speed\n if (Math.abs(pointer.old_pos - pointer.current_pos) < pointer.velocity){\n pointer.wrapper.style.left = pointer.current_pos+'px';\n pointer.old_pos = pointer.current_pos;\n // Case: moving to next image (in process)\n } else if (pointer.old_pos > pointer.current_pos) {\n pointer.old_pos -= pointer.velocity;\n // Case: moving to previous image (in process)\n } else {\n pointer.old_pos += pointer.velocity;\n }\n // set appropriate position for container\n pointer.wrapper.style.left = pointer.old_pos+'px';\n \n // redraw on change\n if (pointer.old_pos != pointer.current_pos)\n window.requestAnimationFrame(update);\n \n }", "title": "" }, { "docid": "cf57c49a6908dda51cafd67c6870f326", "score": "0.6074337", "text": "function createBullet(){\r\n bullet = createSprite(displayWidth/2,displayHeight/2 + 100,50,10);\r\n bullet.addImage(bulletImg);\r\n bullet.x = player.x;\r\n bullet.velocityY = -6;\r\n bullet.lifetime = 100;\r\n bullet.scale = 0.1;\r\n bulletGroup.add(bullet);\r\n // shooterSound.play();\r\n}", "title": "" }, { "docid": "589c83ae1c15551bd0fba60e2637762d", "score": "0.60526824", "text": "function Bulletl(pos) {\n Enemy.call(this, pos);\n this.speed = new Vector(-6, 0);\n this.sprite = 'character/bullet.png';\n}", "title": "" }, { "docid": "44f8497e5ba14438350cb394487fe806", "score": "0.6041071", "text": "function vuurSchuinVanLinksTop(x,y) {\n var bullet = document.createElement(\"div\");\n bullet.style.cssText = 'position:absolute; top: 0px; left: 0px; width:30px; height:30px; border-radius: 20px 20px; z-index:4; background-color:red; ';\n document.getElementById(\"container\").appendChild(bullet);\n function schietBullet()\n {\n bullet.style.left = parseInt(bullet.style.left) + x + \"px\";\n bullet.style.top = parseInt(bullet.style.top) + y + \"px\";\n var ufo = document.getElementById(\"ufo\");\n checkCollision(bullet, ufo);\n if(parseInt(bullet.style.left) > 2557|| (parseInt(bullet.style.top) < 0 || parseInt(bullet.style.top) > 1303))\n {\n if(bullet.parentNode)\n {\n bullet.parentNode.removeChild(bullet);\n }\n }\n }\n\n function schietBullet2(){\n var interval = setInterval(schietBullet, 1);\n setTimeout(function() {\n clearInterval(interval)\n }, 2000);\n }\n schietBullet2();\n}", "title": "" }, { "docid": "a46dd91f5ed135c7ef5b4f9fc1cd459e", "score": "0.6038005", "text": "function fire() {\n if (player.fireDelay > 13) {//making sure enough time has passed to shoot\n //getting distance between firepoint and mouse\n deltaX = mouseX - firePointX;\n deltaY = mouseY - firePointY;\n dist = Math.sqrt(deltaY ** 2 + deltaX ** 2);\n //dividing distance by 5 to get a third value that will later be used to make sure all bullets travel at a contant speed\n moveRate = dist / 5;\n //getting speeds for X and Y axes\n speedX = deltaX / moveRate;\n speedY = deltaY / moveRate;\n //making a new bullet, and adding it to the bullets list\n newBullet = new bullet(firePointX, firePointY, speedX, speedY);\n bullets.push(newBullet);\n //resetting the fire delay\n player.fireDelay = 0;\n }\n\n}", "title": "" }, { "docid": "78a28995215878237296bcef66a47b89", "score": "0.6035625", "text": "function createBullet() {\n var bullet = {\n x: ship.x + Math.cos(ship.a) * SHIP_SIZE / 2, // x coordinate of the bullet's center (same as the tip of the ship)\n y: ship.y + Math.sin(ship.a) * SHIP_SIZE / 2, // y coordinate of the bullet's center (same as the tip of the ship)\n dx: Math.cos(ship.a) * BULLET_SPEED + ship.dx, // x velocity of the bullet (add the ship's velocity for realism)\n dy: Math.sin(ship.a) * BULLET_SPEED + ship.dy, // y velocity of the bullet (add the ship's velocity for realism)\n lifetime: BULLET_LIFETIME // how long the bullet should live in frames\n };\n bullets.push(bullet);\n}", "title": "" }, { "docid": "175638030e9dadd9f650076890065bb7", "score": "0.6021277", "text": "update() {\n let top = 0\n let left = 0\n let height = 0\n let width = 0\n\n // update layer position\n this.offset += this.velocity\n\n this.sprites.forEach((sprite, idx) => {\n\n left = idx * this.elm.clientHeight - this.offset\n top = 0\n height = this.elm.clientHeight\n width = this.elm.clientHeight\n\n sprite.update(top, left, height, width)\n })\n }", "title": "" }, { "docid": "b1904a45aa6ee2ca5ef7f10fac9ffd77", "score": "0.60179585", "text": "function vuurSchuinVanLinksBot(x,y) {\n var bullet = document.createElement(\"div\");\n bullet.style.cssText = 'position:absolute; top: 1303px; left: 0px; width:30px; height:30px; border-radius: 20px 20px; z-index:4; background-color:red; ';\n document.getElementById(\"container\").appendChild(bullet);\n function schietBullet()\n {\n bullet.style.left = parseInt(bullet.style.left) + x + \"px\";\n bullet.style.top = parseInt(bullet.style.top) - y + \"px\";\n var ufo = document.getElementById(\"ufo\");\n checkCollision(bullet, ufo);\n if(parseInt(bullet.style.left) > 2557|| (parseInt(bullet.style.top) < 0 || parseInt(bullet.style.top) > 1303))\n {\n if(bullet.parentNode)\n {\n bullet.parentNode.removeChild(bullet);\n }\n }\n }\n\n function schietBullet2(){\n var interval = setInterval(schietBullet, 1);\n setTimeout(function() {\n clearInterval(interval)\n }, 2000);\n }\n schietBullet2();\n}", "title": "" }, { "docid": "54f339c0d4e0fd6325d8dd34f10050d3", "score": "0.60178095", "text": "function moveBulletsBoss() {\n bulletsBoss.forEach(function (bulletBoss) {//alala\n bulletBoss.y -= Math.random() * (1 - 2) - 3;\n bulletBoss.x += Math.random() * (5 + 5) - 5;\n bulletBoss.rotation += 0.4;\n });\n}", "title": "" }, { "docid": "e54f76aefc8e99151338737afd4a6c8b", "score": "0.6015597", "text": "function vuurSchuinVanRechtsBot(x,y) {\n var bullet = document.createElement(\"div\");\n bullet.style.cssText = 'position:absolute; top: 1303px; left: 2557px; width:30px; height:30px; border-radius: 20px 20px; z-index:4; background-color:red; ';\n document.getElementById(\"container\").appendChild(bullet);\n function schietBullet()\n {\n bullet.style.left = parseInt(bullet.style.left) - x + \"px\";\n bullet.style.top = parseInt(bullet.style.top) - y + \"px\";\n var ufo = document.getElementById(\"ufo\");\n checkCollision(bullet, ufo);\n if(parseInt(bullet.style.left) < 0|| (parseInt(bullet.style.top) < 0 || parseInt(bullet.style.top) > 1303))\n {\n if(bullet.parentNode)\n {\n bullet.parentNode.removeChild(bullet);\n }\n }\n }\n\n function schietBullet2(){\n var interval = setInterval(schietBullet, 1);\n setTimeout(function() {\n clearInterval(interval)\n }, 2000);\n }\n schietBullet2();\n}", "title": "" }, { "docid": "9f4e95056b17893375988815c47cda69", "score": "0.60129315", "text": "function createBullets() {\n var bullet= createSprite(100, 100, 60, 10);\n bullet.addImage(bulletImg);\n bullet.x = 360;\n bullet.y=gun.y;\n bullet.velocityX = 4;\n bullet.lifetime = 100;\n bullet.scale = 0.1;\n bulletsGroup.add(bullet);\n \n}", "title": "" }, { "docid": "79f1cfc651d1de6e1924a5bc8c050ca9", "score": "0.60116637", "text": "function drawBullet(bullet) {\n // Set the fill color to white\n ctx.fillStyle = COLOR_WHITE;\n\n // Fill a circle at the bullet's position with a radius of 2 pixels\n ctx.beginPath();\n ctx.arc(bullet.x, bullet.y, 2, 0, TWO_PI);\n ctx.fill();\n}", "title": "" }, { "docid": "a1ae577ee3de7ac410bd7cb91f927c76", "score": "0.6006202", "text": "function destroyBullet(b) {\r\n var bullet = $(b);\r\n bullet.css(\"top\", $(\"#character\").offset().top);\r\n bullet.css(\"left\", $(\"#character\").offset().left);\r\n }", "title": "" }, { "docid": "32de0b658f01d8d59bc31483d806eb60", "score": "0.60035825", "text": "function drawBullets() {\n strokeWeight(4);\n stroke(0,0,255);\n bullets.forEach(function(bullet) {\n if(bullet.dir === KEYS.W || bullet.dir === KEYS.S) { //draw vertical line\n line(bullet.x,bullet.y,bullet.x,bullet.y+bulletSize);\n } else if (bullet.dir === KEYS.A || bullet.dir === KEYS.D) { //draw horizontal line\n line(bullet.x,bullet.y,bullet.x+bulletSize,bullet.y);\n }\n });\n stroke(255);\n}", "title": "" }, { "docid": "d1164c0a9a5a8eaf3107119f6140e0e2", "score": "0.59909064", "text": "update(dt) {\n super.update(dt);\n // TODO: return a boolean for whether or not the bullet is still valid\n }", "title": "" }, { "docid": "86fee9f9a79ff065e9d1b6dba41c68fe", "score": "0.5986354", "text": "UpdatePossition()\n {\n this.holder.transform.possition.x += cutDecimal(this.speed.x * system.deltaTime);\n this.holder.transform.possition.y += cutDecimal(this.speed.y * system.deltaTime);\n }", "title": "" }, { "docid": "7bc0e43fe27a690ff4d5c46db3f8d02a", "score": "0.5976898", "text": "function vuurSchuinVanRechtsTop(x,y) {\n var bullet = document.createElement(\"div\");\n bullet.style.cssText = 'position:absolute; top: 0px; left: 2557px; width:30px; height:30px; border-radius: 20px 20px; z-index:4; background-color:red; ';\n document.getElementById(\"container\").appendChild(bullet);\n function schietBullet()\n {\n bullet.style.left = parseInt(bullet.style.left) - x + \"px\";\n bullet.style.top = parseInt(bullet.style.top) - y + \"px\";\n var ufo = document.getElementById(\"ufo\");\n checkCollision(bullet, ufo);\n if(parseInt(bullet.style.left) < 0|| (parseInt(bullet.style.top) < 0 || parseInt(bullet.style.top) > 1303))\n {\n if(bullet.parentNode)\n {\n bullet.parentNode.removeChild(bullet);\n }\n }\n }\n\n function schietBullet2(){\n var interval = setInterval(schietBullet, 1);\n setTimeout(function() {\n clearInterval(interval)\n }, 2000);\n }\n schietBullet2();\n}", "title": "" }, { "docid": "8277bb7e89c081e14ec2c0b0ba4039d9", "score": "0.59717244", "text": "function Bullet(posOptions) {\n let options = {game: posOptions['game'], color: 'red', pos: posOptions['pos'], radius: 5, vel: posOptions['vel'], wrappable: false}\n MovingObject.call(this, options);\n}", "title": "" }, { "docid": "0fcf97c818e4435d0cfd7e2dd6383fb1", "score": "0.59698784", "text": "function windBulletsHitEnemy (enemy, bullet) {\n bullet.kill();\n game.physics.arcade.moveToXY(enemyArray[enemy.name].monster,enemyArray[enemy.name].currentMovetoX,enemyArray[enemy.name].currentMovetoY,enemyArray[enemy.name].speed*0.6);\n /*\n enemyArray[enemy.name].monster.body.velocity.y = 0;\n enemyArray[enemy.name].monster.body.velocity.x =0;\n */\n // console.log(enemyArray[enemy.name].monster.body.velocity.y);\n}", "title": "" }, { "docid": "e6c09775adb030eaddb95f23e28fd5b6", "score": "0.5967535", "text": "function fireBullet(player, direction) {\n var directions = {\n 'UP': bullets,\n 'DOWN': bullets2\n }\n\n if (game.time.now > bulletTime1 && direction == 'UP')\n {\n // Cogemos la primera bala de la piscina\n if(direction in directions) {\n bullet = directions[direction].getFirstExists(false);\n }\n\n if (bullet)\n {\n // Disparamos la bala\n bullet.reset(player.x, player.y + 8);\n bullet.body.velocity.y = -800;\n bulletTime1 = game.time.now + 1000;\n } \n }\n else if(game.time.now > bulletTime2 && direction == 'DOWN') {\n // Cogemos la primera bala de la piscina\n if(direction in directions) {\n bullet = directions[direction].getFirstExists(false);\n }\n\n if (bullet) {\n // Disparamos la bala\n bullet.angle = 180;\n bullet.reset(player.x, player.y +30);\n bullet.body.velocity.y = 800;\n bulletTime2 = game.time.now + 1000;\n }\n }\n\n return player;\n}", "title": "" }, { "docid": "0cdf0969ee981947a1dc522d8c2c773b", "score": "0.5956007", "text": "updatePosition(dt) {\n\t\tthis.x += (this.velocity.x / 50) * dt;\n\t\tthis.y += (this.velocity.y / 50) * dt;\n\t}", "title": "" }, { "docid": "2fc30e7c9385391ae7c9bbfad44f2f95", "score": "0.5949432", "text": "function Bullet() {\n}", "title": "" }, { "docid": "356f284123c7cb70339aaf4fb55d1241", "score": "0.593083", "text": "function movePos (bullet, drop) {\n const tmpB = listItems[bullet]\n const tmpD = delBtns[bullet]\n\n /* Delete old bullet then put it in new spot in array */\n listItems.splice(bullet, 1)\n delBtns.splice(bullet, 1)\n if (drop === 0) {\n listItems.splice(drop, 0, tmpB)\n delBtns.splice(drop, 0, tmpD)\n } else {\n listItems.splice(drop - 1, 0, tmpB)\n delBtns.splice(drop - 1, 0, tmpD)\n }\n }", "title": "" }, { "docid": "c22be4d7040e61fd8d30ae87f6dd2708", "score": "0.59292406", "text": "function Bullet(bulletSet, spriteTexture, spawnPos, speed, dir, size) {\n if (size === undefined) {\n this.kRefWidth = 130;\n\n } else {\n\n this.kRefWidth = size;\n }\n this.kRefHeight =this.kRefWidth *15/13;\n\n this.mBullet = new SpriteRenderable(spriteTexture);\n this.mBullet.setColor([1, 1, 1, 0.1]);\n this.mBullet.getXform().setPosition(spawnPos[0], spawnPos[1]);\n this.mBullet.getXform().setSize(this.kRefWidth / 50, this.kRefHeight / 50);\n // this.mBullet.setElementPixelPositions(510, 595, 23, 153);\n this.mBullet.setElementPixelPositions(0,64,0,64);\n\n this.mbulletSet = bulletSet;\n\n GameObject.call(this, this.mBullet);\n\n this.setSpeed(speed);\n this.setCurrentFrontDir(dir);\n\n this.kDemage = 0;\n\n\n this.spawnTime = Date.now();\n}", "title": "" }, { "docid": "7679c6e143f24c789c00359286c59936", "score": "0.5927126", "text": "function Bullet(x, y, xVelocity, yVelocity, src, game) {\n this.x = x; // probably doesn't need to be here\n this.y = y;\n // this.rotation = rotation;\n this.name = \"Bullet\";\n this.xVelocity = xVelocity;\n this.yVelocity = yVelocity;\n this.src = src;\n this.game = game;\n this.speed = 0;\n this.animation = null;\n this.damage = 0;\n this.spent = false;\n\n var screen = worldToScreen(this.x, this.y);\n var world = screenToWorld(this.x, this.y);\n this.screenX = screen.x;\n this.screenY = screen.y;\n this.worldX = world.x;\n this.worldY = world.y;\n\n switch (this.src) {\n case 'pistol':\n this.speed = 10;\n this.damage = 34;\n this.radius = 5;\n this.animation = new Animation(ASSET_MANAGER.getAsset(\"./img/bullet.jpg\"), 0, 0, 114, 114, .15, 1, true, false);\n break;\n case 'assault rifle':\n this.speed = 20;\n this.damage = 25;\n this.radius = 5;\n this.animation = new Animation(ASSET_MANAGER.getAsset(\"./img/bullet.jpg\"), 0, 0, 114, 114, .15, 1, true, false);\n break;\n case 'shotgun':\n this.speed = 10;\n this.damage = 20;\n this.radius = 3;\n this.animation = new Animation(ASSET_MANAGER.getAsset(\"./img/bullet.jpg\"), 0, 0, 114, 114, .15, 1, true, false);\n\n break;\n case 'sniper':\n this.speed = 30;\n this.damage = 200;\n this.radius = 4;\n this.penetration = 5;\n this.animation = new Animation(ASSET_MANAGER.getAsset(\"./img/bullet.jpg\"), 0, 0, 114, 114, .15, 1, true, false);\n\n break;\n case 'grenade':\n this.speed = 7;\n this.damage = 100;\n this.radius = 5;\n default:\n break;\n\n }\n //this.radius = 70;\n\n Entity.call(this, game, this.x, this.y);\n}", "title": "" }, { "docid": "415448d937b251197ea364e1f0f7d829", "score": "0.5926208", "text": "function step(timestamp) {\n\n //update css variable\n positionLeft += speedX;\n positionTop += speedY;\n\n //change speed and direction variable if the ball hits the edge of the screen\n if( positionLeft > width ){\n speedX = speedX * -1 ;\n }\n\n if( positionLeft < 0 ){\n speedX = speedX * -1;\n }\n\n if( positionTop > height ){\n speedY = speedY * -1 ;\n }\n\n if( positionTop < 0 ){\n speedY = speedY * -1;\n }\n\n //edit class\n $('#shape').css(\"left\", positionLeft)\n $('#shape').css(\"top\", positionTop)\n\n window.requestAnimationFrame(step);\n }", "title": "" }, { "docid": "54fc6d31e4cf2224a7853c07142b85ec", "score": "0.5922835", "text": "function shoot() {\n var xPos = player.position().top;\n\n //create individual name for each bullet => bullet0, bullet1 etc..\n var bulletName = \"bullet\" + bulletCount;\n bulletCount++;\n\n //insert bullet\n $( 'div#amo' ).append( '<div class=\"bullet\" id=\"' + bulletName + '\"></div>' );\n\n //attach indivdual bullets to player position //1600\n $( 'div#' + bulletName ).css( {\n 'top': xPos + 25 + 'px'\n } ).animate( {\n left: '489px'\n }, {\n duration: 1600,\n done: function() {\n this.remove(); //remove <div> it at the end of the animation (which is at the max width)\n },\n step: function() { //function to be called for EACH animated property\n var bulletCords = $( this ).offset(); //to get actual position on the screen\n var enemies = $( \".enemy\" );\n for ( var i = 0; i < enemies.length; i++ ) { // loop through .enemy class\n var enemyCords = enemies.eq( i ).offset(); // gets individual position\n\n if ( bulletCords.left + 10 >= enemyCords.left + 5 && bulletCords.top + 10 >= enemyCords.top + 1 && enemyCords.top + 35 >= bulletCords.top ) {\n enemies.eq( i ).remove() // remove the .enemy elements to the one at the specified index\n $( 'div#' + bulletName ).fadeOut( 1000 ).remove(); // removes the div\n killCount += 1;\n parseInt( $( 'span#score' ).html( killCount ) );\n gameOver();\n speedUp();\n }\n }\n }\n } );\n }", "title": "" }, { "docid": "d7fd01099bf299ace97c14564fc3f467", "score": "0.59178627", "text": "shootBullet(time, delta){\n if (this.input.activePointer.isDown) {\n this.bullet = this.bullets.get();\n\n if (this.bullet)\n {\n this.bullet.shoot(this.player.x, this.player.y);\n this.lastFired = time + 50;\n this.music = this.sound.add(\"shootSound\");\n this.music.play();\n }\n }\n }", "title": "" }, { "docid": "2b6b4c1ed5ded004ba72a17adf538b49", "score": "0.5915812", "text": "function shoot() {\n\n if (!gameSettings.gameOver && !gameSettings.pause) {\n var clone = cloneFbx(gameObjects.bullet.object);\n clone.position.set(gameObjects.player.position.x, gameObjects.player.position.y, gameObjects.player.position.z);\n clone.angle = gameObjects.player.rotation.y + Math.PI;\n scene.add(clone);\n clone.id = gameObjects.bullet.id++;\n gameObjects.bullet.bullets.push(clone);\n }\n}", "title": "" }, { "docid": "2855e53f22b74c806ff6f725bc626bcc", "score": "0.59113", "text": "function initializeBullets() {\n var bullets = [];\n var turrets = $('.turret')\n for(var i = 0; i < 32; i++) {\n var round = [0]\n $(turrets[i]).attr('turret_id', i);\n for(var j = 0; j < 4; j++) {\n var bullet = document.createElement('div'); \n $('#sky').append(bullet);\n $(bullet).addClass('bullet');\n $(bullet).hide();\n round.push(bullet);\n }\n bullets.push(round);\n }\n $(document).attr('bullets', bullets);\n}", "title": "" }, { "docid": "ae4c527205e55882538dc4bdc572f9f2", "score": "0.5896645", "text": "function Player_bullet() {\n _super.call(this, \"player_bullet\", 8);\n }", "title": "" }, { "docid": "8d96f9ce04169af1a2b3d6d36d308428", "score": "0.5885709", "text": "function repositionGameItem(){\n gameItem.x += gameItem.speedX; // update the position of the circle along the x-axis\n gameItem.y += gameItem.speedY; // update the position of the circle along the x-axis\n\n }", "title": "" }, { "docid": "1a59316f8abb8aa00650e68553aead38", "score": "0.5867752", "text": "function fireBullet(posX, posY) {\n // Reset the bar hit or it will start throwing the rope\n // ..instead of the bullet\n barHit = false;\n isActive = true;\n\n firedPointX = posX;\n firedPointY = posY;\n\n // Get the positions relative to the current bot position\n relFiredPointX = firedPointX - bot.posX;\n relFiredPointY = firedPointY - bot.posY;\n\n // Relative angles to the fire position\n relAngleX = relAngleY = Math.atan2(relFiredPointY, relFiredPointX) * 57.32;\n\n // Set the fired flag\n bulletFired = true;\n }", "title": "" }, { "docid": "0bfa13da2aa76c704604d285af4fa136", "score": "0.5849762", "text": "update() {\n if (this.posX > L10_2.crc2New.canvas.width || this.posX < 0) {\n this.velocityX = -this.velocityX;\n }\n if (this.posY > L10_2.crc2New.canvas.height * 0.20 || this.posY < 10) {\n this.velocityY = -this.velocityY;\n }\n this.posX += this.velocityX;\n this.posY += this.velocityY;\n // this.draw();\n }", "title": "" }, { "docid": "021460d1543ef051f1df1b11620a1254", "score": "0.5843079", "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": "84657ec9319a759abf53e95085ca8289", "score": "0.5834915", "text": "function animatePlayer() {\n\n //mouvement du joueur \n if(Keyboard.RIGHT){\n player.x += player.speed;\n \n }\n if(Keyboard.LEFT){\n player.x -= player.speed;\n \n }\n\n //gestion du débordement de l'érand du joueur\n if (player.x < 0) {\n player.x = 0;\n }\nelse if (player.x + player.sprite.width > canvas.width) {\n player.x = canvas.width - player.sprite.width;\n}\nif (Keyboard.SPACE) {\n if ( player.bullet === null){\n player.bullet = {\n x : player.x + player.sprite.width / 2,\n y : player.y,\n width : 4,\n height : 15,\n color : '#0f0',\n speed : 9,\n };\n }\n}\n\nif(player.bullet !== null) {\n player.bullet.y -= player.bullet.speed;\n\n if ( player.bullet.y + player.bullet.height < 0) {\n player.bullet = null;\n }\n}\n\n}", "title": "" }, { "docid": "136afd3d2c1fe8a949680caf571d0c2b", "score": "0.5834542", "text": "updatePos() {\n //find the changes in x and y\n var yChange = this.speed * Math.sin(this.theta) ;\n var xChange = this.speed * Math.cos(this.theta) ;\n //update the positions\n this.posX = this.posX + xChange ;\n this.posY = this.posY + yChange ;\n //update css\n this.element.css(\"left\", this.posX) ;\n this.element.css(\"top\", this.posY) ;\n }", "title": "" }, { "docid": "77f9528cf2f604a02f837e6dc095869e", "score": "0.5830519", "text": "updatePositions() {\n for (const sprite of this.sprites) {\n const { x, y } = this.state.position;\n sprite.setPosition(x, y);\n }\n }", "title": "" }, { "docid": "b854a025006f2aa3f3758febf4fcd95d", "score": "0.5825905", "text": "function bulletSwitch() {\n $(\".slider__control-bullets-item--active\").removeClass(\n \"slider__control-bullets-item--active\"\n );\n const slideActive = $(\".section-testimonials__box--active\");\n const slideNumber = $(\".section-testimonials__box\").index(slideActive);\n $(\".slider__control-bullets-item\")\n .eq(slideNumber)\n .addClass(\"slider__control-bullets-item--active\");\n }", "title": "" }, { "docid": "17a01d8312bb4e2bcd4974e28f3e5aa5", "score": "0.5821419", "text": "constructor(_name, _size, _position) {\n super(\"Bullet\", _size, _position);\n this.velocity = fc.Vector3.ZERO();\n //let cmpMaterial: fc.ComponentMaterial = new fc.ComponentMaterial(this.grey);\n //this.addComponent(cmpMaterial); \n }", "title": "" }, { "docid": "8d00e53619c6034915275fdcea328bbd", "score": "0.5817808", "text": "function bulletThumbs() {\n\t\t\tvar thumbs_markup = '';\n\n\t\t\tfor(var i = 0; i < $slides.length; i++) {\n\t\t\t\tthumbs_markup += '<a href=\"#\" class=\"mpc_ls_thumb\"><span class=\"mpc_ls_thumb_inside\"></span></a>'\n\t\t\t}\n\t\t\t\n\t\t\t$thumbs_container\n\t\t\t\t.addClass(settings.uiStyle)\n\t\t\t\t.append(thumbs_markup)\n\t\t\t\t.height($thumbs_container.children().height());\n\n\t\t\t$thumbs = $thumbs_container.children();\n\t\t\t$thumbs.eq(index).addClass('active');\n\n\t\t\tif(settings.showBulletsTooltip)\n\t\t\t\taddTooltip();\n\n\t\t\tpositionThumbs();\n\t\t}", "title": "" }, { "docid": "e1364c49eb3a91585872dae733fe0734", "score": "0.5816051", "text": "function resetBullet() {\n bullet.kill();\n}", "title": "" }, { "docid": "c4f05564dc142d08581cfaf7a3a56cd8", "score": "0.5800204", "text": "function shootBullet() {\n shootSound.currentTime = 0;\n shootSound.play();\n if (!cheatEnabled) {\n remainingBulletsNode = remainingBulletsNodeSet;\n let foundUse = false;\n for (let i = 0; i < remainingBulletsNode.childNodes.length; i++) {\n let node = remainingBulletsNode.childNodes.item(i);\n if (node.nodeName == \"use\") {\n node.parentNode.removeChild(node);\n break;\n }\n else {\n continue;\n }\n }\n for (let i = 0; i < remainingBulletsNode.childNodes.length; i++) {\n let node = remainingBulletsNode.childNodes.item(i);\n if (node.nodeName == \"use\") {\n foundUse = true;\n break;\n }\n else {\n continue;\n }\n }\n\n // Disable shooting for a short period of time\n canShoot = false;\n if (foundUse) {\n setTimeout(\"canShoot = true\", SHOOT_INTERVAL);\n }\n }\n else {\n canShoot = false;\n setTimeout(\"canShoot = true\", SHOOT_INTERVAL);\n }\n // Create the bullet using the use node\n let bullet = new Bullet();\n bullet.faceRight = player.faceRight;\n bullet.node = document.createElementNS(\"http://www.w3.org/2000/svg\", \"use\");\n bullet.node.setAttribute(\"x\", player.position.x + PLAYER_SIZE.w / 2 - BULLET_SIZE.w / 2);\n bullet.node.setAttribute(\"y\", player.position.y + PLAYER_SIZE.h / 2 - BULLET_SIZE.h / 2);\n bullet.node.setAttributeNS(\"http://www.w3.org/1999/xlink\", \"xlink:href\", \"#bullet\");\n bulletsNodeSet.appendChild(bullet.node);\n bulletsClass.push(bullet);\n}", "title": "" }, { "docid": "018ad9f63cebeedf0abec69e98c3ac39", "score": "0.5799981", "text": "function update() {\n for (var i = 0; i < balls.length; i += 1) {\n ball = balls[i];\n ball.nextX = (ball.x += ball.velocityX);\n ball.nextY = (ball.y += ball.velocityY);\n }\n }", "title": "" } ]
0bff74b8c2dabe4382660ce3cba03aa7
For not moving after drag
[ { "docid": "8bff6c4cbfdc6f554f2d1ae5d1d60c51", "score": "0.0", "text": "function dblclick(d) {\n d3.select(this).classed(\"fixed\", d.fixed = false);\n }", "title": "" } ]
[ { "docid": "ce0eefd035078ba7c176d47ceb320704", "score": "0.7504444", "text": "function dragMove (e) {\n var clientX = isTouch ? e.touches[0].pageX : e.clientX,\n clientY = isTouch ? e.touches[0].pageY : e.clientY,\n limitsX = self.limits.x,\n limitsY = self.limits.y;\n // Mouse movementin px\n movedX = clientX - posX;\n movedY = clientY - posY;\n\n // Based on the direction of the first px\n // disable drag if moving in opposite axis\n if(!isDragging && (self.restrict.y && Math.abs(movedY) > Math.abs(movedX)\n || self.restrict.x && Math.abs(movedX) > Math.abs(movedY))) {\n return dragEnd();\n }\n e.preventDefault();\n isDragging = true;\n ele.classList.add('isDragging');\n\n if (!self.restrict.x) {\n // New pixel value (x axis) of element\n newX = relativeX + movedX;\n if (newX >= limitsX[0] && newX <= limitsX[1]) {\n posX = clientX;\n relativeX = newX;\n }\n else if (newX < limitsX[0]) {\n relativeX = limitsX[0];\n }\n else if (newX > limitsX[1]) {\n relativeX = limitsX[1];\n }\n self.position.x = relativeX;\n }\n if (!self.restrict.y) {\n newY = relativeY + movedY;\n if (newY >= limitsY[0] && newY <= limitsY[1]) {\n posY = clientY;\n relativeY = newY;\n }\n else if (newY < limitsY[0]) {\n relativeY = limitsY[0];\n }\n else if (newY > limitsY[1]) {\n relativeY = limitsY[1];\n }\n self.position.y = relativeY;\n }\n util.rAF.call(window, function () {\n var use3d = self.config.use3d;\n ele.style[transformProp] = 'translate' + (use3d ? '3d' : '') + '(' + relativeX + 'px,' + relativeY + 'px' + (use3d ? ',0)' : ')');\n self.onDragMove.call(self, e, { x: movedX, y: movedY });\n });\n }", "title": "" }, { "docid": "e40cac4bce3c19407fc38a223251a809", "score": "0.7369043", "text": "function finishDragging() {\n\tisDragged = false;\n}", "title": "" }, { "docid": "1a329b23423a2127d518888bcc7cdec2", "score": "0.7292748", "text": "function dragended() {}", "title": "" }, { "docid": "b80e93af272966b90099a5e9903135ea", "score": "0.7266028", "text": "function mouseDragged() {\n return false;\n}", "title": "" }, { "docid": "b80e93af272966b90099a5e9903135ea", "score": "0.7266028", "text": "function mouseDragged() {\n return false;\n}", "title": "" }, { "docid": "e0b2f0119a2ca61184e5190907d91386", "score": "0.72450995", "text": "function touchMoved() {\n return false;\n}", "title": "" }, { "docid": "f47eb799a7c481c33b794b60c826077f", "score": "0.7224969", "text": "flowDragMove(e){\n let deltaX = e.clientX - this.dragX;\n let deltaY = e.clientY - this.dragY;\n\n this.dragX = e.clientX;\n this.dragY = e.clientY;\n\n this.updating.dragShift(deltaX, deltaY);\n e.preventDefault();\n }", "title": "" }, { "docid": "af51755b20d3ce7f2b41884fc0b73920", "score": "0.7211253", "text": "function dontStart(){ return ( drag.dragging === false ); }", "title": "" }, { "docid": "604cc116c09ce2a219fa487941bdd6f0", "score": "0.7172535", "text": "onMove(e) {\n const curr = this.currentWidget;\n\n if (curr) {\n let dx = e.offsetX - this.lastX;\n let dy = e.offsetY - this.lastY;\n\n curr.moveBy(dx, dy);\n\n if (!App.currentWorkzone.verticalLine.checkPosition(curr)) {\n this.lastX = e.offsetX;\n }\n\n if (!App.currentWorkzone.horizontalLine.checkPosition(curr)) {\n this.lastY = e.offsetY;\n }\n }\n }", "title": "" }, { "docid": "d4e96d48216e60e7821d6f4407e86f02", "score": "0.7157813", "text": "function drag(event) { }", "title": "" }, { "docid": "7a1758df4081213e93ca04388c1dcc40", "score": "0.7143448", "text": "function dragObj() {\n console.log(\"Manual Move\");\n if (mouseX - 30 > 0 && mouseX < 800 && mouseY - 30 > 0 && mouseY < 500) {\n objects[drag].pos = [mouseX - coords[0], mouseY - coords[1]];\n } \n setScene();\n \n}", "title": "" }, { "docid": "448e735a16c0de4a783a84d4675c33cd", "score": "0.71403396", "text": "handleDragStart() {\n this.isDragging = true;\n }", "title": "" }, { "docid": "b5b5acca69201c9dbd3a682ce8472374", "score": "0.71189314", "text": "function checkAndMove() {\n\n if (mouseDown && selected.move) {\n selected.move();\n }\n\n}", "title": "" }, { "docid": "ba045b6ff53d1a05ff9ea52f584d93c4", "score": "0.7116139", "text": "function drag (move) {\n var start = new Vec2(mouse.x, mouse.y)\n var diff = new Vec2(0, 0)\n var onMove\n mouse.change(onMove = function () {\n //can easily disable the other axi\n //for draging in only one dimention.\n move(diff.set(mouse.x, mouse.y).subtract(start)) \n })\n window.addEventListener('mouseup', function () {\n mouse.ignore(onMove)\n diff.dropped = true\n move(diff)\n })\n move(diff.set(mouse.x, mouse.y).subtract(start)) \n}", "title": "" }, { "docid": "a4a0987277eb23bf27ae6ef56ba91af8", "score": "0.7087066", "text": "static onUp(e, offset) { DragBar.dragStartDim = undefined; }", "title": "" }, { "docid": "1b7615b346cfb99d7c07a574760a04a5", "score": "0.70837045", "text": "mouseDrag(prev, pt) {}", "title": "" }, { "docid": "1b7615b346cfb99d7c07a574760a04a5", "score": "0.70837045", "text": "mouseDrag(prev, pt) {}", "title": "" }, { "docid": "d113b2a3f3bef14c2e6ee2b6ecd7a004", "score": "0.707795", "text": "function mouseDragged() {\n\n // NIVEL 8\n //revisa si la posición del astronauta es cercana a la posicion de la luna\n if (dist(mouseX, mouseY, x1, y1) < tam1 / 2 + 20) {\n\n //actualiza la posicion de la elipse con la posición del mouse\n x1 = mouseX;\n y1 = mouseY;\n }\n\n\n // NIVEL 9\n //revisa si la posición del CIRCULO es cercana a la posicion del no cuadrado\n else if (dist(mouseX + 30, mouseY + 30, x2, y2) < tam2 / 2 + 20) {\n\n //actualiza la posicion de la elipse con la posición del mouse\n x2 = mouseX;\n y2 = mouseY;\n }\n}", "title": "" }, { "docid": "f0fa326aec98a1727e306be62c410091", "score": "0.70776165", "text": "function dragStart(){\n setObserver(false);\n}", "title": "" }, { "docid": "dfd1958f4c04a752b354649713b8a9aa", "score": "0.7033407", "text": "onStopDrag() {\n return;\n }", "title": "" }, { "docid": "7752953e0cac656386dac12b0d18629a", "score": "0.70297265", "text": "drag() {\n this._container.drag();\n }", "title": "" }, { "docid": "53e3f30683fb1f20bf984f7a56f19a03", "score": "0.6999746", "text": "function drag(e) {\n if (active == true && selectState == 0) {\n e.preventDefault();\n\n if (e.type === \"touchmove\") {\n currentX = e.touches[0].clientX - initialX;\n currentY = e.touches[0].clientY - initialY;\n } else {\n currentX = e.clientX - initialX;\n currentY = e.clientY - initialY;\n }\n xOffset = currentX;\n yOffset = currentY;\n\n setTranslate(currentX, currentY, dragItem);\n }\n}", "title": "" }, { "docid": "1370128dd6199ade7472ed2d872a2a0e", "score": "0.69988996", "text": "function onDragMove() {\n if (this.dragging) {\n var newPosition = this.data.getLocalPosition(this.parent);\n this.x = newPosition.x;\n this.y = newPosition.y;\n }\n}", "title": "" }, { "docid": "002a455db2f66c262b488e1237e047ff", "score": "0.6994376", "text": "function dragMove() {\r\n overwolf.windows.dragMove(windowID);\r\n }", "title": "" }, { "docid": "16d6de44bba54a027a3a1b694f08359b", "score": "0.69605863", "text": "function moveDragOver(e){\n\te.preventDefault();\n}", "title": "" }, { "docid": "09cea77de07cf67385177084a52156eb", "score": "0.6928059", "text": "dragComplete(){\n //does nothing\n }", "title": "" }, { "docid": "a29e147a0ceb4ce16792ae374ddf802e", "score": "0.68686014", "text": "function onDragMove(event) {\n\t\tif (Event.dragTarget) {\n\t\t\tif (Event.dragTarget.isObserving(\"drag\")) Event.dragTarget.fire(\"drag\", event);\n\t\t\t\n\t\t} else if (Event.dragStart) {\n\t\t\tvar target = Event.dragStart.target;\n\n// TODO: figure out the dragOffset\t\t\t\n\t\t\tif (\tMath.abs(Event.x - Event.dragStart.x) >= target.dragStartDistance\n\t\t\t\t || Math.abs(Event.y - Event.dragStart.y) >= target.dragStartDistance) \n\t\t\t{\n\t\t\t\tEvent.dragTarget = target;\n\t\t\t\tif (Event.dragTarget.isObserving(\"dragstart\")) target.fire(\"dragstart\", event);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "1c8ef254a53f373629000b4e040234d1", "score": "0.6863913", "text": "isDragAvailable() {\n return true;\n }", "title": "" }, { "docid": "9fefcf4ea96ad6549f6e91922894f651", "score": "0.6852177", "text": "function touchMoved(){\n return false;\n}", "title": "" }, { "docid": "4be28de72939c485f8cab2b949ea87cc", "score": "0.68467593", "text": "function mouseReleased() {\n\ndragging = 0;\n\n}", "title": "" }, { "docid": "25f093d575709cb6091ac4ed31ac2223", "score": "0.6842835", "text": "function mouse_move_handler(e) {\n\tvar evn;\n\tevn = e || event;\n\tif (is_drag) {\n\t\tdrag_clone.style[\"visibility\"] = \"visible\";\n\t\tvar y = evn.clientY\n\t\t\t\t+ document.getElementsByTagName('html')[0].scrollTop;\n\n\t\tdrag_clone.style[\"top\"] = (y - 5) + \"px\";\n\t\tdrag_clone.style[\"left\"] = (evn.clientX - 5) + \"px\";\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "9ce77cfae25a03160acdd6faaecef1e5", "score": "0.6840981", "text": "function dragmove(d, i) {\r\n\t\td.px += d3.event.dx;\r\n\t\td.py += d3.event.dy;\r\n\t\td.x += d3.event.dx;\r\n\t\td.y += d3.event.dy; \r\n\t\ttick(); // this is the key to make it work together with updating both px,py,x,y on d !\r\n\t}", "title": "" }, { "docid": "7c63f4de41709fc98144eafca342da54", "score": "0.6835764", "text": "function dragleave()\n{\n console.log(\"Dragged element left target zone\");\n}", "title": "" }, { "docid": "bbec19e39ef3f7128195aec9aca00008", "score": "0.68283755", "text": "function moveHandler(e) {\n // Move the element to the current mouse position, adjusted by the\n // position of the scrollbars and the offset of the initial click.\n newX = (baseX + (e.clientX - clickX));\n newY = (baseY + (e.clientY - clickY));\n elementToDrag.setXY(newX, newY);\n\tworkspace.draw();\n\n // And don't let anyone else see this event.\n e.stopPropagation(); \n }", "title": "" }, { "docid": "28735a1a0277b0390edfe2a1b232eab2", "score": "0.682037", "text": "function drag() {\r\n var dx, dy, moveout;\r\n var handle = $(\"#dBox\").find(\"#d_head>#d_title\").css('cursor', 'move');\r\n handle.mousedown(function (e) {\r\n dx = e.clientX - parseInt($(\"#dBox\").css(\"left\"));\r\n dy = e.clientY - parseInt($(\"#dBox\").css(\"top\"));\r\n $(\"#dBox\").mousemove(move).mouseout(out).css({\r\n \"opacity\": opts.opacity\r\n });\r\n handle.mouseup(up);\r\n });\r\n /*\r\n * move for a new position\r\n */\r\n move = function (e) {\r\n moveout = false;\r\n var x, y;\r\n if (e.clientX - dx < 0) {\r\n x = 0;\r\n } else {\r\n if (e.clientX - dx > ($(window).width() - $(\"#dBox\").width())) {\r\n x = $(window).width() - $(\"#dBox\").width();\r\n } else {\r\n x = e.clientX - dx;\r\n }\r\n }\r\n if (e.clientY - dy < 0) {\r\n y = 0;\r\n } else {\r\n y = e.clientY - dy;\r\n }\r\n $(\"#dBox\").css({\r\n left: x,\r\n top: y\r\n });\r\n }\r\n out = function (e) {\r\n moveout = true;\r\n setTimeout(function () {\r\n moveout && up(e);\r\n }, 5);\r\n }\r\n up = function (e) {\r\n $(\"#dBox\").unbind(\"mousemove\", move).unbind(\"mouseout\", out).css(\"opacity\", 1);\r\n handle.unbind(\"mouseup\", up);\r\n }\r\n }", "title": "" }, { "docid": "2621a9dd134452c19d3c9ac5a9350665", "score": "0.6814976", "text": "function dragEnd(e) { }", "title": "" }, { "docid": "e47603f26af8d5a5f47347d710029ff9", "score": "0.68107295", "text": "function noDragStart() {\n return false;\n}", "title": "" }, { "docid": "e47603f26af8d5a5f47347d710029ff9", "score": "0.68107295", "text": "function noDragStart() {\n return false;\n}", "title": "" }, { "docid": "e47603f26af8d5a5f47347d710029ff9", "score": "0.68107295", "text": "function noDragStart() {\n return false;\n}", "title": "" }, { "docid": "8ea032f90f79cf605ff170a138d5e5ee", "score": "0.6810449", "text": "function noDragStart() {\r\n\t\t return false;\r\n\t\t}", "title": "" }, { "docid": "bfa75ae0bea064e29b897bc4204e3f7e", "score": "0.6801366", "text": "function tmove(e) {\n\t\t\t\t\tif(isDrag==true)\n\t\t\t\t\t{\n\t\t\t\t\t\t//prevent default event\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\n\t\t\t\t\t\t//to prevent display error dialog in ie11\n\t\t\t\t\t\tif(window.navigator.userAgent.indexOf(\"rv:11\")!=-1)$(obj).trigger('mouseup');\n\t\t\t\t\t\t\n\t\t\t\t\t\t//trace mouse\n\t\t\t\t\t\t$(this).css({\"top\":e.pageY - y + divY +\"px\",\"left\":e.pageX - x + divX + \"px\"});\n\t\t\t\t\t\teX=e.pageX;\n\t\t\t\t\t\teY=e.pageY;\n\t\t\t\t\t\t\n\t\t\t\t\t\t//mouse up or mouse leave event\n\t\t\t\t\t\t$(this).on(\"mouseup\",tup);\n\t\t\t\t\t\t$(frameBody).on(\"mouseleave\",\".divTable\",tup);\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" }, { "docid": "fd306af0c9f460085883bc95d1c471fd", "score": "0.67977285", "text": "function drag_start(d) {\n if (!d3.event.active) simulation.alphaTarget(0.3).restart();\n d.fx = d.x;\n d.fy = d.y;\n }", "title": "" }, { "docid": "5081631ec814acbdd2f0624fdbe32643", "score": "0.67942", "text": "stopDragging() {\n if (this.mode === 'dragging') {\n this.checkMove();\n }\n this.mode = 'standBy';\n }", "title": "" }, { "docid": "3ca31377f7abbb704af733c6abc82b78", "score": "0.67886347", "text": "function mouseDragged() {\n //prevent default\n\n return false;\n\n}", "title": "" }, { "docid": "9b3734d95ad760076cdef86a55c2d348", "score": "0.6785024", "text": "function myMove(e)\n{\n\tvar curs = false;\n\n\tobj.forEach(function(item, i)\n\t{\n\t\tif (e.pageX < item.x + 50 + canvas1.offsetLeft && e.pageX > item.x - 50 +\n\t\t\tcanvas1.offsetLeft && e.pageY < item.y + 50 + canvas1.offsetTop &&\n\t\t\te.pageY > item.y - 50 + canvas1.offsetTop)\n\t\t\tcurs = true;\n\t\tcanvas1.style.cursor = curs ? 'pointer' : 'default';\n\t\tif (item.dragok)\n\t\t{\n\t\t\titem.x = e.pageX - canvas1.offsetLeft;\n\t\t\titem.y = e.pageY - canvas1.offsetTop;\n\t\t}\n\t});\n}", "title": "" }, { "docid": "607ffc277f93511c4254de9df1078e44", "score": "0.6783549", "text": "drag(ev) {\n // console.log('drag')\n }", "title": "" }, { "docid": "962cb2bb67cba1710bb5d06473f02a40", "score": "0.67820966", "text": "drag(bool) {\n this.enableDrag = bool;\n }", "title": "" }, { "docid": "f31d7c1c2dcaca5f6bd254e47fab324d", "score": "0.6773332", "text": "function up_dragged(e) {\n\t//Si il y a un clone en cours de mouvement, on le supprime, on remet tout à zéro et on \n\t// appelle la fonction qui gère le drag si elle existe et qu'il y a un récepteur en dessous \n\tif (current_drag!=null) {\n\t\t//Y-a-t-il un récepteur en dessous du lâché ?\n\t\ttarget=is_on();\n\t\t//Appel de la fonction callback_after si elle existe\n\t\tif (dragged.getAttribute(\"callback_after\")) {\n\t\t\teval(dragged.getAttribute(\"callback_after\")+\"(dragged,e,'\"+target+\"')\");\n\t\t}\n\t\t//Remise à zero\n\t\tposxdown=0;\n\t\tposydown=0;\n\t\tis_down=false;\n\t\tif (current_drag) current_drag.parentNode.removeChild(current_drag);\n\t\tcurrent_drag=null;\n\t\t//Si il y a un récepteur : callback de la fonction d'association si elle existe \n\t\tif (target) {\n\t\t\tif (eval(\"typeof \"+dragged.getAttribute(\"dragtype\")+\"_\"+document.getElementById(target).getAttribute(\"recepttype\")+\"=='function'\")) {\n\t\t\t\teval(dragged.getAttribute(\"dragtype\")+\"_\"+document.getElementById(target).getAttribute(\"recepttype\")+\"(dragged,document.getElementById(target))\");\n\t\t\t}\n\t\t}\n\t\t//On nettoie la référence à l'élément d'origine\n\t\tdragged=null;\n\t}\n}", "title": "" }, { "docid": "7ddbc94ee9d6c61e3d8b9a600cf42963", "score": "0.6768285", "text": "function Draggable(_latLng){\n this.latLng = _latLng;\n this.shape;\n this.size;\n this.moving = false;\n\n\t\n this.end_move = function(){\n if(this.moving){\n this.finalize_move();\n }\n this.moving = false;\n /* kludge ... consider another to figure this out */\n if(global.moving_component != null && global.moving_component != this){\n global.moving_component.end_move();\n }\n global.moving_component = null;\n return true;\n }\n\n this.start_move = function(){\n global.moving_component = this;\n this.moving = true;\n }\n\n this.move_click = function(){\n if(!this.moving && global.moving_component == null){\n this.start_move()\n }\n else{\n this.end_move();\n }\n }\n\n this.remove = function(){\n return;\n }\n\n this.mouse_move = function(event){ \n if(this.moving){\n this.move(event);\n }\t\t \n }\n\n this.move = function(event) {\n return;\n }\n\n this.finalize_move = function(){\n return;\n }\n\t\n this.get_pos = function(){\n return this.latLng;\n }\n\t\n this.draw = function(){\n if(typeof this.shape.setMap == 'function'){\n this.shape.setMap(objects.map);\n }\t\t\n }\n\n this.undraw = function(){\n if(typeof this.shape.setMap == 'function'){\n this.shape.setMap(null);\n if(global.selected_node == this){\n this.deselect();\n } \n }\n }\n\t\n this.show = function(){\n if(typeof this.shape.getVisible == 'function'){\n this.shape.setVisible(true);\n }\n }\n\n this.hide = function(){\n if(typeof this.shape.getVisible == 'function'){\n this.shape.setVisible(false);\n }\n }\t\n\t\n}", "title": "" }, { "docid": "31a5a33d92e54919657a073618ca9bd9", "score": "0.67635304", "text": "isMoving() {\n return (\n this.isDragging ||\n this.isScrolling ||\n Math.abs(this.velocity.x) >= 0.01 ||\n Math.abs(this.velocity.y) >= 0.01\n );\n }", "title": "" }, { "docid": "8616b692dfa7050ad3c98d55faab49a6", "score": "0.6758402", "text": "function dragstart(d, i) {\n force.stop(); // stops the force auto positioning before you start dragging\n}", "title": "" }, { "docid": "1d6d0282cfc88bae3d357d5d4684c922", "score": "0.6748975", "text": "function editOnDragOver(editor,e){editor._internalDrag=false;editor.setMode('drag');e.preventDefault();}", "title": "" }, { "docid": "be14fa3e5402955a827737fe1a3fa264", "score": "0.6748805", "text": "get isDragging() {\n return this._isDown;\n }", "title": "" }, { "docid": "3a315fe428a56f2469a8d99d7f40e965", "score": "0.6745044", "text": "function drag(e) {\r\n draggedItem = e.target;\r\n dragging = true;\r\n}", "title": "" }, { "docid": "3a315fe428a56f2469a8d99d7f40e965", "score": "0.6745044", "text": "function drag(e) {\r\n draggedItem = e.target;\r\n dragging = true;\r\n}", "title": "" }, { "docid": "3a315fe428a56f2469a8d99d7f40e965", "score": "0.6745044", "text": "function drag(e) {\r\n draggedItem = e.target;\r\n dragging = true;\r\n}", "title": "" }, { "docid": "cada5ca012a0c25a34fac0c476355633", "score": "0.6743866", "text": "function handleDrag(event){\n if(checkIfPieceAndTurnIsYours(event)) {\n event.target.x = (event.stageX / (container.width/720)) - 30;\n event.target.y = (event.stageY / (container.height/720)) - 50;\n }\n }", "title": "" }, { "docid": "0391d4451f63f3b420d128a4aa16ede7", "score": "0.6742888", "text": "function drag_start(d) {\n if (!d3.event.active) simulation.alphaTarget(0.3).restart();\n d.fx = d.x;\n d.fy = d.y;\n }", "title": "" }, { "docid": "c8df7301af03886f4350fdc3b0449483", "score": "0.67362976", "text": "isMoveable()\n {\n return true;\n }", "title": "" }, { "docid": "b01fa9240eef813ef608f8d597297f0c", "score": "0.6723526", "text": "function drag_start(d) {\n if (!d3.event.active) simulation.alphaTarget(0.3).restart();\n d.fx = d.x;\n d.fy = d.y;\n }", "title": "" }, { "docid": "57e1ad6c2172fd689ddb0f342a70e592", "score": "0.67221355", "text": "function drag(e) {\n draggedItem = e.target;\n dragging = true;\n}", "title": "" }, { "docid": "77612238e1c833082b6269a861559ac9", "score": "0.6721932", "text": "toggle_drag(e) {\n let self = e.data.self;\n e.stopPropagation();\n e.preventDefault();\n self.dragging = e.type === \"mousedown\";\n if (self.dragging) {\n self.dragged = true; // just ensuring the user did this at least once\n self.origin.x = e.pageX;\n self.origin.y = e.pageY;\n self.reference.element.width.computed = Math.floor($(self.DOM.reference.box).outerWidth);\n self.reference.element.height.computed = Math.floor($(self.DOM.reference.box).outerHeight);\n }\n }", "title": "" }, { "docid": "7174125c7c92465fbcd473674cfe2499", "score": "0.6720337", "text": "drag(e) {\n surface.map.updateMapLocation();\n }", "title": "" }, { "docid": "c3f215601a50fed35f98d1cb86e9c415", "score": "0.6709823", "text": "function dragstarted(event, d) {\n if (!event.active) simulation.alphaTarget(0.3).restart()\n d.fx = d.x;\n d.fy = d.y;\n}", "title": "" }, { "docid": "0c51df6cce976b81d5c6c87be9a3da9e", "score": "0.6708653", "text": "function draggedStart(d) {\n\tsimulation.alphaTarget(1.0).restart()\n\td.fixed = true\n\td.fx = d.x\n\td.fy = d.y\n}", "title": "" }, { "docid": "5c1b0db8a193fb419537c8c198b1ebfe", "score": "0.6707425", "text": "function dragnode(e) {\n closeAllPopovers();\n\n var returnResult = true;\n if (e.pos[1] < 0) {\n e.e.preventDefault();\n e.el.style.top = '10px';\n returnResult = false;\n }\n if (e.pos[0] < 0) {\n e.e.preventDefault();\n e.el.style.left = '10px';\n returnResult = false;\n }\n MyAppDAGService.nodes[e.el.id].style = {top: e.el.style.top, left: e.el.style.left};\n return returnResult;\n }", "title": "" }, { "docid": "2194620474563d992191b3cb70f92d5f", "score": "0.670304", "text": "function gestureMove(ev){if(!pointer||!typesMatch(ev,pointer))return;updatePointerState(ev,pointer);runHandlers('move',ev);}", "title": "" }, { "docid": "0977292b7cc850d2c0550fbf25ee0282", "score": "0.6699792", "text": "function onMouseUp(event){\n\t\tdragging = false;\n\t\t}", "title": "" }, { "docid": "2ed45c9a9c6bb4f5a0adb7cde538338a", "score": "0.6694608", "text": "function drag_start(d) {\n if (!d3.event.active) simulation.alphaTarget(0.3).restart();\n d.fx = d.x;\n d.fy = d.y;\n}", "title": "" }, { "docid": "67519f0ed98f501e1eacd617bfd0c56c", "score": "0.6691689", "text": "function drag()\n{\n console.log(\"Dragging\");\n}", "title": "" }, { "docid": "4837e32db738955a16a215e6cb5663db", "score": "0.66914195", "text": "function dragstarted(d) {\n\t d3.event.sourceEvent.stopPropagation();\n\t // d.fx = d.x;\n\t // d.fy = d.y;\n\t netLayout.velocityDecay(0);\n\t }", "title": "" }, { "docid": "6a74565333458e9c40c55a4c42496b70", "score": "0.66902417", "text": "function stopDrag() {\n // snap to grid\n var left = parseInt(evt.clientX - that.offsetLeft);\n console.log('@@@@@@@@@@@@@ ', left)\n console.log('########### ', nearest(left, 5))\n that.style.left = nearest(left, 5) + 'px';\n console.log('%%%%%%%@@@@ ', that.style.left)\n\n document.removeEventListener('mousemove', moveAlong);\n document.removeEventListener('mouseup', stopDrag);\n }", "title": "" }, { "docid": "762b4074298627ff739d7421944125cb", "score": "0.66814405", "text": "mousedragMove(mouseDraggedEvent, button)\r\n {\r\n // We click the mouseWheel button. event.buttons == 2 is right-click.\r\n if(mouseDraggedEvent.buttons == button)\r\n {\r\n let speed = Math.ceil(this.clicksPerPixel * 0.5);\r\n this.mapPosition.x -= mouseDraggedEvent.movementX * speed;\r\n this.mapPosition.y -= mouseDraggedEvent.movementY * speed;\r\n this.anchor = undefined;\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "40d4af3f4249842180e3c55ca141c983", "score": "0.6662312", "text": "function out_box_dragmove() {\t \n var x = out_box_x + d3.event.dx;\n var y = out_box_y + d3.event.dy;\n \n \tout_box_x = Math.max(Math.min(x, width-out_box_w), 0);\n \tout_box_y = Math.max(Math.min(y, height-out_box_h), 0);\n\n\t\td3.select(this)\n\t\t .attr(\"transform\", \"translate(\" + out_box_x + \",\" + out_box_y + \")\");\t \n\t}", "title": "" }, { "docid": "6e95531e70ba6b2d23c1bcd8ec290a97", "score": "0.66584283", "text": "get wantsMouseMove() {}", "title": "" }, { "docid": "efb660b9d1a6739ffd17a5c260a105f1", "score": "0.6657973", "text": "isDragging() {\n return exports.Konva['DD'].isDragging;\n }", "title": "" }, { "docid": "73800a69234a670baa39d31493933722", "score": "0.6651596", "text": "onMove(event) {\n if (this.active) { //<!>\n curPosX = (event.clientX - clickPosX);\n curPosY = (event.clientY - clickPosY);\n reDraw();\n }\n }", "title": "" }, { "docid": "75c1b16b94a9da3d03820b1a581b20c0", "score": "0.66395587", "text": "function drag(e) {\n if (active) {\n //prevent default dragging behavior (like dragging screen)\n e.preventDefault();\n\n //If the device is mobile:\n if (e.type === \"touchmove\") {\n currentX = e.touches[0].clientX - initialX;\n } else {\n currentX = e.clientX - initialX;\n }\n\n //XOffset is delta in pixels from start drag event\n xOffset = currentX;\n\n //If Direction is 'right'\n if (xOffset < 0) {\n direction = -1;\n }\n else { //if direction is left\n direction = 1;\n }\n\n //If mouse/finger drags less than threshold don't direction //TBD - consider removing\n if (Math.abs(xOffset) < 30) {\n direction = 0;\n }\n\n if (direction == 1 && swiped == false) {\n //Draw right blue bar on master and send message to slave\n sendNav(0);\n swiped = true;\n } else if (direction == -1 && swiped == false) {\n //Draw left blue bar on master and send to slave\n sendNav(1);\n swiped = true;\n }\n\n /*if (swiped == false) {\n message.innerHTML = 'Started swiping';\n }*/\n\n click = false;\n }\n}", "title": "" }, { "docid": "dc2781914a4f97ff4ce805782c7aa777", "score": "0.6637801", "text": "function dragstarted(d) {\n if(d.no_drag) return;\n hovertool.body.style(\"visibility\", \"hidden\");\n if (!d3.event.active) simulation.alphaTarget(1).restart();\n d.fx = d.x;\n d.fy = d.y;\n }", "title": "" }, { "docid": "1f1c1c67ca215f5474d900634a4e4498", "score": "0.66377395", "text": "function editOnDragStart() {\n\t this._internalDrag = !0, this.setMode(\"drag\");\n\t }", "title": "" }, { "docid": "96be75f2970b0cdbd1ef21eb10fed0dc", "score": "0.663436", "text": "function touchMoved() {\n // do some stuff\n return false;\n}", "title": "" }, { "docid": "1dd2bbe96f98af88e32c3afa00d43208", "score": "0.66307825", "text": "function dragmove() {\n const x = d3.event.x;\n const y = d3.event.y;\n d3.select(this).attr('cx', x).attr('cy', y);\n}", "title": "" }, { "docid": "3c58c59f8b0f1fb6ef5c2cc1150162f3", "score": "0.66276217", "text": "function drag(elem) {\n // store the object of the element that needs to be moved\n selected = elem;\n elemX = posX - selected.offsetLeft;\n elemY = posY - selected.offsetTop;\n}", "title": "" }, { "docid": "70a8bdc91a9ed8bf311219194a6df204", "score": "0.662489", "text": "function dragEnter(event) {\n }", "title": "" }, { "docid": "764b34d87451e73c54372cb0f4f1cd55", "score": "0.6620207", "text": "onMove() {\n }", "title": "" }, { "docid": "d5d1c23ee0a457aea8d8673b787b6a6a", "score": "0.6611638", "text": "function dragstarted(d) {\n if (!d3.event.active) simulation.alphaTarget(0.3).restart();\n d.fx = d.x;\n d.fy = d.y;\n }", "title": "" }, { "docid": "61fc71d130c179f9e9a833bd76f80cc4", "score": "0.6610926", "text": "function dragstarted(d) {\n if (!d3.event.active) simulation.alphaTarget(0.3).restart()\n d.fx = d.x;\n d.fy = d.y;\n }", "title": "" }, { "docid": "f49aa1fcbf5f94eedd8f15e1e1fc0f9b", "score": "0.66082627", "text": "function dragstarted(d) {\n\tif (!d3.event.active) simulation.alphaTarget(0.3).restart();\n\td.fx = d.x;\n\td.fy = d.y;\n}", "title": "" }, { "docid": "1986dbc17369afbe9d186751c6cbebfd", "score": "0.660524", "text": "function drag(evt) {\n var coord = getMousePosition(evt, container);\n debugText.textContent = coord.x + 'x' + coord.y;\n //evt.preventDefault();\n if (!offset) {\n offset = {\n s: 0\n };\n }\n var dt = parseInt(coord.x) - offset.s;\n handleDrag(coord, dt);\n offset.s = coord.x;\n }", "title": "" }, { "docid": "c80b290ce905f71bdcc12edf746f45da", "score": "0.6594078", "text": "function editOnDragStart(editor){editor._internalDrag=true;editor.setMode('drag');}", "title": "" }, { "docid": "1b9f3902ff6234a8b6686bc4657c73b3", "score": "0.65902215", "text": "function mouseReleased() {\r\n moveLeft = false;\r\n moveRight = false;\r\n}", "title": "" }, { "docid": "d7a76188d1736958e7e2883c740d8976", "score": "0.6588464", "text": "function drag_start(){\n drag.draggable({\n containment:'parent',\n scroll:false,\n drag:function(){ dragging() },\n stop:function(){}\n });\n }", "title": "" }, { "docid": "386db636bc34df565aa5946a1c6cff8a", "score": "0.65810496", "text": "function prepareDrag() {\n var that = this;\n\n stage.onContent('mousemove touchmove', function(evt) {\n var node = engine.drag.node;\n if (node) {\n var date = new Date();\n var time = date.getTime();\n\n if (time - engine.drag.lastDrawTime > engine.dragTimeInterval) {\n engine.drag.lastDrawTime = time;\n\n var pos = that.getUserPosition();\n var dc = node.dragConstraint;\n var db = node.dragBounds;\n var lastNodePos = {\n x: node.x,\n y: node.y\n };\n\n // default\n var newNodePos = {\n x: pos.x - engine.drag.offset.x,\n y: pos.y - engine.drag.offset.y\n };\n\n // bounds overrides\n if (db.left !== undefined && newNodePos.x < db.left) {\n newNodePos.x = db.left;\n }\n if (db.right !== undefined && newNodePos.x > db.right) {\n newNodePos.x = db.right;\n }\n if (db.top !== undefined && newNodePos.y < db.top) {\n newNodePos.y = db.top;\n }\n if (db.bottom !== undefined && newNodePos.y > db.bottom) {\n newNodePos.y = db.bottom;\n }\n\n node.setAbsolutePosition(newNodePos);\n\n // constraint overrides\n if (dc === 'horizontal') {\n node.y = lastNodePos.y;\n } else if (dc === 'vertical') {\n node.x = lastNodePos.x;\n }\n\n engine.drag.node.getLayer().draw();\n\n if (!engine.drag.moving) {\n engine.drag.moving = true;\n // execute dragstart events if defined\n engine.drag.node.handleEvents('ondragstart', evt);\n }\n\n // execute user defined ondragmove if defined\n engine.drag.node.handleEvents('ondragmove', evt);\n }\n }\n }, false);\n\n stage.onContent('mouseup touchend mouseout', function(evt) {\n that.endDrag(evt);\n });\n }", "title": "" }, { "docid": "f662a7d29e8515cfe60c40c289c757a7", "score": "0.65806484", "text": "function dragstarted(d) {\n if (!d3.event.active) forceSimulation.alphaTarget(0).restart();\n d.fx = d.x;\n d.fy = d.y;\n }", "title": "" }, { "docid": "f4589d12cc95ac15255662af067c1bc1", "score": "0.65802085", "text": "function dragstarted(d) {\n\t// if (!d3.event.active) simulation.alphaTarget(0.03).restart();\n\td.fx = d.x;\n\td.fy = d.y;\n}", "title": "" }, { "docid": "c79e7359c21f07c1a926bb9c622936f4", "score": "0.657575", "text": "function dragstarted(d) {\n d3.select(this).raise().classed(\"active\", true); \n d3.select(this).attr(\"y\", d3.mouse(this)[1]); \n g.selectAll('#limit').remove()\n //g.selectAll('.divergence').remove()\n }", "title": "" }, { "docid": "1af72d758d5feeeaf8575e0d0149a56c", "score": "0.65721506", "text": "function dragstart(event) { event.preventDefault(); }", "title": "" }, { "docid": "0d92b52dec139d62e73aa2ab5dbcd365", "score": "0.6570922", "text": "isMoving() {\n return (\n this.isDragging ||\n this.isScrolling ||\n Math.abs(this.velocity.x) >= 0.01 ||\n Math.abs(this.velocity.y) >= 0.01\n );\n }", "title": "" }, { "docid": "1dc523b03a6e1b54f576d2e1f90a11cf", "score": "0.6569205", "text": "function dragstarted(d) {\r\n if (!d3.event.active) simulation.alphaTarget(0.3).restart();\r\n d.fx = d.x;\r\n d.fy = d.y;\r\n }", "title": "" }, { "docid": "6504e42e8e7e511a2c15f33e760843a2", "score": "0.6563437", "text": "function dragCheck(){\n\tif(clickInfo.length > 0)\n\t\tif((getMousePos() - clickInfo[5]).sqrMagnitude > 60) dragMode = true;\n}", "title": "" }, { "docid": "8e16df1637c03111fb4011546f962d5d", "score": "0.6563232", "text": "doDragMove(element, x, y, event) {\n let dx = x - this._drag.last.x;\n let dy = y - this._drag.last.y;\n // get initial supports and move elements on glass without changing support.\n for (let selectedElement of this._dragSet) {\n Canvas.instance.moveElementOnGlass(selectedElement, null, x, y);\n }\n // get targets (using final positions of dragged elements)\n let targets = this.getTargets(this._dragSet);\n // Possible change of support...\n for (let selectedElement of this._dragSet) {\n let target = targets.get(selectedElement);\n // No target at all : element is outside viewport\n if (!target) {\n Canvas.instance.moveElementOnGlass(selectedElement, null,\n selectedElement._drag.last.x+selectedElement._drag.drag.x,\n selectedElement._drag.last.y+selectedElement._drag.drag.y);\n } else {\n /* support changed */\n if (target.effective!==selectedElement.support) {\n Canvas.instance.moveElementOnGlass(selectedElement, target.effective, x, y);\n }\n selectedElement._drag.last.x = selectedElement.gx;\n selectedElement._drag.last.y = selectedElement.gy;\n }\n }\n for (let selectedElement of this._dragSet) {\n let target = targets.get(selectedElement);\n if (target) {\n selectedElement._hoverOn(target.effective, this._dragSet, target.initial);\n }\n selectedElement._fire(Events.DRAG_MOVE);\n }\n this._drag.last.x = x;\n this._drag.last.y = y;\n this._doHover(dx, dy);\n Canvas.instance._fire(DragMoveSelectionOperation.DRAG_MOVE_MOVE, this._dragSet);\n for (let selectedElement of this._dragSet) {\n selectedElement.registerValidLocation();\n }\n }", "title": "" } ]
619db4928fc7d4424dd32f9e199e7dbd
Definition of the Portfolio class for the GFPortfolio gadget. Each instance of the class is used to store information about one stock.
[ { "docid": "7614fb4a896d7ff9bff0ab1a08288fd4", "score": "0.84471726", "text": "function Portfolio()\n{\n\t// Create an empty array of stocks\n\tthis.stocks = new Array();\n\tthis.addPriceData = addPriceData;\n\tthis.displayPriceData = displayPriceData;\n\tthis.displaySymbols = displaySymbols;\n\tthis.makeDateEntry = makeDateEntry;\n}", "title": "" } ]
[ { "docid": "eb1ee5d98dace17b357601e37e74999b", "score": "0.6714322", "text": "function Stock(symbol){\n // this.name = name;\n this.symbol = symbol;\n this.numShares = 0;\n this.data = this.lookupStock();\n this.name = name;\n this.price = price;\n\n}", "title": "" }, { "docid": "6498e2efaad7a4cf413f7876e1e3c6fa", "score": "0.6539987", "text": "function Stock(symbol, price, shares) {\n this.symbol = symbol;\n this.price = price;\n this.shares = shares;\n}", "title": "" }, { "docid": "80ce368aa7662f9439945512b2d30278", "score": "0.62731886", "text": "function Portfolio(defaultValues) {\n var privateState = {};\n context[\"field\"] = \"portfolioId\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"portfolioId\"] : null);\n privateState.portfolioId = defaultValues ?\n (defaultValues[\"portfolioId\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"portfolioId\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"description\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"description\"] : null);\n privateState.description = defaultValues ?\n (defaultValues[\"description\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"description\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"holdingsType\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"holdingsType\"] : null);\n privateState.holdingsType = defaultValues ?\n (defaultValues[\"holdingsType\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"holdingsType\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"quantity\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"quantity\"] : null);\n privateState.quantity = defaultValues ?\n (defaultValues[\"quantity\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"quantity\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"marketPrice\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"marketPrice\"] : null);\n privateState.marketPrice = defaultValues ?\n (defaultValues[\"marketPrice\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"marketPrice\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"costPrice\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"costPrice\"] : null);\n privateState.costPrice = defaultValues ?\n (defaultValues[\"costPrice\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"costPrice\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"marketValue\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"marketValue\"] : null);\n privateState.marketValue = defaultValues ?\n (defaultValues[\"marketValue\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"marketValue\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"unrealPLMkt\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"unrealPLMkt\"] : null);\n privateState.unrealPLMkt = defaultValues ?\n (defaultValues[\"unrealPLMkt\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"unrealPLMkt\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"secCCy\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"secCCy\"] : null);\n privateState.secCCy = defaultValues ?\n (defaultValues[\"secCCy\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"secCCy\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"navPage\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"navPage\"] : null);\n privateState.navPage = defaultValues ?\n (defaultValues[\"navPage\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"navPage\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"ISIN\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"ISIN\"] : null);\n privateState.ISIN = defaultValues ?\n (defaultValues[\"ISIN\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"ISIN\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"sortBy\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"sortBy\"] : null);\n privateState.sortBy = defaultValues ?\n (defaultValues[\"sortBy\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"sortBy\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"searchByInstrumentName\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"searchByInstrumentName\"] : null);\n privateState.searchByInstrumentName = defaultValues ?\n (defaultValues[\"searchByInstrumentName\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"searchByInstrumentName\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"holdingsId\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"holdingsId\"] : null);\n privateState.holdingsId = defaultValues ?\n (defaultValues[\"holdingsId\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"holdingsId\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"transactionId\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"transactionId\"] : null);\n privateState.transactionId = defaultValues ?\n (defaultValues[\"transactionId\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"transactionId\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"orderType\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"orderType\"] : null);\n privateState.orderType = defaultValues ?\n (defaultValues[\"orderType\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"orderType\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"exchangeRate\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"exchangeRate\"] : null);\n privateState.exchangeRate = defaultValues ?\n (defaultValues[\"exchangeRate\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"exchangeRate\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"limitPrice\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"limitPrice\"] : null);\n privateState.limitPrice = defaultValues ?\n (defaultValues[\"limitPrice\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"limitPrice\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"netAmount\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"netAmount\"] : null);\n privateState.netAmount = defaultValues ?\n (defaultValues[\"netAmount\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"netAmount\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"tradeDate\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"tradeDate\"] : null);\n privateState.tradeDate = defaultValues ?\n (defaultValues[\"tradeDate\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"tradeDate\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"fees\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"fees\"] : null);\n privateState.fees = defaultValues ?\n (defaultValues[\"fees\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"fees\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"valueDate\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"valueDate\"] : null);\n privateState.valueDate = defaultValues ?\n (defaultValues[\"valueDate\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"valueDate\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"referenceCurrency\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"referenceCurrency\"] : null);\n privateState.referenceCurrency = defaultValues ?\n (defaultValues[\"referenceCurrency\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"referenceCurrency\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"startDate\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"startDate\"] : null);\n privateState.startDate = defaultValues ?\n (defaultValues[\"startDate\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"startDate\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"endDate\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"endDate\"] : null);\n privateState.endDate = defaultValues ?\n (defaultValues[\"endDate\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"endDate\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"instrumentId\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"instrumentId\"] : null);\n privateState.instrumentId = defaultValues ?\n (defaultValues[\"instrumentId\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"instrumentId\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"RICCode\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"RICCode\"] : null);\n privateState.RICCode = defaultValues ?\n (defaultValues[\"RICCode\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"RICCode\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"customerId\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"customerId\"] : null);\n privateState.customerId = defaultValues ?\n (defaultValues[\"customerId\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"customerId\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"instrumentCurrency\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"instrumentCurrency\"] : null);\n privateState.instrumentCurrency = defaultValues ?\n (defaultValues[\"instrumentCurrency\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"instrumentCurrency\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"instrumentAmount\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"instrumentAmount\"] : null);\n privateState.instrumentAmount = defaultValues ?\n (defaultValues[\"instrumentAmount\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"instrumentAmount\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"total\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"total\"] : null);\n privateState.total = defaultValues ?\n (defaultValues[\"total\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"total\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"sortType\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"sortType\"] : null);\n privateState.sortType = defaultValues ?\n (defaultValues[\"sortType\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"sortType\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"userId\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"userId\"] : null);\n privateState.userId = defaultValues ?\n (defaultValues[\"userId\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"userId\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"fieldOrder\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"fieldOrder\"] : null);\n privateState.fieldOrder = defaultValues ?\n (defaultValues[\"fieldOrder\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"fieldOrder\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"limit\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"limit\"] : null);\n privateState.limit = defaultValues ?\n (defaultValues[\"limit\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"limit\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"offset\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"offset\"] : null);\n privateState.offset = defaultValues ?\n (defaultValues[\"offset\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"offset\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"sortOrder\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"sortOrder\"] : null);\n privateState.sortOrder = defaultValues ?\n (defaultValues[\"sortOrder\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"sortOrder\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"pageSize\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"pageSize\"] : null);\n privateState.pageSize = defaultValues ?\n (defaultValues[\"pageSize\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"pageSize\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"pageOffset\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"pageOffset\"] : null);\n privateState.pageOffset = defaultValues ?\n (defaultValues[\"pageOffset\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"pageOffset\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"accountIds\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"accountIds\"] : null);\n privateState.accountIds = defaultValues ?\n (defaultValues[\"accountIds\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"accountIds\"], context) :\n null) :\n null;\n\n\n //Using parent constructor to create other properties req. to kony sdk\n BaseModel.call(this);\n\n //Defining Getter/Setters\n Object.defineProperties(this, {\n \"portfolioId\": {\n get: function() {\n context[\"field\"] = \"portfolioId\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"portfolioId\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.portfolioId, context);\n },\n set: function(val) {\n setterFunctions['portfolioId'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"description\": {\n get: function() {\n context[\"field\"] = \"description\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"description\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.description, context);\n },\n set: function(val) {\n setterFunctions['description'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"holdingsType\": {\n get: function() {\n context[\"field\"] = \"holdingsType\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"holdingsType\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.holdingsType, context);\n },\n set: function(val) {\n setterFunctions['holdingsType'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"quantity\": {\n get: function() {\n context[\"field\"] = \"quantity\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"quantity\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.quantity, context);\n },\n set: function(val) {\n setterFunctions['quantity'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"marketPrice\": {\n get: function() {\n context[\"field\"] = \"marketPrice\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"marketPrice\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.marketPrice, context);\n },\n set: function(val) {\n setterFunctions['marketPrice'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"costPrice\": {\n get: function() {\n context[\"field\"] = \"costPrice\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"costPrice\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.costPrice, context);\n },\n set: function(val) {\n setterFunctions['costPrice'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"marketValue\": {\n get: function() {\n context[\"field\"] = \"marketValue\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"marketValue\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.marketValue, context);\n },\n set: function(val) {\n setterFunctions['marketValue'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"unrealPLMkt\": {\n get: function() {\n context[\"field\"] = \"unrealPLMkt\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"unrealPLMkt\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.unrealPLMkt, context);\n },\n set: function(val) {\n setterFunctions['unrealPLMkt'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"secCCy\": {\n get: function() {\n context[\"field\"] = \"secCCy\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"secCCy\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.secCCy, context);\n },\n set: function(val) {\n setterFunctions['secCCy'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"navPage\": {\n get: function() {\n context[\"field\"] = \"navPage\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"navPage\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.navPage, context);\n },\n set: function(val) {\n setterFunctions['navPage'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"ISIN\": {\n get: function() {\n context[\"field\"] = \"ISIN\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"ISIN\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.ISIN, context);\n },\n set: function(val) {\n setterFunctions['ISIN'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"sortBy\": {\n get: function() {\n context[\"field\"] = \"sortBy\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"sortBy\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.sortBy, context);\n },\n set: function(val) {\n setterFunctions['sortBy'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"searchByInstrumentName\": {\n get: function() {\n context[\"field\"] = \"searchByInstrumentName\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"searchByInstrumentName\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.searchByInstrumentName, context);\n },\n set: function(val) {\n setterFunctions['searchByInstrumentName'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"holdingsId\": {\n get: function() {\n context[\"field\"] = \"holdingsId\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"holdingsId\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.holdingsId, context);\n },\n set: function(val) {\n setterFunctions['holdingsId'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"transactionId\": {\n get: function() {\n context[\"field\"] = \"transactionId\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"transactionId\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.transactionId, context);\n },\n set: function(val) {\n setterFunctions['transactionId'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"orderType\": {\n get: function() {\n context[\"field\"] = \"orderType\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"orderType\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.orderType, context);\n },\n set: function(val) {\n setterFunctions['orderType'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"exchangeRate\": {\n get: function() {\n context[\"field\"] = \"exchangeRate\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"exchangeRate\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.exchangeRate, context);\n },\n set: function(val) {\n setterFunctions['exchangeRate'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"limitPrice\": {\n get: function() {\n context[\"field\"] = \"limitPrice\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"limitPrice\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.limitPrice, context);\n },\n set: function(val) {\n setterFunctions['limitPrice'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"netAmount\": {\n get: function() {\n context[\"field\"] = \"netAmount\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"netAmount\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.netAmount, context);\n },\n set: function(val) {\n setterFunctions['netAmount'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"tradeDate\": {\n get: function() {\n context[\"field\"] = \"tradeDate\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"tradeDate\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.tradeDate, context);\n },\n set: function(val) {\n setterFunctions['tradeDate'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"fees\": {\n get: function() {\n context[\"field\"] = \"fees\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"fees\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.fees, context);\n },\n set: function(val) {\n setterFunctions['fees'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"valueDate\": {\n get: function() {\n context[\"field\"] = \"valueDate\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"valueDate\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.valueDate, context);\n },\n set: function(val) {\n setterFunctions['valueDate'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"referenceCurrency\": {\n get: function() {\n context[\"field\"] = \"referenceCurrency\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"referenceCurrency\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.referenceCurrency, context);\n },\n set: function(val) {\n setterFunctions['referenceCurrency'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"startDate\": {\n get: function() {\n context[\"field\"] = \"startDate\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"startDate\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.startDate, context);\n },\n set: function(val) {\n setterFunctions['startDate'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"endDate\": {\n get: function() {\n context[\"field\"] = \"endDate\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"endDate\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.endDate, context);\n },\n set: function(val) {\n setterFunctions['endDate'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"instrumentId\": {\n get: function() {\n context[\"field\"] = \"instrumentId\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"instrumentId\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.instrumentId, context);\n },\n set: function(val) {\n setterFunctions['instrumentId'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"RICCode\": {\n get: function() {\n context[\"field\"] = \"RICCode\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"RICCode\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.RICCode, context);\n },\n set: function(val) {\n setterFunctions['RICCode'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"customerId\": {\n get: function() {\n context[\"field\"] = \"customerId\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"customerId\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.customerId, context);\n },\n set: function(val) {\n setterFunctions['customerId'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"instrumentCurrency\": {\n get: function() {\n context[\"field\"] = \"instrumentCurrency\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"instrumentCurrency\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.instrumentCurrency, context);\n },\n set: function(val) {\n setterFunctions['instrumentCurrency'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"instrumentAmount\": {\n get: function() {\n context[\"field\"] = \"instrumentAmount\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"instrumentAmount\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.instrumentAmount, context);\n },\n set: function(val) {\n setterFunctions['instrumentAmount'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"total\": {\n get: function() {\n context[\"field\"] = \"total\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"total\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.total, context);\n },\n set: function(val) {\n setterFunctions['total'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"sortType\": {\n get: function() {\n context[\"field\"] = \"sortType\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"sortType\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.sortType, context);\n },\n set: function(val) {\n setterFunctions['sortType'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"userId\": {\n get: function() {\n context[\"field\"] = \"userId\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"userId\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.userId, context);\n },\n set: function(val) {\n setterFunctions['userId'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"fieldOrder\": {\n get: function() {\n context[\"field\"] = \"fieldOrder\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"fieldOrder\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.fieldOrder, context);\n },\n set: function(val) {\n setterFunctions['fieldOrder'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"limit\": {\n get: function() {\n context[\"field\"] = \"limit\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"limit\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.limit, context);\n },\n set: function(val) {\n setterFunctions['limit'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"offset\": {\n get: function() {\n context[\"field\"] = \"offset\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"offset\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.offset, context);\n },\n set: function(val) {\n setterFunctions['offset'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"sortOrder\": {\n get: function() {\n context[\"field\"] = \"sortOrder\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"sortOrder\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.sortOrder, context);\n },\n set: function(val) {\n setterFunctions['sortOrder'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"pageSize\": {\n get: function() {\n context[\"field\"] = \"pageSize\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"pageSize\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.pageSize, context);\n },\n set: function(val) {\n setterFunctions['pageSize'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"pageOffset\": {\n get: function() {\n context[\"field\"] = \"pageOffset\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"pageOffset\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.pageOffset, context);\n },\n set: function(val) {\n setterFunctions['pageOffset'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"accountIds\": {\n get: function() {\n context[\"field\"] = \"accountIds\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"accountIds\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.accountIds, context);\n },\n set: function(val) {\n setterFunctions['accountIds'].call(this, val, privateState);\n },\n enumerable: true,\n },\n });\n\n //converts model object to json object.\n this.toJsonInternal = function() {\n return Object.assign({}, privateState);\n };\n\n //overwrites object state with provided json value in argument.\n this.fromJsonInternal = function(value) {\n privateState.portfolioId = value ? (value[\"portfolioId\"] ? value[\"portfolioId\"] : null) : null;\n privateState.description = value ? (value[\"description\"] ? value[\"description\"] : null) : null;\n privateState.holdingsType = value ? (value[\"holdingsType\"] ? value[\"holdingsType\"] : null) : null;\n privateState.quantity = value ? (value[\"quantity\"] ? value[\"quantity\"] : null) : null;\n privateState.marketPrice = value ? (value[\"marketPrice\"] ? value[\"marketPrice\"] : null) : null;\n privateState.costPrice = value ? (value[\"costPrice\"] ? value[\"costPrice\"] : null) : null;\n privateState.marketValue = value ? (value[\"marketValue\"] ? value[\"marketValue\"] : null) : null;\n privateState.unrealPLMkt = value ? (value[\"unrealPLMkt\"] ? value[\"unrealPLMkt\"] : null) : null;\n privateState.secCCy = value ? (value[\"secCCy\"] ? value[\"secCCy\"] : null) : null;\n privateState.navPage = value ? (value[\"navPage\"] ? value[\"navPage\"] : null) : null;\n privateState.ISIN = value ? (value[\"ISIN\"] ? value[\"ISIN\"] : null) : null;\n privateState.sortBy = value ? (value[\"sortBy\"] ? value[\"sortBy\"] : null) : null;\n privateState.searchByInstrumentName = value ? (value[\"searchByInstrumentName\"] ? value[\"searchByInstrumentName\"] : null) : null;\n privateState.holdingsId = value ? (value[\"holdingsId\"] ? value[\"holdingsId\"] : null) : null;\n privateState.transactionId = value ? (value[\"transactionId\"] ? value[\"transactionId\"] : null) : null;\n privateState.orderType = value ? (value[\"orderType\"] ? value[\"orderType\"] : null) : null;\n privateState.exchangeRate = value ? (value[\"exchangeRate\"] ? value[\"exchangeRate\"] : null) : null;\n privateState.limitPrice = value ? (value[\"limitPrice\"] ? value[\"limitPrice\"] : null) : null;\n privateState.netAmount = value ? (value[\"netAmount\"] ? value[\"netAmount\"] : null) : null;\n privateState.tradeDate = value ? (value[\"tradeDate\"] ? value[\"tradeDate\"] : null) : null;\n privateState.fees = value ? (value[\"fees\"] ? value[\"fees\"] : null) : null;\n privateState.valueDate = value ? (value[\"valueDate\"] ? value[\"valueDate\"] : null) : null;\n privateState.referenceCurrency = value ? (value[\"referenceCurrency\"] ? value[\"referenceCurrency\"] : null) : null;\n privateState.startDate = value ? (value[\"startDate\"] ? value[\"startDate\"] : null) : null;\n privateState.endDate = value ? (value[\"endDate\"] ? value[\"endDate\"] : null) : null;\n privateState.instrumentId = value ? (value[\"instrumentId\"] ? value[\"instrumentId\"] : null) : null;\n privateState.RICCode = value ? (value[\"RICCode\"] ? value[\"RICCode\"] : null) : null;\n privateState.customerId = value ? (value[\"customerId\"] ? value[\"customerId\"] : null) : null;\n privateState.instrumentCurrency = value ? (value[\"instrumentCurrency\"] ? value[\"instrumentCurrency\"] : null) : null;\n privateState.instrumentAmount = value ? (value[\"instrumentAmount\"] ? value[\"instrumentAmount\"] : null) : null;\n privateState.total = value ? (value[\"total\"] ? value[\"total\"] : null) : null;\n privateState.sortType = value ? (value[\"sortType\"] ? value[\"sortType\"] : null) : null;\n privateState.userId = value ? (value[\"userId\"] ? value[\"userId\"] : null) : null;\n privateState.fieldOrder = value ? (value[\"fieldOrder\"] ? value[\"fieldOrder\"] : null) : null;\n privateState.limit = value ? (value[\"limit\"] ? value[\"limit\"] : null) : null;\n privateState.offset = value ? (value[\"offset\"] ? value[\"offset\"] : null) : null;\n privateState.sortOrder = value ? (value[\"sortOrder\"] ? value[\"sortOrder\"] : null) : null;\n privateState.pageSize = value ? (value[\"pageSize\"] ? value[\"pageSize\"] : null) : null;\n privateState.pageOffset = value ? (value[\"pageOffset\"] ? value[\"pageOffset\"] : null) : null;\n privateState.accountIds = value ? (value[\"accountIds\"] ? value[\"accountIds\"] : null) : null;\n };\n }", "title": "" }, { "docid": "cea8fef18aef67ff08afaa4ba8e5a902", "score": "0.624087", "text": "constructor(scope, id, props) {\n super(scope, id, { type: CfnPortfolio.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_servicecatalog_CfnPortfolioProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnPortfolio);\n }\n throw error;\n }\n cdk.requireProperty(props, 'displayName', this);\n cdk.requireProperty(props, 'providerName', this);\n this.attrPortfolioName = cdk.Token.asString(this.getAtt('PortfolioName', cdk.ResolutionTypeHint.STRING));\n this.displayName = props.displayName;\n this.providerName = props.providerName;\n this.acceptLanguage = props.acceptLanguage;\n this.description = props.description;\n this.tags = new cdk.TagManager(cdk.TagType.STANDARD, \"AWS::ServiceCatalog::Portfolio\", props.tags, { tagPropertyName: 'tags' });\n }", "title": "" }, { "docid": "cd6d60c5e3b2257e9947e7f9742553a6", "score": "0.6208182", "text": "constructor(name, stock) {\n this.name = name;\n this.stock = stock;\n this.revenue = 0;\n }", "title": "" }, { "docid": "2bb62089ad3777c6c926201ca1648df8", "score": "0.60977584", "text": "function Project (portfolioDataObj) {\n this.name = portfolioDataObj.name;\n this.link = portfolioDataObj.link;\n this.description = portfolioDataObj.description;\n this.image = 'images/' + portfolioDataObj.image;\n}", "title": "" }, { "docid": "cb50477cd42456141feed83b440bc9f4", "score": "0.59967226", "text": "function Portfolio (opts) {\n Object.keys(opts).forEach(function(e, index, keys) {\n this[e] = opts[e];\n },this);\n }", "title": "" }, { "docid": "315b1f0a90a30f70b299b3f788ec84cd", "score": "0.59666336", "text": "function BuildPortfolio (projectTitle, image, githublink, liveSite, description, technology) {\n this.title = projectTitle;\n this.imagePath = image;\n this.gitLink = githublink;\n this.gitSite = liveSite;\n this.description = description;\n this.technology = technology;\n}", "title": "" }, { "docid": "14203d6cc51e4c4943580d64ea143b35", "score": "0.5834694", "text": "function Stockitem()\n {\n this.type = 'stockpile';\n this.name = 'Unknown';\n this.attack = 0;\n this.defense = 0;\n this.upkeep = 0;\n this.price = 0;\n }", "title": "" }, { "docid": "70a9213e03eda7a0c2a73f82be103c3e", "score": "0.5686634", "text": "function StockChart(options, element) {\n var _this = _super.call(this, options, element) || this;\n /** @private */\n _this.isSingleAxis = false;\n _this.chartid = 57723;\n /** @private */\n _this.tempDataSource = [];\n /** @private */\n _this.blazorDataSource = [];\n /** @private */\n _this.tempSeriesType = [];\n /** private */\n _this.zoomChange = false;\n /** @private */\n _this.allowPan = false;\n /** @private */\n _this.onPanning = false;\n /** @private */\n _this.trendlinetriggered = true;\n /** @private */\n _this.toolbarHeight = _this.enablePeriodSelector ? (Browser.isDevice ? 56 : 42) : 0;\n /** @private */\n _this.initialRender = true;\n return _this;\n }", "title": "" }, { "docid": "46ee24c7b5f65102c37a1f0d968e4305", "score": "0.5678524", "text": "function getStock() {\n return {\n symbol: 'NLSN',\n price: 100,\n country: 'KEN',\n exchange: {\n name: 'NASDAQ',\n tradingHours: '9AM',\n },\n };\n}", "title": "" }, { "docid": "f4c581fafb776d07f1734eafc643ed42", "score": "0.5659926", "text": "function Cookie(name, regularPrice, holidayPrice) {\n this.name = name;\n this.prices = [regularPrice, holidayPrice];\n this.prices = this.prices.map(a => a.toFixed(2));\n}", "title": "" }, { "docid": "cacd1858b5d9e2fc27e19a497fab3b61", "score": "0.564082", "text": "constructor(scope, id, props) {\n super(scope, id, { type: CfnPortfolioShare.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_servicecatalog_CfnPortfolioShareProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnPortfolioShare);\n }\n throw error;\n }\n cdk.requireProperty(props, 'accountId', this);\n cdk.requireProperty(props, 'portfolioId', this);\n this.accountId = props.accountId;\n this.portfolioId = props.portfolioId;\n this.acceptLanguage = props.acceptLanguage;\n this.shareTagOptions = props.shareTagOptions;\n }", "title": "" }, { "docid": "ae9824fe5496f7bec122c6e155df9ad7", "score": "0.56323653", "text": "addPortfolio() {\n if (Object.keys(this.state.jsPortfolios).length >= 10) {\n alert(\"You can only have 10 portfolios\");\n return;\n }\n var name = prompt(\"Pick a name for the portfolio.\");\n if (name === null || name.trim() === \"\") {\n alert(\"The name cannot be empty.\");\n }\n else {\n //Get current list of portfolios, push this new portfolio to it and update the state and local storage.\n let portfolios = this.state.portfolios;\n let jsPortfolios = this.state.jsPortfolios;\n if (jsPortfolios === undefined) {\n jsPortfolios = {};\n }\n let state = this.state;\n let id = getGuid();\n let stocks = {};\n portfolios.push(<Portfolio key={id}\n id={id}\n name={name}\n setGraphApp={this.setGraph.bind(this)}\n updatePortfolio={this.updatePortfolio.bind(this)}\n deletePortfolio={this.deletePortfolio.bind(this)}\n setPrompt={this.setPrompt.bind(this)}\n />);\n state.portfolios = portfolios;\n jsPortfolios[id] = {\n key: id,\n id: id,\n name: name,\n currency: \"euro\",\n stocks: stocks\n };\n this.setState(state);\n this.updateLocalStorage();\n }\n }", "title": "" }, { "docid": "4386c1f6d314dd6613a5c512b4aff388", "score": "0.56312984", "text": "function createPortfolio(data) {\n\tvar portfolioDisplay = \"\";\n\t//For each project generate an individual portfolio square\n\tdata.forEach(function createSquare(project,index) {\n\t\tportfolio[index].id = index;\n\t\tvar name = project.name,\n\t\t\tsnippet = project.snippet,\n\t\t\ttags = project.tags[0],\n\t\t\tdesc = project.description,\n\t\t\tlink = project.link,\n\t\t\tid = project.id;\n\t\t\timage = project.image;\n\n\t\t//Add additional tags\n\t\tfor (var i=1; i<project.tags.length; i++) {\n\t\t\ttags+= \" | \" + project.tags[i];\n\t\t}\n\n\t\tportfolioDisplay+= \"<div class='portfolio-square' id='\" +\n\t\tid + \n\t\t\"'><div><img src='../img/\" +\n\t\timage +\n\t\t\"'></div><div class='overlay'><h4>\" +\n\t\tname +\n\t\t\"</h4><p>\" +\n\t\t snippet +\n\t\t \"</p><a class='button read-more'>read more</a><span>\" +\n\t\t tags +\n\t\t \"</span></div></div>\";\n\n\t\t //Generate the html for the modal pop up\n\t\tportfolio[id].modal = \"<h1>\" + \n\t\tname +\n\t\t\"</h1><p>\" + \n\t\tdesc + \n\t\t\"</p><a href='\" +\n\t\tlink +\n\t\t\"' target='_blank' class='button'>view project</a>\";\n\t\t});\t\n\t\t//Affix each square to the main portfolio display\n\t\t$(\"#portfolio-display\").append(portfolioDisplay);\n}", "title": "" }, { "docid": "6de7a2abe0ad0ecb5445c6feff508429", "score": "0.55567294", "text": "function init() {\n portfolioView = new app.views.PortfolioView(self);\n }", "title": "" }, { "docid": "48ca76b450909bcbed7b521ff9ebf631", "score": "0.5549783", "text": "function Portfolio() {\n return (\n <div className=\"portfolio\" id=\"portfolio\">\n <div className=\"container\">\n <Title titleName=\"PORTFOLIO\" descriptionName=\"Magnam dolores commodi suscipit. Necessitatibus eius consequatur ex aliquid fuga eum quidem. Sit sint consectetur velit. Quisquam quos quisquam cupiditate. Et nemo qui impedit suscipit alias ea. Quia fugiat sit in iste officiis commodi quidem hic quas.\" />\n <PortfolioController />\n <PortfolioList />\n \n </div>\n </div>\n )\n}", "title": "" }, { "docid": "5aef4a5202ab65da6ecf3d4a92e32a99", "score": "0.5499764", "text": "function Product(name, price, inStock){\n\n\tthis.prodName = name;\n\tthis.price = price;\n\tthis.inStock = inStock;\n\n\tthis.setStock = function (stock){\n\tthis.inStock = stock;\n\t};\n}", "title": "" }, { "docid": "5aef4a5202ab65da6ecf3d4a92e32a99", "score": "0.5499764", "text": "function Product(name, price, inStock){\n\n\tthis.prodName = name;\n\tthis.price = price;\n\tthis.inStock = inStock;\n\n\tthis.setStock = function (stock){\n\tthis.inStock = stock;\n\t};\n}", "title": "" }, { "docid": "48148b57889431d61ff95ede0aa67496", "score": "0.5498229", "text": "function calcPortfolio(quotes){\n\tlet price, changep, change, market;\n\tlet sum=0;\n\tlet sumchange=0;\n\tlet invested=0;\n\tlet chper=0;\n\tfunction getmarketprice(quote){\n\t\tif(quote.marketState==\"PRE\" && quote.preMarketPrice){\n\t\t\tprice= quote.preMarketPrice;\n\t\t\tchangep=quote.preMarketChangePercent;\n\t\t\tmarket=\"pre-market\";\n\t\t\tchange=quote.preMarketChange;\n\t\t}else if(quote.marketState==\"PRE\" && !quote.preMarketPrice){\n\t\t\tprice= quote.regularMarketPrice;\n\t\t\tchangep=0;\n\t\t\tmarket=\"pre-market\";\n\t\t\tchange=0;\n\t\t}else if([\"PREPRE\",\"POST\",\"POSTPOST\",\"CLOSED\"].includes(quote.marketState) && quote.postMarketPrice){\n\t\t\tprice= quote.postMarketPrice;\n\t\t\t//changep=quote.postMarketChangePercent;\n\t\t\tchangep=100*(quote.postMarketChange+quote.regularMarketChange)/quote.regularMarketPreviousClose;\n\t\t\tmarket=\"after hours trading\";\n\t\t\tchange=quote.postMarketChange+quote.regularMarketChange;\n\t\t}\n\t\telse{\n\t\t\tprice= quote.regularMarketPrice;\n\t\t\tchangep=quote.regularMarketChangePercent;\n\t\t\tmarket=\"regular session\";\n\t\t\tchange=quote.regularMarketChange;\n\t\t}\n\t}\n\t\n\tfor(q of quotes){\n\t\t//text+=q.displayName? q.displayName: q.shortName;\n\t\tgetmarketprice(q);\n\t\tsum=sum+price*getHolding(q.symbol).n;\n\t\tsumchange=sumchange+change*getHolding(q.symbol).n;\n\t\tchper=100*sumchange/(sum-sumchange);\n\t\tinvested=invested + getHolding(q.symbol).n*getHolding(q.symbol).p;\n\t}\n\tdocument.getElementById(\"portfolio\").innerHTML=\"Portfolio: \"+sum.toFixed(2)+\" Change: \"+sumchange.toFixed(2)+ \" \"+chper.toFixed(2)+\"% P/L: \"+(sum-invested).toFixed(2);\n\t\n\tskipcount++;\n\tif(pchart && skipcount>4){\n\tpchart.data[0].push((new Date()).getTime()/1000);\n\tpchart.data[1].push(sum);\n\tdocument.getElementById(\"costline\").checked ? pchart.data[4].push(invested):null;\n\tpchart.setData(pchart.data);\n\tskipcount=0;\n\t}\n\t\n}", "title": "" }, { "docid": "86ef7b5d208f91ce03a4924928c1adae", "score": "0.5404354", "text": "function Product(id, name, prices, stock) {\n this.id = id;\n this.name = name;\n this.prices = prices;\n this.stock = stock\n}", "title": "" }, { "docid": "ca97ee3db40c7e41b2869aa07e081ec3", "score": "0.5396404", "text": "function LoadNewPortfolioOverview() {\n var Catalog = {\n _id: 'New',\n portfolioid: '',\n description: '',\n coverage: '',\n org: '',\n publish: 0,\n status_data: [],\n status_label: '',\n repeated_data: [],\n repeated_label: '',\n risk_data: [],\n risk_label: '',\n audits: [],\n portfoliomap: []\n };\n return Catalog;\n}", "title": "" }, { "docid": "07891ab6d12991673746c789f4484cc0", "score": "0.53877676", "text": "constructor() {\n this.headers = [];\n this.stocks = [];\n }", "title": "" }, { "docid": "a820642d36b412c7e7cead443c184788", "score": "0.53755647", "text": "function formatStockDataForPortfolioUpdate (JSONdata) {\n\n var stock = {\n\n symbol: JSONdata.Symbol,\n currentPrice: parseFloat(JSONdata.LastTradePriceOnly), \n previousClose: parseFloat(JSONdata.PreviousClose) \n };\n\n return stock;\n}", "title": "" }, { "docid": "d3ffc672781892203b9fafc3a2d8046d", "score": "0.5357117", "text": "function Finance(){\n\t\tvar self = this;\n\t\tself.cost = 0;\n\t\tself.revenue = {min: 0, max: 0};\n\t\tself.profit = {min: 0, max: 0};\n\t\t\n\t\tself.plantings = 0; // planting count\n\t\tself.harvests = {min: 0, max: 0}; // harvest count\n\t}", "title": "" }, { "docid": "ea0a3550a018813e1b5a6340b988201b", "score": "0.5348619", "text": "static load() {\n const PORTFOLIO = require(DATA_PORTFOLIO);\n let funds = [];\n let total = 0;\n\n for (let portfund of PORTFOLIO) {\n let fund = Fund.find(portfund.symbol);\n let fundTotal = parseFloat(portfund.shares * fund.price);\n\n funds.push({ fund: fund, shares: portfund.shares, total: fundTotal });\n total += fundTotal;\n }\n\n return new Portfolio(funds, total);\n }", "title": "" }, { "docid": "4242c5e2577249ff14de445f92de2d35", "score": "0.5314188", "text": "function Portfolio() {\n\n\treturn (<>\n\t\t\n\t\t\t<div className=\"container__titlePortfolio\">\n\t\t\t\t<a name=\"portfolio\">\n\t\t\t\t\t<h2 className=\"title\">Portfolio</h2>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t\t<div className=\"container__portfolio\">\n\t\t\t<div className=\"container__imgPortfolio\">\n\t\t\t\t<a href=\"https://eleonoradellamico.github.io/Cinema/\" target=\"_blank\">\n\t\t\t\t\t<img className=\"portfolioImg\" src={Photo} alt=\"Cinema\" />\n\t\t\t\t</a>\n\t\t\t\t<div className=\"info__imgPortfolio\">\n\t\t\t\t\t<p className=\"text textPortfolio\">Design&layout Html Css Netflix</p>\n\t\t\t\t\t<img className=\"link__portfolio\" src={GitHub} alt=\"gitHub\" />\n\t\t\t\t\t<img className=\"link__portfolio\" src={Enlace} alt=\"gitHub\" />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div className=\"container__imgPortfolio\">\n\t\t\t\t<a href=\"https://martreyz.github.io/project-promo-k-module-3-team-4/#/\" target=\"_blank\">\n\t\t\t\t\t<img className=\"portfolioImg\" src={PhotoOne} alt=\"Cards\" />\n\t\t\t\t</a>\n\t\t\t\t<div className=\"info__imgPortfolio\">\n\t\t\t\t\t<p className=\"text textPortfolio\">React project: Visting cards</p>\n\t\t\t\t\t<img className=\"link__portfolio\" src={GitHub} alt=\"gitHub\" />\n\t\t\t\t\t<img className=\"link__portfolio\" src={Enlace} alt=\"gitHub\" />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div className=\"container__imgPortfolio\">\n\t\t\t\t<a href=\"https://eleonoradellamico.github.io/LearnJavaScrip_MemoryGame/\" target=\"_blank\">\n\t\t\t\t\t{' '}\n\t\t\t\t\t<img className=\"portfolioImg\" src={PhotoTwo} alt=\"Laptop\" />\n\t\t\t\t</a>\n\t\t\t\t<div className=\"info__imgPortfolio\">\n\t\t\t\t\t<p className=\"text textPortfolio\">Play memory card with JS!</p>\n\t\t\t\t\t<img className=\"link__portfolio\" src={GitHub} alt=\"gitHub\" />\n\t\t\t\t\t<img className=\"link__portfolio\" src={Enlace} alt=\"gitHub\" />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t</div>\n\t\t\t{/* <div className=\"btn__experience\">\n\t\t\t\t<Link to=\"/moreProjects\">\n\t\t\t\t\t<Button variant=\"outlined\" color=\"secondary\">\n\t\t\t\t\t\tMore Projects\n\t\t\t\t\t</Button>\n\t\t\t\t</Link>\n\t\t\t</div> */}\n\t\t\t\n</>\n\t);\n}", "title": "" }, { "docid": "230be658126e9f4169818adbbad755ed", "score": "0.52702475", "text": "render() {\n // console.log(\"portfolio stocks in render\", this.portfolioStocks)\n return (\n <div>\n <Header/>\n <MainContainer allStocks={this.state.allStocks} handleBuyStock={this.handleBuyStock} portfolioStocks={this.state.portfolioStocks} />\n </div>\n );\n }", "title": "" }, { "docid": "1340902c9eac8940e3e5a4b8b8382ade", "score": "0.52526456", "text": "constructor(scope, id, props) {\n super(scope, id, { type: CfnAcceptedPortfolioShare.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_servicecatalog_CfnAcceptedPortfolioShareProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnAcceptedPortfolioShare);\n }\n throw error;\n }\n cdk.requireProperty(props, 'portfolioId', this);\n this.portfolioId = props.portfolioId;\n this.acceptLanguage = props.acceptLanguage;\n }", "title": "" }, { "docid": "423ce67c7503524c3b628935109d6adc", "score": "0.52384794", "text": "static createStock() {\n const itemNames = ['Camisa', 'Pantalon', 'Calcetines'];\n const itemPrices = [13, 27, 100];\n return itemNames.map((value, index) => new Item(itemNames[index], itemPrices[index]));\n }", "title": "" }, { "docid": "a706241fff00a8a5c8c64b7c55350260", "score": "0.52205", "text": "constructor(name,stock = 1){\n\tif (typeof(name) == 'object') {\n\t\t// clone branch\n\t\tObject.keys(name).forEach(prop => this[prop] = clone(name[prop]));\n\t} else {\n\t\t// standard branch\n\t\tthis.id = \"_\" + (new Date().getTime() + Math.random() * 0x10000000000).toString(16);\n\t\tthis._name = name;\n\t\tif (this.usable.includes(\"inmenu\") && this.onUse === undefined) {\n\t\t\tconsole.log(`WARNING: item ${name} does not have an onUse`);\n\t\t}\n\t\tif (this.equippable && this.onEquip === undefined) {\n\t\t\tconsole.log(`WARNING: item ${name} does not have an onEquip`);\n\t\t}\n\t\tif (this.equippable && this.onRemove === undefined) {\n\t\t\tconsole.log(`WARNING: item ${name} does not have an onRemove`);\n\t\t}\n\t\tthis.stock = stock;\n\t\tif (this.itemData && Number.isInteger(this.itemData.uses)) {\n\t\t\tthis._uses = new FillStat(this.itemData.uses);\n\t\t} else {\n\t\t\tthis._uses = new FillStat(1);\n\t\t}\n\n\t\tif (this.equippable !== undefined) {\n\t\t\tthis.modID = {};\n\t\t}\n\t}\n\n\t}", "title": "" }, { "docid": "e8df3ac77cbcc0d9da5ea1029beb923e", "score": "0.51947796", "text": "constructor(scope, id, props) {\n super(scope, id, { type: CfnPortfolioProductAssociation.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_servicecatalog_CfnPortfolioProductAssociationProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnPortfolioProductAssociation);\n }\n throw error;\n }\n cdk.requireProperty(props, 'portfolioId', this);\n cdk.requireProperty(props, 'productId', this);\n this.portfolioId = props.portfolioId;\n this.productId = props.productId;\n this.acceptLanguage = props.acceptLanguage;\n this.sourcePortfolioId = props.sourcePortfolioId;\n }", "title": "" }, { "docid": "f59f10a502bf65cc4aed5844ecfeb97c", "score": "0.5190033", "text": "function initPortfolio() {\n\t\t//We want to hide all images at first\n\t\tportfolioImages = $(\"#portfolio-images li img\").css(\"display\", \"none\");\n\t\t\n\t\t//Add the various mouse events to the grid overlay\n\t\tgridOverlay = $(\"#grid-overlay\").click(onGridClick).mousemove(onGridMouseMove).mouseout(onGridMouseOut);\n\t\t\n\t\tcurrentImageIndex = 0;\n\t\tnextImageIndex = 1;\n\t\t\n\t\t//We begin by displaying the first image in the list\n\t\tif (portfolioImages.length > 0) {\n\t\t\t$(portfolioImages[0]).css(\"display\", \"block\");\n\t\t}\n\t\t\n\t\tportfolioInfo = $(\"#portfolio-info\");\n\t\tportfolioTimerBar = $(\"#portfolio-timer\");\n\t\tportfolioTimerBar.data(\"originalOpacity\", portfolioTimerBar.css(\"opacity\"));\n\t\tportfolioNavigation = $(\"#portfolio-navigation\");\n\t\t\n\t\t//We store all the navigation buttons in a document fragment first before actually\n\t\t//appending them to the DOM. This gives us better performance since direct\n\t\t//DOM manipulation is processor expensive\n\t\tvar frag = document.createDocumentFragment();\n\t\tportfolioButtons = [];\n\t\t\n\t\t//Create a nav button for every image in the portfolio\n\t\tfor (var i = 0; i < portfolioImages.length; i++) {\n\t\t\tvar navButton = $(\"<div>\").addClass(\"portfolio-button\").data(\"index\", i);\n\t\t\t//Transition to the corresponding image on click\n\t\t\tnavButton.click(function() {\n\t\t\t\tvar thisIndex = $(this).data(\"index\");\n\t\t\t\tif(thisIndex !== currentImageIndex) {\n\t\t\t\t\tnextImageIndex = thisIndex;\n\t\t\t\t\timageTransition();\n\t\t\t\t}\n\t\t\t});\n\t\t\t//Highlight the current nav button\n\t\t\tif (i === currentImageIndex) {\n\t\t\t\taddHighlight(navButton);\n\t\t\t}\n\t\t\t\n\t\t\t//Add button to fragment and array\n\t\t\tfrag.appendChild(navButton[0]);\n\t\t\tportfolioButtons.push(navButton);\n\t\t}\n\t\t//Add to document\n\t\tportfolioNavigation.append(frag);\n\t}", "title": "" }, { "docid": "2bbb7b4ed7b138fd15bcd5ab8eee8b1e", "score": "0.51181763", "text": "setPortfolioByDate(){}", "title": "" }, { "docid": "453dabc86d9d913fd94164e1f9c589da", "score": "0.5107213", "text": "updatePortfolioState(portfolioId, stocks, name){\n let pfCopy = Object.assign([], this.state.portfolio);\n for(var i = 0; i<pfCopy.length; i++){\n if(pfCopy[i].id === portfolioId){\n pfCopy[i].name = name\n pfCopy[i].stocks = stocks\n }\n }\n this.setState({portfolio: pfCopy})\n this.onSetResult(pfCopy, 'portfolio')\n }", "title": "" }, { "docid": "2654018d63efba2d5ee5e0b8340888f4", "score": "0.5096993", "text": "function setPortfolioInStorage(portfolio) {\n const name = portfolio.name;\n let portfolios = getPortfoliosFromStorage();\n let updated = false;\n\n /* Look for existing equivalent portfolio in local storage. */\n for (let i = 0; i < portfolios.length; i++) {\n if (portfolios[i].name === name) {\n // Update existing portfolio in local storage.\n portfolios[i] = portfolio;\n setPortfoliosInStorage(portfolios);\n updated = true;\n }\n }\n\n if (!updated) {\n // Add new portfolio.\n portfolios.push(portfolio);\n setPortfoliosInStorage(portfolios);\n }\n\n // Return the new list of portfolios in the storage.\n return portfolios;\n}", "title": "" }, { "docid": "7ec6d7312add9fbbbac2768b67dacd5e", "score": "0.50718343", "text": "function Item(name, price, stock, image) {\n this.name = name;\n this.price = price;\n this.stock = stock;\n this.image = image;\n}", "title": "" }, { "docid": "06814862639b2914d91a1e790ea59360", "score": "0.50716645", "text": "function Cart(){\n // check for existing instance\n if (typeof Cart._instance === 'Object'){\n return Cart._instance;\n }\n\n // default properties\n this.data = {};\n this.isReady = false;\n\n // store the instance\n Cart._instance = this;\n\n // 'this' is returned implicitly when called with new\n }", "title": "" }, { "docid": "1cced5f7326d74ae5283085a176c2276", "score": "0.50388515", "text": "function calculatePortfolioValue (portfolio, completedPositions, pendingOrders) {\n\n var portfolioFreeCash = 0.0\n var portfolioCommittedCash = 0.0\n var portfolioEquityValue = 0.0\n var portfolioTodaysGainOrLoss = 0.0\n var portfolioPositionsTotalGainOrLoss = 0.0\n var portfolioTotalGainOrLoss = 0.0\n\n var portfolioTotalValue = 0.0\n var numberOfPositions = completedPositions.length\n var numberOfUniquePositions = 1 // Need to determine a formula for this\n\n\n for (i = 0; i < pendingOrders.length; i++) {\n\n var orderType = pendingOrders[i][\"orderType\"]\n\n // Will only increase pending cash if the ordertype is a \"buy\"\n if (orderType == \"buy\") {\n\n var numberOfShares = pendingOrders[i][\"numberOfShares\"]\n var purchasePrice = pendingOrders[i][\"purchasePrice\"]\n\n // Calculates how much cash is commited to open orders\n portfolioCommittedCash += (numberOfShares * purchasePrice) \n }\n }\n\n\n for (i = 0; i < completedPositions.length; i++) {\n\n // Numbers used to calculate the value of this holding as a part of the portfolio\n var numberOfShares = completedPositions[i][\"numberOfShares\"]\n var purchasePrice = completedPositions[i][\"purchasePrice\"]\n var todaysGainOrLoss = completedPositions[i][\"todaysGainOrLoss\"]\n var totalGainOrLoss = completedPositions[i][\"totalGainOrLoss\"]\n\n // The equity value of the position is it's value at purchase plus the total change in value\n var positionEquityValue = (numberOfShares * purchasePrice) + totalGainOrLoss\n\n // Update the aggregate portfolio values\n portfolioEquityValue += positionEquityValue\n portfolioTodaysGainOrLoss += todaysGainOrLoss\n // portfolioTodaysGainOrLoss += totalGainOrLoss\n portfolioPositionsTotalGainOrLoss += positionEquityValue\n }\n\n portfolioFreeCash = portfolio.get(\"cash\") - portfolioCommittedCash\n portfolioTotalValue = portfolioEquityValue + portfolioFreeCash + portfolioCommittedCash\n portfolioTotalGainOrLoss = portfolioTotalValue - portfolio.get(\"initialPortfolioValue\")\n\n var updatedPortfolioValues = {\n\n cash: parseFloat(portfolioFreeCash.toFixed(2)),\n committedCash: parseFloat(portfolioCommittedCash.toFixed(2)),\n equityValue: parseFloat(portfolioEquityValue.toFixed(2)),\n portfolioValue: parseFloat(portfolioTotalValue.toFixed(2)),\n todaysGainOrLoss: parseFloat(portfolioTodaysGainOrLoss.toFixed(2)),\n totalGainOrLoss: parseFloat(portfolioTotalGainOrLoss.toFixed(2)),\n numberOfPositions: numberOfPositions,\n numberOfUniquePositions: numberOfUniquePositions\n }\n\n return updatedPortfolioValues\n}", "title": "" }, { "docid": "4f13a59818b0d14cfc045be567f7a10b", "score": "0.5030876", "text": "function updatePorfolio(quote, sales, callback) {\n\t// updating quote info\n\tif ( quote['ask'] === -1 ) {\n\t\tportfolio['ask'] = '-';\n\t\tportfolio['askSize'] = '-';\n\t} else {\n\t\tportfolio['ask'] = quote['ask'];\n\t\tportfolio['askSize'] = quote['askSize'];\n\t}\n\n\tif ( quote['bid'] === -1 ) {\n\t\tportfolio['bid'] = '-';\n\t\tportfolio['bidSize'] = '-';\n\t} else {\n\t\tportfolio['bid'] = quote['bid'];\n\t\tportfolio['bidSize'] = quote['bidSize'];\n\t}\n\n\taddAskBid(quote);\n\n\tif ( quote.hasOwnProperty('price') ) {\n\t\tportfolio['last'] = quote['price'];\n\t\tportfolio['volume'] = quote['volume'];\n\n\t\tif ( portfolio['high'] === '-' ) {\n\t\t\tportfolio['high'] = quote['price'];\n\t\t} else {\n\t\t\tportfolio['high'] = Math.max(quote['price'], portfolio['high']);\n\t\t}\n\t\tif ( portfolio['low'] === '-' ) {\n\t\t\tportfolio['low'] = quote['price'];\n\t\t} else {\n\t\t\tportfolio['low'] = Math.min(quote['price'], portfolio['low']);\n\t\t}\n\t}\n\n\tif (sales) {\n\n\t\taddSales(sales);\n\t\t// updating personal portfolio info\n\t\t// when a current order is altered, either partially or completely fulfilled, \n\t\t// it will be recorded in sales which will have buyer and seller ids\n\t\tfor ( var i = 0; i < sales.length; i++ ) {\n\t\t\tvar currentSale = sales[i];\n\t\t\t// client bought shares\n\t\t\tif ( currentSale['buyerId'] === email ) {\n\t\t\t\tportfolio['cashTotal'] -= currentSale['price'] * currentSale['amount'];\n\t\t\t\tportfolio['quantity'] += currentSale['amount'];\n\t\t\t\taddToTransaction(currentSale, 'buy');\n\t\t\t} \n\t\t\t// client sold shares\n\t\t\tif ( currentSale['sellerId'] === email ) {\n\t\t\t\tportfolio['cashTotal'] += currentSale['price'] * currentSale['amount'];\n\t\t\t\tportfolio['quantity'] -= currentSale['amount'];\n\t\t\t\taddToTransaction(currentSale, 'sell');\n\t\t\t}\n\t\t}\n\t\tcash = portfolio['cashTotal']\n\n\t\t// update the value of client's stocks\n\t\tportfolio['crlTotal'] = portfolio['last'] * portfolio['quantity'];\n\n\t\t// update the value of client's entire portfolio\n\t\tportfolio['total'] = portfolio['crlTotal'] + portfolio['cashTotal'];\n\n\t\tcallback();\n\t}\n}", "title": "" }, { "docid": "c75675671856620d325ef55e6ea52ebc", "score": "0.5026071", "text": "function Inventory(){\r\n stock = []; \r\n \r\n //function name: calculateValue\r\n //inputs:\r\n //output: totalInventoryValue\r\n //brief description: this function calcuulates the total value of the inventory\r\n this.calculateValue = function(){ \r\n var inventoryValue = 0;\r\n //return (Product.price * Product.quantity);\r\n \r\n for (var i = 0; i < stock.length; i++){\r\n inventoryValue += ( stock[i].price * stock[i].quantity );\r\n }\r\n \r\n console.log( \"The value of this inventory is $\" + inventoryValue );\r\n return inventoryValue;\r\n }\r\n \r\n //function name: addStock\r\n //inputs: Product\r\n //brief description: this function adds a product to stock\r\n this.addStock = function(Product){\r\n stock.push(Product);\r\n }\r\n \r\n //function name: displayStock\r\n //inputs: \r\n //brief description: this function displays the items in stock\r\n this.displayStock = function(){\r\n\r\n if (stock.length > 0){\r\n for (var i = 0; i < stock.length; i++){\r\n console.log( stock[i] ); \r\n }\r\n } else { console.log(\"There are no items in the inventory\"); \r\n }\r\n }\r\n \r\n}", "title": "" }, { "docid": "ace28b2a3a5b99612486577d937c41ff", "score": "0.5021331", "text": "function getChart(data, initialData) {\n\treturn isc.FacetChart.create({\n\t ID: \"stockQuotesChart\",\n\t facets: [{\n\t id: \"time\",\n\t title: \"Time\"\n\t }, {\n\t id: \"name\",\n\t title: \"Name\"\n\t }],\n\t data:data,\n\t initialData:initialData,\n\t valueProperty: \"lastValue\",\n\t chartType: \"Area\",\n\t title: \"Portfolio Value\"\n\t});\n}", "title": "" }, { "docid": "b39637c391a1ce04e12840b8b43381fb", "score": "0.49574605", "text": "function getPortfolioPositions (portfolio) {\n\n // Function will not return until this promise is fulfilled\n var promiseToFindPortfolioPositions = new Parse.Promise();\n\n // Sets up the Parse query to find PortfolioPositions associated with this Portfolio \n var PortfolioPosition = Parse.Object.extend(\"PortfolioPosition\")\n var portfolioPositionQuery = new Parse.Query(PortfolioPosition)\n portfolioPositionQuery.equalTo(\"portfolioID\", portfolio)\n\n // Executes the query search\n promiseToFindPortfolioPositions = portfolioPositionQuery.find()\n\n return promiseToFindPortfolioPositions\n}", "title": "" }, { "docid": "69fc671de627db143dbbce55a3d67c16", "score": "0.49407157", "text": "function Stock({ ticker }) {\n const result = ensureQuote.read(ticker);\n console.log(result);\n // Assume this is deeply nested (and that you don't want\n // import the cache into every component)...\n return (\n <div>\n {result.companyName} <small>({result.symbol})</small> {result.change}%\n </div>\n );\n}", "title": "" }, { "docid": "f181d156166c58d4fdfb5fb37db7b492", "score": "0.49396363", "text": "function StockProvider(){\n /**\n * Maakt een nieuwe YahooAjaxHelper aan en zet dat in de variable yahoo.\n * @type {YahooAjaxHelper} : Geeft een YahooAjaxHelper \"class/object\".\n */\n yahoo = new YahooAjaxHelper();\n\n /**\n * Maakt een nieuwe LocalHelper aan en zet dat in de variable local.\n * @type {LocalHelper} : Geeft een LocalHelper \"class/object\".\n */\n local = new LocalHelper();\n\n /**\n * Dit is om bij te houden het aantal keer dat de methode getdata is aan geroepen,\n * zodat er om en om de yahoo en local helpers worden gereturnt\n * @type {Number} : count begint met 1.\n */\n var count = 1;\n\n /**\n * De functie getData is om een nieuwe yahoo of local helper te returnen .\n * Na elke keer dat de functie wordt aangeroepen gaat de count omhoog.\n * Dan wordt er een if en else gezet, wanneer de getdata 10 keer is aangeroepen (die local mee geeft) geeft hij de yahoo terug.\n * Nadat de functie 20 keer is aangeroepen wordt de count gereset en zo geeft de StockProvider factory om en om de local en yahoo en roept de getStockData functie aan.\n *\n * @param count : het aantal keer dat getdata is opgeroepen.\n */\n function getData(count) {\n /**\n * Eerst 10 keer dat data wordt opgeroepen voor de local;\n * @type {Number} : 10 keer.\n */\n var localCount = 10;\n /**\n * de volgende 10 keer (maximum is dan dus 20 keer) voor de yahoo;\n * @type {Number} : 20e keer.\n */\n var yahooCount = 20;\n /**\n * reset de count terug naar 1\n * @type {Number} : 1 (gereset weer naar het begin)\n */\n var resetCount = 1;\n /**\n * hier wordt de functie getdata aangeroepen voor het returnen van de local of yahoo helper.\n * @return {*} Het hang van de count af wat hij returnt, of de local.getStockData() of de yahoo.getStockData\n */\n this.getData = function () {\n count++;\n if (count <= localCount) {\n return local.getStockData();\n }\n else {\n if (count === yahooCount) {\n count = resetCount;\n }\n return yahoo.getStockData();\n }\n };\n }\n\n /**\n * Wanneer de functie getData wordt opgeroepen geeft hij de count mee.\n */\n getData.call(this, count);\n}", "title": "" }, { "docid": "8a01c073c8072888f68901af83ddf613", "score": "0.49349055", "text": "function Product(product_name,department_name,price, stock_quantity){\n this.product_name= product_name;\n this.department_name= department_name;\n this.price=price;\n this.stock_quantity= stock_quantity;\n}", "title": "" }, { "docid": "64054e7a0fbb87b5b964cb264ab9c781", "score": "0.49323454", "text": "function Portfolio() {\t\n\t\n\t\t\t\n\t\tif( $('.portfolio-wrap').length > 0 ){\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif ($(\"body\").hasClass(\"smooth-scroll\")) {\n\t\t\t\tvar elem = document.querySelector(\"#content-scroll\");\n\t\t\t\tvar scrollbar = Scrollbar.init(elem,\n\t\t\t\t{\n\t\t\t\t\trenderByPixels: true,\n\t\t\t\t\tdamping:0.05\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\tvar $container = $('.portfolio');\n\t\t\n\t\t\t$container.isotope({\n\t\t\t layoutMode: 'packery',\n\t\t\t itemSelector: '.item',\n\t\t\t gutter:0,\n\t\t\t transitionDuration: \"0.5s\"\n\t\t\t});\n\t\t\t\n\t\t\t$('#filters a').on('click', function() {\n\t\t\t\t$('#filters a').removeClass('active');\n\t\t\t\t$(this).addClass('active');\n\t\t\t\t$('.item').addClass('item-margins');\n\t\t\t\tvar selector = $(this).attr('data-filter');\n\t\t\t\t$container.isotope({ filter: selector }, function( $changedItems, instance ) {\n\t\t\t\t instance.$allAtoms.filter('.isotope-hidden').removeClass('is-filtered');\n\t\t\t\t instance.$filteredAtoms.addClass('is-filtered');\n\t\t\t\t});\t\t\n\t\t\t\treturn false;\n\t\t\t});\n\t\t\t\n\t\t\t$(\"#all\").trigger('click');\n\t\t\t\t\n\t\t\t$('.item').each(function() {\n\t\t\t\tvar image = $(this).find('.item-image').data('src');\t\n\t\t\t\t$(this).find('.item-image').css({'background-image': 'url(' + image + ')'});\n\t\t\t});\n\t\t\t\n\t\t\t\n\t\t\t$(\".item-image\").mouseenter(function(e) {\t\n\t\t\t\tTweenMax.to('#ball', 0.3,{borderWidth: '2px', scale: 1, borderColor:'#fff'});\n\t\t\t\tTweenMax.to('#ball-loader', 0.2,{borderWidth: '2px', top: 2, left: 2});\n\t\t\t\t$( \"#ball\" ).addClass(\"with-icon\").append( '<i class=\"fa fa-plus\"></i>' );\n\t\t\t\t$(this).parent().find('video').each(function() {\n\t\t\t\t\t$(this).get(0).play();\n\t\t\t\t});\n\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t$(\".item-image\").mouseleave(function(e) {\n\t\t\t\tTweenMax.to('#ball', 0.2,{borderWidth: '4px', scale:0.5, borderColor:'#999999'});\n\t\t\t\tTweenMax.to('#ball-loader', 0.2,{borderWidth: '4px', top: 0, left: 0});\n\t\t\t\t$(\"#ball\").removeClass(\"with-icon\");\n\t\t\t\t$('#ball i').remove();\n\t\t\t\t$(this).parent().find('video').each(function() {\n\t\t\t\t\t$(this).get(0).pause();\n\t\t\t\t});\n\t\t\t});\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//Show Filters On overlay\n\t\t\t$('#show-filters, #close-filters').on('click', function() {\t\t\t\n\t\t\t\t$('#filters-overlay').toggleClass('active');\n\t\t\t\tvar navtitleheight = $(\".hero-title\").height()\n\t\t\t\tvar navsubtitleheight = $(\".hero-subtitle\").height()\n\t\t\t\t\n\t\t\t\tsetTimeout( function(){\t\t\t\n\t\t\t\t\tif ($('#filters-overlay').hasClass(\"active\")) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tTweenMax.to($(\".item-parallax\"), 0.6, {force3D:true, scale:0.9, opacity:0.3, delay:1.1, ease:Power2.easeInOut});\t\t\t\t\t\n\t\t\t\t\t\tTweenMax.to($(\".active .item-caption\"), 0.3, {opacity:0, ease:Power2.easeOut});\n\t\t\t\t\t\tTweenMax.to($(\"#show-filters, #counter-wrap\"), 0.3, {opacity:0, delay:0, ease:Power2.easeOut});\n\t\t\t\t\t\tTweenMax.to($(\"#show-filters, #counter-wrap\"), 0, {visibility:'hidden', delay:0.35, ease:Power2.easeOut}); \n\t\t\t\t\t\t\n\t\t\t\t\t\t//Fade In Navigation Lists\n\t\t\t\t\t\tTweenMax.set($(\".filters-info\"), {y:30, opacity:0});\n\t\t\t\t\t\tTweenMax.to($(\".filters-info\"), 0.4, {force3D:true, y:0, opacity:1, delay:0.7, ease:Power2.easeOut});\n\t\t\t\t\t\tvar tlMenu = new TimelineLite();\n\t\t\t\t\t\ttlMenu.set($(\".filters-timeline\"), {y:60, opacity:0});\n\t\t\t\t\t\t$(\".filters-timeline\").each(function(index, element) {\n\t\t\t\t\t\t\ttlMenu.to(element, 0.5, {y:0, opacity:1, delay:1.2, ease:Power3.easeOut}, index * 0.1)\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar heroheight = $(\"#hero\").height();\t\t\t\n\t\t\t\t\t\tif ($(\"body\").hasClass(\"smooth-scroll\")) {\n\t\t\t\t\t\t\tTweenLite.to(scrollbar, 1.5, {scrollTop:heroheight, ease:Power4.easeInOut});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$(\"html,body\").animate({scrollTop: heroheight}, 800);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t} else {\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\tTweenMax.to($(\".item-parallax\"), 0.6, {force3D:true, scale: 1, opacity:1, delay:0.3, ease:Power2.easeInOut});\t\t\t\t\t\n\t\t\t\t\t\tTweenMax.to($(\".active .item-caption\"), 0.5, {opacity:1, delay:0.5, ease:Power2.easeOut});\n\t\t\t\t\t\tTweenMax.set($(\"#show-filters, #counter-wrap\"), {visibility:'visible', opacity:0});\n\t\t\t\t\t\tTweenMax.to($(\"#show-filters, #counter-wrap\"), 0.3, {opacity:1, delay:0.7, ease:Power2.easeOut});\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Fade Out Navigation Lists\n\t\t\t\t\t\tTweenMax.to($(\".filters-info\"), 0.2, {force3D:true, y:-30, opacity:0, delay:0, ease:Power1.easeIn});\t\t\t\t\t\n\t\t\t\t\t\tvar tlMenu = new TimelineLite();\n\t\t\t\t\t\t$(\".filters-timeline, .jssocials-share\").each(function(index, element) {\n\t\t\t\t\t\t\ttlMenu.to(element, 0.25, {opacity:0, y:-60, delay:0.1, ease:Power1.easeIn }, index * 0.1)\n\t\t\t\t\t\t});\t\n\t\t\t\t\t\tTweenMax.to('#ball', 0.1,{borderWidth: '4px', scale:0.5,});\n\t\t\t\t\t\t$(\"#ball\").removeClass(\"close-icon\");\n\t\t\t\t\t\t$('#ball i').remove();\n\t\t\t\t\t\t\n\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t} , 20 );\n\t\t\t});\n\t\t\t\n\t\t\t\n\t\t\t$(\"#close-filters\").mouseenter(function(e) {\t\n\t\t\t\tTweenMax.to('#ball', 0.2,{borderWidth: '2px', scale: 1, borderColor:'#fff',});\n\t\t\t\tTweenMax.to('#ball-loader', 0.2,{borderWidth: '2px', top: 2, left: 2});\n\t\t\t\t$( \"#ball\" ).addClass(\"close-icon\").append( '<i class=\"fa fa-times\"></i>' );\n\t\t\t});\n\t\t\t\t\n\t\t\t$(\"#close-filters\").mouseleave(function(e) {\n\t\t\t\tTweenMax.to('#ball', 0.2,{borderWidth: '4px', scale:0.5, borderColor:'#999999',});\n\t\t\t\tTweenMax.to('#ball-loader', 0.2,{borderWidth: '4px', top: 0, left: 0});\n\t\t\t\t$(\"#ball\").removeClass(\"close-icon\");\n\t\t\t\t$('#ball i').remove();\n\t\t\t});\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tsetTimeout( function(){\n\t\t\t\tvar controller = new ScrollMagic.Controller();\n\t\t\t\t$('.portfolio').each(function(){\n\t\t\t\t\tvar $this = $(this);\n\t\t\t\t\tvar $elheight = window.innerHeight*0.7;\n\t\t\t\t\tvar $thisHeight = $(this).outerHeight() - $elheight;\n\t\t\t\t\t\n\t\t\t\t\tvar scene = new ScrollMagic.Scene({triggerElement:$this[0],duration: $thisHeight})\n\t\t\t\t\t\t.addTo(controller)\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tscene.triggerHook(0.3)\n\t\t\t\t\t\n\t\t\t\t\tscene.on('enter', function(){\t\t\t\t\n\t\t\t\t\t\tTweenMax.to($(\"#show-filters\"), 0.3, {opacity:1, delay:0, ease:Power2.easeOut});\n\t\t\t\t\t\t$(\"#show-filters\").addClass('enabled')\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tscene.on('leave', function(){\t\t\t\t\n\t\t\t\t\t\tTweenMax.to($(\"#show-filters\"), 0.15, {opacity:0, delay:0, ease:Power2.easeOut});\n\t\t\t\t\t\t$(\"#show-filters\").removeClass('enabled')\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tif ($(\"body\").hasClass(\"smooth-scroll\")) {\n\t\t\t\t\t\tscrollbar.addListener(() => {\n\t\t\t\t\t\t\tscene.refresh()\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t} , 2000 );\n\t\t\t\n\t\t\tTweenMax.to($(\"#show-filters\"), 0, {opacity:0, delay:0.05, ease:Power2.easeOut});\n\t\t\t\n\t\t}\n\t\n\t}", "title": "" }, { "docid": "950159e5c9d700f57a9d3c1c8e2f53bd", "score": "0.48994607", "text": "constructor(name, price) {\n // invokes the setters\n this.name = name;\n this.price = price;\n }", "title": "" }, { "docid": "7da544d546e22e6dee9e367ee6857c2e", "score": "0.48876125", "text": "static initialize(obj, portfolioDataField, portfolioIDField, portfolioNameField, resultField) { \n obj['PortfolioDataField'] = portfolioDataField;\n obj['PortfolioIDField'] = portfolioIDField;\n obj['PortfolioNameField'] = portfolioNameField;\n obj['ResultField'] = resultField;\n }", "title": "" }, { "docid": "176f14c2ddee510f3731a890bf83f461", "score": "0.4856577", "text": "function Composition(axis) {\n this.axis = axis;\n this.stacks = {\n changed: false\n };\n }", "title": "" }, { "docid": "9cd51e6667c770293b329904049705c9", "score": "0.4850132", "text": "function ClusterInventory(clusterName, data) {\n this.clusterName = clusterName;\n if (data) {\n Object.assign(this, data);\n }\n }", "title": "" }, { "docid": "7f677646317f291759e157008e719dcc", "score": "0.4848187", "text": "function Position(p)\n{\n this.ticker = p[0];\n this.name = p[1];\n this.currency = p[2];\n this.FXrate = parseFloat(p[3]);\n this.position = parseFloat(p[4]);\n this.exposureNAV = parseFloat(p[5]) / 100;\n this.exposureGross = parseFloat(p[6]);\n this.exposureNet = parseFloat(p[7]);\n this.fundNAVbase = parseFloat(p[8]);\n this.EODprice = parseFloat(p[9]);\n this.stdPxChange = parseFloat(p[10]) / 100;\n this.custodian = p[11];\n}", "title": "" }, { "docid": "5195b5cabce646fc3350e7c579a0abec", "score": "0.4847761", "text": "function Data() {\n this.data = {};\n this.orders = {};\n this.currentOrderNumber = 0;\n this.currentFavorites = [];\n}", "title": "" }, { "docid": "c75db1b0e777610a8ccbf5e05c788bbb", "score": "0.48271504", "text": "constructor (_data, _quantidade, _valor) {\n\n Object.assign(this, {\n _quantidade,\n _valor \n });\n \n this._data = new Date(_data.getTime()), //criando uma nova referência\n Object.freeze(this); //congela para nao permitir alterações\n }", "title": "" }, { "docid": "1a90d48fdb17e4551dcd8fdde00c6858", "score": "0.48267812", "text": "function getStockPortfolioData (arrayOfStockNames) {\n\n // var promiseToGetPortfolioData = new Parse.Promise();\n\n // Builds the Yahoo Stock API url for the JSON call\n var returnedURL = buildStockPortfolioURL(arrayOfStockNames);\n\n // This array will hold the final data to return to the client\n var arrayOfStockData = [];\n\n return new Promise(function(resolve, reject) {\n\n request({\n url: returnedURL,\n json: true\n }, function (error, response, returnedData) {\n\n if (!error && response.statusCode === 200) {\n\n var portfolioData = returnedData.query.results.quote\n\n // Filters out unnecesary information from JSON request for each stock in portfolio\n for (i = 0; i < portfolioData.length; i++) {\n\n var stockData = formatStockData(portfolioData[i]);\n arrayOfStockData[i] = stockData;\n }\n\n resolve (arrayOfStockData);\n\n } else {\n\n reject (error)\n }\n })\n });\n}", "title": "" }, { "docid": "583280f8429113760631b3f7c2e1d365", "score": "0.482013", "text": "async changeRate(portfolio, currency) {\n var valueOfStocks = 0;\n var portfolios = this.state.listOfPortfolios;\n // Find the right portfolio\n for (var i=0; i<portfolios.length; i++){\n if (portfolios[i].name === portfolio) {\n var index = i;\n }\n }\n var data = await this.getCurrency();\n var changeRate = data[\"rates\"][\"EUR\"];\n if (currency === 'USD') {\n changeRate = 1 / changeRate;\n }\n portfolios[index].changeRate = changeRate;\n portfolios[index].currency = currency;\n // Update currency to all stocks\n for (var j=0; j<portfolios[index].stocks.length; j++) {\n const updatedStock = {\n \"id\": portfolios[index].stocks[j].id,\n \"unitValue\": (portfolios[index].stocks[j].unitValue * portfolios[index].changeRate).toFixed(2),\n \"quantity\": portfolios[index].stocks[j].quantity,\n \"totalValue\": (portfolios[index].stocks[j].unitValue * portfolios[index].stocks[j].quantity * portfolios[index].changeRate).toFixed(2)\n };\n valueOfStocks = (parseFloat(valueOfStocks) + parseFloat(updatedStock.totalValue)).toFixed(2);\n portfolios[index].stocks[j] = updatedStock;\n localStorage.setItem(\"portfolios\", \"\");\n localStorage.setItem(\"portfolios\", JSON.stringify(portfolios));\n this.setState({\n listOfPortfolios: portfolios});\n }\n portfolios[index].valueOfStocks = valueOfStocks;\n localStorage.setItem(\"portfolios\", \"\");\n localStorage.setItem(\"portfolios\", JSON.stringify(portfolios));\n this.setState({ listOfPortfolios: portfolios })\n }", "title": "" }, { "docid": "00e2abda539a9f990dfdd5934c201286", "score": "0.4819303", "text": "static get tableName() {\n\t\treturn 'portfolio';\n\t}", "title": "" }, { "docid": "003dbff6c27477143997dc6cbe7cbd10", "score": "0.48167118", "text": "function formatPortfolioPosition (currentPosition, calculatedTodaysGainOrLoss, calculatedTotalGainOrLoss) {\n\n var portfolioPosition = {\n\n objectId: currentPosition.id,\n name: currentPosition.get(\"name\"),\n ticker: currentPosition.get(\"ticker\"),\n numberOfShares: parseFloat(currentPosition.get(\"numberOfShares\")),\n purchasePrice: parseFloat(currentPosition.get(\"purchasePrice\")),\n dateOrderPlaced: currentPosition.createdAt,\n\n // Makes sure these numbers have only two decimal places\n todaysGainOrLoss: parseFloat(calculatedTodaysGainOrLoss.toFixed(2)),\n totalGainOrLoss: parseFloat(calculatedTotalGainOrLoss.toFixed(2))\n };\n\n return portfolioPosition;\n}", "title": "" }, { "docid": "943a34941fc7116d5afc573e15e346de", "score": "0.48136878", "text": "function Cart(item, amount, price) { // <=== ça, c'est le nom de mon objet\n this.item = item; // <=== ceci est une propriété\n this.amount = amount;\n this.price = price;\n}", "title": "" }, { "docid": "c8b5ec6a459bc99d51448138fcededc2", "score": "0.4810876", "text": "function createDefaultStock(defaultData, names, prices, changes, changeInPercentages) {\n for (var i = 0; i < names.length; i++) {\n defaultData[i] = new StockModel(names[i], prices[i], changes[i], changeInPercentages[i]);\n }\n }", "title": "" }, { "docid": "309f79fecb8e4c374709f07bc94eedd9", "score": "0.48061687", "text": "constructor() {\n\n //the variables for this class...\n\n var foodStock,lastFed;\n var foodObj;\n\n \n \n}", "title": "" }, { "docid": "f3c821d3062531669e246b76ecbc56b6", "score": "0.47915336", "text": "function Product(pid, pname, companyName, stock, area) {\n this.area = area;\n this.prodId = pid;\n this.proName = pname;\n this.compName = companyName;\n this.availableStock = stock;\n }", "title": "" }, { "docid": "6c94f101f694a5e942747bbaca680b2f", "score": "0.4790868", "text": "function getPortfolioById( id ){\n \t\t\tvar i=portfolios.length;\n \t\t\twhile(i--){\n \t\t\t\tif( portfolios[i][\"id\"] == id){\n \t\t\t\t\treturn portfolios[i];\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\treturn null;\n \t\t}", "title": "" }, { "docid": "f00110647c4457650aa69d20b8bd3ea1", "score": "0.47886354", "text": "function CookieStore(storeName, hourlyMin, hourlyMax, avgPerSale){\n this.storeName = storeName;\n this.hourlyMin = hourlyMin;\n this.hourlyMax = hourlyMax;\n this.avgPerSale = avgPerSale;\n this.hourlyCustomers = [];\n this.hourlyCookies = [];\n this.dailyTotal = 0;\n CookieStore.allStores.push(this);\n}", "title": "" }, { "docid": "1dbba37e1f7a0b6d1fbc1c850d23685d", "score": "0.478707", "text": "function TicketPricing() {\r\n this.seniorPrice = 8.0;\r\n this.kidPrice = 7.0;\r\n this.adultPrice = 10.0;\r\n}", "title": "" }, { "docid": "ab9cdf362d6fdd27c7d37ae934c3c86b", "score": "0.47733554", "text": "constructor(name, color) {\n this.name = name;\n this.color = color;\n this.position = 0;\n this.cash = 1000;\n }", "title": "" }, { "docid": "7b2571f2a3e571c974f559a80227751a", "score": "0.47705987", "text": "function createPortfolio(id, name, value, risk) { \n if (risk === 0) {\n risk = 'Low';\n }\n if (risk === 1) {\n risk = 'Medium';\n }\n if (risk === 2) {\n risk = 'High';\n }\n return { id, name, value, risk };\n}", "title": "" }, { "docid": "1e5480431470356c47e66adf1a5ae484", "score": "0.4769364", "text": "constructor (name, color) {\n this.name = name\n this.color = color\n this.position = 0\n this.cash = 1000\n }", "title": "" }, { "docid": "9e2e5639a254af7cd49da4eb0cf6cfa4", "score": "0.47550195", "text": "function FinancialTrackOneData() {\n \"use strict\";\n /**\n * Contains the account number of the financial card.\n * @public\n * @instance\n * @type {string}\n */\n this.accountNumber = \"\";\n /**\n * Contains the first name of the card holder.\n * @public\n * @instance\n * @type {string}\n */\n this.firstName = \"\";\n /**\n * Contains the last name of the card holder\n * @public\n * @instance\n * @type {string}\n */\n this.lastName = \"\";\n /**\n * Contains the expiration date of the card.\n * @public\n * @instance\n * @type {Date}\n */\n this.expiration = false;\n /**\n * Contains the service code of the card.\n * @public\n * @instance\n * @type {string}\n */\n this.serviceCode = \"\";\n /**\n * Contains any other data the card issuer wanted to include on the first track.\n * @public\n * @instance\n * @type {string}\n */\n this.discretionaryData = \"\";\n}", "title": "" }, { "docid": "b5a3c2e6d552bfe966e520836d776533", "score": "0.4747795", "text": "function updateArtistPortfolio(artistName) {\n currentArtistName = artistName;\n var $portfolio = $(\"#artist-portfolio\");\n _clearPortfolio();\n\n var url = '/miouzik/songs/' + currentCollection.id + \"/\" + encodeURIComponent(artistName);\n return ajax({\n type: 'GET',\n url: url,\n dataType: 'json',\n success: function(songs) {\n _clearPortfolio();\n\n for (var i=0; i<songs.length; i++) {\n var uuid = songs[i].uuid;\n currentPortfolio[uuid] = songs[i];\n }\n\n var albums = {}; // key = album name, value = list of songs\n var releases = {}; // key = release id, value = release\n for (var i=0; i<songs.length; i++) {\n var albumName = songs[i].album;\n var album = albums[albumName];\n if (album === undefined)\n albums[albumName] = album = { name:albumName, year:undefined, songs:[], releaseId:undefined };\n album.songs.push(songs[i]);\n if (songs[i].year !== null && songs[i].year !== undefined && album.year === undefined) album.year = songs[i].year;\n var releaseId = songs[i].discogs.release && songs[i].discogs.release.id;\n if (releaseId !== null && releaseId !== undefined && releaseId !== 0 && album.releaseId === undefined) album.releaseId = releaseId;\n if (releaseId !== null && releaseId !== undefined && releaseId !== 0) releases[releaseId] = songs[i].discogs.release;\n }\n var songCount = songs.length;\n var albumCount = Object.keys(albums).length;\n\n function newAlbum(album) {\n var albumSongIds = []; // song IDs in this album (ordered by track number)\n\n var $album = $('<div class=\"artist-portfolio-album\"></div>');\n var $header = $('<div class=\"artist-portfolio-album-header\"></div>').appendTo($album);\n var $cover = $('<div class=\"artist-portfolio-album-header-cover\"></div>').appendTo($header);\n var cover = \"/miouzik/cover/album/0\";\n if (album.releaseId) cover = \"/miouzik/cover/album/\" + album.releaseId;\n $('<img>').attr('src', cover).appendTo($cover);\n var $caption = $('<div class=\"artist-portfolio-album-header-caption\"></div>').appendTo($header);\n $('<h1>').text(album.name).appendTo($caption);\n var h2 = \"\";\n if (album.releaseId && releases[album.releaseId]) {\n var styles = releases[album.releaseId].style;\n if (styles && styles.length>0) {\n for (var i=0; i<styles.length; i++) {\n if (i>0) h2 = h2 + \", \";\n h2 = h2 + styles[i];\n }\n }\n }\n if (album.year !== null && album.year !== undefined && h2 !== \"\") h2 = h2 + \"\\xa0•\\xa0\";\n if (album.year !== null && album.year !== undefined) h2 = h2 + album.year;\n h2 = h2 + \"\\xa0\"; // &nbsp;\n $('<h2>').text(h2).appendTo($caption);\n\n function newSong(index, song) {\n var $song = $('<div class=\"artist-portfolio-album-song\"></div>').attr('id', song.uuid);\n var $like = $('<div class=\"artist-portfolio-album-song-like\"></div>').appendTo($song);\n var $trackNumber = $('<div class=\"artist-portfolio-album-song-trackNumber\"></div>').text(\"\" + song.trackNumber).appendTo($song);\n var $play = $('<div class=\"artist-portfolio-album-song-play\"></div>').appendTo($song);\n var $title = $('<div class=\"artist-portfolio-album-song-title\"></div>').text(song.title).appendTo($song);\n var $download = $('<div class=\"artist-portfolio-album-song-download\"></div>').appendTo($song);\n var $duration = $('<div class=\"artist-portfolio-album-song-duration\"></div>').appendTo($song);\n $album.append($song);\n $song.click(function() {\n $(\".artist-portfolio-album-song\", $portfolio).toggleClass(\"artist-portfolio-album-song--selected\", false);\n $song.toggleClass(\"artist-portfolio-album-song--selected\", true);\n });\n $play.click(function() {\n playSongs(albumSongIds.slice(index));\n });\n }\n\n var songs = album.songs.sort(function(a,b) {\n if (a.trackNumber && b.trackNumber) return a.trackNumber - b.trackNumber; \n });\n for (var i=0; i<album.songs.length; i++) {\n var song = album.songs[i];\n albumSongIds.push(song.uuid);\n newSong(i, song);\n }\n\n $album.appendTo($portfolio);\n }\n\n var $header = $('<div class=\"artist-portfolio-header\"></div>');\n $('<h1>').text(artistName).appendTo($header);\n var h2 = \"\" + albumCount;\n if (albumCount === 1) h2 = h2 + \" album, \"; else h2 = h2 + \" albums, \";\n h2 = h2 + songCount;\n if (songCount === 1) h2 = h2 + \" song, \"; else h2 = h2 + \" songs\";\n $('<h2>').text(h2).appendTo($header);\n $portfolio.append($header);\n\n for (var i=0; i<albumCount; i++) {\n var album = Object.keys(albums)[i];\n album = albums[album];\n newAlbum(album);\n }\n\n },\n error: function(jqxhr, textStatus, error) {\n flashError(\"Failed to load artists\", jqxhr.status);\n }\n });\n}", "title": "" }, { "docid": "d05151920a9985f4d66a640bb9132cd6", "score": "0.47473502", "text": "function init_portfolio()\n{\n\t/* --- Hide portfolio excerpts --- */\n\t$('.portfolio .cycle .excerpt').css('display', 'none');\n\n\t/* --- Category filter --- */\n\tvar speed = 500;\n\tvar ease = 'easeOutQuart';\n\n\t$('#category_filter ul li a').click(function(){\n\t\tvar title = $(this).attr('title');\n\t\t$('#category_filter ul li').removeClass('active');\n\t\t$(this).parent('li').addClass('active');\n\t\t$('.portfolio .cycle .elem').each(function(){\n\t\t\tif(title == 'All') {\n\t\t\t\t$(this).removeClass('disable').animate({\n\t\t\t\t\t'opacity' : 1\n\t\t\t\t}, speed, ease);\n\t\t\t} else if(title == $(this).find('h4').text()) {\n\t\t\t\t$(this).removeClass('disable').animate({\n\t\t\t\t\t'opacity' : 1\n\t\t\t\t}, speed, ease);\n\t\t\t} else {\n\t\t\t\t$(this).addClass('disable').animate({\n\t\t\t\t\t'opacity' : 0.1\n\t\t\t\t}, speed, ease);\n\t\t\t}\n\t\t});\n\t});\n}", "title": "" }, { "docid": "70ed640b52adcf94ff437c2220f7cfc0", "score": "0.4735847", "text": "constructor(scope, id, props) {\n super(scope, id, { type: CfnPortfolioPrincipalAssociation.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_servicecatalog_CfnPortfolioPrincipalAssociationProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnPortfolioPrincipalAssociation);\n }\n throw error;\n }\n cdk.requireProperty(props, 'portfolioId', this);\n cdk.requireProperty(props, 'principalArn', this);\n cdk.requireProperty(props, 'principalType', this);\n this.portfolioId = props.portfolioId;\n this.principalArn = props.principalArn;\n this.principalType = props.principalType;\n this.acceptLanguage = props.acceptLanguage;\n }", "title": "" }, { "docid": "5fccf2a15b6aa7f3604f23beb587b138", "score": "0.47329685", "text": "function portfolioToHTML( portfolio ){\n \t\t\t\n\t\t\tvar $portfolio = $('<div/>');\n\t\t\tvar $preload = $('<div class=\"preload\" />');\n\t\t\t$preload.html('loading images');\n\t\t\t$portfolio.append($preload);\n\t\t\t\n\t\t\t$portfolio.addClass(\"portfolio\");\n\t\t\t$portfolio.attr(\"id\",portfolio.id);\n\t\t\t$portfolio.attr(\"name\",portfolio.name);\n\t\t\t$portfolio.css(\"background-color\",portfolio.bgColor);\n\t\t\t$portfolio.css(\"height\",portfolio.height ? portfolio.height : cam.height);\n\t\t\t$portfolio.css(\"width\",portfolio.width ? portfolio.width : cam.width);\n\t\t\t\n\t\t\treturn $portfolio;\n\t\t\n \t\t}", "title": "" }, { "docid": "7ae9f6bcee3e7ba581d32ea5848f4296", "score": "0.47208723", "text": "constructor(name, price, year){ //metodo contructor\n this.name= name;\n this.price= price;\n this.year= year;\n }", "title": "" }, { "docid": "4549393a1619f32aa6f5009f705dbf72", "score": "0.47169143", "text": "function Cart() {\n this.items = [];\n this.currentindex = 0;\n this.total = 0;\n this.active = {};\n}", "title": "" }, { "docid": "06de424a30ac709d1a5085d0e693b6b3", "score": "0.4714786", "text": "function getPortfolio() {\r\n spinner.show();\r\n return new Promise((resolve, reject) => {\r\n $.getJSON(\"portfolio.json\")\r\n .done(function (json) {\r\n spinner.hide();\r\n resolve(json);\r\n })\r\n .fail(function () {\r\n spinner.hide();\r\n reject(alert(`Failed to fetch user's portfolio`));\r\n });\r\n });\r\n }", "title": "" }, { "docid": "d51d30c2d57a4994673927dcc29b7400", "score": "0.47062087", "text": "function getUserPortfolio(date = new Date().getTime()) {\n // get all of user's transactions\n return (async () => {\n const currentUser = await getCurrentUser();\n const transactions = currentUser.transactions;\n\n // loop through and aggregate data on stocks user owns, # of shares, cost basis, unrealized gains/ losses, % gain/ loss\n var transaction_length = transactions.length;\n var n = 0;\n var portfolio = {};\n for (n = 0; n < transaction_length; n++) {\n if (transactions[n]) {\n if (transactions[n].purchase_date <= date) {\n if (transactions[n].symbol in portfolio) {\n var quantity = transactions[n].num_shares;\n var cost = transactions[n].price * quantity;\n portfolio[transactions[n].symbol].quantity += quantity;\n portfolio[transactions[n].symbol].cost_basis += cost;\n } else {\n if (transactions[n].symbol != \"\") {\n const ticker = transactions[n].symbol;\n var quantity = transactions[n].num_shares;\n var cost = transactions[n].price * quantity;\n portfolio[ticker] = {\n quantity: quantity,\n cost_basis: cost,\n current_value: 0,\n gain: 0,\n return: 0,\n };\n }\n }\n }\n }\n }\n return portfolio;\n })();\n // auto-refresh the user account table after the account is made\n}", "title": "" }, { "docid": "1e1db079bb4ee838351cd9f7c94340b0", "score": "0.4704433", "text": "function Store(name, minCustPerHour, maxCustPerHour, avgCookieSales){\n this.name = name;\n this.minCustPerHour = minCustPerHour;\n this.maxCustPerHour = maxCustPerHour;\n this.avgCookieSales = avgCookieSales;\n this.numOfCookiesProjection = [];\n stores.push(this);\n}", "title": "" }, { "docid": "6a6de28c9d555f9eab01ebacd3918bbb", "score": "0.46929225", "text": "function createChart() {\n\n\t\t\t\t$('#highcharts-container').highcharts('StockChart', {\n\t\t\t\t\tchart: {\n\t\t\t\t\t},\n\t\t\t\t\t\n\t\t\t\t\trangeSelector: {\n\t\t\t\t\t\tselected: 4\n\t\t\t\t\t},\n\n\t\t\t\t\tyAxis: {\n\t\t\t\t\t\tlabels: {\n\t\t\t\t\t\t\tformatter: function() {\n\t\t\t\t\t\t\t\treturn (this.value > 0 ? '' : '') + this.value + ' USD / MMBtu';\n\t\t\t\t\t\t\t\t//return (this.value > 0 ? '+' : '') + this.value + '%';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tplotLines: [{\n\t\t\t\t\t\t\tvalue: 0,\n\t\t\t\t\t\t\twidth: 2,\n\t\t\t\t\t\t\tcolor: 'silver'\n\t\t\t\t\t\t}]\n\t\t\t\t\t},\n\t\t\t\t\t\n\t\t\t\t\tlegend: {\n\t\t\t\t\t\tenabled: true\n\t\t\t\t\t},\n\t\t\t\t\t\n\t\t\t\t\tplotOptions: {\n\t\t\t\t\t\tseries: {\n\t\t\t\t\t\t\t//compare: 'percent',\n\t\t\t\t\t\t\tmarker: {\n\t\t\t\t\t\t\t\tenabled: false,\n\t\t\t\t\t\t\t\tstates: {\n\t\t\t\t\t\t\t\t\thover: {\n\t\t\t\t\t\t\t\t\t\tenabled: true,\n\t\t\t\t\t\t\t\t\t\tradius: 3\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\t\n\t\t\t\t\ttooltip: {\n\t\t\t\t\t\t//pointFormat: '<span style=\"color:{series.color}\">{series.name}</span>: <b>{point.y}</b> ({point.change}%)<br/>',\n\t\t\t\t\t\tpointFormat: '<span style=\"color:{series.color}\">{series.name}</span>: <b>{point.y}</b><br/>',\n\t\t\t\t\t\tvalueDecimals: 2\n\t\t\t\t\t},\n\t\t\t\t\t\n\t\t\t\t\tseries: seriesOptions\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "5640657b6a3089e6ab1649c40638e21a", "score": "0.46912032", "text": "function Projector(universeName, dbOptions) {\n // in the absence of establishing db references in funds and actors,\n // nulling that out in toJSON override and providing a custom \n // inflater to lokijs, i will just force singleton pattern for now\n singletonContinuum = this;\n\n\tthis.universeName = universeName;\n \n this.enums = {\n BalanceType: BalanceTypeEnum,\n FundClass: FundClassEnum,\n ActorPeriodicity: ActorPeriodicityEnum,\n ActivityType: ActivityTypeEnum\n };\n \n this.MAX_DATE = MAX_DATE;\n this.MIN_DATE = MIN_DATE;\n\n this.AddDate = AddDate;\n\n dbOptions.actors = { proto: Actor };\n dbOptions.funds = { proto: Fund };\n\n\tthis.db = new loki(universeName, dbOptions); \n\tthis.vol = null;\n\tthis.activities = this.db.anonym([]);\n}", "title": "" }, { "docid": "a292d74d479a6ac3345e7198677693ba", "score": "0.46851695", "text": "function getDetailedStockPortfolioData (arrayOfStockNames) {\n\n // var promiseToGetPortfolioData = new Parse.Promise();\n\n // Builds the Yahoo Stock API url for the JSON call\n var returnedURL = buildStockPortfolioURL(arrayOfStockNames);\n\n // This array will hold the final data to return to the client\n var arrayOfStockData = [];\n\n return new Promise(function(resolve, reject) {\n\n request({\n url: returnedURL,\n json: true\n }, function (error, response, returnedData) {\n\n if (!error && response.statusCode === 200) {\n\n var portfolioData = returnedData.query.results.quote\n\n // Filters out unnecesary information from JSON request for each stock in portfolio\n for (i = 0; i < portfolioData.length; i++) {\n\n var stockData = formatDetailedStockData(portfolioData[i]);\n arrayOfStockData[i] = stockData;\n }\n\n resolve (arrayOfStockData);\n\n } else {\n\n reject (error)\n }\n })\n });\n}", "title": "" }, { "docid": "3a9de0d094b7568ba5a0fa32b0802d10", "score": "0.46851173", "text": "function Product(name, supplier, sku, priceObj, colors, sizes, financing, link) {\n this.Name = name;\n this.Supplier = supplier;\n this.SKU = sku;\n this.Pricing = priceObj;\n this.Colors = colors;\n this.Sizes = sizes;\n this.Financing = financing;\n this.Link = link;\n this.SearchDate = moment().format('MMMM Do YYYY');\n}", "title": "" }, { "docid": "718b25a8ee9dafd33108ba0eabf1cf46", "score": "0.4681373", "text": "function Stockist(id, name, add1, add2, town, city, postcode, latitude, longitude) {\n this.id = id;\n this.name = name;\n this.address_line_one = add1;\n this.address_line_two = add2;\n this.town = town;\n this.city = city;\n this.postcode = postcode;\n this.latitude = latitude;\n this.longitude = longitude;\n this.latlng = new google.maps.LatLng(latitude, longitude);\n this.distance;\n this.distance_raw;\n this.duration;\n this.duration_raw;\n this.toString = function() {\n return \"id: \" + this.id + \" name: \" + this.name + \" latlng: \" + this.latlng.toUrlValue(2) + \" distance: \" + this.distance + \" (\" + this.distance_raw + \" meters) duration: \" + this.duration + \" (\" + this.duration_raw + \" secs)\";\n }\n}", "title": "" }, { "docid": "5aea2d1bf181c770c47eca6ae6cf5b76", "score": "0.46809337", "text": "function Product(id,title,size,color,designId,price,url,quantity,inStock){\n\t//this.id = id,\n\tthis.title = title,\n\tthis.size = size,\n\tthis.color = color,\n\tthis.designId = designId,\n\tthis.price = price,\n\tthis.url = url,\n\tthis.quantity = quantity,\n\t//this.inStock = function(){\n\t//\treturn this.quantity > 0;\n\t//},\n\tcart.push(this)\n\t//products.push(this)\n}", "title": "" }, { "docid": "c6fd75aab79eff4eb0c663f72d328067", "score": "0.46781132", "text": "static fromPortfolioArn(scope, id, portfolioArn) {\n const arn = cdk.Stack.of(scope).splitArn(portfolioArn, cdk.ArnFormat.SLASH_RESOURCE_NAME);\n const portfolioId = arn.resourceName;\n if (!portfolioId) {\n throw new Error('Missing required Portfolio ID from Portfolio ARN: ' + portfolioArn);\n }\n class Import extends PortfolioBase {\n constructor() {\n super(...arguments);\n this.portfolioArn = portfolioArn;\n this.portfolioId = portfolioId;\n }\n generateUniqueHash(value) {\n return (0, util_1.hashValues)(this.portfolioArn, value);\n }\n }\n return new Import(scope, id, {\n environmentFromArn: portfolioArn,\n });\n }", "title": "" }, { "docid": "44d162847bd310dd59c99e5f0f317bfa", "score": "0.46752867", "text": "function formatStockData (JSONdata) {\n\n var stock = {\n\n name: JSONdata.Name,\n symbol: JSONdata.Symbol,\n currentPrice: parseFloat(JSONdata.LastTradePriceOnly),\n priceChange: parseFloat(JSONdata.Change),\n priceChangeInPercent: parseFloat(JSONdata.ChangeinPercent)\n };\n\n return stock;\n}", "title": "" }, { "docid": "9858dbd789096d34511ab493147767d1", "score": "0.46749732", "text": "function oSeries() {\n var oSeries = {\n // ARRAYS OF FOOTPRINTS\n aAllEquipment: [],\n aComputingEquipment: [],\n aWorkstation: [],\n aDesktop: [],\n aIntergated: [],\n aNotebook: [],\n // TOTAL FOOTPRINTS\n iComputingEquipment: 0,\n iWorkstation: 0,\n iDesktop: 0,\n iIntergated: 0,\n iNotebook: 0,\n totalFootprint: 0,\n // QUANTITY OF EQUIPMENT BY CATEGORY\n iQtyComputingEquipment: 0,\n iQtyWorkstation: 0,\n iQtyDesktop: 0,\n iQtyIntergated: 0,\n iQtyNotebook: 0,\n // FLAG\n loaded: false,\n\t\t// factors\n\t\tconversion_factor: 0,\n\t\tconversion_factor_unit: \"N/A\"\n };\n return oSeries;\n}", "title": "" }, { "docid": "49de15ec48fe54b9a6cc9332900a406f", "score": "0.46668193", "text": "function displayStockData(stock) {\n\n // Changes top-level display data.\n let stockHeaderInfo = d3.select('#stock-header-info').html('');\n stockHeaderInfo.append('h1').attr('id','stockTitle').text(stock);\n let currentPrice = stockHeaderInfo.append('p');\n let shares;\n zwazStocks.forEach(s => {\n if (s.symbol === stock) {\n shares = s.shares;\n }\n })\n\n // Calls API for the selected stock.\n d3.json(`${finnhubBaseLink}api/v1/quote?symbol=${stock}&token=${finnhub_API_KEY}`).then(stockCall => {\n let stockObject = {\n 'symbol': stock,\n 'prices': {\n 'open': stockCall.o,\n 'current': stockCall.c,\n 'high': stockCall.h,\n 'low': stockCall.l,\n 'previousClose': stockCall.pc\n },\n 'date': toHumanDate(stockCall.t),\n }\n if (stockObject.prices.current === 0) {\n currentPrice.text('There was an issue retrieving data for this stock.')\n } else {\n currentPrice.text(`Current Price: $${stockObject.prices.current}`);\n let sharesOwned = stockHeaderInfo.append('p').text(`Shares: ${shares}`);\n let investedSum;\n investedSum = stockHeaderInfo.append('p').text(`Total Invested: $${(stockObject.prices.current * shares).toFixed(2)}`);\n }\n }).catch(error => {\n fourTwentyNine();\n })\n}", "title": "" }, { "docid": "7320b4a7db0aa2083c29b78e0eb2a081", "score": "0.46625555", "text": "function PFMPieChart(defaultValues){\n\t\tvar privateState = {};\n\t\t\tprivateState.cashSpent = defaultValues?(defaultValues[\"cashSpent\"]?defaultValues[\"cashSpent\"]:null):null;\n\t\t\tprivateState.cateforyId = defaultValues?(defaultValues[\"cateforyId\"]?defaultValues[\"cateforyId\"]:null):null;\n\t\t\tprivateState.categoryName = defaultValues?(defaultValues[\"categoryName\"]?defaultValues[\"categoryName\"]:null):null;\n\t\t\tprivateState.errmsg = defaultValues?(defaultValues[\"errmsg\"]?defaultValues[\"errmsg\"]:null):null;\n\t\t\tprivateState.monthId = defaultValues?(defaultValues[\"monthId\"]?defaultValues[\"monthId\"]:null):null;\n\t\t\tprivateState.monthName = defaultValues?(defaultValues[\"monthName\"]?defaultValues[\"monthName\"]:null):null;\n\t\t\tprivateState.totalCashSpent = defaultValues?(defaultValues[\"totalCashSpent\"]?defaultValues[\"totalCashSpent\"]:null):null;\n\t\t\tprivateState.year = defaultValues?(defaultValues[\"year\"]?defaultValues[\"year\"]:null):null;\n\t\t//Using parent contructor to create other properties req. to kony sdk\t\n\t\t\tBaseModel.call(this);\n\n\t\t//Defining Getter/Setters\n\t\t\tObject.defineProperties(this,{\n\t\t\t\t\"cashSpent\" : {\n\t\t\t\t\tget : function(){return privateState.cashSpent},\n\t\t\t\t\tset : function(val){\n\t\t\t\t\t\tsetterFunctions['cashSpent'].call(this,val,privateState);\n\t\t\t\t\t},\n\t\t\t\t\tenumerable : true,\n\t\t\t\t},\n\t\t\t\t\"cateforyId\" : {\n\t\t\t\t\tget : function(){return privateState.cateforyId},\n\t\t\t\t\tset : function(val){\n\t\t\t\t\t\tsetterFunctions['cateforyId'].call(this,val,privateState);\n\t\t\t\t\t},\n\t\t\t\t\tenumerable : true,\n\t\t\t\t},\n\t\t\t\t\"categoryName\" : {\n\t\t\t\t\tget : function(){return privateState.categoryName},\n\t\t\t\t\tset : function(val){\n\t\t\t\t\t\tsetterFunctions['categoryName'].call(this,val,privateState);\n\t\t\t\t\t},\n\t\t\t\t\tenumerable : true,\n\t\t\t\t},\n\t\t\t\t\"errmsg\" : {\n\t\t\t\t\tget : function(){return privateState.errmsg},\n\t\t\t\t\tset : function(val){\n\t\t\t\t\t\tsetterFunctions['errmsg'].call(this,val,privateState);\n\t\t\t\t\t},\n\t\t\t\t\tenumerable : true,\n\t\t\t\t},\n\t\t\t\t\"monthId\" : {\n\t\t\t\t\tget : function(){return privateState.monthId},\n\t\t\t\t\tset : function(val){\n\t\t\t\t\t\tsetterFunctions['monthId'].call(this,val,privateState);\n\t\t\t\t\t},\n\t\t\t\t\tenumerable : true,\n\t\t\t\t},\n\t\t\t\t\"monthName\" : {\n\t\t\t\t\tget : function(){return privateState.monthName},\n\t\t\t\t\tset : function(val){\n\t\t\t\t\t\tsetterFunctions['monthName'].call(this,val,privateState);\n\t\t\t\t\t},\n\t\t\t\t\tenumerable : true,\n\t\t\t\t},\n\t\t\t\t\"totalCashSpent\" : {\n\t\t\t\t\tget : function(){return privateState.totalCashSpent},\n\t\t\t\t\tset : function(val){\n\t\t\t\t\t\tsetterFunctions['totalCashSpent'].call(this,val,privateState);\n\t\t\t\t\t},\n\t\t\t\t\tenumerable : true,\n\t\t\t\t},\n\t\t\t\t\"year\" : {\n\t\t\t\t\tget : function(){return privateState.year},\n\t\t\t\t\tset : function(val){\n\t\t\t\t\t\tsetterFunctions['year'].call(this,val,privateState);\n\t\t\t\t\t},\n\t\t\t\t\tenumerable : true,\n\t\t\t\t},\n\t\t\t});\n\n\t}", "title": "" }, { "docid": "dee40723b4c6d86d7fc30ceb6543d41c", "score": "0.46616706", "text": "function Cart(salesTax, deliveryFee) {\n this.pizzas = [],\n this.subTotal = 0,\n this.salesTax = salesTax,\n this.totalTax = 0,\n this.deliveryFee = deliveryFee,\n this.totalPrice = 0\n}", "title": "" }, { "docid": "def67baa240a05989fbe40590f8e66c1", "score": "0.4660901", "text": "function formatDetailedStockData (JSONdata) {\n\n var stock = {\n\n // Basic information\n name: JSONdata.Name,\n symbol: JSONdata.Symbol,\n\n // Price Data\n currentPrice: parseFloat(JSONdata.LastTradePriceOnly),\n priceChange: parseFloat(JSONdata.Change),\n priceChangeInPercent: parseFloat(JSONdata.ChangeinPercent),\n marketCap: JSONdata.MarketCapitalization, // Convert this into the appropriate double value PLZ\n\n // Stock Details\n openPrice: parseFloat(JSONdata.Open),\n previousClose: parseFloat(JSONdata.PreviousClose),\n daysLowPrice: parseFloat(JSONdata.DaysLow),\n daysHighPrice: parseFloat(JSONdata.DaysHigh),\n volume: parseFloat(JSONdata.Volume),\n averageVolume: parseFloat(JSONdata.AverageDailyVolume),\n fiftyTwoWeekHigh: parseFloat(JSONdata.YearHigh),\n fiftyTwoWeekLow: parseFloat(JSONdata.YearLow),\n shortRatio: parseFloat(JSONdata.ShortRatio),\n\n // Stock Metrics\n earningsPerShare: parseFloat(JSONdata.EarningsShare),\n dividend: parseFloat(JSONdata.DividendShare),\n dividendYield: parseFloat(JSONdata.DividendYield),\n priceToEarnings: parseFloat(JSONdata.PERatio),\n priceToSales: parseFloat(JSONdata.PriceSales),\n priceToBook: parseFloat(JSONdata.PriceBook)\n };\n\n return stock;\n}", "title": "" }, { "docid": "680382f87e19ec992c2ed32d3c553ec1", "score": "0.4660335", "text": "render () {\n const {\n id,\n heading=null,\n byline=null,\n content=null,\n modifiers=[],\n flourishes=[],\n segments=[],\n style=\"default\",\n children=null,\n } = this.props\n\n let styleModifiers = modifiers\n styleModifiers.push(style)\n let portfolioClassModifiers = styleModifiers.map(\n modifier => \"portfolio--\" + modifier\n ).join(\" \")\n let visibleSegments = segments.filter(segment => segment.visible !== false)\n\n return (\n <section id={id} className={`portfolio ${ portfolioClassModifiers }`}>\n {flourishes ? flourishes.map((flourish, i) => <Flourish key={i} category={flourish}/>) : \"\"}\n <div className=\"portfolio__header\">\n {heading ? <Heading level={1} modifiers={byline ? [\"leader\"] : [\"major\"]}>{heading}</Heading> : \"\"}\n {byline ? <Heading level={0} modifiers={[\"major\"]}>{byline}</Heading> : \"\"}\n {content ? content.split(\"\\n\\n\").map((para, i) => <p key={i}>{para}</p>) : \"\"}\n {children}\n </div>\n <div className=\"portfolio__content\">\n {\n visibleSegments.map((segment, index) => (\n <PortfolioSegment key={index} {...segment}/>\n ))\n }\n <PortfolioSegment\n heading=\"Interested in working with us?\"\n content=\"Send us a message to find out how we could help with your project\"\n isInfoBox={true}\n />\n </div>\n </section>\n )\n }", "title": "" }, { "docid": "e67d840d1e95fb995d6c1e8c50658ccd", "score": "0.465805", "text": "function showPortfolio(request) {\n\t\t//first set it to a number (-1 because items start at 0)\n\t\tvar item = mapPortfolioItem(request[1]);\n\t\t\n\t\t$pleftA.eq(item).each(function(){\n\t\t\t$(this).addClass('current');\n\t\t\tvar t = getPortfolioItemHtml(item);\n\t\t\tsetPortfolioItemHtml(t);\n\t\t});\n\t\t$pright.css('opacity',0);\n\n\t\t\n\t\t$pleftDiv.each(function(i) {\n\t\t\t$(this).delay(i*speed/3).animate({opacity: 1}, speed);\n\t\t});\n\t\tfadeInPortfolioItem(speed*2);\n\t\t\n\t}", "title": "" }, { "docid": "6c25e5c90f5a932e9b68b8a8bf73d21b", "score": "0.4657995", "text": "function Company (name) {\n this.company = name;\n this.creator = hrEmployee;\n}", "title": "" }, { "docid": "275bfc2935aad492e004447267c233be", "score": "0.4656228", "text": "function createAndPushProjects () {\n // let trivia = new BuildPortfolio(\"The Office Trivia Game\", \"images/portimages/trivia.png\", \"https://github.com/901david/TriviaGame\", \"https://901david.github.io/TriviaGame/\", \"This is a basic trivia game app focused around the hit comedy series - The Office. As you navigate through trivia questions enjoying the hilarious associated animated gifs and sound bites, you will see the quiz is designed to automatically move the user through the quiz using Javascript. At the conclusion of the quiz the user is given a 'grade' on how they did which is based on how many questions they get right and wrong in addition to how much time they take. Can you get an Expert grade?\", \"Html, Css, Javascript, JQuery\");\n let centennial = new BuildPortfolio(\"The Centennial Charge\",\"images/portimages/charge.png\", \"https://github.com/901david/centennialCharge\", \"https://901david.github.io/centennialCharge/\", \"This was a group project I worked on mainly backend for. The idea was to present ironic Colorado news articles and Colorado styled solutions. My work on this project included creating the live comment system that allows users to interact with each other within the site. This includes re-arranging the comments based on how many likes and dislikes they have received. In addition, I was responsible for using the Ny Times API which was accessed using Ajax calls and then displaying Colorado based 'real' news articles underneath our ironic false ones. Lastly, I assisted in assuring that the site was mobile responsive.\", \"Html, Css, Javascript, Ajax, Api's, Animate Css, Firebase, JQuery\");\n // let flashCardGen = new BuildPortfolio(\"Flash-Card Generator\", \"images/portimages/flashgen.png\", \"https://github.com/901david/Flashcard-Generator\", \"https://901david.github.io/Flashcard-Generator/\", \"This is a Node based app using constructor functions to create two types of flash cards. User is allowed to create any number of flash cards and once created has the ability to 'study' the group created afterwards.\", \"Node, Javascript, Inquirer NPM Package\");\n let bamazon = new BuildPortfolio(\"Bamazon App\", \"images/portimages/bamazon.png\", \"https://github.com/901david/bamazon\", \"https://901david.github.io/bamazon/\", \"This is a storefront Node App that allows you to use three separate interfaces: Customer, Manager & Supervisor mode. In each mode you accomplish different tasks in the database. The idea is in each of these interfaces the client is able to purchase items that are listed in the database which updates the database. In other modes you are able to add inventory and products and/or manage departments and total sales.\", \"Node, Javascript, Inquirer, CLI-Table, MySQL\");\n let flashCardFun = new BuildPortfolio(\"FlashCard Fun\", \"images/portimages/flashfun.png\", \"https://github.com/901david/Flashcard-Fun\", \"https://901david.github.io/Flashcard-Fun/\",\"The inspiration for FlashCard Fun was the Node app I created FlashCard Generator. This web app uses Firebase Authorization to allow users to create usernames. When signed in the user can keep a running tab of Flash Cards they have created to study from. The Flash Cards are also able to be broken down by groups which alllows for maintaining several different subjects you can study. Then you are able to review the cards you have created for studying purposes.\", \"Html, Bootstrap, Css, Animate Css, Firebase, Javascript, Photoshop, JQuery\");\n let starWars = new BuildPortfolio(\"Star Wars Battle\", \"images/portimages/starwars.png\",\"https://github.com/901david/star-wars-Battle\",\"https://901david.github.io/star-wars-Battle/\",\"This is a Star Wars based JQuery game. It allows a user to choose a character and then with that character they must defeat all the other available chracters to assure victory. May the force be with you!\", \"Html, Css, Javascript, JQuery\");\n let rockPapSciss = new BuildPortfolio(\"Rock Paper Scissors - Multiplayer\", \"images/portimages/RPS.png\", \"https://github.com/901david/RPS-Multiplayer\", \"https://901david.github.io/RPS-Multiplayer/\", \"This web application is a basic rock, paper, scissors game that uses Firebase to allow to users to play each other. It also has a chat feature to it which allows users to chat with each other while battling it out.\", \"Html, Css, JQuery, Javascript, Firebase\");\n let liriNode = new BuildPortfolio(\"'LIRI' - Node Application\", \"images/portimages/lirinode.png\", \"https://github.com/901david/liri-node-app\", \"https://github.com/901david/liri-node-app\", \"This is a node application that is a language knock off of the popular SIRI. LIRI takes commands as well through the terminal. Send tweets, look up sounds through spotify and search for movies. This is a fun application that shows you how easily node will integrate with API's to create a fun application\", \"Node, Javascript, Ajax, Twitter npm, Spotify npm\" );\n\n portfolioProjects.push(centennial, rockPapSciss, liriNode, flashCardFun,starWars, bamazon);\n}", "title": "" }, { "docid": "2ae5ecfbfd1c455921f8bf4fe94e5465", "score": "0.46538395", "text": "function Package(data) {\n this.name = data.name;\n this.width = data.width;\n this.height = data.height;\n this.weight = data.weight;\n this.location = data.location;\n this.price = data.price;\n this.selector = data.selector;\n\n\n }", "title": "" }, { "docid": "98839c50fb3717b5fcff3609baafc2b0", "score": "0.46533993", "text": "function CandlestickSeriesDataItem() {\n var _this = _super.call(this) || this;\n\n _this.values.lowValueX = {};\n _this.values.lowValueY = {};\n _this.values.highValueX = {};\n _this.values.highValueY = {};\n _this.className = \"CandlestickSeriesDataItem\";\n\n _this.applyTheme();\n\n return _this;\n }", "title": "" }, { "docid": "aeedefe5050c050b98b0b793808269ab", "score": "0.46533188", "text": "function collectData()\n {\n var stocks = [];\n var $topNodes = $(\"#knowledge-finance-wholepage__financial-entities-list\").children();\n var count =0;\n for(var ii=0; ii < $topNodes.length; ++ii)\n {\n var $topNode = $($topNodes[ii]);\n var elList = $topNode.find('span:not(:has(*))');\n\n if(elList.length == 0)\n continue;\n \n //For NIFTY --> there is no currency. So length is 7 instead of default 8\n if(elList.length == 7)\n {\n elList.splice(2,0,'');\n }\n var symbol = DOMUtils.getDomText(elList[0]);\n var lastPriceEl = elList[1];\n var currency = DOMUtils.getDomText(elList[2]);\n var stockCode = DOMUtils.getDomText(elList[3]);\n var currentState = DOMUtils.getDomText(elList[4]); //Closed:\n var timeEl = elList[5];\n var changeEl = elList[6];\n var percentChangeEl = elList[7];\n stocks.push(new Stock(symbol, lastPriceEl, stockCode, currency, timeEl, changeEl, percentChangeEl));\n }\n //window.stocks = stocks;\n// console.log(stocks);\n return stocks;\n }", "title": "" }, { "docid": "3ce8dbfee767f129c826e2760a5e135a", "score": "0.4647267", "text": "function Figure(type, color, img, index) {\n this.type = type;\n this.color = color;\n this.img = img;\n if (index) this.index = index;\n}", "title": "" }, { "docid": "636cff64c346092c4755800dc47033e0", "score": "0.4631451", "text": "function refreshPortfolio() {\n reloadPortfolio = true;\n loadPortfolio();\n }", "title": "" } ]
317e65450c842cbc416219808b6bac50
Get/Read e.g. get(" "_design/viewByName/_view/viewByNames"); This is the only func that (optionally) takes two parts of a URL. Inconsistent, but it makes the other files neater.
[ { "docid": "1ba4cc860f1fe3acd824786290fe9aaf", "score": "0.5513797", "text": "function get(url, path) {\n // Will join URL and path if two arguments, or just use a single full URL if only one argument.\n if (path) {\n url += path;\n }\n\n return fetch(url)\n .then(function (response) {\n return response.json();\n }).then(function (body) {\n return body;\n });\n}", "title": "" } ]
[ { "docid": "26a6f0203cdd58039d6af52f04a81599", "score": "0.59865975", "text": "get(uri){\n\n }", "title": "" }, { "docid": "9d7ad6d3ad9b76bb045d3f6aec02f3d5", "score": "0.59822434", "text": "get(path) {\n if (path && typeof path === \"string\") {\n const split = Page.splitPath(path);\n if (split.pageId) return this.getPage(split.projectId, split.sectionId, split.pageId);\n if (split.sectionId) return this.getSection(split.projectId, split.sectionId);\n if (split.projectId) return this.getProject(split.projectId);\n }\n console.warn(`oak.get(${path}): path not understood`);\n return undefined;\n }", "title": "" }, { "docid": "f7bc7c481b4fd0b87553d9bf8b868352", "score": "0.58520037", "text": "function doGet( request, response ) {\n var split\n , op\n , arg\n ;\n split = request.url.split('?');\n op = split[0];\n arg = split[1];\n try {\n switch( op ) {\n case '/Materias':\n getSubjects( response );\n break;\n case '/Examenes':\n getExams( qs.parse( arg ), response );\n break;\n case '/Examen':\n getExam( qs.parse( arg ), response );\n break;\n case '/Apuntes':\n getNotes( qs.parse( arg ), response );\n break;\n case '/Apunte':\n getNote( qs.parse( arg ), response );\n break;\n default:\n http.badRequest( response, request.url );\n }\n } catch ( e ) {\n http.internalError( response, e );\n console.log( e );\n }\n}", "title": "" }, { "docid": "a38f8e66d6a3ae4b1dd1919e44f69987", "score": "0.58015513", "text": "function doGet() {}", "title": "" }, { "docid": "74f0c08d61a08099f28f14b226f28673", "score": "0.5793562", "text": "function get(name){\n if(name=(new RegExp('[?&]'+encodeURIComponent(name)+'=([^&]*)')).exec(location.search))\n return decodeURIComponent(name[1]);\n}", "title": "" }, { "docid": "a7b0c490c4beee2cdf0569e03a3b2c20", "score": "0.5726002", "text": "function get(name)\n{\n if(name=(new RegExp('[?&]'+encodeURIComponent(name)+'=([^&]*)')).exec(location.search))\n return decodeURIComponent(name[1]);\n}", "title": "" }, { "docid": "26af61a28ac701be5cb9b620253677e6", "score": "0.5626659", "text": "function eval_getURLandName() {\n\tvar theArr = [];\n\t\n\ttheArr[0] = 'file:///Volumes' + app.activeDocument.fullName.fullName;\n\ttheArr[1] = app.activeDocument.name;\n\t\n\t//return value must be string...\n\treturn JSON.stringify(theArr);\n}", "title": "" }, { "docid": "65414c8947ec7bdb972e568a191546b4", "score": "0.56110686", "text": "function getGET( name )\r\n\r\n{\r\n\r\n name = name.replace(/[\\[]/,\"\\\\\\[\").replace(/[\\]]/,\"\\\\\\]\");\r\n\r\n var regexS = \"[\\\\?&]\"+name+\"=([^&#]*)\";\r\n\r\n var regex = new RegExp( regexS );\r\n\r\n var results = regex.exec( window.location.href );\r\n\r\n if( results == null )\r\n\r\n return \"\";\r\n\r\n else\r\n\r\n return results[1];\r\n\r\n}", "title": "" }, { "docid": "d1c119b057c469b28f2fbe06f66fddfb", "score": "0.560746", "text": "function __GET(parameterName) {return $_GET(parameterName);}", "title": "" }, { "docid": "9fc5999a4a2cdc210a0bbfda82fcfbeb", "score": "0.55889875", "text": "function superstar_get(robot,path,on_success,on_error)\n{\n\tsuperstar_generic(robot,path,\"?get\",\n\t\tfunction(str) {\n\t\t\tvar json=null;\n\t\t\tif(str!=\"\") json=JSON.parse(str);\n\t\t\ton_success(json);\n\t\t}\n\t,on_error);\n}", "title": "" }, { "docid": "78c1e17423d411ba0070a55c89968d56", "score": "0.5534868", "text": "function get(name) {\n if (name = (new RegExp('[?&]' + encodeURIComponent(name) + '=([^&]*)')).exec(location.search))\n return decodeURIComponent(name[1]);\n}", "title": "" }, { "docid": "53f9ba97a8a64be871532ad9e78d1984", "score": "0.5455785", "text": "function get(...args) {\n return request('GET', ...args);\n}", "title": "" }, { "docid": "882b42cf2a2877f3185f28b7e887cc95", "score": "0.5448936", "text": "function processGET() {\n\tvar parameters = location.search.substring(1).split(\"&\");\n\tvar temp = parameters[0].split(\"=\");\n\tvar name = unescape(temp[1]);\n\treturn name;\n}", "title": "" }, { "docid": "1d6e74b654fc30f0a8215066e4d59ba6", "score": "0.5436473", "text": "get(path)\n {\n return this.request(path, null, 'GET');\n }", "title": "" }, { "docid": "fb6c19dacc1208d7b4772c3c86f8b4d3", "score": "0.54237646", "text": "get(url, opt = {}) {\n opt.method = 'GET';\n return this.request(url, opt);\n }", "title": "" }, { "docid": "ab2983bae07715b1d556f666d3ad52fc", "score": "0.5348511", "text": "function get_url(path, args){\n return args.u || args.url || path\n}", "title": "" }, { "docid": "c5c4e3a2ba9e6ed723e4c9311647dbdc", "score": "0.52987504", "text": "function get(url) { return request(\"GET\")(url)(null)([\"Nil\"]); }", "title": "" }, { "docid": "5bb70b200d0d5d3faa94d7aec97b1db0", "score": "0.5267617", "text": "async getDataFromApiForOneField (myUrl,myField){\n\n }", "title": "" }, { "docid": "378089650abaf601f3f545483f59bc6e", "score": "0.52581763", "text": "function getUrl() {\n var query = window.location.pathname.split(\"/\");\n return \"/editor/\" + query[2] + \"/\" + query[3];\n}", "title": "" }, { "docid": "7901dd69aa93a7a6e432fcde4a2fec75", "score": "0.5224757", "text": "getDataFromUrl() {\n var aux = location.search.substr(2).split('+');\n\n for (var i = 0; i < aux.length - 1; i++) {\n var aux2 = { id: aux[i], name: aux[++i] }\n this.types.push(aux2);\n }\n this.title = aux[aux.length - 1].split('_').join(' ');\n document.title = this.title;\n }", "title": "" }, { "docid": "22e018320a77b68517f96460f095ef21", "score": "0.52245146", "text": "static get(url, paramsDict) {\n const processedUrl = NetworkFunc.generateApiUrlPrefix(url);\n\n if (!paramsDict || Object.keys(paramsDict).length == 0) {\n return fetch(processedUrl, {\n credentials: 'same-origin',\n });\n }\n const concatenated = processedUrl + \"?\" + NetworkFunc.mapToSortedQueryParams(paramsDict);\n return fetch(concatenated, {\n credentials: 'same-origin',\n });\n }", "title": "" }, { "docid": "ec3aaea3f8ab5b12b0b95aea75593b56", "score": "0.5224465", "text": "function getqv(url, name) {\n\t\tvar vars = url.replace(/^[^?]*\\?/, '').split('&'); \n\t\tfor (var i = 0; i < vars.length; i++) {\n\t\t\tvar kv = vars[i].split('=');\n\t\t\tif (decodeURIComponent(kv[0]) == name)\n\t\t\t\treturn decodeURIComponent(kv[1]);\n\t\t}\n\t}", "title": "" }, { "docid": "b4711affacda7dfd1cdd6a396693cc24", "score": "0.51845735", "text": "function getData (url){\n\t\tlet request=$.get(url);\n\t\treturn request;\n\t}", "title": "" }, { "docid": "0bf962a3ff831ad74826dce5639cd729", "score": "0.51772875", "text": "function getpage(url) {\n fetch(url).then(response => response.json()).\n then(data => displayNames(data));\n}", "title": "" }, { "docid": "37bd6a43468276c10b6c983310a26b60", "score": "0.5140782", "text": "getDesignFromUrl( url ){\n let design;\n let expression = /\\/([A-Za-z0-9-]*)-a-/;\n let designArray = expression.exec( url );\n\n if( designArray ){\n design = designArray[1];\n }\n\n return design;\n }", "title": "" }, { "docid": "28e3f7afbd8ff26267e84943e298c6ab", "score": "0.5139617", "text": "get (url) {\n return this.makeRequest(url)\n }", "title": "" }, { "docid": "65773bf823dc751f1f51aea240156a4d", "score": "0.5120198", "text": "function loadGedcomRec(recType, recId) {\n var urlPref = \"http://localhost:8080/gedcom-web/rest/\";\n // sample: \"http://localhost:8080/gedcom-web/rest/person/1/xml\";\n var url = urlPref+recType+\"/\"+recId+\"/xml\";\n //alert(\"url: \" + url);\n loadXMLDoc(url);\n}", "title": "" }, { "docid": "9e5d29a5faa82a1548659c85488f6dea", "score": "0.511212", "text": "function getFromurl(Name, Def) {\n if (arguments.length < 2 ) Def=false;\n var search = Name + \"=\"\n var surl = new String(document.URL);\n \n if (surl.length > 0) { \t// if there are any Url\n offset = surl.indexOf(search)\n if (offset != -1) { \t\t\t// if var exists\n offset += search.length\n\t\t\t\t\t\t\t // set index of beginning of value\n end = surl.indexOf(\"&\", offset)\n\t\t\t\t\t\t // set index of end of cookie value\n if (end == -1)\n end = surl.length;\n return unescape(surl.substring(offset, end))\n }\n }\n return Def;\n}", "title": "" }, { "docid": "bc00e43572eab8e3cc6822ec40047172", "score": "0.51102126", "text": "get(url, options) {\n return this.fetch(...arguments, {\n method: \"GET\",\n });\n }", "title": "" }, { "docid": "f032b66ccf857fa266c3287b201f6de3", "score": "0.5101368", "text": "get(url, options = {}) {\n return this.request('GET', url, options);\n }", "title": "" }, { "docid": "f032b66ccf857fa266c3287b201f6de3", "score": "0.5101368", "text": "get(url, options = {}) {\n return this.request('GET', url, options);\n }", "title": "" }, { "docid": "f032b66ccf857fa266c3287b201f6de3", "score": "0.5101368", "text": "get(url, options = {}) {\n return this.request('GET', url, options);\n }", "title": "" }, { "docid": "f032b66ccf857fa266c3287b201f6de3", "score": "0.5101368", "text": "get(url, options = {}) {\n return this.request('GET', url, options);\n }", "title": "" }, { "docid": "0f5cb035dea0415e7d438854a2776695", "score": "0.5100324", "text": "static get(g, a=true) {\n if (a === true) a = location.href\n if (!a) return null\n a = Url.url2a(a)\n let i, gets = {}\n const args = a.search ? a.search.replace(/^\\?/, '').split('&') : []\n for (i=0; i<args.length; i++) {\n const v = args[i].split('=')\n gets[v[0]] = decodeURIComponent(v[1].replace(/\\+/g, ' '))\n }\n return g === true ? gets : gets[g]\n //protocol, host (hostname, port), pathname, search, hash\n }", "title": "" }, { "docid": "346a41a74ff38b2196cb965c7fe2a98e", "score": "0.50973976", "text": "_getUrl(path)\n{\n return `${this._baseUri}/${path}`\n}", "title": "" }, { "docid": "81b69010998c7fcb6fe571bc2a82f20b", "score": "0.5092243", "text": "getAccess(id1, id2) {\n return http.get(`/employee-service/employee/checkvalid/${id1}/${id2}`);\n }", "title": "" }, { "docid": "ce4c18f16b86a6b63dc647f851eb317c", "score": "0.5086703", "text": "function readURL() {\n\n\t\tvar hash = window.location.hash;\n\n\t\t// Attempt to parse the hash as either an index or name\n\t\tvar bits = hash.slice( 2 ).split( '/' ),\n\t\t\tname = hash.replace( /#|\\//gi, '' );\n\n\t\t// If the first bit is invalid and there is a name we can\n\t\t// assume that this is a named link\n\t\tif( isNaN( parseInt( bits[0], 10 ) ) && name.length ) {\n\t\t\t// Find the slide with the specified name\n\t\t\tvar element = document.querySelector( '#' + name );\n\n\t\t\tif( element ) {\n\t\t\t\t// Find the position of the named slide and navigate to it\n\t\t\t\tvar indices = Reveal.getIndices( element );\n\t\t\t\tslide( indices.h, indices.v );\n\t\t\t}\n\t\t\t// If the slide doesn't exist, navigate to the current slide\n\t\t\telse {\n\t\t\t\tslide( indexh || 0, indexv || 0 );\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// Read the index components of the hash\n\t\t\tvar h = parseInt( bits[0], 10 ) || 0,\n\t\t\t\tv = parseInt( bits[1], 10 ) || 0;\n\n\t\t\tif( h !== indexh || v !== indexv ) {\n\t\t\t\tslide( h, v );\n\t\t\t}\n\t\t}\n\n\t}", "title": "" }, { "docid": "b3f0016321d43783b45d1ed156712b46", "score": "0.507615", "text": "function getSetfromURL(){\n console.log(\"entered get set url\");\n var path = window.location.pathname;\n var pathParts = path.split('/');\n return pathParts[1];\n}", "title": "" }, { "docid": "2793c26e62e434c9a74339f12fa3c175", "score": "0.5075483", "text": "get(uri) {\r\n return this._documents[uri];\r\n }", "title": "" }, { "docid": "2793c26e62e434c9a74339f12fa3c175", "score": "0.5075483", "text": "get(uri) {\r\n return this._documents[uri];\r\n }", "title": "" }, { "docid": "99f84ca032161f50bf518550b67f0adb", "score": "0.5055773", "text": "get(name, locals) {\n\n }", "title": "" }, { "docid": "02f8d1c5657ccd6d8fe945d5ab60ec10", "score": "0.5054413", "text": "Get() {}", "title": "" }, { "docid": "35ccdca7b3b9f245ae98265d68c44121", "score": "0.50536376", "text": "@Get('/:name(@[\\\\w\\\\-\\\\.]+\\/[\\\\w\\\\-\\\\.]+)/:d(download|\\-)/:filename(.+)')\n @Middleware('limit')\n @Middleware('download')\n async dowload_with_scope(ctx, next) {\n console.log('get i', ctx.params)\n return 1;\n }", "title": "" }, { "docid": "f96af45a780e837a4e9c1119d980aa63", "score": "0.50478333", "text": "function urlRequest(paras) //获取url参数方法\n{\n var url = location.href;\n var paraString = url.substring(url.indexOf(\"?\") + 1, url.length).split(\"&\");\n var paraObj = {}\n for (i = 0; j = paraString[i]; i++) {\n paraObj[j.substring(0, j.indexOf(\"=\")).toLowerCase()] = j.substring(j.indexOf(\"=\") + 1, j.length);\n }\n var returnValue = paraObj[paras.toLowerCase()];\n if (typeof(returnValue) == \"undefined\") {\n return \"\";\n } else {\n return returnValue;\n }\n}", "title": "" }, { "docid": "8bcca7a4884a21fa73960f632ebf044c", "score": "0.5045588", "text": "getUrl(fileName){\n DB.GetPostUrl(fileName)\n}", "title": "" }, { "docid": "a4e9cb774659d63ce114754392a5eb8f", "score": "0.50448334", "text": "get(id) {\r\n return http.get(`/id/${id}`);\r\n }", "title": "" }, { "docid": "ca3ed8929f93d477271c375aa5f6da87", "score": "0.50444514", "text": "function httpGet(theUrl) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open(\"GET\", theUrl, false);\n xmlHttp.send(null);\n return xmlHttp.responseText;\n }", "title": "" }, { "docid": "fc932a22beb0c4961fb750dd0bf23a96", "score": "0.50395703", "text": "async get (id, params) {\r\n\r\n\t}", "title": "" }, { "docid": "8ff34cb7f5335720d18e7a28f81a99d9", "score": "0.50284314", "text": "function UrlUtil() {}", "title": "" }, { "docid": "ed1213238129f13678739bfe6d6448da", "score": "0.5016573", "text": "function get(url) {\n return resourceCache[url];\n }", "title": "" }, { "docid": "e5891b6ab3bd4532345ff4490e5fcac3", "score": "0.5012619", "text": "get(url) {\n if (arguments.length > 1 || url.indexOf('/') !== -1) {\n throw new Ember.Error('It seems you tried to use `.get` to make a request! Use the `.request` method instead.');\n }\n return this._super(...arguments);\n }", "title": "" }, { "docid": "d4313b03c43396a3d822e4b85ece3431", "score": "0.5011723", "text": "static _get(url, body, success, failure) {\n let ajax = {\n method: 'GET'\n };\n let path = url;\n if (body) {\n let params = Object.keys(body).map((key) => {\n return key + \"=\" + body[key];\n });\n path += '?' + params.join('&');\n }\n\n this._request(path, ajax, success, failure);\n }", "title": "" }, { "docid": "fb68f86014a410c209374869b4d89f84", "score": "0.5004891", "text": "function getOverload() {\n\n\t\t/**\n\t\t * Overload Cldr.prototype.get().\n\t\t */\n\t\tsuperGet = Cldr.prototype.get;\n\t\tCldr.prototype.get = function( path ) {\n\t\t\tvar value = superGet.apply( this, arguments );\n\t\t\tpath = pathNormalize( path, this.attributes ).join( \"/\" );\n\t\t\tglobalEe.trigger( \"get\", [ path, value ] );\n\t\t\tthis.ee.trigger( \"get\", [ path, value ] );\n\t\t\treturn value;\n\t\t};\n\t}", "title": "" }, { "docid": "da1c381a859343b92d86eea17b534511", "score": "0.4996298", "text": "get(url) {\n if (arguments.length > 1 || url.indexOf('/') !== -1) {\n throw new Ember.Error('It seems you tried to use `.get` to make a request! Use the `.request` method instead.');\n }\n return this._super(...arguments);\n }", "title": "" }, { "docid": "75781162629b94e56eede95fa91c68d1", "score": "0.4990979", "text": "function GET(v)\n{\n if (!HTTP_GET_VARS[v]) {\n return 'undefined';\n }\n return HTTP_GET_VARS[v];\n}", "title": "" }, { "docid": "7ff03a8b7a24677abbee493539d1df6c", "score": "0.49840558", "text": "async function GET(url){\n return await global.client.fetch( url, {method:\"GET\"} )\n}", "title": "" }, { "docid": "1ab3f9f4ee35f6814c1e1ac2ba7c0302", "score": "0.49746946", "text": "function getOverload() {\n \t /**\n \t * Overload Cldr.prototype.get().\n \t */\n \t superGet = Cldr.prototype.get;\n \t Cldr.prototype.get = function (path) {\n \t var value = superGet.apply(this, arguments);\n \t path = pathNormalize(path, this.attributes).join(\"/\");\n \t globalEe.trigger(\"get\", [path, value]);\n \t this.ee.trigger(\"get\", [path, value]);\n \t return value;\n \t };\n \t }", "title": "" }, { "docid": "9dc1be4c1991c118e0d959c80c5fc91a", "score": "0.4971064", "text": "function Url(){}", "title": "" }, { "docid": "e8c7ea03d3d55cc2b1df98c46e6d33e5", "score": "0.4951248", "text": "function get(url, data, callback) { request(\"GET\", url, data, callback) }", "title": "" }, { "docid": "df196a3fce2de7cdd69c3f836d67e1ba", "score": "0.49492663", "text": "static get(...args) {\n let url = this.getItemUrl(...args);\n\n // Must be caught later\n return this.fetcher.get(url).then(({ response, headers, status }) => {\n let ret = this.fromJSON(response);\n ret.__meta = { headers, status, response };\n return ret;\n });\n }", "title": "" }, { "docid": "089f4af7e32c43e7cb0b3863422304fc", "score": "0.4942577", "text": "function httpGet(theUrl) {\n\tvar xmlHttp = new XMLHttpRequest();\n\txmlHttp.open(\"GET\", theUrl, false); // false for synchronous request\n\txmlHttp.send(null);\n\treturn xmlHttp.responseText;\n}", "title": "" }, { "docid": "f7601dc135c26e5e7db651ac8e8ffcd1", "score": "0.49368176", "text": "get(uri) {\n return this._documents[uri];\n }", "title": "" }, { "docid": "8a3c7569eba6f38fd5feb2be4cfb49b2", "score": "0.4935438", "text": "function backwardCompat_get(opt, path) {\r\n var pathArr = path.split(',')\r\n var obj = opt\r\n\r\n for (var i = 0; i < pathArr.length; i++) {\r\n obj = obj && obj[pathArr[i]]\r\n\r\n if (obj == null) {\r\n break\r\n }\r\n }\r\n\r\n return obj\r\n }", "title": "" }, { "docid": "4593077efdf22daa183328c78d5ec5fa", "score": "0.4908732", "text": "function getPeople(url) {\n return getJSON(url);\n}", "title": "" }, { "docid": "6ad4d69506f3b36382814bdfadab5d24", "score": "0.4905097", "text": "async get(uri, opts){\n let req = {\n method: 'GET'\n };\n try{\n let qstring = qs.stringify(opts);\n req.uri = `${uri}${qstring?'?'+qstring:''}`;\n debug(`GET ${req.uri}`);\n\n let resp = await this.baseRequest(req);\n return this.handleResponse(resp, null, req);\n\n }catch(ex){\n return this.handleResponse(ex, null, req);\n }\n }", "title": "" }, { "docid": "001b5496e65ac471f7224ab9481b28d5", "score": "0.48965928", "text": "function resolve(url, urls) {\n // Match a url\n // Return a url, or undefined\n if (url.indexOf('?') != -1)\n url = url.split('?')[0];\n for(var i=0; i<urls.length; i++) {\n var regex = new RegExp(urls[i][0]);\n var view = urls[i][1];\n var match = url.match(regex);\n if (match != null) {\n return view;\n }\n }\n return undefined;\n}", "title": "" }, { "docid": "ee27e33a7b6da2108f8cb352aa6d50d8", "score": "0.48953038", "text": "function requestGet(url, params) {\n\t\t\treturn handleResponse($http.get(url, { params: params }));\n\t\t}", "title": "" }, { "docid": "2aee530c2b2ef3ac7fdf261c1afa57bc", "score": "0.48921746", "text": "get (request, response, name) {\n return this._host.get(name).then(repr => {\n response.setHeader('Content-Type', 'application/json')\n response.end(JSON.stringify(repr))\n })\n }", "title": "" }, { "docid": "59f7039748e900e5b05e866ad0c34068", "score": "0.4891896", "text": "function fetchData(url) {\n var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n return model.dataAccessHelper.fetchText(publicAPI, url, option);\n }", "title": "" }, { "docid": "59f7039748e900e5b05e866ad0c34068", "score": "0.4891896", "text": "function fetchData(url) {\n var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n return model.dataAccessHelper.fetchText(publicAPI, url, option);\n }", "title": "" }, { "docid": "59f7039748e900e5b05e866ad0c34068", "score": "0.4891896", "text": "function fetchData(url) {\n var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n return model.dataAccessHelper.fetchText(publicAPI, url, option);\n }", "title": "" }, { "docid": "c2f9769c5c47c07efbf5582bc3c91d5d", "score": "0.48783162", "text": "function get(param){\n var value = expand.get(param);\n return value;\n}", "title": "" }, { "docid": "f8ca20f13c84ad545e7cc5d692226f26", "score": "0.48781118", "text": "function redirectGet(entry) {\n if( entry !== 'error.2.0.json') {\n entry = 'redfish-1.0/' + entry;\n }\n return fs.readFileAsync(__dirname + '/../../../../data/views/' + entry, 'utf-8')\n .then(function(contents) {\n return { contents: contents };\n });\n }", "title": "" }, { "docid": "bf51a51195679a1b08725d5aa40eb874", "score": "0.48737764", "text": "function _api_get(path, format, values, callback) {\n self.consumer.get(\n self.options.api_url + path + \".\" + format + \"?\" + (util.isArray(values) ? values.join('&') : values.toString()),\n self.token.access.token,\n self.token.access.secret,\n function (error, data) {\n if (error) {\n console.error(error);\n callback(error, null);\n } else {\n callback(null, data);\n }\n }\n );\n }", "title": "" }, { "docid": "3408865092d1a4bdc0c7619aeef57755", "score": "0.4869115", "text": "async get(path, setShowLoading) {\n return doRequest(path, setShowLoading, 'GET');\n }", "title": "" }, { "docid": "3811c94a8157e6cbdd501bc6f5330d06", "score": "0.48668364", "text": "function get(opt, path) {\n var pathArr = path.split(',');\n var obj = opt;\n\n for (var i = 0; i < pathArr.length; i++) {\n obj = obj && obj[pathArr[i]];\n\n if (obj == null) {\n break;\n }\n }\n\n return obj;\n}", "title": "" }, { "docid": "3811c94a8157e6cbdd501bc6f5330d06", "score": "0.48668364", "text": "function get(opt, path) {\n var pathArr = path.split(',');\n var obj = opt;\n\n for (var i = 0; i < pathArr.length; i++) {\n obj = obj && obj[pathArr[i]];\n\n if (obj == null) {\n break;\n }\n }\n\n return obj;\n}", "title": "" }, { "docid": "00d67daa1812627001b5c6376f3951d7", "score": "0.48599187", "text": "function get(opt, path) {\n path = path.split(',');\n var obj = opt;\n for (var i = 0; i < path.length; i++) {\n obj = obj && obj[path[i]];\n if (obj == null) {\n break;\n }\n }\n return obj;\n}", "title": "" }, { "docid": "cbbfb985049be60f6ced76ed1e593db6", "score": "0.48566434", "text": "function Get(yourUrl) {\n\tvar Httpreq = new XMLHttpRequest(); // a new request\n\tHttpreq.open(\"GET\", yourUrl, false);\n\tHttpreq.send(null);\n\treturn Httpreq.responseText;\n}", "title": "" }, { "docid": "e63931318f576addb6b2d1004f1efce1", "score": "0.4850001", "text": "function httpGet(theUrl) {\r\n var xmlHttp = new XMLHttpRequest();\r\n xmlHttp.open( \"GET\", theUrl, false); // false for synchronous request\r\n xmlHttp.send(null);\r\n return xmlHttp.responseText;\r\n}", "title": "" }, { "docid": "bddd1b963ad2261a74cd3178a3b7bbbb", "score": "0.48490855", "text": "function _getParam(url,key){\n\n\t\t\tkey = key.replace(/[\\[]/,\"\\\\\\[\").replace(/[\\]]/,\"\\\\\\]\");\n\t\t\tvar regexS = \"[\\\\?&]\"+key+\"=([^&#]*)\";\n\t\t\tvar regex = new RegExp( regexS );\n\t\t\tvar results = regex.exec( url );\n\t\t\treturn ( results == null ) ? \"\" : results[1];\n\n\t\t}", "title": "" }, { "docid": "9d706a92a12b572c65223bd588f54e74", "score": "0.4845832", "text": "function aGet(uri) {\r\n var request = Url.parse(uri);\r\n request.headers = {\r\n 'Authorization': 'Bearer ' + auth.credentials.access_token\r\n }\r\n request.method = \"GET\"\r\n var bits = new Stream.PassThrough();\r\n https.request(request, function(res) {\r\n console.error(\"[LOG] Fetching Document\", res.statusCode)\r\n res.pipe(bits);\r\n }).on('error', function(err) {\r\n console.error(\"[ERROR]\",err);\r\n }).end();\r\n return bits;\r\n}", "title": "" }, { "docid": "cd275c40088a77c8edbbab0046dee22d", "score": "0.48456573", "text": "function doGet(e) {}", "title": "" }, { "docid": "c38128c0c96fa9c4f182c560f9b7bff5", "score": "0.4845432", "text": "static getItemUrl(...args) {\n let params = args[0];\n if (!params.id) {\n throw new ArgumentError(`[Model][${this.constructor.name}] id is mandatory`);\n }\n\n let query = args[1];\n let queryString = this.getQueryString(query);\n\n return `${this.getListUrl(args[0])}/${params.id}${queryString}`;\n }", "title": "" }, { "docid": "77ed523a9e5b75071c7945c406627935", "score": "0.48380244", "text": "get(path, query = {}, options = {}) {\n return this.request(`${path}?${!isBlank(query) ? new URLSearchParams(query).toString() : ''}`, 'GET', options);\n }", "title": "" }, { "docid": "da0e879460cfbf80190f42ae764128f0", "score": "0.48347116", "text": "function searchName(request) {\n let miURL = url.parse(request.url, true);\n var mod = modelSearch();\n\n //Con For\n for (i = 0; i < mod.length; i++) {\n if (miURL.query.n === mod[i].nombre) {\n var n = mod[i].nombre\n var aP = mod[i].apellido_paterno\n var aM = mod[i].apellido_materno\n return n + \" \" + aP + \" \" + aM;\n\n }\n }\n}", "title": "" }, { "docid": "82bc598fefdfe8d400c008d2bda896eb", "score": "0.48344198", "text": "function loadContextFromUrl()\n {\n var querystring = $.deparam.querystring();\n site = querystring.site;\n view = querystring.view;\n mode = querystring.mode;\n path = querystring.path;\n id = querystring.id;\n name = querystring.name;\n debug = querystring.debug;\n autoTest = querystring.at;\n pathType = querystring.pathType;\n warningMessage = querystring.warningMessage;\n\n javascriptOff = (querystring.disableJS === \"true\" ? true : false);\n if(typeof(querystring.memento) != \"undefined\")\n {\n memento = JSON.parse(decodeURIComponent(querystring.memento));\n }\n }", "title": "" }, { "docid": "0a3f40aeeb25eff5f37a8e75ee292ea3", "score": "0.4832804", "text": "function get_gets() {\n function transformToAssocArray(prmstr) {\n var params = {};\n var prmarr = prmstr.split(\"&\");\n for (var i = 0; i < prmarr.length; i++) {\n var tmparr = prmarr[i].split(\"=\");\n params[tmparr[0]] = tmparr[1];\n }\n return params;\n }\n var prmstr = window.location.search.substr(1);\n Project.get_vars =\n prmstr !== null && prmstr !== \"\" ? transformToAssocArray(prmstr) : {};\n\n // maybe the following is left over from the simulator?\n if (typeof Project.get_vars.name !== \"undefined\") {\n exp_condition = Project.get_vars.name;\n } else {\n exp_condition = \"\";\n }\n if (Project.get_vars.platform === \"preview\") {\n online_data_obj.finished_and_stored = true;\n }\n Project.activate_pipe();\n}", "title": "" }, { "docid": "b7bcbaea2249d79669ab6fa25ba03f17", "score": "0.48315832", "text": "function httpGet(theUrl) {\n var xmlHttp = null;\n xmlHttp = new XMLHttpRequest();\n xmlHttp.open( \"GET\", theUrl, false );\n xmlHttp.send( null );\n return xmlHttp.responseText;\n}", "title": "" }, { "docid": "fe0b93a998a4d74fed862361c6c02591", "score": "0.48237243", "text": "get(params, callback) {\n\n this.client.get(params, function (err, response) {\n if (err) {\n this._logger.error(err);\n return callback(err);\n }\n\n if (!response._source) {\n return callback(new Error('404 - error')); // TODO\n }\n\n callback(err, response._source);\n }.bind(this));\n }", "title": "" }, { "docid": "996bfcbccd2878b3070cbb7d5cdbb42a", "score": "0.4823664", "text": "function getUrlArg(name, def, url) {\n if (!url) url = window.location.href;\n name = name.replace(/[\\[\\]]/g, '\\\\$&');\n var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),\n results = regex.exec(url);\n if (!results) return def;\n if (!results[2]) return def;\n return decodeURIComponent(results[2].replace(/\\+/g, ' '));\n}", "title": "" }, { "docid": "474430c47d7ef2d3b232c1d50d38738c", "score": "0.48151428", "text": "function url(){\n return \"https://en.wikipedia.org/w/api.php?action=query&format=json&list=search&utf8=1&srsearch=Albert+Einstein\";\n}", "title": "" }, { "docid": "47c2f791bfee1930953d1d095f4161d2", "score": "0.4813976", "text": "function selectedPath () { \ntry { \nvar ref = new ActionReference(); \nref.putEnumerated( charIDToTypeID(\"Path\"), charIDToTypeID(\"Ordn\"), charIDToTypeID(\"Trgt\") ); \nvar desc = executeActionGet(ref); \nvar theName = desc.getString(charIDToTypeID(\"PthN\")); \nreturn app.activeDocument.pathItems.getByName(theName) \n} \ncatch (e) { \nreturn undefined \n} \n}", "title": "" }, { "docid": "d0e1933387f6a3729dc8741f7143bbf5", "score": "0.4809196", "text": "function getUrl() {\n let query = new URLSearchParams(window.location.search).get('v');\n if (typeof query === \"string\") {\n return query;\n }\n return undefined;\n}", "title": "" }, { "docid": "427dd32d7d9e8b384af5dff8afd57af3", "score": "0.48074207", "text": "function httpGet(theUrl) {\n var xmlHttp = null;\n xmlHttp = new XMLHttpRequest();\n xmlHttp.open(\"GET\", theUrl, false);\n xmlHttp.send(null);\n return xmlHttp.responseText;\n}", "title": "" }, { "docid": "6fee1897210589f6ce3daca327a38642", "score": "0.48045653", "text": "function getIndexFromUrl(url){\n return url.split(\"/\").slice(-2);\n }", "title": "" }, { "docid": "607c25a5730739cbf4edd300293255dc", "score": "0.47989756", "text": "function secondPart(value) {\n var request = new XMLHttpRequest();\n request.open('GET', value);\n request.responseType = 'json';\n request.send();\n request.onload = function () {\n controller(request.response);\n }\n }", "title": "" }, { "docid": "21b51e3d94c10f43943e7b6bee51fe4e", "score": "0.4798565", "text": "async function getAPI(page, getContents) {\n\t\tif (page.title && page.properties && page.id && page.tags && (!getContents || page.content))\n\t\t\treturn page;\n\t\telse if (typeof page === 'string')\n\t\t\tpage = {\n\t\t\t\turl: page\n\t\t\t};\n\t\tpage.url = page.url.replace('?contentOnly', '');\n\t\t\n\t\tlet [subdomain, path] = parseURL(page.url);\n\t\t// console.log(page.url);\n\t\tlet response = await authenticatedFetch(path, `?dream.out.format=json${getContents ? '&include=contents' : ''}`, subdomain);\n\t\tif (response.ok) {\n\t\t\tresponse = await response.json();\n\t\t\tlet {properties, tags, files} = response;\n\t\t\tif (properties['@count'] !== '0' && properties.property) {\n\t\t\t\tproperties = properties.property.length ? properties.property : [properties.property]\n\t\t\t\tproperties = properties.map((prop) => {\n\t\t\t\t\tif (prop['@revision']) return {name: prop['@name'], value: prop.contents['#text']};\n\t\t\t\t\telse return prop\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tproperties = [];\n\t\t\t}\n\t\t\tif (tags.tag) {\n\t\t\t\ttags = tags.tag.length ? tags.tag : [tags.tag];\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttags = []\n\t\t\t}\n\t\t\tif (files.file) {\n\t\t\t\tfiles = files.file.length ? files.file : [files.file];\n\t\t\t\tfiles = files.map((file) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t'id': file['@id'],\n\t\t\t\t\t\t'revision': file['@revision'],\n\t\t\t\t\t\t'href': file['@href'],\n\t\t\t\t\t\t'contents': file['contents'],\n\t\t\t\t\t\t'created': file['date.created'],\n\t\t\t\t\t\t'filename': file['filename']\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfiles = []\n\t\t\t}\n\t\t\ttags = tags.map((elem) => elem.title);\n\t\t\tpage.id = parseInt(response['@id']);\n\t\t\tpage.title = page.title || response.title;\n\t\t\tpage.tags = page.tags || tags;\n\t\t\tpage.properties = page.properties || properties;\n\t\t\tpage.subdomain = subdomain;\n\t\t\tpage.files = page.files || files;\n\t\t\tpage.path = response.path['#text'];\n\t\t\tpage.modified = new Date(response['date.modified']);\n\t\t\tpage.content = response.content;\n\t\t\tif (response['page.parent'])\n\t\t\t\tpage.parentID = parseInt(response['page.parent']['@id']);\n\t\t\tif (response.security && response.security['permissions.effective']) {\n\t\t\t\tlet permissions = response.security['permissions.effective'].operations['#text'];\n\t\t\t\tif (permissions.includes('CHANGEPERMISSIONS'))\n\t\t\t\t\tpage.security = 'Editor';\n\t\t\t\telse if (permissions.includes('UPDATE'))\n\t\t\t\t\tpage.security = 'Author';\n\t\t\t\telse if (permissions.includes('READ'))\n\t\t\t\t\tpage.security = 'Viewer';\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\tlet error = await response.json();\n\t\t\t// console.error(`Can't get ${page.url}`);\n\t\t\tpage.subdomain = subdomain;\n\t\t\tpage.path = path;\n\t\t\tpage.modified = 'restricted';\n\t\t\tpage.error = error;\n\t\t}\n\t\treturn page;\n\t}", "title": "" }, { "docid": "6ed1ce3ed474b3191fed76acf74cdc9b", "score": "0.47927576", "text": "function get(query) {\n\treturn request(\"GET\", query);\n}", "title": "" }, { "docid": "b9414dba3dd73086449c690f8e6d0ca3", "score": "0.4785656", "text": "function Get(Url) {\n var XMLHttpRequest = require(\"xmlhttprequest\").XMLHttpRequest;\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", Url, false);\n xhr.send(null);\n return xhr.responseText;\n}", "title": "" } ]
a7aac160b02ad30dcec88e3e1a1b3d65
Create and return a new ReactElement of the given type. See
[ { "docid": "f757810746c7780c0e0ed361e5f40335", "score": "0.0", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" } ]
[ { "docid": "ba89f7470e9f759722c6a227e170b58d", "score": "0.7050864", "text": "function CreateType (props) {\n const {as, children, ...remainder} = props\n return React.createElement(as || 'span', remainder, children)\n}", "title": "" }, { "docid": "8d9f98312fc7c5eb18bccc8b52e7b155", "score": "0.6777204", "text": "createPageElement(gmctx, type, props) {\n return React.createElement(type, props);\n }", "title": "" }, { "docid": "82322eacdc46123b6730de55ce7c08be", "score": "0.674537", "text": "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "title": "" }, { "docid": "82322eacdc46123b6730de55ce7c08be", "score": "0.674537", "text": "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "title": "" }, { "docid": "82322eacdc46123b6730de55ce7c08be", "score": "0.674537", "text": "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "title": "" }, { "docid": "82322eacdc46123b6730de55ce7c08be", "score": "0.674537", "text": "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "title": "" }, { "docid": "82322eacdc46123b6730de55ce7c08be", "score": "0.674537", "text": "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "title": "" }, { "docid": "82322eacdc46123b6730de55ce7c08be", "score": "0.674537", "text": "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "title": "" }, { "docid": "82322eacdc46123b6730de55ce7c08be", "score": "0.674537", "text": "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "title": "" }, { "docid": "82322eacdc46123b6730de55ce7c08be", "score": "0.674537", "text": "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "title": "" }, { "docid": "82322eacdc46123b6730de55ce7c08be", "score": "0.674537", "text": "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "title": "" }, { "docid": "82322eacdc46123b6730de55ce7c08be", "score": "0.674537", "text": "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "title": "" }, { "docid": "bc9e90284790cc09e4b12a270bd3f05b", "score": "0.65219396", "text": "static create(type, properties, ...children) {\n if (type instanceof Function) {\n return new type(properties, children).element;\n }\n else if (typeof type === 'string') {\n const attributes = this.getProperties(properties);\n const content = this.getChildren(children);\n if (content.length) {\n return `<${type}${attributes.length ? ` ${attributes}` : ''}>${content}</${type}>`;\n }\n else {\n return `<${type}${attributes.length ? ` ${attributes}` : ''}/>`;\n }\n }\n else {\n throw new TypeError(`Unsupported element or component type \"${type}\"`);\n }\n }", "title": "" }, { "docid": "3ef97776bbac63712a54ae48f724ca14", "score": "0.6444101", "text": "function createElement(type, props, ...children) {\n return {\n type,\n props: {\n ...props,\n children: children.map(child =>\n typeof child === \"object\" ? child : createTextElement(child)\n )\n }\n };\n}", "title": "" }, { "docid": "03b94fbb31ed47c7d6acd368d4173095", "score": "0.6415681", "text": "function createElement(type, props, ...children) {\n\treturn {\n\t\ttype,\n\t\tprops: {\n\t\t\t...props, // use the spread operator for the props\n\t\t\tchildren,\n\t\t},\n\t};\n}", "title": "" }, { "docid": "9f1171d208f5565c43cf12483625f77e", "score": "0.64079314", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "9f1171d208f5565c43cf12483625f77e", "score": "0.64079314", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "9f1171d208f5565c43cf12483625f77e", "score": "0.64079314", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "64b5399f145433e9b2a3509d59099b3d", "score": "0.63947004", "text": "function createElement (type, props, ...children) {\n return {\n type,\n props: {\n ...props,\n children: children.length <= 1 ? children[0] : children\n }\n }\n}", "title": "" }, { "docid": "455808d1a3e8125255262e30cfc2c2c6", "score": "0.63826317", "text": "function createElement(type, attributes, ...children) {\n if (Assert.isPlainType(type)) {\n return createPlainElement(type, attributes, children);\n }\n else if (Assert.isClassType(type)) {\n return createClassElement(type, attributes, children);\n }\n else {\n throw new TypeError(`Element type isn't supported.`);\n }\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.6372984", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.634562", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "f158520e2f2e2fd7890557ce0b412227", "score": "0.6334784", "text": "function createElement (type, props, ...children) {\n const dom = document.createElement(type)\n if (props) Object.assign(dom, props)\n for (const child of children) {\n if (typeof child !== 'string') dom.appendChild(child)\n else dom.appendChild(document.createTextNode(child))\n }\n return dom\n}", "title": "" }, { "docid": "db41dfea0c31044015006adbec743b9f", "score": "0.6334656", "text": "function elt(type) {\n var node = document.createElement(type);\n for (var i = 1; i < arguments.length; i++) {\n var child = arguments[i];\n if (typeof child == \"string\")\n child = document.createTextNode(child);\n node.appendChild(child);\n }\n return node;\n}", "title": "" }, { "docid": "37967011f4f682f8c26e10460efb91eb", "score": "0.63005865", "text": "function createElement(type, config, children) {\n\t var propName;\n\n\t // Reserved names are extracted\n\t var props = {};\n\n\t var key = null;\n\t var ref = null;\n\t var self = null;\n\t var source = null;\n\n\t if (config != null) {\n\t if (hasValidRef(config)) {\n\t ref = config.ref;\n\t }\n\t if (hasValidKey(config)) {\n\t key = '' + config.key;\n\t }\n\n\t self = config.__self === undefined ? null : config.__self;\n\t source = config.__source === undefined ? null : config.__source;\n\t // Remaining properties are added to a new props object\n\t for (propName in config) {\n\t if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n\t props[propName] = config[propName];\n\t }\n\t }\n\t }\n\n\t // Children can be more than one argument, and those are transferred onto\n\t // the newly allocated props object.\n\t var childrenLength = arguments.length - 2;\n\t if (childrenLength === 1) {\n\t props.children = children;\n\t } else if (childrenLength > 1) {\n\t var childArray = Array(childrenLength);\n\t for (var i = 0; i < childrenLength; i++) {\n\t childArray[i] = arguments[i + 2];\n\t }\n\t {\n\t if (Object.freeze) {\n\t Object.freeze(childArray);\n\t }\n\t }\n\t props.children = childArray;\n\t }\n\n\t // Resolve default props\n\t if (type && type.defaultProps) {\n\t var defaultProps = type.defaultProps;\n\t for (propName in defaultProps) {\n\t if (props[propName] === undefined) {\n\t props[propName] = defaultProps[propName];\n\t }\n\t }\n\t }\n\t {\n\t if (key || ref) {\n\t if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n\t var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\t if (key) {\n\t defineKeyPropWarningGetter(props, displayName);\n\t }\n\t if (ref) {\n\t defineRefPropWarningGetter(props, displayName);\n\t }\n\t }\n\t }\n\t }\n\t return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n\t}", "title": "" }, { "docid": "3a797e31dcc007c00564065b410819ac", "score": "0.6277755", "text": "function createElement(type, config, children) {\n\t var propName; // Reserved names are extracted\n\n\t var props = {};\n\t var key = null;\n\t var ref = null;\n\t var self = null;\n\t var source = null;\n\n\t if (config != null) {\n\t if (hasValidRef(config)) {\n\t ref = config.ref;\n\t {\n\t warnIfStringRefCannotBeAutoConverted(config);\n\t }\n\t }\n\n\t if (hasValidKey(config)) {\n\t key = '' + config.key;\n\t }\n\n\t self = config.__self === undefined ? null : config.__self;\n\t source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n\t for (propName in config) {\n\t if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n\t props[propName] = config[propName];\n\t }\n\t }\n\t } // Children can be more than one argument, and those are transferred onto\n\t // the newly allocated props object.\n\n\n\t var childrenLength = arguments.length - 2;\n\n\t if (childrenLength === 1) {\n\t props.children = children;\n\t } else if (childrenLength > 1) {\n\t var childArray = Array(childrenLength);\n\n\t for (var i = 0; i < childrenLength; i++) {\n\t childArray[i] = arguments[i + 2];\n\t }\n\n\t {\n\t if (Object.freeze) {\n\t Object.freeze(childArray);\n\t }\n\t }\n\t props.children = childArray;\n\t } // Resolve default props\n\n\n\t if (type && type.defaultProps) {\n\t var defaultProps = type.defaultProps;\n\n\t for (propName in defaultProps) {\n\t if (props[propName] === undefined) {\n\t props[propName] = defaultProps[propName];\n\t }\n\t }\n\t }\n\n\t {\n\t if (key || ref) {\n\t var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n\t if (key) {\n\t defineKeyPropWarningGetter(props, displayName);\n\t }\n\n\t if (ref) {\n\t defineRefPropWarningGetter(props, displayName);\n\t }\n\t }\n\t }\n\t return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n\t }", "title": "" }, { "docid": "f143fa0a14bfd57a80332f89897f4173", "score": "0.6255302", "text": "function createElement(type, props) {\n var COMPONENTS = {\n ROOT: function ROOT() {\n return new _components.Root();\n },\n APP: function APP() {\n return new _components.App(props);\n },\n VIEW: function VIEW() {\n return new _components.View(props);\n },\n WINDOW: function WINDOW() {\n return new _components.Window(props);\n },\n VIRTUALTEXT: function VIRTUALTEXT() {\n return new _components.VirtualText(props);\n },\n ROOTTEXT: function ROOTTEXT() {\n return new _components.RootText(props);\n },\n IMAGE: function IMAGE() {\n return new _components.Image(props);\n },\n TEXTINPUT: function TEXTINPUT() {\n return new _components.TextInput(props);\n },\n PICKERINTERNAL: function PICKERINTERNAL() {\n return new _components.PickerInternal(props);\n },\n \"default\": undefined\n };\n return COMPONENTS[type]() || COMPONENTS[\"default\"];\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230725", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230725", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230725", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230725", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230725", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230725", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230725", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230725", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230725", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230725", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230725", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230725", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230725", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230725", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230725", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230725", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230725", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230725", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230725", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230725", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230725", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "bc4a7026c1939cb82ff1cfd1f298ae66", "score": "0.6230725", "text": "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" } ]
85e327b2462f0467d086481a85e554f2
For IE8 and IE9.
[ { "docid": "b6a82c40de3522753cd3152728ca92aa", "score": "0.0", "text": "function getTargetIDForInputEventIE(topLevelType, topLevelTarget, topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topSelectionChange || topLevelType === topLevelTypes.topKeyUp || topLevelType === topLevelTypes.topKeyDown) {\n\t // On the selectionchange event, the target is just document which isn't\n\t // helpful for us so just check activeElement instead.\n\t //\n\t // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire\n\t // propertychange on the first input event after setting `value` from a\n\t // script and fires only keydown, keypress, keyup. Catching keyup usually\n\t // gets it and catching keydown lets us fire an event for the first\n\t // keystroke if user does a key repeat (it'll be a little delayed: right\n\t // before the second keystroke). Other input methods (e.g., paste) seem to\n\t // fire selectionchange normally.\n\t if (activeElement && activeElement.value !== activeElementValue) {\n\t activeElementValue = activeElement.value;\n\t return activeElementID;\n\t }\n\t }\n\t}", "title": "" } ]
[ { "docid": "152ae9bc1417f8a0e5996a8772fc212a", "score": "0.729394", "text": "function isIE9or8(){\n\t\tvar version = getInternetExplorerVersion();\n\t\treturn(version != -1 && version <= 9 && version >= 7);\n\t\t\n\t\t//return ($.browser.msie && $.browser.version <= 9 && window.XDomainRequest);\n\t}", "title": "" }, { "docid": "9dd08fab2832d4c96d6a6496e0eed673", "score": "0.6967555", "text": "get ie9() {\n return isIE(9);\n }", "title": "" }, { "docid": "677aa9f28e2d8781d3eff09c17b2758d", "score": "0.68580246", "text": "function is_lt_ie9() {\n\tie_v = parseFloat(navigator.userAgent.match(/MSIE (\\d+\\.\\d+);/));\n\tif(ie_v && ie_v[1] < 9) { return true; } else { return false; };\n}", "title": "" }, { "docid": "dcb3a8814057a19f5ff81cc93d020c03", "score": "0.6834211", "text": "function patchMSIE() {\r\n\r\n }", "title": "" }, { "docid": "1a44a23db40d5c141279298ea8d160ed", "score": "0.6702816", "text": "function isIE8(){ \r\nreturn pDocument.getElementById(\"ie8\"); \r\n}", "title": "" }, { "docid": "608598a1ac132fa128b43743c58c26b6", "score": "0.6689359", "text": "function isIE8() {\n if (window.attachEvent && !window.addEventListener) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "9cf1e0ff6440ddc7fd4d7bdb69e88d88", "score": "0.6531783", "text": "function isIE7OrIE8(){\n\tvar version = $.browser.version;\n\tvar idx7 = version.indexOf(\"7.\"); //e' = a 0 se la versione e' un 7.x\n\tvar idx8 = version.indexOf(\"8.\"); //e' = a 0 se la versione e' un 8.x\n\treturn (idx7 == 0 || idx8 == 0 );\n}", "title": "" }, { "docid": "25efbf82b4a0f9660a64b3cd5458c441", "score": "0.6493873", "text": "function nonResIE() {\n if (navigator.sayswho[0].match('MSIE') && navigator.sayswho[1].substring(0,1) < '9') {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "ba03d852276188c4848f0002b0f34beb", "score": "0.63906777", "text": "function ie() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) return true;else return false;\n}", "title": "" }, { "docid": "6d02ed54017e9ebd7a3f023529650b8a", "score": "0.6377287", "text": "function iecompattest(){\nreturn (document.compatMode && document.compatMode!=\"BackCompat\")? document.documentElement : document.body\n}", "title": "" }, { "docid": "cbd752301b41605164bbd54c999408eb", "score": "0.63751185", "text": "function IEFix(){\n\tif ($.browser.msie && $.browser.version == 7.0) {\n\t\t$('.b-form-holder select').closest('.b-form-line').find('label').addClass('m-label-for-select');\n\t\t$('.b-btn + .b-btn').addClass('m-ml');\n\t}\n}", "title": "" }, { "docid": "753cbb12952f799dc58dad4b0ab33ca0", "score": "0.6229552", "text": "isBrowserIE () {\n\t\treturn !!(document.documentMode && document.documentMode >= 9)\n\t}", "title": "" }, { "docid": "fc917289d55624d8d0e26719c3746f5f", "score": "0.6224928", "text": "function checkIE() {\n return !(msie > 0);\n}", "title": "" }, { "docid": "6849ff8d0b5fa8da51f1ff83462baa6b", "score": "0.62007254", "text": "function PieInIE(){\n\tif ($.browser.msie && $.browser.version <= 8.0) {\n\t\t$('.l-header .b-second-bar li.m-logged .b-flyout, .b-pagination li a, .b-contact-us .b-col2 .b-icon, .b-efficacy-chart .b-col, .l-header .b-second-bar li.m-contact-btn a, .b-btn, .b-manufacturing .b-icon').each(function() {\n\t\t\tPIE.detach(this);\n\t\t\tPIE.attach(this);\n\t\t});\n\t}\n}", "title": "" }, { "docid": "09d7f8f2e0258025bc337f58b6e060bd", "score": "0.61332244", "text": "function ___IE_global_fix___() { }", "title": "" }, { "docid": "26d5d01fefa4dda7eb0cfe4ddd1c247b", "score": "0.61118186", "text": "function msieversion() {\r\n var ua = window.navigator.userAgent;\r\n var msie = ua.indexOf(\"MSIE \");\r\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) { \r\n var ieVersion = parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie)));\r\n if (ieVersion === 9) {$('body').addClass('no-js ie' + ieVersion);}\r\n return ieVersion;\r\n }\r\n else { return false; }\r\n }", "title": "" }, { "docid": "50d9c43bdc41b03531c4d330c54b52ab", "score": "0.60704446", "text": "function msieversion() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\n var ieVersion = parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie)));\n if (ieVersion === 9) { $('body').addClass('no-js ie' + ieVersion); }\n return ieVersion;\n }\n else { return false; }\n }", "title": "" }, { "docid": "7c79038479f08e3ca53f72f53cbb1374", "score": "0.6040397", "text": "function isIE() {\n var myNav = navigator.userAgent.toLowerCase();\n return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;\n}", "title": "" }, { "docid": "d9410e2686d6ffdd0eda3ce159681b99", "score": "0.6030998", "text": "get ie() {\n return getInternetExplorerVersion() !== -1;\n }", "title": "" }, { "docid": "33d953755561cb9a70a33186afe84592", "score": "0.60235125", "text": "function isIE () {\n var myNav = navigator.userAgent.toLowerCase();\n return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;\n}", "title": "" }, { "docid": "a014984976011951eb20b05ea6369e0b", "score": "0.60194343", "text": "function isIE () {\n var myNav = navigator.userAgent.toLowerCase();\n return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1], 10) : false;\n }", "title": "" }, { "docid": "2de515d5010197d6bc4399f0306b6676", "score": "0.600236", "text": "function IsIE() \r\n{\r\n\t\r\n\tif (navigator.userAgent.indexOf('MSIE')>-1)\r\n\t\treturn true;\r\n\telse\r\n\t\treturn false;\r\n}", "title": "" }, { "docid": "3092d2a36c48eff11df773e2d98a6949", "score": "0.5975352", "text": "function isIE() {\r\n\treturn navigator.appName != \"Netscape\";\r\n}", "title": "" }, { "docid": "29b1ebe4670d87e7bd76e7e11c7c011d", "score": "0.5968318", "text": "function isBrowserIE() {\n\t if (window.navigator && window.navigator.userAgent) {\n\t var ua = window.navigator.userAgent;\n\t\n\t return ua.indexOf('Trident/7.0') > 0 || ua.indexOf('Trident/6.0') > 0;\n\t }\n\t\n\t return false;\n\t}", "title": "" }, { "docid": "eb24954dc0abdd76ad67683c9fd4fcd2", "score": "0.5961604", "text": "function msieversion()\n\t {\n\t var ua = window.navigator.userAgent\n\t var msie = ua.indexOf ( \"MSIE \" )\n\n\t if ( msie > 0 ) { // If Internet Explorer, return version number\n\t \tvar version = parseInt (ua.substring (msie+5, ua.indexOf (\".\", msie )));\n\t \tif(version <= 8){\n\t \t$('html').addClass(\"lt-ie9\");\n\t \t$('#FINRA_header, #FINRA_footer, #FINRA_responsive').css('font-size', '14px').addClass(\"finra_normalize_prefix\");\n\t \t$('#FINRA_header').append('<link rel=\"stylesheet\" href=\"/finra-theme.no-query.css\"/>');\n\n\n\t \t}\n\t return parseInt (ua.substring (msie+5, ua.indexOf (\".\", msie )))\n\t }\n\t else // If another browser, return 0\n\t return 0\n\t }", "title": "" }, { "docid": "c9239d6f259aadef0c521f4ddbca688d", "score": "0.59483665", "text": "function isIE() {\r\n var ua = window.navigator.userAgent;\r\n var msie = ua.indexOf(\"MSIE \");\r\n\r\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }", "title": "" }, { "docid": "d04d1871b31da43327f469c8f88e2adc", "score": "0.5943452", "text": "function isIE() {\n var myNav = navigator.userAgent.toLowerCase();\n return myNav.indexOf(\"msie\") != -1\n ? parseInt(myNav.split(\"msie\")[1], 10)\n : false;\n }", "title": "" }, { "docid": "eb1a0b72f1a2913f1c1c6653469cd6b8", "score": "0.59195244", "text": "function NiftyCheck()\n{\nif(!document.getElementById || !document.createElement)\n return(false);\nvar b=navigator.userAgent.toLowerCase();\nif(b.indexOf(\"msie 5\")>0 && b.indexOf(\"opera\")==-1)\n return(false);\nreturn(true);\n}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.58856195", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.58856195", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.58856195", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.58856195", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.58856195", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.58856195", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.58856195", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.58856195", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.58856195", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.58856195", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.58856195", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "0f7ceb5423adace2c2fb5dc072682be4", "score": "0.5870658", "text": "function isIE( version ) {\n return getInternetExplorerVersion() === version;\n}", "title": "" }, { "docid": "2c73b0cd17e3bfbb0b986e34e36069a3", "score": "0.5861358", "text": "function isIE() {\n var ua = window.navigator.userAgent;\n // MSIE: ie <= 10, Trident: ie 11+\n return ua.indexOf('Trident/') > 0 || ua.indexOf('MSIE ') > 0;\n}", "title": "" }, { "docid": "cf2ab5f24e2a7e57a507764681586836", "score": "0.58583283", "text": "function ieVersion() {\n if (navigator.appName == \"Microsoft Internet Explorer\") {\n if (navigator.appVersion.indexOf(\"MSIE 8.0\") > 0) { return 8; }\n else if (navigator.appVersion.indexOf(\"MSIE 7.0\") > 0) { return 7; }\n else if (navigator.appVersion.indexOf(\"MSIE 6.0\") > 0) { return 6; }\n } else { return 8; }\n}", "title": "" }, { "docid": "ad9642597dc9685a00dfe297a2a9728c", "score": "0.582267", "text": "function lessThanIE9(element) {\n\t\t\tvar fileName = element.val().split(/\\\\/).pop();\n\n\t\t\tif (!fileName == '') {\n\n\t\t\t\tvar fileExtension = fileName.split('.').pop().toLowerCase(),\n\t\t\t\t\textensions = element.data('extensions'),\n\t\t\t\t\tparent = element.parent(),\n\t\t\t\t\tuploadFeedback = parent.find('.customfile-feedback'),\n\t\t\t\t\tuploadButton = parent.find('.customfile-button'),\n\t\t\t\t\tprogressionBar = parent.find('.customfile-progress'),\n\t\t\t\t\tfileExtClass = 'customfile-ext-' + fileExtension;\n\n\t\t\t\tvar validExtension = fileExtValidation(extensions, [fileExtension]);\n\n\t\t\t\tif (validExtension) {\n\t\t\t\t\tuploadFeedback.text(fileName);\n\n\t\t\t\t\tdidValidate(uploadFeedback, uploadButton, fileExtClass);\n\n\t\t\t\t} else {\n\n\t\t\t\t\tdidNotValidate(element, uploadFeedback, uploadButton);\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "41f3ebd066dd18bb9fb4b86629e624ba", "score": "0.58156276", "text": "function isIE() {\n\t//Create var for userAgent\n\tuserAg = navigator.userAgent;\n\t//Create var to store return of index of strings\n\tvar is_ie = userAg.indexOf(\"MSIE \") > -1 || userAg.indexOf(\"Trident/\") > -1 || userAg.indexOf(\"Edge\") > -1;\n\t//return result\n\treturn is_ie;\n}", "title": "" }, { "docid": "04c8c833b9afa91a2a8bcf2ac808f816", "score": "0.5814825", "text": "function isIE() {\n var ua = navigator.userAgent;\n var is_ie = ua.indexOf(\"MSIE \") > -1 || ua.indexOf(\"Trident/\") > -1;\n\n return is_ie;\n}", "title": "" }, { "docid": "a9a8aad3e3d5a93c5af27f54faaf00b3", "score": "0.58119226", "text": "function isExplorer()\n{\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE\");\n\n if (msie > 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n}", "title": "" }, { "docid": "42b7710376ff578f010789cec5b0ccd7", "score": "0.5795958", "text": "static isIEorEdge() {\n return LuxUtil.isIE() || LuxUtil.isEdge();\n }", "title": "" }, { "docid": "be4ccfd0f0e7c8a803d6cbf9cc69516a", "score": "0.5771936", "text": "function initFixCompatibility() {\n (0, _ie11helper2.default)();\n}", "title": "" }, { "docid": "9acc93f0e5fe31e6a38eba9b140bbf73", "score": "0.57718396", "text": "function is_ie() {\n\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\n return true;\n }\n else {\n return false;\n }\n }", "title": "" }, { "docid": "6ab0de16ce268c57251ff718a4cfb48c", "score": "0.5770083", "text": "static isIE() {\n const msie = window.document['documentMode'];\n return msie && msie <= 11;\n }", "title": "" }, { "docid": "9a74be172f66219ea5d2ab71293d7a08", "score": "0.57423097", "text": "function isSupported()\r\n{\r\n\treturn (isIE || isMoz);\r\n}", "title": "" }, { "docid": "24fc3c7cd9f06636ca3e46b194e8acdd", "score": "0.57413286", "text": "function InitBrowserSettings() {\n if (/msie/.test(navigator.userAgent.toLowerCase())) { // Identify browser for IE9-IE10.\n document.onselectstart = function () { return false; };\n } else if (!!window.ActiveXObject || \"ActiveXObject\" in window) { // Identify browser for IE11.\n document.onselectstart = function () { return false; };\n }\n}", "title": "" }, { "docid": "657a6ea60bbb7557ee3502a1a6327a54", "score": "0.57395566", "text": "function isIE() {\n var ua = window.navigator.userAgent; //Check the userAgent property of the window.navigator object\n var msie = ua.indexOf('MSIE '); // IE 10 or older\n var trident = ua.indexOf('Trident/'); //IE 11\n\n return (msie > 0 || trident > 0);\n }", "title": "" }, { "docid": "2211943686f3e395bbdbf68cbe3b3e6a", "score": "0.5718534", "text": "function isInternetExplorer() {\n\t if (typeof navigator === 'undefined') {\n\t return false;\n\t }\n\t\n\t var rv = -1; // Return value assumes failure.\n\t var ua = navigator.userAgent;\n\t if (navigator.appName === 'Microsoft Internet Explorer') {\n\t var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n\t if (re.exec(ua) != null)\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t // IE > 11\n\t else if (ua.indexOf(\"Trident\") > -1) {\n\t var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n\t if (re.exec(ua) !== null) {\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t }\n\t\n\t return rv >= 8;\n\t }", "title": "" }, { "docid": "01725ab9ec4ee5ba2b6bf5dfb1602333", "score": "0.56781083", "text": "function isIE(version) {\n return getInternetExplorerVersion() === version;\n }", "title": "" }, { "docid": "8b205e0308ebe3bc711b997bbdbbeeff", "score": "0.5676731", "text": "function isInternetExplorer() {\n\t var rv = -1; // Return value assumes failure.\n\t var ua = navigator.userAgent;\n\t if (navigator.appName === 'Microsoft Internet Explorer') {\n\t var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n\t if (re.exec(ua) != null)\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t // IE > 11\n\t else if (ua.indexOf(\"Trident\") > -1) {\n\t var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n\t if (re.exec(ua) !== null) {\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t }\n\t\n\t return rv >= 8;\n\t }", "title": "" }, { "docid": "5aab2c26dbe38c15780440b11bb307eb", "score": "0.5670071", "text": "function msieversion() {\n\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\n //alert(parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie))));\n var retval = 1;\n }\n else {\n retval = '';\n }\n\n return retval;\n}", "title": "" }, { "docid": "58c5f7c8eb1ee55df0626b4ac0029b0f", "score": "0.5661578", "text": "function isIe() {\n\tvar ie\n\tif(typeof(Promise)==='undefined') {\n\t\tie = true\n\t} else {\n\t\tie = false\n\t}\n\treturn ie;\n}", "title": "" }, { "docid": "861233e9096a869ea272a865a2ee513a", "score": "0.56463116", "text": "function isIE () {\n // Check if IE/Edge using 'console.log(navigator.userAgent.toLowerCase())'\n return (ua.indexOf('msie') != -1 || ua.indexOf('trident') != -1 || ua.indexOf('edge') != -1) ? true : false;\n }", "title": "" }, { "docid": "51f57acd5162a848e53a734e05384443", "score": "0.5638144", "text": "function mlib_is_ie() {\n var myNav = navigator.userAgent.toLowerCase();\n return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : 1000;\n}", "title": "" }, { "docid": "db5137322cea48e852374ca3c11a76da", "score": "0.5637232", "text": "function ietruebody(){\nreturn (document.compatMode && document.compatMode!=\"BackCompat\")? document.documentElement : document.body\n}", "title": "" }, { "docid": "4545d33b89fb0d7548b12e583c5412fc", "score": "0.5604213", "text": "function IsInternetExplorer () {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) { // If Internet Explorer, return true\n return true;\n } else { // If another browser, return false\n return false;\n }\n}", "title": "" }, { "docid": "053dc7d1eca8ef5d81348c783f9b73c4", "score": "0.559814", "text": "function isInternetExplorer() {\n var rv = -1; // Return value assumes failure.\n var ua = navigator.userAgent;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n // IE > 11\n else if (ua.indexOf(\"Trident\") > -1) {\n var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n if (re.exec(ua) !== null) {\n rv = parseFloat(RegExp.$1);\n }\n }\n\n return rv >= 8;\n }", "title": "" }, { "docid": "d71e3e2e2b344ea1ee7d8b8a6d278526", "score": "0.55922335", "text": "function isIE( version, comparison ){\r\n\t\t var $div = jQuery('<div style=\"display:none;\"/>').appendTo(jQuery('body'));\r\n\t\t $div.html('<!--[if '+(comparison||'')+' IE '+(version||'')+']><a>&nbsp;</a><![endif]-->');\r\n\t\t var ieTest = $div.find('a').length;\r\n\t\t $div.remove();\r\n\t\t return ieTest;\r\n\t\t}", "title": "" }, { "docid": "50b2fc686474841757f9c16b490114cb", "score": "0.55850303", "text": "function isIE6() {\n return /msie|MSIE 6/.test(navigator.userAgent);\n}", "title": "" }, { "docid": "6f67218fe3342bce87d859f4f65d8eb1", "score": "0.55803746", "text": "function isInternetExplorer() {\n if (typeof navigator === 'undefined') {\n return false;\n }\n\n var rv = -1; // Return value assumes failure.\n var ua = navigator.userAgent;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n // IE > 11\n else if (ua.indexOf(\"Trident\") > -1) {\n var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n if (re.exec(ua) !== null) {\n rv = parseFloat(RegExp.$1);\n }\n }\n\n return rv >= 8;\n }", "title": "" }, { "docid": "6f67218fe3342bce87d859f4f65d8eb1", "score": "0.55803746", "text": "function isInternetExplorer() {\n if (typeof navigator === 'undefined') {\n return false;\n }\n\n var rv = -1; // Return value assumes failure.\n var ua = navigator.userAgent;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n // IE > 11\n else if (ua.indexOf(\"Trident\") > -1) {\n var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n if (re.exec(ua) !== null) {\n rv = parseFloat(RegExp.$1);\n }\n }\n\n return rv >= 8;\n }", "title": "" }, { "docid": "31bc7ebcb86e0cd2ccec0c2b44b31205", "score": "0.5579846", "text": "function isIE() {\n\t\tvar isNetscape = navigator.appName == 'Netscape';\n\t\tvar isTrident = new RegExp(\"Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})\").exec(navigator.userAgent) != null;\n\t\treturn ((navigator.appName == 'Microsoft Internet Explorer') || (isNetscape && isTrident));\n\t}", "title": "" }, { "docid": "2df7d3feaf9f39033ea743d6656cc76f", "score": "0.55766374", "text": "function isIE() {\n ua = navigator.userAgent;\n\n /* MSIE used to detect old browsers and Trident used to newer ones*/\n var is_ie = ua.indexOf(\"MSIE \") > -1 || ua.indexOf(\"Trident/\") > -1;\n\n return is_ie;\n }", "title": "" }, { "docid": "efbea42f85f2fbfff6c2769a38fe1561", "score": "0.55621237", "text": "function isIE() {\n for (var v = 3, el = document.createElement('b'), all = el.all || []; el.innerHTML = '<!--[if gt IE ' + (++v) + ']><i><![endif]-->', all[0];);\n return v > 4 ? v : !!document.documentMode;\n }", "title": "" }, { "docid": "402448850a7d2c521880e5e1652fec8c", "score": "0.55601966", "text": "function isIE6() {\n\t\treturn $.browser.msie && /msie 6\\.0/i.test(navigator.userAgent);\n\t} // isIE6", "title": "" }, { "docid": "c30af8e2c39febb0774b3a657919d00b", "score": "0.5559786", "text": "function isIe()\n// Returns the version of Windows Internet Explorer or a -1\n// (indicating the use of another browser).\n{\n\tvar rv = -1; // Return value assumes failure.\n\tif (navigator.appName == 'Microsoft Internet Explorer') { return true; }\n\treturn false;\n}", "title": "" }, { "docid": "3bf1787b441762dfdcf724f4d657bc35", "score": "0.555916", "text": "function browserCheck(){\n\t\tif(Globals.s.isIE === false || Globals.s.ieVersion >= 10){\n\t\t\ts.browserOk = true;\n\t\t}\n\t\telse{\n\t\t\ts.browserOk = false;\n\t\t}\n\t}", "title": "" }, { "docid": "00041206bfa21b850274241be03f085b", "score": "0.5547592", "text": "function fixIeBug(string) {\n\t\t\t\tif ($.browser.msie) {\n\t\t\t\t\treturn string.length - string.replace(/\\r/g, '').length;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}", "title": "" }, { "docid": "ee6d3913e9735540272a2ab053617422", "score": "0.5533861", "text": "function isIE( version, comparison ){\n\t\t var $div = jQuery('<div style=\"display:none;\"/>').appendTo(jQuery('body'));\n\t\t $div.html('<!--[if '+(comparison||'')+' IE '+(version||'')+']><a>&nbsp;</a><![endif]-->');\n\t\t var ieTest = $div.find('a').length;\n\t\t $div.remove();\n\t\t return ieTest;\n\t\t}", "title": "" }, { "docid": "19dfb02b2f0f4874072568075cb15de9", "score": "0.5518443", "text": "function usingIE() {\n return navigator.appVersion.match(/\\.NET/i) !== null;\n}", "title": "" }, { "docid": "587bf33a052b2e3174a3381e381d768a", "score": "0.55045223", "text": "function fixIeBug(string) {\n\t\t\t\tif (browser.msie) {\n\t\t\t\t\treturn string.length - string.replace(/\\r*/g, '').length;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}", "title": "" }, { "docid": "2635793ca2c5a6bf1a718134cadf50b5", "score": "0.55023104", "text": "function fixIeBug(string) {\n\t\t\t\tif ($.browser.msie) {\n\t\t\t\t\treturn string.length - string.replace(/\\r*/g, '').length;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}", "title": "" }, { "docid": "6f7e348aa5857c63259f6972bab6c358", "score": "0.54956174", "text": "function ie8SafePreventEvent(event) \n{\n (event.preventDefault) ? event.preventDefault() : event.returnValue = false;\n}", "title": "" }, { "docid": "31a61fd07a4ea33776983c2afc69f2c9", "score": "0.5464117", "text": "function isIE() {\n var s = navigator.userAgent.toLowerCase();\n console.log(s);\n //ie10 information:\n //mozilla/5.0 (compatible; msie 10.0; windows nt 6.2; trident/6.0)\n //ie11 information:\n //mozilla/5.0 (windows nt 6.1; trident/7.0; slcc2; .net clr 2.0.50727; .net clr 3.5.30729; .net clr 3.0.30729; media center pc 6.0; .net4.0c; .net4.0e; infopath.2; rv:11.0) like gecko\n var ie = s.match(/rv:([\\d.]+)/) || s.match(/msie ([\\d.]+)/);\n if (ie) {\n return ie[1];\n } else {\n return -1;\n }\n}", "title": "" }, { "docid": "076c31708531353861783e21ab61ee80", "score": "0.54590315", "text": "function ieFixes(override){\r\n\t\tvar ieClass = 'ie-';\r\n\t\tif(s.ieVersion === 99){\r\n\t\t\tieClass+='11+';\r\n\t\t}\r\n\t\telse if(s.ieVersion < 9){\r\n\t\t\tieClass+='old';\r\n\t\t}\r\n\t\telse{\r\n\t\t\tieClass+=s.ieVersion;\r\n\t\t}\r\n\t\t$('html').addClass(ieClass);\r\n\t\t\r\n\r\n\t\t/**********************************\r\n\t\tFix for IE9's css selector limit\r\n\r\n\t\tInfo\r\n\t\t\tIE9 has a per-file css selector limit of 4096. To deal with this, grunt makes a copy of the wc-styles.css file\r\n\t\t\tand breaks it into chunks that are smaller than that. Then we use this JS to link to those files in the \r\n\t\t\thead if the browser is IE9 or below.\r\n\r\n\t\tNotes\r\n\t\t[1]\t\tIf we ever need more files than 2 *shudder*, update this array with the new file names. \r\n\t\t[2] \tFirst check to see if the split CSS files are there\r\n\t\t[3] \t...if they are then remove the original css file\r\n\t\t[4] \t...and add the new ones.\r\n\t\t**********************************/\r\n\t\tif (s.ieVersion < 10 || override === true){\r\n\t\t\tvar ieCSSFiles = [\r\n\t\t\t\t'wc-style_part_1.css',/*[1]*/\r\n\t\t\t\t'wc-style_part_2.css'\r\n\t\t\t];\r\n\t\t\tcheckUrl(s.cssFolderPath + ieCSSFiles[1], function(m){/*[2]*/\r\n\t\t\t\tif(m === 'success'){\r\n\t\t\t\t\t$(mainCSSLink).remove(); /*[3]*/\r\n\t\t\t\t\tfor (var i = 0; i < ieCSSFiles.length; i++) {/*[4]*/\r\n\t\t\t\t\t\tvar path \t= s.cssFolderPath + ieCSSFiles[i];\r\n\t\t\t\t\t\tvar link \t= document.createElement('link');\r\n\t\t\t\t\t\tlink.rel \t= 'stylesheet';\r\n\t\t\t\t\t\tlink.type \t= 'text/css';\r\n\t\t\t\t\t\tlink.href \t= path;\r\n\t\t\t\t\t\tlink.media \t= 'all';\r\n\t\t\t\t\t\tdocument.getElementsByTagName('head')[0].appendChild(link);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "076c31708531353861783e21ab61ee80", "score": "0.54590315", "text": "function ieFixes(override){\r\n\t\tvar ieClass = 'ie-';\r\n\t\tif(s.ieVersion === 99){\r\n\t\t\tieClass+='11+';\r\n\t\t}\r\n\t\telse if(s.ieVersion < 9){\r\n\t\t\tieClass+='old';\r\n\t\t}\r\n\t\telse{\r\n\t\t\tieClass+=s.ieVersion;\r\n\t\t}\r\n\t\t$('html').addClass(ieClass);\r\n\t\t\r\n\r\n\t\t/**********************************\r\n\t\tFix for IE9's css selector limit\r\n\r\n\t\tInfo\r\n\t\t\tIE9 has a per-file css selector limit of 4096. To deal with this, grunt makes a copy of the wc-styles.css file\r\n\t\t\tand breaks it into chunks that are smaller than that. Then we use this JS to link to those files in the \r\n\t\t\thead if the browser is IE9 or below.\r\n\r\n\t\tNotes\r\n\t\t[1]\t\tIf we ever need more files than 2 *shudder*, update this array with the new file names. \r\n\t\t[2] \tFirst check to see if the split CSS files are there\r\n\t\t[3] \t...if they are then remove the original css file\r\n\t\t[4] \t...and add the new ones.\r\n\t\t**********************************/\r\n\t\tif (s.ieVersion < 10 || override === true){\r\n\t\t\tvar ieCSSFiles = [\r\n\t\t\t\t'wc-style_part_1.css',/*[1]*/\r\n\t\t\t\t'wc-style_part_2.css'\r\n\t\t\t];\r\n\t\t\tcheckUrl(s.cssFolderPath + ieCSSFiles[1], function(m){/*[2]*/\r\n\t\t\t\tif(m === 'success'){\r\n\t\t\t\t\t$(mainCSSLink).remove(); /*[3]*/\r\n\t\t\t\t\tfor (var i = 0; i < ieCSSFiles.length; i++) {/*[4]*/\r\n\t\t\t\t\t\tvar path \t= s.cssFolderPath + ieCSSFiles[i];\r\n\t\t\t\t\t\tvar link \t= document.createElement('link');\r\n\t\t\t\t\t\tlink.rel \t= 'stylesheet';\r\n\t\t\t\t\t\tlink.type \t= 'text/css';\r\n\t\t\t\t\t\tlink.href \t= path;\r\n\t\t\t\t\t\tlink.media \t= 'all';\r\n\t\t\t\t\t\tdocument.getElementsByTagName('head')[0].appendChild(link);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "001b16ca1efd64c8cf0d7bad88c83e2d", "score": "0.54462504", "text": "function ieimgposition(nextsh,opt) {\r\n\r\n\t\t\tif (isIE(8)) {\r\n\t\t\t\t\tvar ie8img = nextsh.find('.ieeightfallbackimage');\r\n\t\t\t\t\tif (opt.startwidth/opt.startheight <nextsh.data('owidth')/nextsh.data('oheight'))\r\n\t\t\t\t\t\tie8img.css({width:\"auto\",height:\"100%\"})\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tie8img.css({width:\"100%\",height:\"auto\"})\r\n\r\n\r\n\r\n\t\t\t\t\tvar ie8w = ie8img.width(),\r\n\t\t\t\t\t ie8h = ie8img.height();\r\n\r\n\t\t\t\t\tif (nextsh.data('bgposition')==\"center center\")\r\n\t\t\t\t\t\tie8img.css({position:\"absolute\",top:opt.height/2 - ie8h/2+\"px\", left:opt.width/2-ie8w/2+\"px\"});\r\n\r\n\t\t\t\t\tif (nextsh.data('bgposition')==\"center top\" || nextsh.data('bgposition')==\"top center\")\r\n\t\t\t\t\t\tie8img.css({position:\"absolute\",top:\"0px\", left:opt.width/2-ie8w/2+\"px\"});\r\n\r\n\t\t\t\t\tif (nextsh.data('bgposition')==\"center bottom\" || nextsh.data('bgposition')==\"bottom center\")\r\n\t\t\t\t\t\tie8img.css({position:\"absolute\",bottom:\"0px\", left:opt.width/2-ie8w/2+\"px\"});\r\n\r\n\r\n\t\t\t\t\tif (nextsh.data('bgposition')==\"right top\" || nextsh.data('bgposition')==\"top right\")\r\n\t\t\t\t\t\tie8img.css({position:\"absolute\",top:\"0px\", right:\"0px\"});\r\n\r\n\t\t\t\t\tif (nextsh.data('bgposition')==\"right bottom\" || nextsh.data('bgposition')==\"bottom right\")\r\n\t\t\t\t\t\tie8img.css({position:\"absolute\",bottom:\"0px\", right:\"0px\"});\r\n\r\n\t\t\t\t\tif (nextsh.data('bgposition')==\"right center\" || nextsh.data('bgposition')==\"center right\")\r\n\t\t\t\t\t\tie8img.css({position:\"absolute\",top:opt.height/2 - ie8h/2+\"px\", right:\"0px\"});\r\n\r\n\t\t\t\t\tif (nextsh.data('bgposition')==\"left bottom\" || nextsh.data('bgposition')==\"bottom left\")\r\n\t\t\t\t\t\tie8img.css({position:\"absolute\",bottom:\"0px\", left:\"0px\"});\r\n\r\n\t\t\t\t\tif (nextsh.data('bgposition')==\"left center\" || nextsh.data('bgposition')==\"center left\")\r\n\t\t\t\t\t\tie8img.css({position:\"absolute\",top:opt.height/2 - ie8h/2+\"px\", left:\"0px\"});\r\n\t\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "71c44777b5ca40c1205387e13fef4cf0", "score": "0.54429466", "text": "function ieimgposition(nextsh,opt) {\n\n\t\t\tif (isIE(8)) {\n\t\t\t\t\tvar ie8img = nextsh.find('.ieeightfallbackimage');\n\t\t\t\t\tif (opt.startwidth/opt.startheight <nextsh.data('owidth')/nextsh.data('oheight'))\n\t\t\t\t\t\tie8img.css({width:\"auto\",height:\"100%\"})\n\t\t\t\t\telse\n\t\t\t\t\t\tie8img.css({width:\"100%\",height:\"auto\"})\n\n\n\n\t\t\t\t\tvar ie8w = ie8img.width(),\n\t\t\t\t\t ie8h = ie8img.height();\n\n\t\t\t\t\tif (nextsh.data('bgposition')==\"center center\")\n\t\t\t\t\t\tie8img.css({position:\"absolute\",top:opt.height/2 - ie8h/2+\"px\", left:opt.width/2-ie8w/2+\"px\"});\n\n\t\t\t\t\tif (nextsh.data('bgposition')==\"center top\" || nextsh.data('bgposition')==\"top center\")\n\t\t\t\t\t\tie8img.css({position:\"absolute\",top:\"0px\", left:opt.width/2-ie8w/2+\"px\"});\n\n\t\t\t\t\tif (nextsh.data('bgposition')==\"center bottom\" || nextsh.data('bgposition')==\"bottom center\")\n\t\t\t\t\t\tie8img.css({position:\"absolute\",bottom:\"0px\", left:opt.width/2-ie8w/2+\"px\"});\n\n\n\t\t\t\t\tif (nextsh.data('bgposition')==\"right top\" || nextsh.data('bgposition')==\"top right\")\n\t\t\t\t\t\tie8img.css({position:\"absolute\",top:\"0px\", right:\"0px\"});\n\n\t\t\t\t\tif (nextsh.data('bgposition')==\"right bottom\" || nextsh.data('bgposition')==\"bottom right\")\n\t\t\t\t\t\tie8img.css({position:\"absolute\",bottom:\"0px\", right:\"0px\"});\n\n\t\t\t\t\tif (nextsh.data('bgposition')==\"right center\" || nextsh.data('bgposition')==\"center right\")\n\t\t\t\t\t\tie8img.css({position:\"absolute\",top:opt.height/2 - ie8h/2+\"px\", right:\"0px\"});\n\n\t\t\t\t\tif (nextsh.data('bgposition')==\"left bottom\" || nextsh.data('bgposition')==\"bottom left\")\n\t\t\t\t\t\tie8img.css({position:\"absolute\",bottom:\"0px\", left:\"0px\"});\n\n\t\t\t\t\tif (nextsh.data('bgposition')==\"left center\" || nextsh.data('bgposition')==\"center left\")\n\t\t\t\t\t\tie8img.css({position:\"absolute\",top:opt.height/2 - ie8h/2+\"px\", left:\"0px\"});\n\t\t\t\t}\n\t\t}", "title": "" }, { "docid": "9c23bad8cd0d447bb2c9ec763dbd1dd1", "score": "0.5429612", "text": "function ieimgposition(nextsh,opt) {\n\n if (isIE(8)) {\n var ie8img = nextsh.find('.ieeightfallbackimage');\n if (opt.startwidth/opt.startheight <nextsh.data('owidth')/nextsh.data('oheight'))\n ie8img.css({width:\"auto\",height:\"100%\"})\n else\n ie8img.css({width:\"100%\",height:\"auto\"})\n\n\n\n var ie8w = ie8img.width(),\n ie8h = ie8img.height();\n\n if (nextsh.data('bgposition')==\"center center\")\n ie8img.css({position:\"absolute\",top:opt.height/2 - ie8h/2+\"px\", left:opt.width/2-ie8w/2+\"px\"});\n\n if (nextsh.data('bgposition')==\"center top\" || nextsh.data('bgposition')==\"top center\")\n ie8img.css({position:\"absolute\",top:\"0px\", left:opt.width/2-ie8w/2+\"px\"});\n\n if (nextsh.data('bgposition')==\"center bottom\" || nextsh.data('bgposition')==\"bottom center\")\n ie8img.css({position:\"absolute\",bottom:\"0px\", left:opt.width/2-ie8w/2+\"px\"});\n\n\n if (nextsh.data('bgposition')==\"right top\" || nextsh.data('bgposition')==\"top right\")\n ie8img.css({position:\"absolute\",top:\"0px\", right:\"0px\"});\n\n if (nextsh.data('bgposition')==\"right bottom\" || nextsh.data('bgposition')==\"bottom right\")\n ie8img.css({position:\"absolute\",bottom:\"0px\", right:\"0px\"});\n\n if (nextsh.data('bgposition')==\"right center\" || nextsh.data('bgposition')==\"center right\")\n ie8img.css({position:\"absolute\",top:opt.height/2 - ie8h/2+\"px\", right:\"0px\"});\n\n if (nextsh.data('bgposition')==\"left bottom\" || nextsh.data('bgposition')==\"bottom left\")\n ie8img.css({position:\"absolute\",bottom:\"0px\", left:\"0px\"});\n\n if (nextsh.data('bgposition')==\"left center\" || nextsh.data('bgposition')==\"center left\")\n ie8img.css({position:\"absolute\",top:opt.height/2 - ie8h/2+\"px\", left:\"0px\"});\n }\n }", "title": "" }, { "docid": "d314f840e0381e31cb5dfe1d305d5f76", "score": "0.5418099", "text": "function browserDetect(){\r\n\t\tvar ua = window.navigator.userAgent;\r\n\t\ts.isFirefox = ua.toLowerCase().indexOf('firefox') > -1; /*[1]*/\r\n\t\tif (s.isFirefox){\r\n\t\t\t$('html').addClass('firefox');\r\n\t\t}\r\n\r\n\t\tvar msIEIndex \t\t= ua.toLowerCase().indexOf(\"msie\");\r\n\t\tvar tridentIndex \t= ua.toLowerCase().indexOf(\"trident\");\r\n\t\tif (msIEIndex > -1 || tridentIndex > -1){\r\n\t\t\ts.isIE = true;\r\n\t\t\t$('html').addClass('ie-yes');\r\n\t\t\tif (msIEIndex > -1){\r\n\t\t\t\ts.ieVersion = parseInt(ua.substring(msIEIndex + 5, ua.indexOf(\".\", msIEIndex)));\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\ts.ieVersion = 99;\r\n\t\t\t}\r\n\t\t\tieFixes();\r\n\t\t}\r\n\t\telse{\r\n\t\t\ts.isIE = false;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "d314f840e0381e31cb5dfe1d305d5f76", "score": "0.5418099", "text": "function browserDetect(){\r\n\t\tvar ua = window.navigator.userAgent;\r\n\t\ts.isFirefox = ua.toLowerCase().indexOf('firefox') > -1; /*[1]*/\r\n\t\tif (s.isFirefox){\r\n\t\t\t$('html').addClass('firefox');\r\n\t\t}\r\n\r\n\t\tvar msIEIndex \t\t= ua.toLowerCase().indexOf(\"msie\");\r\n\t\tvar tridentIndex \t= ua.toLowerCase().indexOf(\"trident\");\r\n\t\tif (msIEIndex > -1 || tridentIndex > -1){\r\n\t\t\ts.isIE = true;\r\n\t\t\t$('html').addClass('ie-yes');\r\n\t\t\tif (msIEIndex > -1){\r\n\t\t\t\ts.ieVersion = parseInt(ua.substring(msIEIndex + 5, ua.indexOf(\".\", msIEIndex)));\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\ts.ieVersion = 99;\r\n\t\t\t}\r\n\t\t\tieFixes();\r\n\t\t}\r\n\t\telse{\r\n\t\t\ts.isIE = false;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "f2438fdb3a4cd76dab1f2f3fcf1800c7", "score": "0.54125375", "text": "function MSIEVersion() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n\n if (msie > 0) // If Internet Explorer, return version number\n //alert(parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie))));\n return true;\n else // If another browser, return 0\n return false;\n\n //return false;\n}", "title": "" }, { "docid": "ab0eaea1aaa528160deb92d35b3856d4", "score": "0.54122365", "text": "function m(){return-1===window.navigator.userAgent.indexOf(\"Trident\")}", "title": "" }, { "docid": "4e1b55e93a8658a120bc43cc7443a926", "score": "0.53990734", "text": "function browserDetection() {\n \n // Determine the browser type\n // Browser Types:\n // 0 - Not supported\n // 1 - Netscape Communicator 4.x\n // 2 - IE\n // 3 - Opera\n // 4 - NS6\n\n\nvar thebrowser;\n\nvar foropera = window.navigator.userAgent.toLowerCase();\n//alert(foropera);\n\nvar itsopera = foropera.indexOf(\"opera\",0) + 1;\nvar itsgecko = foropera.indexOf(\"gecko\",0) + 1;\nvar itsmozillacompat = foropera.indexOf(\"mozilla\",0) + 1;\nvar itsmsie = foropera.indexOf(\"msie\",0) + 1;\n\n\n\n if (itsopera > 0){\n /******* Identify Opera as IE for static tree to show up *****/\n //thebrowser = 2\n thebrowser = 3;\n //alert(\"its opera\");\n //isNav4 = true\n document.all = document.getElementsByTagName(\"*\")\n\n }\n\n\n if (itsmozillacompat > 0){ \n //alert(\"its mozilla compatible\");\n if (itsgecko > 0) {\n thebrowser = 4\n // alert(\"its gecko\");\n //isNav4 = true\n document.all = document.getElementsByTagName(\"*\")\n\n \n }\n else if (itsmsie > 0) {\n // alert(\"its msie\");\n thebrowser = 2\n //isIE = true\n }\n else {\n // alert(\"its ns4.x\")\n thebrowser = 1\n // isNav4 = true\n }\n } \n\n\nreturn thebrowser;\n\n}", "title": "" }, { "docid": "91f068580bf502a31924764f2b369a60", "score": "0.5396355", "text": "function isThisIE() {\n // Pre-version 11, this was sufficient.\n if (Prototype.Browser.IE) { return true; }\n\n var ua = navigator.userAgent;\n\n // With IE 11, the string 'Trident' appears in this.\n if (ua.indexOf('Trident') > 0) { return true; }\n\n // With Microsoft Edge...\n if (ua.indexOf('Edge') > 0) { return true; }\n\n // Safari... oddly enough, the userAgent for Chrome includes 'Safari'\n if ((ua.indexOf('Safari') > 0)\n && (ua.indexOf('Chrome') < 0)) { return true; }\n\n return false;\n}", "title": "" }, { "docid": "57e0956f686496c1d7da22314d6fd428", "score": "0.53905964", "text": "function browserCheck()\n{\nvar check=navigator.appName;\nif (check==\"Microsoft Internet Explorer\")\n{\nbrowserInfo=\"bad\";\n}\n}", "title": "" }, { "docid": "c6e6d16d4975d4548ff6a14569d199b9", "score": "0.5390306", "text": "function hasTransparentBug(browser) {\n return ~[\"ie 8\", \"ie 9\"].indexOf(browser);\n}", "title": "" }, { "docid": "3ae32a6369487cbb1f94d7dea5693a2d", "score": "0.53848743", "text": "function setCompatibility()\n {\n if (typeof String.prototype.trim !== 'function') {\n String.prototype.trim = function() {\n return this.replace(/^\\s+|\\s+$/g, '');\n }\n }\n\n if (typeof document.hasFocus !== 'function') {\n // Opera lacks hasFocus support. Simply default to true.\n document.hasFocus = function() {\n return true;\n }\n }\n }", "title": "" }, { "docid": "17bd114deacdbec983a11e98fcf8265a", "score": "0.5384539", "text": "function ie6Ptach(containerVal) {\n if (IEVersion <= 7) {\n var iframes = containerVal.getElementsByTagName(\"iframe\");\n if (iframes != null && iframes.length > 0) {\n return;\n }\n var ieMat = document.createElement(\"iframe\");\n if (document.location.protocol == \"https:\") {\n ieMat.src = \"/images/spacer.gif\";\n } else if (window.opera != \"undefined\") {\n ieMat.src = \"\";\n } else {\n ieMat.src = \"javascript:false\";\n }\n ieMat.scrolling = \"no\";\n ieMat.frameBorder = \"0\";\n ieMat.style.width = containerVal.offsetWidth + \"px\";\n ieMat.style.height = containerVal.offsetHeight + \"px\";\n ieMat.style.zIndex = \"-1\";\n containerVal.insertBefore(ieMat, containerVal.childNodes[0]);\n containerVal.style.zIndex = \"100\";\n }\n}", "title": "" }, { "docid": "55e7b27e88e92567331928e67164fb12", "score": "0.5379555", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf(\"MSIE \");\n if (msie > 0) {\n return parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie)), 10);\n }\n\n var trident = ua.indexOf(\"Trident/\");\n if (trident > 0) {\n var rv = ua.indexOf(\"rv:\");\n return parseInt(ua.substring(rv + 3, ua.indexOf(\".\", rv)), 10);\n }\n\n var edge = ua.indexOf(\"Edge/\");\n if (edge > 0) {\n return parseInt(ua.substring(edge + 5, ua.indexOf(\".\", edge)), 10);\n }\n\n return false;\n }", "title": "" }, { "docid": "2c5a31320d4ffe0f8f592ca38ba7e6ea", "score": "0.53760356", "text": "function detectIE() {\n\t\tvar ua = window.navigator.userAgent;\n\t\tvar msie = ua.indexOf('MSIE ');\n\t\tif (msie > 0) {\n\t\t\t// IE 10 or older => return version number\n\t\t\treturn parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n\t\t}\n\t\tvar trident = ua.indexOf('Trident/');\n\t\tif (trident > 0) {\n\t\t\t// IE 11 => return version number\n\t\t\tvar rv = ua.indexOf('rv:');\n\t\t\treturn parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n\t\t}\n\t\tvar edge = ua.indexOf('Edge/');\n\t\tif (edge > 0) {\n\t\t // IE 12 => return version number\n\t\t return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n\t\t}\n\t\t// other browser\n\t\treturn false;\n\t}", "title": "" }, { "docid": "fd1ee68a9068da6e769542f9779e1906", "score": "0.53739357", "text": "function isEDGE(){\n return /Edge\\/\\d./i.test(navigator.userAgent)\n }", "title": "" }, { "docid": "7aeccdc52d02192e5135a752f9a6f6a3", "score": "0.53739107", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n return false;\n}", "title": "" }, { "docid": "7aeccdc52d02192e5135a752f9a6f6a3", "score": "0.53739107", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n return false;\n}", "title": "" }, { "docid": "21d97a6bb5a3c1f9c6118402b724feef", "score": "0.53725725", "text": "function clickreturnvalue(){\nif (ie4||ns6) return false\nelse return true\n}", "title": "" } ]
197d7f16daaffd456012310f5598f214
Creates a new Node with `attributes`, resolving with the new record
[ { "docid": "b09e88ffa5f1fa8ead95edd57b2b1176", "score": "0.6254221", "text": "create(attributes) {\n return new Promise((resolve, reject) => {\n // Add the new record to the IDB store, then resolve with the newly\n // allocated localId on the record\n this.objectStore.put(attributes)\n .then(localId => {\n attributes.localId = localId;\n resolve(attributes);\n })\n .catch(reject);\n });\n }", "title": "" } ]
[ { "docid": "795d0183456139f8cfda0754c39c5c94", "score": "0.59545773", "text": "function newTag() //E Create a new node\n {const parameters = Array.from(arguments);\n const tag = parameters.shift(); // Tag for new node\n\n return objectifyTree({\"tag\": tag, \"contents\":[], \"attributes\":{}});\n }", "title": "" }, { "docid": "4e3054c0952e61600b9f8e5e35de15d0", "score": "0.58274657", "text": "create(attributes, relationships) {\n var _this = this;\n var headers = new Headers();\n var data = { data: { type: _this.type, attributes, relationships } };\n var body = JSON.stringify(data);\n var fetchOptions = { method: 'POST', body, headers };\n\n headers.append('Content-Type', 'application/json');\n\n return rest(`${_this.type}`, fetchOptions)\n .then(handleFetchResponse)\n .then(_this.buildFromJson.bind(_this))\n .catch(handleFetchError);\n }", "title": "" }, { "docid": "2af018b7db156e7cd5cb5d84c3fd8c0f", "score": "0.57145363", "text": "node(name, attributes, text) {\n var child;\n if (name != null) {\n name = name.valueOf();\n }\n attributes || (attributes = {});\n attributes = attributes.valueOf();\n // swap argument order: text <-> attributes\n if (!isObject(attributes)) {\n [text, attributes] = [attributes, text];\n }\n child = new XMLElement(this, name, attributes);\n if (text != null) {\n child.text(text);\n }\n this.children.push(child);\n return child;\n }", "title": "" }, { "docid": "6cf4e47377b76b254ebdbe371deab7f8", "score": "0.5674517", "text": "function unsafeAddNode(graph, node, attributes) {\n var data = new graph.NodeDataClass(node, attributes);\n\n graph._nodes.set(node, data);\n\n graph.emit('nodeAdded', {\n key: node,\n attributes: attributes\n });\n return data;\n }", "title": "" }, { "docid": "e916c30eeaf31ccfdc84222ecf710423", "score": "0.55973554", "text": "node(name, attributes, text) {\n var child;\n if (name != null) {\n name = getValue(name);\n }\n attributes || (attributes = {});\n attributes = getValue(attributes);\n // swap argument order: text <-> attributes\n if (!isObject(attributes)) {\n [text, attributes] = [attributes, text];\n }\n child = new XMLElement(this, name, attributes);\n if (text != null) {\n child.text(text);\n }\n this.children.push(child);\n return child;\n }", "title": "" }, { "docid": "75da759ad668a7521a88c79aaf5c5a48", "score": "0.55085915", "text": "create (scope) {\n return this.createNode(scope, this.creationArgs)\n }", "title": "" }, { "docid": "de402d718f29f3505208e522e375cf8a", "score": "0.5506842", "text": "function unsafeAddNode(graph, node, attributes) {\n const data = new graph.NodeDataClass(node, attributes);\n\n graph._nodes.set(node, data);\n\n graph.emit('nodeAdded', {\n key: node,\n attributes\n });\n\n return data;\n}", "title": "" }, { "docid": "2cd28657ab46720f5f79bd8c3b77c3af", "score": "0.54925936", "text": "function createNode(node, success, failure, headers) {\n\n\tmakeAuthenticatedRequest({\n\t\t\tservicePath : \"node\",\n\t\t\thttpMethod : \"POST\",\n\t\n\t\t\tparams : JSON.stringify({\n\t\t\t\tnode : node\n\t\t\t})\n\t\t}, function(response) {\n\t\t\tTi.API.trace(JSON.stringify(response));\n\t\t\tsuccess(response);\n\t\t}, function(response) {\n\t\t\tfailure(response);\n\t\t}, \n\t\theaders\n\t);\n}", "title": "" }, { "docid": "090e10340343c0f4ceb1b9ef5e3a1322", "score": "0.53931797", "text": "update(localId, updatedAttributes) {\n return new Promise((resolve, reject) => {\n // Lock the DB before performing the update so we don't have problems\n // with race conditions and lose data\n this.objectStore.db.transaction('readwrite', ['nodes'], (err, tx) => {\n const store = tx.objectStore('nodes');\n\n // Fetch the existing record\n store.get(localId).onsuccess = (evt) => {\n let node = evt.target.result;\n\n // Apply the new attributes to the node\n Object.assign(node, updatedAttributes);\n\n // Save it\n store.put(node);\n\n // When we're done saving, resolve the promise with the new record\n tx.oncomplete = evt => resolve(evt.target.result);\n\n // Let the caller be aware of any errors during the transaction\n tx.onerror = reject;\n };\n });\n });\n }", "title": "" }, { "docid": "d4785041c0ce0f4607b8ea9c04f2acc5", "score": "0.53454465", "text": "function reformNode(rawNode) {\n if (!rawNode || typeof rawNode !== 'object') { return rawNode }\n\n const copy = Object.assign({}, rawNode)\n\n if (copy.properties && copy.properties.id) {\n copy.id = copy.properties.id\n }\n\n const decodedProps = utils.decodeProps(copy.properties)\n delete copy.properties\n\n return Object.assign({}, copy, { data: decodedProps })\n }", "title": "" }, { "docid": "466a215c154e31eb091c3552aead1f6b", "score": "0.5304529", "text": "node(name, attributes, text) {\n if (name == null) {\n throw new Error(\"Missing node name\");\n }\n if (this.root && this.currentLevel === -1) {\n throw new Error(\"Document can only have one root node\");\n }\n this.openCurrent();\n name = name.valueOf();\n if (attributes == null) {\n attributes = {};\n }\n attributes = attributes.valueOf();\n // swap argument order: text <-> attributes\n if (!isObject(attributes)) {\n [text, attributes] = [attributes, text];\n }\n this.currentNode = new XMLElement(this, name, attributes);\n this.currentNode.children = false;\n this.currentLevel++;\n this.openTags[this.currentLevel] = this.currentNode;\n if (text != null) {\n this.text(text);\n }\n return this;\n }", "title": "" }, { "docid": "37947654410eb882ebfcee15a4a9eab4", "score": "0.53040445", "text": "constructor(attributes) {\n super(attributes);\n }", "title": "" }, { "docid": "f43af23f530e93523a0b0f7291401491", "score": "0.5285265", "text": "function createNode(id) {\n removeHighlight()\n id = id || 'new' + Math.round( Math.random() * 100 );\n cy.add({\n classes: 'node',\n data: { id: id},\n position: {\n x: realClickCoordsX,\n y: realClickCoordsY\n }\n });\n console.log(`Node created. Id: ${id}`);\n}", "title": "" }, { "docid": "f199906a3754253d96e3f3b379f2471e", "score": "0.5282673", "text": "node(name, attributes, text) {\n if (name == null) {\n throw new Error(\"Missing node name.\");\n }\n if (this.root && this.currentLevel === -1) {\n throw new Error(\"Document can only have one root node. \" + this.debugInfo(name));\n }\n this.openCurrent();\n name = getValue(name);\n if (attributes == null) {\n attributes = {};\n }\n attributes = getValue(attributes);\n // swap argument order: text <-> attributes\n if (!isObject(attributes)) {\n [text, attributes] = [attributes, text];\n }\n this.currentNode = new XMLElement(this, name, attributes);\n this.currentNode.children = false;\n this.currentLevel++;\n this.openTags[this.currentLevel] = this.currentNode;\n if (text != null) {\n this.text(text);\n }\n return this;\n }", "title": "" }, { "docid": "f199906a3754253d96e3f3b379f2471e", "score": "0.5282673", "text": "node(name, attributes, text) {\n if (name == null) {\n throw new Error(\"Missing node name.\");\n }\n if (this.root && this.currentLevel === -1) {\n throw new Error(\"Document can only have one root node. \" + this.debugInfo(name));\n }\n this.openCurrent();\n name = getValue(name);\n if (attributes == null) {\n attributes = {};\n }\n attributes = getValue(attributes);\n // swap argument order: text <-> attributes\n if (!isObject(attributes)) {\n [text, attributes] = [attributes, text];\n }\n this.currentNode = new XMLElement(this, name, attributes);\n this.currentNode.children = false;\n this.currentLevel++;\n this.openTags[this.currentLevel] = this.currentNode;\n if (text != null) {\n this.text(text);\n }\n return this;\n }", "title": "" }, { "docid": "adffddca9473761d85a8e37fdbe7bed2", "score": "0.528236", "text": "function Node(tag, attrs, children, text, parentNode) {\n this.tag = tag;\n this.text = text;\n this.attrs = attrs;\n this.children = children;\n this.parentNode = parentNode;\n\n // Capture a quick reference to a key if the Node has one.\n this.key = attrs.key;\n\n // Once the virtual node is built into a real node, we'll\n // store a reference to that node here so we never have to\n // find it again.\n this.node = null;\n }", "title": "" }, { "docid": "52f30ccaa2c88cd4c12bbf706facfb63", "score": "0.527473", "text": "function createNode(type, attributes, props, evls) {\r\n\r\n\tvar node = document.createElement(type);\r\n\r\n\tif (attributes) {\r\n\t\tfor (var attr in attributes) {\r\n\t\t\tif (attributes.hasOwnProperty(attr)) node.setAttribute(attr, attributes[attr]);\r\n\t\t}\r\n\t}\r\n\r\n\tif (props) {\r\n\t\tfor (var prop in props) {\r\n\t\t\tif ((props.hasOwnProperty(prop)) && (prop in node)) node[prop] = props[prop];\r\n\t\t}\r\n\t}\r\n\r\n\tif (Array.isArray(evls)) {\r\n\t\tevls.forEach(function(evl) {\r\n\t\t\tif (Array.isArray(evl)) node.addEventListener.apply(node, evl);\r\n\t\t});\r\n\t}\r\n\r\n\treturn node;\r\n\r\n}", "title": "" }, { "docid": "402829d3191666162f7c37854c43f685", "score": "0.5235628", "text": "function createAndAddAttribute(node, attributeName, attributeValue) {\n if (!node) {\n console.error('Node is null, cannot add attribute.');\n return;\n }\n\n if (!node.hasAttribute(attributeName)) {\n var attr = document.createAttribute(attributeName);\n attr.value = attributeValue;\n node.setAttributeNode(attr);\n }\n if (!!attributeValue) {\n node.setAttribute(attributeName, attributeValue);\n }\n}", "title": "" }, { "docid": "e00c4f97ff451eb8d81377719f89562b", "score": "0.52304095", "text": "function createNode(name, value) {\n Nodes.push({\n name,\n value,\n links: []\n });\n}", "title": "" }, { "docid": "c222667621438ffc958beab2ba7d999e", "score": "0.5227256", "text": "constructor (attributes = {}, options = {}) {\n this.isNew = !attributes[this.idAttribute]\n this.options = options\n\n this.attributes = attributes\n }", "title": "" }, { "docid": "b545ae9c918841bcf88259eb30f8b18c", "score": "0.5224004", "text": "createNewNode(data){\n const newNode = new node(data);\n return newNode;\n }", "title": "" }, { "docid": "4f37d8a8121d222b8b9af4c10dbdb0e0", "score": "0.5215291", "text": "creating(newObj, attr, options) { // eslint-disable-line\n }", "title": "" }, { "docid": "62b22debde55362e143c835c2995a2be", "score": "0.51921606", "text": "function createNode$$1(type, parent, subpath, environment, initialValue, createNewInstance, finalizeNewInstance) {\n if (createNewInstance === void 0) { createNewInstance = identity; }\n if (finalizeNewInstance === void 0) { finalizeNewInstance = noop; }\n if (isStateTreeNode$$1(initialValue)) {\n var targetNode = initialValue.$treenode;\n if (!targetNode.isRoot)\n fail(\"Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '\" + (parent\n ? parent.path\n : \"\") + \"/\" + subpath + \"', but it lives already at '\" + targetNode.path + \"'\");\n targetNode.setParent(parent, subpath);\n return targetNode;\n }\n var storedValue = createNewInstance(initialValue);\n if (type.shouldAttachNode) {\n var node = new ObjectNode$$1(type, parent, subpath, environment, initialValue, storedValue, type.shouldAttachNode, finalizeNewInstance);\n node.finalizeCreation();\n return node;\n }\n return new ScalarNode$$1(type, parent, subpath, environment, initialValue, storedValue, type.shouldAttachNode, finalizeNewInstance);\n}", "title": "" }, { "docid": "a178add1cd1e626eff375a3a0112c140", "score": "0.51624376", "text": "function newElement(tag, attributes, parent) {\n\tvar element = document.createElement(tag);\n\tif(attributes != undefined) {\n\t\tif(attributes.class != undefined) { attributes.className = attributes.class; attributes.class = undefined; }\n\t\tif(attributes.inner != undefined) { attributes.innerHTML = attributes.inner; attributes.inner = undefined; }\n\t\tfor(var key in attributes) {\n\t\t\telement[key] = attributes[key];\n\t\t}\n\t}\n\tif(parent != undefined) parent.appendChild(element);\n\treturn element;\n}", "title": "" }, { "docid": "178c83baf36ce4665ae027765a7fc19b", "score": "0.5154761", "text": "function createNode(text,el,nodeId){\n var node = document.createElement(el);\n //node.id = nodeId + String(tracking);\n node.id = nodeId;\n var line = document.createTextNode(text);\n node.appendChild(line);\n {debugger}\n return node;\n}", "title": "" }, { "docid": "f7813a92c9afe330096c4414099bf419", "score": "0.514533", "text": "constructor() {\n this.attributes = {};\n }", "title": "" }, { "docid": "a45d3febb337ad08917c8716d48f1e07", "score": "0.5129704", "text": "function createNode(vnode, children, element) {\n var type = vnode.type;\n var node = void 0;\n\n if (!element) {\n if (type === '#text') {\n vnode.element = document.createTextNode(vnode.props.nodeValue);\n return vnode;\n }\n\n node = vnode.element = (0, _createElement2.default)(type);\n } else {\n node = vnode.element = element;\n }\n\n (0, _foreach2.default)(function (child) {\n return node.appendChild(child.element);\n }, children);\n (0, _foreach2.default)(function (value, name) {\n return (0, _setAttribute2.default)(node, name, value);\n }, vnode.props);\n return vnode;\n}", "title": "" }, { "docid": "89512fe78b11b8090b86ac8913a41701", "score": "0.511946", "text": "function createAndAppend(typ, parent, attributes = {}) {\n const elem = document.createElement(typ);\n parent.appendChild(elem);\n for (const key in attributes) elem[key] = attributes[key]\n return elem\n}", "title": "" }, { "docid": "9208a3b8a3a8bb533762834a22bc0918", "score": "0.51174605", "text": "function createNode(transform, render, sibling, child){\n var node = {\n transform: transform,\n render: render,\n sibling: sibling,\n child: child,\n }\n return node;\n}", "title": "" }, { "docid": "b24b7a2900b74af275bd2943e184ac33", "score": "0.5105846", "text": "@action(constants.CREATE_NODE_SUCCESS)\n handleCreateNodeSuccess(payload) {\n logger.info('handleCreateNodeSuccess', { payload: payload });\n this.db.nodes.get(payload.localId).then((node) => {\n if (node.assignmentId) {\n this.flux.actions.persistNode(node.localId);\n }\n });\n }", "title": "" }, { "docid": "bf09f7a8b455d76bb192b2d06d570297", "score": "0.50962627", "text": "build(attributes) {\n attributes = attributes || {}\n\n // Strike displaced nodes from index, they should already have been deleted\n let changedKeys = Object.keys(attributes)\n let toDelete = this.getPathsToDelete(attributes)\n toDelete.forEach((path) => {\n delete this.i[path]\n })\n\n // Add new keys to index, write new\n changedKeys.forEach((path) => {\n \n // If this path does not yet have an index node, create one\n if (!this.i[path]) {\n this.i[path] = new IndexEntry(path)\n }\n this.i[path].size(u.getSize(attributes[path])) \n })\n \n // Add intermediate nodes, including the top level\n this.updateMetaNodes()\n this.loaded = true\n return this.i\n }", "title": "" }, { "docid": "ea6d5a19e40fdff1160cb719178be953", "score": "0.50863117", "text": "function createElement(tag, node, text, attr1, attrValue1, attr2, attrValue2, attr3, attrValue3, attr4, attrValue4) {\n\tlet element = document.createElement(tag);\n\tif (attr1 != undefined) {\n\t\telement.setAttribute(attr1, attrValue1);\n\t\tif (attr2 != undefined) {\n\t\t\telement.setAttribute(attr2, attrValue2);\n\t\t\tif (attr3 != undefined) {\n\t\t\t\telement.setAttribute(attr3, attrValue3);\n\t\t\t\tif (attr4 != undefined)\n\t\t\t\t\telement.setAttribute(attr4, attrValue4);\n\t\t\t}\n\t\t}\n\t}\n\tif (text != null) {\n\t\tlet string = document.createTextNode(text);\n\t\telement.appendChild(string);\n\t}\n\tnode.appendChild(element);\n\treturn element;\n}", "title": "" }, { "docid": "d057397ef2f21266f565c07c22f2e898", "score": "0.5084984", "text": "createNewNode(type, depth){\n\n let newNode;\n\n newNode = new Node(this.numNodes, type, depth);\n\n this.numNodes += 1;\n\n return newNode;\n }", "title": "" }, { "docid": "94f7b58525ae9c92def99c0d10bfde16", "score": "0.50826985", "text": "function addNode(prop, timestamp = new Date().toJSON()) {\n var query = `MERGE (a${filterize(prop)}) ON CREATE SET a={prop}, a.created_at=${JSON.stringify(timestamp)}, a.updated_at=${JSON.stringify(timestamp)} ON MATCH SET a += {prop}, a.updated_at=${JSON.stringify(timestamp)} RETURN a`\n return {\n query: query,\n params: { prop: prop }\n }\n}", "title": "" }, { "docid": "1cc456461bb3a5274c6dc7b4e89ff171", "score": "0.5071021", "text": "createPlainObject(name, id = undefined, attributes = {}) {\n return {\n attributes,\n childNodes: [],\n id,\n name,\n textLength: 0,\n };\n }", "title": "" }, { "docid": "b9517fe41ded9fd8988b7f4f8c982dda", "score": "0.5069636", "text": "function node (name, attr, event) {\n // create and add command\n var cmd = {node: name},\n attrDef = addToDefs('node', cmd);\n // set defaults and optional params\n if (/innerHTML|innerText|class/.test(attr)) {\n cmd.type = attr;\n }\n else {\n cmd.type = 'attribute';\n cmd.attribute = attr || currAttr;\n }\n if (event) {\n cmd.event = event;\n // record if this command is bidirectional\n attrDef.bidi = [].concat(attrDef.bidi, cmd);\n }\n // return fully-decorated chain\n return chainWithSubMethods;\n }", "title": "" }, { "docid": "e4563bdd1ac76d12bc2fc36d608c9319", "score": "0.50665414", "text": "function createNodeAndLink(data, fromnode) {\n var diagram = fromnode.diagram;\n var model = diagram.model;\n var nodedata = model.copyNodeData(data);\n model.addNodeData(nodedata);\n var newnode = diagram.findNodeForData(nodedata);\n var linkdata = model.copyLinkData({text:\"Relation\"}); //mujtabachang: Added default link text of \"relation\"\n model.setFromKeyForLinkData(linkdata, model.getKeyForNodeData(fromnode.data));\n model.setToKeyForLinkData(linkdata, model.getKeyForNodeData(newnode.data));\n model.addLinkData(linkdata);\n diagram.select(newnode);\n return newnode;\n }", "title": "" }, { "docid": "e37fdc6dca84ee82415c3c7f84065dd1", "score": "0.506605", "text": "function create(metadata, item) {\n var key = getKeyByValue(metadata, item);\n var nodeTree = [];\n\n var node = {\n key: key,\n siblings: [],\n parent: null\n };\n nodeTree.push(node);\n return parseMetadataToObject(metadata, key, nodeTree, node);\n }", "title": "" }, { "docid": "ee156e1b49a9f7cf42cd64fdb7bbd728", "score": "0.505584", "text": "async create(attributes) {\n let data = {};\n\n\n // add # before conditions string (`#` representing `intent`);\n if (attributes.conditions) {\n attributes.conditions = `#${attributes.conditions}`;\n }\n\n attributes.dialogNode = slugify(attributes.title);\n \n data.result = await this._createResource(attributes)\n\n data.result = this._mapAttributes(data.result);\n\n\n return data;\n }", "title": "" }, { "docid": "e1f19ddbe48b0f78244f1b784b181d6d", "score": "0.50534505", "text": "function create(contents) {\n // Using the current timestamp in place of a real id.\n var id = Date.now();\n _root[id] = {\n id: id,\n selector: '.foo',\n properties: {},\n contents: contents\n };\n}", "title": "" }, { "docid": "4e35662f0550386207aa5ec155c7a1fd", "score": "0.5051518", "text": "function hc_documentcreateattribute() {\n var success;\n var doc;\n var newAttrNode;\n var attrValue;\n var attrName;\n var attrType;\n doc = load(\"hc_staff\");\n newAttrNode = doc.createAttribute(\"title\");\n attrValue = newAttrNode.nodeValue;\n\n assertEquals(\"value\",\"\",attrValue);\n attrName = newAttrNode.nodeName;\n\n assertEqualsAutoCase(\"attribute\", \"name\",\"title\",attrName);\n attrType = newAttrNode.nodeType;\n\n assertEquals(\"type\",2,attrType);\n \n}", "title": "" }, { "docid": "cc7c1ff34e1a013b8690929e7f69c10a", "score": "0.5044747", "text": "function createNode () {\n const name = \"q\" + nodeCounter;\n nodeCounter++;\n return {name, transitions: [], targetOf: []};\n}", "title": "" }, { "docid": "824955529b4b241f058f4d3d1dcfbbd1", "score": "0.5025627", "text": "constructor(node) {\n this._node = node;\n }", "title": "" }, { "docid": "824955529b4b241f058f4d3d1dcfbbd1", "score": "0.5025627", "text": "constructor(node) {\n this._node = node;\n }", "title": "" }, { "docid": "824955529b4b241f058f4d3d1dcfbbd1", "score": "0.5025627", "text": "constructor(node) {\n this._node = node;\n }", "title": "" }, { "docid": "8a8accab6e13e0d8661ba80ebf172c0b", "score": "0.50223696", "text": "create ( props ) {\n props.slug = util.string.sluggify( props.name );\n props.fid = util.helper.generateId();\n\n var createQuery = [\n // Validate the Invitation\n 'MATCH (invite:FeisInvite {id: {id}})-[:FOR]->(account:Account {id:{account_id}})',\n 'WHERE ( invite.invalid IS NULL OR invite.invalid = 0 )',\n ' AND (invite.used IS NULL OR invite.used = 0 )',\n\n // Create the Feis\n 'CREATE invite<-[:FROM]-(feis:Feis {',\n ' name: { name },',\n ' slug: { slug },',\n ' tz: { tz },',\n ' is_public: 0,',\n ' id: {fid}',\n '})<-[:ON]-(:Grant { role: \"chair\" })-[:FOR]->account',\n 'SET invite.used = 1',\n \n // Return the feis\n 'RETURN feis as node'\n ];\n\n var copySyllabusQuery = [\n 'MATCH (feis:Feis {id:{fid}})',\n 'MATCH (:FeisTemplate {id:{tid}})<-[:OF]-(tpl:Event)',\n 'CREATE feis<-[:OF]-(event:Event)',\n 'SET event = tpl',\n 'SET event.id = event.id + \":\" + feis.id',\n \n // Return the feis\n 'RETURN feis as node'\n ];\n\n return this._db.queryOne( createQuery, props )\n .map( ( feis ) => {\n if ( props.template_id ) {\n return this._db.queryOne( copySyllabusQuery, { fid: props.fid, tid: props.template_id } )\n } else {\n return [ feis ];\n }\n })\n .flatten()\n .head();\n }", "title": "" }, { "docid": "8b2539686569033129a9aeb07c5225fa", "score": "0.5008572", "text": "function $makeNode(tag, className, attrs, children) {\n /* Allow omitting parameters */\n if (Array.isArray(className)) {\n if (! attrs && ! children) {\n children = className;\n attrs = null;\n className = null;\n }\n } else if (typeof className == 'object' && className != null) {\n if (! children) {\n children = attrs;\n attrs = className;\n className = null;\n }\n } else if (Array.isArray(attrs) || typeof attrs == 'string') {\n if (! children) {\n children = attrs;\n attrs = null;\n }\n }\n /* Create node */\n var ret = document.createElement(tag);\n /* Set classes */\n if (className) ret.className = className;\n /* Set additional attributes */\n if (attrs) {\n for (var name in attrs) {\n if (! attrs.hasOwnProperty(name)) continue;\n ret.setAttribute(name, attrs[name]);\n }\n }\n /* Add children */\n if (children) {\n if (typeof children == 'string') children = [children];\n for (var i = 0; i < children.length; i++) {\n var e = children[i];\n if (! e) {\n /* Allow conditional node omission */\n } else if (typeof e == 'string') {\n /* Strings become text nodes */\n ret.appendChild(document.createTextNode(e));\n } else if (typeof e != 'object') {\n /* Other primitive types are not allowed */\n throw new Error('Bad child encountered during DOM node creation');\n } else if (Array.isArray(e)) {\n /* Arrays are handled recursively */\n ret.appendChild($makeNode.apply(null, e));\n } else {\n /* Everything else is assumed to be a DOM node */\n ret.appendChild(e);\n }\n }\n }\n return ret;\n}", "title": "" }, { "docid": "e17566b82b944e6647e40f47a073bf37", "score": "0.5003522", "text": "addNode() {\n function randomArg(... args) {\n return args[Math.floor(Math.random() * args.length)];\n }\n\n const nodeData = {\n renderedPosition: { x: 60 + Math.round(Math.random() * 70), y: 60 + Math.round(Math.random() * 70) },\n data: {\n attr1: Math.random(), // betwen 0 and 1\n attr2: Math.random() * 2.0 - 1.0, // between -1 and 1\n attr3: randomArg(\"A\", \"B\", \"C\")\n }\n };\n const node = this.cy.add(nodeData);\n this.bus.emit('addNode', node);\n }", "title": "" }, { "docid": "f98a5a61242a1d4a2bed10d663c7097c", "score": "0.50012577", "text": "createNode(\n graphComponent,\n newName,\n newShort,\n newImgurl,\n newColor,\n posX,\n posY\n ) {\n // get cytoscape instance\n let cy = graphComponent.getCytoGraph();\n\n // get current id counter\n let count = cy.data(\"IDCount\");\n let doneonce = false;\n // add element\n cy.add({\n data: {\n id: parseInt(count),\n name: newName,\n short: newShort,\n imgUrl: newImgurl,\n color: newColor\n },\n style: {\n \"background-color\": \"#\" + newColor\n },\n position: { x: posX, y: posY }\n });\n\n let node = cy.getElementById(count);\n console.log(\"added node: \", node);\n\n node.addClass(\"nodelabel\");\n\n if (doneonce==false){\n // update position if conflict occurs\n this.moveNodesInConflict(graphComponent, node)\n doneonce=true;\n }\n // increment id counter\n count++;\n cy.data(\"IDCount\", count);\n }", "title": "" }, { "docid": "5f623230d5d39e301d7f77a08c6e68e2", "score": "0.5000144", "text": "openNode(type, attrs) {\n this.stack.push({type: type, attrs: attrs, content: []});\n }", "title": "" }, { "docid": "b33480948fe55c97798359053566edcc", "score": "0.49931282", "text": "function addNode(id, label, href)\n{\n\tvar newIndex = this.m_subNodes.length;\n\tvar newNode = new NavNode(id, label, href, this);\n\n\tvar argValues = addNode.arguments;\n\tvar argCount = addNode.arguments.length;\n\n\tfor (i = 3 ; i < argCount ; i++)\n\t{\n\t\tvar eqPos = argValues[i].indexOf(\"==\");\n\t\tvar attrName = argValues[i].substring(0,eqPos);\n\t\tvar attrValue = argValues[i].substring(eqPos+2);\n\n\t\teval(\"newNode.cp_\" + attrName + \" = '\" + attrValue + \"';\");\n\t}\n\n\tthis.m_subNodes[newIndex] = newNode;\n\treturn newNode;\n}", "title": "" }, { "docid": "ed730092c0f5f066aca0ecf5e814104d", "score": "0.4967696", "text": "function makeNode(dom_parent, tag_name, value_element) {\n dom_parent.append($(document.createElement('div')).addClass('node')\n .append($(document.createElement('div')).addClass('tag_name closed').html(tag_name))\n .append(value_element)\n );\n}", "title": "" }, { "docid": "bfb5dc2987f57f139d2c8c74758444da", "score": "0.49671948", "text": "injectAttributes() {\n\t const newAttributes = {};\n\n\t newAttributes[this.foreignKey] = _.defaults({}, this.foreignKeyAttribute, {\n\t type: this.options.keyType || this.target.rawAttributes[this.targetKey].type,\n\t allowNull: true\n\t });\n\n\t if (this.options.constraints !== false) {\n\t const source = this.source.rawAttributes[this.foreignKey] || newAttributes[this.foreignKey];\n\t this.options.onDelete = this.options.onDelete || (source.allowNull ? 'SET NULL' : 'NO ACTION');\n\t this.options.onUpdate = this.options.onUpdate || 'CASCADE';\n\t }\n\n\t Helpers.addForeignKeyConstraints(newAttributes[this.foreignKey], this.target, this.source, this.options, this.targetKeyField);\n\t Utils.mergeDefaults(this.source.rawAttributes, newAttributes);\n\n\t this.identifierField = this.source.rawAttributes[this.foreignKey].field || this.foreignKey;\n\n\t this.source.refreshAttributes();\n\n\t Helpers.checkNamingCollision(this);\n\n\t return this;\n\t }", "title": "" }, { "docid": "2ccc8941be2cd6e53058ed260f84ffee", "score": "0.4964904", "text": "function createNode(el, attr) {\n\t// html comment is not currently supported by virtual-dom\n\tif (el.nodeType === 3) {\n\t\treturn createVirtualTextNode(el);\n\n\t// cdata or doctype is not currently supported by virtual-dom\n\t} else if (el.nodeType === 1 || el.nodeType === 9) {\n\t\treturn createVirtualDomNode(el, attr);\n\t}\n\n\t// default to empty text node\n\treturn new VText('');\n}", "title": "" }, { "docid": "96bb2814134a015bb07b2cf7e6a24c1b", "score": "0.49552593", "text": "function makeNode(name, children = [], state = validResultValues.not_built, completePercent) {\n completePercent = completePercent || ((state == validResultValues.running) ? Math.floor(Math.random() * 60 + 20) : 50);\n const id = __id++;\n return {name, children, state, completePercent, id};\n}", "title": "" }, { "docid": "e4cba510cdfc00799210157f28e0b2d3", "score": "0.4947515", "text": "function Node() {}", "title": "" }, { "docid": "283d98ef56e44af5e3d01a4b2779f941", "score": "0.4938277", "text": "function makeNode(name, children = [], state = validResultValues.not_built, completePercent) {\n completePercent = completePercent || ((state == validResultValues.running) ? Math.floor(Math.random() * 60 + 20) : 50);\n const id = __id++;\n return { name, children, state, completePercent, id };\n}", "title": "" }, { "docid": "6153cda15c768bc366addeb23f39f15f", "score": "0.49375194", "text": "function factory(type, attributes, text) {\r\n const el = document.createElement(type);\r\n for (let key in attributes) {\r\n el.setAttribute(key, attributes[key]);\r\n }\r\n if (text) {\r\n el.textContent = text;\r\n }\r\n return el;\r\n }", "title": "" }, { "docid": "8babe7b178655054965416e790cd7e53", "score": "0.4921049", "text": "function createNodes(data_nodes) {\n\tvar node = {};\n\tfor (id in data_nodes) {\n\t\tnode[id] = db.createNode(data_nodes[id]); //this create the node\n\t\t//save into the DB\t\t\n\t\tnode[id].save();\n\t}\n\treturn node;\n}", "title": "" }, { "docid": "1590c90f57f0d33c3ebbf7c0f3f9ac58", "score": "0.49146238", "text": "function createNode(link, depth) {\n return {\n link,\n depth,\n children: []\n };\n}", "title": "" }, { "docid": "c2d22c6e6fb0e49409d9efb8eb8db0b3", "score": "0.49135214", "text": "createChildNode(node) {\n var att, attName, attributes, child, i, len, ref, ref1;\n switch (node.type) {\n case NodeType.CData:\n this.cdata(node.value);\n break;\n case NodeType.Comment:\n this.comment(node.value);\n break;\n case NodeType.Element:\n attributes = {};\n ref = node.attribs;\n for (attName in ref) {\n if (!hasProp.call(ref, attName)) continue;\n att = ref[attName];\n attributes[attName] = att.value;\n }\n this.node(node.name, attributes);\n break;\n case NodeType.Dummy:\n this.dummy();\n break;\n case NodeType.Raw:\n this.raw(node.value);\n break;\n case NodeType.Text:\n this.text(node.value);\n break;\n case NodeType.ProcessingInstruction:\n this.instruction(node.target, node.value);\n break;\n default:\n throw new Error(\"This XML node type is not supported in a JS object: \" + node.constructor.name);\n }\n ref1 = node.children;\n // write child nodes recursively\n for (i = 0, len = ref1.length; i < len; i++) {\n child = ref1[i];\n this.createChildNode(child);\n if (child.type === NodeType.Element) {\n this.up();\n }\n }\n return this;\n }", "title": "" }, { "docid": "c2d22c6e6fb0e49409d9efb8eb8db0b3", "score": "0.49135214", "text": "createChildNode(node) {\n var att, attName, attributes, child, i, len, ref, ref1;\n switch (node.type) {\n case NodeType.CData:\n this.cdata(node.value);\n break;\n case NodeType.Comment:\n this.comment(node.value);\n break;\n case NodeType.Element:\n attributes = {};\n ref = node.attribs;\n for (attName in ref) {\n if (!hasProp.call(ref, attName)) continue;\n att = ref[attName];\n attributes[attName] = att.value;\n }\n this.node(node.name, attributes);\n break;\n case NodeType.Dummy:\n this.dummy();\n break;\n case NodeType.Raw:\n this.raw(node.value);\n break;\n case NodeType.Text:\n this.text(node.value);\n break;\n case NodeType.ProcessingInstruction:\n this.instruction(node.target, node.value);\n break;\n default:\n throw new Error(\"This XML node type is not supported in a JS object: \" + node.constructor.name);\n }\n ref1 = node.children;\n // write child nodes recursively\n for (i = 0, len = ref1.length; i < len; i++) {\n child = ref1[i];\n this.createChildNode(child);\n if (child.type === NodeType.Element) {\n this.up();\n }\n }\n return this;\n }", "title": "" }, { "docid": "bf9f60a365e59e4f294fed5e4408370c", "score": "0.49118373", "text": "function newNode(locator, userId, label, details, language,\r\n largeImagePath, smallImagePath, isPrivate) {\r\n var result = {};\r\n if (null !== locator && '' !== locator) {\r\n result.lox = locator;\r\n }\r\n result.uId = userId;\r\n if (null !== language) {\r\n result.Lang = language;\r\n } else {\r\n result.Lang = 'en'; // default\r\n }\r\n //TODO MUST deal with language codes other than english\r\n // this means cloning the language2label system\r\n if (null !== label) {\r\n result.label = label;\r\n }\r\n //TODO same issue with language\r\n if (null !== details) {\r\n result.details = details;\r\n }\r\n if (null !== largeImagePath) {\r\n result.lIco = largeImagePath;\r\n }\r\n if (null !== smallImagePath) {\r\n result.sIco = smallImagePath;\r\n }\r\n var p = \"F\";\r\n if (isPrivate) {\r\n p = \"T\";\r\n }\r\n result.isPrv = p;\r\n console.log(\"NEWNODE \"+JSON.stringify(result));\r\n return result;\r\n }", "title": "" }, { "docid": "11d4f8e47fedc329e78e39ff0147d240", "score": "0.4901542", "text": "function createNode (tag, text, parent, id, clazz, value){\n\tvar newElement = document.createElement (tag);\n\tif (text) newElement.innerHTML = text;\n\tif (clazz) newElement.className = clazz;\n\tif (id) newElement.id = id;\n\tif (value) newElement.value = value;\n\tif (parent){\n\t\tparent.appendChild (newElement);\n\t\treturn parent.children [parent.children.length -1];\n\t}\n\telse return newElement;\n}", "title": "" }, { "docid": "30c5dbffc554f07f9f069f7e46a4aefc", "score": "0.48950875", "text": "createElement(type, attributes) {\n let element = document.createElement(type);\n // Sets the element attributes (if any).\n if(attributes !== undefined) {\n for(let key in attributes) {\n\t// Ensures that key is not a method/function.\n\tif(typeof attributes[key] !== 'function') {\n\t element.setAttribute(key, attributes[key]);\n\t}\n }\n }\n\n return element;\n }", "title": "" }, { "docid": "ca16903aa7fce8045c69a7fd4dac11ba", "score": "0.48950338", "text": "constructor(attributes = []) {\n this.attributes = attributes;\n }", "title": "" }, { "docid": "afe8f1333fed50c2a97c45c607710e16", "score": "0.48944798", "text": "function newNews(){\n\tfor (attr in allNewsAttributes){\n\t\tif (allNewsAttributes[attr]['caster']){\n\t\t\tcodeAttributes[allNewsAttributes[attr]['path']] = [];\n\t\t}\n\t\telse if (allNewsAttributes[attr]['path'] == 'date'){\n\t\t\tnewsAttributes['TimeStamp'] = {'isOpen':false, 'value':undefined};\n\t\t}\n\t\telse if (['_id', '__v'].indexOf(allNewsAttributes[attr]['path']) == -1){\n\t\t\tnewsAttributes[allNewsAttributes[attr]['path']] = {'isOpen':false, 'value':''};\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d5e4db87eda616f2c01df0073a958149", "score": "0.48928484", "text": "function createNode(name)\n {\n return {\n name: name,\n edges: [],\n module: {}\n };\n }", "title": "" }, { "docid": "a7ef606afc2d03afef944ebb1131728d", "score": "0.48908725", "text": "insert(value) {\n let node = new Node(value);\n }", "title": "" }, { "docid": "5ce0eb3fefbde4bd39027805ef7d309d", "score": "0.48879695", "text": "function Node(opts) {\n this.after = opts.after;\n this.before = opts.before;\n this.type = opts.type;\n this.value = opts.value;\n this.sourceIndex = opts.sourceIndex;\n }", "title": "" }, { "docid": "f923639f534f3c1c0f39226549c7514b", "score": "0.48827377", "text": "injectAttributes() {\n\t const newAttributes = {};\n\t const keyType = this.source.rawAttributes[this.source.primaryKeyAttribute].type;\n\n\t newAttributes[this.foreignKey] = _.defaults({}, this.foreignKeyAttribute, {\n\t type: this.options.keyType || keyType,\n\t allowNull: true\n\t });\n\t Utils.mergeDefaults(this.target.rawAttributes, newAttributes);\n\n\t this.identifierField = this.target.rawAttributes[this.foreignKey].field || this.foreignKey;\n\n\t if (this.options.constraints !== false) {\n\t const target = this.target.rawAttributes[this.foreignKey] || newAttributes[this.foreignKey];\n\t this.options.onDelete = this.options.onDelete || (target.allowNull ? 'SET NULL' : 'CASCADE');\n\t this.options.onUpdate = this.options.onUpdate || 'CASCADE';\n\t }\n\n\t Helpers.addForeignKeyConstraints(this.target.rawAttributes[this.foreignKey], this.source, this.target, this.options);\n\n\t // Sync attributes and setters/getters to Model prototype\n\t this.target.refreshAttributes();\n\n\t Helpers.checkNamingCollision(this);\n\n\t return this;\n\t }", "title": "" }, { "docid": "d47deb45305da2be85db9d984dff8035", "score": "0.4882098", "text": "function addNode() {\n // veryLastNodeId = lastCreatedNodeId;\n veryLastNodeId = \"1\"; //Family node\n nodeGenerated = generateBox();\n // createNode(nodeGenerated.node.type, nodeGenerated.node);\n\n createNode(\"Member\", nodeGenerated.node);\n\n if(veryLastNodeId != undefined) {\n edgeGenerated = \n { \"edge\" : {\n \"id\" : nodeGenerated.node.id + \"Edge\",\n \"type\" : \"default\",\n \"origin\" : veryLastNodeId,\n \"target\" : nodeGenerated.node.id,\n \"editorOptions\" : { \"movable\" : false,\"editable\" : false} \n }\n };\n createEdge(edgeGenerated.edge.type, edgeGenerated.edge);\n }\n}", "title": "" }, { "docid": "75fb0db60792fd296141c1ba6f90aeb3", "score": "0.48696604", "text": "static create(attributes) {\n // synchronous version\n // let product = new Product(attributes)\n // this.collection.push(product)\n // return product\n // asynchronous version with fetch \n return fetch(\"http://localhost:3000/products\", {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(attributes)\n })\n .then(response => response.json())\n .then(productAttributes => {\n let product = new Product(productAttributes)\n this.collection.push(product)\n return product\n })\n }", "title": "" }, { "docid": "f8933dba92ab8be2f42a765ffe1a1d2c", "score": "0.48681355", "text": "async create (modelName, newContents, creator, parent) {\n const bare = Object.assign(Object.assign({}, newContents), {\n creator,\n createdOn: new Date(),\n acl: {}, // TODO: add initial\n parent\n })\n\n const out = Pandemonica(bare, abs, await resolveModel(modelName))\n await out.save()\n return out\n }", "title": "" }, { "docid": "fe2c9c2410fb8188005c7cb0291b9343", "score": "0.48622322", "text": "connectNode(node, command, args) {\n node.setAttribute(`data-${COMMAND_ATTR}`, command);\n if (args !== void 0) {\n node.setAttribute(`data-${ARGS_ATTR}`, JSON.stringify(args));\n }\n return node;\n }", "title": "" }, { "docid": "ce9fd373992fc269ffc10a85f488aee9", "score": "0.4856173", "text": "function new_article_category_tree_node(){\n return {\n id:[],\n tag:{},\n children: {},\n }\n}", "title": "" }, { "docid": "f3dc7b54e128c3abc857623289a090e3", "score": "0.4855798", "text": "function NodeWrapper() {\n this._node = this.constructor.createNode();\n }", "title": "" }, { "docid": "014ba3258148002dc4fe195844bfe7bb", "score": "0.48533535", "text": "function ajaxDSSchemaNode(nsname, nodename, nodetype, nodeForAttr)\n{\n\tthis.nsname = nsname;\n\tthis.nodename = nodename;\n\tthis.nodetype = nodetype;\n\tthis.nodeForAttr = nodeForAttr;\n}", "title": "" }, { "docid": "2435373c447a60533026a308f1cc1d24", "score": "0.48523983", "text": "function create(uri, languageId, version, text) {\n return {\n uri: uri,\n languageId: languageId,\n version: version,\n text: text\n };\n }", "title": "" }, { "docid": "963ad4d258751aa1b7f542835178c9d6", "score": "0.4851821", "text": "function createTNode(type, adjustedIndex, tagName, attrs, parent, tViews) {\n ngDevMode && ngDevMode.tNode++;\n return {\n type: type,\n index: adjustedIndex,\n flags: 0,\n tagName: tagName,\n attrs: attrs,\n localNames: null,\n initialInputs: undefined,\n inputs: undefined,\n outputs: undefined,\n tViews: tViews,\n next: null,\n child: null,\n parent: parent,\n dynamicContainerNode: null,\n detached: null,\n stylingTemplate: null,\n projection: null\n };\n}", "title": "" }, { "docid": "963ad4d258751aa1b7f542835178c9d6", "score": "0.4851821", "text": "function createTNode(type, adjustedIndex, tagName, attrs, parent, tViews) {\n ngDevMode && ngDevMode.tNode++;\n return {\n type: type,\n index: adjustedIndex,\n flags: 0,\n tagName: tagName,\n attrs: attrs,\n localNames: null,\n initialInputs: undefined,\n inputs: undefined,\n outputs: undefined,\n tViews: tViews,\n next: null,\n child: null,\n parent: parent,\n dynamicContainerNode: null,\n detached: null,\n stylingTemplate: null,\n projection: null\n };\n}", "title": "" }, { "docid": "963ad4d258751aa1b7f542835178c9d6", "score": "0.4851821", "text": "function createTNode(type, adjustedIndex, tagName, attrs, parent, tViews) {\n ngDevMode && ngDevMode.tNode++;\n return {\n type: type,\n index: adjustedIndex,\n flags: 0,\n tagName: tagName,\n attrs: attrs,\n localNames: null,\n initialInputs: undefined,\n inputs: undefined,\n outputs: undefined,\n tViews: tViews,\n next: null,\n child: null,\n parent: parent,\n dynamicContainerNode: null,\n detached: null,\n stylingTemplate: null,\n projection: null\n };\n}", "title": "" }, { "docid": "963ad4d258751aa1b7f542835178c9d6", "score": "0.4851821", "text": "function createTNode(type, adjustedIndex, tagName, attrs, parent, tViews) {\n ngDevMode && ngDevMode.tNode++;\n return {\n type: type,\n index: adjustedIndex,\n flags: 0,\n tagName: tagName,\n attrs: attrs,\n localNames: null,\n initialInputs: undefined,\n inputs: undefined,\n outputs: undefined,\n tViews: tViews,\n next: null,\n child: null,\n parent: parent,\n dynamicContainerNode: null,\n detached: null,\n stylingTemplate: null,\n projection: null\n };\n}", "title": "" }, { "docid": "963ad4d258751aa1b7f542835178c9d6", "score": "0.4851821", "text": "function createTNode(type, adjustedIndex, tagName, attrs, parent, tViews) {\n ngDevMode && ngDevMode.tNode++;\n return {\n type: type,\n index: adjustedIndex,\n flags: 0,\n tagName: tagName,\n attrs: attrs,\n localNames: null,\n initialInputs: undefined,\n inputs: undefined,\n outputs: undefined,\n tViews: tViews,\n next: null,\n child: null,\n parent: parent,\n dynamicContainerNode: null,\n detached: null,\n stylingTemplate: null,\n projection: null\n };\n}", "title": "" }, { "docid": "c70cf63370fa276a3685e8a8f12ed801", "score": "0.4847024", "text": "@action create(data = null, options = { wait: false }) {\n let originalAttributes = this.attributes.toJS();\n let originalRelationships = toJS(this.relationships);\n let resourceObject = {\n data: {\n type: this.type\n }\n };\n\n if (data && data.attributes) {\n resourceObject.data.attributes = Object.assign(\n {},\n originalAttributes,\n data.attributes\n );\n } else {\n resourceObject.data.attributes = Object.assign(\n {}, \n originalAttributes\n );\n }\n\n if (data && data.relationships) {\n resourceObject.data.relationships = Object.assign(\n {},\n originalRelationships,\n data.relationships\n );\n } else {\n resourceObject.data.relationships = Object.assign(\n {}, \n originalRelationships\n );\n }\n\n if (!options.wait) {\n if (data && data.attributes) {\n this.setAttributes(data.attributes);\n }\n\n if (data && data.relationships) {\n this.setRelationships(data.relationships);\n }\n } else {\n this.setRequestLabel('saving', true);\n }\n\n return new Promise((resolve, reject) => {\n request.post(\n options.url ? options.url : this.url(), \n resourceObject\n )\n .then((response) => {\n this.set(response.data);\n this.setRequestLabel('saving', false);\n resolve(this, response);\n })\n .catch((error) => {\n if (!options.wait) {\n this.setAttributes(originalAttributes);\n this.setRelationships(originalRelationships);\n }\n \n this.setRequestLabel('saving', false);\n reject(error);\n });\n });\n }", "title": "" }, { "docid": "99ec6eadef257e20ddd4abaabff85423", "score": "0.48469225", "text": "function makeElement(name, attributes, dest = scene) {\n const e = document.createElement(`a-${name}`);\n Object.entries(attributes).forEach(([key, value]) => {\n e.setAttribute(key, value);\n });\n\n dest.appendChild(e);\n return e;\n}", "title": "" }, { "docid": "aeb54ff88240e357f7792503dc2c08df", "score": "0.48392108", "text": "createNode(value) {\n return {\n value: value,\n next: null\n }\n }", "title": "" }, { "docid": "be0d732bd1b398312853f3e0e78ee54c", "score": "0.48389804", "text": "function NodeWrapper() {\r\n\t this._node = this.constructor.createNode();\r\n\t }", "title": "" }, { "docid": "4444a68a01c62985e0b70418cdda95e9", "score": "0.48352927", "text": "function create(name, detail, kind, range, selectionRange, children) {\n var result = {\n name: name,\n detail: detail,\n kind: kind,\n range: range,\n selectionRange: selectionRange\n };\n if (children !== undefined) {\n result.children = children;\n }\n return result;\n }", "title": "" }, { "docid": "9020b809b7fc902d94233152c91039fa", "score": "0.48267782", "text": "nodify(data) {\n return Object.assign(data, this.nodeFactory())\n }", "title": "" }, { "docid": "b6e5aac4edb901051e7bfa7054e8f2b5", "score": "0.48260713", "text": "function Node(opts) {\n this.after = opts.after;\n this.before = opts.before;\n this.type = opts.type;\n this.value = opts.value;\n this.sourceIndex = opts.sourceIndex;\n}", "title": "" }, { "docid": "210f56feca6694a391cd35d18710ba53", "score": "0.48076925", "text": "function Node(xml){\r\n var _this = this;\r\n this.id = xml.getAttribute(\"id\");\r\n this.name = xml.getAttribute(\"name\");\r\n \r\n var translate = xml.getElementsByTagName(\"translate\")[0];\r\n if (translate) {\r\n this.translate = parseFloatArray(translate.firstChild.nodeValue);\r\n }\r\n var rotates = xml.getElementsByTagName(\"rotate\");\r\n for (var i = 0; i < rotates.length; i++) {\r\n var rotate = rotates[i];\r\n var sid = rotate.getAttribute(\"sid\");\r\n if (sid == \"rotateZ\") {\r\n this.rotateZ = parseFloatArray(rotate.firstChild.nodeValue);\r\n }else if (sid == \"rotateY\") {\r\n this.rotateY = parseFloatArray(rotate.firstChild.nodeValue);\r\n }else if (sid == \"rotateX\") {\r\n this.rotateX = parseFloatArray(rotate.firstChild.nodeValue);\r\n }\r\n }\r\n var scale = xml.getElementsByTagName(\"scale\")[0];\r\n if (scale) {\r\n this.scale = parseFloatArray(scale.firstChild.nodeValue);\r\n }\r\n \r\n var instance_geometry = xml.getElementsByTagName(\"instance_geometry\")[0];\r\n if (instance_geometry) {\r\n var url = instance_geometry.getAttribute(\"url\");\r\n if (url) {\r\n this.url = url.replace(\"#\", \"\");\r\n }\r\n }\r\n }", "title": "" }, { "docid": "cf24d264c10c9849553db155bb284f2a", "score": "0.48022276", "text": "assignNodes(node) {\n if (Class.resolve(this) !== Class.resolve(node)) {\n if (node.leftNode !== void 0) {\n this.attachLeft(node.leftNode);\n }\n if (node.nextNode !== void 0) {\n this.attachNext(node.nextNode);\n }\n if (node.rightNode !== void 0) {\n this.attachRight(node.rightNode);\n }\n this.nodeData = {\n ...node.nodeData,\n ...this.nodeData\n };\n }\n return this;\n }", "title": "" }, { "docid": "e480af399aefc33b8375be2348bd2d25", "score": "0.47940102", "text": "setAttributes(attributes) {\n for (const key of Object.keys(attributes)) {\n this.attributes[key] = attributes[key];\n }\n return this;\n }", "title": "" }, { "docid": "f87e98f5ce956e4aa850aa969d16fcca", "score": "0.47880667", "text": "function createAttribute(doc, node, type, val){\n\tvar attribute = doc.createAttribute(type);\n\tattribute.nodeValue = val;\n\tnode.setAttributeNode(attribute);\n}", "title": "" }, { "docid": "8313d9774b39d98dffb82b8d1ceb2b3c", "score": "0.4782088", "text": "function cl(node){\r\n\t\tvar element = document.createElement(node.tagName);\r\n\t\telement.id = node.id + \"-clone\";\r\n\t\telement.className = node.className;\r\n\t\tfor (var j = 0; j < node.attributes.length; j++) {\r\n\t\t\tif (node.attributes[j].specified) {\r\n\t\t\t\tif (node.attributes[j].nodeName.toLowerCase() != \"style\" \r\n\t\t\t\t\t&& node.attributes[j].nodeName.toLowerCase() != \"edited\" \r\n\t\t\t\t\t&& node.attributes[j].nodeName.toLowerCase() != \"contenteditable\"\r\n\t\t\t\t\t&& node.attributes[j].nodeName.toLowerCase() != \"id\"\r\n\t\t\t\t\t&& node.attributes[j].nodeName.toLowerCase() != \"class\"\r\n\t\t\t\t){\r\n\t\t\t\t\telement.setAttribute(node.attributes[j].nodeName.toLowerCase(), node.attributes[j].nodeValue);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn element;\r\n\t}", "title": "" }, { "docid": "8313d9774b39d98dffb82b8d1ceb2b3c", "score": "0.4782088", "text": "function cl(node){\r\n\t\tvar element = document.createElement(node.tagName);\r\n\t\telement.id = node.id + \"-clone\";\r\n\t\telement.className = node.className;\r\n\t\tfor (var j = 0; j < node.attributes.length; j++) {\r\n\t\t\tif (node.attributes[j].specified) {\r\n\t\t\t\tif (node.attributes[j].nodeName.toLowerCase() != \"style\" \r\n\t\t\t\t\t&& node.attributes[j].nodeName.toLowerCase() != \"edited\" \r\n\t\t\t\t\t&& node.attributes[j].nodeName.toLowerCase() != \"contenteditable\"\r\n\t\t\t\t\t&& node.attributes[j].nodeName.toLowerCase() != \"id\"\r\n\t\t\t\t\t&& node.attributes[j].nodeName.toLowerCase() != \"class\"\r\n\t\t\t\t){\r\n\t\t\t\t\telement.setAttribute(node.attributes[j].nodeName.toLowerCase(), node.attributes[j].nodeValue);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn element;\r\n\t}", "title": "" }, { "docid": "571157dbcc45626e6eb6d9e159322d51", "score": "0.4773645", "text": "function dom(name, attributes) {\n\tvar node = document.createElement(name);\n\tif (attributes) {\n\t\tforEachIn(attributes, function(name, value) {\n\t\t\tsetNodeAttribute(node, name, value);\n\t\t\t/**\n\t\t\t * the forEachIn function uses attributes as object and calls the action\n\t\t\t * using object and object[property], so object[property] is where the value of the\n\t\t\t * attribute to set comes from.\n\t\t\t * Furthermore the forEachIn function is able to use the second argument of the dom function an \n\t\t\t * object containing the attributes of the node.\n\t\t\t * */\n\n\t\t});\n\t}\n\tfor (var i = 2; i < arguments.length; i++) {\n\t\tvar child = arguments[i];\n\t\tif (typeof child == \"string\")\n\t\t\tchild = document.createTextNode(child);\n\t\tnode.appendChild(child);\n\t}\n\treturn node;\n}", "title": "" }, { "docid": "bc8e08d49526e95f5585371bf0db1e90", "score": "0.477162", "text": "function changeXmlNodeType(node, tag, attributes)\n{\n\t// Find the root (actually the document, not the root node. Who's counting?)\n\t// We create based on this XML document to ensure we have the right namespace\n\tvar root = rootNode(node);\n\tvar ns = namespace(node);\n\n\t// Create a new node of the desired type\n\tvar newNode = root.createElementNS(ns, tag);\n\n\t// Set the desired attributes on the new node\n\tattributes && _.each(attributes, function(val, key) {\n\t\tnewNode.setAttribute(key, val);\n\t});\n\n\t// Transfer all children from the old node to the new\n\twhile(node.childNodes.length)\n\t\tnewNode.appendChild(node.childNodes[0]);\n\n\t// Replace the old node with the new\n\tnode.parentNode.replaceChild(newNode, node);\n\n\t// Return the new node in case the caller needs to perform further operations on it\n\treturn newNode;\n}", "title": "" }, { "docid": "e29df195c1d4168c4468e274c3c3adf2", "score": "0.4767753", "text": "createInstance (resourceName, attrs, options) {\n let definition = this.definitions[resourceName]\n let item\n\n attrs = attrs || {}\n\n if (!definition) {\n throw new NER(resourceName)\n } else if (attrs && !DSUtils.isObject(attrs)) {\n throw new IA('\"attrs\" must be an object!')\n }\n\n options = DSUtils._(definition, options)\n\n const relationList = definition.relationList || []\n if (relationList.length) {\n DSUtils.forEach(relationList, function (def) {\n const relationData = DSUtils.get(attrs, def.localField)\n if (relationData) {\n if (DSUtils.isArray(relationData)) {\n const array = []\n const Resource = definition.getResource(def.relation)\n const _options = options.orig()\n DSUtils.forEach(relationData, function (relationDataItem) {\n array.push(Resource.createInstance(relationDataItem, _options))\n })\n DSUtils.set(attrs, def.localField, array)\n } else if (DSUtils.isObject(relationData)) {\n DSUtils.set(attrs, def.localField, definition.getResource(def.relation).createInstance(relationData, options.orig()))\n }\n }\n })\n }\n\n options.logFn('createInstance', attrs, options)\n\n // lifecycle\n options.beforeCreateInstance(options, attrs)\n\n // grab instance constructor function from Resource definition\n let Constructor = definition[definition.class]\n\n // create instance\n item = new Constructor()\n\n if (definition.instanceEvents) {\n DSUtils.Events(item)\n }\n\n // add default values\n if (options.defaultValues) {\n DSUtils.deepMixIn(item, DSUtils.copy(options.defaultValues))\n }\n DSUtils.deepMixIn(item, attrs)\n\n // compute computed properties\n if (definition.computed) {\n definition.compute(item)\n }\n // lifecycle\n options.afterCreateInstance(options, item)\n return item\n }", "title": "" } ]
decb3823ea9d53ab355b97675829d143
1. Draw the image data onto offscreen buffer 2. Draw buffer to canvas at zoom level
[ { "docid": "db73486f235926182a6e4c747760f0c4", "score": "0.6300846", "text": "function updateBuffer() {\n\toffscreen.width = canvasWidth;\n\toffscreen.height = canvasHeight;\n\n\tvar imgdata = offscreenCtx.getImageData(0, 0, canvasWidth, canvasHeight);\n\tvar color;\n\tvar pixel;\n\tvar index;\n\tvar data = imgdata.data;\n\tvar coord;\n\tvar owner = mypixelsSelected && me.userID;\n\n\t//loop over board\n\tfor(var pos in board) {\n\t\tpixel = board[pos];\n\t\t//skip if only drawing owner\n\t\tif(owner && pixel.owner != owner) continue;\n\t\t\n\t\tcoord = pos.split(\",\");\n if(coord.length !== 2) continue;\n\n\t\tindex = (coord[1] * canvasWidth + (+coord[0])) * 4;\n\t\tcolor = pixel.color;\n\t\t\n\t\tdata[index] = parseInt(color.substr(0, 2), 16); //red\n\t\tdata[++index] = parseInt(color.substr(2, 2), 16); // green\n\t\tdata[++index] = parseInt(color.substr(4, 2), 16); // blue\n\t\tdata[++index] = 255;\n\t}\n\t\n\t//loop over selected pixels\n\tfor(var pos in pixels) {\n\t\tpixel = board[pos];\n\t\tif(owner && !pixel) continue;\n\t\tif(owner && pixel.owner != owner) continue;\n\t\t\n\t\tcoord = pos.split(\",\");\n\t\tif(coord.length !== 2) continue;\n\n\t\tindex = (coord[1] * canvasWidth + (+coord[0])) * 4;\n\n\t\tvar sr = parseInt(selectColorHex.substr(0, 2), 16),\n\t\t\tsg = parseInt(selectColorHex.substr(2, 2), 16),\n\t\t\tsb = parseInt(selectColorHex.substr(4, 2), 16);\n\n\t\tif(!pixel) {\n\t\t\tdata[ index] = sr; //red\n\t\t\tdata[++index] = sg; // green\n\t\t\tdata[++index] = sb; // blue\n\t\t\tdata[++index] = 127;\n\t\t} else {\n\t\t\tvar other = pixel.color;\n\t\t\tvar r = parseInt(other.substr(0, 2), 16) / 255;\n\t\t\tvar g = parseInt(other.substr(2, 2), 16) / 255;\n\t\t\tvar b = parseInt(other.substr(4, 2), 16) / 255;\n\t\t\tsr /= 255;\n\t\t\tsg /= 255;\n\t\t\tsb /= 255;\n\n\t\t\tdata[ index] = ((r * .5 + sr * .5) * 255) | 0;\n\t\t\tdata[++index] = ((g * .5 + sg * .5) * 255) | 0;\n\t\t\tdata[++index] = ((b * .5 + sb * .5) * 255) | 0;\n\t\t\tdata[++index] = 255;\n\t\t}\n\t\t\n\t}\n\n\toffscreenCtx.putImageData(imgdata, 0, 0);\n\tdirtyBuffer = false;\n}", "title": "" } ]
[ { "docid": "2630d8bc28c8735c9ed296f6a319091e", "score": "0.66202974", "text": "function render() {//used in run():271\n requestAnimationFrame(render);\n\n lHis && lHis.style(\"display\", setting.showHistogram ? null : \"none\");\n lLeg && lLeg.style(\"display\", setting.showCountExt ? null : \"none\");\n\n if (valid) return;\n\n valid = true;\n\n ctx.save();\n ctx.clearRect(0, 0, _w, _h);\n\n redrawCanvas();//:618\n\n ctx.drawImage(bufCanvas, 0, 0);\n ctx.restore();\n\n valid = false;\n\n // console.log(\"rendered!\");\n }", "title": "" }, { "docid": "7bb531dbad4b57442d86c93c02a2e7b9", "score": "0.6546924", "text": "function update_spectrum() {\n\n if (!windowLeft)\n requestAnimationFrame(update_spectrum);\n\n spec_now = performance.now();\n spec_elapsed = spec_now - spec_then;\n\n //if (spec_elapsed > fpsInterval)\n {\n spec_then = spec_now - (spec_elapsed % fpsInterval);\n //console.log(\"spectrum interval: \" + spec_elapsed.toFixed(3) + \" [ms]\", \"fps = \", Math.round(1000 / spec_elapsed)) ;\n\n //image\n try {\n let data = image_stack.pop();\n image_stack = [];\n\n ctx.clearRect(data.px, data.py, data.zoomed_size, data.zoomed_size);\n\n var imageCanvas;\n\n if (composite_view)\n imageCanvas = compositeCanvas;\n else\n imageCanvas = imageContainer[va_count - 1].imageCanvas;//if composite_view use compositeCanvas\n\n if (zoom_shape == \"square\") {\n ctx.fillStyle = \"rgba(0,0,0,0.3)\";\n ctx.fillRect(data.px, data.py, data.zoomed_size, data.zoomed_size);\n\n ctx.drawImage(imageCanvas, data.x - data.clipSize, data.y - data.clipSize, 2 * data.clipSize + 1, 2 * data.clipSize + 1, data.px, data.py, data.zoomed_size, data.zoomed_size);\n }\n\n if (zoom_shape == \"circle\") {\n ctx.save();\n ctx.beginPath();\n ctx.arc(data.px + data.zoomed_size / 2, data.py + data.zoomed_size / 2, data.zoomed_size / 2, 0, 2 * Math.PI, true);\n\n ctx.fillStyle = \"rgba(0,0,0,0.3)\";\n ctx.fill();\n\n ctx.closePath();\n ctx.clip();\n ctx.drawImage(imageCanvas, data.x - data.clipSize, data.y - data.clipSize, 2 * data.clipSize + 1, 2 * data.clipSize + 1, data.px, data.py, data.zoomed_size, data.zoomed_size);\n ctx.restore();\n }\n }\n catch (e) {\n //console.log(e) ;\n }\n\n //spectrum\n try {\n let go_ahead = true;\n let new_seq_id = 0;\n\n for (let index = 0; index < va_count; index++) {\n let len = spectrum_stack[index].length;\n\n if (len > 0) {\n let id = spectrum_stack[index][len - 1].id;\n\n if (id <= last_seq_id)\n go_ahead = false;\n else\n new_seq_id = Math.max(new_seq_id, id);\n }\n else\n go_ahead = false;\n }\n\n if (go_ahead) {\n last_seq_id = new_seq_id;\n console.log(\"last_seq_id:\", last_seq_id);\n\n //pop all <va_count> spectrum stacks\n var data = [];\n\n for (let index = 0; index < va_count; index++) {\n data.push(spectrum_stack[index].pop().spectrum);\n spectrum_stack[index] = [];\n }\n\n plot_spectrum(data);\n replot_y_axis();\n\n last_spectrum = data;\n }\n\n }\n catch (e) {\n console.log(e);\n }\n\n }\n }", "title": "" }, { "docid": "988d067ea30d7e3e74f15ea22a6d534e", "score": "0.6491379", "text": "drawImage(canvas, canvasSize, level, window, maskVisibility, maskColours) {\n\t//console.log(\"draw\", level, window)\n\t// Get the dimensions\n\tvar height = this.data.length\n\tvar width = this.data[0].length\n\tvar pixHeight = this.pixHeight\n\tvar pixWidth = this.pixWidth\n\t\n\tvar size = canvasSize\n\tif (height > width) {\n\t // Calculate unscaled height\n\t var actualSize = height*pixHeight\n\t \n\t // Size the canvas correctly\n\t var scale = size/actualSize\n\t this.scale = scale\n\t canvas.height = size\n\t canvas.width = width * pixWidth * scale\n\t}\n\telse {\n\t // Calc unscaled width\n\t var actualSize = width*pixWidth\n\t // Size canvas\n\t var scale = size/actualSize\n\t this.scale = scale\n\t canvas.width = size\n\t canvas.height = height*pixHeight*scale\n\t}\n\n\t// Clear the canvas\n\tvar ctx = canvas.getContext(\"2d\")\n\tctx.clearRect(0, 0, width*scale, height*scale);\n\t// Draw the image\n\tif (this.preRender !== null && this.preRenderLevel === level\n\t && this.preRenderWindow === window) {\n\t ctx.drawImage(this.preRender, 0, 0)\n\t}\n\telse {\n\t this.drawImageOnly(canvas, canvasSize, level, window, maskVisibility, maskColours)\n\t}\n\t// Draw the image onto the canvas\n\tfor (var row = 0; row < height; row++) {\n\t for (var col = 0; col < width; col++) { \n\t\tfor (var i = 0; i < this.masks.length; i++) {\n\t\t if (maskVisibility[i] === false) {\n\t\t\tcontinue\n\t\t }\n\t\t if (this.currentMask === i) {\n\t\t\tvar mask = this.tempMask\n\t\t }\n\t\t else {\n\t\t\tvar mask = this.masks[i]\n\t\t }\n\t\t if (row > 0 && mask[row][col] !== mask[row - 1][col]) {\n\t\t\tif (mask[row][col] !== 0) {\n\t\t\t // Set the color to the one specified\n\t\t\t ctx.fillStyle = maskColours[i][mask[row][col] - 1]; \n\t\t\t ctx.fillRect(Math.floor(col * pixWidth * scale), Math.floor(row * pixHeight*scale), Math.ceil(pixWidth*scale), Math.ceil(0.33*pixHeight*scale));\n\t\t\t}\n\n\t\t\tif (mask[row - 1][col] !== 0) {\n\t\t\t ctx.fillStyle = maskColours[i][mask[row - 1][col] - 1];\n\t\t\t ctx.fillRect(Math.floor(col * pixWidth * scale), Math.floor((row-0.33) * pixHeight*scale), Math.ceil(pixWidth*scale), Math.ceil(0.33*pixHeight*scale));\n\t\t\t}\n\t\t }\n\n\t\t if (col > 0 && mask[row][col] !== mask[row][col - 1]) {\n\t\t\tif (mask[row][col] !== 0) {\n\t\t\t ctx.fillStyle = maskColours[i][mask[row][col] - 1]; \n\t\t\t ctx.fillRect(Math.floor(col * pixWidth * scale), Math.floor(row * pixHeight*scale), Math.ceil(0.33*pixWidth*scale), Math.ceil(pixHeight*scale));\n\t\t\t}\n\t\t\tif (mask[row][col - 1] !== 0) {\n\t\t\t ctx.fillStyle = maskColours[i][mask[row][col - 1] - 1]; \n\t\t\t ctx.fillRect(Math.floor((col-0.33) * pixWidth * scale), Math.floor(row * pixHeight*scale), Math.ceil(0.33*pixWidth*scale), Math.ceil(pixHeight*scale));\n\t\t\t}\n\t\t }\n\t\t}\n\t }\n\t}\n\tthis.boundingRect[1] = this.rowToCoord(this.boundingRectPix[1])\n\tthis.boundingRect[3] = this.rowToCoord(this.boundingRectPix[3])\n\tthis.boundingRect[0] = this.colToCoord(this.boundingRectPix[0])\n\tthis.boundingRect[2] = this.colToCoord(this.boundingRectPix[2])\n\tctx.beginPath();\n\tctx.rect(this.boundingRect[0],\n\t\t this.boundingRect[1],\n\t\t this.boundingRect[2] - this.boundingRect[0],// * (pixWidth * scale),\n\t\t this.boundingRect[3] - this.boundingRect[1])\n\tctx.lineWidth = 3\n\tctx.strokeStyle = 'yellow';\n\tctx.stroke()\n }", "title": "" }, { "docid": "08383a6efbdacedf1475ae2f12976aab", "score": "0.6488885", "text": "draw(ctx) {\n const smoothing = this.ctx.imageSmoothingEnabled\n ctx.imageSmoothingEnabled = this.useImageSmoothing\n this.ctx.putImageData(this.imageData, 0, 0)\n // this.updateCanvas()\n util.fillCtxWithImage(ctx, this.ctx.canvas)\n ctx.imageSmoothingEnabled = smoothing\n }", "title": "" }, { "docid": "903cc3c263665d2894bf082297ae17b7", "score": "0.6474566", "text": "_fillMipMap() {\n var ctx = this.canvas.getContext('2d');\n\n // First zoom-level comes from the image\n var to = this.coordinates[0];\n ctx.drawImage(this.image, to[0], to[1], to[2], to[3]);\n\n // The rest are copy actions internal to the canvas/context\n for (let iterations = 1; iterations < this.NUM_ITERATIONS; iterations++) {\n let from = this.coordinates[iterations - 1];\n let to = this.coordinates[iterations];\n\n ctx.drawImage(this.canvas,\n from[0], from[1], from[2], from[3],\n to[0], to[1], to[2], to[3]\n );\n }\n }", "title": "" }, { "docid": "eb145e0e4ba898867a28ac5ca010b145", "score": "0.64403844", "text": "_fillMipMap() {\n const ctx = this.canvas.getContext(\"2d\");\n\n // First zoom-level comes from the image\n const to = this.coordinates[0];\n ctx.drawImage(this.image, to[0], to[1], to[2], to[3]);\n\n // The rest are copy actions internal to the canvas/context\n for (let iterations = 1; iterations < this.NUM_ITERATIONS; iterations++) {\n const from = this.coordinates[iterations - 1];\n const to = this.coordinates[iterations];\n\n ctx.drawImage(\n this.canvas,\n from[0],\n from[1],\n from[2],\n from[3],\n to[0],\n to[1],\n to[2],\n to[3]\n );\n }\n }", "title": "" }, { "docid": "b3898c71b1ac81e50f8a504723b24ede", "score": "0.64184576", "text": "function drawImage(canvas) {\n\t // canvas is a d3 selection.\n\t //var plotdata = canvas.data()[0];\n\t var maxColorIndex = 255,\n\t overflowIndex = 256,\n\t context = canvas.node().getContext(\"2d\"),\n\t ctx = backing_canvas.getContext(\"2d\");\n\n\t if (_redraw_backing) {\n\t _redraw_backing = false;\n\t var height = source_data.length,\n\t width = source_data[0].length;\n\t if (backing_image == null || backing_canvas.width != width || backing_canvas.height != height) {\n\t backing_canvas.width = width;\n\t backing_canvas.height = height;\n\t backing_image = ctx.createImageData(width, height);\n\t }\n\t var data = backing_image.data;\n\t var yp,\n\t pp = 0;\n\t for (var yt = 0, p = -1; yt < height; ++yt) {\n\t yp = dims.ydim - 1 - yt; // y-axis starts at the top!\n\t for (var xp = 0; xp < width; ++xp, pp++) {\n\t var c = _colormap_array[plotdata[pp]];\n\t data[++p] = c.r;\n\t data[++p] = c.g;\n\t data[++p] = c.b;\n\t data[++p] = c.a;\n\t }\n\t }\n\t ctx.putImageData(backing_image, 0, 0);\n\t }\n\n\t //context.mozImageSmoothingEnabled = false;\n\t //context.webkitImageSmoothingEnabled = false;\n\t //context.msImageSmoothingEnabled = false;\n\t //context.imageSmoothingEnabled = false;\n\n\n\t context.clearRect(0, 0, context.canvas.width, context.canvas.height);\n\t if (context.mozImageSmoothingEnabled) context.mozImageSmoothingEnabled = false;\n\t if (context.imageSmoothingEnabled) context.imageSmoothingEnabled = false;\n\t if (context.msImageSmoothingEnabled) context.msImageSmoothingEnabled = false;\n\t if (context.webkitImageSmoothingEnabled) context.webkitImageSmoothingEnabled = false;\n\t var sxdx = get_sxdx();\n\t context.drawImage(ctx.canvas, sxdx.sx, sxdx.sy, sxdx.sw, sxdx.sh, sxdx.dx, sxdx.dy, sxdx.dw, sxdx.dh);\n\t }", "title": "" }, { "docid": "44e4e1da9f8e49af0bfc86bf334e43ec", "score": "0.6397034", "text": "function render(){\n var start = Date.now();\n\n for (var i = 0; i <= canvas.width; i++){\n for (var j = 0; j <= canvas.height; j++){\n var ray = camera.castRay(i, j);\n setPixel(i, j, trace(ray, scene.bounce_depth) );\n }\n }\n\n //carica immagine calcolata\n context.putImageData(imageBuffer,0,0);\n\n var end = Date.now();\n $('#log').html(\"rendered in: \"+(end-start)+\"ms\");\n console.log(\"rendered in: \"+(end-start)+\"ms\");\n\n}", "title": "" }, { "docid": "c8c9a1ad46f72f78002a0bf35078ea1c", "score": "0.6391222", "text": "updateCanvas() {\n this.shootAreaCtx.putImageData(this.shootAreaData, 0, 0);\n }", "title": "" }, { "docid": "384a81d8c891c9f9a85110558b0d2f4d", "score": "0.6380239", "text": "function drawPixelated(img,context,zoom,x,y){\n if (!zoom) zoom=4; if (!x) x=0; if (!y) y=0;\n if (!img.id) img.id = \"__img\"+(drawPixelated.lastImageId++);\n var idata = drawPixelated.idataById[img.id];\n if (!idata){\n var ctx = document.createElement('canvas').getContext('2d');\n ctx.width = img.width;\n ctx.height = img.height;\n ctx.drawImage(img,0,0);\n idata = drawPixelated.idataById[img.id] = ctx.getImageData(0,0,img.width,img.height).data;\n }\n for (var x2=0;x2<img.width;++x2){\n for (var y2=0;y2<img.height;++y2){\n var i=(y2*img.width+x2)*4;\n var r=idata[i ];\n var g=idata[i+1];\n var b=idata[i+2];\n var a=idata[i+3];\n context.fillStyle = \"rgba(\"+r+\",\"+g+\",\"+b+\",\"+(a/255)+\")\";\n context.fillRect(x+x2*zoom, y+y2*zoom, zoom, zoom);\n }\n }\n}", "title": "" }, { "docid": "bc71d73016587d246b054af8f9e9bacb", "score": "0.63600194", "text": "drawBuffer() {\n const nominalWidth = Math.round(\n this.getDuration() *\n this.params.minPxPerSec *\n this.params.pixelRatio\n );\n const parentWidth = this.drawer.getWidth();\n let width = nominalWidth;\n let start = this.drawer.getScrollX();\n let end = Math.max(start + parentWidth, width);\n // Fill container\n if (\n this.params.fillParent &&\n (!this.params.scrollParent || nominalWidth < parentWidth)\n ) {\n width = parentWidth;\n start = 0;\n end = width;\n }\n\n let peaks;\n peaks = this.backend.getPeaks(width, start, end);\n this.drawer.drawPeaks(peaks, width, start, end);\n this.fireEvent('redraw', peaks, width);\n }", "title": "" }, { "docid": "049a85a5ce2971b79c4fdcb1453f3833", "score": "0.6356626", "text": "fitToScreen() {\n var rect = this.getRectofPoints(this.points);\n var rateX = 0, rateY = 0;\n this.wx = 0;\n this.wy = 0;\n rateX = (this.canvas.width-20)/(rect.xMax-rect.xMin);\n rateY = (this.canvas.height-20)/(rect.yMax-rect.yMin);\n if(rateX > rateY) {\n this.scale = 1 * rateY;\n }\n else {\n this.scale = 1 * rateX;\n }\n this.wx = (this.zoomedX(rect.xMin)-(this.canvas.width-this.zoomedX(rect.xMax)+this.zoomedX(rect.xMin))/2)/this.scale; // world zoom origin\n this.wy = (this.zoomedY(rect.yMin)-(this.canvas.height-this.zoomedY(rect.yMax)+this.zoomedY(rect.yMin))/2)/this.scale;\n this.drawLine();\n }", "title": "" }, { "docid": "d4d1c473e46766e04d475426bbb57b47", "score": "0.6347767", "text": "function takeScreenshot(){\n\tif(!gl){return;}\n\tgl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n\trender(1);\nvar ddd1 = new Date().getTime();\n\n\tvar offscreenView = new Uint8Array(offscreenRenderWidth*offscreenRenderHeight*4);\nvar ddd2 = new Date().getTime();\nconsole.log((ddd2-ddd1));\t\n\tgl.readPixels(0,0,offscreenRenderWidth,offscreenRenderHeight,gl.RGBA,gl.UNSIGNED_BYTE,offscreenView);\nvar ddd3 = new Date().getTime();\nconsole.log(\"readpixels: \"+(ddd3-ddd2));\t\n\tgl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\trender(0);\nvar ddd4 = new Date().getTime();\nconsole.log((ddd4-ddd3));\n\t//omzetten naar bmp\nvar cnvs=document.getElementById(\"canvasOffscreenHelper\");\t\n\t$('#canvasOffscreenHelper').attr('width',offscreenRenderWidth);\n\t$('#canvasOffscreenHelper').attr('height',offscreenRenderHeight);\n\tvar ctxt=cnvs.getContext(\"2d\");\n\tvar imgData=ctxt.createImageData(offscreenRenderWidth,offscreenRenderHeight);\nvar ddd5 = new Date().getTime();\nconsole.log((ddd5-ddd4));\n\tfor(var i=0;i<offscreenRenderHeight;i+=1){\t\t\t\t\t\t\t//put arraybuffer content in canvas, flipped vertically\n\t\tfor(var j=0;j<=4*offscreenRenderWidth-4;j=j+1){\n\t\t\timgData.data[j+i*4*offscreenRenderWidth]=offscreenView[j-i*4*offscreenRenderWidth+4*offscreenRenderWidth*offscreenRenderHeight];\n\t\t}\n \t}\nvar ddd6 = new Date().getTime();\nconsole.log((ddd6-ddd5));\n\tctxt.putImageData(imgData,0,0);\n\tvar img = cnvs.toDataURL(\"image/jpeg\");;\n\tdocument.getElementById(\"imgOffscreenHelper\").src=img;\n\tdocument.getElementById(\"aOffscreenHelper\").href = img;\n\tdocument.getElementById(\"aOffscreenHelper\").download=document.getElementById(\"inputOffscreenName\").value+\".jpeg\";\n \n\tvar clickEvent = document.createEvent(\"MouseEvent\");\n\tclickEvent.initMouseEvent(\"click\", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); \n\tdocument.getElementById(\"aOffscreenHelper\").dispatchEvent(clickEvent);\n\n\tconsole.log(\"done taking screenshot\");\n\t\n\treturn img;\n\t\tvar ddd7 = new Date().getTime();\n\nconsole.log((ddd7-ddd6));\n}", "title": "" }, { "docid": "3ecc06b76b87aa7e363f56a8cbe36df8", "score": "0.63405704", "text": "function startRender() {\n\tlet v4 = viewWidth / 2;\n\tlet h4 = v4 * heightToWidthRatio;\n\tmandelBitmap.render(curCR - v4, curCI + h4,\n\t\tcurCR + v4, curCI - h4);\n\n\tlet zoomLevel = Math.pow(zoomFactor, curZoom);\n\tzoomText.innerHTML = zoomLevel;\n}", "title": "" }, { "docid": "cc748b66a2f040b49c54db5cb20d6381", "score": "0.6309445", "text": "function updateCanvas() {\n ctx.putImageData(canvasData, 0, 0);\n}", "title": "" }, { "docid": "985ad0aef7e6916e81305cbef69e1cd8", "score": "0.62963384", "text": "function cw_drawScreen() {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.save();\n cw_setCameraPosition();\n ctx.translate(200 - (camera_x * zoom), 200 + (camera_y * zoom));\n ctx.scale(zoom, -zoom);\n cw_drawFloor();\n ghost_draw_frame(ctx, ghost);\n cw_drawCars();\n ctx.restore();\n}", "title": "" }, { "docid": "dcbb2d49e2b20d59a3fdb55dc4a48ee3", "score": "0.62800926", "text": "function doRedraw() {\n\n doClearScreen(false);\n\n var lowerFrameStart = visibleWidth * canvasCharacterHeight; // redrawX + visibleXStart\n \n if (canvases==1) {\n\t\t\n var sx = visibleXStart * canvasCharacterWidth; // The x coordinate of the upper left corner of the rectangle from which the ImageData will be extracted.\n var sy = (visibleHeight + visibleYStart + 1) * canvasCharacterHeight; // The y coordinate of the upper left corner of the rectangle from which the ImageData will be extracted.\n var sw = (visibleWidth) * canvasCharacterWidth; // The width of the rectangle from which the ImageData will be extracted.\n var sh = (visibleHeight - 1) * canvasCharacterHeight; // The height of the rectangle from which the ImageData will be extracted. \n //console.log(\"sx: \"+sx+\" sy: \"+sy+\" sw: \"+sw+\" sh: \"+sh);\n var imgData = ctx.getImageData(sx, sy, sw, sh);\n ctx.putImageData(imgData, 0, 0);\n \n } else {\n var sx = visibleXStart * canvasCharacterWidth; // The x coordinate of the upper left corner of the rectangle from which the ImageData will be extracted.\n var sy = ( visibleYStart ) * canvasCharacterHeight; // The y coordinate of the upper left corner of the rectangle from which the ImageData will be extracted.\n var sw = (visibleWidth) * canvasCharacterWidth; // The width of the rectangle from which the ImageData will be extracted.\n var sh = (visibleHeight - 1) * canvasCharacterHeight; // The height of the rectangle from which the ImageData will be extracted. \n //console.log(\"sx: \"+sx+\" sy: \"+sy+\" sw: \"+sw+\" sh: \"+sh);\n var imgData = ctx2.getImageData(sx, sy, sw, sh);\n ctx.putImageData(imgData, 0, 0);\n \n }\n\n updateScrollbarX(true, 0); // draw the scrollbar at the bottom, x position = 0 \n updateScrollbarY(true, 0); // Show a part of the scrollbar again\n //\talert(sx+\"==\"+sy+\"==\"+sw+\"==\"+sh)\n}", "title": "" }, { "docid": "de9695d9bc964b082de802eb445c8aac", "score": "0.62595356", "text": "function redrawCanvas() {//used in render():890\n\n bufCtx.save();\n bufCtx.clearRect(0, 0, _w, _h);\n\n if (setting.blendingLighter && bufCtx.globalCompositeOperation == 'source-over') {\n bufCtx.globalCompositeOperation = 'lighter';\n //darker\n }\n else if (!setting.blendingLighter && bufCtx.globalCompositeOperation == 'lighter') {\n bufCtx.globalCompositeOperation = 'source-over';\n }\n\n bufCtx.translate(lastEvent.translate[0], lastEvent.translate[1]);\n bufCtx.scale(lastEvent.scale, lastEvent.scale);\n\n var n, l, i, j,\n src, trg,\n iw, ih,\n img,\n d, beg,\n c, x, y, s;\n\n\n if (setting.showEdge || selected){\n n = links.entries();\n if (!setting.showEdge)\n n = n.filter(function(d) {\n return d.key.indexOf(selected.id) >= 0;\n });\n\n l = n.length;\n\n bufCtx.save();\n bufCtx.lineCap=\"round\";\n bufCtx.lineJoin=\"round\";\n\n while(--l > -1) {\n d = n[l].value;\n src = d.source;\n trg = d.target;\n j = src.type == typeNode.child;\n\n c = curColor(j ? src : trg);\n\n bufCtx.beginPath();\n bufCtx.strokeStyle = c.toString();\n bufCtx.lineWidth = (radius(nr(d)) * 3) || 1;\n\n var sx = j ? trg.x : src.x,\n sy = j ? trg.y : src.y,\n tx = !j ? trg.x : src.x,\n ty = !j ? trg.y : src.y;\n\n bufCtx.moveTo(sx, sy);\n var x3 = .3 * ty - .3 * sy + .8 * sx + .2 * tx,\n y3 = .8 * sy + .2 * ty - .3 * tx + .3 * sx,\n x4 = .3 * ty - .3 * sy + .2 * sx + .8 * tx,\n y4 = .2 * sy + .8 * ty - .3 * tx + .3 * sx;\n bufCtx.bezierCurveTo(x3, y3, x4, y4, tx, ty);\n bufCtx.stroke();\n }\n bufCtx.restore();\n }//end of if (setting.showEdge || selected){\n\n if (setting.showChild) {\n n = _force.nodes()\n .filter(filterVisible)\n .sort(sortBySize)\n .sort(sortByOpacity)\n .sort(sortByColor)\n ;\n\n l = n.length;\n\n c = null;\n i = 100;\n j = true;\n beg = false;\n\n bufCtx.globalAlpha = i * .01;\n\n while(--l > -1) {\n d = n[l];\n\n if (i != curOpacity(d)) {\n i = curOpacity(d);\n bufCtx.globalAlpha = i * .01;\n }\n\n if (!c || compereColor(c, curColor(d))) {\n c = curColor(d);\n j = false;\n }\n\n if (!j) {\n if (!setting.showHalo) {\n if (beg) {\n bufCtx.closePath();\n bufCtx.fill();\n bufCtx.stroke();\n }\n\n bufCtx.beginPath();\n beg = true;\n bufCtx.strokeStyle = \"none\";\n bufCtx.fillStyle = c.toString();\n }\n else\n img = colorize(particle, c.r, c.g, c.b, 1);\n j = true;\n }\n\n x = Math.floor(d.x);\n y = Math.floor(d.y);\n\n\n if (setting.fadingTail && setting.showTrack) {\n //bufCtx.save();\n bufCtx.lineCap=\"round\";\n //bufCtx.lineJoin=\"round\";\n bufCtx.lineWidth = (radius(nr(d)) / 4) || 1;\n bufCtx.fillStyle = \"none\";\n bufCtx.strokeStyle = c.toString();\n\n var rs = d.paths.slice(0).reverse(),\n lrs = rs.length,\n cura = bufCtx.globalAlpha;\n\n for (var p in rs) {\n if (!rs.hasOwnProperty(p))\n continue;\n\n bufCtx.beginPath();\n if (p < 1)\n bufCtx.moveTo(x, y);\n else\n bufCtx.moveTo(\n Math.floor(rs[p - 1].x),\n Math.floor(rs[p - 1].y)\n );\n bufCtx.lineTo(\n Math.floor(rs[p].x),\n Math.floor(rs[p].y)\n );\n bufCtx.stroke();\n bufCtx.globalAlpha = ((lrs - p)/lrs) * cura;\n }\n //bufCtx.restore();\n bufCtx.globalAlpha = cura;\n }\n\n if (!setting.fadingTail && setting.showTrack) {\n bufCtx.save();\n bufCtx.beginPath();\n bufCtx.lineCap=\"round\";\n bufCtx.lineJoin=\"round\";\n bufCtx.strokeStyle = c.toString();\n bufCtx.lineWidth = (radius(nr(d)) / 4) || 1;\n\n var rs = d.paths.slice(0).reverse(),\n lrs = rs.length;\n\n bufCtx.moveTo(x, y);\n for (var p in rs) {\n if (!rs.hasOwnProperty(p))\n continue;\n\n bufCtx.lineTo(\n Math.floor(rs[p].x),\n Math.floor(rs[p].y)\n );\n }\n //bufCtx.closePath();\n bufCtx.stroke();\n bufCtx.restore();\n }\n\n s = radius(nr(d)) * (setting.showHalo ? 8 : 1);\n setting.showHalo\n ? bufCtx.drawImage(img, x - s / 2, y - s / 2, s, s)\n : bufCtx.arc(x, y, s, 0, PI_CIRCLE, true)\n ;\n }//end of while\n if (!setting.showHalo && beg) {\n bufCtx.closePath();\n bufCtx.fill();\n bufCtx.stroke();\n }\n }//end of if (setting.showChild)\n\n if (setting.showParent || setting.showLabel) {\n n = _forceBase.nodes().filter(filterVisible).sort(sortByOpacity);\n l = n.length;\n\n i = 100;\n\n bufCtx.globalAlpha = i * .01;\n\n while(--l > -1) {\n d = n[l];\n\n if (i != curOpacity(d)) {\n i = curOpacity(d);\n bufCtx.globalAlpha = i * .01;\n }\n\n x = Math.floor(d.x);\n y = Math.floor(d.y);\n\n if (setting.showParent) {\n c = curColor(d);\n bufCtx.save();\n\n if (setting.showPaddingCircle) {\n bufCtx.beginPath();\n bufCtx.strokeStyle = \"none\";\n bufCtx.fillStyle = \"#ff0000\";\n bufCtx.arc(x, y, nr(d) + setting.padding, 0, PI_CIRCLE, true);\n bufCtx.closePath();\n bufCtx.fill();\n bufCtx.stroke();\n }\n\n bufCtx.beginPath();\n bufCtx.strokeStyle = \"transparent\";\n bufCtx.fillStyle = setting.useImage ? \"transparent\" : c;\n bufCtx.arc(x, y, nr(d), 0, PI_CIRCLE, true);\n bufCtx.closePath();\n bufCtx.fill();\n bufCtx.stroke();\n img = d.img && d.img.width > 0 && d.img.height > 0 ? d.img : defImg;\n if (setting.useImage && img.width > 0 && img.height > 0) {\n bufCtx.clip();\n iw = img.width;\n ih = img.height;\n\n if (iw == ih) {\n ih = iw = nr(d);\n }\n else if (iw > ih) {\n ih = (ih/iw) * nr(d) * 1.2;\n iw = nr(d) * 1.2;\n }\n else {\n iw = (iw/ih) * nr(d) * 1.2;\n ih = nr(d) * 1.2;\n }\n\n bufCtx.drawImage(img, x - iw, y - ih, iw * 2, ih * 2);\n }\n\n bufCtx.restore();\n }\n\n if (setting.showLabel) {\n c = d.flash ? \"white\" : \"gray\";\n\n bufCtx.fillStyle = c;\n bufCtx.fillText(d.nodeValue.shortName, x, y + nr(d) * 1.5);\n }\n }\n }//end of if (setting.showParent || setting.showLabel) {\n\n bufCtx.restore();\n\n }", "title": "" }, { "docid": "a321591d8eca1c0c45839d85bfa2390f", "score": "0.6248543", "text": "function drawImage(){\n\tvar imgWidth = G.img.width;\n\tvar imgHeight = G.img.height;\n\tvar sx = 0, sy = 0, sw = imgWidth, sh = imgHeight, dx, dy, dw, dh;\n\tif(imgWidth >= imgHeight){ \t\t//fill the width or height of the image to the canvas\n\t\tdw = G.getWidth();\n\t\tdh = dw*imgHeight/imgWidth;\n\t}else{\n\t\tdh = G.getHeight();\n\t\tdw = dh*imgWidth/imgHeight;\n\t}\n\n\tdw = dw * G.zoomScale;\n\tdh = dh * G.zoomScale;\n\n\tdx = Math.floor((G.getWidth() - dw) / 2);\n\tdy = Math.floor((G.getHeight() - dh) / 2);\n\n\tG.ctxPic.drawImage(G.img, sx, sy, sw, sh, dx, dy, dw, dh);\n\t/*G.ctxMask.fillStyle = \"rgba(0, 0, 0, 0.4)\";\n\tG.ctxMask.fillRect(0, 0, G.getWidth(), G.getHeight());*/\n}", "title": "" }, { "docid": "6d473b7e6a0d79afcd805af1d8b33da6", "score": "0.6216746", "text": "function renderCanvas() {\n canvas = document.querySelector('canvas');\n ctx = canvas.getContext('2d');\n var imageObj = new Image();\n imageObj.src = gCurrImg.url;\n ctx.drawImage(imageObj, 0, 0, canvas.width, canvas.height);\n renderLines();\n}", "title": "" }, { "docid": "f805ef3435d9db007c3e280c4a18e392", "score": "0.62075156", "text": "createCanvas () {\n let width = this.texture.width;\n let height = this.texture.height-50;\n if (!this._canvas) {\n this._canvas = document.createElement('canvas');\n\n this._canvas.width = width;\n this._canvas.height = height;\n }\n else {\n this.clearCanvas();\n }\n let ctx = this._canvas.getContext('2d');\n this.camera.render();\n let data = this.texture.readPixels();\n // write the render data\n let rowBytes = width * 4; \n for (let row = 0; row < height; row++) {\n let srow = height - 1 - row;\n let imageData = ctx.createImageData(width, 1);\n let start = srow * width * 4;\n for (let i = 0; i < rowBytes; i++) {\n // if ((i - 3) % 4 == 0) {\n // // cc.log (\"i \" + i + \" data \" + data[start + i]);\n // // imageData.data[i] = 255;\n // } else {\n // imageData.data[i] = data[start + i];\n // }\n imageData.data[i] = data[start + i];\n }\n\n ctx.putImageData(imageData, 0, row);\n }\n return this._canvas;\n }", "title": "" }, { "docid": "9a19bdd2ab6aa86409ddc86c9d3b5c87", "score": "0.6190052", "text": "function zoomOut(event) {\n var oldCols = canvas.width/scale;\n var oldRows = canvas.height/scale;\n if(scale>10){\n scale-=10;\n var newCols = canvas.width/scale;\n var newRows = canvas.height/scale;\n xOffset += Math.round((newCols - oldCols)/2);\n yOffset += Math.round((newRows - oldRows)/2);\n }\n drawBlueprint();\n}", "title": "" }, { "docid": "3d1f0d6510b4bcafb0c9bec88a40758b", "score": "0.618379", "text": "function zoomIn(event) {\n var oldCols = canvas.width/scale;\n var oldRows = canvas.height/scale;\n if(scale<80){\n scale+=10;\n var newCols = canvas.width/scale;\n var newRows = canvas.height/scale;\n xOffset -= Math.round((oldCols - newCols)/2);\n yOffset -= Math.round((oldRows - newRows)/2);\n }\n drawBlueprint();}", "title": "" }, { "docid": "821461eff52a211b28a3444443ae6c68", "score": "0.6173043", "text": "updateDrawing() {\n P5.image(this.graphicsBuffer, 0, 0);\n }", "title": "" }, { "docid": "c3022ea7716915d57927e47fafbe62f1", "score": "0.6164941", "text": "function updateCanvas(){\n\tctx.drawImage(canvasImgSource, 0, 0, canvas.width, canvas.height);\n\tctxIn.drawImage(canvasImgSource, 0, 0, canvas.width, canvas.height);\n}", "title": "" }, { "docid": "ccdde14c39669959f530a8234e1d3596", "score": "0.61515725", "text": "function CImgBuf(wide, tall) {\r\n//==============================================================================\r\n// Construct an 'image-buffer' object to hold a floating-point ray-traced image.\r\n// Contains BOTH\r\n//\tiBuf -- 2D array of 8-bit RGB pixel values we can display on-screen, AND\r\n//\tfBuf -- 2D array of floating-point RGB pixel values we often CAN'T display,\r\n// but contains full-precision results of ray-tracing.\r\n//\t\t\t--Both buffers hold the same numbers of pixel values (xSiz,ySiz,pixSiz)\r\n//\t\t\t--imgBuf.int2float() copies/converts current iBuf contents to fBuf\r\n//\t\t\t--imgBuf.float2int() copies/converts current fBuf contents to iBuf\r\n//\tWHY? \r\n//\t--Our ray-tracer computes floating-point light amounts(e.g. radiance L) \r\n// but neither our display nor our WebGL texture-map buffers can accept \r\n//\t\timages with floating-point pixel values.\r\n//\t--You will NEED all those floating-point values for applications such as\r\n// environment maps (re-lighting from sky image) and lighting simulations.\r\n// Stay simple in early versions of your ray-tracer: keep 0.0 <= RGB < 1.0, \r\n// but later you can modify your ray-tracer \r\n// to use radiometric units of Radiance (watts/(steradians*meter^2), or convert \r\n// to use photometric units of luminance (lumens/(steradians*meter^2 or cd/m^2) \r\n// to compute in physically verifiable units of visible light.\r\n\r\n\tthis.xSiz = wide;\t\t\t\t\t\t\t// image width in pixels\r\n\tthis.ySiz =\ttall;\t\t\t\t\t\t\t// image height in pixels\r\n\tthis.pixSiz = 3;\t\t\t\t\t\t\t// pixel size (3 for RGB, 4 for RGBA, etc)\r\n\tthis.iBuf = new Uint8Array( this.xSiz * this.ySiz * this.pixSiz);\t\r\n\tthis.fBuf = new Float32Array(this.xSiz * this.ySiz * this.pixSiz);\r\n\tthis.antiAliasing = 0;\r\n}", "title": "" }, { "docid": "823843dbf8678ab0874edc023441ba3f", "score": "0.6125147", "text": "drawImage(dx, dy, image) {\n dx = dx || 0;\n dy = dy || 0;\n let dyy;\n let dxx;\n let dyyPage;\n let dxxByte = null;\n let bufferOffset = 0;\n let page;\n let imageOffset;\n let pixelByte;\n let color;\n\n // outer loop through columns\n for (let x = 0; x < image.width; x++) {\n dxx = dx + x;\n if (this.clipped(dxx, null)) {\n continue;\n }\n page = -1; // reset page\n // inner loop through rows\n for (let y = 0; y < image.height; y++) {\n dyy = dy + y;\n if (this.clipped(null, dyy)) {\n continue;\n }\n // calculate buffer page for y coord\n dyyPage = Math.floor(dyy / 8);\n // check if new page\n if (dyyPage > page) {\n // if we have a byte and it differs from buffer then save\n if (dxxByte !== null && dxxByte !== this.buffer[bufferOffset]) {\n this.buffer[bufferOffset] = dxxByte;\n this.dirtyBytes[page] = this.dirtyBytes[page] || {};\n this.dirtyBytes[page][dxx] = dxxByte;\n }\n // prepare settings for new page\n page = dyyPage;\n bufferOffset = page * this.Config.displayColumns + dxx;\n dxxByte = this.buffer[bufferOffset];\n }\n // calculate offset into image data (4 bytes per RGBA pixel)\n imageOffset = (image.width * image.channels * y + image.channels * x);\n\n // transparency check\n if (image.channels === 2 || image.channels === 4) {\n if (!image.data[imageOffset + (image.channels - 1)]) { continue; }\n }\n\n // convert pixel y position into buffer column byte\n pixelByte = 0x01 << (dyy - 8 * dyyPage);\n // convert image pixel color to monochrome\n color = (image.channels < 3 ? image.data[imageOffset] : image.data[imageOffset] || image.data[imageOffset + 1] || image.data[imageOffset + 2]);\n\n // apply pixel to buffer byte\n if (color) {\n dxxByte |= pixelByte;\n }\n else {\n dxxByte &= ~pixelByte;\n }\n }\n // if we have a byte and it differs from buffer then save\n if (dxxByte !== null && dxxByte !== this.buffer[bufferOffset]) {\n // save byte\n this.buffer[bufferOffset] = dxxByte;\n this.dirtyBytes[page] = this.dirtyBytes[page] || {};\n this.dirtyBytes[page][dxx] = dxxByte;\n }\n dxxByte = null;\n }\n }", "title": "" }, { "docid": "4c53cfdfdeb5a03dd298e6109ca24045", "score": "0.6124233", "text": "async function zoom(buffer) {\n return sharp(buffer)\n .crop(sharp.gravity.center)\n .resize(1280, config.zoom)\n .toBuffer();\n }", "title": "" }, { "docid": "9da17b8f6704199e6e67d454efcc5b7c", "score": "0.6120511", "text": "render(timestamp){\n // for (let i = 0; i < this.vramSize; i += 4){\n // this._layerOne.data[i + 0] = this.vram[i + 0]\n // this._layerOne.data[i + 1] = this.vram[i + 1]\n // this._layerOne.data[i + 2] = this.vram[i + 2]\n // this._layerOne.data[i + 3] = 255\n // }\n\n // let that = this\n // console.log(timestamp)\n // console.log(1000/(timestamp - this.oldTime))\n this.fps = 1000/(timestamp - this.oldTime)\n this.oldTime = timestamp\n\n this.copyVramToImage()\n\n Promise.all([\n createImageBitmap(this._layerOne, {\n resizeQuality: 'pixelated',\n colorSpaceConversion: 'none',\n premultiplyAlpha: 'premultiply',\n resizeWidth: this.canvas.width,\n resizeHeight: this.canvas.height,\n })\n ]).then(function(bitmaps){\n // this.ctx.putImageData(this._imageData, 0, 0)\n\n this.ctx.drawImage(bitmaps[0], 0, 0)\n\n requestAnimationFrame(this.render.bind(this))\n }.bind(this))\n\n }", "title": "" }, { "docid": "96a3933ca06da8c118ea38916914cec4", "score": "0.6114568", "text": "function pickPoint(e){\n console.log(e)\n console.log(e.offsetX, e.offsetY)\n // var imgAryBaseWidth = window.baselevel.slice_size[0]\n var imgAryBaseWidth = window.baselevel.resolution[0] // tempXXX\n const rateCanvas = Math.ceil(canvas.width / canvasMinimap.width)\n const scaleRate = 1\n const rate = Math.ceil((imgAryBaseWidth / scaleRate) / canvas.width)\n // 縮圖置中,添加平移量\n const baseX = (canvasMinimap.width - imgAryBaseWidth / rate / rateCanvas) / 2\n var x = (e.offsetX - baseX) * rateCanvas\n var y = e.offsetY * rateCanvas\n // var pointer = canvas.getPointer({ x: 0, y: 0 });\n // var pointer = beforeRotateLeftTopCoord(window.theta, CenterCoord(), { x: 0, y: 0 })\n var pointer = CenterCoord()\n var ary = new Array(6)\n var ary = canvas.viewportTransform;\n var centerMoveMatirx = [1, 0, 0, 1, pointer.x - x, pointer.y - y]\n // console.log('--A--', JSON.stringify(ary))\n // var centerMoveMatirx = [1,0,0,1,10,10]\n ary = matrixProduct(ary, centerMoveMatirx) // 先平移\n // console.log('--B--', JSON.stringify(ary))\n canvas.setViewportTransform(ary);\n canvas.renderAll();\n clearTimeout(tt)\n tt = setTimeout(function(){\n var zoom = realZoom()\n var levelInfo = window.imgInfo.partition.find(function(item){\n return item.scaleRate < zoom || item.scaleRate === 1\n })\n var area = { x: shiftDrawArea(), y: shiftDrawArea(), w: window.tempCanvasWidth, h: window.tempCanvasWidth}\n var coordinate = leftTopCoord()\n if (window.theta !== 0) {\n var tempAngle = window.theta\n rotateSwitch(0)\n coordinate = leftTopCoord()\n rotateSwitch(tempAngle)\n }\n loadImgByLevelAndCanvasArea(levelInfo, coordinate, zoom, area)\n })\n }", "title": "" }, { "docid": "43d3e938383f490ed92cee8518721823", "score": "0.6097722", "text": "function Layer(width, height, canvas) {\n this.canvasSize = [width, height];\n this.canvas = canvas;\n this.context = this.canvas.getContext('2d');\n // Initializes the canvas\n this.initialize = function() {\n var maxHorizontalZoom = Math.floor(window.innerWidth/this.canvasSize[0]*0.75);\n var maxVerticalZoom = Math.floor(window.innerHeight/this.canvasSize[1]*0.75);\n\n zoom = Math.min(maxHorizontalZoom,maxVerticalZoom);\n if (zoom < 1) zoom = 1;\n\n //resize canvas\n this.canvas.width = this.canvasSize[0];\n this.canvas.height = this.canvasSize[1];\n this.canvas.style.width = (this.canvas.width*zoom)+'px';\n this.canvas.style.height = (this.canvas.height*zoom)+'px';\n\n //unhide canvas\n this.canvas.style.display = 'block';\n\n //center canvas in window\n this.canvas.style.left = 64+canvasView.clientWidth/2-(this.canvasSize[0]*zoom/2)+'px';\n this.canvas.style.top = 48+canvasView.clientHeight/2-(this.canvasSize[1]*zoom/2)+'px';\n\n this.context.imageSmoothingEnabled = false;\n this.context.mozImageSmoothingEnabled = false;\n };\n // Resizes canvas\n this.resize = function() {\n let newWidth = (this.canvas.width * zoom) + 'px';\n let newHeight = (this.canvas.height *zoom)+ 'px';\n\n this.canvas.style.width = newWidth;\n this.canvas.style.height = newHeight;\n };\n // Copies the otherCanvas' position and size\n this.copyData = function(otherCanvas) {\n this.canvas.style.width = otherCanvas.canvas.style.width;\n this.canvas.style.height = otherCanvas.canvas.style.height;\n\n this.canvas.style.left = otherCanvas.canvas.style.left;\n this.canvas.style.top = otherCanvas.canvas.style.top;\n };\n}", "title": "" }, { "docid": "cc72e52476809d5b9136ab1bca6eaabd", "score": "0.60591197", "text": "function updateCanvasSize(){\n\n canvas.width = params.width;\n canvas.height = params.height;\n\n zoomCanvas();\n\n params.width = canvas.width;\n params.height = canvas.height;\n gl.viewport( 0, 0, canvas.width, canvas.height );\n createRenderTargets();\n params.step = 0;\n params.doConfig = 1;\n }", "title": "" }, { "docid": "c94600d5fa2af2f238fe9eb098afddf9", "score": "0.604687", "text": "function drawPixels(canvasId, imageData) {\n var context2d = getContext2d(canvasId);\n context2d.putImageData(imageData, 0, 0);\n }", "title": "" }, { "docid": "291e2ba957c88c47091f0cef22295ad4", "score": "0.603797", "text": "draw() {\r\n this.context.drawImage(this.img, 0, 0, this.img.width, this.img.height, (this.canvas.width - this.img.width * this.ratio)/2, (this.canvas.height - this.img.height * this.ratio)/2, (this.img.width * this.ratio), (this.img.height * this.ratio));\r\n }", "title": "" }, { "docid": "7de1a5357b8f04a082fceb65df329770", "score": "0.60340315", "text": "function draw(img) {\n\tconst data = img.dataSync();\n\tconst multiplier = 500;\n\tconst imageData = new ImageData(width, height);\n\n\tfor (let i = 0; i < height * width; ++i) {\n\t\tconst j = i * 4;\n\t\timageData.data[j + 0] = data[i] * multiplier;\n\t\timageData.data[j + 1] = data[i] * multiplier;\n\t\timageData.data[j + 2] = data[i] * multiplier;\n\t\timageData.data[j + 3] = 255;\n\n\t}\n\n\tif (canvas != null) {\n\t\tconst ctx = canvas.getContext('2d');\n\t\tctx.putImageData(imageData, 0, 0);\n\t}\n}", "title": "" }, { "docid": "df3faff3ca5c5273bc52105a96c123b6", "score": "0.6028558", "text": "function draw () {\n\t\tdrawVisual = requestAnimationFrame(draw);\n\n\t\tanalyser.getByteTimeDomainData(dataArray);\n\n\t\tcanvasCtx.fillStyle = 'rgb(46,19,114)';\n\t\tcanvasCtx.fillRect(0, 0, WIDTH, HEIGHT);\n\t\t\n\t\tcanvasCtx.lineWidth = 4;\n\t\tcanvasCtx.strokeStyle = '#1ADB6F';\n\n\t\tcanvasCtx.beginPath();\n\n\t\tvar sliceWidth = WIDTH * 1.0 / bufferLength;\n\t\tvar x = 0\n\n\t\tfor(var i = 0; i < bufferLength; i++) {\n \n \tvar v = dataArray[i] / 128.0;\n \tvar y = v * HEIGHT/2;\n\n \tif(i === 0) {\n \t\tcanvasCtx.moveTo(x, y);\n \t} else {\n \t\tcanvasCtx.lineTo(x, y);\n \t}\n\n \tx += sliceWidth;\n \t}\t\n\n \tcanvasCtx.lineTo(canvas.width, canvas.height/2);\n \tcanvasCtx.stroke();\n\t}", "title": "" }, { "docid": "2ad65cf79a70d86bc70bb1f2659204ed", "score": "0.6018335", "text": "function renderFrame() {\n let oldFrame;\n\n // 1. Capture to offscreen buffer\n offscreenCtx.drawImage(cameraEl, 0, 0);\n\n // 2. Read the pixel data from this buffer\n let frame = offscreenCtx.getImageData(\n 0,\n 0,\n offscreenCanvasEl.width,\n offscreenCanvasEl.height\n );\n\n const totalPixels = frame.data.length / 4; // Get total number of pixels by dividing by 4 (since each pixel uses 4 values)\n for (let pixelIndex = 0; pixelIndex < totalPixels; pixelIndex++) {\n // Save each color channel of the pixel\n const r = frame.data[pixelIndex * 4 + 0];\n const g = frame.data[pixelIndex * 4 + 1];\n const b = frame.data[pixelIndex * 4 + 2];\n\n // Calculate the \"blueishness\" of the pixel\n const blueishness = b - (r + g) / 2;\n\n if (blueishness < 40) {\n // If it's not blue we make the pixel transparent\n frame.data[pixelIndex * 4 + 3] = 0;\n } else {\n // If it's blue enough we set it to pink\n frame.data[pixelIndex * 4 + 0] = 255;\n frame.data[pixelIndex * 4 + 2] = 128;\n }\n }\n\n // Add the frame to our buffer array to be able to delay the rendering\n frameBuffer.push(frame);\n if (frameBuffer.length > 30) {\n // Remove the oldest frames and save it for later\n oldFrame = frameBuffer.shift();\n }\n\n // Draw the camera picture to the screen\n ctx.drawImage(cameraEl, 0, 0);\n\n if (delay && oldFrame) {\n // Write our old modified frame back to the buffer and\n // draw buffer to the visible canvas\n offscreenCtx.putImageData(oldFrame, 0, 0);\n ctx.drawImage(offscreenCanvasEl, 0, 0);\n } else if (!delay) {\n // Write our modified frame back to the buffer and\n // draw buffer to the visible canvas\n offscreenCtx.putImageData(frame, 0, 0);\n ctx.drawImage(offscreenCanvasEl, 0, 0);\n }\n\n // Repeat!\n window.requestAnimationFrame(renderFrame);\n}", "title": "" }, { "docid": "e7e6c5463d6c3b66ee481e312065817a", "score": "0.6008731", "text": "update (data) {\n let canvas = this.refs.canvas.getContext('2d');\n let img = new Image();\n img.onload = function () {\n //canvas.clearRect(0,0,2000,2000);\n canvas.drawImage(this, 0, 0);\n }\n img.src = data;\n }", "title": "" }, { "docid": "517b272f692f8db940ed40225e3ac7cd", "score": "0.6008491", "text": "function blit_pixels(viewport, transform, pixels, viewport_size, mono){\n var ctx = viewport.getContext(\"2d\");\n var imageData = ctx.getImageData(0, 0, viewport.width, viewport.height);\n var target = imageData.data;\n for(var y = 0; y < viewport_size; y++)\n {\n for(var x = 0; x < viewport_size; x++)\n {\n var posn = pair(x,y);\n var transposn = transform(posn); \n var srcIdx = 4*(viewport_size * y + x);\n var destIdx = 4*(viewport.width * Math.round(posn_y(transposn)) + Math.round(posn_x(transposn)));\n if(mono){\n var avg = Math.round(pixels[srcIdx+0] + pixels[srcIdx+1] + pixels[srcIdx+2])/3;\n target[destIdx+0] = avg;\n target[destIdx+1] = avg;\n target[destIdx+2] = avg;\n }else{\n target[destIdx+0] = pixels[srcIdx+0];\n target[destIdx+1] = pixels[srcIdx+1];\n target[destIdx+2] = pixels[srcIdx+2];\n }\n target[destIdx+3] = 255;\n }\n }\n var buffer = document.createElement(\"Canvas\");\n buffer.width = ctx.canvas.width;\n buffer.height = ctx.canvas.height;\n buffer.getContext(\"2d\").putImageData(imageData, 0, 0);\n ctx.scale(antialias, antialias);\n ctx.drawImage(buffer, 0 , 0);\n}", "title": "" }, { "docid": "55556abc4bd49715daa173e787c2e203", "score": "0.60031", "text": "_bindCanvas() {\n\t\tconst {width, height} = this.state;\n\t\tconst {image, step} = this.props;\n\t\tconst canvas = document.querySelector('#strenght-canvas');\n\t\tconst ctx = canvas.getContext('2d');\n\n\t\tconst img = loadImage(image);\n\n\t\timg.onload = function () {\n\t\t\tctx.fillStyle = \"red\";\n\t\t\tctx.drawImage(this, 0, 0, width, height);\n\n\t\t\tconst imageData = ctx.getImageData(0, 0, width, height);\n\t\t\tconst data = imageData.data;\n\n\t\t\tfor (var i = 0; i < data.length; i += 4) {\n\t\t\t\tif(data[i] > (50 * step) && step < 8) {\n\t\t\t\t\tdata[i] = 0;\n\t\t\t\t\tdata[i+1] = data[i];\n\t\t\t\t\tdata[i+2] = data[i] + 10;\n\t\t\t\t}else {\n\t\t\t\t\tdata[i] = data[i];\n\t\t\t\t\tdata[i+1] = data[i+1];\n\t\t\t\t\tdata[i+2] = data[i+2];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tctx.putImageData(imageData, 0, 0);\n\t\t}\n\t}", "title": "" }, { "docid": "98bb84a9295d8b6fbe923ec3b9746d7f", "score": "0.59990275", "text": "constructor(image, scale, callback, isPreview){\n\n this.image = image;\n this.isPreview = isPreview;\n this.scale = scale || 1;\n\n this.width = this.image.metaData.width;\n this.height = this.image.metaData.height;\n this.scaleMin = this.image.scaling.scaleMin;\n this.scaleMax = this.image.scaling.scaleMax;\n this.sample = Math.floor(1 / this.scale);\n this.targetWidth = Math.floor(this.width * this.scale);\n this.targetHeight = Math.floor(this.height * this.scale);\n\n let tmpCanvas = document.createElement('canvas');\n tmpCanvas.width = this.targetWidth;\n tmpCanvas.height = this.targetHeight;\n\n let tmpCtx = this.tmpCtx = tmpCanvas.getContext('2d');\n\n let data = {\n width: this.width,\n height: this.height,\n targetWidth: this.targetWidth,\n targetHeight: this.targetHeight,\n sample: this.sample,\n scaleMin: this.scaleMin,\n scaleMax: this.scaleMax,\n imageData: this.image.imageData,\n colors: this.image.scaling.colors,\n scaleFunction: this.image.scaling.scaleFunction,\n tmpContext: this.tmpCtx.getImageData(0,0,this.targetWidth, this.targetHeight)\n };\n\n if(isPreview){\n this.render(data, callback);\n }else{\n this.workerRender(data, function(imageData){\n tmpCtx.putImageData(imageData, 0, 0);\n let url = tmpCtx.canvas.toDataURL(),\n img = new Image();\n img.src = url;\n callback(img);\n });\n }\n\n }", "title": "" }, { "docid": "38085e6a3412840a0b99fec363e4d031", "score": "0.5987512", "text": "function saveDrawingSurface(){\n\t\n\t\tvar imageData=context.getImageData(0,0, canvas.width, canvas.height);\n\n}", "title": "" }, { "docid": "2d59a60aac62cdd888e284a78cf3afa6", "score": "0.59859693", "text": "draw(){\n this.context.drawImage(this.img, this.x, this.y);\n }", "title": "" }, { "docid": "2d4d72722fcefd98944285e356d8430b", "score": "0.5984148", "text": "function renderImageToCanvas(img, canvas, width, height) {\n var iw = img.naturalWidth;\n var ih = img.naturalHeight;\n var ctx = canvas.getContext('2d');\n canvas.width = width;\n canvas.height = height;\n ctx.save();\n\n var subsampled = detectSubsampling(img);\n if (subsampled) {\n iw /= 2;\n ih /= 2;\n }\n\n var d = 1024; // size of tiling canvas\n var tilingCanvas = document.createElement('canvas');\n tilingCanvas.width = tilingCanvas.height = d;\n var tilingCtx = tilingCanvas.getContext('2d');\n var vertSquashRatio = detectVerticalSquash(img, iw, ih);\n\n var sy = 0;\n while (sy < ih) {\n var sh = sy + d > ih ? ih - sy : d;\n var sx = 0;\n while (sx < iw) {\n var sw = sx + d > iw ? iw - sx : d;\n tilingCtx.clearRect(0, 0, d, d);\n tilingCtx.drawImage(img, -sx, -sy);\n var dx = sx * width / iw << 0;\n var dw = Math.ceil(sw * width / iw);\n var dy = sy * height / ih / vertSquashRatio << 0;\n var dh = Math.ceil(sh * height / ih / vertSquashRatio);\n ctx.drawImage(tilingCanvas, 0, 0, sw, sh, dx, dy, dw, dh);\n sx += d;\n }\n\n sy += d;\n }\n\n ctx.restore();\n tilingCanvas = tilingCtx = null;\n}", "title": "" }, { "docid": "1a1c88ca902f7ba47a072b93edec96da", "score": "0.59780794", "text": "drawFromBuffer () {\n\t\tdisplaySystem.updateBufferFOV();\n\t\tdisplaySystem.updateBuffer();\n\n\t\tdisplay.clear();\n\t\tlogger.showMessages();\n\t\tfor (let i = 0; i < bufferOptions.width; i++) {\n\t\t\tfor (let j = 0; j < bufferOptions.height; j++) {\n\t\t\t\tlet pos = i + (j * bufferOptions.width);\n\n\t\t\t\t//draw separating line between game and log/information\n\t\t\t\tfor (let k = 0; k < bufferOptions.height; k++) {\n\t\t\t\t\tdisplay.draw(bufferOptions.width, k, \"|\", \"#ffffff\")\n\t\t\t\t}\n \t\t\t\t\n\t\t\t\t//idea: \"flipped mode\" where i and j are flipped as a status effect\n\t\t\t\tif (this.buffer[pos]) { display.draw(i, j, this.buffer[pos][0], this.buffer[pos][1], this.buffer[pos][2]);}\n\t\t\t\telse {display.draw(i,j,'','','#000000')}\n\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "5764c0eb56cc20747429b9da4ea9127b", "score": "0.5965301", "text": "function initCanvas() {\n //Choose zoom level to fit image inside canvas\n currZoom = 1.0;\n var fitWidthScale = window.cc.canvas.clientWidth / imgs[0][0].naturalWidth;\n var fitHeightScale = window.cc.canvas.clientHeight / imgs[0][0].naturalHeight;\n if (fitWidthScale < fitHeightScale) {\n currZoom = fitWidthScale;\n } else {\n currZoom = fitHeightScale;\n }\n window.cc.scale(currZoom, currZoom);\n\n //Move (0,0) from top-left of canvas to centre\n window.cc.translate(window.cc.canvas.clientWidth / currZoom / 2, window.cc.canvas.clientHeight / currZoom / 2);\n\n //Find where top-left of image should be positioned\n imgTopLeft = [-imgs[0][0].naturalWidth / 2, -imgs[0][0].naturalHeight / 2];\n\n userRotateEnabled = true;\n userPanEnabled = true;\n userZoomEnabled = true;\n}", "title": "" }, { "docid": "4b5785262f8b44f4a07b9c41b60f6bfe", "score": "0.5957516", "text": "renderFrame() {\n // Check if we have new graphics to show\n if (!this.imageDataArrayChanged) {\n return;\n }\n this.imageDataArrayChanged = false;\n\n // Check for a callback for accessing image data\n if (this.updateGraphicsCallback) {\n this.updateGraphicsCallback(this.imageDataArray);\n }\n\n // Set the imageDataArray to our plugins\n WasmBoyPlugins.runHook({\n key: 'graphics',\n params: [this.imageDataArray],\n callback: response => {\n if (response) {\n this.imageDataArray = response;\n }\n }\n });\n\n // Add our new imageData\n this.canvasImageData.data.set(this.imageDataArray);\n\n this.canvasContext.clearRect(0, 0, this.canvasElement.width, this.canvasElement.height);\n this.canvasContext.putImageData(this.canvasImageData, 0, 0);\n }", "title": "" }, { "docid": "340df2fa63931a9764378319b4b315b8", "score": "0.59360313", "text": "async function zoom(buffer) {\n\t\treturn sharp(buffer)\n\t\t\t.crop(sharp.gravity.center)\n\t\t\t.resize(1280, config.zoom)\n\t\t\t.toBuffer();\n\t}", "title": "" }, { "docid": "6227ea2c147325bc03f3ece9ce433209", "score": "0.5933869", "text": "function main() {\n\n // Get the canvas and context\n var canvas = document.getElementById(\"viewport\");\n var context = canvas.getContext(\"2d\");\n\tcontext.translate(0,context.canvas.height);\n\tcontext.scale(1,-1);\n\t\n\n \n // Create the image\n //drawRandPixels(context);\n // shows how to draw pixels\n \n drawRandPixelsInInputEllipsoids(context);\n // shows how to draw pixels and read input file\n \n //drawInputEllipsoidsUsingArcs(context);\n // shows how to read input file, but not how to draw pixels\n}", "title": "" }, { "docid": "7afeba09a2e3beeacbdfde2b59d53a5a", "score": "0.5932826", "text": "function renderFrame() {\n let offscreenC = offscreenCanvasEl.getContext('2d');\n let c = canvasEl.getContext('2d');\n\n // 1. Capture to offscreen canvas\n offscreenC.drawImage(cameraEl, 0, 0);\n\n // 2. Do whatever processing we want to the this buffer\n // Example from: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Manipulating_video_using_canvas\n let frame = offscreenC.getImageData(0, 0, offscreenCanvasEl.width, offscreenCanvasEl.height);\n\n let diffCount = 0;\n\n // 4 is used here since frame is represented as R G B A\n let l = frame.data.length / 4;\n if (oldFrame !== null) {\n for (let i = 0; i < l; i++) {\n if (comparePixel(frame, i)) {\n frame.data[i * 4 + 3] = 0; // Set alpha to 0, transparent\n diffCount++;\n }\n }\n }\n // Draw something in the background\n var gradient = c.createLinearGradient(0, 0, canvasEl.width, canvasEl.height);\n gradient.addColorStop(0, 'deeppink');\n gradient.addColorStop(1, 'palegreen');\n\n c.fillStyle = gradient;\n c.fillRect(0, 0, canvasEl.width, canvasEl.height);\n\n // Write image data to destination context\n offscreenC.putImageData(frame, 0, 0);\n\n c.drawImage(offscreenCanvasEl, 0, 0);\n\n // % of image that has changed\n diffCount = 100 - parseInt(100 * (diffCount / (frame.data.length / 4)));\n c.fillStyle = 'white';\n c.font = '48px \"Fira Code\", Monaco, \"Andale Mono\", \"Lucida Console\", \"Bitstream Vera Sans Mono\", \"Courier New\", Courier, monospace';\n c.fillText(diffCount + \"%\", 100, 100);\n\n let now = Date.now();\n let keepFrame = true;\n\n // If we want, we could change when we hold on to the last frame,\n // eg to only update it every so often, or to keep a single reference frame\n\n // This only updates the reference frame every 1 second\n // if (now - oldFrameCapturedAt < 11000) keepFrame = false;\n\n // This only keeps a single reference frame and never updates it\n //if (oldFrame !== null) keepFrame = false;\n\n // Remember last frame\n if (keepFrame) {\n oldFrame = frame;\n oldFrameCapturedAt = now;\n }\n\n // Repeat!\n window.requestAnimationFrame(renderFrame);\n}", "title": "" }, { "docid": "6fa5245c34e87690d6c472b4e601ea65", "score": "0.5928093", "text": "function draw() {\n var drawVisual = requestAnimationFrame(draw);\n\n analyser.getByteTimeDomainData(dataArray);\n\n canvasCtx.fillStyle = \"rgb(240,128,128)\";\n canvasCtx.fillRect(0, 0, canvas.width, canvas.height);\n\n canvasCtx.lineWidth = 2;\n canvasCtx.strokeStyle = \"rgb(50, 150, 127)\";\n\n canvasCtx.beginPath();\n\n var sliceWidth = (canvas.width * 1.0) / bufferLength;\n var x = 0;\n\n for (var i = 0; i < bufferLength; i++) {\n var v = dataArray[i] / 128.0;\n var y = (v * canvas.height) / 2;\n\n if (i === 0) {\n canvasCtx.moveTo(x, y);\n } else {\n canvasCtx.lineTo(x, y);\n }\n\n x += sliceWidth;\n }\n\n canvasCtx.lineTo(canvas.width, canvas.height / 2);\n canvasCtx.stroke();\n}", "title": "" }, { "docid": "b8b580569a0b3e13c7e3a2b235293a33", "score": "0.5911935", "text": "function directImage() {\n if (trueMagnification !== 1) {\n console.error('directImage: Magnification is not equal to 1, it is ' + trueMagnification);\n return;\n }\n console.log('directImage');\n output.startDrawing();\n output.pixels.update();\n const pixels = output.pixels;\n const width = output.canvas.width;\n const height = width;\n let imageIndex = 0;\n // going over image pixels, skipping border cells\n for (var j = 0; j < height; j++) {\n // skip first two cell rows (border)\n const jCellSize = size * (2 + j);\n for (var i = 0; i < width; i++) {\n // skip first two cell columns (border)\n const cell = cells[jCellSize + i + 2];\n if (cell < -20) {\n pixels.array[imageIndex] = colorForMoverLeft;\n } else if (cell < -10) {\n pixels.array[imageIndex] = colorForMoverRight;\n } else if (cell < 0) {\n pixels.array[imageIndex] = colorForMover;\n } else {\n pixels.array[imageIndex] = colors[cell];\n }\n imageIndex += 1;\n }\n }\n output.pixels.show();\n}", "title": "" }, { "docid": "9e85c5190bb308ae9b0ed2acadfd15a0", "score": "0.5899221", "text": "display() {\n let sx = this.raw ? 0 : cs.camera.getX()\n let sy = this.raw ? 0 : cs.camera.getY()\n let sWidth = this.raw ? this.canvas.width : cs.camera.getWidth()\n let sHeight = this.raw ? this.canvas.height : cs.camera.getHeight()\n\n // We will have to scale the X over becuse safari doesnt act like chrome\n const dx = sx < 0 ? Math.floor(cs.camera.getScale() * (cs.camera.getX() * -1)) : 0\n const dy = sy < 0 ? Math.floor(cs.camera.getScale() * (cs.camera.getY() * -1)) : 0\n const dWidth = sWidth <= this.canvas.width\n ? cs.view.width\n : cs.view.width - Math.floor(cs.camera.getScale() * ((cs.camera.getWidth()) - this.canvas.width))\n const dHeight = sHeight <= this.canvas.height\n ? cs.view.height\n : cs.view.height - Math.floor(cs.camera.getScale() * ((cs.camera.getHeight()) - this.canvas.height))\n\n if (sx < 0) {\n sx = 0\n sWidth += sx * -1\n }\n if (sy < 0) {\n sy = 0\n sHeight += sy * -1\n }\n if (sWidth > this.canvas.width) sWidth = this.canvas.width\n if (sHeight > this.canvas.height) sWidth = this.canvas.height\n\n cs.view.ctx.drawImage(this.canvas,\n sx, sy, sWidth, sHeight,\n dx, dy, dWidth, dHeight)\n }", "title": "" }, { "docid": "ca104ce1178123771c0cc6f3ec176b23", "score": "0.58842003", "text": "function drawBlendImage(messageEvent) {\n logOnce_1('main thread - ', messageEvent.data);\n blendImageData\n .data\n .set(\n new Uint8ClampedArray(messageEvent.data)\n );\n\n blendCtx.putImageData(blendImageData, 0, 0);\n previousImageData = currentImageData;\n}", "title": "" }, { "docid": "3818b9ad0b1ab5ea4e805e53893ac4e0", "score": "0.58829224", "text": "function _zoom() {\n step++\n if (step < 20) {\n self._zoomFrame = requestAnimationFrame(_zoom)\n }\n var tickZoom = easeOutQuart(step, curPerc, perc - curPerc, 20)\n\n var ratio = tickZoom / curPerc,\n imgWidth = imageDim.w * tickZoom / 100,\n imgHeight = imageDim.h * tickZoom / 100,\n newLeft = -((point.x - curLeft) * ratio - point.x),\n newTop = -((point.y - curTop) * ratio - point.y)\n\n var baseLeft = Math.max((containerDim.w - imgWidth) / 2, 0),\n baseTop = Math.max((containerDim.h - imgHeight) / 2, 0),\n baseRight = containerDim.w - baseLeft,\n baseBottom = containerDim.h - baseTop\n\n newLeft = Math.min(newLeft, baseLeft)\n newTop = Math.min(newTop, baseTop)\n\n //fix for right and bottom\n if ((newLeft + imgWidth) < baseRight) {\n newLeft = baseRight - imgWidth //newLeft - (newLeft + imgWidth - baseRight)\n }\n if ((newTop + imgHeight) < baseBottom) {\n newTop = baseBottom - imgHeight //newTop + (newTop + imgHeight - baseBottom)\n }\n curImg.style.width = imgWidth + 'px'\n curImg.style.height = imgHeight + 'px'\n curImg.style.left = newLeft + 'px'\n curImg.style.top = newTop + 'px'\n\n self.zoomValue = tickZoom\n }", "title": "" }, { "docid": "07cc27b4154126e080a854d9c3d5bd25", "score": "0.58762825", "text": "renderDataBuffer( dataBuffer, dataMaterial )\n { \n \n // render data into copy texture\n gl.bindFramebuffer( gl.FRAMEBUFFER, this._rtCopyBuffer.fbo() );\n gl.clear( gl.COLOR_BUFFER_BIT );\n \n dataMaterial.apply(); \n this._screenQuadMesh.render(); \n \n // render copy texture into data texture\n gl.bindFramebuffer( gl.FRAMEBUFFER, dataBuffer );\n gl.clear( gl.COLOR_BUFFER_BIT );\n \n this._copyMaterial.apply(); \n this._screenQuadMesh.render(); \n }", "title": "" }, { "docid": "6e78f714ba12b82e7ca7937fcdc995e2", "score": "0.58723897", "text": "draw() {\n if (!this.img) return;\n ctx.drawImage(this.img, this.x, this.y);\n ctx.drawImage(this.img, this.x + W, 0);\n }", "title": "" }, { "docid": "ee696d12fe5305d93eac14e51af829a4", "score": "0.5871594", "text": "function copy() {\n imgData = ctx.getImageData(0, 0, canvas.width, canvas.height);\n}", "title": "" }, { "docid": "01c5e47397a1d67de79759e8560eab67", "score": "0.5870759", "text": "draw(ctx) {\n ctx.drawImage(\n this.image,\n this.position.x,\n this.position.y,\n this.size,\n this.size\n );\n }", "title": "" }, { "docid": "a20010b74f92954bc7764c1a1fcda2ff", "score": "0.58594215", "text": "updateCanvas() {\n this.ctx.putImageData(this.imageData, 0, 0)\n return this.ctx.canvas\n }", "title": "" }, { "docid": "38e003eaf69fa6868b08f647059d102d", "score": "0.58476776", "text": "function drawImage(canvas) {\n var context = canvas.node().getContext(\"2d\"),\n image = context.createImageData(dx, dy);\n\n //for (var y = 0, p = -1; y < dy; ++y) {\n for (var y = dy-1, p = -1; y >= 0; --y) {\n for (var x = 0; x < dx; ++x) {\n if (mapdata[y][x] < 0.) {\n image.data[++p] = 200;\n image.data[++p] = 200;\n image.data[++p] = 210;\n image.data[++p] = 255;\n } else {\n var c = d3.rgb(color(mapdata[y][x]));\n image.data[++p] = c.r;\n image.data[++p] = c.g;\n image.data[++p] = c.b;\n image.data[++p] = 255;\n }\n }\n }\n\n context.putImageData(image, 0, 0);\n }", "title": "" }, { "docid": "dedeb8d1234809e0adc59ba014af6a62", "score": "0.5847137", "text": "function renderImageToCanvas(img, canvas, options) {\r\n var iw = img.naturalWidth,\r\n ih = img.naturalHeight;\r\n var width = options.width,\r\n height = options.height;\r\n var ctx = canvas.getContext('2d');\r\n ctx.save();\r\n transformCoordinate(canvas, width, height, options.orientation);\r\n var subsampled = detectSubsampling(img);\r\n if (subsampled) {\r\n iw /= 2;\r\n ih /= 2;\r\n }\r\n var d = 1024; // size of tiling canvas\r\n var tmpCanvas = document.createElement('canvas');\r\n tmpCanvas.width = tmpCanvas.height = d;\r\n var tmpCtx = tmpCanvas.getContext('2d');\r\n var vertSquashRatio = detectVerticalSquash(img, iw, ih);\r\n var dw = Math.ceil(d * width / iw);\r\n var dh = Math.ceil(d * height / ih / vertSquashRatio);\r\n var sy = 0;\r\n var dy = 0;\r\n while (sy < ih) {\r\n var sx = 0;\r\n var dx = 0;\r\n while (sx < iw) {\r\n tmpCtx.clearRect(0, 0, d, d);\r\n tmpCtx.drawImage(img, -sx, -sy);\r\n ctx.drawImage(tmpCanvas, 0, 0, d, d, dx, dy, dw, dh);\r\n sx += d;\r\n dx += dw;\r\n }\r\n sy += d;\r\n dy += dh;\r\n }\r\n ctx.restore();\r\n tmpCanvas = tmpCtx = null;\r\n }", "title": "" }, { "docid": "7d7ea2b3e887d39b3ad5db14b431fc99", "score": "0.5846274", "text": "function img_update () {\r\n\t\tcontexto.drawImage(canvas, 0, 0);\r\n\t\tcontext.clearRect(0, 0, canvas.width, canvas.height);\r\n }", "title": "" }, { "docid": "a803035406feab74e81384f6829a3c80", "score": "0.5832754", "text": "render(cameraX, cameraY, cameraScaleX, cameraScaleY, cameraZoom){}", "title": "" }, { "docid": "3947f35a4721e8c03fa55cfe2c9d0876", "score": "0.5832374", "text": "function writeToCanvas(){\n\t//Create off-screen canvas\n\tvar temp_canvas = document.createElement('canvas'),\n\t\ttemp_canvas_context = temp_canvas.getContext('2d'),\n\t\twrite_y = 0,\n\t\twrite_x = 0;\n\t\n\ttemp_canvas.width = width;\n\ttemp_canvas.height = height;\n\t\n\t// put pixel data on canvas\n\tfor (x = 0; x < individual_blocks.length; x++){\n\t\t//reset to create a new row of blocks\n\t\tif(write_y * block_size > height - block_size){\n\t\t\twrite_y = 0;\n\t\t\twrite_x++;\n\t\t}\n\t\t//Write to temp canvas\n\t\ttemp_canvas_context.putImageData(individual_blocks[x], write_x*block_size, write_y*block_size);\n\t\t//Increment row count\n\t\twrite_y++;\n\t}\n\n\t//Write to final canvas fully rendered effects\n\tcanvas_context.drawImage(temp_canvas, 0, 0);\n\t\n}", "title": "" }, { "docid": "40e9a20ee5e9f999dd9252a2fe69464a", "score": "0.58318746", "text": "function renderImageToCanvas(img, canvas, options) {\n\t\tvar iw = img.naturalWidth, ih = img.naturalHeight;\n\t\tvar width = options.width, height = options.height;\n\t\tvar x = options.x || 0, y = options.y || 0;\n\t\tvar ctx = canvas.getContext('2d');\n\t\tif (detectSubsampling(img)) {\n\t\t\tiw /= 2;\n\t\t\tih /= 2;\n\t\t}\n\t\tvar d = 1024; // size of tiling canvas\n\t\tvar tmpCanvas = document.createElement('canvas');\n\t\ttmpCanvas.width = tmpCanvas.height = d;\n\t\tvar tmpCtx = tmpCanvas.getContext('2d');\n\t\tvar vertSquashRatio = detectVerticalSquash(img, iw, ih);\n\t\tvar sy = 0;\n\t\twhile (sy < ih) {\n\t\t\tvar sh = sy + d > ih ? ih - sy : d;\n\t\t\tvar sx = 0;\n\t\t\twhile (sx < iw) {\n\t\t\t\tvar sw = sx + d > iw ? iw - sx : d;\n\t\t\t\ttmpCtx.clearRect(0, 0, d, d);\n\t\t\t\ttmpCtx.drawImage(img, -sx, -sy);\n\t\t\t\tvar dx = (sx * width / iw + x) << 0;\n\t\t\t\tvar dw = Math.ceil(sw * width / iw);\n\t\t\t\tvar dy = (sy * height / ih / vertSquashRatio + y) << 0;\n\t\t\t\tvar dh = Math.ceil(sh * height / ih / vertSquashRatio);\n\t\t\t\tctx.drawImage(tmpCanvas, 0, 0, sw, sh, dx, dy, dw, dh);\n\t\t\t\tsx += d;\n\t\t\t}\n\t\t\tsy += d;\n\t\t}\n\t\ttmpCanvas = tmpCtx = null;\n\t}", "title": "" }, { "docid": "40e9a20ee5e9f999dd9252a2fe69464a", "score": "0.58318746", "text": "function renderImageToCanvas(img, canvas, options) {\n\t\tvar iw = img.naturalWidth, ih = img.naturalHeight;\n\t\tvar width = options.width, height = options.height;\n\t\tvar x = options.x || 0, y = options.y || 0;\n\t\tvar ctx = canvas.getContext('2d');\n\t\tif (detectSubsampling(img)) {\n\t\t\tiw /= 2;\n\t\t\tih /= 2;\n\t\t}\n\t\tvar d = 1024; // size of tiling canvas\n\t\tvar tmpCanvas = document.createElement('canvas');\n\t\ttmpCanvas.width = tmpCanvas.height = d;\n\t\tvar tmpCtx = tmpCanvas.getContext('2d');\n\t\tvar vertSquashRatio = detectVerticalSquash(img, iw, ih);\n\t\tvar sy = 0;\n\t\twhile (sy < ih) {\n\t\t\tvar sh = sy + d > ih ? ih - sy : d;\n\t\t\tvar sx = 0;\n\t\t\twhile (sx < iw) {\n\t\t\t\tvar sw = sx + d > iw ? iw - sx : d;\n\t\t\t\ttmpCtx.clearRect(0, 0, d, d);\n\t\t\t\ttmpCtx.drawImage(img, -sx, -sy);\n\t\t\t\tvar dx = (sx * width / iw + x) << 0;\n\t\t\t\tvar dw = Math.ceil(sw * width / iw);\n\t\t\t\tvar dy = (sy * height / ih / vertSquashRatio + y) << 0;\n\t\t\t\tvar dh = Math.ceil(sh * height / ih / vertSquashRatio);\n\t\t\t\tctx.drawImage(tmpCanvas, 0, 0, sw, sh, dx, dy, dw, dh);\n\t\t\t\tsx += d;\n\t\t\t}\n\t\t\tsy += d;\n\t\t}\n\t\ttmpCanvas = tmpCtx = null;\n\t}", "title": "" }, { "docid": "40e9a20ee5e9f999dd9252a2fe69464a", "score": "0.58318746", "text": "function renderImageToCanvas(img, canvas, options) {\n\t\tvar iw = img.naturalWidth, ih = img.naturalHeight;\n\t\tvar width = options.width, height = options.height;\n\t\tvar x = options.x || 0, y = options.y || 0;\n\t\tvar ctx = canvas.getContext('2d');\n\t\tif (detectSubsampling(img)) {\n\t\t\tiw /= 2;\n\t\t\tih /= 2;\n\t\t}\n\t\tvar d = 1024; // size of tiling canvas\n\t\tvar tmpCanvas = document.createElement('canvas');\n\t\ttmpCanvas.width = tmpCanvas.height = d;\n\t\tvar tmpCtx = tmpCanvas.getContext('2d');\n\t\tvar vertSquashRatio = detectVerticalSquash(img, iw, ih);\n\t\tvar sy = 0;\n\t\twhile (sy < ih) {\n\t\t\tvar sh = sy + d > ih ? ih - sy : d;\n\t\t\tvar sx = 0;\n\t\t\twhile (sx < iw) {\n\t\t\t\tvar sw = sx + d > iw ? iw - sx : d;\n\t\t\t\ttmpCtx.clearRect(0, 0, d, d);\n\t\t\t\ttmpCtx.drawImage(img, -sx, -sy);\n\t\t\t\tvar dx = (sx * width / iw + x) << 0;\n\t\t\t\tvar dw = Math.ceil(sw * width / iw);\n\t\t\t\tvar dy = (sy * height / ih / vertSquashRatio + y) << 0;\n\t\t\t\tvar dh = Math.ceil(sh * height / ih / vertSquashRatio);\n\t\t\t\tctx.drawImage(tmpCanvas, 0, 0, sw, sh, dx, dy, dw, dh);\n\t\t\t\tsx += d;\n\t\t\t}\n\t\t\tsy += d;\n\t\t}\n\t\ttmpCanvas = tmpCtx = null;\n\t}", "title": "" }, { "docid": "08f13d9d6b6f053a6392a80409c09462", "score": "0.58316827", "text": "updateBuffer () {\n\t\tthis.buffer = new Array(displayOptions.width * displayOptions.height);\n\n\t\t//console.log(this.bx + \",\"+ this.by);\n\t\tthis.bx = this.bufferEntity.position.x;\n\t\tthis.by = this.bufferEntity.position.y;\n\n\t\tfor (let i = 0; i < bufferOptions.width; i++) {\n\t\t\tfor (let j = 0; j < bufferOptions.height; j++) {\n\t\t\t\t//Tiles are the default thing in the buffer\n\t\t\t\t//position of the screen ON THE MAP.\n\t\t\t\t//BX is NOT on the BUFFER; it is on the MAP.\n\t\t\t\tconst bufferx = this.bx + i;\n\t\t\t\tconst buffery = this.by + j;\n\t\t\t\tconst tile = mapSystem.getTile(bufferx, buffery);\n\t\t\t\tconst isOutsideMap = bufferx < 0 || bufferx >= mapOptions.width || buffery < 0 || buffery >= mapOptions.height;\n\t\t\t\tconst pos = i + j * bufferOptions.width;\n\n\t\t\t\t//Bloody hack: If it's outside the map, then dont draw it\n\t\t\t\tif (!tile || isOutsideMap) {this.buffer[pos] = new DisplayTile('', '', '#000000').query(); continue;}\n\t\t\t\telse if (tile.entityHere && tile.entityHere.display && (tile.hasSeen || tile.inSight)) {\n\t\t\t\t\tconst entity = tile.entityHere;\n\n\t\t\t\t\tthis.buffer[pos] = entity.display.tile.query();\n\t\t\t\t}\n\t\t\t\telse if (tile.hasSeen || tile.inSight) {\n\t\t\t\t\tif (tile.varietyColor) {this.buffer[i+j*bufferOptions.width]=[tile.tileType.tile.character, tile.varietyColor];}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis.buffer[pos] = tile.tileType.tile.query();\n\t\t\t\t\t\tif (tile.hasSeen && !tile.inSight) {\n\t\t\t\t\t\t\tthis.buffer[pos][1] = ROT.Color.toHex(ROT.Color.interpolate(ROT.Color.fromString(this.buffer[pos][1]), ROT.Color.fromString(\"#000000\")), 0.3);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttile.inSight = false;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "c73e63cebd939d2a19304c54a3efa69e", "score": "0.581672", "text": "function img_update () {\n\t\tcontexto.drawImage(canvas, 0, 0);\n\t\tcontext.clearRect(0, 0, canvas.width, canvas.height);\n }", "title": "" }, { "docid": "4e5608455003bf56ce6716308ffdd02c", "score": "0.58157545", "text": "function renderData(imageData, anim){\t\n\tvar data = getUserInputData();\n\t//identified global variables\n\tvar Xs = 256;\t\t\t\t\t//Xres\n\tvar Ys = 256;\t\t\t\t\t//Yres\n\tvar Zmax = 333333333;\n\tvar Cam = {X:{}, Y:{}, Z:{}}\t//camera\n\tvar worldMatrix = new Array();\n\t//end of global variables\n\t//calculated values from global variables\n\t\n\t//end of calculated values\n\tdata.Light = [\n\t\t\t\t\t{pos:{x:-0.7071, y:0.7071, z:0},color:{r:0.5,g:0.5,b:0.9}},\n\t\t\t\t\t{pos:{x:0, y:-0.7071, z:-0.7071},color:{r:0.9,g:0.2,b:0.3}},//{0, -0.7071, -0.7071}, {0.9, 0.2, 0.3}\n\t\t\t\t\t{pos:{x:0.7071, y:0.0, z:-0.7071},color:{r:0.2,g:0.7,b:0.3}},//{0.7071, 0.0, -0.7071}, {0.2, 0.7, 0.3}\t\n\t\t\t\t];\t//{ {-0.7071, 0.7071, 0}, {0.5, 0.5, 0.9} };\n\tdata.Ks = {r:0.3,g:0.3,b:0.3};\n\tdata.Ka = {r:0.1,g:0.1,b:0.1};\n\tdata.Kd = {r:0.7,g:0.7,b:0.7};\n\tdata.s = 32;//specular coefficient\n\tdata.La = {pos:{x:0, y:0, z:0},color:{r:0.3,g:0.3,b:0.3}}\n\tdata.Zmax = Zmax;\n\t//data.shaderType = 'FLAT';//GOURAUD';//'FLAT'\n\n\tcalculateWorldMatrix(worldMatrix, data)\n\n\tvar FOV = data.FOV\t//focal point\n\tvar C = data.C;\t\t//camera location\n\tvar L = data.L;\t\t//lookat\n\tvar UP = data.UP;\t//up_\n\tif(anim){\n\t\tFOV = data.FOV = anim.FOV?anim.FOV:data.FOV;\n\t\t//data.La.color.r = anim.FOV;\n\t\t//data.Light = anim.Light?anim.Light:data.Light;\n\t\tdata.La = anim.La?anim.La:data.La;\n\t\tdata.proceduralTexture = anim.proceduralTexture;\n\t}\n\tvar d = 1/(tan(FOV/2));\n\n\tcalculateCamera(Cam, C, L, UP)\n\tvar Xsp = calculateXsp(Xs, Ys, Zmax, d);\n\tvar Xpi = calculateXpi(d);\n\tvar Xiw = calculateXiw(Cam, C)\n\tvar Xwm = calculateXwm(worldMatrix)\n\tdata.Xsp = Xsp;\n\tdata.Xpi = Xpi;\n\tdata.Xiw = Xiw;\n\tdata.Xwm = Xwm;\n\n\tvar globalMatrix = new Array();\n\tglobalMatrix.push(Xsp);\n\tglobalMatrix.push(Xpi);\n\n\tvar Xi = matrixMultiply(Xwm, Xiw);\n\tglobalMatrix.push(Xi);\n\t// globalMatrix.push(Xiw)\n\t// globalMatrix.push(Xwm)\n\n\t//removing Scaling and translation from Xi\n\t\n\tvar Xsm = calculateXsm(globalMatrix);\n\n\tXi = normalizeXi(Xi);\n\n\tvar newVertices = applyXForms(vertices, Xsm, Xi, data)\n\n\tshowFinalImage(newVertices, imageData, data)\n}", "title": "" }, { "docid": "95d9c18712a73e59d590100f7325884f", "score": "0.57955796", "text": "function zoomCanvasTo(_x,_y, oldlevel ,newlevel){\n\tif(showAll){\n\t\tscreenH=$(window).height()-20;\n\n\t\tif(canvasRatio>screenRatio){\n\t\t\tshowAllZoomLevel=(canvas.width/screenW)\n\t\t}else{\n\t\t\tshowAllZoomLevel=(canvas.height/screenH)\n\t\t}\nnewLevel= showAllZoomLevel\n\t\t$(\"#canvasHolder\").css({width:screenW, height:screenH})\n\t\t$(\"#canvasNavHolder\").slideUp(\"slow\").delay(400);\n\t\t$(\"#buttonHolder\").css({marginTop:(screenH+70)+\"px\"});\n\t\t$(\"#canvas\").css({cursor: \"url(images/cursor_zoom_in.cur) 6.5 6.5, crosshair\"})\n\t}else{\n\t\t$(\"#canvasHolder\").css({width:screenW, height:screenH})\n\t\tscreenH=$(window).height()-60;\n\t\t$(\"#buttonHolder\").css({marginTop:(screenH+10)+\"px\"}).clearQueue().show();\n\t\t$(\"#canvasNavHolder\").slideDown(\"slow\").delay(400);\n\t\t$(\"#canvas\").css({cursor: \"url(images/\"+currentCursor+\".cur) \"+cursorPosition[currentCursor]+\" \"+cursorPosition[currentCursor]+\", crosshair\"})\n\t}\n\tcanvasCenter={x:_x,y:_y}\n\tvar oldCanvasW=canvas.width/oldlevel;\n\tvar newCanvasW=canvas.width/newlevel;\n\tvar navCanvasW=canvas.width*navSizePercent;\n\tvar oldCanvasH=canvas.height/oldlevel\n\tvar newCanvasH=canvas.height/newlevel\n\tvar navCanvasH=canvas.height*navSizePercent;\n\tvar navX=navCanvasW*((oldCanvasW-(oldCanvasW-(_x/oldlevel)))/oldCanvasW);\n\tvar navY=navCanvasH*((oldCanvasH-(oldCanvasH-(_y/oldlevel)))/oldCanvasH);\n\tvar newX=newCanvasW*((oldCanvasW-(oldCanvasW-(_x/oldlevel)))/oldCanvasW);\n\tvar newY=newCanvasH*((oldCanvasH-(oldCanvasH-(_y/oldlevel)))/oldCanvasH);\n\tvar offsetX=-(newX)+(screenW/2);\n\tvar offsetY=-(newY)+(screenH/2);\n\tvar canvasBoxH=(screenH*navSizePercent)*newlevel;\n\tvar canvasBoxW=(screenW*navSizePercent)*newlevel;\n\tvar navOffsetX=(navX)-(canvasBoxW/2)\n\tvar navOffsetY=(navY)-(canvasBoxH/2)\n\tcurrentZoomLevel= newlevel\n\t// set to draggable so the animate function can properly set the left/top of canvas. figure out why this is the case…\n\t$(\"#canvas\").draggable({drag:dragfunc})\n\t$(\"#canvas\").animate({\n\t\tleft:offsetX,\n\t\ttop:offsetY,\n\t\twidth:canvas.width/newlevel,\n\t\theight:canvas.height/newlevel\n\t},300,function(){\n\t\tcanvasPos.x=$(\"#canvas\").offset().left;\n\t\tcanvasPos.y=$(\"#canvas\").offset().top;\n\t});\n\t//destroy the draggable instance.\n\t$(\"#canvas\").draggable(\"destroy\")\n\tcanvasPos.x=offsetX;\n\tcanvasPos.y=offsetY;\n\t$(\"#canvasNavBox\").animate({\n\t\tleft:navOffsetX,\n\t\ttop:navOffsetY,\n\t\twidth:canvasBoxW-2,\n\t\theight:canvasBoxH-2\n\t},300);\t\n}", "title": "" }, { "docid": "96a1a139f18770167558a49568463c01", "score": "0.57934433", "text": "preRenderImage(canvasSize, level, window) {\n\tvar canvas = document.createElement(\"canvas\")\n\tthis.drawImageOnly(canvas, canvasSize, level, window)\n\tthis.preRender = canvas\n\tthis.preRenderLevel = level\n\tthis.preRenderWindow = window\n }", "title": "" }, { "docid": "dc290efda242e3911db3b02507492e93", "score": "0.57924485", "text": "render() {\n for (let y = 0; y < this.canvas.heigth; y += 1) {\n for (let x = 0; x < this.canvas.width; x += 1) {\n let pixel = x === 0 || y === 0 ? this.canvas.renderAt(x, y) : null;\n\n const line = this.pixels[x];\n if (!line) this.pixels[x] = [];\n\n if (!pixel) {\n for (let s = this.shapes.length - 1; s >= 0; s -= 1) {\n const v = this.shapes[s].renderAt(x, y);\n if (v) {\n pixel = v;\n break;\n }\n }\n }\n\n\n if (!pixel) {\n pixel = this.pixels[x][y] ? this.pixels[x][y] : this.canvas.renderAt(x, y);\n }\n this.pixels[x][y] = pixel;\n this.rl.write(pixel);\n }\n this.rl.write('\\n');\n }\n }", "title": "" }, { "docid": "bafd9f7b63e705a5c55ecda35d72d0ae", "score": "0.57905746", "text": "updateCanvas(){\n if (this.props.content){\n let data = this.props.content.toImageData();\n const canvas = this.refs.canvas;\n const context = canvas.getContext('2d');\n\n context.clearRect(0, 0, canvas.width, canvas.height);\n context.fillStyle =\"rgba(255, 255, 255, 255)\";\n context.beginPath();\n context.fillRect(0, 0, data.width, data.height);\n context.fill();\n context.globalCompositeOperation = 'source-over';\n\n context.putImageData(this.props.content.toImageData(), 0, 0);\n }\n }", "title": "" }, { "docid": "971f49d1e3e5a8f960547e76ff231e0d", "score": "0.57877886", "text": "function drawImage(canvas) {\n var context = canvas.node().getContext(\"2d\"),\n image = context.createImageData(dx, dy);\n \n for (var y = 0, p = -1; y < dy; ++y) {\n for (var x = 0; x < dx; ++x) {\n var c = d3.rgb(MAP_COLORS(data[dy-y-1][x]));\n image.data[++p] = c.r;\n image.data[++p] = c.g;\n image.data[++p] = c.b;\n image.data[++p] = 255;\n }\n }\n \n context.putImageData(image, 0, 0);\n }", "title": "" }, { "docid": "7261bff790cbd1b9806b791f2a8260b7", "score": "0.57866824", "text": "function draw()\n{\n\trenderPass = 0;\n\tmode = $(\"algorithm\").selectedIndex;\n\tconsole.log(\"alg: \" + mode);\n\tdoInverse = $(\"inverse\").checked;\n\n\tdepth_red = parseInt($(\"redText\").value);\n\tdepth_green = parseInt($(\"greenText\").value);\n\tdepth_blue = parseInt($(\"blueText\").value);\n\n\tmax_depth = Math.max(depth_green, Math.max(depth_blue, depth_red));\n\timg_cache = matrix(max_depth, 2, 0.0);\n\n\tresetScore();\n\n\tif ( lookAt === null ) lookAt = lookAtDefault;\n\tif ( zoom === null ) zoom = [zoomStart, zoomStart];\n\n\txRange = [lookAt[0]-zoom[0]/2, lookAt[0]+zoom[0]/2];\n\tyRange = [lookAt[1]-zoom[1]/2, lookAt[1]+zoom[1]/2];\n\trange_x = xRange[1] - xRange[0];\n\trange_y = yRange[1] - yRange[0];\n\n\tif ( reInitCanvas ) {\n\t\treInitCanvas = false;\n\n\t\tcanvas = $('canvasMandelbrot');\n\t\tcanvas.width = window.innerWidth;\n\t\tcanvas.height = window.innerHeight;\n\n\t\tccanvas = $('canvasControls');\n\t\tccanvas.width = window.innerWidth;\n\t\tccanvas.height = window.innerHeight;\n\n\t\tctx = canvas.getContext('2d');\n\t\tctx_img = ctx.createImageData(canvas.width, canvas.height);\n\t}\n\n\tadjustAspectRatio(xRange, yRange, canvas);\n\tconsole.log(\"zoom: \" + zoom[0] + \" \" + zoom[1] + \" mode: \" + mode);\n\n\timg_red = new matrix(canvas.width, canvas.height, 0.0);\n\timg_green = new matrix(canvas.width, canvas.height, 0.0);\n\timg_blue = new matrix(canvas.width, canvas.height, 0.0);\n\n\tupdateHashTag();\n\tupdateInfoBox();\n\n\t// Only enable one render at a time\n\trenderId += 1;\n\n\trender();\n}", "title": "" }, { "docid": "b9d37fea73cf9b30eb9b8bfbdeb5df3b", "score": "0.578049", "text": "function doRedraw (){\n encoder.addFrame(canvas.getContext(\"2d\"));\n }", "title": "" }, { "docid": "6943a26eac201da2990cbd3cb560a44f", "score": "0.57749456", "text": "draw() {\n ctx.drawImage(this.img, this.x, this.y, this.width, this.height);\n }", "title": "" }, { "docid": "9055cea84c6f492eb7fec64ac3975270", "score": "0.57669914", "text": "function initCanvas()\n{\n const canvas = document.getElementById('canvas');\n const ctx = canvas.getContext('2d');\n const canvasWidth = canvas.width;\n const canvasHeight = canvas.height;\n const imageData = ctx.getImageData(0,0,1,1);\n\n\n \n\n \n\n}", "title": "" }, { "docid": "a0fee69d031e26cec344378db4ff4e8c", "score": "0.57667243", "text": "function initCanvas() {\n buf.canvas.width = circuit.width;\n buf.canvas.height = circuit.height;\n ctx.canvas.width = circuit.width * scale;\n ctx.canvas.height = circuit.height * scale;\n\n ctx.imageSmoothingEnabled = false;\n ctx.fillStyle = \"white\";\n ctx.strokeStyle = \"white\";\n\n switch (scale) {\n case 1:\n rubber.size = 12;\n break;\n case 2:\n rubber.size = 6;\n break;\n case 3:\n rubber.size = 3;\n break;\n case 4:\n rubber.size = 2;\n break;\n default:\n rubber.size = 1;\n break;\n }\n}", "title": "" }, { "docid": "a09ec4cb8df7079d01fbbdd82ff2b1fe", "score": "0.5749631", "text": "function draw() {\n image(resultImg, 0, 0, 640, 480);\n}", "title": "" }, { "docid": "798b0f2e57c8a7b7b9b81bc4b7213a8f", "score": "0.5728994", "text": "function render(src){\n var image = new Image();\n \n image.onload = function(){\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n canvas.width = 2480;\n canvas.height = 3508;\n\n\n ctx.fillStyle = blendColor;\n ctx.fillRect(0,0,canvas.width,canvas.height);\n // @TODO find solution for no .filter support in IE or Safari. Consider this approach: https://www.html5rocks.com/en/tutorials/canvas/imagefilters/\n ctx.filter = currentFilter + ' contrast(' + contrast + ')';\n ctx.filter += currentFilter + ' brightness(' + brightness + ')';\n ctx.filter += currentFilter + ' blur(' + blur + 'px)';\n ctx.globalCompositeOperation = currentBlend;\n\n // get the scale\n var scale = Math.max(canvas.width / image.width, canvas.height / image.height);\n\n var x = (canvas.width / 2) - (image.width / 2) * scale;\n var y = (canvas.height / 2) - (image.height / 2) * scale;\n ctx.drawImage(image, x, y, image.width * scale, image.height * scale);\n \n\n };\n \n image.src = src;\n}", "title": "" }, { "docid": "8d71917f633b9039f59866d580bb21b4", "score": "0.57225996", "text": "listenerMouseDownTouchStart(e) {\n // The pointerdown event signals the start of a touch interaction.\n // This event is cached to support 2-finger gestures\n if (e.pointerId) {\n this.evCache.push(e);\n }\n var [pos, touch] = this.pointerEvents(e);\n\n if (this.evCache.length < 2) {\n this.dragStarted = true;\n this.isDragging = this.scaling = false;\n\n this.startCoords = {\n x: pos.x - this.lastMove.x,\n y: pos.y - this.lastMove.y\n };\n\n this.previewZoomStartCoords = {\n x: this.applyScaleToMoveX(this.startCoords.x),\n y: this.applyScaleToMoveY(this.startCoords.y)\n };\n\n this.lastDraggedPos.x = pos.x;\n this.lastDraggedPos.y = pos.y;\n\n this.lastChangeIn = \"main\";\n\n this.queueCanvasDraw();\n\n if (app.dev) {\n // console.log(['start startCoords:', this.startCoords.x, this.startCoords.y, ', pos: ', pos.x, pos.y, ', lastMove: ', this.lastMove.x, this.lastMove.y, ', dragStarted: ', this.dragStarted]);\n // console.log(this.scalingCanvasDrawArgs());\n }\n }\n }", "title": "" }, { "docid": "9b3ae336f361bcff8016b7054fb847d0", "score": "0.57220244", "text": "function draw(v, c, bc, w, h) {\n // First, draw it into the backing canvas\n bc.drawImage(v, 0, 0, w, h);\n // Grab the pixel data from the backing canvas\n var idata = bc.getImageData(0, 0, w, h);\n var data = idata.data;\n\n // apply filters based on filterMode set with button\n filters(filterMode, data);\n\n idata.data = data;\n // Draw the pixels onto the visible canvas\n c.putImageData(idata, 0, 0);\n // Start over!\n setTimeout(function () {\n\n draw(v, c, bc, w, h);\n }, 0);\n }", "title": "" }, { "docid": "0af984a9e0a6c745a362bfc54f09228c", "score": "0.57095057", "text": "function placeOntoCanvas() {\n holder.getContext('2d').drawImage(videoElm, 0, 0);\n imageData = holder.getContext('2d').getImageData(0, 0, holder.width, holder.height);\n window.chroma.cutout(imageData, holder.height, holder.width, function(cleaned) {\n imageData.data.set(cleaned);\n output.getContext('2d').putImageData(cleaned, 0, 0);\n });\n }", "title": "" }, { "docid": "140cb2e155fe581e1d4107b24e13efc9", "score": "0.57065076", "text": "render (ctx, srcX, srcY, srcW, srcH, destX, destY, destW, destH) {\n if (!this.isReady()) { return; }\n\n var srcImg = this._srcImg;\n if (ctx.filter) {\n var filterImg = filterRenderer.renderFilter(ctx, this, srcX, srcY, srcW, srcH);\n if (filterImg) {\n srcImg = filterImg;\n srcX = 0;\n srcY = 0;\n }\n }\n\n ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH);\n }", "title": "" }, { "docid": "5ab4868990c30adb6456b071db843359", "score": "0.5697599", "text": "draw() {\n drawCallCount++;\n return new Uint8ClampedArray(900);\n }", "title": "" }, { "docid": "0c0d88cdeadd2dd560c051c2e5cd4943", "score": "0.56916714", "text": "function render(canvas){\n var L = parseFloat(document.getElementById(\"L\").value);\n var K = parseFloat(document.getElementById(\"K\").value);\n var G = parseFloat(document.getElementById(\"G\").value);\n var color_func = greyscale_map;\n if (document.getElementById(\"color\").checked)\n color_func = rainbow_colormap;\n var canvas = document.getElementById('example');\n \n if (! canvas) {\n console.log(' Failed to retrieve the < canvas > element');\n return false;\n }\n else {\n\tconsole.log(' Got < canvas > element ');\n }\n // Get the rendering context for 2DCG <- (2)\n var ctx = canvas.getContext('2d');\n\n // Draw the scalar data using an image rpresentation\n var imgData=ctx.getImageData(0,0,canvas.width,canvas.height);\n\n // Store whole image noise data\n var pt_noise = (function()\n {\n var array = [];\n for(var y = 0; y != (canvas.width+1); y++) { array[y] = new Float32Array(canvas.height+1); }\n return array;\n })();\n\n var pt_lic = (function()\n {\n var array = [];\n for(var y = 0; y != (canvas.width+1); y++) { array[y] = new Float32Array(canvas.height+1); }\n return array;\n })();\n\n for (var y=0;y<canvas.height;y++){\n \tfor (var x=0;x<canvas.width;x++)\n {\n pt_noise[x][y] = Math.random();\n }\n }\n\n for (var y=0;y<canvas.height;y++){\n for (var x=0;x<canvas.width;x++)\n {\n var h = 5.0*(x_extent[1]-x_extent[0])/canvas.width;\n var steps = L;\n var pixel = [x,y];\n var numerator = 0.0;\n var denominator = 0.0;\n var pt_pixel = pixel2pt(canvas.width,canvas.height,x_extent,y_extent,x,y);\n var linpts_forward = euler_integration(pixel2pt(canvas.width,canvas.height,x_extent,y_extent,x,y),h,steps,gaussian_gradient);\n var linpts_backward = euler_integration(pixel2pt(canvas.width,canvas.height,x_extent,y_extent,x,y),h,steps,gaussian_gradient_backward);\n\n var temp_forward = 0.0;\n var temp_backward = 0.0;\n var distances_backward = new Float32Array(steps);\n var distances_forward = new Float32Array(steps);\n distances_backward[0]=0.0;\n distances_forward[0]=0.0;\n for (var i = 0; i < steps-1; i++) {\n temp_backward = temp_backward + distance(linpts_backward[i],linpts_backward[i+1]);\n temp_forward = temp_forward + distance(linpts_backward[i],linpts_forward[i+1]);\n distances_backward[i+1]=temp_backward;\n distances_forward[i+1]=temp_forward;\n }\n\n for (var i = 0; i < steps; i++) {\n var pixel_backward = pt2pixel(canvas.width,canvas.height,x_extent,y_extent,linpts_backward[i][0],linpts_backward[i][1]);\n var pixel_forward = pt2pixel(canvas.width,canvas.height,x_extent,y_extent,linpts_forward[i][0],linpts_forward[i][1]);\n var weight_backward = Math.exp(-Math.pow(distances_backward[i],2));\n var weight_forward = Math.exp(-Math.pow(distances_forward[i],2));\n\n if (pixel_backward[0]<0||pixel_backward[0]>canvas.width||pixel_backward[1]<0||pixel_backward[1]>canvas.height||pixel_forward[0]<0||pixel_forward[0]>canvas.width||pixel_forward[1]<0||pixel_forward[1]>canvas.height) {\n numerator = numerator + weight_backward * Math.random() + weight_forward * Math.random();\n }else{\n numerator = numerator + weight_backward * pt_noise[pixel_backward[0]][pixel_backward[1]] + weight_forward * pt_noise[pixel_forward[0]][pixel_forward[1]];\n }\n denominator = denominator + weight_backward + weight_forward;\n }\n numerator = numerator - pt_noise[x][y]; // substract weight(1) * target pixel noise since euler_integration calculate twice(backward,forward)\n denominator = denominator - 1; // substract target pixel weight(1) since euler_integration calculate twice(backward,forward)\n pt_lic[x][y] = numerator/denominator;\n }\n }\n var mn_temp = 256;\n var mx_temp = -256;\n for (var y=0;y<canvas.height;y++)\n for (var x=0;x<canvas.width;x++)\n {\n var grad = gaussian_gradient(pixel2pt(canvas.width,canvas.height,x_extent,y_extent,x,y));\n var fval = Math.sqrt(Math.pow(grad[0],2)+Math.pow(grad[1],2));\n if (fval < mn_temp)\n mn_temp=fval;\n if (fval>mx_temp)\n mx_temp=fval;\n }\n\n var mn = pt_noise[0][0];\n var mx = mn;\n for (var y=0;y<canvas.height;y++)\n for (var x=0;x<canvas.width;x++)\n {\n var fval = pt_noise[x][y];\n if (fval < mn)\n mn=fval;\n if (fval>mx)\n mx=fval;\n }\n\n for (var y=0;y<canvas.height;y++){\n for (var x=0;x<canvas.width;x++)\n {\n if (document.getElementById(\"color\").checked){\n color_func = rainbow_colormap;\n var grad = gaussian_gradient(pixel2pt(canvas.width,canvas.height,x_extent,y_extent,x,y));\n var temp = Math.sqrt(Math.pow(grad[0],2)+Math.pow(grad[1],2));\n var color = color_func(temp,mn_temp,mx_temp);\n i = (y*canvas.width + x)*4\n imgData.data[i]=color[0]*pt_lic[x][y];\n imgData.data[i+1]= color[1]*pt_lic[x][y];\n imgData.data[i+2]= color[2]*pt_lic[x][y];\n imgData.data[i+3]= color[3];\n }else{\n var color = color_func(pt_lic[x][y],mn,mx);\n i = (y*canvas.width + x)*4\n imgData.data[i]=color[0];\n imgData.data[i+1]= color[1];\n imgData.data[i+2]= color[2];\n imgData.data[i+3]= color[3];\n }\n }\n }\n\n\tctx.putImageData(imgData,0,0);\n if (document.getElementById(\"hedgehog\").checked){\n draw_glyphs(K,G,gaussian_gradient,canvas);\n }\n}", "title": "" }, { "docid": "dc784f544afe38e83a43c4e271de62b5", "score": "0.5690815", "text": "function zoomimg_in() {\n\n imageheight *= 1.1\n imagewidth *= 1.1\n\n}", "title": "" }, { "docid": "f3ac9af4243e79a14ad6360d45b923c1", "score": "0.56900203", "text": "function restoreDrawingSurface(){\n\tcontext.putImageData(imageData,0,0);\n\t}", "title": "" }, { "docid": "e15f4252d2352a8ca8cb36c54024223e", "score": "0.56877136", "text": "_draw(){\n if(!this.currentConfig) return;\n const ids = this.streamIds();\n if(this.currentConfig.paint){\n // let the custom paint function handle it\n this.currentConfig.paint(ids, this._canvas, this._context);\n }else{\n const snapshot = {background: null, mixed: []};\n this._context.clearRect(0,0,this._width,this._height);\n const background = this.currentConfig.background()(ids);\n this._context.fillStyle = background;\n snapshot.background = background;\n this._context.fillRect(0,0,this._width, this._height);\n // check if you have to resolve position functions\n const resolveFn = (v, s) => typeof v === \"function\" ? v(s) : v;\n this.currentConfig.calculatedPositions\n // sort according to z-Index\n .sort((a , b) => {\n if(a.zIndex !== undefined && b.zIndex !== undefined){\n return (typeof a.zIndex === \"function\" ? a.zIndex({id: a.assignedId}) : a.zIndex) - (typeof b.zIndex === \"function\" ? b.zIndex({id: b.assignedId}) : b.zIndex);\n }\n else if(a.zIndex !== undefined) return 1;\n else return -1\n })\n // draw each frame\n .forEach((pos, drawIndex) => {\n const stats = {width: this.width, height: this.height, id: pos.assignedId, drawIndex};\n if(pos.source){\n const x = resolveFn(pos.x, stats);\n const y = resolveFn(pos.y, stats);\n const width = resolveFn(pos.width, stats);\n const height = resolveFn(pos.height, stats);\n this._context.drawImage(pos.source, x, y, width, height);\n snapshot.mixed.push({id: pos.assignedId, drawIndex, x, y, width, height});\n }\n });\n // optionally take a snapshot\n if(this._snapshot){\n this._snapshot(snapshot);\n this._snapshot = null;\n }\n }\n }", "title": "" }, { "docid": "9ce64ebcbe8ee222e5858e3f4855e176", "score": "0.5683904", "text": "function draw_image(){\n ctx.drawImage(img,0,0,CANVAS_WIDTH, CANVAS_HEIGHT);\n}", "title": "" }, { "docid": "a2a5d53aef18a389dffb134dea251f1e", "score": "0.56792134", "text": "function init() {\n canvas = document.getElementById('fractal');\n canvasPreview = document.getElementById('zoompreview');\n paletStart = document.getElementById(\"rngPalet\");\n\n zoomhistory = [];\n\n /*\n Get references to important elements in the DOM\n */\n // Bounding box info\n elmX1 = document.getElementById('bbx1');\n elmY1 = document.getElementById('bby1');\n elmX2 = document.getElementById('bbx2');\n elmY2 = document.getElementById('bby2');\n\n // cursor location\n elmCursorX = document.getElementById('cursorX');\n elmCursorY = document.getElementById('cursorY');\n\n // zoombox information\n elmZoomX1 = document.getElementById('zoomx1');\n elmZoomX2 = document.getElementById('zoomx2');\n elmZoomY1 = document.getElementById('zoomy1');\n elmZoomY2 = document.getElementById('zoomy2');\n\n elmZoombox = document.getElementById('zoombox');\n elmLivePreview = document.getElementById(\"livepreview\");\n elmDrawtime = document.getElementById(\"drawtime\");\n elmZoomHistoryInfo = document.getElementById(\"zoomhistoryinfo\");\n\n var eventcatcher = document.getElementById(\"eventcatcher\");\n\n var palette = setupPalette(0);\n\n var constants = prepareconstants(canvas, -2.0, 2.0, 2.0, -2.0);\n constants.colorpalette = palette;\n setupZoombox(constants);\n\n AddToHistory(constants);\n\n elmDrawtime.textContent = draw(canvas, constants);\n showBoundingBoxInfo(constants);\n\n eventcatcher.addEventListener(\"mousemove\", (evt) => {\n\n mouseX = evt.offsetX;\n mouseY = evt.offsetY;\n\n // evt.offsetX and evt.offsetY contain the point clicked on the canvas. these need to be translated to the given bounding box\n const cx = constants.boundingBoxX1 + (mouseX / constants.canvas_width ) * constants.boundingBoxWidth;\n const cy = constants.boundingBoxY1 - (mouseY / constants.canvas_height) * constants.boundingBoxHeight;\n\n elmCursorX.textContent = cx.toString().substr(0,6);\n elmCursorY.textContent = cy.toString().substr(0,6);\n\n // make a box 12% x 8% of the bounding box.\n zoombox_x1 = cx - (ZOOMBOX_WIDTH_PERCENTAGE / 100) * constants.boundingBoxWidth / 2;\n zoombox_x2 = cx + (ZOOMBOX_WIDTH_PERCENTAGE / 100) * constants.boundingBoxWidth / 2;\n zoombox_y1 = cy + (ZOOMBOX_HEIGHT_PERCENTAGE / 100) * constants.boundingBoxHeight / 2;\n zoombox_y2 = cy - (ZOOMBOX_HEIGHT_PERCENTAGE / 100) * constants.boundingBoxHeight / 2;\n\n elmZoomX1.textContent = (zoombox_x1.toString()).substr(0,6);\n elmZoomX2.textContent = (zoombox_x2.toString()).substr(0,6);\n elmZoomY1.textContent = (zoombox_y1.toString()).substr(0,6);\n elmZoomY2.textContent = (zoombox_y2.toString()).substr(0,6);\n\n let x = mouseX - zbox_w / 2;\n let y = mouseY - zbox_h / 2\n\n elmZoombox.setAttribute(\"x\", x);\n elmZoombox.setAttribute(\"y\", y);\n\n if (elmLivePreview.checked){\n\n let tempConstants = prepareconstants(canvasPreview, zoombox_x1, zoombox_y1, zoombox_x2, zoombox_y2);\n lastclick = prepareconstants(canvasPreview, zoombox_x1, zoombox_y1, zoombox_x2, zoombox_y2);\n tempConstants.colorpalette = setupPalette(parseInt(paletStart.value));\n draw(canvasPreview, tempConstants);\n }\n });\n\n eventcatcher.addEventListener(\"wheel\", (evt) => {\n if (evt.wheelDelta > 0) {\n ZOOMBOX_WIDTH_PERCENTAGE++;\n ZOOMBOX_HEIGHT_PERCENTAGE++;\n }\n else if (evt.wheelDelta <0) {\n ZOOMBOX_WIDTH_PERCENTAGE--;\n ZOOMBOX_HEIGHT_PERCENTAGE--;\n }\n setupZoombox(constants);\n });\n\n window.addEventListener(\"keypress\", (evt) => {\n switch(evt.code){\n case \"+\":\n case \"NumpadAdd\":\n ZOOMBOX_WIDTH_PERCENTAGE++;\n ZOOMBOX_HEIGHT_PERCENTAGE++;\n break;\n case \"-\":\n case \"NumpadSubtract\":\n ZOOMBOX_WIDTH_PERCENTAGE--;\n ZOOMBOX_HEIGHT_PERCENTAGE--;\n break;\n }\n setupZoombox(constants);\n });\n\n eventcatcher.addEventListener(\"dblclick\", (evt) => {\n\n evt.preventDefault();\n evt.stopPropagation();\n\n AddToHistory(constants);\n\n constants = prepareconstants(canvas, zoombox_x1, zoombox_y1, zoombox_x2, zoombox_y2);\n constants.colorpalette = palette;\n\n elmDrawtime.textContent = draw(canvas, constants);\n showBoundingBoxInfo(constants);\n\n return false;\n });\n\n var lastclick = null;\n\n eventcatcher.addEventListener(\"click\", (evt) => {\n evt.preventDefault();\n evt.stopPropagation();\n\n // left mouse\n let tempConstants = prepareconstants(canvasPreview, zoombox_x1, zoombox_y1, zoombox_x2, zoombox_y2);\n lastclick = prepareconstants(canvasPreview, zoombox_x1, zoombox_y1, zoombox_x2, zoombox_y2);\n tempConstants.colorpalette = palette;\n draw(canvasPreview, tempConstants);\n\n return false;\n });\n\n eventcatcher.addEventListener(\"contextmenu\", evt => {\n evt.preventDefault();\n evt.stopPropagation();\n // right mouse\n if (zoomhistory.length > 0) {\n constants = GetFromHistory();\n showBoundingBoxInfo(constants);\n draw(canvas, constants);\n }\n return false;\n });\n\n\n document.getElementById(\"redraw\").addEventListener(\"click\", (evt) => {\n AddToHistory(constants);\n if (lastclick) {\n constants = prepareconstants(canvas,\n lastclick.boundingBoxX1,\n lastclick.boundingBoxY1,\n lastclick.boundingBoxX2,\n lastclick.boundingBoxY2,\n );\n constants.colorpalette = palette;\n elmDrawtime.textContent = draw(canvas, constants);\n\n }\n });\n\n paletStart.addEventListener(\"change\", (evt) => {\n palette = setupPalette(parseInt(paletStart.value));\n\n if (lastclick) {\n lastclick.colorpalette = palette;\n draw(canvasPreview, lastclick);\n }\n }, false);\n}", "title": "" }, { "docid": "77d4665a16e9e359d6df166a5bc4552b", "score": "0.5677521", "text": "function draw_on_canvas()\n{\n GLOBAL_OVERRIDE = edit_image_draw;\n}", "title": "" }, { "docid": "c34cc33f5a5d501191ae8c17df48f421", "score": "0.5677143", "text": "render() {\n ctx.drawImage( Resources.get( this.image ), this.posX, this.posY );\n }", "title": "" }, { "docid": "d58daa4d3f1e4ee5657d4f8de073fbb0", "score": "0.56621003", "text": "function DrawImageToHelpUserPutTheirHandOverTheDevice(){\n\timage(img, 0, 0, window.innerWidth/2, window.innerHeight/2);\n}", "title": "" }, { "docid": "be1dc87dfc806cbc0787d9305453fcbb", "score": "0.56600535", "text": "function copy_viewport(src, dest) \n{\n dest.getContext(\"2d\").clearRect(0,0,dest.width,dest.height);\n dest.getContext(\"2d\").drawImage(src,0,0);\n}", "title": "" }, { "docid": "68e4c54b3e06afe901ff48713b90f3b5", "score": "0.56491554", "text": "function draw(adjust) {\n //ctx.clearRect(0, 0, canvas.width, canvas.height)\n ctx.setTransform(scalef,0,0,scalef,offsetx,offsety)\n var r = detectVerticalSquash(img)\n ctx.drawImage(img, 0, 0, width, height/r)\n \n if ($('input[name=res]').is(':checked')) _draw_res_rings()\n if ($('input[name=ice]').is(':checked')) _draw_ice_rings()\n }", "title": "" }, { "docid": "0e972b1626d900519c8e6ca70842a07f", "score": "0.5636554", "text": "function zoomimg_out() {\n\n imageheight /= 1.1\n imagewidth /= 1.1\n\n}", "title": "" } ]
8b02d6e077f551b63dc4bc64973e7e13
Deal with Mobile Click
[ { "docid": "fbcc7736882403b5d127f335c0802219", "score": "0.0", "text": "function openMenu(){\n let menu = document.querySelector('.dropdown-content');\n if(menu.style.display === 'block')\n {\n menu.style.display = 'none';\n } else {\n menu.style.display = 'block';\n }\n}", "title": "" } ]
[ { "docid": "601b36ab5035fb431fa9cd9e7eb32c86", "score": "0.682185", "text": "function mmm_mobile_double_tap_to_go () {\r\n\t\t\tfunction_selector = '#mega_main_menu li:has(.mega_dropdown) > .item_link, #mega_main_menu li:has(.post_details) > .processed_image';\r\n\t\t\tjQuery( function_selector ).unbind();\r\n\t\t\tif( /iphone|ipad|ipod|android|webos|blackberry|iemobile|opera mini/i.test( navigator.userAgent.toLowerCase() ) ) \r\n\t\t\t{\r\n\t\t\t\tvar clicked_item = false;\r\n\t\t\t\tjQuery( function_selector ).on( 'click', function( index )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( clicked_item != this) {\r\n\t\t\t\t\t\tindex.preventDefault();\r\n\t\t\t\t\t\tif ( jQuery( this ).parent().parent().parent().hasClass('keep_open') ) {\r\n\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tjQuery( '#mega_main_menu .keep_open' ).removeClass('keep_open');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tjQuery( this ).parent().addClass('keep_open');\r\n\t\t\t\t\t\tclicked_item = this;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "314e42c1062666bbd066c0573385434e", "score": "0.6660941", "text": "fixMobileMouseHandling() {\n new FastClick(document.body);\n window.addEventListener(\"touchstart\", \n (event) => {\n if(event.touches.length > 1) {\n //the event is multi-touch\n //you can then prevent the behavior\n event.preventDefault();\n }\n },{ passive : false});\n }", "title": "" }, { "docid": "9ba9b2813dc11128f862ff1c13b67fb7", "score": "0.6437528", "text": "function mobileMenuBtnClick() {\n $($menuMobileBtn).click(function () {\n $(this).toggleClass($showClass);\n $($menuMain).toggleClass($showClass);\n $('body').toggleClass('jsa-body-lock');\n });\n }", "title": "" }, { "docid": "d43ec7a4863ff459379335d3dc2fd6b9", "score": "0.6416783", "text": "function handleClick(){\n if(isMobile){\n props.history.push(\"/dashboard/userId=\"+firebase.getCurrentUserId()+\"/goals/\"+goal.category+\"/goalId=\"+goal.id)\n }\n console.log(\"Click\")\n }", "title": "" }, { "docid": "878c0af731e2d4b0b75162d3440da930", "score": "0.63476425", "text": "onMobileToggleClick(e) {\n e.preventDefault();\n this.dom.links.classList.toggle('open');\n }", "title": "" }, { "docid": "72dbdb78bc20baacab6349ad6fe50f28", "score": "0.6310012", "text": "switch_to_mobile () {\n // click mobile version button\n cy.get(\".header__line--top .icon-mobile\", { timeout: 15000 })\n //.first()\n .click({ force: true });\n }", "title": "" }, { "docid": "4f74904dc6c4c7bb68c834de91b779e3", "score": "0.6309403", "text": "function OnClick () {\t\t\n\t\tfingering.OnClick();\n\t\tnote.OnClick();\n\t}", "title": "" }, { "docid": "c5069da0eda035efac35f9c6335fafdf", "score": "0.62545425", "text": "function receivePush(e) { \nconsole.log(\"receivePush\");\nconsole.log(e);\n\tvar extra = (OS_IOS)?e.data.extra:e.extra;\n\tvar target = (OS_IOS)?e.data.target:e.target;\n\t \n\tTi.App.fireEvent('app:goToAds', {target: target, extra: extra});\n\tTi.App.fireEvent('refresh_notification');\n\treturn false;\n}", "title": "" }, { "docid": "97b26fdecf9ee873ac0906b660f098fd", "score": "0.6253619", "text": "function changePageOnTouch(num) {\n if( mobileDevice.isAny() ) {\n //alert(\"is mobile device\");\n changepage(num);\n return false;\n }\n}", "title": "" }, { "docid": "5aeb3276f6b6c851c2373fd08f4e1479", "score": "0.6211651", "text": "function hyperlinkPhone(){\n\t $(\"a[href^='tel:']\").click(function(){\n\t \tif( !$(\"body\").hasClass(\"mobile\") ) return false;\n });\n}", "title": "" }, { "docid": "40fa5e6128a85b95cde17ae5bbae15d7", "score": "0.6107772", "text": "function isMobile() {\n try{ document.createEvent(\"TouchEvent\"); return true; }\n catch(e){ return false; }\n }", "title": "" }, { "docid": "40fa5e6128a85b95cde17ae5bbae15d7", "score": "0.6107772", "text": "function isMobile() {\n try{ document.createEvent(\"TouchEvent\"); return true; }\n catch(e){ return false; }\n }", "title": "" }, { "docid": "9edc2dd30b177ac7bc29f66de5a3b4ef", "score": "0.60983336", "text": "function checkMobile() {\n try {\n document.createEvent(\"TouchEvent\");\n return true;\n } catch (e) {\n return false;\n }\n }", "title": "" }, { "docid": "1dfd4ff08b9d401195d6c57d02c3e0c6", "score": "0.6077894", "text": "mobileTabClick(event) {\n const {tab} = event.target.dataset;\n this.showTab(tab);\n }", "title": "" }, { "docid": "58ad59c09ec33627becd5bd81edaa367", "score": "0.6058387", "text": "function onSupportClick() {\n Analytics.trackEvent('web', 'main-support-click');\n }", "title": "" }, { "docid": "870ca91c69fc1c3b8fb6969e31db13a3", "score": "0.6024742", "text": "function imgClick() {\n alert(\"Thanks For purchasing This World Class Mobile Phone\")\n}", "title": "" }, { "docid": "2cf735ec1df6293711e69e8efe110e21", "score": "0.6009585", "text": "_onTouchstart(event) {\n // Prevent the click event\n event.preventDefault()\n\n this.cancelNextClick = true\n this.trigger('OffCanvasMenuButton:click')\n }", "title": "" }, { "docid": "406ac4a71c537bab44df765ec301d61b", "score": "0.5996544", "text": "function mobileUi() {\n\t\tjQuery('body').addClass('mobile');\n\t\t// jQuery('#wrap-move-zones').remove();\n\t\tjQuery('#wrap-move-zones .move-fast').remove();\n\t\t//iScroll plugin\n\t\t/*var myScroll;\n\t\tmyScroll = new iScroll('menu_holder', {\n\t\t\thScroll: false,\n\t\t\thScrollbar: true,\n\t\t\tvScrollbar: true,\n\t\t\tscrollbarClass: 'myScrollbar',\n\t\t\tonScrollMove: function () {\n\t\t\t\thideAllEvents();\n\t\t\t}\n\t\t\t//onScrollEnd: function () {\n\t\t\t//topOffset: pullDownOffset,\n\t\t\t//onRefresh: function () {\n\t\t});*/\n\n\t\t//Y not let them click on the years!\n\t\tjQuery('.event-normal').click(function (e) {\n\t\t\tjQuery(this).addClass('event-normal-bg');\n\t\t\tif (jQuery(this).attr('id') !== 'current-event') {\n\t\t\t\thideAllEvents();\n\t\t\t\tjQuery(this).children().show();\n\t\t\t\tjQuery(this).attr('id', 'current-event');\n\t\t\t} else {\n\t\t\t\t//if is already current stay hidden\n\t\t\t\thideAllEvents();\n\t\t\t}\n\t\t});\n\t\tjQuery('.event-mystery').click(function (e) {\n\t\t\tif (jQuery(this).attr('id') !== 'current-event') {\n\t\t\t\thideAllEvents();\n\t\t\t\tjQuery(this).children().show().css('visibility', 'visible')\n\t\t\t\t\t.children().show().css('visibility', 'visible')\n\t\t\t\t\t.attr('id', 'current-event');\n\t\t\t} else {\n\t\t\t\t//if is already current stay hidden\n\t\t\t\thideAllEvents();\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "53e32b146103e0d3f4357a77a702d004", "score": "0.59458256", "text": "toggleMobileNav(e) {\n e.preventDefault();\n this.props.toggleMobileNav(this.props.canViewMobileNav)\n }", "title": "" }, { "docid": "7bb21d569aee673c96187857cd4f21cd", "score": "0.59452724", "text": "function handleFocus() {\n bc.ga._trackEvent( \"mobile app\", \"view\", document.title );\n }", "title": "" }, { "docid": "36ca5642e3857783b500500c9ca3f570", "score": "0.59341574", "text": "function _enterMobile() {\n\t\t\t$scope.$broadcast('enter-mobile');\n\t\t}", "title": "" }, { "docid": "f7c5a3ce1d1ad441a71ff44b7888e6da", "score": "0.5925757", "text": "function startTapClick(t){var e,n,o=10*-MOUSE_WAIT,i=0,a=!1,r=!1,c=new WeakMap;function s(t){o=Object(_chunk_e7816c0b_js__WEBPACK_IMPORTED_MODULE_0__[\"c\"])(t),E(t)}function d(){clearTimeout(n),n=void 0,e&&(v(!1),e=void 0),a=!0}function u(t){e||r||(a=!1,f(getActivatableTarget(t),t))}function E(t){r||(f(void 0,t),a&&t.cancelable&&t.preventDefault())}function f(t,o){if(!t||t!==e){clearTimeout(n),n=void 0;var i=Object(_chunk_e7816c0b_js__WEBPACK_IMPORTED_MODULE_0__[\"l\"])(o),a=i.x,r=i.y;if(e){if(c.has(e))throw new Error(\"internal error\");e.classList.contains(ACTIVATED)||l(e,a,r),v(!0)}if(t){var s=c.get(t);s&&(clearTimeout(s),c.delete(t)),t.classList.remove(ACTIVATED),n=setTimeout(function(){l(t,a,r),n=void 0},ADD_ACTIVATED_DEFERS)}e=t}}function l(t,e,n){i=Date.now(),t.classList.add(ACTIVATED);var o=getRippleEffect(t);o&&o.addRipple&&o.addRipple(e,n)}function v(t){var n=e;if(n){var o=CLEAR_STATE_DEFERS-Date.now()+i;if(t&&o>0){var a=setTimeout(function(){n.classList.remove(ACTIVATED),c.delete(n)},CLEAR_STATE_DEFERS);c.set(n,a)}else n.classList.remove(ACTIVATED)}}t.body.addEventListener(\"click\",function(t){(a||r)&&(t.preventDefault(),t.stopPropagation())},!0),t.body.addEventListener(\"ionScrollStart\",function(){r=!0,d()}),t.body.addEventListener(\"ionScrollEnd\",function(){r=!1}),t.body.addEventListener(\"ionGestureCaptured\",d),t.addEventListener(\"touchstart\",function(t){o=Object(_chunk_e7816c0b_js__WEBPACK_IMPORTED_MODULE_0__[\"c\"])(t),u(t)},!0),t.addEventListener(\"touchcancel\",s,!0),t.addEventListener(\"touchend\",s,!0),t.addEventListener(\"mousedown\",function(t){var e=Object(_chunk_e7816c0b_js__WEBPACK_IMPORTED_MODULE_0__[\"c\"])(t)-MOUSE_WAIT;o<e&&u(t)},!0),t.addEventListener(\"mouseup\",function(t){var e=Object(_chunk_e7816c0b_js__WEBPACK_IMPORTED_MODULE_0__[\"c\"])(t)-MOUSE_WAIT;o<e&&E(t)},!0)}", "title": "" }, { "docid": "8305c87ee400da7df9789a9a9fd562cd", "score": "0.5924296", "text": "function touchHandler(ev) {\n //this function will run when the touch events happen\n if (ev.type == \"touchend\") {\n ev.preventDefault();\n var touch = ev.changedTouches[0]; //this is the first object touched\n var newEvt = document.createEvent(\"MouseEvent\");\n newEvt.initMouseEvent(\"click\", true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY);\n //var newEvt = new MouseEvent(\"click\"); //new method\n //REF: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.MouseEvent\n ev.currentTarget.dispatchEvent(newEvt);\n //change the touchend event into a click event and dispatch it immediately\n //this will skip the built-in 300ms delay before the click is fired by the browser\n }\n}", "title": "" }, { "docid": "567b00df8cc4d6d9b5898e854026b4ec", "score": "0.58738345", "text": "function dummyTouchStartHandler(e) {\n}", "title": "" }, { "docid": "2986d00c29c2d3c18c19ab8db195fb62", "score": "0.5871501", "text": "function mousePressed() {\n // click to unlock phone\n var d = dist(mouseX, mouseY, 840, 900);\n if (d < 100) {\n islockScreen = false;\n ishomeScreen = true;\n }\n \n // click on app icon\n var d1 = dist(mouseX, mouseY, 750, 710);\n if (ishomeScreen && d1 < 100) {\n ishomeScreen = false;\n isappScreen = true;\n }\n \n // click to scan product\n var d2 = dist(mouseX, mouseY, 760, 300);\n if (isappScreen && d2 < 100) {\n isappScreen = false;\n isscanProductScreen = true;\n \n }\n \n var d3 = dist(mouseX, mouseY,815,270);\n if (isscanProductScreen && d3 < 100) {\n isscanProductScreen = false;\n isproduct1Screen = true;\n }\n \n var d4 = dist(mouseX, mouseY,795,600);\n if (isproduct1Screen && d4 < 100) {\n //print(\"click report button\");\n isproduct1Screen = false;\n isreportScreen = true;\n }\n \n var d5 = dist(mouseX, mouseY,790,770);\n if (isreportScreen && d5 < 100) {\n //print(\"click report button\");\n isreportScreen = false;\n isthankyouScreen = true;\n }\n \n var d6 = dist(mouseX, mouseY,790,100);\n if (isthankyouScreen && d6 < 100) {\n //print(\"click report button\");\n isthankyouScreen = false;\n isproduct2Screen = true;\n }\n \n \n \n \n \n}", "title": "" }, { "docid": "e3de382e913f73a0ef6072c6313586ef", "score": "0.5869818", "text": "handleTechTap_() {\n this.userActive(!this.userActive());\n }", "title": "" }, { "docid": "fc8222789b44f313056700ef5456ed4d", "score": "0.58670884", "text": "function isMobile() {\n\ttry{ document.createEvent(\"TouchEvent\"); return true; }\n\tcatch(e){ return false; }\n}", "title": "" }, { "docid": "724b51a6540b63b07173bfe20631121e", "score": "0.5862267", "text": "function isMobile() {\n\t try{ document.createEvent(\"TouchEvent\"); return true; }\n\t catch(e){ return false; }\n\t}", "title": "" }, { "docid": "86c5411b3e429103ab1c89f5eca4d34f", "score": "0.58460444", "text": "function mobileOpen() {\n navCircle.removeClass(\"navCircleLeft\");\n $(\".redBar\").removeClass(\"navCircleLeft\");\n clearTimeout($(window).data('scrollTimeout'));\n navOpen();\n }", "title": "" }, { "docid": "52d1d2bdc2c6b51e89f03d74d19034ce", "score": "0.58369094", "text": "function mobileSetUp()\n {\n $('.hiddenMobile').hide();\n $('.viewMobile').show();\n }", "title": "" }, { "docid": "37b8bca33ff05aeaa6c8d3ababb01e24", "score": "0.58295876", "text": "function loadmobile(){setmobile();window.location.reload()}", "title": "" }, { "docid": "84f9a45c295cbd57b55c39a1742e5055", "score": "0.58281934", "text": "function onDeviceReady() {\n\t$.mobile.defaultPageTransition = 'none';\n\t$.mobile.defaultDialogTransition = 'none';\n\t$.mobile.buttonMarkup.hoverDelay = 0;\n\t// iOS. BB. Android\n\tdocument.addEventListener(\"offline\", onOffline, false);\n\tdocument.addEventListener(\"online\", onOnline, false);\n\n}", "title": "" }, { "docid": "295afa52d60a5e8c6599e0cd46c465e6", "score": "0.5822111", "text": "function mobileSetUp()\n {\n \n $('.no-mobile').hide();\n $('.mobile').show();\n }", "title": "" }, { "docid": "bd67ce88007e3f709fa0fe0f743bd956", "score": "0.5820651", "text": "function fpNavCloseOnClickMobile(){\r\n if(windows.width() < 992) {\r\n $('.fullpage-menu').on('click', 'li a', function(e) {\r\n $('.side-header-toggle').removeClass('toggle-close');\r\n $('.side-menu-overlay').removeClass('overlay-show');\r\n $('.side-header').removeClass('side-menu-open');\r\n });\r\n }\r\n}", "title": "" }, { "docid": "e29191692247d435d507dda0634d6083", "score": "0.5818043", "text": "clickHandler() {\n if (this.Navigation.mobileState) {\n if (this.open) {\n this.open = false;\n this.button.setAttribute('aria-expanded', false);\n this.element.classList.remove('term-navigation-menu--expanded');\n this.menu.setAttribute('aria-hidden', true);\n } else {\n this.open = true;\n this.button.setAttribute('aria-expanded', true);\n this.element.classList.add('term-navigation-menu--expanded');\n this.menu.setAttribute('aria-hidden', false);\n this.buttonLink.focus();\n }\n }\n }", "title": "" }, { "docid": "9ff71f400a76bb542f5ca76a3d7263d4", "score": "0.5816977", "text": "function btnBack_OnTouch() {web.Back();}", "title": "" }, { "docid": "a5bc8f911dd515b1a8e40b8df073a6c2", "score": "0.5799958", "text": "function touchstart(event) {\n // prevents this from running when the sandwich menu button is visible:\n // prevents this from running when we're doing the \"phone\" menu\n if ($('.navbar .toggle-nav-bar').css('display') !== 'none') {\n return false;\n }\n\n if ($(this).closest('.dropdown').hasClass('open')) {\n } else {\n // If it is a touch event, get rid of the click events.\n if (event.type == 'touchstart') {\n $(this).off('click.toggleNav');\n }\n $(this).parent('.dropdown').addClass('open');\n $(this).parent('.dropdown').addClass('open');\n self.openMenu = this;\n event.preventDefault();\n event.stopPropagation();\n }\n }", "title": "" }, { "docid": "fd9dea43022ddfc43cf2600a1b3d5b63", "score": "0.5799006", "text": "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "title": "" }, { "docid": "c6454a9d7204b70c92e0a15ba3d46cec", "score": "0.57907677", "text": "function clickTheGreyBackgroundToCloseMobile() {\n hamburgerAnimation();\n}", "title": "" }, { "docid": "45adfc0883014a1f0d895e8048253c80", "score": "0.5782326", "text": "function tdAjaxSubCatMegaRunOnTouch(event, jQueryObject) {\r\n if ( (true === tdSubCatMegaRunLink) && (event.target === tdSubCatMegaLastTarget) ) {\r\n window.location = event.target;\r\n } else {\r\n tdSubCatMegaRunLink = true;\r\n tdSubCatMegaLastTarget = event.target;\r\n event.preventDefault();\r\n\r\n setTimeout( function() {\r\n tdSubCatMegaRunLink = false;\r\n }, 300);\r\n\r\n tdAjaxSubCatMegaRun(event, jQueryObject);\r\n }\r\n }", "title": "" }, { "docid": "e5437f1dc87e5baf341005dc2d07b548", "score": "0.57641983", "text": "function exeMenuPageOpen(){\n //Windows Phone checks.\n\tif($.mobile.path.getLocation(\"x-wmapp0://www/ustadmobile_menuPage2.html\") != \"x-wmapp0://www/ustadmobile_menuPage2.html\"){\n\t\tdebugLog('there is path problem');\n\t}else{\n\t\tdebugLog('everything is OK with paths');\n\t}\n\tdebugLog(\"Ustad Mobile Content: You will go into: exeMenuPage \" + exeMenuPage2);\n //alert(\"userAgent:\" + navigator.userAgent);\n //if( platform == \"android\" ){\n if(navigator.userAgent.indexOf(\"Android\") !== -1){\n var exeMenuLink2 = localStorage.getItem(\"baseURL\") + \"/\" + exeMenuPage2;\n\t debugLog(\"Ustad Mobile Content: ANDROID: You will go into: exeMenuLink \" + exeMenuLink2);\t\n }else if(navigator.userAgent.indexOf(\"Windows Phone OS 8.0\") !== -1){\t//Currently only Windows Phone checks.\n\t var exeMenuLink2 = \"/www/\" + exeMenuPage2;\n debugLog(\"Ustad Mobile Content: WINDOWS PHONE 8: You will go into: exeMenuLink \" + exeMenuLink2);\n }else if(navigator.userAgent.indexOf(\"BB10\") !== -1){\n //Do nothing\n console.log(\"Detected your device platform as: Blackberry 10!\");\n var exeMenuLink2 = localStorage.getItem(\"baseURL\") + \"/\" + exeMenuPage2;\n\t debugLog(\"Ustad Mobile Content: Blackberry 10: You will go into: exeMenuLink \" + exeMenuLink2);\n //alert(\"BB10TEST: Ustad Mobile Content: Blackberry 10: You will go into: exeMenuLink \" + exeMenuLink2);\n }else if(navigator.userAgent.indexOf(\"iPhone OS\") !== -1 ){\n //Do nothing\n console.log(\"Detected your device platform as: iOS!\");\n\t//alert(\"Detected iOS.\");\n var exeMenuLink2 = localStorage.getItem(\"baseURL\") + \"/\" + exeMenuPage2;\n\t debugLog(\"Ustad Mobile Content: iOS: You will go into: exeMenuLink \" + exeMenuLink2);\n\t//alert(\"exeMenuLink: \" + exeMenuLink2);\n }else{\n console.log(\"Unable to detect your device platform. Error.\");\t\n\t//alert(\"Unable to get platform..\");\n }\n $.mobile.changePage( exeMenuLink2, { transition: \"slideup\" } );\n}", "title": "" }, { "docid": "a2f1c827adfb60402e2555afbda0c6c3", "score": "0.57560736", "text": "function handler_click() {\n\t\t//\tStuff to do on the click\n\t}", "title": "" }, { "docid": "396129d730de26d5a558729f9d9d4f41", "score": "0.57545674", "text": "_buttonTap() {\n this.dispatchEvent(new CustomEvent(\"click\", { detail: this }));\n }", "title": "" }, { "docid": "6f9ea6767236d077cf6da5c1f1979391", "score": "0.5752597", "text": "function click(layoutManager){\n return {\n restrict: 'A', \n link: function(scope, element, attrs){\n \n\n element.bind('touchstart click', function(event) {\n\n console.log('clicked');\n \n event.preventDefault();\n event.stopPropagation();\n \n scope.$event = event;\n scope.$apply(attrs['click']);\n\n });\n }\n };\n }", "title": "" }, { "docid": "99d9e5759d2c44b6619be26bb6c0ba64", "score": "0.5750859", "text": "function iPadseemenu(){\r\n\tif ($(window).width() <= 767) {\r\n $('.see-head').on('click',function(){\r\n if(!$(this).hasClass('selected')){\r\n $(this).addClass('selected');\r\n $('.see-menu').slideDown();\r\n }\r\n else{\r\n $(this).removeClass('selected');\r\n $('.see-menu').slideUp(); \r\n } \r\n }); \r\n\t}\r\n}", "title": "" }, { "docid": "4b517fd8adfde74d10a5c1d478a6ed97", "score": "0.57492906", "text": "handletouchstart(e) {\n var touch = e.touches[0];\n var mouseEvent = new MouseEvent(\"mousedown\", {\n clientX: touch.clientX,\n clientY: touch.clientY\n })\n this.canvas.dispatchEvent(mouseEvent);\n e.preventDefault();\n }", "title": "" }, { "docid": "84c1a745a614d33d5de1266d728b8b87", "score": "0.573138", "text": "function doubleTapIni(windowW) {\r\n\t\t$('.touch category-block__list a').doubleTapToGo();\r\n\t\tif (windowW > 767) {\r\n\t\t\t$('.touch ul.navbar-nav > li').each(function () {\r\n\t\t\t\tif ($(this).find('a').hasClass('dropdown-toggle')) {\r\n\t\t\t\t\t$(this).doubleTapToGo()\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "11f7aefa664e3b3d2be543f7e016fb5a", "score": "0.5726181", "text": "function detectDisengageMobile(event, str)\n {\n if(str === \"touchstart\")\n {\n touch_start_time = Date.now();\n }\n\n\n if(str === \"touchend\")\n {\n let currenttime = Date.now();\n /* touch for 5 second or more */\n if(currenttime - touch_start_time > TOUCH_DISENGAGE_TIME)\n {\n disengageSignalServer();\n }\n\n }\n\n return true;\n }", "title": "" }, { "docid": "d6965c038eb4da27bcf2184bc2547008", "score": "0.5722948", "text": "click_event(){\n const card = this.card;\n deck.element.addEventListener('click', function handler(event){\n if(event.target && event.target.matches('.card:not(.open)')){\n card.open(event.target);\n }\n // mobile\n else if (event.target && event.target.matches('I.fa') && event.target.parentElement.matches('.card:not(.open)')){\n card.open(event.target.parentElement);\n }\n },false);\n }", "title": "" }, { "docid": "5ca4dfca4671f2b9e593238c91983ff0", "score": "0.5721627", "text": "_onBannerItemClicked(adjURL: string) {\n this.props.navigator.push({ name: 'WebPage',url: adjURL });\n }", "title": "" }, { "docid": "60a53c6d35e91c929743651c2d865f28", "score": "0.57209605", "text": "tapEventOn(e) {\n if (typeof this.hoverClass !== typeof undefined && !this.disabled) {\n // break class into array\n var classes = this.hoverClass.split(\" \");\n // run through each and add or remove classes\n classes.forEach((item, index) => {\n if (item != \"\") {\n this.shadowRoot.querySelector(\"#button\").classList.add(item);\n if (item.indexOf(\"-\") != -1) {\n this.shadowRoot.querySelector(\"#icon\").classList.add(item);\n }\n }\n });\n }\n }", "title": "" }, { "docid": "566776465cdf66fcd632e8999b4b600b", "score": "0.5720453", "text": "handleProductLongPressRelease() {\n if (isMobile)\n clearTimeout(this.productPressTimer);\n }", "title": "" }, { "docid": "0147bb6aac2a5169f9086492e5048fd1", "score": "0.5713222", "text": "function triggerTicketMachine()\n{\n\t// Once an event has completed, the mobile device calls this funtion to trigger the ticket machine.\n\t// Android ticket machine is native (so doesn't need to use this callback)\n\tif(deviceType == 'ios'){\n\t\t//console.log('triggerTicketMachine');\n\t\tshowTicketMachine();\n\t}\n}", "title": "" }, { "docid": "807ff55bb93857a40f36aa218e0005b7", "score": "0.5711519", "text": "function handleIconInteraction() {\n if (icon.dataset.open == dataOpen) {\n closeMobileMenu();\n } else {\n openMobileMenu();\n }\n }", "title": "" }, { "docid": "f473d44f4aa09f842c0b246d2f26a763", "score": "0.5707521", "text": "function touchNav() {\r\n $(\"#work-carousel-mobile\").on(\"swipeleft\", function () {\r\n $(\".right.carousel-control\").trigger(\"click\");\r\n });\r\n $(\"#work-carousel-mobile\").on(\"swiperight\", function () {\r\n $(\".left.carousel-control\").trigger(\"click\");\r\n });\r\n }", "title": "" }, { "docid": "0aabdb84b03d960bb0c1bfc78eccd1a8", "score": "0.5697396", "text": "function Local__clickHandler(e) {\n\tif (e.button !== 0) { return; } // handle left-click only\n\tvar request = local.util.extractRequest.fromAnchor(e.target);\n\tif (request && ['_top','_blank'].indexOf(request.target) !== -1) { return; }\n\tif (request) {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\tlocal.util.dispatchRequestEvent(e.target, request);\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "1d5600f7f2cd152c136338f10d2cd0cb", "score": "0.5697365", "text": "fireClick() {}", "title": "" }, { "docid": "981d90d81fe7308a7a283a2fef2e1e36", "score": "0.5692574", "text": "function collegeMiddleMobileMenuClicked(){\n\t/* This is only used for Medium and smaller devices. So only allow the\n\t * below code to run when window width is medium or smaller (< 64.063em)\n\t */\n\tvar width = $(window).width() / parseFloat($(\"body\").css(\"font-size\"));\n\tif( width < 64.063 ){\n\t\tvar elem = $('.dropDownCollegeMenu');\n\t\tif (elem.hasClass('active')) {\n\t\t\telem.slideUp( 250,'easeInOutExpo', function (){\n\t\t\t\t$(this).css('display', '').removeClass('active');\n\t\t\t});\n\t\t} else {\n\t\t\telem.slideDown(250, 'easeInOutExpo', function() {\n\t\t\t\t$(this).addClass('active');\n\t\t\t});\n\t\t};\n\t}\n}", "title": "" }, { "docid": "66cfd4edc783eeeda360c3ad2d330614", "score": "0.56887734", "text": "function mic_click_handler(e) {\n\tstates.mic_on = !(states.mic_on);\n\tif (states.mic_on) {\n\t\tuserStartAudio().then(function() {\n\t\t\tmic.start();\n\t\t\tmic_fft.setInput(mic);\n\t\t});\n\t\tthis.style.opacity = \"1\";\n\t}\n\telse {\n\t\tmic.stop();\n\t\tthis.style.opacity = \".6\";\n\t}\n}", "title": "" }, { "docid": "afdf06846e1e2f3a0fd4e6bb9c899edf", "score": "0.56835926", "text": "function clickItbackMessageType() {\n showMessagingtest();\n}", "title": "" }, { "docid": "a771166604dd792fadf7dc445a4e74f2", "score": "0.5680112", "text": "handleClick(e) {\n\t\tconst id = $(e.currentTarget).attr('href');\n\n\t\tVeams.Vent.trigger(Veams.EVENTS.navigation.clicked, id);\n\t\te.preventDefault();\n\t}", "title": "" }, { "docid": "391fd62e77baf908c8022c5529ea6649", "score": "0.56696445", "text": "function preventClickSpam() {\n $('.card').off('click');\n $('.card').off('tap');\n window.setTimeout(() => {\n $('.card').click(toggleCardOpenClose);\n $('.card').on('tap', toggleCardOpenClose);\n }, 500); // Value corresponds to .card-exterior \"transition\" attribute.\n}", "title": "" }, { "docid": "08098f430618ae274708852d7acbd50f", "score": "0.56611055", "text": "function toggleMobileNav(event) {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\t\n\t\t$('body').toggleClass('mobile-nav--is-open');\n\t\twindow.scrollTo(0,0);\n\t}", "title": "" }, { "docid": "81fdb430f994cbb22681d0b9430edcf9", "score": "0.5655625", "text": "function clickHandler() {\n audioContext.resume();\n document.body.removeEventListener(\"click\", clickHandler);\n document.body.removeEventListener(\"touchend\", clickHandler);\n }", "title": "" }, { "docid": "3bcf1a6f2e664d23caa3b133288fd356", "score": "0.5654505", "text": "function showCitationOnClick($) {\n $('.citation-num.citation-num-mobile').each(function() {\n touchClick($(this), () => {\n $(this).next().addClass('fadeIn').slideToggle(200);\n })\n });\n}", "title": "" }, { "docid": "997beb087fa12b4aadb66bf8bf0dbf87", "score": "0.56465274", "text": "function touchHandler(event) {\n var touch = event.changedTouches[0];\n\n var simulatedEvent = document.createEvent(\"MouseEvent\");\n simulatedEvent.initMouseEvent({\n touchstart: \"mousedown\",\n touchmove: \"mousemove\",\n touchend: \"mouseup\"\n }[event.type], true, true, window, 1,\n touch.screenX, touch.screenY,\n touch.clientX, touch.clientY, false,\n false, false, false, 0, null);\n\n touch.target.dispatchEvent(simulatedEvent);\n // Clicks should continue to work\n if( event.type === \"touchmove\" ) event.preventDefault();\n}", "title": "" }, { "docid": "a7e9fb67812c07066f882116f2f1430f", "score": "0.56389457", "text": "function checkMobileMode() {\n var width = $(window).width();\n if (width > 1000) {\n turnOffAllTaskFunctionality();\n\n makeDraggableAndDroppable();\n clickResize();\n $(\".draggableTask p:last-child\").mousedown(function (event) {\n $(this).focus();\n });\n }\n else {\n turnOffAllTaskFunctionality();\n\n $(\".task\").click(function () {\n var data = { id: $(this).attr(\"id\") };\n makeDialog(\"/Task/GetTaskDetails_Ajax\", data);\n })\n }\n}", "title": "" }, { "docid": "7d3a7313f6ea9e5237929ab167b13089", "score": "0.5636837", "text": "function checkForMobile() {\n if (_currentViewPortSize.width <= _tabletBreakWidth || _browserInfo.mobile.any()) {\n switchToMobileView();\n } else if (_currentViewPortSize.width > _tabletBreakWidth) {\n switchToDesktopView();\n }\n }", "title": "" }, { "docid": "39b8b5f748e830fbafaa06f76be9a4ab", "score": "0.5634701", "text": "function onSocialClick(snName) {\n Analytics.trackEvent('web', 'main-social-click', snName);\n }", "title": "" }, { "docid": "60439ad96f6637c803dbb8985c853ea8", "score": "0.5634074", "text": "function contentItemTap() {\n\n\t\tif (!isMenuOpen) {\n\t\t\t\n // Change the current screen\n App.navigate($(this).attr(\"href\"));\n\t\t\n } else {\n \n // If the menu is open, close it\n\t\t\tcloseMenu();\n\n }\n\t\treturn false;\n\t}", "title": "" }, { "docid": "8dd36367f00834f413313bde57ca12ce", "score": "0.56199014", "text": "function openMobileMenu(){\n if (breakPoint == 'xx' || breakPoint == 'xs' || breakPoint == 'sm') {\n $('.hamburger').attr('data-toggle', 'collapse');\n $('.hamburger').attr('aria-expanded', 'true');\n $('.hamburger').attr('data-target', '#mobile-wrap');\n $('.hamburger').addClass('collapsed');\n $('.mobile-wrap').addClass('collapse');\n\n } else {\n\n $('.hamburger').removeAttr('data-toggle', 'collapse');\n $('.hamburger').removeAttr('aria-expanded', 'true');\n $('.hamburger').removeAttr('data-target', '#mobile-wrap');\n $('.hamburger').removeClass('collapsed');\n $('.mobile-wrap').removeClass('collapse');\n }\n }", "title": "" }, { "docid": "1eb64bf0d09f42490e25e2ec737139eb", "score": "0.56099147", "text": "function clicktag_Click(e) {\n if (dcSelect) {\n Enabler.exit(\"Exit Click\");\n // Enabler.exitOverride(\"Exit Click\", \"https://www.google.com\");\n Enabler.counter(\"Counter Click\");\n } else {\n window.open(window.clickTag);\n }\n}", "title": "" }, { "docid": "1eb64bf0d09f42490e25e2ec737139eb", "score": "0.56099147", "text": "function clicktag_Click(e) {\n if (dcSelect) {\n Enabler.exit(\"Exit Click\");\n // Enabler.exitOverride(\"Exit Click\", \"https://www.google.com\");\n Enabler.counter(\"Counter Click\");\n } else {\n window.open(window.clickTag);\n }\n}", "title": "" }, { "docid": "5081728542f53c62dc9b0faa22f3a5d1", "score": "0.5608519", "text": "function FastClick(a,b){function c(a,b){return function(){return a.apply(b,arguments)}}var d;b=b||{};this.trackingClick=!1;this.trackingClickStart=0;this.targetElement=null;this.lastTouchIdentifier=this.touchStartY=this.touchStartX=0;this.touchBoundary=b.touchBoundary||10;this.layer=a;this.tapDelay=b.tapDelay||200;if(!FastClick.notNeeded(a)){for(var g=\"onMouse onClick onTouchStart onTouchMove onTouchEnd onTouchCancel\".split(\" \"),f=0,h=g.length;f<h;f++)this[g[f]]=c(this[g[f]],this);deviceIsAndroid&&\n(a.addEventListener(\"mouseover\",this.onMouse,!0),a.addEventListener(\"mousedown\",this.onMouse,!0),a.addEventListener(\"mouseup\",this.onMouse,!0));a.addEventListener(\"click\",this.onClick,!0);a.addEventListener(\"touchstart\",this.onTouchStart,!1);a.addEventListener(\"touchmove\",this.onTouchMove,!1);a.addEventListener(\"touchend\",this.onTouchEnd,!1);a.addEventListener(\"touchcancel\",this.onTouchCancel,!1);Event.prototype.stopImmediatePropagation||(a.removeEventListener=function(b,c,d){var e=Node.prototype.removeEventListener;\n\"click\"===b?e.call(a,b,c.hijacked||c,d):e.call(a,b,c,d)},a.addEventListener=function(b,c,d){var e=Node.prototype.addEventListener;\"click\"===b?e.call(a,b,c.hijacked||(c.hijacked=function(a){a.propagationStopped||c(a)}),d):e.call(a,b,c,d)});\"function\"===typeof a.onclick&&(d=a.onclick,a.addEventListener(\"click\",function(a){d(a)},!1),a.onclick=null)}}", "title": "" }, { "docid": "5033e7a48fe4f142a577a1fe9c38e69f", "score": "0.5606225", "text": "function openCardPhone(e) {\n if (!isCardOpen) { cardTogglePhone(e); } else { cardTogglePhone(null); }\n }", "title": "" }, { "docid": "10dc22b6a0629abed46fb33cf328bc69", "score": "0.55988795", "text": "onShortClick() { }", "title": "" }, { "docid": "e6b154cbe9a3fabe65a7886c83de918a", "score": "0.55959994", "text": "function returnFromMobile() {\n if (document.body.clientWidth >= 480) {\n var down = document.body.querySelector(\".down\");\n var downMenu = document.body.querySelector(\".down__menu\");\n var parent = downMenu.parentElement;\n var social = document.body.querySelectorAll(\".social\");\n var end = document.body.querySelectorAll(\".social-around\");\n downMenu.parentElement.removeChild(downMenu);\n down.appendChild(downMenu);\n var linksRight = document.body.querySelector(\".links .right\");\n linksRight.appendChild(social[0]);\n linksRight.appendChild(social[1]);\n down.removeChild(down.firstElementChild);\n \n }\n}", "title": "" }, { "docid": "4ec4b503e65a49351ed854cc6e1a961d", "score": "0.559447", "text": "function touchHandler(event) {\r\n var touch = event.changedTouches[0];\r\n\r\n var simulatedEvent = document.createEvent(\"MouseEvent\");\r\n simulatedEvent.initMouseEvent({\r\n touchstart: \"mousedown\",\r\n touchmove: \"mousemove\",\r\n touchend: \"mouseup\"\r\n }[event.type], true, true, window, 1,\r\n touch.screenX, touch.screenY,\r\n touch.clientX, touch.clientY, false,\r\n false, false, false, 0, null);\r\n\r\n touch.target.dispatchEvent(simulatedEvent);\r\n event.preventDefault();\r\n \r\n}", "title": "" }, { "docid": "29f2de62259d13578d9da2e2ef8a4d64", "score": "0.5592888", "text": "function dropdownHandlerMobile(e) {\n\te.stopPropagation();\n\te.preventDefault();\n\n\tvar mobileMenu = this.nextElementSibling;\n\tvar downCarat = this.childNodes[1];\n\n\tmobileMenu.classList.toggle('show');\n\tdownCarat.classList.toggle('active');\n\n\thideMenuHandler(mobileMenu.id);\n}", "title": "" }, { "docid": "092c39abd955aefd9b0ef571040e2e3c", "score": "0.55926293", "text": "function deviceChecker() {\n var eventHandler = \"\"\n //check if device is mobile or desktop --> Needs testing dont think itll work consistantly \n if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {\n //mobile \n // isMobile = true;\n console.log('mobile device')\n //click for mobile\n eventHandler = \"click\";\n //click ooption on for mobile\n $('.panel').click(dropDownHandler);\n } else {\n //desktop \n console.log('desktop')\n //hover for desktop\n eventHandler = \"mouseover\";\n //hover option on for desktop\n $('.panel').hover(dropDownHandler, exitHoverCallBack);\n }\n //make the panel open when page loads \n $(\".panel:eq(0)\").trigger(eventHandler);\n}", "title": "" }, { "docid": "0ac6c7bc6d5f26bb4e18b5771c86ba04", "score": "0.558345", "text": "function clickButton() {\n }", "title": "" }, { "docid": "ca9e427982972f6c55c712638ec592f6", "score": "0.55779415", "text": "function setupMobileTabs() {\r\n tabContentMobile.hide();\r\n tabMobile.click(function() {\r\n $f(this).toggleClass('selected').next().slideToggle();\r\n });\r\n tabMobile.eq(0).click();\r\n }", "title": "" }, { "docid": "c72c7b4ea7cbe7374553456a149926ae", "score": "0.55694604", "text": "function ao(){\r\n var aK,aJ,aM,aL,aN,s=false;\r\n am.unbind(\"touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick\").bind(\"touchstart.jsp\",function(aO){\r\n var aP=aO.originalEvent.touches[0];\r\n aK=aD();\r\n aJ=aB();\r\n aM=aP.pageX;\r\n aL=aP.pageY;\r\n aN=false;\r\n s=true\r\n })\r\n .bind(\"touchmove.jsp\",function(aR){\r\n if(!s){\r\n return\r\n }\r\n var aQ=aR.originalEvent.touches[0],aP=aa,aO=I;\r\n Q.scrollTo(aK+aM-aQ.pageX,aJ+aL-aQ.pageY);\r\n aN=aN||Math.abs(aM-aQ.pageX)>5||Math.abs(aL-aQ.pageY)>5;\r\n/* Returning true of no movement so rest of the screen can scroll */ \r\n return aP==aa&&aO==I\r\n })\r\n .bind(\"touchend.jsp\",function(aO){\r\n s=false\r\n })\r\n .bind(\"click.jsp-touchclick\",function(aO){\r\n if(aN){\r\n aN=false;\r\n return false\r\n }\r\n })\r\n }", "title": "" }, { "docid": "281cef91a1fd41ba18e7dbd159e831b2", "score": "0.5568188", "text": "function checkMobile() { return /iPhone|iPad|iPod|Android/i.test(navigator.userAgent); }", "title": "" }, { "docid": "012ddbf06425bc4fd22bbca4ee11a222", "score": "0.555924", "text": "function desktopSetUp()\n {\n $('.hiddenMobile').show();\n $('.viewMobile').hide();\n }", "title": "" }, { "docid": "52f9b56b2f1f7e8bd6f4f41be606c028", "score": "0.5559024", "text": "function viewportGo_l() {\n\tundropclick();\n}", "title": "" }, { "docid": "7c68985a94cbd8b18cb6efd494aa984c", "score": "0.55485904", "text": "onVRClick(event) {\n this.dispatchEvent({ type: \"click\" });\n }", "title": "" }, { "docid": "7ba7a79d72c3de761ae35447dcbbc2d0", "score": "0.55451727", "text": "function burgerIconClick() {\n $(BURGER_BTN).on('click', e => {\n e.preventDefault();\n toggleMobileMenu();\n });\n}", "title": "" }, { "docid": "45390be3a1e91e911967611e4e6dbafa", "score": "0.554504", "text": "function clickable() { ; }", "title": "" }, { "docid": "09733752b89ead40b6bac0e9b896af48", "score": "0.5545003", "text": "function openSectionBindClick($selector, $target, $targetMobile)\n {\n $(\"#\"+$selector).click(function()\n {\n if(_isMobile)\n {\n $('#'+$targetMobile).slideToggle( \"slow\", function() \n {\n checkBoxVisibility();\n });\n }else\n {\n $('#'+$target).slideToggle( \"slow\", function() \n {\n checkBoxVisibility();\n });\n }\n });\n }", "title": "" }, { "docid": "0f763157d62f93d4b98cf6775bfe82a0", "score": "0.554456", "text": "handleTechTouchMove_() {\n if (this.userWasActive) {\n this.reportUserActivity();\n }\n }", "title": "" }, { "docid": "e2830816acdd8fb86e6e57a1ef33fd30", "score": "0.55387014", "text": "onMobileModeChanged(inMobileMode) {\n }", "title": "" }, { "docid": "2f4ecc2e74aa99e8c1979fcdce18e388", "score": "0.553794", "text": "function FastClick(t,e){\"use strict\";function i(t,e){return function(){return t.apply(e,arguments)}}var n;if(e=e||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=e.touchBoundary||10,this.layer=t,this.tapDelay=e.tapDelay||200,!FastClick.notNeeded(t)){for(var o=[\"onMouse\",\"onClick\",\"onTouchStart\",\"onTouchMove\",\"onTouchEnd\",\"onTouchCancel\"],s=this,r=0,c=o.length;c>r;r++)s[o[r]]=i(s[o[r]],s);deviceIsAndroid&&(t.addEventListener(\"mouseover\",this.onMouse,!0),t.addEventListener(\"mousedown\",this.onMouse,!0),t.addEventListener(\"mouseup\",this.onMouse,!0)),t.addEventListener(\"click\",this.onClick,!0),t.addEventListener(\"touchstart\",this.onTouchStart,!1),t.addEventListener(\"touchmove\",this.onTouchMove,!1),t.addEventListener(\"touchend\",this.onTouchEnd,!1),t.addEventListener(\"touchcancel\",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(t.removeEventListener=function(e,i,n){var o=Node.prototype.removeEventListener;\"click\"===e?o.call(t,e,i.hijacked||i,n):o.call(t,e,i,n)},t.addEventListener=function(e,i,n){var o=Node.prototype.addEventListener;\"click\"===e?o.call(t,e,i.hijacked||(i.hijacked=function(t){t.propagationStopped||i(t)}),n):o.call(t,e,i,n)}),\"function\"==typeof t.onclick&&(n=t.onclick,t.addEventListener(\"click\",function(t){n(t)},!1),t.onclick=null)}}", "title": "" }, { "docid": "d2efa36567f8ca2e7e7f5daba5439d86", "score": "0.5532519", "text": "function customLinkClickHandler() {\n var target;\n if (target = getTargetAttribute(this)) {\n if (target == 'stop') {\n option[13]/*auto*/ = FALSE;\n stopAuto();\n } else if (target == \"start\") {\n startAuto();\n option[13]/*auto*/ = TRUE;\n } else if (target == 'block') {\n clickable = FALSE;\n } else if (target == 'unblock') {\n clickable = TRUE;\n } else {\n enqueueAnimation((target == parseInt10(target)) ? target - 1 : target, TRUE);\n }\n }\n return FALSE;\n }", "title": "" }, { "docid": "e6af8250337a6dc07617bbb9cf0020cc", "score": "0.55304444", "text": "function _exitMobile() {\n\t\t\t$scope.$broadcast('exit-mobile');\n\t\t}", "title": "" }, { "docid": "9c4130614d1f100ca241ced3f50cd50b", "score": "0.55257833", "text": "function mobileMenuShiftAwayLink() {\n const elementMenuMobileLink = document.getElementsByClassName(\"menu_mobile_link\");\n for (let i = 0; i < elementMenuMobileLink.length; i++) {\n elementMenuMobileLink[i].addEventListener(\"click\", function() {\n document.getElementById(\"animation_mobile_menu\").style.display = \"none\";\n document.getElementById(\"div_mobile_menu\").style.display = \"none\";\n document.getElementById(\"nav_mobile_menu\").style.display = \"block\";\n document.getElementById(\"nav_mobile_menu\").addEventListener(\"click\", mobileMenuPopUp);\n document.getElementById(\"div_mobile_menu\").style.opacity = 0;\n });\n }\n }", "title": "" }, { "docid": "424fce98e06e0335276d73515be3a705", "score": "0.5523683", "text": "function hb_is_mobile(){\n\tif( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {\n\t\t$body.addClass('mobile mobile-device');\n\t}\n}", "title": "" }, { "docid": "7f716e911e8b0b9292ed656930b6deba", "score": "0.5503497", "text": "function handleClick () {\n\t}", "title": "" }, { "docid": "2cdb7e455c58293e153ad13b3122d77e", "score": "0.550324", "text": "function mobileToggle(e) {\n\t\t\tif ($(e).hasClass(\"active\") == true) {\n\t\t\t\t$(e).animate({maxHeight: \"70px\"}, 300).removeClass(\"active\");\n\t\t\t} else {\n\t\t\t\t$(e).animate({maxHeight: \"100vh\"}, 300).addClass(\"active\");\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "199823edf0db66a57f88b77a09a42e3a", "score": "0.5495514", "text": "function h(){var e=window.navigator.userAgent;return(-1===e.indexOf(\"Android 2.\")&&-1===e.indexOf(\"Android 4.0\")||-1===e.indexOf(\"Mobile Safari\")||-1!==e.indexOf(\"Chrome\")||-1!==e.indexOf(\"Windows Phone\"))&&(window.history&&\"pushState\"in window.history)}", "title": "" }, { "docid": "a31b5a70432a7ea15988624eb6d8e60b", "score": "0.5483041", "text": "function handleHireClick(e) {\n\tlocation.href = \"\";\n}", "title": "" } ]
35d89ee3ac1e30c58af916935248994e
generate new questions and reset instance variables
[ { "docid": "48d178d010aa7ecf90b5f65262dec541", "score": "0.6474137", "text": "reset() {\n this.generateQuestions();\n this.timer = new Timer(10, this.timesUp(this));\n this.round = 0;\n this.score = 0;\n this.multiplier = 1;\n this.currentQuestion = this.questions[this.round];\n this.userGuess = '';\n\n // housekeeping - clear the board \n this.timer.remove();\n this.currentQuestion.clear();\n this.clearNextQuestionPromt();\n }", "title": "" } ]
[ { "docid": "6e0608ad32e552f242d97ac25d68cb39", "score": "0.7902963", "text": "generateQuestions() {\n const questions = []\n const randoms = this.randomQuestions();\n for (let i = 0; i < randoms.length; i++) {\n const question = new Question(randoms[i]);\n questions.push(question);\n }\n\n this.questions = questions;\n }", "title": "" }, { "docid": "6f2fc038069ea365476e82ffc3d26e5d", "score": "0.7423109", "text": "function loadQuestion() {\n let singleQuestion = new QuestionAndAnswer\n (\n randomLoremGenMax66Words(7, 20),\n randomLoremGenMax66Words(3, 66),\n numberOfQuestion\n );\n\n showQuestion(\n singleQuestion.getQuestion(),\n singleQuestion.getAnswer(),\n phaseAppendQuestions\n );\n //Global change\n numberOfQuestion++;\n}", "title": "" }, { "docid": "b055006a4f980ba2a8478c36b4cc398a", "score": "0.73392", "text": "function populateQuestions(){\nallQuestions = defaultQuestions;\nquestions = defaultQuestions[current];\nquestion = questions.question;\nchoiceA = questions.choiceA;\nchoiceB = questions.choiceB;\nchoiceC = questions.choiceC;\nchoiceD = questions.choiceD;\n}", "title": "" }, { "docid": "c0dc88b1638108824e2f0dc7245b2cbc", "score": "0.724611", "text": "function setupNewQuestion() {\n question = new MinusQuestion();\n questionElement.innerText = question.questionText();\n answerElement.value = \"\";\n }", "title": "" }, { "docid": "caab26beb565cfe75f5be815a65b008a", "score": "0.7243469", "text": "function resetUsedQuestions() {\n usedQuestions = [];\n}", "title": "" }, { "docid": "be01c81e5d782f133a9734f15a071b28", "score": "0.7171578", "text": "function makeQuestion() {\n randomizeQuestion();\n displayQuestion();\n }", "title": "" }, { "docid": "201a82df32491c3804563041b4647f96", "score": "0.7169128", "text": "function qGenerator(){\n var i = Math.floor(Math.random()*questionSet.length);\n question.textContent = questionSet[i][0];\n answer1.textContent = questionSet[i][1];\n answer2.textContent = questionSet[i][2];\n answer3.textContent = questionSet[i][3];\n answer4.textContent = questionSet[i][4];\n questionSet.splice(i,1);\n}", "title": "" }, { "docid": "be2cd6e9b3acbeab7b9aaccea216adcd", "score": "0.7132091", "text": "function newQuestion() {\n var allQuestions = [ageQue, jobQue, countryQue];\n\n var n = Math.floor(Math.random() * allQuestions.length);\n\n allQuestions[n].displayQuestion();\n\n var answer = prompt(allQuestions[n].question);\n\n if (answer !== 'exit') {\n allQuestions[n].checkAnswer(parseInt(answer));\n newQuestion();\n }\n }", "title": "" }, { "docid": "7b0d955a665d1d5ac4cc424c74ced9b4", "score": "0.7091687", "text": "generateQuestion() {\n questionDiv.empty();\n questionDiv.append(Object.values(this.questions[counter].question));\n this.startTimer();\n }", "title": "" }, { "docid": "3deec5471f7e55586c062472966e5925", "score": "0.7048493", "text": "function generateNewQuestion() {\n // increasing question tracker by 1 with each new question generated and updating text\n questionTracker++;\n questionTrackerText.innerText = questionTracker + \"/\" + totalQuestions;\n\n // variable for question index to generate random question from available questions array\n var questionIndex = Math.floor(Math.random(availableQuestions.length));\n // setting current question to a random index within the availabe questions array\n currentQuestion = availableQuestions[questionIndex];\n quizQuestion.innerText = currentQuestion.question;\n\n // following same principle for answer selections usinf forEach method\n answerSelections.forEach(answerSelection => {\n // variable to reference data-set in html \n var number = answerSelection.dataset[\"number\"];\n // printing selections to the screen that match with corresponding text \n answerSelection.innerText = currentQuestion[\"answerSelection\" + number];\n });\n // splicing out question that was used so it doesn't repeat\n availableQuestions.splice(questionIndex, 1);\n}", "title": "" }, { "docid": "737ee54f63bde82b3564bd7670f34bb2", "score": "0.70346135", "text": "function generateQuestions() {\n questionArray.push(new question(\"What card has the following flavor text? <br><br> <em>'A blade that has never known sheath, a hilt that has never known hand.'</em>\", [\"Dancing Scimitar\", \"Sword of the Ages\", \"Whirling Dervish\", \"Blade Sentinel\"], \"dancing-scimitar.jpg\"));\n questionArray.push(new question(\"First printed in Alpha, is the only card with art painted by Faye Jones. It pictures a clown and a blindfolded humanoid fox balanced on a scale.\", [\"Stasis\", \"Jackal Pup\", \"Atog\", \"Noetic Scales\"], \"stasis.jpg\"));\n questionArray.push(new question(\"Which of these is NOT a creature type on the card Coiling Oracle?\", [\"Merfolk\", \"Snake\", \"Elf\", \"Druid\"], \"coiling_oracle.jpg\"));\n questionArray.push(new question(\"Which of these lands is both a Swamp and and Island\", [\"Underground Sea\", \"Overgrown Tomb\", \"Lonely Sandbar\", \"Bloodstained Mire\"], \"underground_sea.jpg\"));\n questionArray.push(new question(\"What card has the following flavor text? <br><br> <em>'I want a banana this big!'</em>\", [\"Gorilla Titan\", \"Tasigur, the Golden Fang\", \"Uktabi Orangutan\", \"Hyalopterous Lemure\"], \"gorilla_titan.jpg\"));\n questionArray.push(new question(\"What is the converted mana cost of the card Enlisted Wurm?\", [6, 5, 7, 8], \"enlisted_wurm.jpg\"));\n questionArray.push(new question(\"Besides Shaman, what creature type does Thundercloud Shaman have?\", [\"Giant\", \"Elf\", \"Elemental\", \"Goblin\"], \"thundercloud_shaman.jpg\"));\n questionArray.push(new question(\"How much damage does the card Pyroclasm do to each creature?\", [2, 3, 4, 1], \"pyroclasm.jpg\"));\n questionArray.push(new question(\"What is Lord of the Pit's power and toughness?\", [\"7/7\", \"6/6\", \"5/5\", \"8/8\"], \"lord_of_the_pit.jpg\"));\n questionArray.push(new question(\"What color is the card Volcanic Erruption\", [\"Blue\", \"Red\", \"Black\", \"Green\"], \"volcanic_erruption.jpg\"));\n}", "title": "" }, { "docid": "972aa0d00eafd19734868c33fffbf6b7", "score": "0.7029648", "text": "function init() {\n questions();\n}", "title": "" }, { "docid": "ff619fc488f4a983a7b59b9ee017b3d4", "score": "0.7003965", "text": "function setQuestions() {\n for (let i = 0; i < questionsLength; i++) {\n availableQuestion.push(quizQuestions[i]);\n }\n}", "title": "" }, { "docid": "f5b8ace8f7f68fdadf7a20966f7a928b", "score": "0.6993607", "text": "function setNextQuestion(){\n //resets everything back to the starting state for each quesiton\n resetState()\n //runs the function that dynamically generates the questions\n showQuestion(shuffledQuestions[currentQuestionIndex])\n}", "title": "" }, { "docid": "b1b6680dd5fc0f19d6810985c06bbf29", "score": "0.69657195", "text": "function populate() {\n new Questions('cult', 'The Goonies search for which pirate\\'s treasure?', 'Blackbeard', 'Davy Jones', 'Calico Jack', 'One Eyed-Willy', 4);\n new Questions('cult', 'Which 80s movie theme song was recorded in just 3 hours?', '\"Oh Yeah\" - Ferris Bueller\\'s Day Off', '\"Don\\'t You (Forget About Me)\" - The Breakfast Club', '\"Storybook Love\" - The Princess Bride', '\"Ghostbusters\" - Ghostbusters', 2);\n new Questions('magic', 'In the Labyrinth, what other name does the Goblin King go by (Hint: The Goblin King is played by David Bowie!)?', 'The Lord of the Labyrinth', 'Robert', 'Jareth', 'His Highness', 3);\n new Questions('magic', 'What is the name of Atreyu\\'s horse in The NeverEnding Story?', 'Artex', 'Teeny Weeny', 'Bastian', 'Urgl', 1);\n new Questions('horror', 'Which movie is in the Guinness Book of Records for the most retakes of a single scene?', 'A Nightmare on Elm Street', 'The Shining', 'The Evil Dead', 'Poltergeist', 2);\n new Questions('horror', 'How many Nightmare on Elm Street films were made in the 80s?', 3, 4, 5, 6, 3);\n new Questions('scifi', 'Which 80s movie was the highest grossing film of the decade?', 'E.T. the Extra-Terrestrial', 'Return of the Jedi', 'Tron', 'Aliens', 1);\n new Questions('scifi', 'This is the only actor to be killed by an Alien, Predator, and a Terminator.', 'Sigourney Weaver', 'Carl Weathers', 'Lance Henriksen', 'Bill Paxton', 4);\n new Questions('chevy', 'What nickname did Chevy Chase\\'s wife call him in the National Lampoon movies?', 'Buddy', 'Clark', 'Sparky', 'Mr. Griswold', 3);\n new Questions('cult', 'What song did Ducky lip sync in Pretty in Pink?', '\"Try a Little Tenderness\"', '\"Nothing\\'s Gonna Stop Us Now\"', '\"Saving All My Love for You\"', '\"Longer\"', 1);\n new Questions('action', 'Name That Movie: \"Snakes. Why did it have to be snakes?\"', 'Indiana Jones and the Template of Doom', 'Crocodile Dundee', 'The Princess Bride', 'Raiders of the Lost Ark', 4);\n new Questions('magic', 'Jim Hensen\\'s The Dark Crystal takes place in \"another world, another time, in the age of _____.\"', 'surprise', 'wonder', 'magic', 'uncertainty', 2);\n new Questions('scifi', 'The main street set in Back to the Future is also the main street in what other 80s movie?', 'RoboCop', 'Repo Man', 'Gremlins', 'E.T. the Extra-Terrestrial', 3);\n new Questions('scifi', 'What is the single most valuable commodity in David Lynch\\'s Dune?', 'Melange', 'Coffee', 'Salt', 'Plutonium', 1);\n new Questions('horror', 'Which is not a movie directed by John Carpenter?', 'The Fog', 'Halloween II', 'The Thing', 'Prince of Darkness', 2);\n new Questions('scifi', 'Whose work did NOT influence Blade Runner?', 'Philip K. Dick', 'Dan O\\'Bannon', 'Jean Giraud', 'Arthur C. Clarke', 4);\n new Questions('magic', 'What god does Conan the Barbarian worship?', 'Odin', 'Kull', 'Crom', 'Bhaal', 3);\n new Questions('magic', 'What was the first DVD sent out on Netflix in 1998?', 'Beetlejuice', 'The Dark Crystal', 'The NeverEnding Story', 'Gremlins', 1);\n new Questions('chevy', 'In Three Amigos!, what did the Dusty Bottoms play for the other amigos to dance to in the cantina?', 'Arm in Arm', 'My Little Buttercup', 'Cheek to Cheek', 'My Love, Sweet Love', 2);\n new Questions('chevy', 'In National Lampoon\\'s Christmas Vaction, which football team\\'s hat did Clark wear?', 'Green Bay Packers', 'Chicago Bears', 'Pittsburgh Steelers', 'Kansas City Chiefs', 2);\n new Questions('chevy', 'In Caddyshack, Ty Webb and Judge Smails each bet what amount in the golf match?', '$20k', '$40k', '$60k', '$80k', 1);\n new Questions('chevy', 'In Funny Farm, what hat does Andy wear for most of the film?', 'Chicago Cubs', 'New York Mets', 'Boston Red Sox', 'New York Yankees', 2);\n new Questions('action', 'In The Warriors, what famous line does Luther screech?', 'Just beat it', 'Come out to play', 'Let\\'s get down to it', 'Truth or dare', 2);\n new Questions('action', 'In Escape from New York, what is the only thing that Snake asks for when escaping?', 'A Shower', 'Water', 'A Phone Call', 'A Ride', 4);\n new Questions('action', 'In They Live, Nada is here to, \"Kick Ass and _____?\"', 'Take Names', 'Take a Break', 'Right Wrongs', 'Chew Bubblegum', 4);\n new Questions('action', 'In Highlander, the main villain - the Kurgan - says \"it\\'s better to _____.\"', 'be alone', 'burn the candle at both ends', 'burn out than to fade away', 'be feared than loved', 3);\n new Questions('horror', 'Although Jamie Lee Curtis has top billing in Halloween II, she only appears for _____ minutes in the film.', '23', '28', '31', '25', 4);\n new Questions('horror', 'In The Lost Boys, what was the name of the main love interest?', 'Star', 'Peony', 'Soleil', 'Moonflower', 1);\n new Questions('horror', 'In Pet Sematary, what was the name of the evil cat that comes back to life?', 'Josie', 'Kitty', 'Churches', 'Maxy', 3);\n new Questions('scifi', 'In The Thing, what computer game did R.J. MacReady play while sitting in his cabin?', 'Tetris', 'Chess', 'Pong', 'Solitaire', 2);\n new Questions('scifi', 'In Aliens, what was the little girl\\'s name who was the only survivor at the LV-426 settlement?', 'Sarah', 'Hadley', 'Newt', 'Salamander', 3);\n new Questions('scifi', 'In Blade Runner, what type of origami animal does Gaff make and leave outside Deckard\\'s house?', 'Frog', 'Unicorn', 'Horse', 'Swan', 2);\n new Questions('scifi', 'In The Terminator, what was the only possession that Kyle had of Sarah Connor\\'s?', 'Tapes', 'A Gun', 'A T-shirt', 'Polaroid', 4);\n new Questions('cult', 'In The Goonies, what was the name of the Fratelli family member whom Chunk befriends?', 'Mouth', 'Sloth', 'Sid', 'Brand', 2);\n new Questions('cult', 'In The Princess Bride, Buttercup knew it was Westley when he said what phrase to her?', 'Where you go I go', 'As I do hope you love me', 'As you wish', 'With your permission', 3);\n new Questions('scifi', 'In Back to the Future, how fast does Doc Brown tell Marty McFly he needs to drive in order to time travel in The DeLorean?', '66 mph', '77 mph', '88 mph', '99 mph', 3);\n new Questions('scifi', 'In E.T. the Extra-Terrestrial, what colorful candy did Elliot leave in a trail to attract E.T.?', 'Skittles', 'Reese\\'s Pieces','M&M\\'s', 'Runts', 2);\n new Questions('magic', 'In the Labyrinth, what animal does the Goblin King transform into?', 'Owl', 'Cat', 'Dog', 'Spider', 1);\n new Questions('magic', 'In Willow, the main character was not always a powerful sorcerer; what was he beforehand?', 'Farmer', 'Fisher', 'Baker', 'Shopkeeper', 1);\n new Questions('magic', 'In The NeverEnding Story, what was the name of Bastion\\'s luckdragon?', 'Troy', 'Artayu', 'Falkor', 'Jaryth', 3);\n new Questions('magic', 'In Clash of the Titans, which titan does Perseus kill to save Andromeda?', 'Kraken', 'Uranus', 'Mars', 'Cronus', 1);\n new Questions('action', 'Bruce Willis was paid an \"unheard of\" sum of money to star in Die Hard. How much was it?', '$3 Million', '$4 Million', '$5 Million', '$6 Million', 3);\n new Questions('action', 'Name That Movie: \"Son, your ego is writing checks your body can\\'t cash!\"', 'Lethal Weapon', 'Top Gun', 'Bloodsport', 'Beverly Hills Cop', 2);\n new Questions('horror', 'What was the first movie to win an Academy Award for Best Makeup?', 'An American Werewolf in London', 'The Evil Dead', 'Halloween II', 'Friday the 13th', 1);\n new Questions('horror', 'What movie did Andy Warhol call, \"A Clockwork Orange of the 1980s?\"', 'A Nightmare on Elm Street', 'Re-Animator', 'Christine', 'Videodrome', 4);\n new Questions('horror', 'Who did Steven Spielberg initially ask to write the Poltergeist script?', 'John Carpenter', 'Tobe Hooper', 'Stephen King', 'Dario Argento', 3);\n new Questions('cult', 'How many times was the name \"Heather\" said during the movie Heathers?', '70', '80', '90', '100', 3);\n new Questions('cult', 'David Lynch\\'s Blue Velvet contains subtle references to which historical figure\\'s assassination?', 'John F. Kennedy', 'Abraham Lincoln', 'Archduke Franz Ferdinand', 'Martin Luther King Jr.', 2);\n new Questions('cult', 'In the original script of Bill & Ted\\'s Excellent Adventure, the time machine was a _____?', 'Treadmill', 'Van', 'Closet', 'Hot Tub', 2);\n new Questions('cult', 'Which movie on IMDB is rated out of 11 instead of 10?', 'Ghostbusters', 'RoboCop', 'Scarface', 'This is Spinal Tap', 4);\n new Questions('chevy', 'How many National Lampoon\\'s Vacation movies came out in the 80s?', 1, 2, 3, 4, 3);\n new Questions('chevy', 'The Griswald family win a trip to Europe on what game show?', 'The Price Is Right', 'You Bet Your Life', 'Pig In A Poke', 'Wacky Wally World', 3);\n new Questions('chevy', 'In National Lampoon\\'s European Vacation, what Monty Python actor do the Griswalds literally keep running into?', 'Eric Idle', 'John Cleese', 'Terry Gilliam', 'Terry Jones', 1);\n new Questions('chevy', 'Which Cheers actor was in the movie Fletch with Chevy Chase?', 'Woody Harrelson', 'Kelsey Grammer', 'George Wendt', 'Ted Danson', 3);\n new Questions('cult', 'Who did not star in the 1982 classic, Fast Times at Ridgemont High?', 'Sean Penn', 'Forest Whitaker', 'Kevin Kline', 'Nicolas Cage', 3);\n new Questions('chevy', 'What 1980s movie did Chevy Chase turn down a leading role in?', 'Airplane', 'American Gigolo', 'Stir Crazy', 'Private Benjamin', 2);\n new Questions('chevy', 'What country were Emmett Fitz-Hume and Austin Millbarge sent to in Spies Like Us?', 'Saudi Arabia', 'Iran', 'Pakistan', 'Afghanistan', 3);\n new Questions('cult', 'In Scarface, Tony Montana came to America from which country?', 'Columbia', 'Puerto Rico', 'Italy', 'Cuba', 4);\n new Questions('chevy', 'What movie did Chevy Chase star in with Gregory Hines?', 'Deal Of The Century', 'The Couch Trip', 'Running Scared', 'Modern Problems', 1);\n new Questions('action', 'Which popular wrestler starred in the movie They Live?', 'Hulk Hogan', 'Andre The Giant', '\"Rowdy\" Roddy Piper', 'Jimmy \"Superfly\" Snuka', 3);\n new Questions('magic', 'What quintessential 80s rockband performed the soundtrack for Highlander?','Survivor', 'Rush', 'Journey', 'Queen', 4);\n new Questions('cult', 'In Real Genius, what does Professor Hathaway hate the smell of?', 'Coffee', 'Dirty Sneakers','Popcorn', 'Hairspray', 3);\n new Questions('magic', 'Who composed the film score for Beetlejuice?', 'John Williams', 'Hans Zimmer', 'Danny Elfman', 'Harold Faltimimer', 3);\n new Questions('action', 'What type of bird call was used to create the Predator\\'s click noise?', 'Wood Pecker', 'Crow', 'Blue Jay', 'cockatoo', 2);\n new Questions ('action', 'In Big Trouble in Little China, what must the sorceror do to retrieve his physical form?', 'Marry a green eyed girl', 'Sacrifice a pure woman', 'Bring back an ancestor from the dead', 'Kill a dragon', 1);\n new Questions('action', 'What future date does The Running Man take place in?', '2020', '2001', '2033', '2017', 4);\n new Questions('action', 'In Die Hard, what special gift does Riggs give Murtaugh at the end of the movie?', 'A special forces patch from his Army uniform', 'An unfired bullet', 'The bullet he was shot with during the movie', 'A zippo lighter he recieved from his deceased wife', 2);\n new Questions ('cult', 'Complete this famous line from Mad Max, Road Warrior: \"A fella, a quick fella, might have a weapon under there it would be a shame if I had to..\"', 'take off his hand', 'serve him to the snake', 'pin his head to the panel', 'slit his throat', 3);\n new Questions ('magic', 'What is the name of Honeythorn Gump\\'s fairy friend that accompanies them on their adventure in Legend?', 'Oona', 'Lilly', 'Asteria','Elvina', 1);\n new Questions ('cult', 'In ending number one of Clue, who killed the cook?', 'Miss Scarlet','The Butler', 'Yvette', 'Professor Plum', 3);\n new Questions ('chevy', 'What unwanted gift did Clark receive as his bonus during National Lampoon\\'s Christmas Vacation?', 'A yearly subscription to Time magazine', 'A yearly subscription to a Jelly of the Month Club', 'A really nice card', 'A designer set of towels', 2);\n new Questions('chevy', 'What is Chevy Chase\\'s real name?', 'Christopher', 'Cornelius', 'Cameron', 'Colton', 2);\n new Questions('horror', 'How many Evil Dead sequels were made?', '1', '2', '3', '4', 2);\n new Questions('chevy', 'Which Las Angeles Lakers player made an appearance in the movie Fletch?', 'Magic Johnson', 'Kareem Abdul-Jabbar', 'James Worthy', 'A.C. Green', 2);\n new Questions('chevy', 'In the movie Fletch, Irwin Fletcher published articles for the Las Angeles Times under which pseudonym?', 'Ann Landers', 'Mark Twain', 'Jane Doe', 'Busy Body', 3);\n new Questions('horror', 'Chucky first appeared in which 80s horror film?', 'Good Guy', 'Child\\'s Play', 'Sleep Tight', 'Let\\'s Play', 2);\n new Questions('horror', 'Which of the following is not a 1980s horror film?', 'The Stuff', 'The Blob', 'The Gate', 'The Slime', 4);\n new Questions('horror', 'In the 1983 movie The Dead Zone, Christopher Walken\\'s character has what special power?', 'He can see the future', 'He can see dead people', 'He can become invisible', 'He can kill people with his mind', 1);\n new Questions('horror', 'What model car was Christine in the 1983 John Carpenter movie?', '1958 Plymouth Fury', '1954 Buick Skylark', '1957 Ford Thunderbird', '1955 Chrysler 300', 1);\n}", "title": "" }, { "docid": "3280024f440f51c1ad5e5f582e8ead5f", "score": "0.6943061", "text": "function generateQuestion(){\n if(questions.length === 0) {\n // If there are no quotes remaining, triggers end of game\n handleEndOfGame();\n } else {\n randomNumber = generateRandomNumber();\n $('#question').empty().append(questions[randomNumber].question);\n $('#option1').empty().append(questions[randomNumber].option1);\n $('#option2').empty().append(questions[randomNumber].option2);\n $('#option3').empty().append(questions[randomNumber].option3);\n $('#option4').empty().append(questions[randomNumber].option4);\n $('#questionContainer').fadeIn(1000); \n }\n }", "title": "" }, { "docid": "67fdd3185d08106c999bdd09632fa170", "score": "0.6941443", "text": "function initQuestion() {\r\n /* Question array */\r\n var q = [\"This is a Debian derived Linux distribution managed and funded by the Offensive Security Ltd, designed for digital forensics and penetration testing. Which is this very famous OS majorly developed for Hackers and software testers?\", \"What is DDoS?\", \"The word X is a combination of the words “robot” and “network”. It is a number of Internet-connected devices, each of which is running one or more bots. This can be used to perform DDoS attacks, steal data, send spam. Identify the word X?\"];\r\n\r\n /* Answer array */\r\n var a = [\"kalilinux\", \"distributeddenialofservice\", \"botnet\"];\r\n\r\n /* Make a new array containing the question objects */\r\n var question = [];\r\n for (var i = 0; i < q.length; i++) {\r\n question.push(new Question(q[i], a[i]));\r\n }\r\n return question;\r\n}", "title": "" }, { "docid": "baaa0a2b2576819b11070d7b5f52da7f", "score": "0.69409657", "text": "function newGame(){\n var create1 = new genQuestion(question1);\n var create2 = new genQuestion(question2);\n var create3 = new genQuestion(question3);\n var create4 = new genQuestion(question4);\n var create5 = new genQuestion(question5);\n}", "title": "" }, { "docid": "9d54bd67dd29759f9873917c64541c5b", "score": "0.6936279", "text": "function questionSetup(current, answers, correct){\n \n this.current = current;\n this.answers= answers;\n this.correct = correct;\n \n}", "title": "" }, { "docid": "482210a0c6e388ca17c61f3e3a44d832", "score": "0.6915367", "text": "function newQuestion(){\r\n\t// remove stylings\r\n\t$('.correct').removeClass('correct');\r\n\t$('.wrong').removeClass('wrong');\r\n\t$('.disabled').removeClass('disabled');\r\n\t$('.selected').removeClass('selected');\r\n\r\n\t// hide the correct answer box\r\n\t$('#dontknowbox').hide();\r\n\tviewModel.currentAnswerAsText('');\r\n\r\n\t// reset current and user values\r\n\tviewModel.currentCardPosition(null);\r\n\tviewModel.currentCardValue(null);\r\n\tviewModel.currentCardSuit(null);\r\n\tviewModel.userCardSuit(null);\r\n\tviewModel.userCardValue(null);\r\n\tviewModel.userCardPosition(null);\r\n\tviewModel.currentCorrect(false);\r\n\r\n\t// reset question styles visible\r\n\tviewModel.questionStyleAVisible(false);\r\n\tviewModel.questionStyleBVisible(false);\t\r\n\tviewModel.questionStyleCVisible(false);\r\n\tviewModel.questionStyleDVisible(false);\r\n\r\n\r\n\t// take card from bank\r\n\tvar x = viewModel.currentBank()[0];\r\n\r\n\t// set position, value and suit of this card\r\n\tviewModel.currentCardPosition(x);\r\n\tviewModel.currentCardValue(viewModel.stack()[x][0]);\r\n\tviewModel.currentCardSuit(viewModel.stack()[x][1]);\r\n\r\n\t// choose what type of question to use:\r\n\tviewModel.randomSeed((Math.floor((Math.random() * 4) + 1)));\r\n\t// viewModel.randomSeed(1); // debug\r\n\t\r\n\t// make that question visible\r\n\tswitch (viewModel.randomSeed()) {\r\n\t\tcase 1: // user picks position of given card\r\n\t\t\tviewModel.questionStyleAVisible(true);\r\n\t\tbreak;\r\n\t\tcase 2: // user picks card at given position \r\n\t\t\tviewModel.questionStyleBVisible(true);\t\r\n\t\tbreak;\r\n\t\tcase 3: // user gives card before a given card\r\n\t\t\tviewModel.questionStyleCVisible(true);\r\n\t\tbreak;\r\n\t\tcase 4: // user gives card that is after a given card\r\n\t\t\tviewModel.questionStyleDVisible(true);\r\n\t\tbreak;\r\n\t}\r\n\r\n\t// make the check button visible and the next button not\r\n\tviewModel.nextVisible(false);\r\n\tviewModel.checkVisible(true);\r\n\tsaveDataToLocalStorage()\r\n}", "title": "" }, { "docid": "c7d3843a59299293ed03ad359f875323", "score": "0.68536645", "text": "newQuestion() {\r\n return {\r\n \"nb_answers\": 0,\r\n \"allowed_emojis\": [],\r\n \"objs\": {\r\n \"q\": {},\r\n \"e\": {}\r\n },\r\n \"results\": [],\r\n \"winner\": {},\r\n \"messages\": {\r\n \"response\": \"\",\r\n \"question\": \"\",\r\n },\r\n \"randomized\": false,\r\n \"success\": false\r\n }\r\n }", "title": "" }, { "docid": "d195d23a8827cacd5ce6263911711ab7", "score": "0.68338555", "text": "setTheNewQuestion() {\n const englishWords = this.mapperOfEnglishWords();\n const deutschWords = this.mapperOfDeutschWords();\n const map = this.mapper();\n const question = englishWords[Math.floor(Math.random() * englishWords.length)];\n this.correctAnswer = map[question];\n const wrongAnswers = deutschWords.filter(item => item !== this.correctAnswer);\n for (let index = 0; index < 4; index++) {\n let randomValue = Math.floor(Math.random() * wrongAnswers.length);\n let aWrongAnswer = wrongAnswers[randomValue];\n wrongAnswers.splice(randomValue, 1);\n this.fillTheButtonText(\"#ChoiceButton\" + index, aWrongAnswer);\n }\n\n this.correctAnswerIndex = Math.floor(Math.random() * 4);\n this.fillTheButtonText(\"#ChoiceButton\" + this.correctAnswerIndex, this.correctAnswer);\n\n this.question.innerHTML = question;\n }", "title": "" }, { "docid": "80eff6866d9eb383de923f16e24e5f73", "score": "0.6810776", "text": "function populate_quiz_question(){\n // Populate qns number out of total questions, e.g. Q 1 of 10\n populate_question_of_total_question();\n\n // Populate title of question\n populate_question_title();\n\n // Start the loop through the quiz questions\n console.log(\"Current question count = \" + current_qns_count);\n loop_through_quiz_questions();\n}", "title": "" }, { "docid": "bcc6b0d386e88852b97488314929c689", "score": "0.68083346", "text": "function setNextQuestions() {\n resetState()\n //randomize based on the questions variable index\n showQuestion(shuffledQuestions[currentQuestionIndex])\n}", "title": "" }, { "docid": "645a838469f8ad0e94cd76195d15988c", "score": "0.6803702", "text": "function newQuestion() {\n console.log(\"New question requested\");\n\n var questionTypes = [SimpleQuestion, ChoiceQuestion];\n\n // Load the next question\n var question = new questionTypes[Math.floor(Math.random() * questionTypes.length)]();\n question.renderQuestion();\n}", "title": "" }, { "docid": "873123cafeac2e73960f326885c26ffb", "score": "0.6798145", "text": "function populateQuestions() {\n if (\n easyCountdown <= 0 ||\n hardCountdown <= 0 ||\n questionCount === questions.length\n ) {\n clearQuestions();\n } else {\n questionNumber.textContent = `Question ${questionCount + 1}/5`;\n questionHeader.textContent = questions[questionCount].title;\n populateButtons();\n }\n}", "title": "" }, { "docid": "d4beab75567e7cfd0c3c880442218a8a", "score": "0.67921925", "text": "function populateQuiz() {\n // A. Keep count of questions presented\n questionsAsked++;\n \n // B. Pull current question and corresponding answer options\n let quizData = questionsArray[currentQuestion];\n\n questionNumber = quizData.questionNum;\n questionCount.textContent = `Question ${questionNumber}`;\n questionPlaceholder.textContent = quizData.question;\n answerAPlaceholder.textContent = quizData.A;\n answerBPlaceholder.textContent = quizData.B;\n answerCPlaceholder.textContent = quizData.C;\n answerDPlaceholder.textContent = quizData.D;\n answerEPlaceholder.textContent = quizData.E;\n }", "title": "" }, { "docid": "592cef64502ad90f346b44c6e07ec76b", "score": "0.6784942", "text": "function Quiz(questions){\n this.score = 0;\n this.questions = questions;\n this.questionIndex = 0;\n}", "title": "" }, { "docid": "057abe32897a79ca1a387c59216331ea", "score": "0.67785996", "text": "function newQuestion() {\n \n indexQ = Math.floor(Math.random()*questionPool.length);\n console.log(\"indexQ is \"+indexQ)\n console.log(\"pool length is \"+questionPool.length)\n questionText.innerText = JSON.stringify(questionPool[indexQ].question);\n choiceText1.innerText = JSON.stringify(questionPool[indexQ].choice1)\n choiceText2.innerText = JSON.stringify(questionPool[indexQ].choice2)\n choiceText3.innerText = JSON.stringify(questionPool[indexQ].choice3)\n choiceText4.innerText = JSON.stringify(questionPool[indexQ].choice4)\n\n \n }", "title": "" }, { "docid": "f9628563122e4ea6108ae2470fe1e1d4", "score": "0.6775914", "text": "function populateQ() {\n if (currentTime > 0 && questionIndex < questionArr.length) {\n \n // Populates question\n changingTxt.textContent = questionArr[questionIndex].q;\n \n // Populates multiple choice & assigns values\n for (var i=0; i < mcBtnArr.length; i++) {\n mcBtnArr[i].textContent = questionArr[questionIndex].choices[i];\n } \n } \n}", "title": "" }, { "docid": "806a6f6eb1729af4cef4b13fdb0b3bbc", "score": "0.6774283", "text": "function populateQuesAndAns(eachQuestion) {\n $('#question-view').text(eachQuestion.question);\n for (var i = 0; i < eachQuestion.multipleChoice.length; i++) {\n $($('.choice')[i]).text(eachQuestion.multipleChoice[i]);\n }\n quesCount += 1;\n $('#question-status').text(quesCount + \" Question out of 10\");\n displayResult(count);\n $('.next').hide();\n\n }", "title": "" }, { "docid": "1d9e87f3de35ca0caf38d726066974fb", "score": "0.67520386", "text": "function init() {\n // set the index of qArray to the first question in the array.\n idx = 0;\n // reset the score to 0\n scores = 0;\n // build a new set of randomly sorted questions for the user to answer\n buildQuestionsArray();\n }", "title": "" }, { "docid": "daf58493001fcc279c551ebf74ed0212", "score": "0.67499244", "text": "function generate(){\n\t//get form values\n\tdifficulty = document.getElementById('difficulty').value;\n\tnumquestions = document.getElementById('numQuestions').value;\n\tif(difficulty == \"chapter\"){\n\t\tnumquestions = 50;\n\t}\n\t//check if # of questions is too large\n\tif(difficulty == \"beginner\" && numquestions > beginner.length){\n\t\tnumquestions = beginner.length;\n\t\twindow.alert(\"Test size too large. Lowering number of questions.\");\n\t}\n\tif(difficulty == \"simple\" && numquestions > simple.length){\n\t\tnumquestions = simple.length;\n\t\twindow.alert(\"Test size too large. Lowering number of questions.\");\n\t}\n\tif(difficulty == \"average\" && numquestions > average.length){\n\t\tnumquestions = average.length;\n\t\twindow.alert(\"Test size too large. Lowering number of questions.\");\n\t}\n\tif(difficulty == \"challenging\" && numquestions > challenging.length){\n\t\tnumquestions = challenging.length;\n\t\twindow.alert(\"Test size too large. Lowering number of questions.\");\n\t}\n\t//create an array of questions\n\tquestions = [];\n\t//try to prevent duplicate questions\n\tvar used = new Array();\n\tvar max;\n\tif(difficulty == \"beginner\"){\n\t\tmax = beginner.length;\n\t}\n\tif(difficulty == \"simple\"){\n\t\tmax = simple.length;\n\t}\n\tif(difficulty == \"average\"){\n\t\tmax = average.length;\n\t}\n\tif(difficulty == \"challenging\"){\n\t\tmax = challenging.length;\n\t}\n\tfor(var i = 0; i < max; i ++){\n\t\tused[i] = false;\n\t}\n\t//loop to fill questions array\n\tfor(var i = 0; i < numquestions; i ++){\n\t\tvar rand;\n\t\tif(difficulty == \"beginner\"){\n\t\t\tdo{ \n\t\t\t\trand = Math.floor(Math.random() * beginner.length);\n\t\t\t}\n\t\t\twhile(used[rand]);\n\t\t\tused[rand] = true;\n\t\t\tvar thisquestion = beginner[rand];\n\t\t}\n\t\telse if(difficulty == \"simple\"){\n\t\t\tdo{ \n\t\t\t\trand = Math.floor(Math.random() * simple.length);\n\t\t\t}\n\t\t\twhile(used[rand]);\n\t\t\tused[rand] = true;\n\t\t\tvar thisquestion = simple[rand];\n\t\t}\n\t\telse if(difficulty == \"average\"){\n\t\t\tdo{ \n\t\t\t\trand = Math.floor(Math.random() * average.length);\n\t\t\t}\n\t\t\twhile(used[rand]);\n\t\t\tused[rand] = true;\n\t\t\tvar thisquestion = average[rand];\n\t\t}\n\t\telse if(difficulty == \"challenging\"){\n\t\t\tdo{ \n\t\t\t\trand = Math.floor(Math.random() * challenging.length);\n\t\t\t}\n\t\t\twhile(used[rand]);\n\t\t\tused[rand] = true;\n\t\t\tvar thisquestion = challenging[rand];\n\t\t}\n\t\telse if(difficulty == \"chapter\"){\n\t\t\tif(i < 11){ // 10 beginner\n\t\t\t\trand = Math.floor(Math.random() * beginner.length);\n\t\t\t\tvar thisquestion = beginner[rand];\n\t\t\t}\n\t\t\telse if(i >= 11 && i < 26){ // 15 simple\n\t\t\t\trand = Math.floor(Math.random() * simple.length);\n\t\t\t\tvar thisquestion = simple[rand];\n\t\t\t}\n\t\t\telse if(i >= 26 && i < 46){ // 20 average\n\t\t\t\trand = Math.floor(Math.random() * average.length);\n\t\t\t\tvar thisquestion = average[rand];\n\t\t\t}\n\t\t\telse if(i >= 46 && i < 50){ // 5 challenging\n\t\t\t\trand = Math.floor(Math.random() * challenging.length);\n\t\t\t\tvar thisquestion = challenging[rand];\n\t\t\t}\n\t\t}\n\t\tquestions.push(thisquestion);\n\t}\n\t//output\n\tvar out = '<div class=\"adminDataSection nohover\" style=\"width:97.5%; padding-left:5%; padding-right:5%; padding-top:2.5%; padding-bottom: 2.5%\">';\n\tfor(var i = 0; i < numquestions; i ++){\n\t\tout = out + \"<form id='question\" + (i+1) + \"'><div class='form-group'><label>\" + (i+1) + \". \" + questions[i][0] + \"</label><br>\";\n\t\tout = out + \"<label><input type='radio' name='answer\" + (i+1) + \"' value='1'>\" + questions[i][1] + \"</label><br>\";\n\t\tout = out + \"<label><input type='radio' name='answer\" + (i+1) + \"' value='2'>\" + questions[i][2] + \"</label><br>\";\n\t\tout = out + \"<label><input type='radio' name='answer\" + (i+1) + \"' value='3'>\" + questions[i][3] + \"</label><br>\";\n\t\tout = out + \"<label><input type='radio' name='answer\" + (i+1) + \"' value='4'>\" + questions[i][4] + \"</label><br>\";\t\t \n\t\tout = out + \"</div></form>\";\n\t}\n\tout = out + \"<button id='submitButton' class='btn btn-primary' onclick='submitAnswers()'>Score</button><form target='hideframe' id='scoreForm' style='display:none;' method='post'><input type='number' id='scoreValue' name='scoreValue'><input type='number' id='testNumber' name='testNumber'></form></div>\";\n\tcontent.innerHTML = out;\n}", "title": "" }, { "docid": "a6014c5331f4e31247f63fc5c7c8cf1b", "score": "0.6740833", "text": "function resetQuestions() {\n $('.autogenerate').remove();\n counter = 0;\n}", "title": "" }, { "docid": "aae21eed7ffc68eec0fb2c06d71b677f", "score": "0.6740296", "text": "function repopulateQuestion(data) {\n\n\tif(data.template) {\n\t\trepopulateTemplateQuestion(data);\n\t} else {\n\t\trepopulateIndividualQuestion(data);\n\t}\n}", "title": "" }, { "docid": "f8645303f474486adc0ac19986150ff5", "score": "0.6739203", "text": "function createQuestions() {\n\t $('#fade').fadeIn('slow');\n\t// unselect all radiobuttons at the start\n\tfor (var i = 0; i<4; i++) {\n\t\t$(\"#answer\" + i).prop('checked', false);\n\t}\n\t$(\"#questions\").text(allQuestions[questionNum].question);\n\tcreateOptions();\n}", "title": "" }, { "docid": "a5d2e4ef15d9aef2e3b79af88161c17f", "score": "0.6730938", "text": "function Quiz(questions) {\n this.score = 0;\n this.questions = questions;\n this.questionIndex = 0;\n}", "title": "" }, { "docid": "a5d2e4ef15d9aef2e3b79af88161c17f", "score": "0.6730938", "text": "function Quiz(questions) {\n this.score = 0;\n this.questions = questions;\n this.questionIndex = 0;\n}", "title": "" }, { "docid": "c84b9dd7fedf2bae598fbf4a8778b8cb", "score": "0.67301095", "text": "function generateQuestions() {\n finalEl.style.display = \"none\";\n if (currentQuestionIndex === finalQuestionIndex) {\n return displayScore();\n }\n var currentQuestion = questions[currentQuestionIndex];\n questionEl.innerHTML = \"<p>\" + currentQuestion.question + \"</p>\";\n button1.innerHTML = currentQuestion.choice1;\n button2.innerHTML = currentQuestion.choice2;\n button3.innerHTML = currentQuestion.choice3;\n button4.innerHTML = currentQuestion.choice4;\n}", "title": "" }, { "docid": "ebc981cbf6b995cb4102c54453b56587", "score": "0.6728595", "text": "InitializeQuestions(){\n this.getOrderedQuestions()\n }", "title": "" }, { "docid": "7bdd5a1f64496b255b35f0e8c9343ae1", "score": "0.67273176", "text": "function nextRandomQuestion(){\r\n \r\n //set of questions\r\nvar q1 = new QuestionSet('Where is Assam Located?',\r\n ['India', 'China', 'Bangladesh'],\r\n 0);\r\nvar q2 = new QuestionSet('Who is the current President of USA?',\r\n ['Obama', 'Bill Clinton', 'Donald Trump'],\r\n 2);\r\nvar q3 = new QuestionSet('Elun Musk is a/an :', \r\n ['Dancer', 'Athlete', 'Entrepreneur'],\r\n 2);\r\n \r\n//storing the questions in an array\r\nvar questions = [q1,q2,q3];\r\n \r\n//chooisng a random question\r\nvar n = Math.floor(Math.random(questions)*questions.length);\r\n\r\nquestions[n].DisplayQuestions(); //Displays Questions\r\n\r\nvar answer = prompt('Please give your Answer'); //promts user to input the correct option\r\n//Quits the game if user types 'exit'\r\nif(answer === 'exit'){\r\n \r\n console.log('---------------------------------');\r\n console.log('Refresh the page to Play the Quiz'); \r\n console.log('---------------------------------'); \r\n }\r\n else{\r\n \r\n questions[n].CheckAnswer(parseInt(answer), KeepScore); // Displays Correct Answer\r\n nextRandomQuestion();\r\n }\r\n}", "title": "" }, { "docid": "7c8fb4411ed5bc75273f47113f468a5a", "score": "0.6719887", "text": "function setNextQuestion() {\n resetquestion()\n questiondisplay(randomanswers[Current])\n}", "title": "" }, { "docid": "1e1e9299b8e05618f85ab7d181973341", "score": "0.67028195", "text": "function generateQuestion() {\r\n\t\t// Randomly select assembled/combined item\r\n\t\tvar keysArr = [], \r\n\t\trandomItemName = '',\r\n\t\trandomItemObj = {};\r\n\r\n\t\tkeysArr = Object.keys(itemObj.combined);\r\n\t\trandomItemName = keysArr[Helper.randomInt(0, keysArr.length - 1)];\r\n\t\trandomItemObj = itemObj.combined[randomItemName];\r\n\r\n\t\tquestionArchive.push(\r\n\t\t\tnew Question({\r\n\t\t\t\titemName: randomItemName,\r\n\t\t\t\tmaterials: randomItemObj.components,\r\n\t\t\t\treversed: (Helper.randomInt(0, 1) === 0), // Determine the quiz type\r\n\t\t\t\trecipe: getRecipe(randomItemObj.components, randomItemObj.cost),\r\n\t\t\t}).createWrongItems() // Create wrong set of items and store it in question object.\r\n\t\t);\r\n\r\n\t}", "title": "" }, { "docid": "545b659948a4cf4f5abed57c4423365c", "score": "0.6696466", "text": "populateQuestions(questionsData) {\n\t\t//Iterate over questions data and make a new TriviaQuestion for each question in the data\n\t\t$.each(questionsData, (index, question) => {\n\t\t\t//Add newly instantiated trivia question object to questions array\t\n\t\t\tthis.questionsList.push(new TriviaQuestion(question.question,\n\t\t\t\tquestion.incorrect_answers,question.correct_answer));\t\t\t\t\n\t\t});\n\n\t\t//Now in the questionPhase\n\t\tthis.updateGameState('questionPhase');\n\t}", "title": "" }, { "docid": "f204d08e7cba0440f07c5844691d08d7", "score": "0.6690915", "text": "function Quiz(questions) {\n this.score = 0;\n this.questions = questions;\n this.questionIndex = 0;\n}", "title": "" }, { "docid": "30add9442f4beeac8d93d939a86a03cf", "score": "0.66893685", "text": "function newQuestion() {\n $(\"#message\").empty();\n $(\"#correct-answer\").empty();\n $(\"#image\").hide();\n $(\"#fun-fact\").hide();\n $(\"#timer-counter\").show();\n answered = true;\n\n $(\"#current-question\").html(\"Question \" + (currentQuestion + 1) + \" of \" + questionsArray.length);\n $(\".question\").html(questionsArray[currentQuestion].question);\n\n // tried to set up where questions get set up randomly, failed miserable. will try again after turning in assignment \n // for (var j = 0; j < questionCount; j++ ) {\n // var randomQuestion = questionsArray.splice (\n // Math.floor(Math.random() * questionsArray.length), 1)[0];\n // (existingQuestions());\n // // Add the question to the tracker\n // questionTracker.push(randomQuestion);\n // }\n \n // // If the current random number already exists in the tracker, return true\n // function existingQuestions() {\n // for (var j = 0; j < questionTracker.length; j++) {\n // if (questionTracker[j] === randomQuestion) {\n // return true;\n // }\n // }\n // return false;\n // }\n for (var i = 0; i < 4; i++) {\n var choices = $(\"<div>\");\n choices.text(questionsArray[currentQuestion].choicesArray[i]);\n choices.attr({\n \"data-index\": i\n });\n choices.addClass(\"thisChoice\");\n $(\".answer-choices\").append(choices);\n }\n countdown();\n //clicking an answer will pause the time \n $(\".thisChoice\").on(\"click\", function () {\n userSelect = $(this).data(\"index\");\n clearInterval(time);\n $(\"#timer-counter\").hide();\n answers();\n });\n }", "title": "" }, { "docid": "451162481b102dabbad3f6918fde7720", "score": "0.6684085", "text": "function setQuestion() {\n nextQuestion(questionList[firstQuestion])\n\n}", "title": "" }, { "docid": "2d95540c02433003ea13406bc638f624", "score": "0.66763985", "text": "function newQuestion() {\n if (index >= questionAnswerArray.length) {\n endQuiz();\n } else {\n currentQuestion = questionAnswerArray[index];\n question.textContent = currentQuestion.Question;\n button1.textContent = currentQuestion.Answers[0];\n button2.textContent = currentQuestion.Answers[1];\n button3.textContent = currentQuestion.Answers[2];\n button4.textContent = currentQuestion.Answers[3];\n }\n}", "title": "" }, { "docid": "477c930419ba34fecd52aea2c59f8171", "score": "0.66757387", "text": "function newQuestion(){\n\t\t$(\"#message\").empty();\n\t\t$(\"#correctedAnswer\").empty();\n\t\t$(\"#gif\").hide();\n\t\t$(\"#gifCaption\").hide();\n\t\tanswered = true;\n\t\t\n\t\t//This function displays the new question\n\t\tif(currentQuestion){triviaQuestions.splice(currentQuestion-1, 1);}\n\t\tcurrentQuestion = Math.round(Math.random()*(triviaQuestions.length-1));\n\t\tconsole.log(triviaQuestions);\n\t\t$(\"#currentQuestion\").html(\"Pregunta \" + ((parseInt(correctAnswer)+parseInt(incorrectAnswer)+parseInt(unanswered))+1) + \" de \" + ((document.getElementById(\"limite\").value)));\n\t\t$(\".question\").html(triviaQuestions[currentQuestion].question);\n\n\t\t//This function displays the new questions's answer options in multiple choice type\n\t\tfor(var i = 0; i <= 5; i++){\n\n\t\t\tvar choices = $(\"<div>\");\n\t\t\tchoices.text(triviaQuestions[currentQuestion].answerList[i]);\n\t\t\tchoices.attr({\"data-index\": i });\n\t\t\tchoices.addClass(\"thisChoice\");\n\t\t\t$(\".answerList\").append(choices);\n\t\t}\n\n\t\t//This sets the timer\n\t\tcountdown();\n\n\t\t//When user clicks on n answer this will pause the time and display the correct answer to the question \n\t\t$(\".thisChoice\").on(\"click\",function(){\n\t\t\t\tuserSelect = $(this).data(\"index\");\n\t\t\t\tclearInterval(time);\n\t\t\t\tanswerPage();\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "12dad05d413c7b1010f660aa291f8d61", "score": "0.6669103", "text": "function loadQuestions() {\n\n\t\tfor ( var i=0; i < myQs.length; i++ ) {\n\t\t\tquestionArr.push( new Question( myQs[i].q, myQs[i].a, myQs[i].correctA ) );\n\t\t}\n\t\t//console.log(questionArr);\n\t}", "title": "" }, { "docid": "35fe551f1db2aeb29dd6b51f78634123", "score": "0.6658865", "text": "function newQuestion() {\n $(\".click-btn\").hide();\n number = 16;\n question = questionsArray[index];\n console.log(question);\n\n runTimer();\n\n $(\".image-display\").empty();\n\n $(\".question-display\")\n .empty()\n .append(questionsArray[index]);\n\n $(\"#answer-1\")\n .empty()\n .append(answers[index][0]);\n\n $(\"#answer-2\")\n .empty()\n .append(answers[index][1]);\n\n $(\"#answer-3\")\n .empty()\n .append(answers[index][2]);\n\n $(\"#answer-4\")\n .empty()\n .append(answers[index][3]);\n }", "title": "" }, { "docid": "4e301e7ae46a45e0d4ed102bb16df0b8", "score": "0.66222835", "text": "function populateQuestions() {\n \n $(\"#questionNumber\").html(\"<p>Question \" + getQuestion[counter].questionNumber + \" out of 10</p>\");\n $(\"#question\").text(getQuestion[counter].question);\n $(\"#choiceBox\").append(\"<button class=\\\"clickMe\\\">\" + getQuestion[counter].options[0] + \"</button>\",\n \"<button class=\\\"clickMe\\\">\" + getQuestion[counter].options[1] + \"</button>\");\n $(\"#choiceBox\").append(\"<button class=\\\"clickMe\\\">\" + getQuestion[counter].options[2] + \"</button>\",\n \"<button class=\\\"clickMe\\\">\" + getQuestion[counter].options[3] + \"</button>\")\n }", "title": "" }, { "docid": "7f7c822d6429495e7437226c237240ff", "score": "0.6621603", "text": "constructor(questions) {\n this.score = 0;\n this.questions = questions;\n this.questionIndex = 0;\n}", "title": "" }, { "docid": "c34ee8f1001569ba68c1beeada7082bb", "score": "0.6614671", "text": "function populate() {\r\n// alert(\"function populate started\");\r\n// this function gives each of the answers 0 points so if someone doesn't answer a question\r\n// the whole thing will continue to work\r\n for(var i=0; i<10; i++) { Quest[i]=0; }\r\n}", "title": "" }, { "docid": "e43de237fcaae8d85bed76462f82d049", "score": "0.66036505", "text": "function Quiz(questions) {\n this.questions = questions;\n\n this.userAnswers = [];\n}", "title": "" }, { "docid": "c12aa52d34827ecfd7008c63f3058e05", "score": "0.6602285", "text": "function setNextQuestion() {\n //resetState() when i removed questions started up\n showQuestion()\n}", "title": "" }, { "docid": "cace6dc3560282c6af9963e0a190f32c", "score": "0.6600927", "text": "function makeQuestions(questions){\n $scope.questions = questions;\n }", "title": "" }, { "docid": "9405ea0c58e685c0d892deb723d8be7f", "score": "0.65982234", "text": "function questionsManager()\n {\n // Get the current TestManager instance\n var answers = app.getTest().getQuestionBank(),\n answersLength = answers.length;\n \n // TODO: Update this description\n incorrectAnswers = [],\n \n // TODO: Update this description\n correctAnswers = [];\n\n // Check if interaction data exists\n for (var x = 0; x < answersLength; x++)\n {\n // Build in/correct answer lists to pass\n // Since the questions are manually graded,\n // just push everything to the correct list\n if (answers[x].learner_response !== undefined)\n {\n correctAnswers[x] = {\n \"answer\" : answers[x].learner_response,\n \"index\" : answers[x].id\n };\n }\n }\n \n if (correctAnswers.length > 0)\n {\n //Build responses\n buildSlideShow({\n \"correctAnswers\" : correctAnswers\n }); \n }\n else\n {\n buildSlideShow();\n }\n }", "title": "" }, { "docid": "35a8a6a4b390c0cc2c75e18bbc343e72", "score": "0.6595699", "text": "function QuestionSet()\n{\n\tthis.start = new Array();\n\tthis.onTrail = new Array();\n\tthis.capture = new Array();\n\tthis.transport = new Array();\n\n\tthis.startUsed = new Array();\n\tthis.onTrailUsed = new Array();\n\tthis.captureUsed = new Array();\n\tthis.transportUsed = new Array();\n}", "title": "" }, { "docid": "70b9db74196ff9eebb156eeb6a74ba34", "score": "0.6594566", "text": "function resetAnswers() {\n $(\"nextQ\").css(\"display\", \"none\");\n gameInProgress = true;\n contGame();\n questionIteration++;\n console.log(\"On interation \" + questionIteration);\n $(\"#answerOptions\").empty();\n changeQuestionsText(questionIteration);\n correctOption = questionsArrays[questionIteration][\"correct\"];\n //console.log(correctOption);\n}", "title": "" }, { "docid": "3ca84f8f8aad78ed0c30399c8ff4e942", "score": "0.6579937", "text": "function createQuestions () {\n let q = questionCounter;\n if (q === questions.length) {\n console.log('button removed');\n } else {\n $('#question').text(questions[q].question);\n }\n}", "title": "" }, { "docid": "a4f77e0ad113b29e543de5eaee31dff1", "score": "0.6572392", "text": "function question() {\n\t\t\t$('#questionNumber').text(questionCounter + ' / ' + totalQuestions)\n\t\t\t$('#stemQuestion').text(stemList[listIndex][1] + ' ');\n\t\t\t$('#answer').val('');\n\t\t\t$('#exampleVocabulary').text(stemList[listIndex][3]);\n\t\t\t$('#answer').focus();\n\t\t}", "title": "" }, { "docid": "e114b9936217bfda66a23c45f8a18d7d", "score": "0.6566742", "text": "function loadPreviousQuestion() {\r\n //Decrement quentions index\r\n currentQuestion--;\r\n //remove last array value;\r\n score.pop();\r\n //Generate the question\r\n generateQuestions(currentQuestion);\r\n }", "title": "" }, { "docid": "6ee29e5988e7c91bd1f6345a20d318b2", "score": "0.6563854", "text": "function questionReset() {\n\tfor (i = 0; i < 10; i++) {\n\t\t// console.log(questionsIndex);\n\t\t// console.log(junkyard);\n\t\tquestionsIndex.push(junkyard[i]);\n\t}\n\tfor (i = 0; i < 10; i++) {\n\t\tjunkyard.splice(junkyard[i], 1);\n\t}\n}", "title": "" }, { "docid": "509e91844f6738e58c0e62266704335b", "score": "0.6552508", "text": "function buildQuestionArray() {\n\n for (let i = 0; i < questionAvailable; i++) {\n questionArray.push(eval(\"question\" + i));\n }\n\n // Shuffles question array\n shuffleArray(questionArray);\n}", "title": "" }, { "docid": "4d269d92c0e7c5d284858a3a3d20cdff", "score": "0.65462", "text": "function loadPreviousQuestion() {\r\n //Decrement quentions index\r\n currentQuestion--;\r\n //remove last array value;\r\n score.pop();\r\n //Generate the question\r\n generateQuestions(currentQuestion);\r\n}", "title": "" }, { "docid": "0a2ede7b70acf353188d365bd9db4d48", "score": "0.6544964", "text": "function generateQuestion() {\n let question = `<p class = 'question' >\n Question: ${store.questionNumber + 1} / 5 </p>\n <p>${store.questions[store.questionNumber].question}</p><p>SCORE:${\n store.score\n }/5</p>\n <form class = 'check-submited-answer'>`;\n for (\n let i = 0;\n i < store.questions[store.questionNumber].answers.length;\n i++\n ) {\n let newAnswers = store.questions[store.questionNumber].answers[i];\n question += ` <label>\n <input class = 'js-checkAnswer' type=\"radio\" name = 'radAnswer' value = '${newAnswers}'>\n <span id = 'focus' tabindex = '0'>${newAnswers}</span>\n </label>\n `;\n }\n question += `\n \n <div class = 'a-button-submit'>\n <button id = 'submit-button' tabindex = '0' class=\"next-button\" type=\"button\" value=\"submit\" hidden = 'true'> SUBMIT </button>\n </div>\n <div id = \"answer\" hidden> </div>\n </form>`;\n $('.Start').html('');\n $('.Start').html(question);\n}", "title": "" }, { "docid": "47214fc50b620f690666d4a3794d64c0", "score": "0.653825", "text": "function resetQuestion() {\n $(\"#answers-area\").empty();\n $(\"#question-area\").empty();\n $(\".correct-ans\").empty();\n $(\"#correct-ans-image-one\").empty();\n }", "title": "" }, { "docid": "9226d4c3f17fd140fc07380f82793a40", "score": "0.653741", "text": "function next_question() {\n // clear question\n $questions.empty();\n // clear #picks\n $picks.empty();\n return\n\n}", "title": "" }, { "docid": "d838856e493602777716812d3ccd74c8", "score": "0.6536722", "text": "function nextQuestion() {\n setQuestionText()\n clearAnswers();\n buildAnswers();\n}", "title": "" }, { "docid": "8a9a5e0e72480c48f00ab478d00f5f2f", "score": "0.65348333", "text": "constructor(options){\n this.options = options;\n //takes array from options_construct\n this.bookList = options[0]; //list of 0/1 values, first value is 'all'\n this.bookCount = this.countBooks(this.bookList);\n\n this.questionType = options[1]; // true is spoken, false is text\n this.questionCount = options[2]; // integer value, -1 is infinite\n this.questionTimer = options[3]; // integer value, -1 is no timer\n this.questionRepeat = options[4]; // false is no repeated values, true allows repeats\n\n this.answerType = options[5] // 0 no details, 1 is a break, 2 correct/incorrect, 3 is full\n this.answerTimer = options[6]; // integer value, -1 is no timer\n this.answerInput = options[7]; // 0 MC, 1 write-in, 2 MC w/ chapter, 3 write-in w/ chapter\n\n this.generalSound = options[8]; // false no sound, true has sound\n this.generalProgressBar = options[9]; // false no bar, true has bar\n this.generalTimer = options[10]; // false timer not displayed, true timer displayed\n\n this.proportions = this.generateProportion(this.bookCount, this.questionCount);\n\n //generate question list\n this.currentQuestion;\n this.currentQuestionBonus = false; //bonus question boolean flag\n\n //multiple choice options -> first value is blank\n this.currentTitles = [\"----\"];\n this.currentAuthors = [\"----\"];\n this.currentSources = [\"----\"];\n\n this.questionList = [];\n this.usedQuestions = [];\n this.generateQuestions(this.proportions);\n\n //user input tracker\n this.responseTracker = [];\n\n //initialize session stats\n this.stats = new statisticsTracker();\n\n }", "title": "" }, { "docid": "f58e206907bba9da3c20ef12f4fba7f4", "score": "0.6527583", "text": "function questions() {\n let q = questions[runningQuestion];\n\n question.innerHTML = \"<p>\" + q.question + \"</p>\";\n choiceA.innerHTML = q.choiceA;\n choiceB.innerHTML = q.choiceB;\n choiceC.innerHTML = q.choiceC;\n choiceD.innerHTML = q.choiceD;\n}", "title": "" }, { "docid": "342fb948836406f04f8d832fb9a398bd", "score": "0.65250874", "text": "function setQuestion(){\n // selects random question from var easy\n random = Math.floor(Math.random() * easy.length);\n current = easy[random]\n //question\n currentQuestion = current.question;\n // the 4 choices in order of their place in a for loop\n currentChoice0 = current.choice.choice0;\n currentChoice1 = current.choice.choice1;\n currentChoice2 = current.choice.choice2;\n currentChoice3 = current.choice.choice3;\n\n // the correct choice\n currentCorrectChoice = current.correctChoice;\n // id targets from html page\n showQuestion = document.getElementById(\"question\");\n showChoice0 = document.getElementById(\"choice0\");\n showChoice1 = document.getElementById(\"choice1\");\n showChoice2 = document.getElementById(\"choice2\");\n showChoice3 = document.getElementById(\"choice3\");\n\n\n\n // shows current question\n showQuestion.innerText = currentQuestion\n\n\n // shows choice options which connect to the current question\n showChoice0.innerText = currentChoice0\n showChoice1.innerText = currentChoice1\n showChoice2.innerText = currentChoice2\n showChoice3.innerText = currentChoice3\n\n\n}", "title": "" }, { "docid": "7ceca76a97ca80ef894493cc17e52114", "score": "0.6522983", "text": "function loadPreviousQuestion() {\n currentQuestion--;\n //remove last value\n score.pop();\n //generate question\n generateQuestions(currentQuestion);\n}", "title": "" }, { "docid": "e661b5255e3ddac3d19848ef5ca58064", "score": "0.6519909", "text": "function askQuestions() {\n\t\tquestionTimer.start();\n\t\t$('#question').html(qsArray[currentIndex].question);\n\t\t$('#btn0').show().html(qsArray[currentIndex].answers[0]);\n\t\t$('#btn1').show().html(qsArray[currentIndex].answers[1]);\n\t\t$('#btn2').show().html(qsArray[currentIndex].answers[2]);\n\t\t$('#btn3').show().html(qsArray[currentIndex].answers[3]);\n\t\t$('#gifHolder').hide().off('click');\n\n\t\tonClickAnswer();\n\t}", "title": "" }, { "docid": "c03eb599e56283bc8fcaf00bf737888e", "score": "0.6517329", "text": "function newQuestion() {\n\t\ttimer();\n\t\tif (index >= questions.length) {\n\t\t\tendGame();\n\t\t} else {\n\t\t\t$(\"#correct-question-box\").html(questions[index].questionTitle);\n\t\t\tvar question = questions[index];\n\t\t\tconsole.log(\"index: \" + index);\n\t\t\tvar choicesHtml = $(\".choices\");\n\t\t\tfor (var i = 0; i < choicesHtml.length; i++) {\n\t\t\t\t// Updates the choices to the HTML page\n\t\t\t\tvar choiceHTML = $(choicesHtml[i]);\n\t\t\t\tvar selection = questions[index].choices[i];\n\t\t\t\t$(choiceHTML).html(selection);\n\t\t\t}\n\n\t\t\t// Turns click off\n\t\t\t$(\".choices\").off(\"click\");\n\n\t\t\t$(\"#choice-one-box.choices\").on(\"click\", function () {\n\t\t\t\tvar userSelection = questions[index - 1].choices[0];\n\t\t\t\tanswerHelper(userSelection, question);\n\t\t\t\tclearInterval(countDownInterval);\n\t\t\t});\n\n\t\t\t$(\"#choice-two-box.choices\").on(\"click\", function () {\n\t\t\t\tvar userSelection = questions[index - 1].choices[1];\n\t\t\t\tanswerHelper(userSelection, question);\n\t\t\t\tclearInterval(countDownInterval);\n\t\t\t});\n\n\t\t\t$(\"#choice-three-box.choices\").on(\"click\", function () {\n\t\t\t\tvar userSelection = questions[index - 1].choices[2];\n\t\t\t\tanswerHelper(userSelection, question);\n\t\t\t\tclearInterval(countDownInterval);\n\t\t\t});\n\n\t\t\t$(\"#choice-four-box.choices\").on(\"click\", function () {\n\t\t\t\tvar userSelection = questions[index - 1].choices[3];\n\t\t\t\tanswerHelper(userSelection, question);\n\t\t\t\tclearInterval(countDownInterval);\n\t\t\t});\n\t\t\tindex++;\n\t\t}\n\t}", "title": "" }, { "docid": "bf518be32ca4c33784f2b663214ddc7b", "score": "0.6516582", "text": "function populateRandomQuestion(){\n i = Math.floor(Math.random() * sqlQuestions.length);\n console.log(`The value of i is ${i}`)\n var randomQuestion = sqlQuestions[i];\n nextQuestion.replaceWith(\"<p id = question></p>\")\n $(\"#question\").text(randomQuestion.question);\n nextAnswer.replaceWith(\"<p id = answer></p>\")\n $(\"#answer\").text(randomQuestion.answer);\n\n }", "title": "" }, { "docid": "32e61149010332408b9b0144b2da36f7", "score": "0.6515139", "text": "function generateQuestion() {\n if (questionNumber < STORE.length) {\n return createForm(questionNumber);\n } else {\n $('.question-box').hide();\n results();\n }\n}", "title": "" }, { "docid": "6b60fbc4ad5f6de2b82a8a6b7bf27427", "score": "0.6505692", "text": "function resetAnswers() {\r\n\t\texerciseAnswers = {\r\n\t\t\tfirst: null,\r\n\t\t\tsecond: null,\r\n\t\t\tthird: null,\r\n\t\t\tfourth: null,\r\n\t\t\tfifth: null,\r\n\t\t\tsixth: null\r\n\t\t},\r\n\t\tcorrectness = {\r\n\t\t\tfirst: null,\r\n\t\t\tsecond: null,\r\n\t\t\tthird: null,\r\n\t\t\tfourth: null,\r\n\t\t\tfifth: null,\r\n\t\t\tsixth: null\t\r\n\t\t};\r\n\r\n\t\tdocument.dispatchEvent(new CustomEvent('model:destoryed'));\t\r\n\t}", "title": "" }, { "docid": "9ad4166aa89d6c9c19509d8cd4145ec3", "score": "0.65024614", "text": "function questionOne(){\n\n // Put in previous questions in function\n}", "title": "" }, { "docid": "79820ff24abd77aff0b0989cf712b5c7", "score": "0.65020245", "text": "function generate(){\n\tq.innerHTML= data.questions[qIndex].question;\n\topt1.value= data.questions[qIndex].options[0];\n\topt2.value= data.questions[qIndex].options[1];\n\topt3.value= data.questions[qIndex].options[2];\n\topt4.value= data.questions[qIndex].options[3];\n}", "title": "" }, { "docid": "d1fcad3d781e76fc58ee1906b031071b", "score": "0.64977986", "text": "function pickQuestions() {\n currentquestion = Quiz[index];\n setPage();\n }", "title": "" }, { "docid": "1434faddf822109de553e35fd43ef79a", "score": "0.64865273", "text": "function init() {\n const data= questions();\n}", "title": "" }, { "docid": "266e3695ee664f70bcd54a0c8037e7c9", "score": "0.64820796", "text": "function nextQuestion () {\n //first get next question from array\n currQuestionIndex = generateRandomNumber();\n var question = questionnaire[currQuestionIndex].question;\n //Display this new question in the html\n showQuest.innerHTML = questionnaire[currQuestionIndex].question;\n totalAskedQ++;\n\n}", "title": "" }, { "docid": "18f3c93e33b25fccbe1e4fb53ad7ff05", "score": "0.6478707", "text": "function newQuiz() {\n $(\"#start-button\").remove();\n $(\"#game-over\").text(\"Select the correct answer!!\");\n correct = 0;\n incorrect = 0;\n unanswered = 0;\n nextQuestion();\n }", "title": "" }, { "docid": "4592349ce588fbc88adfcf672c4670d4", "score": "0.6477452", "text": "function setNextQuestion() {\r\n resetState();\r\n showQuestion(shuffledQuestions[currentQuestionIndex]);\r\n}", "title": "" }, { "docid": "62abf254f92a9b15e38785bdd7610121", "score": "0.64716613", "text": "function createQuiz(q)\n{\n\t//Loop through the questions\n\t//Determine question type\n\t//Fill in the template info\n\t//Append question to the page.\n\tfor(var i = 0; i < q.length; i++)\n\t{\n\t\tvar type = q[i].type;\n\t\tvar question = q[i].question;\n\t\t//alert(type + \" \" + question);\n\t\tif(type === \"mc\")\n\t\t{\n\t\t\tvar a = q[i].a;\n\t\t\tvar b = q[i].b;\n\t\t\tvar c = q[i].c;\n\t\t\t\n\t\t\tvar temp = qmc.clone(true);\n\t\t\ttemp.attr(\"id\", \"MCQ\" + num.toString());\n\t\t\t\n\t\t\ttemp.find(\"#MXX\").attr(\"id\", \"M\" + num.toString()).text(question);\n\t\t\ttemp.find(\"#MLXX\").attr(\"id\", \"ML\" + num.toString()).attr(\"for\", \"M\" + num.toString()).text(\"Question \" + num.toString() + \": \");\n\t\t\t\n\t\t\ttemp.find(\"#MAIXX\").attr(\"id\", \"MAI\" + num.toString()).text(a);\n\t\t\ttemp.find(\"#AXX\").attr(\"id\", \"A\" + num.toString()).attr(\"name\", \"MC\" + num.toString());\n\t\t\t\n\t\t\ttemp.find(\"#MBIXX\").attr(\"id\", \"MBI\" + num.toString()).text(b);\n\t\t\ttemp.find(\"#BXX\").attr(\"id\", \"B\" + num.toString()).attr(\"name\", \"MC\" + num.toString());\n\t\t\t\n\t\t\ttemp.find(\"#MCIXX\").attr(\"id\", \"MCI\" + num.toString()).text(c);\n\t\t\ttemp.find(\"#CXX\").attr(\"id\", \"C\" + num.toString()).attr(\"name\", \"MC\" + num.toString());\n\t\t\t\n\t\t\t$(\"#Quiz\").append(temp);\n\t\t\tnum++;\n\t\t\tqtype.push(\"mc\");\n\t\t}\n\t\tif(type === \"tf\")\n\t\t{\n\t\t\tvar temp = qtf.clone(true);\n\t\t\ttemp.attr(\"id\", \"TFQ\" + num.toString());\n\t\t\t\n\t\t\ttemp.find(\"#TFXX\").attr(\"id\", \"TF\" + num.toString()).text(question);\n\t\t\ttemp.find(\"#TFLXX\").attr(\"id\", \"TFL\" + num.toString()).attr(\"for\", \"TF\" + num.toString()).text(\"Question \" + num.toString() + \": \");\n\t\t\t\n\t\t\ttemp.find(\"#TXX\").attr(\"id\", \"T\" + num.toString()).attr(\"name\", \"TFC\" + num.toString());\n\t\t\ttemp.find(\"#FXX\").attr(\"id\", \"F\" + num.toString()).attr(\"name\", \"TFC\" + num.toString());\n\t\t\t\n\t\t\t$(\"#Quiz\").append(temp);\n\t\t\tnum++;\n\t\t\tqtype.push(\"tf\");\n\t\t}\n\t\tif(type === \"sa\")\n\t\t{\n\t\t\tvar temp = qsa.clone(true);\n\t\t\ttemp.attr(\"id\", \"SAQ\" + num.toString());\n\t\t\t\n\t\t\ttemp.find(\"#SAXX\").attr(\"id\", \"SA\" + num.toString()).text(question);\n\t\t\ttemp.find(\"#SALXX\").attr(\"id\", \"SAL\" + num.toString()).attr(\"for\", \"SA\" + num.toString()).text(\"Question \" + num.toString() + \": \");\n\t\t\t\n\t\t\ttemp.find(\"#ANSXX\").attr(\"id\", \"ANS\" + num.toString()).attr(\"name\", \"SAC\" + num.toString());\n\t\t\t\n\t\t\t$(\"#Quiz\").append(temp);\n\t\t\tnum++;\n\t\t\tqtype.push(\"sa\");\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e6511c2c4755d1c360f801eab8bab1d1", "score": "0.6469415", "text": "function Question(question) {\n this.question = question;\n this.answers = [];\n}", "title": "" }, { "docid": "37df610c443aaf3ea46cc6f767711fa0", "score": "0.6468998", "text": "function nextQ() {\n // console.log(qA);\n random = Math.floor(Math.random() * qA.length);\n // console.log(random);\n question = qA[random].q;\n answer = qA[random].a;\n qA.splice(random, 1);\n var displayQ = $(\"#ask\");\n displayQ.html(question);\n console.log(qA);\n }", "title": "" }, { "docid": "fb8649ba6a58b793a32c1e5dfd6cce9e", "score": "0.64687735", "text": "function CreateQuestion(){\n\tvar randomIndex = GetRandomIndex(count);\n\tvar choice;\n\n\tquestion = books[randomIndex];\n\t\n\t// Do not get long books.\n\twhile(question.eser.length > 28) {\n\t\tquestion = books[GetRandomIndex(count)];\t\t\n\t}\n\n\t// Print the book name to the box.\n\t$(\"#book_name\").html(question.eser);\n\n\t// Get random author names.\n\tfor(var i = 0; i < 3; i++) {\n\t\tchoice = books[GetRandomIndex(count)];\n\n\t\tif(choices.indexOf(choice.yazar) == -1 || choice.yazar.length > 22){\n\t\t\tif(question.yazar !== choice.yazar){\n\t\t\t\tif(!((question.hasOwnProperty(\"digerYazar\") && choice.yazar == question.digerYazar) ||\n\t\t\t\t\t(choice.hasOwnProperty(\"digerYazar\") && choice.digerYazar == question.yazar))) {\n\t\t\t\t\t\n\t\t\t\t\t// If all the conditions are satisfied, save it as an option.\n\t\t\t\t\tchoices[i] = choice.yazar;\n\n\t\t\t\t} else { i--; }\n\t\t\t} else { i--; }\n\t\t} else { i--; }\n\t}\n\n\t// Put the real answer into the array.\n\tanswerIndex = GetRandomIndex(3);\n\tchoices[answerIndex] = question.yazar;\n\n\t// Print the choices to the buttons.\n\tfor(var i = 0; i < 3; i++) {\n\t\t$('#button_' + i).html(choices[i]);\n\t}\n}", "title": "" }, { "docid": "0754e92b041c99925a0936a0bbecb1d8", "score": "0.64680153", "text": "function createQuestions() {\n return [\n {\n letter: 'a',\n status: 0,\n questions: [\n {\n question:\n 'CON LA A. Dicho de una supuesta criatura extraterrestre: Apoderarse de alguien.',\n answer: 'abducir',\n },\n {\n question: \"CON LA A. Legítimo Rey de Gondor en 'El señor de los anillos'.\",\n answer: 'aragorn',\n },\n {\n question:\n 'CON LA A. Persona que se encarga del cumplimiento de las reglas en algunos deportes.',\n answer: 'arbitro',\n },\n ],\n },\n {\n letter: 'b',\n status: 0,\n questions: [\n {\n question:\n \"CON LA B. Juego que ha sacado de quicio a todos los 'Skylabers' en las sesiones de precurso.\",\n answer: 'bingo',\n },\n {\n question:\n 'CON LA B. Diosa egipcia de la protección, amor y armonía. Su cabeza tiene forma de gato.',\n answer: 'bastet',\n },\n {\n question: 'CON LA B. Mamífero acuático de gran tamaño.',\n answer: 'ballena',\n },\n ],\n },\n {\n letter: 'c',\n status: 0,\n questions: [\n { question: 'CON LA C. Niño, crío, bebé.', answer: 'churumbel' },\n {\n question: \"CON LA C. De las novelas 'Canción de hielo y fuego', 'Las lluvias de...'.\",\n answer: 'castamere',\n },\n {\n question:\n 'CON LA C. Automóvil destinado al transporte de personas y con capacidad no superior a siete plazas.',\n answer: 'coche',\n },\n ],\n },\n {\n letter: 'd',\n status: 0,\n questions: [\n {\n question:\n 'CON LA D. Anormalidad en la función del aparato digestivo caracterizada por frecuentes evacuaciones y su consistencia líquida.',\n answer: 'diarrea',\n },\n {\n question:\n 'CON LA D. Reptil fósil, propio del Mesozoico, generalmente de gran tamaño, cabeza pequeña, cuello largo, cola robusta y larga, y extremidades posteriores más largas que las anteriores.',\n answer: 'dinosaurio',\n },\n {\n question: 'CON LA D. Romper, hacer añicos.',\n answer: 'destrozar',\n },\n ],\n },\n {\n letter: 'e',\n status: 0,\n questions: [\n {\n question:\n 'CON LA E. Afección cutánea caracterizada por vesículas rojizas y exudativas, que dan lugar a costras y escamas.',\n answer: 'eccema',\n },\n {\n question: 'CON LA E. Idioma universal artificial creado por el polaco L. L. Zamenhof.',\n answer: 'esperanto',\n },\n {\n question:\n 'CON LA E. Jefe supremo del antiguo Imperio romano, y que originariamente se nombraba por aclamación del Ejército o decreto del Senado.',\n answer: 'emperador',\n },\n ],\n },\n {\n letter: 'f',\n status: 0,\n questions: [\n {\n question: 'CON LA F. Que no requiere gran esfuerzo, capacidad o dificultad.',\n answer: 'facil',\n },\n {\n question: 'CON LA F. Genero literario donde aparecen caballeros, dragones y magia.',\n answer: 'fantasia',\n },\n {\n question:\n 'CON LA F. Cada uno de los antiguos reyes de Egipto anteriores a la conquista de este país por los persas.',\n answer: 'faraon',\n },\n ],\n },\n {\n letter: 'g',\n status: 0,\n questions: [\n {\n question:\n 'CON LA G. Conjunto enorme de estrellas, polvo interestelar, gases y partículas.',\n answer: 'galaxia',\n },\n {\n question:\n \"CON LA G. Título original en España de la aclamada película de ciencia ficción. 'La guerra de las...'.\",\n answer: 'galaxias',\n },\n {\n question: 'CON LA G. Educado, de buenas maneras.',\n answer: 'gentil',\n },\n ],\n },\n {\n letter: 'h',\n status: 0,\n questions: [\n {\n question:\n 'CON LA H. Forma de suicidio ritual, practicado en el Japón por razones de honor o por orden superior, consistente en abrirse el vientre.',\n answer: 'harakiri',\n },\n {\n question: 'CON LA H. Herir el amor propio o la dignidad de alguien.',\n answer: 'humillar',\n },\n {\n question:\n 'CON LA H. Agua convertida en cuerpo sólido y cristalino por un descenso suficiente de temperatura.',\n answer: 'hielo',\n },\n ],\n },\n {\n letter: 'i',\n status: 0,\n questions: [\n {\n question: 'CON LA I. Templo cristiano.',\n answer: 'iglesia',\n },\n {\n question: \"CON LA I. País-Ciudad controlada por Saruman en 'El señor de los anillos'.\",\n answer: 'isengard',\n },\n {\n question:\n 'CON LA I. Cambiar, sustituyéndolos por sus contrarios, la posición, el orden o el sentido de las cosas.',\n answer: 'invertir',\n },\n ],\n },\n {\n letter: 'j',\n status: 0,\n questions: [\n {\n question:\n \"CON LA J. Variedad salvaje del cerdo que sale en la película 'El Rey León', de nombre Pumba.\",\n answer: 'jabali',\n },\n\n {\n question: 'CON LA J. Preparado farmacéutico líquido que se administra por la boca.',\n answer: 'jarabe',\n },\n {\n question: 'CONTIENE LA J. Actividad intensa que implica movimientos incesantes.',\n answer: 'ajetreo',\n },\n ],\n },\n {\n letter: 'l',\n status: 0,\n questions: [\n {\n question: 'CON LA L. Único satélite natural de la Tierra.',\n answer: 'luna',\n },\n {\n question:\n 'CON LA L. Persona que, según la tradición popular, se convierte en lobo las noches de plenilunio.',\n answer: 'licantropo',\n },\n {\n question: 'CON LA L. Que ha perdido la razón.',\n answer: 'loco',\n },\n ],\n },\n {\n letter: 'm',\n status: 0,\n questions: [\n {\n question:\n 'CON LA M. Persona que huye del trato con otras personas o siente gran aversión hacia ellas.',\n answer: 'misantropo',\n },\n {\n question:\n 'CON LA M. Figura decorativa tallada en madera situada en la proa de antiguos buques.',\n answer: 'mascaron',\n },\n {\n question:\n 'CON LA M. Parte del día comprendida entre el amanecer y el mediodía, o la hora de comer o almorzar.',\n answer: 'mañana',\n },\n ],\n },\n {\n letter: 'n',\n status: 0,\n questions: [\n {\n question: 'CON LA N. Demostración de poca inteligencia.',\n answer: 'necedad',\n },\n {\n question: 'CON LA N. Mago especializado en magia negra y resucitar muertos.',\n answer: 'nigromante',\n },\n {\n question:\n 'CON LA N. Sustancia blanca formada por la precipitación de agua a bajas temperaturas.',\n answer: 'nieve',\n },\n ],\n },\n {\n letter: 'ñ',\n status: 0,\n questions: [\n {\n question:\n 'CONTIENE LA Ñ. Indicio que permite deducir algo de lo que no se tiene un conocimiento directo.',\n answer: 'señal',\n },\n {\n question: 'CON LA Ñ. Antílope sudafricano.',\n answer: 'ñu',\n },\n {\n question: 'CONTIENE LA Ñ: Golpe que se da con el puño de la mano.',\n answer: 'puñetazo',\n },\n ],\n },\n {\n letter: 'o',\n status: 0,\n questions: [\n {\n question: 'CON LA O. Órgano externo de la audición.',\n answer: 'oreja',\n },\n\n {\n question: 'CON LA O. Onda de gran amplitud que se forma en la superficie de las aguas.',\n answer: 'ola',\n },\n {\n question: 'CON LA O. Adorno, compostura, atavío que hace vistosa una cosa.',\n answer: 'ornamento',\n },\n ],\n },\n {\n letter: 'p',\n status: 0,\n questions: [\n {\n question:\n 'CON LA P. Raza ancestral tecnológicamente avanzada que se caracteriza por sus grandes poderes psiónicos del videojuego StarCraft.',\n answer: 'protoss',\n },\n {\n question: 'CON LA P: Que se repite con frecuencia a intervalos determinados.',\n answer: 'periodico',\n },\n {\n question:\n 'CON LA P. Utensilio de hierro en forma de rejilla para poner al fuego lo que se ha de asar o tostar.',\n answer: 'parrilla',\n },\n ],\n },\n {\n letter: 'q',\n status: 0,\n questions: [\n {\n question: 'CON LA Q. Producto obtenido por la maduración de la cuajada de la leche',\n answer: 'queso',\n },\n {\n question:\n 'CON LA Q. Piezas bucales presentes en un subfilo de artrópodos como los arácnidos.',\n answer: 'queliceros',\n },\n { question: 'CON LA Q. Destruir algo o a alguien con fuego.', answer: 'quemar' },\n ],\n },\n {\n letter: 'r',\n status: 0,\n questions: [\n {\n question: \"CON LA R. Ciudad élfica gobernada por Elrond en 'El señor de los anillos'.\",\n answer: 'rivendel',\n },\n {\n question:\n 'CON LA R. Mamífero roedor de pequeño tamaño, de hocico puntiagudo y cola larga, de pelaje corto.',\n answer: 'raton',\n },\n {\n question:\n 'CON LA R. Corriente de agua continua y más o menos caudalosa que va a desembocar en otra, en un lago o en el mar.',\n answer: 'rio',\n },\n ],\n },\n {\n letter: 's',\n status: 0,\n questions: [\n {\n question: 'CON LA S. Comunidad salvadora de todo desarrollador informático.',\n answer: 'stackoverflow',\n },\n\n {\n question: 'CON LA S. Baile típico de brasil.',\n answer: 'samba',\n },\n {\n question: 'CON LA S. Representarse en la fantasía imágenes o sucesos mientras se duerme.',\n answer: 'soñar',\n },\n ],\n },\n {\n letter: 't',\n status: 0,\n questions: [\n {\n question:\n 'CON LA T. Película del director James Cameron que consolidó a Arnold Schwarzenegger como actor en 1984.',\n answer: 'terminator',\n },\n {\n question:\n 'CON LA T. Alimento preparado con huevo batido, cuajado con aceite en la sartén y de forma redonda o alargada, al que a veces se añaden otros ingredientes.',\n answer: 'tortilla',\n },\n {\n question:\n 'CON LA T. Grave dolor físico o psicológico infligido a alguien, con métodos y utensilios diversos, con el fin de obtener de él una confesión, o como medio de castigo.',\n answer: 'tortura',\n },\n ],\n },\n {\n letter: 'u',\n status: 0,\n questions: [\n {\n question:\n \"CON LA U. Escritor y filósofo español de la generación del 98 autor del libro 'Niebla' en 1914.\",\n answer: 'unamuno',\n },\n {\n question: 'CON LA U. Instrumento de cuerda similar a la guitarra pero más pequeño.',\n answer: 'ukelele',\n },\n {\n question: 'CON LA U. Objeto fabricado que se destina a un uso manual y doméstico.',\n answer: 'utensilio',\n },\n ],\n },\n {\n letter: 'v',\n status: 0,\n questions: [\n {\n question:\n 'CON LA V. Nombre dado a los miembros de los pueblos nórdicos originarios de Escandinavia, famosos por sus incursiones y pillajes en Europa.',\n answer: 'vikingos',\n },\n {\n question:\n 'CON LA V. Traspasar a alguien por el precio convenido la propiedad de lo que se posee.',\n answer: 'vender',\n },\n {\n question: 'CON LA V. Hortaliza, especialmente la de hojas verdes.',\n answer: 'verdura',\n },\n ],\n },\n {\n letter: 'x',\n status: 0,\n questions: [\n {\n question: 'CONTIENE LA X. Toxina bacteriana utilizada en cirujía estética.',\n answer: 'botox',\n },\n {\n question:\n 'CON LA X. Instrumento musical de percusión formado por láminas generalmente de madera, ordenadas horizontalmente según su tamaño y sonido, que se hacen sonar golpeándolas con dos baquetas.',\n answer: 'xilofono',\n },\n {\n question: 'CON LA X. Fobia a los extranjeros.',\n answer: 'xenofobia',\n },\n ],\n },\n {\n letter: 'y',\n status: 0,\n questions: [\n {\n question:\n 'CONTIENE LA Y. Planta cactácea, de pequeño tamaño, que contiene una sustancia cuya ingestión produce efectos alucinógenos y narcóticos.',\n answer: 'peyote',\n },\n {\n question:\n 'CONTIENE LA Y. Abominable hombre de las nieves. Supuesto gigante antropomorfo, del cual se dice que vive en el Himalaya.',\n answer: 'yeti',\n },\n {\n question:\n 'CONTIENE LA Y. Pieza de la armadura antigua que resguardaba la cabeza y el rostro, y se componía de morrión, visera y babera.',\n answer: 'yelmo',\n },\n ],\n },\n {\n letter: 'z',\n status: 0,\n questions: [\n {\n question:\n 'CON LA Z. Escuela de budismo que busca la experiencia de la sabiduría más allá del discurso racional.',\n answer: 'zen',\n },\n {\n question: 'CON LA Z. Zapato de madera de una pieza.',\n answer: 'zueco',\n },\n {\n question:\n 'CON LA Z. Calzado que no pasa del tobillo, con la parte inferior de suela y lo demás de piel, fieltro, paño u otro tejido, más o menos escotado por el empeine.',\n answer: 'zapato',\n },\n ],\n },\n ];\n}", "title": "" }, { "docid": "fd0613b36851808af9f2bbb77174576a", "score": "0.64674777", "text": "function setNextQuestion () {\n resetState()\n showQuestion (shuffledQuestions[currentQuestionIndex])\n}", "title": "" }, { "docid": "2b6f46fa0f3e3017fab0c4d7e29436e8", "score": "0.6464019", "text": "function generateNextQuestions()\r\n{\r\n if(defaultQuestions[counter])\r\n {\r\n\t\tFirstQuestion.innerText = (counter+1) +\". \"+ defaultQuestions[counter].QuestionText; \r\n\t\tfirstAnswer.style.visibility = \"visible\";\r\n }\r\n else\r\n {\r\n FirstQuestion.innerText = \"\";\r\n firstAnswer.style.visibility = \"hidden\";\r\n }\r\n if(defaultQuestions[counter+1])\r\n {\r\n\t\tSecondQuestion.innerText = (counter+2) +\". \"+ defaultQuestions[counter+1].QuestionText;\r\n\t\tsecondAnswer.style.visibility = \"visible\";\r\n }\r\n else\r\n {\r\n SecondQuestion.innerText = \"\";\r\n secondAnswer.style.visibility = \"hidden\";\r\n }\r\n firstAnswer.value = \"\"; \r\n secondAnswer.value = \"\";\r\n \r\n }", "title": "" }, { "docid": "ba67cef78fdc2d6bef04d59d7f698612", "score": "0.6462216", "text": "async function uniformData() {\n\n // iterate over all question data sets\n await $.asyncForEach( self.questions, async ( question, i ) => {\n\n // each question knows her original number and HTML ID\n question.nr = i + 1; question.id = 'question-' + question.nr;\n\n // consider default values for question data from instance config\n self.questions[ i ] = question = await $.integrate( $.filterProperties( self, 'text', 'description', 'answers', 'input', 'attributes', 'swap', 'escape', 'random', 'solution' ), question, true );\n\n // default input type is checkbox\n if ( !question.input ) question.input = 'checkbox';\n\n // set default information about correct answers\n if ( !question.solution && question.input !== 'radio' ) question.solution = [];\n\n // answer data sets could be given as single string (answer text) instead of object\n for ( i = 0; i < question.answers.length; i++ )\n if ( !$.isObject( question.answers[ i ] ) )\n question.answers[ i ] = { text: question.answers[ i ] };\n\n // information about correct answers of a multiple choice question could be given as integer array instead of boolean array\n if ( question.input === 'checkbox' && typeof question.solution[ 0 ] === 'number' ) {\n const solution = [];\n for ( i = 0; i < question.answers.length; i++ )\n solution.push( question.solution.indexOf( i ) >= 0 );\n question.solution = solution;\n }\n\n // fill up array of information about correct answers with default values (checkbox -> false, otherwise empty string)\n if ( Array.isArray( question.solution ) )\n for ( i = 0; i < question.answers.length; i++ )\n if ( question.solution[ i ] === undefined )\n question.solution[ i ] = question.input === 'checkbox' ? false : '';\n\n // iterate over all answers\n await $.asyncForEach( question.answers, async ( answer, i ) => {\n\n // each answer knows her original number, HTML class and HTML ID\n answer.nr = i + 1; answer.class = 'answer-' + answer.nr; answer.id = question.id + '-' + answer.class;\n\n // information about correct answers of a question could be given via answer data\n if ( answer.correct !== undefined )\n if ( question.input === 'radio' ) {\n if ( answer.correct === true ) question.solution = i;\n }\n else\n question.solution[ i ] = question.input === 'number' ? parseInt( answer.correct ) : answer.correct;\n\n // consider default values for answer data from question data\n question.answers[ i ] = await $.integrate( $.filterProperties( question, 'attributes', 'swap', 'escape' ), answer, true );\n\n } );\n\n // remove no more needed properties in question data\n delete question.attributes; delete question.swap;\n\n } );\n\n // remove no more needed properties in config\n delete self.text; delete self.description; delete self.answers; delete self.input; delete self.attributes; delete self.swap; delete self.escape; delete self.random; delete self.solution;\n\n }", "title": "" }, { "docid": "3796e65ccf740d396f191eb34807e03e", "score": "0.646083", "text": "function setNextQuestion() {\n resetState()\n showQuestion(shuffledQuestion[currentQuestionIndex])\n\n}", "title": "" }, { "docid": "68f2b89d11cd9c91387d70b8332f8da3", "score": "0.6442499", "text": "function getNewQuestion() {\r\n\r\n // set question number\r\n questionNumber.innerHTML = \"Question \" + (questionCounter + 1) + \" of \" + quiz.length;\r\n\r\n // set question text\r\n // get rendom question\r\n var questionIndex = availabeQuestion[Math.floor(Math.random() * availabeQuestion.length)]\r\n currentQuestion = questionIndex;\r\n questionText.innerHTML = currentQuestion.q;\r\n\r\n // get the position of 'questionIndex' from availableQuestion\r\n var index1 = availabeQuestion.indexOf(questionIndex);\r\n\r\n // remove the 'questionIndex' from availableQuestion so that the questions is not repeat\r\n availabeQuestion.splice(index1, 1);\r\n\r\n // set options\r\n // get the length of options\r\n\r\n var optionsLen = currentQuestion.options.length;\r\n\r\n // push optins into available option Array\r\n for (var i = 0; i < optionsLen; i++) {\r\n availabeOptions.push(i)\r\n }\r\n\r\n optionContainer.innerHTML = '';\r\n\r\n var animationDelay = 0.15;\r\n // creat options in HTML\r\n\r\n for (var i = 0; i < optionsLen; i++) {\r\n // random option\r\n var optonIndex = availabeOptions[Math.floor(Math.random() * availabeOptions.length)];\r\n\r\n // get the position of 'optonIndex' from the availabeOptions\r\n var index2 = availabeOptions.indexOf(optonIndex);\r\n\r\n // remove the 'optonIndex' from availableOptions so that the questions is not repeat\r\n availabeOptions.splice(index2, 1);\r\n var option = document.createElement(\"div\");\r\n option.innerHTML = currentQuestion.options[optonIndex];\r\n option.id = optonIndex;\r\n option.style.animationDelay = animationDelay + 's';\r\n animationDelay = animationDelay + 0.15;\r\n option.className = \"option\";\r\n optionContainer.appendChild(option);\r\n option.setAttribute(\"onclick\", \"getResult(this)\")\r\n\r\n }\r\n\r\n // console.log(currentQuestion.options)\r\n\r\n\r\n\r\n questionCounter++\r\n\r\n}", "title": "" }, { "docid": "bc6073bcffea72baea8ac2a9a802ffee", "score": "0.6441558", "text": "function nextQuestion() {\n /* Chose new question until the question was not asked yet -- Crashes if no more available questions */\n\n while (questionArray[questionNumberToShow].allreadyAsked) {\n questionNumberToShow = Math.floor(Math.random() * questionArray.length);\n }\n\n /* Shuffle the answers of the chosen question */\n\n questionArray[questionNumberToShow].answerArray = shuffleArray(\n questionArray[questionNumberToShow].answerArray\n );\n\n /* Set the question in the site content */\n\n questionTextHTML.innerText = questionArray[questionNumberToShow].questionText;\n answer1HTML.innerText = questionArray[questionNumberToShow].answerArray[0];\n answer2HTML.innerText = questionArray[questionNumberToShow].answerArray[1];\n answer3HTML.innerText = questionArray[questionNumberToShow].answerArray[2];\n answer4HTML.innerText = questionArray[questionNumberToShow].answerArray[3];\n\n correctToShowHTML.innerText = `Leider ze spéit! Déi richteg Äntwert war ${questionArray[questionNumberToShow].correctAnswer}`;\n\n /* Set allready asked to true because question was asked */\n\n questionArray[questionNumberToShow].allreadyAsked = true;\n\n /* Remove colors and hidden from answers */\n\n answer1HTML.classList.remove(\"answerfalse\");\n answer2HTML.classList.remove(\"answerfalse\");\n answer3HTML.classList.remove(\"answerfalse\");\n answer4HTML.classList.remove(\"answerfalse\");\n answer1HTML.classList.remove(\"answercorrect\");\n answer2HTML.classList.remove(\"answercorrect\");\n answer3HTML.classList.remove(\"answercorrect\");\n answer4HTML.classList.remove(\"answercorrect\");\n allAnswersHTML.classList.remove(\"hidden\");\n\n /* Set possible trys back to 4 */\n\n answerTrys = 4;\n\n /* Update questions to ask */\n numberOfQuestionsAllreadyAsked++;\n numberofQuestionsToAsk--;\n console.log(numberofQuestionsToAsk);\n\n /* Update image */\n\n imageFeedbackHTML.setAttribute(\"src\", \"questionMark.png\");\n}", "title": "" }, { "docid": "4a3113915b6cdf567d3ef2379537f077", "score": "0.6440944", "text": "function setNextQuestion() {\n resetState();\n showQuestion(shuffledQuestions[currentQuestionIndex]);\n currentQuestionIndex++;\n}", "title": "" }, { "docid": "7f3a693df8696fa6b2571c1cbeaba854", "score": "0.6440389", "text": "function setup() {\n var currQuestion = register[questionNr];\n \n question.innerHTML = \"<b>Question \" + (questionNr + 1) + \"/3:</b><br>\" + currQuestion.question;\n choiceList[0].innerHTML = \"1. \" + currQuestion.choices[0];\n choiceList[1].innerHTML = \"X. \" + currQuestion.choices[1];\n choiceList[2].innerHTML = \"2. \" + currQuestion.choices[2];\n correctAnswer = currQuestion.answer;\n }", "title": "" }, { "docid": "32434106b7096afdb60999cde0310fcd", "score": "0.64375913", "text": "function createQuestions(){\n buildButtons(quizCards[longClock].answerChoices);\n questionTitle.textContent = quizCards[longClock].question;\n\n}", "title": "" } ]
1bd114b8b72f3c32ad22ac07270ccd69
'this' will refer to tdInstance here.
[ { "docid": "974f97f6a39a72aa861ebfafb3175a67", "score": "0.0", "text": "function onPlaylistPreloaded(e) {\n this.getTracks(function(tracks) {\n var nowPlaying = this.getTrack();\n\n log(tracks);\n\n // If parameters.single is not explicitly set to false and\n // there is only one track, render the single-track player.\n if(tracks.length === 1 && playerParameters.single !== false && playerParameters.mini == false && playerParameters.feed == false) {\n playerParameters.single = true;\n }\n\n container.find('.tdspinner').hide();\n\n rerender({\n feed: playerParameters.feed,\n mini: playerParameters.mini,\n nowPlaying: nowPlaying,\n shrink: playerParameters.shrink,\n single: playerParameters.single,\n skin: playerParameters.skin,\n tracks: tracks,\n tracksPerArtist: playerParameters.tracksPerArtist,\n visualizerType: playerParameters.visualizerType\n });\n\n if(this.getSound() && !this.getSound().paused) {\n changePlayButton(false);\n }\n }.bind(this));\n }", "title": "" } ]
[ { "docid": "939791025edbd806410f7d0a6de0c114", "score": "0.58534116", "text": "setTR(t, r) {\nthis._t = t;\nthis._r = r;\nreturn this;\n}", "title": "" }, { "docid": "f8d4419b49780f7014f96fc9a0f2bd6b", "score": "0.56894654", "text": "setT(t) {\nthis._t = t;\nreturn this;\n}", "title": "" }, { "docid": "138d112863a2c0b9fa57ebb142ba4c75", "score": "0.56351155", "text": "getWrappedInstance() {\n if (!this.wrappedInstance) console.warn('RTSelectTable - No wrapped instance')\n if (this.wrappedInstance.getWrappedInstance) return this.wrappedInstance.getWrappedInstance()\n else return this.wrappedInstance\n }", "title": "" }, { "docid": "1e976fcc6fa7aee3da521661116d8dae", "score": "0.54664683", "text": "TP(val) {\n this._TP = val;\n return this;\n }", "title": "" }, { "docid": "df93e1a67131a63386fd5f3e945b8fe6", "score": "0.543338", "text": "get table() {\n return this._table;\n }", "title": "" }, { "docid": "2c1041abbdf0891ce784e2b9ba955b1b", "score": "0.5391248", "text": "get target() {\n\t\treturn this._t;\n\t}", "title": "" }, { "docid": "d721fc7abc70184471cfe1060085e6ca", "score": "0.5328283", "text": "get tr() {\n return new Transaction(this);\n }", "title": "" }, { "docid": "5292297b4de589c7507b8c6494ef0483", "score": "0.52894646", "text": "function bindTT() {\n\t$t=$(this);\n\t$p=$t.parent();\n\tif ($p.hasClass(\"selflink\") == false) {\n\t\t$t.data(\"tt\", $p.attr(\"title\").replace(\" (page does not exist)\",\"\").replace(\"?\",\"%3F\")).hover(showTip,hideTip).mousemove(moveTip);\n\t}\n}", "title": "" }, { "docid": "3b663c3ca93377f2c5d648fb50412735", "score": "0.5223055", "text": "get table() {\n return this.tableIn;\n }", "title": "" }, { "docid": "0632340af6ac02bedfa73761c6128104", "score": "0.522078", "text": "_setTable() {\r\n\r\n\r\n }", "title": "" }, { "docid": "efbb9a165ed8d7572efc1e91112b4ee7", "score": "0.51644766", "text": "function ttable(tableid, divid) {\n // Store the table ID\n this.tableid = tableid;\n\n // Store the Inner Div ID\n this.divid = divid;\n\n // Table Custom Styling\n this.style = new Object();\n this.style.table = new String;\n this.style.table = 'table-default';\n this.style.tablehead = new String;\n this.style.tablehead = 'head-default';\n this.style.tablebody = new String;\n this.style.tablebody = 'body-default';\n this.style.tablecaption = new String;\n this.style.tablecaption = 'caption-default';\n\n // Custom Hover Class\n this.style.bodyhover = new Boolean;\n this.style.bodyhover = true;\n this.style.headhover = new Boolean;\n this.style.headhover = true;\n this.style.tablehead_hover = new String;\n this.style.tablehead_hover = 'hoverhead-default';\n this.style.tableheadtd_hover = new String;\n this.style.tableheadtd_hover = 'hoverheadtd-default';\n this.style.tablebody_hover = new String;\n this.style.tablebody_hover = 'hoverbody-default';\n\n // Highlighting Custom Styling\n this.highlight = new Object();\n this.highlight.enabled = new Boolean;\n this.highlight.enabled = true;\n this.highlight.style = new String;\n this.highlight.style = 'highlight-default';\n this.highlight.onlclick = new Boolean;\n this.highlight.onclick = false;\n this.highlight.onclick_style = new String;\n this.highlight.onclick_style = 'clicklight-default';\n\n // Stripped Rows Parameters\n this.style.stripped = new Boolean;\n this.style.stripped = true;\n this.style.odd_row = new String;\n this.style.odd_row = 'odd-default';\n\n // Numeration Parameters\n this.style.num = new Boolean;\n this.style.num = true;\n this.style.num_class = new String;\n this.style.num_class = 'num-default';\n\n // Sorting Paramters\n this.sorting = new Object();\n this.sorting.enabled = new Boolean;\n this.sorting.enabled = true;\n this.sorting.sortall = new Boolean;\n this.sorting.sortall = false;\n this.sorting.resetnum = new Boolean;\n this.sorting.resetnum = true;\n this.sorting.sortedstyle = new String;\n this.sorting.sortedstyle = 'sorted-default';\n this.sorting.clickablestyle = new String;\n this.sorting.clickablestyle = 'clickable-default';\n this.sorting.onclickstyle = new String;\n this.sorting.onclickstyle = 'onclick-default';\n this.sorting.sortascstyle = new String;\n this.sorting.sortascstyle = 'sortasc-default';\n this.sorting.sortdescstyle = new String;\n this.sorting.sortdescstyle = 'sortdesc-default';\n\n // Pagination Paramaters\n this.pagination = new Object();\n this.pagination.enabled = new Boolean;\n this.pagination.enabled = false;\n this.pagination.rowperpage = new Number;\n this.pagination.rowperpage = 10;\n\n // Editable Parameters\n this.edit = new Object();\n this.edit.enabled = new Boolean;\n this.edit.enabled = false;\n\n // Conversion Parameters\n this.csv = new Object();\n this.csv.separator = new String;\n this.csv.separator = ',';\n\n // Search Input\n this.search = new Object();\n this.search.enabled = new Boolean;\n this.search.enabled = false;\n this.search.inputID = new String;\n this.search.inputID = \"filter\";\n this.search.casesensitive = new Boolean;\n // True = Case Sensitive\n this.search.casesensitive = false;\n\n // Table Information\n this.info = new Object();\n}", "title": "" }, { "docid": "bdfa9a20db90b4899e2794f800d80353", "score": "0.5097572", "text": "function callback() {\n //console.log('callback called', this.el[this.elProperty], this.dataModelField);\n setter(el, this.cashedElData.replace('{{' + tr + '}}',\n this.$scope[this.scopeKey].model.get(this.dataModelField)));\n }", "title": "" }, { "docid": "978479fa434addfd8ecb16fe29e1ea84", "score": "0.50876534", "text": "getData() {\r\n return this.table;\r\n }", "title": "" }, { "docid": "0f38bcdea672b4d042d3f8ed10e5e04a", "score": "0.5065255", "text": "created() {\n this._TPInstance = null\n this._obs_title = null\n this._obs_content = null\n }", "title": "" }, { "docid": "1278a386efe9d8852e2aff25ac5d28d6", "score": "0.50531983", "text": "constructor(element, parent) {\n this.element = element;\n\n //// assign this.tabs to parent\n // this.tabs is assigned to the parent which is an object. there is only one of these objects because there was only one .tabs class used in the document\n this.tabs = parent;\n\n //// Using the method from the parent class above, pass in a reference to the custom data attribute. \n // this.tabsItem = this.parent.getTab();\n // ************solution code used the below*********************\n this.tabsItem = parent.getTab(this.element.dataset.tab);\n //// Create a new TabsItem object that passes in a tabsItem value that you just created above\n this.tabsItem = new TabsItem(this.tabsItem);\n this.element.addEventListener('click', () => {\n this.tabs.updateActive(this);\n // invoke the select() method on this\n this.select();\n });\n }", "title": "" }, { "docid": "4f2eb900552cd55af057d34e140d6d9e", "score": "0.50430435", "text": "function Dt(){this.__data__=sl?sl(null):{}}", "title": "" }, { "docid": "52e93274049e81e3ab5969b30e827a69", "score": "0.5029605", "text": "function whatisthis() {\n return this;\n }", "title": "" }, { "docid": "5cfd1fa745d815bb3216f5d61cb2ba61", "score": "0.50293154", "text": "componentDidUpdate() {\n\t\t/* preserve context */\n\t\tconst _this = this;\n\t}", "title": "" }, { "docid": "5cfd1fa745d815bb3216f5d61cb2ba61", "score": "0.50293154", "text": "componentDidUpdate() {\n\t\t/* preserve context */\n\t\tconst _this = this;\n\t}", "title": "" }, { "docid": "9efbf4d3b2b6a5af01f9c1483177196b", "score": "0.50284004", "text": "get testcaseId() { return this.tcid(); }", "title": "" }, { "docid": "519daf2835907a599ce3ae29f0a22ddf", "score": "0.5025083", "text": "createdCallback() {\n self = this\n self.init()\n }", "title": "" }, { "docid": "5e79ccdfc871f0cdef412021cfe251e1", "score": "0.5014645", "text": "function tableView(container,doc) \r\n{\r\n var numRows; // assigned in click, includes header\r\n var numCols; // assigned at bottom of click\r\n var activeSingleQuery = null;\r\n var autoCompArray = [];\r\n var entryArray = [];\r\n var qps; // assigned in onBinding\r\n var kb = tabulator.kb;\r\n\r\n thisTable = this; // fixes a problem with calling this.container\r\n this.document=null;\r\n if(doc)\r\n this.document=doc;\r\n else\r\n this.document=document;\r\n \r\n // The necessary vars for a View\r\n this.name=\"Table\"; //Display name of this view.\r\n this.queryStates=[]; //All Queries currently in this view.\r\n this.container=container; //HTML DOM parent node for this view.\r\n this.container.setAttribute('ondblclick','tableDoubleClick(event)');\r\n \r\n /*****************************************************\r\n drawQuery \r\n ******************************************************/\r\n this.drawQuery = function (q)\r\n {\r\n var i, td, th, j, v;\r\n var t = thisTable.document.createElement('table');\r\n var tr = thisTable.document.createElement('tr');\r\n var nv = q.vars.length;\r\n \r\n this.onBinding = function (bindings) {\r\n var i, tr, td;\r\n //tabulator.log.info('making a row w/ bindings ' + bindings);\r\n tr = thisTable.document.createElement('tr');\r\n t.appendChild(tr);\r\n numStats = q.pat.statements.length; // Added\r\n qps = q.pat.statements;\r\n for (i=0; i<nv; i++) {\r\n var v = q.vars[i];\r\n var val = bindings[v];\r\n tabulator.log.msg('Variable '+v+'->'+val)\r\n // generate the subj and pred for each tdNode \r\n for (j = 0; j<numStats; j++) {\r\n var stat = q.pat.statements[j];\r\n // statClone = <s> <p> ?* .\r\n var statClone = new tabulator.rdf.Statement(stat.subject, stat.predicate, stat.object);\r\n if (statClone.object == v) {\r\n statClone.object = bindings[v];\r\n var sSubj = statClone.subject.toString();\r\n if (sSubj[0] == '?') { \r\n // statClone = ?* <p> <o> .\r\n statClone.subject = bindings[statClone.subject];\r\n }\r\n break;\r\n }\r\n }\r\n tabulator.log.msg('looking for statement in store to attach to node ' + statClone);\r\n var st = kb.anyStatementMatching(statClone.subject, statClone.predicate, statClone.object);\r\n if (!st) {tabulator.log.warn(\"Tableview: no statement {\"+\r\n statClone.subject+statClone.predicate+statClone.object+\"} from bindings: \"+bindings);}\r\n else if (!st.why) {tabulator.log.warn(\"Unknown provenence for {\"+st.subject+st.predicate+st.object+\"}\");}\r\n tr.appendChild(matrixTD(val, st));\r\n } //for each query var, make a row\r\n } // onBinding\r\n\r\n t.appendChild(tr);\r\n t.setAttribute('class', 'results sortable'); //needed to make sortable\r\n t.setAttribute('id', 'tabulated_data'); \r\n \r\n tabulator.Util.emptyNode(thisTable.container).appendChild(t); // See results as we go\r\n\r\n for (i=0; i<nv; i++) { // create the header\r\n v = q.vars[i];\r\n tabulator.log.debug(\"table header cell for \" + v + ': '+v.label)\r\n text = document.createTextNode(v.label)\r\n th = thisTable.document.createElement('th');\r\n th.appendChild(text);\r\n tr.appendChild(th);\r\n }\r\n \r\n kb.query(q, this.onBinding); // pulling in the results of the query\r\n activeSingleQuery = q;\r\n this.queryStates[q.id]=1;\r\n \r\n drawExport();\r\n drawAddRow();\r\n sortables_init();\r\n \r\n // table edit\r\n t.addEventListener('click', click, false);\r\n numCols = nv;\r\n \r\n // auto completion array\r\n entryArray = tabulator.lb.entry;\r\n for (i = 0; i<tabulator.lb.entry.length; i++) {\r\n autoCompArray.push(entryArray[i][0].toString());\r\n entryArray = entryArray.slice(0);\r\n }\r\n } //drawQuery\r\n\r\n function drawExport () {\r\n var form= thisTable.document.createElement('form');\r\n var but = thisTable.document.createElement('input');\r\n form.setAttribute('textAlign','right');\r\n but.setAttribute('type','button');\r\n but.setAttribute('id','exportButton');\r\n but.addEventListener('click',exportTable,true);\r\n but.setAttribute('value','Export to HTML');\r\n form.appendChild(but);\r\n thisTable.container.appendChild(form);\r\n }\r\n\r\n this.undrawQuery = function(q) {\r\n if(q===activeSingleQuery) \r\n {\r\n this.queryStates[q.id]=0;\r\n activeSingleQuery=null;\r\n tabulator.Util.emptyNode(this.container);\r\n }\r\n }\r\n\r\n this.addQuery = function(q) {\r\n this.queryStates[q.id]=0;\r\n }\r\n\r\n this.removeQuery = function (q) {\r\n this.undrawQuery(q);\r\n delete this.queryStates[q.id];\r\n return;\r\n }\r\n\r\n this.clearView = function () {\r\n this.undrawQuery(activeSingleQuery);\r\n activeSingleQuery=null;\r\n tabulator.Util.emptyNode(this.container);\r\n }\r\n \r\n /*****************************************************\r\n Table Editing\r\n ******************************************************/\r\n var selTD;\r\n var inputObj;\r\n var sparqlUpdate;\r\n \r\n function clearSelected(node) {\r\n if (!node) {return;}\r\n var a = document.getElementById('focus');\r\n if (a != null) { a.parentNode.removeChild(a); };\r\n var t = document.getElementById('tabulated_data');\r\n t.removeEventListener('keypress', keyHandler, false);\r\n node.style.backgroundColor = 'white';\r\n }\r\n \r\n function clickSecond(e) {\r\n selTD.removeEventListener('click', clickSecond, false); \r\n if (e.target == selTD) {\r\n clearSelected(selTD);\r\n onEdit();\r\n e.stopPropagation();\r\n e.preventDefault();\r\n }\r\n }\r\n \r\n function setSelected(node) {\r\n if (!node) {return;}\r\n if (node.tagName != \"TD\") {return;}\r\n var a = document.createElement('a');\r\n a.setAttribute('id', 'focus');\r\n node.appendChild(a);\r\n a.focus();\r\n var t = document.getElementById('tabulated_data');\r\n t.addEventListener('keypress', keyHandler, false);\r\n node.style.backgroundColor = \"#8F3\";\r\n \r\n selTD = node;\r\n selTD.addEventListener('click', clickSecond, false);\r\n }\r\n \r\n function click(e) {\r\n if (selTD != null) clearSelected(selTD);\r\n var node = e.target;\r\n if (node.firstChild && node.firstChild.tagName == \"INPUT\") return;\r\n setSelected(node);\r\n var t = document.getElementById('tabulated_data');\r\n numRows = t.childNodes.length;\r\n }\r\n \r\n function getRowIndex(node) { \r\n var trNode = node.parentNode;\r\n var rowArray = trNode.parentNode.childNodes;\r\n var rowArrayLength = trNode.parentNode.childNodes.length;\r\n for (i = 1; i<rowArrayLength; i++) {\r\n if (rowArray[i].innerHTML == trNode.innerHTML) return i;\r\n }\r\n }\r\n \r\n function getTDNode(iRow, iCol) {\r\n var t = document.getElementById('tabulated_data');\r\n //return t.rows[iRow].cells[iCol]; // relies on tbody\r\n return t.childNodes[iRow].childNodes[iCol];\r\n }\r\n \r\n function keyHandler(e) {\r\n var oldRow = getRowIndex(selTD); //includes header\r\n var oldCol = selTD.cellIndex;\r\n var t = document.getElementById('tabulated_data');\r\n clearSelected(selTD);\r\n if (e.keyCode == 35) { //end\r\n addRow();\r\n }\r\n if (e.keyCode==13) { //enter\r\n onEdit();\r\n }\r\n if(e.keyCode==37) { //left\r\n newRow = oldRow;\r\n newCol = (oldCol>0)?(oldCol-1):oldCol;\r\n var newNode = getTDNode(newRow, newCol);\r\n setSelected(newNode);\r\n }\r\n if (e.keyCode==38) { //up\r\n newRow = (oldRow>1)?(oldRow-1):oldRow;\r\n newCol = oldCol;\r\n var newNode = getTDNode(newRow, newCol)\r\n setSelected(newNode);\r\n newNode.scrollIntoView(false); // ...\r\n }\r\n if (e.keyCode==39) { //right\r\n newRow = oldRow;\r\n newCol = (oldCol<numCols-1)?(oldCol+1):oldCol;\r\n var newNode = getTDNode(newRow, newCol);\r\n setSelected(newNode);\r\n }\r\n if (e.keyCode==40) { //down\r\n newRow = (oldRow<numRows-1)?(oldRow+1):oldRow;\r\n newCol = oldCol;\r\n var newNode = getTDNode(newRow, newCol);\r\n setSelected(newNode);\r\n newNode.scrollIntoView(false);\r\n }\r\n if (e.shiftKey && e.keyCode == 9) { //shift+tab\r\n newRow = oldRow;\r\n newCol = (oldCol>0)?(oldCol-1):oldCol;\r\n if (oldCol == 0) {\r\n newRow = oldRow-1;\r\n newCol = numCols-1;\r\n }\r\n if (oldRow==1) {newRow=1;}\r\n if (oldRow==1 && oldCol==0) {newRow=1; newCol = 0;}\r\n \r\n var newNode = getTDNode(newRow, newCol);\r\n setSelected(newNode);\r\n e.stopPropagation();\r\n e.preventDefault();\r\n return;\r\n }\r\n if (e.keyCode == 9) { // tab\r\n newRow = oldRow;\r\n newCol = (oldCol<numCols-1)?(oldCol+1):oldCol;\r\n if (oldCol == numCols-1) {\r\n newRow = oldRow+1;\r\n newCol = 0;\r\n }\r\n if (oldRow == numRows-1) {newRow = numRows-1;}\r\n if (oldRow == numRows-1 && oldCol == numCols-1) \r\n {newRow = numRows-1; newCol = numCols-1}\r\n \r\n var newNode = getTDNode(newRow, newCol);\r\n setSelected(newNode);\r\n }\r\n e.stopPropagation();\r\n e.preventDefault();\r\n } //keyHandler\r\n \r\n function onEdit() {\r\n if ((selTD.getAttribute('autocomp') == undefined) && \r\n (selTD.getAttribute('type') == 'sym')) {\r\n setSelected(selTD); return; \r\n }\r\n if (!selTD.editable && (selTD.getAttribute('type') == 'sym')) {return;}\r\n if (selTD.getAttribute('type') == 'bnode') {\r\n setSelected(selTD); return;\r\n }\r\n \r\n var t = document.getElementById('tabulated_data');\r\n var oldTxt = selTD.innerHTML;\r\n inputObj = document.createElement('input');\r\n inputObj.type = \"text\";\r\n inputObj.style.width = \"99%\";\r\n inputObj.value = oldTxt;\r\n \r\n // replace old text with input box\r\n if (!oldTxt)\r\n inputObj.value = ' '; // ????\r\n if (selTD.firstChild) { // selTD = <td> text </td>\r\n selTD.replaceChild(inputObj, selTD.firstChild);\r\n inputObj.select();\r\n } else { // selTD = <td />\r\n var parent = selTD.parentNode;\r\n var newTD = thisTable.document.createElement('TD');\r\n parent.replaceChild(newTD, selTD);\r\n newTD.appendChild(inputObj);\r\n }\r\n \r\n // make autocomplete input or just regular input\r\n if (selTD.getAttribute('autocomp') == 'true') {\r\n autoSuggest(inputObj, autoCompArray);\r\n }\r\n inputObj.addEventListener (\"blur\", inputObjBlur, false);\r\n inputObj.addEventListener (\"keypress\", inputObjKeyPress, false);\r\n } //onEdit\r\n \r\n function inputObjBlur(e) { \r\n // no re-editing of symbols for now\r\n document.getElementById(\"autosuggest\").style.display = 'none';\r\n newText = inputObj.value;\r\n selTD.setAttribute('about', newText);\r\n if (newText != '') {\r\n selTD.innerHTML = newText;\r\n }\r\n else {\r\n selTD.innerHTML = '---';\r\n }\r\n setSelected(selTD);\r\n e.stopPropagation();\r\n e.preventDefault();\r\n \r\n // sparql update\r\n if (!selTD.stat) {saveAddRowText(newText); return;};\r\n tabulator.log.msg('sparql update with stat: ' + selTD.stat);\r\n tabulator.log.msg('new object will be: ' + kb.literal(newText, ''));\r\n if (tabulator.isExtension) {sparqlUpdate = sparql.update_statement(selTD.stat);}\r\n else {sparqlUpdate = new sparql(kb).update_statement(selTD.stat);}\r\n // TODO: DEFINE ERROR CALLBACK\r\n //selTD.stat.object = kb.literal(newText, '');\r\n sparqlUpdate.set_object(kb.literal(newText, ''), function(uri,success,error_body) {\r\n if (success) {\r\n //kb.add(selTD.stat.subject, selTD.stat.predicate, selTD.stat.object, selTD.stat.why)\r\n tabulator.log.msg('sparql update success');\r\n var newStatement = kb.add(selTD.stat.subject, selTD.stat.predicate, kb.literal(newText, ''), selTD.stat.why);\r\n kb.remove(selTD.stat);\r\n selTD.stat = newStatement;\r\n }\r\n });\r\n }\r\n\r\n function inputObjKeyPress(e) {\r\n if (e.keyCode == 13) { //enter\r\n inputObjBlur(e);\r\n }\r\n } //***************** End Table Editing *****************//\r\n \r\n /******************************************************\r\n Add Row\r\n *******************************************************/\r\n // node type checking\r\n function literalRC (row, col) {\r\n var t = thisTable.document.getElementById('tabulated_data'); \r\n var tdNode = t.childNodes[row].childNodes[col];\r\n if (tdNode.getAttribute('type') =='lit') return true;\r\n } \r\n\r\n function bnodeRC (row, col) {\r\n var t = thisTable.document.getElementById('tabulated_data');\r\n var tdNode = t.childNodes[row].childNodes[col];\r\n if (tdNode.getAttribute('type') =='bnode') return true;\r\n }\r\n\r\n function symbolRC(row, col) {\r\n var t = thisTable.document.getElementById('tabulated_data');\r\n var tdNode = t.childNodes[row].childNodes[col];\r\n if (tdNode.getAttribute('type') == 'sym') return true;\r\n } // end note type checking\r\n \r\n // td creation for each type\r\n function createLiteralTD() {\r\n tabulator.log.msg('creating literalTD for addRow');\r\n var td = thisTable.document.createElement(\"TD\");\r\n td.setAttribute('type', 'lit');\r\n td.innerHTML = '---';\r\n return td;\r\n }\r\n \r\n function createSymbolTD() {\r\n tabulator.log.msg('creating symbolTD for addRow');\r\n var td = thisTable.document.createElement(\"TD\");\r\n td.editable=true;\r\n td.setAttribute('type', 'sym');\r\n td.setAttribute('style', 'color:#4444ff');\r\n td.innerHTML = \"---\";\r\n td.setAttribute('autocomp', 'true');\r\n return td;\r\n }\r\n\r\n function createBNodeTD() {\r\n var td = thisTable.document.createElement('TD');\r\n td.setAttribute('type', 'bnode');\r\n td.setAttribute('style', 'color:#4444ff');\r\n td.innerHTML = \"...\";\r\n bnode = kb.bnode();\r\n tabulator.log.msg('creating bnodeTD for addRow: ' + bnode.toNT());\r\n td.setAttribute('o', bnode.toNT());\r\n return td;\r\n } //end td creation\r\n \r\n function drawAddRow () {\r\n var form = thisTable.document.createElement('form');\r\n var but = thisTable.document.createElement('input');\r\n form.setAttribute('textAlign','right');\r\n but.setAttribute('type','button');\r\n but.setAttribute('id','addRowButton');\r\n but.addEventListener('click',addRow,true);\r\n but.setAttribute('value','+');\r\n form.appendChild(but);\r\n thisTable.container.appendChild(form);\r\n }\r\n \r\n // use kb.sym for symbols\r\n // use kb.bnode for blank nodes\r\n // use kb.literal for literal nodes \r\n function addRow () {\r\n var td; var tr = thisTable.document.createElement('tr');\r\n var t = thisTable.document.getElementById('tabulated_data');\r\n // create the td nodes for the new row\r\n // for each td node add the object variable like ?v0\r\n for (var i=0; i<numCols; i++) {\r\n if (symbolRC (1, i)) {\r\n td = createSymbolTD();\r\n td.v = qps[i].object;\r\n tabulator.log.msg('FOR COLUMN '+i+' v IS '+td.v);\r\n }\r\n else if (literalRC(1, i)) {\r\n td = createLiteralTD(); \r\n td.v = qps[i].object\r\n tabulator.log.msg('FOR COLUMN '+i+' v IS '+td.v);\r\n }\r\n else if (bnodeRC(1, i)) {\r\n td = createBNodeTD();\r\n td.v = qps[i].object\r\n tabulator.log.msg('FOR COLUMN '+i+' v IS '+td.v);\r\n }\r\n else {tabulator.log.warn('addRow problem')} \r\n tr.appendChild(td);\r\n }\r\n t.appendChild(tr);\r\n // highlight the td in the first column of the new row\r\n numRows = t.childNodes.length;\r\n clearSelected(selTD);\r\n newRow = numRows-1;\r\n newCol = 0;\r\n selTD = getTDNode(newRow, newCol); // first td of the row\r\n setSelected(selTD);\r\n // clone the qps array and attach a pointer to the clone on the first td of the row\r\n tabulator.log.msg('CREATING A CLONE OF QPS: ' + qps);\r\n var qpsClone = [];\r\n for (var i = 0; i<qps.length; i++) {\r\n var stat = qps[i];\r\n var newStat = new tabulator.rdf.Statement(stat.subject, stat.predicate, stat.object, stat.why);\r\n qpsClone[i] = newStat;\r\n }\r\n selTD.qpsClone = qpsClone; // remember that right now selTD is the first td of the row, qpsClone is not a 100% clone\r\n } //addRow\r\n \r\n function saveAddRowText(newText) {\r\n var td = selTD; // need to use this in case the user switches to a new TD in the middle of the autosuggest process\r\n td.editable=false;\r\n var type = td.getAttribute('type');\r\n // get the qps which is stored on the first cell of the row\r\n var qpsc = getTDNode(getRowIndex(td), 0).qpsClone;\r\n var row = getRowIndex(td);\r\n \r\n function validate() { // make sure the user has made a selection\r\n for (var i = 0; i<autoCompArray.length; i++) {\r\n if (newText == autoCompArray[i]) {\r\n return true;\r\n } \r\n }\r\n return false;\r\n }\r\n if (validate() == false && type == 'sym') {\r\n alert('Please make a selection');\r\n td.innerHTML = '---'; clearSelected(td); setSelected(selTD);\r\n return;\r\n }\r\n \r\n function getMatchingSym(text) {\r\n for (var i=0; i<autoCompArray.length; i++) {\r\n if (newText==autoCompArray[i]) {\r\n return entryArray[i][1];\r\n }\r\n }\r\n tabulator.log.warn('no matching sym');\r\n }\r\n \r\n var rowNum = getRowIndex(td);\r\n // fill in the query pattern based on the newText\r\n for (var i = 0; i<numCols; i++) {\r\n tabulator.log.msg('FILLING IN VARIABLE: ' + td.v);\r\n tabulator.log.msg('CURRENT STATEMENT IS: ' + qpsc[i]);\r\n if (qpsc[i].subject === td.v) { // subj is a variable\r\n if (type == 'sym') {qpsc[i].subject = getMatchingSym(newText);}\r\n if (type == 'lit') {qpsc[i].subject = kb.literal(newText, '');}\r\n if (type == 'bnode') {qpsc[i].subject = kb.bnode();}\r\n tabulator.log.msg('NEW QPSC IS: ' + qpsc);\r\n }\r\n if (qpsc[i].object === td.v) { // obj is a variable\r\n // TODO: DOUBLE QUERY PROBLEM IS PROBABLY HERE\r\n if (type == 'sym') {qpsc[i].object = getMatchingSym(newText);}\r\n if (type == 'lit') {qpsc[i].object = kb.literal(newText, '');}\r\n if (type == 'bnode') {qpsc[i].object = kb.bnode();}\r\n tabulator.log.msg('NEW QPSC IS: ' + qpsc);\r\n }\r\n }\r\n \r\n // check if all the variables in the query pattern have been filled out\r\n var qpscComplete = true; \r\n for (var i = 0; i<numCols; i++) {\r\n if (qpsc[i].subject.toString()[0]=='?') {qpscComplete = false;}\r\n if (qpsc[i].object.toString()[0]=='?') {qpscComplete = false;}\r\n }\r\n \r\n // if all the variables in the query pattern have been filled out, then attach stat pointers to each node, add the stat to the store, and perform the sparql update\r\n if (qpscComplete == true) {\r\n tabulator.log.msg('qpsc has been filled out: ' + qpsc);\r\n for (var i = 0; i<numCols; i++) {\r\n tabulator.log.msg('looking for statement in store: ' + qpsc[i]);\r\n var st = kb.anyStatementMatching(qpsc[i].subject, qpsc[i].predicate, qpsc[i].object); // existing statement for symbols\r\n if (!st) { // brand new statement for literals\r\n tabulator.log.msg('statement not found, making new statement');\r\n var why = qpsc[0].subject;\r\n st = new tabulator.rdf.Statement(qpsc[i].subject, qpsc[i].predicate, qpsc[i].object, why);\r\n //kb.add(st.subject, st.predicate, st.object, st.why);\r\n }\r\n var td = getTDNode(row, i);\r\n td.stat = st; \r\n \r\n // sparql update; for each cell in the completed row, send the value of the stat pointer\r\n tabulator.log.msg('sparql update with stat: ' + td.stat);\r\n if (tabulator.isExtension) {sparqlUpdate = sparql}\r\n else {sparqlUpdate = new sparql(kb)}\r\n // TODO: DEFINE ERROR CALLBACK\r\n sparqlUpdate.insert_statement(td.stat, function(uri,success,error_body) {\r\n if (success) {\r\n tabulator.log.msg('sparql update success');\r\n var newStatement = kb.add(td.stat.subject, td.stat.predicate, td.stat.object, td.stat.why);\r\n td.stat = newStatement;\r\n tabulator.log.msg('sparql update with '+newStatement);\r\n } \r\n });\r\n }\r\n }\r\n } // saveAddRowText\r\n\r\n /******************************************************\r\n Autosuggest box\r\n *******************************************************/\r\n // mostly copied from http://gadgetopia.com/post/3773\r\n function autoSuggest(elem, suggestions)\r\n {\r\n //Arrow to store a subset of eligible suggestions that match the user's input\r\n var eligible = new Array();\r\n //A pointer to the index of the highlighted eligible item. -1 means nothing highlighted.\r\n var highlighted = -1;\r\n //A div to use to create the dropdown.\r\n var div = document.getElementById(\"autosuggest\");\r\n //Do you want to remember what keycode means what? Me neither.\r\n var TAB = 9;\r\n var ESC = 27;\r\n var KEYUP = 38;\r\n var KEYDN = 40;\r\n var ENTER = 13;\r\n\r\n /********************************************************\r\n onkeyup event handler for the input elem.\r\n Enter key = use the highlighted suggestion, if there is one.\r\n Esc key = get rid of the autosuggest dropdown\r\n Up/down arrows = Move the highlight up and down in the suggestions.\r\n ********************************************************/\r\n elem.onkeyup = function(ev)\r\n {\r\n var key = getKeyCode(ev);\r\n\r\n switch(key)\r\n {\r\n case ENTER:\r\n useSuggestion();\r\n hideDiv();\r\n break;\r\n\r\n case ESC:\r\n hideDiv();\r\n break;\r\n\r\n case KEYUP:\r\n if (highlighted > 0)\r\n {\r\n highlighted--;\r\n }\r\n changeHighlight(key);\r\n break;\r\n\r\n case KEYDN:\r\n if (highlighted < (eligible.length - 1))\r\n {\r\n highlighted++;\r\n }\r\n changeHighlight(key);\r\n \r\n case 16: break;\r\n\r\n default:\r\n if (elem.value.length > 0) {\r\n getEligible();\r\n createDiv();\r\n positionDiv();\r\n showDiv();\r\n }\r\n else {\r\n hideDiv();\r\n }\r\n }\r\n };\r\n\r\n /********************************************************\r\n Insert the highlighted suggestion into the input box, and \r\n remove the suggestion dropdown.\r\n ********************************************************/\r\n useSuggestion = function() \r\n { // This is where I can move the onblur stuff\r\n if (highlighted > -1) {\r\n elem.value = eligible[highlighted];\r\n hideDiv();\r\n \r\n setTimeout(\"document.getElementById('\" + elem.id + \"').focus()\",0);\r\n }\r\n };\r\n\r\n /********************************************************\r\n Display the dropdown. Pretty straightforward.\r\n ********************************************************/\r\n showDiv = function()\r\n {\r\n div.style.display = 'block';\r\n };\r\n\r\n /********************************************************\r\n Hide the dropdown and clear any highlight.\r\n ********************************************************/\r\n hideDiv = function()\r\n {\r\n div.style.display = 'none';\r\n highlighted = -1;\r\n };\r\n\r\n /********************************************************\r\n Modify the HTML in the dropdown to move the highlight.\r\n ********************************************************/\r\n changeHighlight = function()\r\n {\r\n var lis = div.getElementsByTagName('LI');\r\n for (i in lis) {\r\n var li = lis[i];\r\n if (highlighted == i) {\r\n li.className = \"selected\";\r\n elem.value = li.firstChild.innerHTML;\r\n }\r\n else {\r\n if (!li) return; // fixes a bug involving \"li has no properties\"\r\n li.className = \"\";\r\n }\r\n }\r\n };\r\n\r\n /********************************************************\r\n Position the dropdown div below the input text field.\r\n ********************************************************/\r\n positionDiv = function()\r\n {\r\n var el = elem;\r\n var x = 0;\r\n var y = el.offsetHeight;\r\n\r\n //Walk up the DOM and add up all of the offset positions.\r\n while (el.offsetParent && el.tagName.toUpperCase() != 'BODY') {\r\n x += el.offsetLeft;\r\n y += el.offsetTop;\r\n el = el.offsetParent;\r\n }\r\n\r\n x += el.offsetLeft;\r\n y += el.offsetTop;\r\n\r\n div.style.left = x + 'px';\r\n div.style.top = y + 'px';\r\n };\r\n\r\n /********************************************************\r\n Build the HTML for the dropdown div\r\n ********************************************************/\r\n createDiv = function()\r\n {\r\n var ul = document.createElement('ul');\r\n\r\n //Create an array of LI's for the words.\r\n for (i in eligible) {\r\n var word = eligible[i];\r\n\r\n var li = document.createElement('li');\r\n var a = document.createElement('a');\r\n a.href=\"javascript:false\";\r\n a.innerHTML = word;\r\n li.appendChild(a);\r\n\r\n if (highlighted == i) {\r\n li.className = \"selected\";\r\n }\r\n\r\n ul.appendChild(li);\r\n }\r\n\r\n div.replaceChild(ul,div.childNodes[0]);\r\n\r\n /********************************************************\r\n mouseover handler for the dropdown ul\r\n move the highlighted suggestion with the mouse\r\n ********************************************************/\r\n ul.onmouseover = function(ev)\r\n {\r\n //Walk up from target until you find the LI.\r\n var target = getEventSource(ev);\r\n while (target.parentNode && target.tagName.toUpperCase() != 'LI')\r\n {\r\n target = target.parentNode;\r\n }\r\n \r\n var lis = div.getElementsByTagName('LI');\r\n \r\n\r\n for (i in lis)\r\n {\r\n var li = lis[i];\r\n if(li == target)\r\n {\r\n highlighted = i;\r\n break;\r\n }\r\n }\r\n changeHighlight();\r\n \r\n };\r\n\r\n /********************************************************\r\n click handler for the dropdown ul\r\n insert the clicked suggestion into the input\r\n ********************************************************/\r\n ul.onclick = function(ev)\r\n {\r\n \r\n useSuggestion();\r\n hideDiv();\r\n cancelEvent(ev);\r\n return false;\r\n };\r\n div.className=\"suggestion_list\";\r\n div.style.position = 'absolute';\r\n }; // createDiv\r\n\r\n /********************************************************\r\n determine which of the suggestions matches the input\r\n ********************************************************/\r\n getEligible = function()\r\n {\r\n eligible = new Array();\r\n for (i in suggestions) \r\n {\r\n var suggestion = suggestions[i];\r\n \r\n if(suggestion.toLowerCase().indexOf(elem.value.toLowerCase()) == \"0\")\r\n {\r\n eligible[eligible.length]=suggestion;\r\n }\r\n }\r\n };\r\n \r\n getKeyCode = function(ev) {\r\n if(ev) { return ev.keyCode;}\r\n };\r\n\r\n getEventSource = function(ev) {\r\n if(ev) { return ev.target; }\r\n };\r\n\r\n cancelEvent = function(ev) {\r\n if(ev) { ev.preventDefault(); ev.stopPropagation(); }\r\n }\r\n } // autosuggest\r\n \r\n //document.write('<div id=\"autosuggest\"><ul></ul></div>');\r\n var div = document.createElement('div');\r\n div.setAttribute('id','autosuggest');\r\n document.body.appendChild(div);\r\n div.appendChild(document.createElement('ul'));\r\n} // tableView", "title": "" }, { "docid": "b94094d06fcd54a46d5a7b269e462fb5", "score": "0.5003326", "text": "update(dt) {\n this.instance.update(dt);\n }", "title": "" }, { "docid": "9df7c4049147d03873384570c902079a", "score": "0.49766114", "text": "constructor() {\n super({ dbName: dbName });\n\n const oThis = this;\n\n oThis.tableName = 'tags';\n }", "title": "" }, { "docid": "a382965a408c90a25f4cdb6e496e3c19", "score": "0.49580443", "text": "get darTP() {\n return this.TP;\n }", "title": "" }, { "docid": "7f7c46fe330b4b5e2a75ccdb6bdc5b84", "score": "0.4957206", "text": "function SimTable($simTable) {\n this.$simTable = $simTable;\n }", "title": "" }, { "docid": "eb8eaa2dd74d4368cf546aa6e8911b70", "score": "0.49564907", "text": "get instance() {\n\t\treturn this.__instance;\n\t}", "title": "" }, { "docid": "77cc2d15dc4163caa010cc5aa947fa1d", "score": "0.4934677", "text": "constructor() {\n super({ dbName: dbName });\n\n const oThis = this;\n\n oThis.tableName = 'tokens';\n }", "title": "" }, { "docid": "5573fd5a9391cb91033a8c1fc33c18c7", "score": "0.49241886", "text": "function gtGrdObj(tdObj) { try { var ele = tdObj.parentNode.parentNode.parentNode; if (ele.tagName.toLowerCase() == \"tbody\") le = ele.parentNode; return ele; } catch (e) { return null; } }", "title": "" }, { "docid": "a8dba69f37fe8ef25e8829d05059fab4", "score": "0.4920098", "text": "function q(){this.evTarget=tt,this.targetIds={},T.apply(this,arguments)}", "title": "" }, { "docid": "aa7c739239482579ded4993b34052bb7", "score": "0.4918942", "text": "get name() { return this.tcid(); }", "title": "" }, { "docid": "7c25c42cf8d67c35600bcefd526229e3", "score": "0.4880299", "text": "trans() {\nreturn this._t;\n}", "title": "" }, { "docid": "fec8990af17a1fc1abe9c5dd28451abf", "score": "0.4871689", "text": "bind(context) {\n this.$parent = context;\n }", "title": "" }, { "docid": "c0fc3e147865bf23d54cf82379b69d6f", "score": "0.48596126", "text": "function tablerow(objtable, datasetname, tabledata, template, update) { // Do each row\n if (!datasetname) datasetname = '';\n\n var TR;\n\n if (!update) { // New Record\n\tTR = objtable.find('.row_tablecontent').last();\n\n\tobjtable.append(template); // Append invisible Template for next record\n TR.attr(\"data-id\", tabledata._id); // assign Data To TR tag attribute data-id=1.2.3...\n }else if(update=='new'){\n objtable.prepend(template); // Template for next record\n TR = objtable.find('.row_tablecontent').first();\n TR.attr(\"data-id\", tabledata._id);\n }else {\n var nameofrow = \"[data-id=\" + tabledata._id + \"]\";\n TR = objtable.find(nameofrow)\n .first();\n }\n\n\n setdatabyclass(TR, datasetname, tabledata);\n\n //TR.show('slow');\n return TR;\n}", "title": "" }, { "docid": "5ec7c2cd32c70fc1146a116f7d1a31b8", "score": "0.484656", "text": "_forwardContentValues(instance) {\n instance.datepicker = this;\n instance.color = this.color;\n }", "title": "" }, { "docid": "516e09173a0db62757b2581c41206614", "score": "0.483899", "text": "constructor() {\n this.display = document.getElementById('displayRow'); //getting the tbody of our table\n this.notify = document.getElementById('notification'); //getting the div tag above table to show alerts\n }", "title": "" }, { "docid": "a56f4b77740a3a21bd944ba7ec9146ee", "score": "0.48319685", "text": "get cell() {\n let parentNode = this.node.parentNode;\n return parentNode && parentNode._newtabCell;\n }", "title": "" }, { "docid": "7eefebbf2ab847a8fcd7d14f93bd8827", "score": "0.48261744", "text": "constructor (el, data) {\n el.tbInstance = this;\n extend(this, data, { el: el });\n\n // defaults for all widget types\n this.setDefaults({\n poweredBy: true\n });\n\n // set defaults\n this.setDefaults(this.defaults());\n\n this.el = el;\n }", "title": "" }, { "docid": "2fd47e0915920454e41a419b6024ab20", "score": "0.4818463", "text": "function A() {\n\t\tt.call(this)\n\t}", "title": "" }, { "docid": "a640ed365ede1af377478e708eb4bb6e", "score": "0.48009488", "text": "function itemTable() { }", "title": "" }, { "docid": "577f89e9141a8e022fa9633ba46235f2", "score": "0.47947276", "text": "openTable() {\n this._stackItem = new TableStackItem(this._stackItem);\n }", "title": "" }, { "docid": "f91518d7b7da5dee8030fad3d790cdfd", "score": "0.47885925", "text": "get data() {\n\t\treturn this._tableData;\n\t}", "title": "" }, { "docid": "883e54789af553158c104a3507c13031", "score": "0.47839266", "text": "get target(){ return this.__target; }", "title": "" }, { "docid": "9541189044955202dd819bc74c175cd0", "score": "0.4774126", "text": "constructor() {\n super({ dbName: dbName });\n\n const oThis = this;\n\n oThis.tableName = 'latest_transactions';\n }", "title": "" }, { "docid": "de716f50507860b768a7752276fc27d5", "score": "0.47672662", "text": "function t(e,t){if(!t.has(e))throw new TypeError(\"attempted to get private field on non-instance\");return t.get(e)}", "title": "" }, { "docid": "6cf2dd0c9d3907681e300477096fa1fa", "score": "0.47472554", "text": "function createInstanceRow(instanceData) {\n var newTr = $(\"<tr>\");\n //check where i'm pulling description from. may be the wrong word. \n // newTr.data(\"description\", instanceData);\n newTr.append(\"<td>\" + instanceData.Class_description.class_name + \"</td>\");\n newTr.append(\"<td>\" + instanceData.week_day + \"</td>\");\n newTr.append(\"<td>\" + instanceData.time + \"</td>\")\n newTr.append(\"<td>\" + instanceData.start_date + \"</td>\");\n newTr.append(\"<td>\" + instanceData.end_date + \"</td>\");\n newTr.append(\"<td style='text-align: center;'>\" + instanceData.seats_total+ \"</td>\");\n newTr.append(\"<td style='text-align: center;'>\" + instanceData.seats_filled+ \"</td>\");\n //line below needs info to capture the info from the table description\n $(\"#instance-table tbody\").append(newTr);\n\n return newTr;\n }", "title": "" }, { "docid": "61f9ef3d8f0717e59720597de9f5ba4f", "score": "0.47399446", "text": "constructor() {\n super()\n self = this\n self.init()\n }", "title": "" }, { "docid": "9eb35b5244a0d7f86ff9f1771a537e67", "score": "0.47387487", "text": "function table() {\n this.table = null;\n this.opts = {};\n this.table_id = \"\";\n}", "title": "" }, { "docid": "f87ba40e4fef4c58508b8f26202ef29b", "score": "0.47295478", "text": "function __initFormTable($dom) {\r\n}", "title": "" }, { "docid": "4b370c4f48599d6ffb9f6f16907afd13", "score": "0.47240978", "text": "function CdkCellOutletRowContext() {}", "title": "" }, { "docid": "00af0935ec1a54e433e58d98779dea67", "score": "0.4722145", "text": "selectTower(){\r\n if (selectedTower != this){\r\n selectedTower = this;\r\n }\r\n else{\r\n selectedTower = null;\r\n }\r\n }", "title": "" }, { "docid": "136a63d2c9db806222b89aae1d6d1d6f", "score": "0.4721397", "text": "measured_TP(val) {\n this._measured_TP = val;\n return this;\n }", "title": "" }, { "docid": "24ddf31bee2d7dfcb611a5f5eaf92597", "score": "0.4720601", "text": "function afterSomeTime() {\n this.text = \"Two seconds have passed..\";\n let func = () => {\n // Notice how here 'this' captures the outer this\n console.log(this.text);\n };\n setTimeout(func, 2000);\n}", "title": "" }, { "docid": "e223947985bf679803959d0ce9201243", "score": "0.4720128", "text": "async #renderTable() {\n $(\"#\" + this.id).dataTable();\n}", "title": "" }, { "docid": "56ac4b701b4da0ccd0ef0d895f400c47", "score": "0.4718859", "text": "function Vt(){this.__data__=[]}", "title": "" }, { "docid": "ea03c0b171ee33fb2fb5ee4c2115e457", "score": "0.4708719", "text": "constructor() {\n super({ dbName: dbName });\n\n const oThis = this;\n\n oThis.tableName = 'meetings';\n }", "title": "" }, { "docid": "021209895fffdd8e4baeb53313d7b3a8", "score": "0.47022685", "text": "getGlobalTRX() {\nreturn this.globalTRX;\n}", "title": "" }, { "docid": "522c43e3524870fbd84406a835447332", "score": "0.4700845", "text": "function T0(t){this._=t;}", "title": "" }, { "docid": "e7c1cac210523d10f1ea1237de0abaca", "score": "0.4693868", "text": "setTable(Table) {\n this.table = Table + '.do';\n }", "title": "" }, { "docid": "be63be55eca7a526178c5abd31943f42", "score": "0.46858203", "text": "_table() {\n if (this._table_obj === undefined) {\n this._table_obj = this.fwk_app_container.find('table#fwk-qserv-scheduler-hist');\n }\n return this._table_obj;\n }", "title": "" }, { "docid": "519f3d347a900506ab5753ee144c65e1", "score": "0.46761814", "text": "function tr(t,e){this.x=e,this.q=t}", "title": "" }, { "docid": "057b7607e0ad246f3573674ae694e56c", "score": "0.46686664", "text": "start() {\n //let self = this;\n }", "title": "" }, { "docid": "e356a629d41d94a898beab84d8fd5c2d", "score": "0.46653488", "text": "function getTableUpdate() {\n\n}", "title": "" }, { "docid": "39b793c84be3e75b93b45243f239d35c", "score": "0.46611255", "text": "function self($this) {\n\treturn $this;\n}", "title": "" }, { "docid": "2133eec93ccb79ffda8434366205d157", "score": "0.46608463", "text": "function Table() {\r\n}", "title": "" }, { "docid": "5d1c2d5ef579e724030a6764ef158035", "score": "0.4659421", "text": "function AxisTableRenderer(parent){this.parent=parent;}", "title": "" }, { "docid": "8d2d1ffd2759f74027cf888d2445ec46", "score": "0.46469113", "text": "constructor() { \n \n TrendedDataReport.initialize(this);\n }", "title": "" }, { "docid": "26ec86ef140122517a3280010a0300b1", "score": "0.46436965", "text": "constructor() {\n\n this.table = {};\n\n this.tableSize = 0;\n }", "title": "" }, { "docid": "3bc94b53530fe63a8130a475b9da990c", "score": "0.4638839", "text": "init(){\n var self = this;\n self.generateData();\n self.insertInfo();\n self.copyData();\n }", "title": "" }, { "docid": "58ee5ab61079814de8c04fd570ef8bc2", "score": "0.4638349", "text": "constructor(){\n this.instance = createTextBox();\n }", "title": "" }, { "docid": "45556f1a395ede0968a34a7ea93eefce", "score": "0.4634339", "text": "function doSomethingElse() {\n console.log(this, 'normal function, this has its own context here');\n console.log(self, 'normal function with a workaround to use this storing it in a variable called self');\n }", "title": "" }, { "docid": "1d94c2a33e15599a22fa87f278f12ed9", "score": "0.46309555", "text": "function contextOfThis(){\n return this\n}", "title": "" }, { "docid": "3ee2659db4b6edb40040cc68b6a95d37", "score": "0.4630106", "text": "constructor() {\n super({ dbName: dbName });\n\n const oThis = this;\n\n oThis.tableName = 'aux_price_oracles';\n }", "title": "" }, { "docid": "868a1daff9af0297b17afd7011bb5ae4", "score": "0.46288052", "text": "get selectedCell() {\n return this.table.find('td.cell.selected');\n }", "title": "" }, { "docid": "37cad4507e96d098d803c9d145fbf890", "score": "0.46269718", "text": "function or(){this.__data__=new Ut}", "title": "" }, { "docid": "04629064776b5e5f46794db6d0e9fe2b", "score": "0.4620828", "text": "function setTable() {\n var elemT = $(\"#in_tableh\");\n if (elemT.html() == \"true\") {\n elemT.html(\"false\");\n if ($(\"#is_ownerh\").html() == \"true\")\n sittedTable = new Table($(\"#table_idh\").html(),true);\n else\n sittedTable = new Table($(\"#table_idh\").html(),false);\n }\n}", "title": "" }, { "docid": "ada608bcd48f72f4c1604cc90d9f4c2f", "score": "0.4593819", "text": "constructor(template, _differs, _table) {\n super(template, _differs);\n this._table = _table;\n }", "title": "" }, { "docid": "bb9163d881465b59b8f83155af27a7a4", "score": "0.4592558", "text": "InitClass() {\n this.tpClass = 'tp.DataSource';\n }", "title": "" }, { "docid": "698107d926b1334752fd4d746ca9ae3f", "score": "0.45813075", "text": "function Tester() {\n this.t1a_Selector = \"#t2a\";\n this.t1b_Selector = \"#t2b\";\n}", "title": "" }, { "docid": "abc6f167ffa89d60a2697ce6b6c41371", "score": "0.4575399", "text": "constructor() {\n super({ dbName: dbName });\n\n const oThis = this;\n\n oThis.tableName = 'user_profile_elements';\n }", "title": "" }, { "docid": "39e34bc17bce767021c2b659245fe742", "score": "0.45743015", "text": "function Row(tr)\n{\n this.tr=tr;\n //\n //Set the primary key of a row from the tr/primary key attribute\n this.primarykey = tr.getAttribute('primarykey');\n //\n //Set the id of a row\n this.id = tr.getAttribute('id');\n \n //Select this row by ensuring that it is the ony one with the current \n //attribute\n this.select = function()\n {\n // \n //Select all currentl markd trs\n var trs = document.querySelectorAll(\"[current]\");\n //\n //Remove the current attribute from them\n for(var i=0; i<trs.length; i++)\n {\n trs[i].removeAttribute(\"current\");\n }\n // \n //Make the given row as current\n this.tr.setAttribute(\"current\", true);\n //\n //Save the current row for future reference. Note that local storage does\n //not store objectts; rather it stores serializable data structures\n window.last_tr=this.tr;\n window.localStorage.last_tr_id=this.tr.getAttribute(\"id\");\n };\n}", "title": "" }, { "docid": "4648958174e35a7c8dab2995be5737ce", "score": "0.45740792", "text": "function TimelineThread(parent, tid) {\n this.parent = parent;\n this.tid = tid;\n this.subRows = [[]];\n }", "title": "" }, { "docid": "f3c8541f3a91ae4dbb696e7a89438abd", "score": "0.45702127", "text": "function highlight(td) {\r\n\tconsole.log(\"Testing\");\r\n\t\tif (selectedTd) { // remove the existing highlight if any\r\n\t\t\tselectedTd.classList.remove('addBold');\r\n\t\t}\r\n\t\tselectedTd = td;\r\n\t\tselectedTd.classList.add('addBold'); // highlight the new td\r\n\t}", "title": "" }, { "docid": "4e0e4a9d75184437e1a91c0487c1fc42", "score": "0.456851", "text": "function TLE() {\n this._properties;\n this._date;\n }", "title": "" }, { "docid": "55951612a1457d97d3a681dd4e1c0f77", "score": "0.4565371", "text": "construct(gantt, config) {\n const me = this;\n\n me.tipId = `${gantt.id}-baselines-tip`;\n me.gantt = gantt;\n\n super.construct(gantt, config);\n\n me.ganttDetatcher = gantt.on({\n taskDrag : 'onTaskDrag',\n afterTaskDrop : 'onAfterTaskDrop',\n thisObj : me\n });\n\n me.storeDetacher = gantt.taskStore.on({\n update : {\n fn : 'onStoreUpdateRecord',\n thisObj : me,\n prio : 1000\n }\n });\n }", "title": "" }, { "docid": "eea9e3f16ba701ad9fda712c827cc1f5", "score": "0.45651677", "text": "function TXHT(id) {\n\n\n TXHT.initDataDom(id);\n }", "title": "" }, { "docid": "ab4ae58fdabd0548dc370a37996623f5", "score": "0.45617473", "text": "function getTd($tr) {\n\t\t\t\tvar $td = $startTd.length != 0? $startTd: $endTd;\n\t\t\t\tif ($td.hasClass(\"left\"))\n\t\t\t\t\treturn $tr.find(\"td.content.left\");\n\t\t\t\telse if ($td.hasClass(\"right\"))\n\t\t\t\t\treturn $tr.find(\"td.content.right\");\n\t\t\t\telse\n\t\t\t\t\treturn $tr.find(\"td.content\");\n\t\t\t}", "title": "" }, { "docid": "b64c22efd397aa39ef033a2947c36ca4", "score": "0.45596147", "text": "selectTable() {\n if (!this.owner.enableSelection) {\n return;\n }\n this.selectTableInternal();\n }", "title": "" }, { "docid": "1ab1a58ec883ca381a42a9971f4d5d05", "score": "0.45593542", "text": "function GPT() {\n return this;\n}", "title": "" }, { "docid": "e06801a5749d7d24ef4034182196ee4a", "score": "0.45575956", "text": "init(){\n\t\tthis._active = true\n\t}", "title": "" }, { "docid": "748ef816ab33601d76adf57780674897", "score": "0.45556393", "text": "table() {\n this.showtable= ! this.showtable;\n //workaround - table width is incorect when rendered hidden\n //render it after 100 ms again, usually after it is shown, thus calculating\n //correct width\n if (this.showtable) window.setTimeout(function(that){that.ht2.render()},100,this);\n }", "title": "" }, { "docid": "3f4b33da70c5e505997d6761a9329bcf", "score": "0.45552093", "text": "function TableData(table, options) {\n\t\tthis.$table = $(table);\n\t\tthis.options = $.extend({}, defaults, options);\n\t\t// look for a dataTable extension on this table\n\t\tif ($.fn.DataTable && $.fn.DataTable.fnIsDataTable(this.$table.get(0))) {\n\t\t\tthis.dataTable = this.$table.dataTable();\n\t\t}\n\t\tthis.parse();\n\t\tthis.$table.data(\"visualize-data\", this);\n\t}", "title": "" }, { "docid": "6e23cb1505bb191154b15e4a9567f0bd", "score": "0.4554322", "text": "constructor() {\n super();\n\n this.session = null;\n\n this.past = [];\n this.future = [];\n this.updating = false; /* <-----\n updating variable is changing types through out the application \n runtime from a boolean, null, and function. <.< \n TODO: refactor to have a consistent type \n */\n \n // creating a reference for the instance name element to read its value\n this.refInputInstance = React.createRef();\n this.loadAllInstances = this.loadAllInstances.bind(this)\n this.saveInstance = this.saveInstance.bind(this)\n this.loadStateFromInstance = this.loadStateFromInstance.bind(this)\n this.instanceButtons = this.instanceButtons.bind(this)\n this.loadUserInstances = this.loadUserInstances.bind(this)\n \n // state will be read at custom mode setState of App component to send to the websocket server\n this.state = {\n tables: {},\n instances: []\n };\n }", "title": "" }, { "docid": "b0f237d40c026767f37876c4a15bcca2", "score": "0.4552781", "text": "get tus() { return tus; }", "title": "" }, { "docid": "987b58d2ab747299c92b0c36c25e18a9", "score": "0.45519957", "text": "function initInstanceInfoTooltip() {\n jQuery('#instance-tooltip').tooltip();\n}", "title": "" }, { "docid": "11de85b36fe454f1b8c7a5d232fdee94", "score": "0.4549164", "text": "function tripTableInteractionInit(){\n $('#active-trains-table tbody').on('click', 'tr', function () {\n var data = global.tripDatatable.row( this ).data();\n onClickTripRow(data);\n \n // Update class: selected for row display\n if ( $(this).hasClass('selected') ) {\n $(this).removeClass('selected');\n }\n else {\n global.tripDatatable.$('tr.selected').removeClass('selected');\n $(this).addClass('selected');\n }\n } );\n }", "title": "" }, { "docid": "37aa3d9c7a7795266de4eec3c77230a4", "score": "0.45486185", "text": "newTurtle() {\n return this;\n }", "title": "" }, { "docid": "e0a2bb22947b3e98de513ff897743ce9", "score": "0.45416552", "text": "_2thr(val) {\n this.__2thr = val;\n return this;\n }", "title": "" }, { "docid": "cf60b30f90efe5349d0936b0c61ae3d0", "score": "0.4539663", "text": "set(trs) {\nreturn this.setFromTRSet(trs);\n}", "title": "" }, { "docid": "7f85fb6eea26639c94a2178f9b38fc49", "score": "0.45364282", "text": "initialize(instance) {\n this.instance = instance;\n }", "title": "" }, { "docid": "95a593458aace56978b4db539d34c1b2", "score": "0.453357", "text": "function t(t) {\n this.count = t;\n }", "title": "" } ]
44eed7e81a733925352630a4047892cb
create the grid class
[ { "docid": "b6638c4c05344c9ed2dc062016227888", "score": "0.0", "text": "function grid(options) {\n //declare members\n this.behavior = \"tabular\";\n this.container = \"\";\n this.columns = [];\n this.data = null;\n this.width = \"auto\";\n this.height = \"auto\";\n this.pageIndex = 1;\n this.pageSize = 100;\n this.sortDirection = \"asc\";\n this.sortField = \"\";\n this.paginatorText = 'Records from {0} to {1} of total {2}';\n this.pivotMode = \"tree\";\n\n //declare needed variables\n var that = this;\n var container = null;\n\n //iterate all keys in options\n for (var key in options) {\n that[key] = options[key];\n }\n\n //handle errors\n if (that.container === \"\")\n return null;\n\n //declare internal members\n that._totalPages = 0;\n that._pager = null;\n that._firstCol = null;\n that._minMaxValues = null;\n that._classicalMinMax = null;\n that._rows = null;\n that._totalRecords = null;\n that._columnNames = [];\n that._rowTitles = [];\n that._rowNames = [];\n that._dataNames = [];\n that._totalColWidth = 0;\n that._subBtns = null;\n that._btns = null;\n that._header = null;\n that._footer = null;\n that._rowsContainer = null;\n that._colElements = null;\n that._colResizers = null;\n that._selectedRow = null;\n that._rowElements = null;\n that._gauges = [];\n\n //iterate all columns to set col specific members\n that.columns.forEach(function (c) {\n switch (c.direction) {\n case \"column\":\n {\n that._columnNames.push(c.fieldName);\n }\n break;\n case \"row\":\n {\n that._rowNames.push(c.fieldName);\n that._rowTitles.push(c.columnName);\n\n //set first col\n if (that._rowNames.length === 1)\n that._firstCol = c;\n }\n break;\n case \"data\":\n {\n that._dataNames.push(c.fieldName);\n }\n break;\n default:\n {\n that._columnNames.push(c.fieldName);\n }\n break;\n }\n });\n\n //initializes the grid\n let initGrid = function () {\n //set document element\n container = $('#' + that.container);\n\n //add pagos class into the client element\n if (!container.hasClass('pagos-grid'))\n container.addClass('pagos-grid');\n\n //declare needed variables\n let headerHeight = 0,\n rowsHeight = container.height() - 56,\n footerHeight = 0,\n headerHtml = \"\",\n html = \"\";\n\n //set grid dimensio\n container.css(\"width\", (that.width === 'auto' ? '100%' : that.width + 'px'));\n container.css(\"height\", (that.height === 'auto' ? container.height() : that.height + 'px'));\n\n //check if the behavior is pivot\n if (that.behavior === \"pivot\") {\n //declare variables\n let colWidth = that._firstCol.width ? that._firstCol.width : 100,\n colAlign = that._firstCol.labelPosition === \"auto\" ? \"left\" : that._firstCol.labelPosition,\n cellStyle = 'width: ' + colWidth + 'px;',\n colStyle = 'width: ' + colWidth + 'px; text-align: ' + colAlign + '; height: 27px; padding-top: 5px;',\n sortClass = '';\n\n //set background position\n if (colAlign === \"right\")\n colStyle += 'background-position: left';\n else\n colStyle += 'background-position: right';\n\n //construct column\n headerHtml += '<td class=\"colContainer ' + that.container + '_rowCol_0\" style=\"' + cellStyle + '\">';\n headerHtml += '<div id=\"' + that.container + '_col_0\" columnindex=\"0\" colname=\"' + that._firstCol.fieldName + '\" colid=\"' + that._firstCol.fieldID + '\" dataindex=\"0\" class=\"column ' + that.container + '_cols ' + sortClass + ' ' + that.container + '_rowCol_0\" style=\"' + colStyle + '\">';\n headerHtml += that._rowTitles.join('-');\n headerHtml += '</div></td>';\n\n //set min and max values\n that._minMaxValues = {};\n }\n\n //iterate all column\n that.columns.forEach(function (c, i) {\n //declare variables\n let colWidth = c.width ? c.width : 100,\n colAlign = c.labelPosition === \"auto\" ? \"left\" : c.labelPosition,\n cellStyle = 'width: ' + colWidth + 'px;',\n colStyle = 'width: ' + colWidth + 'px; text-align: ' + colAlign + '; height: 27px; padding-top: 5px;',\n sortClass = '';\n\n //set sorter position\n if (colAlign === 'right')\n colStyle += 'background-position: left';\n else\n colStyle += 'background-position: right';\n\n //check grid behavior\n if (that.behavior === 'tabular') {\n //construct column\n headerHtml += '<td class=\"colContainer ' + that.container + '_rowCol_' + i + '\" style=\"' + cellStyle + '\">';\n headerHtml += '<div id=\"' + that.container + '_col_' + i + '\" columnindex=\"' + i + '\" colname=\"' + c.fieldName + '\" colid=\"' + c.fieldID + '\" dataindex=\"' + i + '\" class=\"column ' + that.container + '_cols ' + sortClass + '\" style=\"' + colStyle + '\">';\n headerHtml += c.columnName;\n headerHtml += '</div></td>';\n } else {\n //check column behavior\n if (c.direction === 'data') {\n //set min and max values\n that._minMaxValues['min' + c.fieldName] = 0;\n that._minMaxValues['max' + c.fieldName] = 0;\n\n //construct column\n headerHtml += '<td class=\"colContainer ' + that.container + '_rowCol_' + i + '\" style=\"' + cellStyle + '\">';\n headerHtml += '<div id=\"' + that.container + '_col_' + i + '\" columnindex=\"' + i + '\" colname=\"' + c.fieldName + '\" colid=\"' + c.fieldID + '\"dataindex=\"' + i + '\" class=\"column ' + that.container + '_cols ' + sortClass + '\" style=\"' + colStyle + '\">';\n headerHtml += c.columnName;\n headerHtml += '</div></td>';\n }\n }\n\n //set an empty col\n headerHtml += '</td>';\n\n //check grid behaivor\n if (that.behavior === 'tabular') {\n //set col width\n that._totalColWidth += c.width ? c.width : 100;\n } else {\n //check col behavior\n if (c.direction === 'row' || c.direction === 'data')\n that._totalColWidth += c.width ? c.width : 100;\n }\n });\n\n //set grid content\n html += '<div id=\"' + that.container + '_hct\" style=\"width: 100%;\" class=\"pagos-grid-rail-content\">';\n html += '<table id=\"' + that.container + '_hdr\" class=\"pagos-grid-header\" style=\"\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>';\n html += headerHtml;\n html += '</tr></table></div>';\n html += '<div id=\"' + that.container + '_rows\" class=\"' + (that.behavior == 'tabular' ? 'pagos-grid-row-container' : 'pagos-pivot-row-container') + '\" style=\"width: 100%; height: ' + rowsHeight + 'px;\">';\n html += '</div>';\n\n //create footer\n if (that.behavior === 'tabular') {\n //set grid footer content\n html += '<table id=\"' + that.container + '_ft\" class=\"pagos-grid-footer\" style=\"min-width: 100%;\"><tr><td>';\n html += '<div id=\"' + that.container + '_first\" class=\"pagos-grid-button pagos-grid-button-first\"><i class=\"fa fa-fast-backward\"></i></div>';\n html += '<div id=\"' + that.container + '_prev\" class=\"pagos-grid-button pagos-grid-button-prev\"><i class=\"fa fa-backward\"></i></div>';\n html += '<div id=\"' + that.container + '_navText\" class=\"pagos-grid-footer-layer\">' + that.paginatorText + '</div>';\n html += '<div id=\"' + that.container + '_next\" class=\"pagos-grid-button pagos-grid-button-next\"><i class=\"fa fa-forward\"></i></div>';\n html += '<div id=\"' + that.container + '_last\" class=\"pagos-grid-button pagos-grid-button-last\"><i class=\"fa fa-fast-forward\"></i></div>';\n html += '<div id=\"grid_footer_layer\" class=\"pagos-grid-footer-layer\">Jump to page: <input id=\"' + that.container + '_pager\" type=\"text\" style=\"text-align: center; padding-left: 0px; width: 50px;\" /></div>';\n html += '</td></tr></table>';\n } else {\n //check whether the sub totals are visible\n if (that.showSubTotals) {\n //set pivot footer content\n let colWidth = that._firstCol.width ? that._firstCol.width : 100;\n html += '<div id=\"' + that.container + '_fct\" class=\"pagos-grid-rail-content\" style=\"width: 100%;\">';\n html += '<table id=\"' + that.container + '_ft\" class=\"pagos-grid-subtotal\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>';\n html += '<td class=\"pagos-grid-subtotal-cell-container ' + that.container + '_rowCol_0\" style=\"width: ' + colWidth + 'px;\">';\n html += '<div id=\"' + that.container + '_subTotal_0\" class=\"pagos-grid-subtotal-cell ' + that.container + '_rowCol_0\" style=\"width: ' + colWidth + 'px;\">Grand Total</div></td>';\n\n //Iterate all data columns\n that.columns.forEach(function (column, columnIndex) {\n //check if the column is data\n if (column.direction === 'data') {\n let colDataWidth = column.width ? column.width : 100;\n html += '<td class=\"pagos-grid-subtotal-cell-container ' + that.container + '_rowCol_' + columnIndex + '\" style=\"width: ' + colDataWidth + 'px;\">';\n html += '<div id=\"' + that.container + '_subTotal_' + columnIndex + '\" class=\"pagos-grid-subtotal-cell ' + that.container + '_rowCol_' + columnIndex + '\" style=\"width: ' + colDataWidth + 'px;\">0</div></td>';\n }\n });\n\n //set empty col\n html += '</td>';\n\n //closure for pivot footer\n html += '</tr></table></div>';\n }\n }\n\n //append the content\n container.html(html);\n\n //set footer events\n if (that.behavior === 'tabular') {\n //Set buttons\n $('#' + that.container + '_first').on(\"click\", function () {\n //check if first page\n if (that.pageIndex == 1)\n return;\n\n //set page index\n that.pageIndex = 1;\n\n //update footer\n setFooter();\n\n //raise page changed event\n if (that.onPageChanged)\n that.onPageChanged(that.pageIndex);\n });\n\n $('#' + that.container + '_prev').on(\"click\", function () {\n //check if first page\n if (that.pageIndex == 1)\n return;\n\n //set page index\n that.pageIndex -= 1;\n\n //update footer\n setFooter();\n\n //raise page changed event\n if (that.onPageChanged)\n that.onPageChanged(that.pageIndex);\n });\n\n $('#' + that.container + '_next').on(\"click\", function () {\n //check if last page\n if (that.pageIndex == that._totalPages)\n return;\n\n //set page index\n that.pageIndex += 1;\n\n //update footer\n setFooter();\n\n //raise page changed event\n if (that.onPageChanged)\n that.onPageChanged(that.pageIndex);\n });\n\n $('#' + that.container + '_last').on(\"click\", function () {\n //check if last page\n if (that.pageIndex == that._totalPages)\n return;\n\n //set page index\n that.pageIndex = that._totalPages;\n\n //update footer\n setFooter();\n\n //raise page changed event\n if (that.onPageChanged)\n that.onPageChanged(that.pageIndex);\n });\n\n //set pager textbox\n that._pager = $(\"#\" + that.container + \"_pager\");\n that._pager.on(\"change\", function () {\n let enteredPageIndex = parseInt(that._pager.val());\n if (isNaN(enteredPageIndex))\n return false;\n\n //handle min\n if (enteredPageIndex < 1)\n if (that.pageIndex === 1) {\n that._pager.val(1);\n return;\n }\n else\n enteredPageIndex = 1;\n\n //handle min\n if (enteredPageIndex > that._totalPages)\n if (that.pageIndex === that._totalPages) {\n that._pager.val(that._totalPages);\n return;\n }\n else\n enteredPageIndex = that._totalPages;\n\n //set page index\n that.pageIndex = enteredPageIndex;\n\n //update footer\n setFooter();\n\n //raise page changed event\n if (that.onPageChanged)\n that.onPageChanged(that.pageIndex);\n\n });\n\n //set pager content\n that._pager.val(that.pageIndex.toString());\n }\n\n //get columns\n that._header = $('#' + that.container + '_hdr');\n that._footer = $('#' + that.container + '_ft');\n that._colElements = $('.' + that.container + '_cols');\n that._rowsContainer = $('#' + that.container + '_rows');\n\n //check if col elements is not null\n if (that._colElements != null && that._colElements.length) {\n //set column click event\n that._colElements.on(\"click\", function () {\n //get colindex and dataindex\n let colIndex = parseInt($(this).attr('columnindex'));\n let dataIndex = parseInt($(this).attr('dataindex'));\n\n //set sorter\n setSorter(colIndex, dataIndex);\n });\n }\n\n //check if rows container is not null\n if (that._rowsContainer != null && that._rowsContainer.length) {\n //set scroll event for rows container\n that._rowsContainer.scroll(function () {\n let scrollArea = $(this);\n let leftPos = scrollArea.scrollLeft();\n let maxLeft = scrollArea[0].scrollWidth - scrollArea[0].clientWidth;\n let lastSubTotalCol = $('#' + that.container + '_subTotal_' + (that.columns.length - 1));\n let hct = $('#' + that.container + '_hct');\n let fct = $('#' + that.container + '_fct');\n\n //check header container\n if (hct != null && hct.length)\n hct.scrollLeft(leftPos);\n\n //check footer container\n if (fct != null && fct.length)\n fct.scrollLeft(leftPos);\n \n });\n }\n\n //check if grid has data\n if (that.data != null)\n bindData(that.data);\n };\n\n //sets footer\n let setFooter = function () {\n //declare variables\n var navText = that.paginatorText,\n rangeMin = ((that.pageIndex - 1) * that.pageSize) + 1,\n rangeMax = rangeMin + that.pageSize - 1,\n nText = $('#' + that.container + '_navText');\n\n //set range max\n if (rangeMax > that._totalRecords)\n rangeMax = that._totalRecords;\n\n //set total pages\n that._totalPages = Math.ceil(that._totalRecords / that.pageSize);\n\n //set navigator text\n navText = navText.replace('{0}', rangeMin.group('.', ',', 0));\n navText = navText.replace('{1}', rangeMax.group('.', ',', 0));\n navText = navText.replace('{2}', that._totalRecords);\n\n //set text content in navigator\n if (nText != null)\n nText.html(navText);\n\n //set pager text\n if (that._pager != null)\n that._pager.val(that.pageIndex);\n };\n\n //sets sorter \n let setSorter = function (colIndex, dataIndex) {\n //declare variables\n var col = $('#' + that.container + '_col_' + colIndex),\n column = that.columns[dataIndex],\n sortClass = that.sortDirection === 'desc' ? 'pagos-grid-sorter-desc' : 'pagos-grid-sorter-asc';\n\n //check if col elements is not null\n if (that._colElements != null) {\n //clear sorters\n that._colElements.removeClass('pagos-grid-sorter-asc');\n that._colElements.removeClass('pagos-grid-sorter-desc');\n }\n\n //check if sorter field is changed\n if (that.sortField != column.fieldName) {\n that.sortDirection = 'asc';\n sortClass = 'pagos-grid-sorter-asc';\n }\n\n if (typeof isSinglePostPage != 'undefined') {\n\n var fieldName = column.fieldName;\n var dataType = column.columnType;\n\n that._rows = that._rows.sort(function (a, b) {\n switch (dataType) {\n case 'numeric':\n {\n //get field values\n var aValue = parseFloat(a[fieldName]);\n var bValue = parseFloat(b[fieldName]);\n\n if (isNaN(aValue))\n aValue = 0;\n\n if (isNaN(bValue))\n bValue = 0;\n\n if (that.sortDirection === 'asc') {\n return aValue - bValue;\n } else {\n return bValue - aValue;\n }\n }\n case 'datetime':\n {\n //get field values\n if (that.sortDirection === 'asc') {\n return (new Date(a[fieldName]) > new Date(b[fieldName])) ? 1 : ((new Date(a[fieldName]) < new Date(b[fieldName])) ? -1 : 0);\n } else {\n return (new Date(b[fieldName]) > new Date(a[fieldName])) ? 1 : ((new Date(b[fieldName]) < new Date(a[fieldName])) ? -1 : 0);\n }\n }\n default:\n {\n if (that.sortDirection === 'asc') {\n return (a[fieldName] > b[fieldName]) ? 1 : ((a[fieldName] < b[fieldName]) ? -1 : 0);\n } else {\n return (b[fieldName] > a[fieldName]) ? 1 : ((b[fieldName] < a[fieldName]) ? -1 : 0);\n }\n }\n }\n });\n\n that.bind(that.data);\n\n //update sort direction\n that.sortDirection = that.sortDirection === 'asc' ? 'desc' : 'asc';\n }\n\n //set sort field\n that.sortField = column.fieldName;\n that.sortFieldID = column.fieldID;\n\n //check if col element is not null\n if (col != null) {\n //add sort class\n col.addClass(sortClass);\n\n //set sorter position\n if (column.labelPosition === 'right')\n col.css('backgroundPosition', 'left');\n else\n col.css('backgroundPosition', 'right');\n }\n\n //set page index and paginator\n /*if (that.behavior === 'tabular') {\n //set pae index\n that.pageIndex = 1;\n\n //set footer\n setFooter();\n }*/\n\n //raise on before sort\n if (that.onSort) {\n that.onSort(that.sortField, that.sortFieldID, that.sortDirection === 'asc' ? 'desc' : 'asc');\n\n //update sort direction\n that.sortDirection = that.sortDirection === 'asc' ? 'desc' : 'asc';\n }\n\n };\n\n //binds data for the grid\n let bindData = function () {\n //switch grid behavior\n switch (that.behavior) {\n case 'tabular':\n bindGrid(that.data);\n break;\n case 'pivot':\n bindPivot(that.data);\n break;\n }\n\n //assign resizable to each cols\n $('.' + that.container + '_cols').each(function (index) {\n //attach resizable\n $(this).resizable({\n handles: 'e',\n resize: function (e, ui) {\n //declare needed variables\n let currentColField = $(this).attr('colid');\n let currentColIndex = getColIndexByID(currentColField);\n\n //update col size\n that.columns[currentColIndex].width = ui.size.width;\n\n //resize columns\n $('.' + that.container + '_rowCol_' + currentColIndex).css('width', ui.size.width + 'px');\n\n //raise callback\n if (that.onColumnResize)\n that.onColumnResize(currentColField, currentColIndex, ui.size.width);\n },\n stop: function (e, ui) {\n\n }\n });\n });\n };\n\n //binds grid dataset\n let bindGrid = function (data) {\n //declare variables\n let html = '';\n\n //set rows, minmax and total records\n that._rows = data.rows;\n that._totalRecords = data.totalRecords;\n that._minMaxValues = data.minMaxValues;\n\n //get length\n let rowsContainerHeight = parseInt(that._rowsContainer.css('height'));\n let rowLimit = Math.floor(rowsContainerHeight / 20);\n\n //iterate all rows\n that._rows.forEach(function (row, rowIndex) {\n //hide class for screenshots\n let hideClassForScreenshot = '';\n\n //check row index to set screenshot class\n if (rowIndex >= rowLimit)\n hideClassForScreenshot = ' pagos-grid-last2';\n\n //build html\n html += '<tr id=\"' + that.container + '_row_' + rowIndex + '\" class=\"pagos-grid-row pagos-grid-row-hlines ' + that.container + '_rows ' + hideClassForScreenshot + '\">';\n\n //iterate all columns\n that.columns.forEach(function (column, colIndex) {\n //check if the column behavior is column\n html += getCellContent(row, column, rowIndex, colIndex, 0);\n });\n\n //closure for row html\n html += '</tr>';\n });\n\n //append rows html\n that._rowsContainer.html('<table cellpadding=\"0\" cellspacing=\"0\">' + html + '</table>');\n that._rowElements = $('.' + that.container + '_rows');\n\n //check if row elements is not null\n if (that._rowElements.length) {\n //set rows click event\n that._rowElements.on(\"click\", function (index) {\n //declare variables\n var item = $(this);\n\n //remove selected class from all rows\n that._rowElements.removeClass('pagos-grid-row-selected');\n\n //add current item seleted class\n item.addClass('pagos-grid-row-selected');\n\n //set selected row\n that._selectedRow = that._rows[index];\n\n //raise row selected event\n if (that.onRowSelected)\n that.onRowSelected(that._selectedRow);\n });\n }\n\n //set conditional formatting\n setConditionalFormat(that._rows, 0);\n\n //check if the page index = 1\n if (that.pageIndex === 1) {\n //set footer content\n setFooter();\n\n\n }\n };\n\n //binds pivot dataset\n let bindPivot = function (data) {\n //declare needed variables\n var rowID = '',\n subID = '',\n subDiv = null,\n rowIndex = 0,\n subTotalCell = null,\n subTotalValue = '',\n html = '';\n\n //set rows\n that._rows = data.rows;\n\n //iterate all rows\n that._rows.forEach(function (row, index) {\n //set row and sub id\n rowID = that.container + '_row_' + index;\n subID = rowID + '_sub';\n\n //build html\n html += '<tr id=\"' + rowID + '\" class=\"pagos-grid-row pagos-grid-row-hlines ' + that.container + '_rows\">';\n\n //set first row\n html += getCellContent(row, that._firstCol, index, 0, 0);\n\n //iterate all columns\n that.columns.forEach(function (column) {\n //check if the current column has a data behavior\n if (column.direction === 'data') {\n //increase col index\n var colIndex = getColIndexByfieldName(column.fieldName);\n\n //set cell\n html += getCellContent(row, column, index, colIndex, 0);\n\n //set min col value\n if (row[column.fieldName] < that._minMaxValues['min' + column.fieldName])\n that._minMaxValues['min' + column.fieldName] = row[column.fieldName];\n\n //set max col value\n if (row[column.fieldName] > that._minMaxValues['max' + column.fieldName])\n that._minMaxValues['max' + column.fieldName] = row[column.fieldName];\n }\n });\n\n //closure for row\n html += '</tr>';\n\n //add sub row container\n html += '<tr id=\"' + subID + '\" class=\"pagos-grid-sub-row-container\"><td colspan=\"' + (that.columns.length - 1) + '\"></td></tr>';\n });\n\n //append rows html\n that._rowsContainer.html('<table cellpadding=\"0\" cellspacing=\"0\">' + html + '</table>');\n that._rowElements = $('.' + that.container + '_rows');\n\n //check if row elements is not null\n if (that._rowElements.length) {\n //set rows click event\n that._rowElements.on(\"click\", function (index) {\n //declare variables\n var item = $(this);\n\n //remove selected class from all rows\n that._rowElements.removeClass('pagos-grid-row-selected');\n\n //add current item seleted class\n item.addClass('pagos-grid-row-selected');\n\n //set selected row\n that._selectedRow = that._rows[index];\n\n //raise row selected event\n if (that.onRowSelected)\n that.onRowSelected(that._selectedRow);\n });\n }\n\n //set sub buttons click event\n that._subBtns = $('.' + that.container + '_subBtns_0');\n\n //check if sub buttons is not null\n if (that._subBtns.length) {\n //attach click event\n that._subBtns.on(\"click\", function (index) {\n var item = $(this);\n rowIndex = parseInt(item.attr('rowindex'));\n\n //declare variables\n var subDivID = '#' + that.container + '_row_' + rowIndex + '_sub';\n\n //get sub content div\n subDiv = $(subDivID);\n\n //set sub button class\n if (item.hasClass('pagos-grid-minus'))\n item.removeClass('pagos-grid-minus');\n else\n item.addClass('pagos-grid-minus');\n\n //hide all subs\n $('.pagos-grid-sub-row-container').css(\"display\", \"none\");\n\n //check if expanded\n if (item.hasClass('pagos-grid-minus')) {\n //set sub div style\n subDiv.css('display', 'table-row');\n\n //build sub rows\n buildSubRows(subDiv, subDivID, that._rows[rowIndex], 0);\n } else {\n //set sub div style\n subDiv.css('display', 'none');\n }\n });\n }\n\n //check if sub totals are visible\n if (that.showSubTotals) {\n //iterate all columns\n that.columns.forEach(function (column) {\n //check if col behavior is data\n if (column.direction === 'data') {\n //get column index\n let columnIndex = getColIndexByfieldName(column.fieldName);\n\n //get subtotal cell\n subTotalCell = $('#' + that.container + '_subTotal_' + columnIndex);\n\n //get summarize value\n subTotalValue = getSummarizeByColumn(columnIndex);\n\n //check if sub total cell is not null\n if (subTotalCell != null) {\n //set sub total cell\n subTotalCell.html(subTotalValue);\n\n //attach title value\n subTotalCell.attr('title', subTotalValue);\n }\n }\n });\n }\n\n //check whether the pivot mode is classical\n if (that.pivotMode === 'classical')\n that._classicalMinMax = getClassicalMinMaxValues(that._rows);\n\n //set conditional format\n setConditionalFormat(that._rows, 0);\n };\n\n let buildSubRows = function (div, divID, row, depth) {\n //declare variables\n var increasedDepth = depth + 1,\n html = '',\n firstCol = null,\n subRowElements = null,\n subBtns = null,\n subID = '',\n subDiv = null,\n rowIndex = 0,\n subs = row.sub;\n\n //check whether the rows has sub\n if (subs != null && subs.length > 0) {\n //get first col\n firstCol = getColByName(that._rowNames[increasedDepth]);\n firstCol.width = getColByName(that._rowNames[0]).width;\n\n //iterate all sub rows\n subs.forEach(function (row, index) {\n //set sub cell id\n subID = divID + '_row_' + index + '_sub';\n\n //build html\n html += '<tr id=\"' + that.container + '_subs_' + increasedDepth + '\" class=\"pagos-grid-sub-row ' + that.container + '_subRows_' + increasedDepth + '\">';\n html += getSubCellContent(row, firstCol, index, 0, (depth + 1), divID);\n\n //iterate all columns\n that.columns.forEach(function (column) {\n //check whether the col behavior is data\n if (column.direction === 'data') {\n //increase col index\n var colIndex = getColIndexByID(column.fieldID);\n\n //get cell html\n html += getSubCellContent(row, column, index, colIndex, (depth + 0), divID);\n\n //set min value\n if (row[column.fieldName] < that._minMaxValues['min' + column.fieldName])\n that._minMaxValues['min' + column.fieldName] = row[column.fieldName];\n\n //set max value\n if (row[column.fieldName] > that._minMaxValues['max' + column.fieldName])\n that._minMaxValues['max' + column.fieldName] = row[column.fieldName];\n }\n });\n\n //closure for row\n html += '</tr>';\n html += '<tr id=\"' + subID + '\" class=\"pagos-grid-sub-row-container\"><td colspan=\"' + (that.columns.length - 1) + '\"></td></tr>';\n });\n }\n\n //set sub content\n div.children().first().html('<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">' + html + '</table>');\n\n //set sub row elements\n subRowElements = $('.' + that.container + '_subRows_' + increasedDepth);\n\n //check if sub row eelemnts is not null\n if (subRowElements.length) {\n //set click event\n subRowElements.on(\"click\", function (index) {\n //get item\n var item = $(this);\n\n //remove selected class\n subRowElements.removeClass('pagos-grid-row-selected');\n\n //add selected class\n item.addClass('pagos-grid-row-selected');\n });\n }\n\n //get sub buttons\n subBtns = $('.' + that.container + '_subBtns_' + increasedDepth);\n\n //check if subButtons are not null\n if (subBtns.length) {\n //attach click event to sub buttons\n subBtns.on(\"click\", function (index) {\n //get item\n var item = $(this);\n\n //set row index\n rowIndex = parseInt(item.attr('rowindex'));\n\n //get sub content div\n subDiv = $('#' + that.container + '_row_' + rowIndex + '_sub');\n\n //set sub button class\n if (item.hasClass('pagos-grid-minus'))\n item.removeClass('pagos-grid-minus');\n else\n item.addClass('pagos-grid-minus');\n\n //check if expanded\n if (item.hasClass('pagos-grid-minus')) {\n //show subs\n subDiv.css('display', 'table-row');\n\n //build sub rows\n buildSubRows(subDiv, '#' + that.container + '_row_' + rowIndex + '_sub', subs[rowIndex], increasedDepth);\n } else {\n //hide subs\n subDiv.css('display', 'none');\n }\n });\n }\n\n //set conditional format\n setConditionalFormat(subs, depth, divID);\n };\n\n let getSummarizeValueForColumn = function (column, row, rowIndex) {\n let abs = row[column.fieldName];\n\n //gets count of the rows\n let getSubRowCount = function () {\n let cnt = 0;\n row.sub.forEach(function (d) {\n if (d[column.fieldName] != null)\n cnt++;\n });\n return cnt;\n };\n\n if (row.sub && row.sub.length) {\n let totalValue = d3.sum(row.sub, function (d) { return d[column.fieldName]; });\n let subRowsCount = getSubRowCount();\n\n //switch expression\n switch (column.expression) {\n case 'count':\n abs = subRowsCount;\n case 'sum':\n abs = totalValue;\n break;\n case 'avg':\n {\n abs = totalValue / subRowsCount;\n }\n break;\n case 'min':\n abs = d3.min(row.sub, function (d) { return d[column.fieldName]; });\n break;\n case 'max':\n abs = d3.max(row.sub, function (d) { return d[column.fieldName]; });\n break;\n default:\n abs = totalValue;\n break;\n }\n }\n\n\n return abs;\n }\n\n let getCellContent = function (row, column, rowIndex, colIndex, depth) {\n //declare variables\n let html = '',\n cellID = that.container + '_row_' + rowIndex + '_col_' + colIndex + '_depth_' + depth,\n subs = row['sub'],\n bSub = '',\n actualColumnValue = row[column.fieldName],\n formattedColumnValue = formatCell(row[column.fieldName], column),\n cellStyle = 'width: ' + column.width + 'px; text-align: ' + column.labelPosition + '; ';\n\n if (that.type === \"pivot\" && column.direction === \"data\") {\n actualColumnValue = column.expression === \"avg\" ? +row[column.fieldName] : getSummarizeValueForColumn(column, row, rowIndex);\n formattedColumnValue = formatCell(actualColumnValue, column);\n }\n\n //check col index\n if (colIndex === that.columns.length - 1 && that._totalColWidth > container.width())\n cellStyle = 'width: ' + (column.width - 2) + 'px; text-align: ' + column.labelPosition + '; ';\n\n //set sub button\n if (colIndex === 0 && subs != null && that.behavior !== 'tabular')\n bSub = '<i class=\"pagos-grid-plus ' + that.container + '_subBtns_0 fa fa-plus\" rowindex=\"' + rowIndex + '\" colindex=\"' + colIndex + '\" depth=\"0\"></i>&nbsp;';\n\n //set html\n html += '<td id=\"' + cellID + '\" title=\"' + formattedColumnValue + '\" value=\"' + actualColumnValue + '\" class=\"pagos-grid-cell pagos-grid-row-vlines ' + that.container + '_rowCol_' + colIndex + '\"';\n\n //chek whether the first index\n if (rowIndex == 0)\n html += ' style=\"' + cellStyle + '\"';\n\n //cell clas\n var cellClass = that.container + '_rowCol_' + colIndex;\n\n //set gauge\n if (column.conditionalFormat.type !== 'bars')\n cellClass += ' pagos-grid-cell-padding';\n\n //create cell\n html += '><div id=\"' + cellID + '_div\" style=\"' + cellStyle + '\" class=\"' + cellClass + '\">';\n\n //set value if values are shown\n if (!column.hideValues) {\n html += bSub + formattedColumnValue;\n } else {\n html += bSub;\n }\n\n //closure for cell\n html += '</div></td>';\n\n //return generated cell content\n return html;\n };\n\n let getSubCellContent = function (row, column, rowIndex, colIndex, depth, baseDivID) {\n //declare needed variables\n let idStart = baseDivID.startsWith(\"#\") ? baseDivID.replace(\"#\", \"\") : baseDivID,\n cellID = idStart + '_row_' + rowIndex + '_col_' + colIndex + '_depth_' + depth,\n subs = row.sub,\n subID = idStart + '_row_' + rowIndex + '_sub',\n bSub = '',\n topBorder = '',\n cellStyle = 'width: ' + column.width + 'px; text-align: ' + column.labelPosition + '; ',\n actualColumnValue = row[column.fieldName],\n formattedColumnValue = formatCell(row[column.fieldName], column),\n html = '';\n\n if (that.type === \"pivot\" && column.direction === \"data\") {\n actualColumnValue = getSummarizeValueForColumn(column, row);\n formattedColumnValue = formatCell(actualColumnValue, column);\n }\n\n //check col index\n if (colIndex === that.columns.length - 1 && that._totalColWidth > container.width())\n cellStyle = 'width: ' + (column.width - 2) + 'px; text-align: ' + column.labelPosition + '; ';\n\n //check if row index === 0 then create a top border\n if (rowIndex === 0)\n topBorder = ' border-top: 1px solid #85b9f6; '\n\n //check if first col\n if (colIndex === 0 && subs != null)\n bSub = '<i class=\"pagos-grid-plus ' + that.container + '_subBtns_' + depth + '\" sid=\"' + subID + '\" rowindex=\"' + rowIndex + '\" colindex=\"' + colIndex + '\" depth=\"' + depth + '\"></i>&nbsp;';\n\n //set \n\n //create cell\n html += '<td id=\"' + cellID + '\" title=\"' + formattedColumnValue + '\" value=\"' + actualColumnValue + '\" class=\"pagos-grid-cell pagos-grid-row-vlines ' + that.container + '_rowCol_' + colIndex + '\" style=\"' + cellStyle + topBorder + '\">';\n\n //update cell style\n if (colIndex === 0)\n cellStyle += 'padding-left: ' + ((depth * 16) + 5) + 'px; padding-right: 5px';\n else\n cellStyle += 'padding-right: 5px';\n\n //cell clas\n var cellClass = that.container + '_rowCol_' + colIndex;\n\n //set gauge\n if (column.conditionalFormat.type !== 'bars')\n cellClass += ' pagos-grid-cell-padding';\n\n //set cell div\n html += '<div id=\"' + cellID + '_div\" style=\"' + cellStyle + '\" class=\"' + cellClass + '\">';\n\n //set value if values are shown\n if (!column.hideValues)\n html += bSub + formattedColumnValue;\n else\n html += bSub;\n\n //finalize html\n html += '</div></td>';\n\n //return generated cell content\n return html;\n };\n\n let formatCell = function (data, column) {\n //handle error\n if (data == null) return '';\n\n //declare variables\n let formattedValue = data,\n dateValue = null;\n\n //check column type\n if (column.columnType === 'datetime') {\n //declare default format\n let defaultFormat = column.labelFormat == '' ? '%x' : column.labelFormat;\n\n if (column.includeTime)\n defaultFormat += ' %X';\n\n formattedValue = e.formatDate(data, defaultFormat);\n } else if (column.columnType === 'numeric') {\n //create data\n formattedValue = e.formatNumber(data, column.labelFormat);\n }\n\n //handle formatted value's null values\n if (formattedValue == null || formattedValue == 'null' || formattedValue == 'nan' || formattedValue == 'NaN' || formattedValue == 'Nan' || formattedValue == NaN || formattedValue == Infinity || formattedValue == 'Infinity' || formattedValue == 'infinity')\n formattedValue = '';\n\n //return formatted value\n return formattedValue;\n };\n\n let setConditionalFormat = function (rows, depth, baseDivID) {\n //declare variables\n let cell = null,\n minMaxVals = null,\n min = 0,\n max = 0,\n ratio = 0,\n cellID = '',\n iterationColumns = null,\n value = 0,\n cond = null,\n negativeValues = {},\n positiveValues = {},\n minPositive = {}, maxPositive = {},\n minNegative = {}, maxNegative = {},\n dividerRatio = {};\n\n //clear gauges\n that._gauges.length = 0;\n\n //set min max values\n if (that.behavior === 'tabular') {\n //set columns\n iterationColumns = that.columns;\n } else {\n //arrayify iteration columns\n iterationColumns = [];\n\n //set iteration columns from rows\n getRows().forEach(function (r) {\n //push current row into the iteration columns\n iterationColumns.push(r);\n });\n\n //set iteration columns from measures\n getMeasures().forEach(function (r) {\n //push current measure into the iteration columns\n iterationColumns.push(r);\n });\n }\n\n //iterate all rows\n for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n //get current row\n let row = rows[rowIndex];\n\n //iterate all columns\n iterationColumns.forEach(function (column, colIndex) {\n //set condition\n cond = column.conditionalFormat;\n \n //check whether the condition is not empty\n if (cond && cond.type !== \"none\") {\n //get min max\n minMaxVals = getMinMaxValues(column.fieldName);\n min = minMaxVals.min;\n max = minMaxVals.max;\n\n //set min if null\n if (min == null || min == undefined)\n min = 0;\n\n //check whether the column has start from zero flag\n if (column.startFromZero != null && column.startFromZero === true)\n min = 0;\n\n //set min and max positives for the column\n minNegative[column.fieldName] = min < 0 ? min : 0;\n maxNegative[column.fieldName] = max >= 0 ? 0 : max;\n minPositive[column.fieldName] = min < 0 ? 0 : min;\n maxPositive[column.fieldName] = max >= 0 ? max : 0;\n\n //set cell id\n cellID = that.container + '_row_' + rowIndex + '_col_' + colIndex + '_depth_' + depth;\n\n //check if basedivid is not null\n if (baseDivID != null)\n cellID = baseDivID + '_row_' + rowIndex + '_col_' + colIndex + '_depth_' + depth;\n\n //set cell element\n if (cellID.startsWith(\"#\"))\n cell = $(cellID);\n else\n cell = $('#' + cellID);\n\n //get current value of cell\n value = parseFloat(cell.attr('value'));\n\n //set ratio\n if (min < 0) {\n ratio = ((Math.abs(value)) * 100) / (max);\n } else {\n ratio = ((Math.abs(value) - min) * 100) / (max - min);\n }\n\n //handle ratio instabilities\n if (ratio < 0) ratio = 0;\n if (ratio > 100) ratio = 100;\n if (isNaN(value)) ratio = 0;\n\n //switch condition type\n switch (cond.type) {\n case 'bars':\n {\n //declare bars variables\n let cellDiv = cell.children().first();\n let widthRange = max - min;\n let widthPercent = Math.abs(value) / widthRange * 100 - (min / widthRange * 100);\n let barWidth = column.width * widthPercent / 100;\n let cellDivHtml = '';\n let data = null;\n\n //clear cell content\n cell.css('padding', '0px 0px 0px 0px !important');\n cellDiv.css('padding', '0px 0px 0px 0px !important');\n cellDiv.css('height', '20px');\n cellDiv.css('position', 'relative');\n cellDiv.html('');\n\n //round percent\n widthPercent = Math.round(widthPercent);\n\n //do number formatting if exists\n if (column.labelFormat != '') {\n if (value == 0)\n value = '';\n else\n value = eve.formatNumber(value, column.labelFormat);\n }\n\n //set label data\n data = (isNaN(value) && column.labelFormat == '') ? '' : value;\n if (data.toString().indexOf('NaN') != -1)\n data = '';\n\n //set div html\n if (data === \"\") {\n cellDivHtml += '<div style=\"width:100%; height:20px; text-align: ' + column.labelPosition + '; position: absolute; top: 0; z-index:2; padding: 0;\" class=\"pagos-grid-cell-padding\">' + data + '</div>';\n } else {\n //if hide values flag is selected\n if (column.hideValues)\n data = '';\n\n //set div content\n cellDivHtml += '<div style=\"width:100%; height:20px; text-align: ' + column.labelPosition + '; position: absolute; padding: 0; top: 0; z-index:2;\" class=\"pagos-grid-cell-padding\">' + data + '</div>';\n\n //check whether the value is less than zero\n if (widthPercent != 0)\n cellDivHtml += '<div style=\"width:' + widthPercent + '%; height: 20px; text-align: ' + column.labelPosition + '; position: absolute; top: 0; background: ' + cond.startColor + '; padding: 0;\" class=\"pagos-grid-cell-padding\"></div>';\n\n cellDiv.html(cellDivHtml);\n }\n }\n break;\n case \"gradient\":\n {\n //declare gradient variables\n let gradient = e.gridGradient(cond.startColor, cond.endColor, ratio);\n\n //set cell value\n if (value == 0) {\n value = '';\n cell.html(value);\n }\n\n //set cell background color\n if (!isNaN(value)) {\n if (value != 0 || column.startFromZero) {\n cell.css('backgroundColor', gradient);\n }\n }\n }\n break;\n }\n \n }\n });\n }\n };\n\n let getMeasures = function () {\n //declare variables\n let measures = [];\n\n //iterate all cols\n that.columns.forEach(function (c) {\n //check behavior\n if (c.direction === 'data')\n measures.push(e.clone(c));\n });\n\n //return founded measures\n return measures;\n };\n\n let getRows = function () {\n //declare variables\n let rows = [];\n\n //iterate all cols\n that.columns.forEach(function (c) {\n //check behavior\n if (c.direction === 'row')\n rows.push(e.clone(c));\n });\n\n //return founded measures\n return rows;\n };\n\n let getColByName = function (name) {\n //declare needed variables\n let col = null;\n\n //iterate all columns\n that.columns.forEach(function (column) {\n //check if columnname matches with the given\n if (column.fieldName === name)\n col = column;\n });\n\n //return founded column\n return col;\n };\n\n let getSelectedRow = function () {\n return that._selectedRow;\n };\n\n let getColIndexByfieldName = function (fieldName) {\n //declare needed variables\n let index = -1;\n\n //iterate all columns to find index\n that.columns.forEach(function (c, i) {\n //check if current col field matches with the given\n if (c.fieldName === fieldName)\n index = i;\n });\n\n //return found index\n return index;\n };\n\n let getMinMaxValues = function (fieldName) {\n //declare needed variables\n let min = 0, max = 0;\n let rows = that._rows;\n\n //check whether the vis is grid\n if (that.behavior === \"tabular\") {\n //set min and max values\n min = parseFloat(that._minMaxValues[0][fieldName + \"_min\"]);\n max = parseFloat(that._minMaxValues[0][fieldName + \"_max\"]);\n\n //return calculated min and max\n return {\n min: min,\n max: max\n };\n }\n\n //check whether the pivot mode is classical\n if (that.pivotMode === 'classical') {\n //get row count\n let rowsArray = getRows(),\n rowNames = [];\n\n //iterate all rows\n rowsArray.forEach(function (r) {\n //push current row into the rownames\n rowNames.push(r.fieldName);\n });\n\n //iterate all rows to set max\n rows.forEach(function (row, index) {\n //check row index\n for (var key in row) {\n //check key\n if (rowNames.indexOf(key) == -1) {\n //check if current value bigger than max\n if (row[key] > max)\n max = parseFloat(row[key]);\n }\n }\n });\n\n //set min as max\n min = max;\n\n //iterate all rows to set min\n rows.forEach(function (row, index) {\n //check row index\n for (var key in row) {\n //check key\n if (rowNames.indexOf(key) == -1) {\n //check if current value bigger than max\n if (row[key] != null)\n if (row[key] < min)\n min = parseFloat(row[key]);\n }\n }\n });\n\n //return calculated min and max\n return {\n min: min,\n max: max\n };\n } else {\n //iterate all rows to set max\n rows.forEach(function (row, index) {\n //check whether the current cell is not null or undefined\n if (row[fieldName] != null && row[fieldName] != undefined && !isNaN(row[fieldName])) {\n //set max value\n if (row[fieldName] > max)\n max = parseFloat(row[fieldName]);\n }\n });\n\n //set min as max\n min = max;\n\n //iterate all rows to set min\n rows.forEach(function (row, index) {\n //check whether the current cell is not null or undefined\n if (row[fieldName] != null && row[fieldName] != undefined && !isNaN(row[fieldName])) {\n //set min value\n if (row[fieldName] < min)\n min = parseFloat(row[fieldName]);\n }\n });\n\n //return calculated min and max\n return {\n min: min,\n max: max\n };\n }\n };\n\n let getClassicalMinMaxValues = function (rows) {\n //declare needed variables\n let min = 0, max = 0;\n\n //iterate all rows\n rows.forEach(function (row, rowIndex) {\n //iterate all columns\n that.columns.forEach(function (column, colIndex) {\n //check whether the current column behavior is data\n if (column.direction === 'data') {\n //check whether the current cell value is not null or undefined\n if (row[column.fieldName] != null && row[column.fieldName] != undefined && !isNaN(row[column.fieldName])) {\n //check whether the max\n if (row[column.fieldName] > max)\n max = row[column.fieldName];\n }\n }\n });\n });\n\n //set mins\n min = max;\n\n //iterate all rows\n rows.forEach(function (row, rowIndex) {\n //iterate all columns\n that.columns.forEach(function (column, colIndex) {\n //check whether the current column behavior is data\n if (column.direction === 'data') {\n //check whether the current cell value is not null or undefined\n if (row[column.fieldName] != null && row[column.fieldName] != undefined && !isNaN(row[column.fieldName])) {\n //check whether the min\n if (row[column.fieldName] < min)\n min = row[column.fieldName];\n }\n }\n });\n });\n\n //return min max\n return {\n min: min,\n max: max\n };\n };\n\n let getSummarizeByColumn = function (colIndex) {\n //declare needed variables\n let col = that.columns[colIndex],\n valueArray = [],\n subRowsCount = 0,\n min = 0, max = 0, abs = 0, total = 0;\n\n //iterate all rows\n that._rows.forEach(function (row) {\n //get column value\n let currentValue = parseFloat(row[col.fieldName]);\n\n //check if current value is not nan\n if (!isNaN(currentValue)) {\n //push current value into stack\n valueArray.push(currentValue);\n\n //increase total value\n total += currentValue;\n }\n\n if (row[col.fieldName] != null)\n subRowsCount++;\n });\n\n //sort value array\n valueArray.sort();\n\n //switch expression\n switch (col.expression) {\n case 'count':\n abs = subRowsCount;\n case 'sum':\n abs = total;\n break;\n case 'avg':\n abs = total / subRowsCount;\n break;\n case 'min':\n abs = d3.min(valueArray);\n break;\n case 'max':\n abs = d3.max(valueArray);\n break;\n default:\n abs = total;\n break;\n }\n\n //return formatted value\n return formatCell(abs, col);\n };\n\n let getColIndexByID = function (colID) {\n //declare needed variables\n var index = -1;\n\n //iterate all columns to find index\n that.columns.forEach(function (c, i) {\n //check if current col field matches with the given\n if (c.fieldID === colID)\n index = i;\n });\n\n //return found index\n return index;\n };\n\n //attach update dataset\n this.update = function (data) {\n //handle errors\n if (data == null) return false;\n\n //declare variables\n var that = this; \n\n //switch grid behavior\n switch (that.behavior) {\n case 'tabular':\n bindGrid(data);\n break;\n case 'pivot':\n bindPivot(data);\n break;\n }\n\n //assign resizable to each cols\n $('.' + that.container + '_cols').each(function (index) {\n //attach resizable\n $(this).resizable({\n handles: 'e',\n resize: function (e, ui) {\n //declare needed variables\n var currentColField = $(this).attr('colid'),\n currentColIndex = getColIndexByID(currentColField);\n\n //update col size\n that.columns[currentColIndex].width = ui.size.width;\n\n //resize columns\n $('.' + that.container + '_rowCol_' + currentColIndex).css('width', ui.size.width + 'px');\n },\n stop: function (e, ui) {\n \n }\n });\n });\n };\n\n //check document ready\n $(document).ready(function () {\n //initialize grid\n initGrid();\n });\n }", "title": "" } ]
[ { "docid": "52056d0689414f518fcf33688752104b", "score": "0.7925451", "text": "function createGrid(){\n for (var j = 0; j < rows; j++) {\n for (var i = 0; i < cols; i++) {\n var cell = new Cell(i, j, w);\n cell = makeCellProperty(cell, j, i);\n grid.push(cell);\n }\n }\n }", "title": "" }, { "docid": "7d99aec89fb428a740e316433067ba75", "score": "0.78829706", "text": "function Grid() {}", "title": "" }, { "docid": "718dc8e66102c189292f708634399c00", "score": "0.7642126", "text": "function createGrid() {\n for (let i=0; i < layout.length; i++) {\n const square = document.createElement('div');\n grid.appendChild(square);\n squares.push(square);\n\n // add layout to the board\n if (layout[i] === 0) {\n squares[i].classList.add('pac-dot', 'dot');\n } else if (layout[i] === 1) {\n squares[i].classList.add('wall');\n } else if (layout[i] === 2) {\n squares[i].classList.add('ghost-lair')\n } else if (layout[i] === 3) {\n squares[i].classList.add('power-pellet');\n }\n }\n }", "title": "" }, { "docid": "f797501ad3ac0b322736bc14ebd11305", "score": "0.75573134", "text": "function Grid() {\n\t\tthis.rows = [];\n\t}", "title": "" }, { "docid": "7fbbb5e9154230a7da07160f8ddb5857", "score": "0.7507087", "text": "constructor() {\r\n this.grid = [];\r\n this.rows = 0;\r\n this.cols = 0;\r\n }", "title": "" }, { "docid": "a9168cc199b9e136c3a7aec208f22e0c", "score": "0.7500231", "text": "constructor() {\n this.grid = [];\n this.rows = 0;\n this.cols = 0;\n }", "title": "" }, { "docid": "da3d76d5d90ad961e9bb7836fdfb85c0", "score": "0.7483778", "text": "gridCreate() {\n const grid = [];\n for (let x = 0; x < this.sizeX; x++) {\n grid[x] = [];\n for (let y = 0; y < this.sizeY; y++) {\n grid[x][y] = 0;\n }\n }\n\n this.Grid = grid;\n }", "title": "" }, { "docid": "6086d8c8f6caea1c780a4db859175b2f", "score": "0.74627477", "text": "function createAbstractGridPanels (params) {\n\n\t /////////////////////////////////\n\t var x = params.x;\n \t var y = params.y;\n \t var height = params.height;\n \t var width = params.width;\n \t var AmountX = params.AmountX;\n \t var AmountY = params.AmountY;\n\n\t /////////////////////////////////\n\n\n\n\tvar i,j;\n var x1 = x;\n var y1 = y;\n var pm = 0;\n var all = 0;\n\n\t\tvar grid = new Array();\n\n\nfor (j=0;j < (AmountY) ;j++) {\n\n for (i=0;i < (AmountX) ;i++) {\n\n pm = ((width/AmountX)*i);\n\n x1 = (x+pm);\n y1 = (y+((height/AmountY)*j));\n\n grid[all] = {x1: x1, y1: y1};\n all++;\n\n }\n\n}\n\nreturn grid;\n\n}", "title": "" }, { "docid": "05317f987c81265d27f598a42263a4fd", "score": "0.74231374", "text": "function createAbstractGrid (params) {\n\n\t//params: x,y,height,width,AmountX,AmountY\n\n\tvar x = params.x;\n\tvar y = params.y;\n\tvar height = params.height;\n\tvar width = params.width;\n\tvar AmountX = params.AmountX;\n\tvar AmountY = params.AmountY;\n\n\tvar i,j;\n\tvar x1 = x;\n\tvar y1 = y;\n\tvar x2;\n\tvar y2;\n\tvar pm = 0;\n\tvar all = 0;\n\tvar offset = 0;\n\tvar border = 0;\n\n\tvar grid = new Array();\n\n for (i=0;i <= (AmountX) ;i++) {\n\n\t pm = ((width/AmountX)*i);\n\t x1 = (x+pm);\n\t y1 = y;\n\n\t\t\t\t\tx2 = x1;\n\t y2 = (y+height);\n\n\t\t\t\t\tgrid[all] = {x1: x1, y1: y1, x2: x2, y2: y2};\n\t all++;\n\n }\n\n\t for (j=0;j <= (AmountY) ;j++) {\n\n pm = ((height/AmountY)*j);\n\t\t\t\t x1 = x;\n\t\t\t\t y1 = (y+pm);\n\n\t\t\t\t x2 = (x+width);\n\t\t\t\t y2 = y1;\n\n\t\t grid[all] = {x1: x1, y1: y1, x2: x2, y2: y2};\n\t\t all++;\n\n\t }\n\nreturn grid;\n\n}", "title": "" }, { "docid": "45816b78609a50d984637c200cfb1f58", "score": "0.74115014", "text": "create_grid() {\n let table = document.createElement('table');\n this._cells = [];\n\n for (var i = 0; i < this._rows; i++) {\n let line = document.createElement('tr');\n this._cells[i] = [];\n for (let j = 0; j < this._columns; j++) {\n let cell = new Cell();\n\n line.appendChild(cell.element);\n this._cells[i][j] = cell;\n }\n table.appendChild(line);\n }\n\n this._table.appendChild(table);\n }", "title": "" }, { "docid": "e0bf509968b35c584459a39859f62b56", "score": "0.7372793", "text": "createGrid() {\n let gridRow;\n let gridRowVisited;\n // let totalRows = this.#width / this.#cellSize;\n // let totalCols = this.#height / this.#cellSize;\n for (let row = 0; row < this.#height; row++) {\n gridRow = [];\n gridRowVisited = [];\n for (let col = 0; col < this.#width; col++) {\n gridRow[col] = new Cell(this.#cellSize, row, col);\n gridRowVisited[col] = false;\n }\n this.#girdArray[row] = gridRow;\n this.#visited[row] = gridRowVisited;\n }\n\n // Mark the initial cell top-left cell as visited\n this.#visited[0][0] = true;\n\n this.#girdArray[0][0].setIsVisited();\n\n // Add the top left cell to the stack\n // so that the stack won't be empty.\n this.#stack.pushData(this.#girdArray[0][0]);\n }", "title": "" }, { "docid": "45fe0d359823e4e4e6d12ea23992babe", "score": "0.73622036", "text": "createGrid(gamegrid) {\r\n this.dotCount = 0;\r\n this.grid = [];\r\n this.DOMGrid.innerHTML = \"\";\r\n // First set correct amount of columns based on Grid Size and the size of each cell is based on Cell Size\r\n this.DOMGrid.style.cssText = `grid-template-columns: repeat(${GRID_SIZE}, ${CELL_SIZE}px);`;\r\n\r\n //loop through the gaemboard array, and create each element in the array\r\n gamegrid.forEach((square) => {\r\n const div = document.createElement(\"div\");\r\n\r\n //check value of current element and match it to classlist to get what object it's supposed to be\r\n div.classList.add(\"square\", CLASS_LIST[square]);\r\n div.style.cssText = `width: ${CELL_SIZE}px; height: ${CELL_SIZE}px;`;\r\n this.DOMGrid.appendChild(div);\r\n this.grid.push(div);\r\n\r\n // Add dots, keep track of the number of dots\r\n if (CLASS_LIST[square] === OBJECT_TYPE.DOT) this.dotCount++;\r\n });\r\n }", "title": "" }, { "docid": "07c69556055950d62ceefd3040bfa5dc", "score": "0.735816", "text": "function createAbstractGridNodes (params) {\n\n\t /////////////////////////////////\n\n\t var x = params.x;\n \t var y = params.y;\n \t var height = params.height;\n \t var width = params.width;\n \t var AmountX = params.AmountX;\n \t var AmountY = params.AmountY;\n\n\t /////////////////////////////////\n\n\n\n\t\tvar i,j;\n var x1 = x;\n var y1 = y;\n var pm = 0;\n var all = 0;\n var offset = 0;\n var border = 0;\n\n\t\tvar grid = new Array();\n\nfor (j=offset;j <= (AmountY+border) ;j++) {\n\n for (i=offset;i <= (AmountX+border) ;i++) {\n\n pm = ((width/AmountX)*i);\n x1 = (x+pm);\n y1 = (y+((height/AmountY)*j));\n\n grid[all] = {x1: x1, y1: y1};\n all++;\n\n }\n\n}\n\nreturn grid;\n\n}", "title": "" }, { "docid": "8091f17361b095431ef130009689f0c1", "score": "0.73541343", "text": "createGrid(){\n\t\tconst grid = [];\n\n\t\tfor(let i = 0; i < this.size; i++){\n\t\t\tconst row = [];\n\n\t\t\tfor(let j = 0; j < this.size; j++){\n\t\t\t\trow.push(new Cell());\n\t\t\t}\n\t\t\tgrid.push(row);\n\t\t}\n\n\t\treturn grid;\n\t}", "title": "" }, { "docid": "863f92287063873feed1120b8abed647", "score": "0.7339761", "text": "initialize(grid){}", "title": "" }, { "docid": "28521b80f1f9e3f9d8dd201c4ca63e66", "score": "0.73147345", "text": "function Grid() {\n}", "title": "" }, { "docid": "2a05be37a29690108f8fbd4508737212", "score": "0.72700906", "text": "function Grid() { \n this.BLOCK_SCALER = 0.045; //percent of height a block should be\n \n this.position_x = 10;\n this.position_y = 10;\n \n this.BORDER_WIDTH = 3;\n \n this.gridData = this.generateEmptyGrid();\n}", "title": "" }, { "docid": "567fd81b5db131c0fa77957db55cff4a", "score": "0.7221458", "text": "GridStyle(total_x, total_y, w, h, srcImage_Path)\n {\n\n if(!(this.grid instanceof Array))\n {\n this.grid = [];\n }\n\n function GridUnit(x, y, w, h, srcImage_Path){\n\n var size = new Gamelab.Vector(w, h),\n position = new Gamelab.Vector(x, y);\n\n var sprite;\n\n if(srcImage_Path)\n {\n sprite = new Gamelab.Sprite(srcImage_Path);\n sprite.Size(size);\n sprite.Pos(position);\n\n Gamelab.game_windows[0].add(sprite);\n }\n\n return {\n size:size,\n position:position\n };\n };\n\n for(var y = 0; y < total_y; y++)\n {\n\n for(var x = 0; x < total_x; x++)\n {\n\n this.grid.push(new GridUnit(x * w, y * h, w, h, srcImage_Path));\n\n }\n\n }\n return this;\n }", "title": "" }, { "docid": "1219affe9a5655510324920fd381ef1b", "score": "0.721846", "text": "function createGrid (params) {\n\n\n\t var el = params.el;\n\t\tvar layer = params.layer;\n\t\tvar transform = params.transform;\n\t\tvar x = params.x;\n \tvar y = params.y;\n\t\tvar height = params.height;\n\t\tvar width = params.width;\n\t\tvar AmountX = params.AmountX;\n\t\tvar AmountY = params.AmountY;\n\t\tvar style = params.style;\n\n\n\n\t\tparams = {x:x,y:y,height:height,width:width,AmountX:AmountX,AmountY:AmountY};\n\t var AbstractGrid =createAbstractGrid(params);\n\n\n\t\tvar grid = el.g({layer:layer, transform:transform});\n\n\n for (i=0; i<AbstractGrid.length;i++) {\n\n params = {layer: grid.id, x1 : AbstractGrid[i].x1, y1: AbstractGrid[i].y1, x2: AbstractGrid[i].x2, y2:AbstractGrid[i].y2, style: style};\n el.line(params);\n\n\t}\n\n return grid;\n}", "title": "" }, { "docid": "882e76b3f7b22a49c108c26e3d66e0bb", "score": "0.7201928", "text": "function newGrid() {\n\tfor (var i = 0; i < 16; i++) {\n\t\t\n\t\t$(\".grid-container\").append( \"<div class=\" + \"grid-row-\" + i + \"></div>\");\n\n\t\tfor (var j = 0; j < 32; j++) {\n\t\t\t$(\".grid-row-\" + i).append(\"<div class=grid-elem></div>\");\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4c4868b04bcf190f4adbbdaae4e86c35", "score": "0.716425", "text": "function grid(top,left){ //,width,height\n this.top = top;\n this.left = left;\n //Store in board since width and height is same for all grids.\n //Dont store width height here.\n // this.w = width;\n // this.h = height;\n }", "title": "" }, { "docid": "c3fa41e869aef62980055f4913331c27", "score": "0.71577024", "text": "function createGrid() {\n\t\tfor(var i = 1; i < Math.pow(rAndC, 2); i++) {\n\t\t\tvar box = document.createElement(\"div\");\n\t\t\tbox.className = \"box\";\n\t\t\tdocument.getElementById(\"puzzlearea\").appendChild(box);\t\n\t\t}\n\t\tstyleBoxes();\n\t}", "title": "" }, { "docid": "d2fdb36c89c79c1ab935dd7f6b441a16", "score": "0.71308196", "text": "function makeGrid(rows, cols) {\n container.style.setProperty('--grid-rows', rows);\n container.style.setProperty('--grid-cols', cols);\n for(i=0; i < rows*cols; i++) {\n let item = document.createElement(\"div\");\n container.appendChild(item).className = \"grid-item\";\n }\n}", "title": "" }, { "docid": "2c7d3a83078013e9b3906414ab7d096c", "score": "0.70996404", "text": "gridSetup() {\n this.grid = [];\n this.temp = [];\n //create canvas at appropriate size\n this.canvas.width = (this.width - 2) * this.cellSize;\n this.canvas.height = (this.height - 2) * this.cellSize;\n this.ctx.fillStyle = \"black\";\n this.ctx.fillRect(0, 0, 3000, 3000);\n //instantiate spaces in arrays\n for (let y = 0; y < this.height; y++) {\n this.grid[y] = [[]];\n this.temp[y] = [[]];\n for (let x = 0; x < this.width; x++) {\n //fill with random values\n this.grid[y][x] = [Math.round(Math.random()), 0];\n this.temp[y][x] = [0, 0];\n //create border\n if (x == 0 || y == 0 || x == this.width - 1 || y == this.height - 1) {\n this.grid[y][x] = 0;\n }\n }\n }\n }", "title": "" }, { "docid": "18f05ca2733ae1c50efaee666b0d9251", "score": "0.70886385", "text": "createGrid() {\n // loop to create the 8 rows\n for (let row = 0; row < 8; row++) {\n this.grid[row] = [];\n // push in 8 columns of nulls\n for (let column = 0; column < 8; column++) {\n this.grid[row].push(null);\n }\n }\n }", "title": "" }, { "docid": "18f05ca2733ae1c50efaee666b0d9251", "score": "0.70886385", "text": "createGrid() {\n // loop to create the 8 rows\n for (let row = 0; row < 8; row++) {\n this.grid[row] = [];\n // push in 8 columns of nulls\n for (let column = 0; column < 8; column++) {\n this.grid[row].push(null);\n }\n }\n }", "title": "" }, { "docid": "2bcf46a1d1099f1058390f9f2a23a015", "score": "0.70827866", "text": "function createGrids(){\n var no_keys = 8;\n var title = [\"RGB-audio-peak-visualiser\",\"whatmovie-php\",\"xor_openvpn_bash\",\"mouseshiver\",\"CSGO_SIMPLE_EXTERNAL\",\"photoorganiser\",\"ticket-collector\",\"whatmovie-js\"]\n var description = [\"A C++/C# application that loopbacks the playback output to create a visualiser with RGB strips.\",\"Original movie reccomendation generator written in PHP using themoviedb API.\",\"Creates a OXR OpenVPN server on Linux.\",\"Moves the mouse according to the microphone input level.\",\"External Code for Counter-Strike: Global Offensive.\",\"Organises a mass of photos into corresponding files.\",\"Bot to get tickets automatically.\",\"Old website ported and removed redundent dependencies. \"]\n var language = [\"Python\",\"PHP\",\"Bash\",\"C++/Python\",\"C++\",\"Python\",\"JS\",\"JS\"]\n\n // Rows\n row_iter = 0\n for(x = 0; x < (no_keys - no_keys % 4)/4; x++){\n // Columns\n for(col=1; col < 5; col++){\n generateBlock(\"column\"+col.toString(), title[row_iter], description[row_iter] , language[row_iter]);\n row_iter +=1\n }\n }\n}", "title": "" }, { "docid": "52b6f293050ba018bc43e1092d9a0166", "score": "0.7078038", "text": "function gridCreation() {\n $('.wrapper').append('<div class=\"neon-wrapper\"><div class=\"neon-text\">2048</div></div>');\n $('.wrapper').after('<div class=\"score\">Score : ' + '<span id=\"newScore\">' + score + '</span>' + '</div>');\n for (var rows = 0; rows < 4; rows++) {\n for (var columns = 0; columns < 4; columns++) {\n $('#container').append('<div class=\"grid\" id=\"' + rows + columns + '\"></div>');\n };\n };\n }", "title": "" }, { "docid": "9eaceb82ad861585db07ea46be57d841", "score": "0.7072934", "text": "function buildGrid(width, height, id, columnClassName, cellClassName) {\n const grid = document.createElement('div');\n // Create number of columns based upon \"width\":\n for (let i = 0; i < width; i++) {\n const column = document.createElement('div');\n column.className = columnClassName;\n // Create number of cells based upon \"height\":\n for (let j = 0; j < height; j++) {\n const cell = document.createElement('div');\n cell.className = cellClassName;\n cell.style.background = 'rgb(255, 255, 255)'; // All cells start white\n // Apply data attributes only to \"canvas\" grid (used in applying fill):\n if (id === 'canvas') {\n addCellAttributes(cell, i, j);\n }\n column.appendChild(cell);\n }\n grid.appendChild(column);\n }\n grid.id = id;\n return grid;\n }", "title": "" }, { "docid": "1a77ba9f2b35916bda19486c5f9f00a2", "score": "0.7065965", "text": "function createGrid() {\n for (let y = cellSize; y < canvas.height; y += cellSize) {\n for (let x = 0; x < canvas.width; x += cellSize) {\n grid.push(new Cell(x, y)) //create new cell\n }\n }\n}", "title": "" }, { "docid": "d96a740e7d7adfdd0272af0d7ed36d48", "score": "0.7060533", "text": "function initialGrid(){\n for (var i = 0; i < 256; i++) {\n let cell = document.createElement('div');\n cell.setAttribute(\"id\", i);\n cell.setAttribute(\"class\", \"cell\")\n container.appendChild(cell);\n }\n }", "title": "" }, { "docid": "093e30a6d10937854191d31c96acd774", "score": "0.705077", "text": "function Grid() {\n this.cells = new Array(9);\n}", "title": "" }, { "docid": "34983d118adc8809dd0fb77e1f7c1541", "score": "0.70377487", "text": "initialise_grid(element) {\n const [width, height] = [document.body.offsetWidth, document.body.offsetHeight];\n this.grid = new DOM.Canvas(null, width, height, { class: \"grid\" });\n element.add(this.grid);\n this.update_grid();\n }", "title": "" }, { "docid": "7cd1593d69b95dcef65f7d1c51b7c4cb", "score": "0.7027327", "text": "function createGrid(gridSize){\n createRow(gridSize);\n createCells(gridSize);\n}", "title": "" }, { "docid": "f05ec71adb491b2aea82963113353909", "score": "0.70269346", "text": "function makeGrid() {\n\n for (var h = 0; h < height; h++) {\n let row = canvas.insertRow(h);\n\n for (var w = 0; w < width; w++) {\n let cell = row.insertCell(w);\n }\n }\n\n } //End of makeGrid function", "title": "" }, { "docid": "c884e7a2edd3b1aa3c28b1ba8d84884f", "score": "0.7026639", "text": "loadGrid(){\r\n for(var i = 0; i < this.cols; i++){ // columns of rows\r\n this.grid[i] = [];\r\n for(var j = 0; j < this.rows; j++){\r\n this.grid[i][j] = new Cell(this, vector2d((i*this.w), (j*this.w)), ++cellId);\r\n\r\n }\r\n }\r\n\r\n }", "title": "" }, { "docid": "678f329cc418005407995e31cbd7087a", "score": "0.7022549", "text": "function gridMaker(row,col){\n \n //set css variable for grid rows and grid col\n gridContainer.style.setProperty('--grid-rows',row);\n gridContainer.style.setProperty('--grid-cols',col); \n //loop for number of cells in grid\n console.log(row)\n console.log(col)\n for(let i = 0;i < (row*col);i++){\n //create a cell div for the grid\n const cell = document.createElement('div');\n //add textcontent to div\n // cell.textContent = 'x';\n //append div to gridContainer with classs\n gridContainer.appendChild(cell).className = \"grid-item\";\n }\n \n}", "title": "" }, { "docid": "fdb078f74b643a155862751953ebe015", "score": "0.70214385", "text": "function makeGrid() {\n // Set Canvas size as N by M grid\n let gridHeight = INPUT_HEIGHT.val();\n let gridWidth = INPUT_WIDTH.val();\n\n /* Max value = 50(for higher values) */\n if (gridHeight > 40) {\n gridHeight = 40;\n }\n\n if (gridWidth > 40) {\n gridWidth = 40;\n }\n\n // Clear the canvas\n CANVAS.empty();\n\n //Make rows (1 row per height)\n for (let lines = 0; lines < gridHeight; lines++) {\n const line = $(\"<tr></tr>\");\n CANVAS.append(line);\n\n //Make columns (1 column in each row)\n for (let columns = 0; columns < gridWidth; columns++) {\n line.append(\"<td></td>\");\n }\n }\n }", "title": "" }, { "docid": "478a4180a02ba661d0774e3fd9fe0828", "score": "0.7020364", "text": "function GridClass(width, height, name, args){\n\tvar self = this;\n\tthis.add_bound_properties(this, ['get_target', 'mask', 'add_control', 'controls', 'receive', 'get_button', 'reset', 'clear_buttons', 'sub_grid', 'clear_translations', 'button_coords']);\n\t//lcl_debug('making GridClass:', width, height, name, args, this._bound_properties);\n\t//this._bound_properties = ['receive'];\n\tvar contents = [];\n\tfor(var i = 0; i < width; i++){\n\t\tcontents[i] = [];\n\t\tfor(var j = 0; j < height; j++){\n\t\t\tcontents[i][j] = undefined;\n\t\t}\n\t}\n\tthis._grid = contents;\n\tthis.width = function(){return width;}\n\tthis.height = function(){return height;}\n\tthis.size = function(){return width * height;}\n\tGridClass.super_.call(this, name, args);\n}", "title": "" }, { "docid": "97b1780cd04243754609fd9aedefa919", "score": "0.7015143", "text": "function Grid() {\n\tthis.grid = createArray(GRID_SIZE);\n\tfor (var i = 0; i < GRID_SIZE; i++){\n\t\tif (i == 0) {\n\t\t\tthis.grid[i] = TOP_LABEL;\n\t\t\tcontinue;\n\t\t}\n\t\tfor (var j = 0; j < GRID_SIZE; j++){\n\t\t\tif (j == 0){\n\t\t\t\tthis.grid[i][j] = SIDE_LABEL[i];\n\t\t\t} else {\n\t\t\tthis.grid[i][j] = EMPTY_SPACE;\n\t\t\t}\n\t\t}\n\t}\n\treturn this.grid;\n}", "title": "" }, { "docid": "a8fbddedc49450760e00e944708f586e", "score": "0.7000697", "text": "function makeGrid(width,height) {\n\tmakeRows(height);\n\tfillRows(width);\n\tstyleBorder();\n}", "title": "" }, { "docid": "c56dd5a43e75aec0b8136d176fa1a141", "score": "0.69821644", "text": "createGrid() {\n // loop to create the 8 rows\n for (let row = 0; row < 8; row++) {\n this.grid[row] = [];\n // push in 8 columns of nulls\n for (let column = 0; column < 8; column++) {\n this.grid[row].push(null);\n } \n }\n }", "title": "" }, { "docid": "00a1c059f5fa689db6d28cf6146400e8", "score": "0.6963781", "text": "function Grid() {\n $.jqplot.ElemContainer.call(this);\n // Group: Properties\n \n // prop: drawGridlines\n // whether to draw the gridlines on the plot.\n this.drawGridlines = true;\n // prop: gridLineColor\n // color of the grid lines.\n this.gridLineColor = '#cccccc';\n // prop: gridLineWidth\n // width of the grid lines.\n this.gridLineWidth = 1.0;\n // prop: background\n // css spec for the background color.\n this.background = '#fffdf6';\n // prop: borderColor\n // css spec for the color of the grid border.\n this.borderColor = '#999999';\n // prop: borderWidth\n // width of the border in pixels.\n this.borderWidth = 2.0;\n // prop: drawBorder\n // True to draw border around grid.\n this.drawBorder = true;\n // prop: shadow\n // whether to show a shadow behind the grid.\n this.shadow = true;\n // prop: shadowAngle\n // shadow angle in degrees\n this.shadowAngle = 45;\n // prop: shadowOffset\n // Offset of each shadow stroke from the border in pixels\n this.shadowOffset = 1.5;\n // prop: shadowWidth\n // width of the stoke for the shadow\n this.shadowWidth = 3;\n // prop: shadowDepth\n // Number of times shadow is stroked, each stroke offset shadowOffset from the last.\n this.shadowDepth = 3;\n // prop: shadowColor\n // an optional css color spec for the shadow in 'rgba(n, n, n, n)' form\n this.shadowColor = null;\n // prop: shadowAlpha\n // Alpha channel transparency of shadow. 0 = transparent.\n this.shadowAlpha = '0.07';\n this._left;\n this._top;\n this._right;\n this._bottom;\n this._width;\n this._height;\n this._axes = [];\n // prop: renderer\n // Instance of a renderer which will actually render the grid,\n // see <$.jqplot.CanvasGridRenderer>.\n this.renderer = $.jqplot.CanvasGridRenderer;\n // prop: rendererOptions\n // Options to pass on to the renderer,\n // see <$.jqplot.CanvasGridRenderer>.\n this.rendererOptions = {};\n this._offsets = {top:null, bottom:null, left:null, right:null};\n }", "title": "" }, { "docid": "0dc852e9526190ceb5b621e98f6fafaa", "score": "0.6947224", "text": "function Grid() {\n\n /* two-dimensional dynamic grid */\n this._grid = [[]];\n /* always point to the last line of the grid */\n this._x = 0;\n /* completed elements count of current line */\n this._y = 0;\n\n /* default handler */\n this._handler = function (element, next) {\n if (Arsenal.isFunction(element)) { element(); }\n if (Arsenal.isFunction(next)) { next(); }\n };\n\n }", "title": "" }, { "docid": "1b0ace8b0ee1fd21a2fe666adb18427b", "score": "0.6945931", "text": "constructor() {\n this.grid = null;\n }", "title": "" }, { "docid": "2d845457e36b9c5e40324f7f3716fc00", "score": "0.6934508", "text": "function createGrid(num) {\n\tfor (var i = 1; i <= num; i++) {\n\t\t// creates each individual grid square\n\t\tfor (var j = 1; j <= num; j++) {\n\t\t\t$('#container').append('<div class=\"grid\"></div>');\n\t\t}\n\t\t// creates each new row\n\t\t$('#container').append('<div class=\"newRow\"></div>');\n\t}\n\n\t// sets the grid width and height based on the number of grids fit in\n\t// the grid's container\n\tsquare = (totalLength / num) -2;\n\t$('#container > .grid').css({\"width\": square,\n\t\t\t\t\t\t\t\t\"height\": square});\n}", "title": "" }, { "docid": "5a2ae3a2360ad95b140ed956aa8b6107", "score": "0.692754", "text": "function makeGrid(a) {\n\tgetRidGrid();\n\tmakeRows(a);\n\tmakeColumns(a);\n}", "title": "" }, { "docid": "263b504950f80007a88cb72df20464bd", "score": "0.69260645", "text": "function createGrid() {\n for (let y = globals.blockSize; y < canvas.height; y += globals.blockSize) {\n for (let x = 0; x < canvas.width; x += globals.blockSize) {\n grid.push(new Block(x, y));\n }\n }\n}", "title": "" }, { "docid": "8523a199c02e53e008d4f137355a7efd", "score": "0.69212663", "text": "createDataStructure() {\n this.grid = new Array(this.size.width);\n\n for (let w = 0; w < this.size.width; ++w) {\n this.grid[w] = new Array(this.size.height).fill(false);\n }\n\n this.registerStep();\n }", "title": "" }, { "docid": "3c6ca47ab7be891617800bc90c94005c", "score": "0.6910542", "text": "function initialization() {\n cols = floor(width / w)\n rows = floor(height / w)\n\n for (let j = 0; j < rows; j++) {\n for (let i = 0; i < cols; i++) {\n let cell = new Cell(i, j)\n grid.push(cell)\n }\n }\n current = grid[0]\n}", "title": "" }, { "docid": "1f4a228f97e19b2e4cf8f2e2ea13de36", "score": "0.6905521", "text": "constructor( columns,rows ){\n\t\tthis.grid = [];\n\t\tthis.columns = columns;\n\t\tthis.rows = rows;\n\t\tthis.minMatch = 3;\n\t\tthis.init();\n\n\n\t}", "title": "" }, { "docid": "6cc3e5822997103f8ec16ae295701b6b", "score": "0.69006443", "text": "function createGrid() {\n for(let row = 0; row < num_rows; row++) {\n nodes[row] = [];\n for(let col = 0; col < num_cols; col++) {\n nodes[row][col] = {\n x: col *(rectWidth + 1),\n y: row * (rectHeight + 1),\n state: STATE.EMPTY,\n prevState: STATE.EMPTY // used for when the start/end nodes are being moved\n };\n }\n }\n nodes[startNode.row][startNode.col].state = STATE.START;\n nodes[finishNode.row][finishNode.col].state = STATE.FINISH;\n}", "title": "" }, { "docid": "f07d3414748d8d0366a978b61daa7f85", "score": "0.6898993", "text": "function createGrid(gridTemplate) {\n clearContainer();\n createDivs(gridTemplate);\n addGridTemplate(gridTemplate[1]);\n drawing();\n}", "title": "" }, { "docid": "22854613512cb6659efbda6b67ba55fa", "score": "0.68909115", "text": "function createGrid(){\n var rows = 11;\n var columns = 11;\n var $row = $(\"<div />\", {\n class: 'row'\n });\n var $square = $(\"<div />\", {\n class: 'square'\n });\n\n var letras = [\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\"];\n var numeros = [];\n\n for (var i = 1; i < 11; i++) {\n numeros.push(i);\n }\n\n var tablero = [];\n\n //add columns to the the temp row object\n for (var i = 0; i < columns; i++) {\n var currentRow = $row.clone();\n if(i > 0){\n tablero.push([]);\n }\n\n $('#shipPlace').append(currentRow);\n for (var j = 0; j < rows; j++) {\n var currentSquare = $square.clone().attr(\"id\", letras[j-1]+(i));\n currentRow.append(currentSquare);\n if(i > 0 && j > 0){\n tablero[i-1].push(currentSquare);\n }\n if(i === 0 || j === 0){\n currentSquare.addClass(\"vacio\");\n }\n if(i === 0 && j > 0){\n currentSquare.text(letras[j-1]);\n }\n if(i > 0 && j === 0){\n currentSquare.text(numeros[i-1]);\n }\n }\n }\n}", "title": "" }, { "docid": "9769d54db59dbd3a681eb40ca662b62a", "score": "0.6885528", "text": "function Grid( _num_items_horiz, _num_items_vert, _grid_w, _grid_h, _startx, _starty ) {\n\n if ( _num_items_horiz == undefined ) _num_items_horiz = 1;\n if ( _num_items_vert == undefined ) _num_items_vert = 1;\n var _horiz = _num_items_horiz || 1;\n var _vert = _num_items_vert || 1;\n this.length = 0;\n this.spacing_x;\n this.spacing_y;\n this.c = rgb( 200 );\n this.num_items_horiz = 0;\n this.num_items_vert = 0;\n\n this.start = {\n x: _startx || 0,\n y: _starty || 0\n };\n\n this.grid_w = this.w = _grid_w || w;\n this.grid_h = this.h = _grid_h || h;\n\n this.width = _grid_w || w;\n this.height = _grid_h || h;\n this.centre = {\n x: this.start.x + this.width / 2,\n y: this.start.y + this.height / 2\n }\n this.grid = [];\n this.edge = [];\n this.x = [];\n this.y = [];\n this.rows = [];\n this.cols = [];\n this.pos = [];\n\n this.add = function ( _horiz, _vert ) {\n\n this.num_items_horiz += _horiz || 1;\n this.num_items_vert += _vert || 1;\n\n this.spacing_x = this.width / this.num_items_horiz;\n this.spacing_y = this.height / this.num_items_vert;\n this.spacing = new Vector( this.spacing_x, this.spacing_y );\n this.createGrid();\n\n return this;\n\n }\n\n\n this.setStart = function ( _x, _y ) {\n\n this.start = {\n x: _x || 0,\n y: _y || 0\n };\n createGrid();\n\n }\n\n this.createGrid = function () {\n var r = 0;\n this.spacing_x = this.width / this.num_items_horiz;\n this.spacing_y = this.height / this.num_items_vert;\n this.spacing = new Vector( this.spacing_x, this.spacing_y );\n // console.log(this.start.x);\n // console.log(this.width);\n this.cols = [];\n\n for ( var y = 0; y < this.num_items_vert; y++ ) {\n\n var c = 0;\n var row = [];\n //this.cols[y] = [];\n var yy = y * this.spacing_y + this.spacing_y / 2 + this.start.y;\n\n\n for ( var x = 0; x < this.num_items_horiz; x++ ) {\n\n var edge = false;\n var xx = x * this.spacing_x + this.spacing_x / 2 + this.start.x;\n\n //console.log(this.start.y);\n // see if it's a point on the outside\n if ( ( y == this.start.y || y == this.num_items_vert ) && ( x == this.start.x || x == this.num_items_horiz ) ) {\n edge = true;\n }\n\n this.x.push( xx );\n this.y.push( yy );\n this.pos.push( {\n row: r,\n col: c,\n x: xx,\n y: yy\n } );\n row.push( {\n x: xx,\n y: yy\n } );\n\n this.edge.push( edge );\n this.grid.push( {\n row: y,\n col: x,\n x: xx,\n y: yy,\n edge: edge,\n c: this.c,\n r: 255,\n g: 255,\n b: 255\n } );\n c++;\n\n }\n\n this.cols[ x ] = {\n col: x,\n x: xx,\n y: yy,\n };\n this.rows[ r ] = {\n row: r,\n items: this.num_items_horiz,\n pos: row\n };\n r++;\n //console.log(row);\n };\n //console.log(this.rows);\n this.length = this.num_items_vert * this.num_items_horiz;\n this.grid.push( {\n row: this.rows,\n col: this.cols\n } );\n\n }\n\n this.add( _horiz, _vert );\n\n //console.log(this);\n return this;\n\n}", "title": "" }, { "docid": "33767016a92e1af18559ff5a8b074f79", "score": "0.68836576", "text": "generate() {\n let generator = new Generator(this);\n this.grid = generator.generate();\n }", "title": "" }, { "docid": "55c3285cb1b725793f0bd1cc45ae2aff", "score": "0.68817014", "text": "static createGameBoard(DOMGrid, gamegrid) {\r\n //creating the empty gameboard using the previously defined constructor\r\n const board = new this(DOMGrid);\r\n\r\n //populate gameboard with the hardcoded array passed in from basics\r\n\r\n board.createGrid(gamegrid);\r\n return board;\r\n }", "title": "" }, { "docid": "42873e16e4f82bf44735d6f1d59a1e03", "score": "0.6879884", "text": "function grid(rows, cols) {\n\tthis.rows = rows;\n\tthis.cols = cols;\n\tthis.cells = [];\n\tfor (i = 0; i < rows; i++) {\n\t\tthis.cells[i] = {};\n\t\tfor (j = 0; j < cols; j++) {\n\t\t\tthis.cells[i][j] = 0;\n\t\t}\n\t}\n\t\n\tthis.set = function(xpos, ypos, object_id) {\n\t\tthis.cells[xpos][ypos] = object_id;\n\t};\n}", "title": "" }, { "docid": "ff7a872032a500dcbc75eb955d11883b", "score": "0.68780506", "text": "function createGrid() {\n // varaibles related to game logic\n const grid = [];\n document.documentElement.style.setProperty(\"--rows\", ROWS);\n document.documentElement.style.setProperty(\"--cols\", COLS);\n\n Array(ROWS)\n .fill(0)\n .forEach((_, rowIndex) => {\n const row = document.createElement(\"div\");\n row.classList.add(\"flex\");\n grid.push([]);\n\n Array(COLS)\n .fill(0)\n .forEach((_, colIndex) => {\n const cell = new Cell(rowIndex, colIndex);\n // adding cell to DOM\n cell.create(row);\n grid[rowIndex].push(cell);\n });\n\n outerBox.appendChild(row);\n });\n\n return grid;\n}", "title": "" }, { "docid": "29262a185e962a09b27b56c8f6e3454b", "score": "0.6868702", "text": "function Grid(width, height) {\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}", "title": "" }, { "docid": "1917df1f4934bc75dae878542eef359e", "score": "0.6866311", "text": "function Grid(xSize, ySize) {\n this.xSize = xSize;\n this.ySize = ySize;\n this.grd = createArray(xSize, ySize);\n}", "title": "" }, { "docid": "c6622701e2745ff293118babb3fcc07c", "score": "0.6866287", "text": "function defaultGrid() {\n createGrid(16);\n}", "title": "" }, { "docid": "86a2e635c16b04e283b80c77a072a6a2", "score": "0.68593735", "text": "function _makeGrid () {\n //initialize an 8 x 8 array \n\n var myGrid = [...Array(8)].map(e => Array(8)); \n\n //place the pieces down \n //like arr[space - 1][space - 1] = new Piece(with the the color)\n\n myGrid[3][3] = new Piece('white');\n myGrid[4][4] = new Piece('white');\n myGrid[3][4] = new Piece('black');\n myGrid[4][3] = new Piece('black');\n\n return myGrid; \n}", "title": "" }, { "docid": "671fad44014dba0e94c092b72b9ab663", "score": "0.6850482", "text": "function buildGrid(root) {\n for (let i = 0; i < 10; i++) {\n for (let j = 0; j < 10; j++) {\n let cell = $('<div>').addClass('cell');\n cell.attr('data-row', i).attr('data-col', j);\n // cells.push(cell);\n root.append(cell);\n }\n }\n }", "title": "" }, { "docid": "f38e23b6e2b21b7ce3d38290c7724a50", "score": "0.6847373", "text": "function makeGrid() {\n let noOfRows = height.val();\n let noOfCols = width.val();\n canvas.find('tbody').remove()\n canvas.append('<tbody></tbody>')\n let table = canvas.find('tbody');\n for (let i = 0; i < noOfRows; i++) {\n table.append('<tr></tr>')\n }\n for (let i = 0; i < noOfCols; i++) {\n canvas.find('tr').append('<td class=\"background\"></td>');\n }\n }", "title": "" }, { "docid": "db0a1f3868f8d14e28e91d93cfa5374f", "score": "0.684587", "text": "function defaultGrid() {\n makeRows(16);\n makeColumns(16);\n}", "title": "" }, { "docid": "e8d4bf201ab39bb1217ddf61235533db", "score": "0.68457836", "text": "function buildGrid(vars) {\n vars = vars || {};\n var container = document.createElement(\"div\"),\n rows = vars.grid[0] || 5,\n cols = vars.grid[1] || 5,\n width = vars.width || 100,\n gutter = vars.gutter || 1,\n className = vars.className || \"\",\n w = (width - cols * gutter) / cols,\n parent = (typeof (vars.parent) === \"string\") ? document.querySelector(vars.parent) : vars.parent ? vars.parent : document.body,\n css = \"display: inline-block; margin: 0 \" + (gutter / width * 100) + \"% \" + (gutter / width * 100) + \"% 0; width: \" + (w / width * 100) + \"%;\",\n l = rows * cols,\n i, box;\n for (i = 0; i < l; i++) {\n box = document.createElement(\"div\");\n box.style.cssText = css;\n box.setAttribute(\"class\", className);\n box.index = i;\n box.setAttribute(\"data-index\", i);\n if (vars.onCellClick) {\n box.addEventListener(\"click\", vars.onCellClick);\n }\n container.appendChild(box);\n }\n container.style.cssText = \"width:\" + width + \"px; line-height: 0; padding:\" + gutter + \"px 0 0 \" + gutter + \"px; display:inline-block;\";\n parent.appendChild(container);\n return container;\n}", "title": "" }, { "docid": "ccf1e1140fc4617d5723099175ac447a", "score": "0.6840106", "text": "function newGrid(){\n unsketch();\n removeOldSquares();\n resetGridTemplate();\n howManySquares();\n setGridRow();\n setGridColumn();\n createGrid();\n addEventListeners();\n}", "title": "" }, { "docid": "5402192c91455666f79bd6704884d8ea", "score": "0.68360233", "text": "initGrid() {\r\n let gridContainer = document.getElementById(\"grid-container\");\r\n let tableRoot = document.createElement(\"table\");\r\n tableRoot.id = \"grid-table\";\r\n\r\n for (let i = 0; i < this.numberOfRows; i++) {\r\n let tableRow = document.createElement(\"tr\");\r\n this.cellModelMatrix[i] = new Array(this.numberOfCols);\r\n this.tableCellMatrix[i] = new Array(this.numberOfCols);\r\n\r\n for (let j = 0; j < this.numberOfCols; j++) {\r\n // Draw table cell\r\n let tableCell = document.createElement(\"td\");\r\n tableRow.appendChild(tableCell);\r\n\r\n let cellView = new CellView(tableCell);\r\n let cellModel = new CellModel(i, j, cellView);\r\n this.cellModelMatrix[i][j] = cellModel;\r\n this.tableCellMatrix[i][j] = tableCell;\r\n }\r\n\r\n tableRoot.appendChild(tableRow);\r\n }\r\n\r\n gridContainer.appendChild(tableRoot);\r\n }", "title": "" }, { "docid": "c9bae3abae3be5829f83ad442613cf0d", "score": "0.68275607", "text": "function makeGrid() {\n\n // Your code goes here!\n \n }", "title": "" }, { "docid": "405e5ba076fe58ded20e4a607d3053b3", "score": "0.68270236", "text": "function drawGrid () {\n var gridHTML = '';\n for (var key in grids) {\n gridHTML += '<div id=\"' + key + '\" class=\"grid ' +grids[key].type+ '\" style=\"top:' +grids[key].top+ 'px; left:' +grids[key].left+ 'px; width:' +small_tile_size+ 'px; height:' +small_tile_size+ 'px;\">' +key+ '</div>';\n }\n $('.tiles-container').append(gridHTML);\n }", "title": "" }, { "docid": "89b653f8033d24ea07799e90f207ee51", "score": "0.6826665", "text": "function createGrid() {\n\t\t\n\t\t// Clear rows & blocks inside the grid\n\t\tgrid.innerHTML = '';\n\t\t\n\t\t// Remove these classes in case the previous game had been won or lost\n\t\t$('#grid').removeClass(\"won lost\");\n\t\trunning = true;\n\n\t\t// For height rows and width columns: create a block object, create an HTML block,\n\t\t// and give the block object a reference to its HTML block.\n\t\tfor (let i = 0; i < height; i++) {\n\t\t\tlet row = document.createElement('div');\n\t\t\trow.classList.add('row');\n\t\t\t$('#grid').append(row);\n\t\t\tfor (let j = 0; j < width; j++) {\n\t\t\t\t\tlet block = document.createElement(\"div\");\n\t\t\t\t\tblock.classList.add('block');\n\t\t\t\t\trow.append(block);\n\t\t\t\t\tblockList.push(new Block(i, j, block));\n\t\t\t}\n\t\t}\n\n\t\t\n\t\t\n\t\t$('.block').click(function(e) {\n\t\t\tlet row = $(this).parent().index();\n\t\t\tlet column = $(this).index();\n\t\t\tlet block = getBlock(row, column);\n\t\t\t\n\t\t\t// Left-clicking uncovers the block.\n\t\t\tif (!e.shiftKey){\n\t\t\t\tblock.click(false);\n\t\t\t\t\n\t\t\t// Shift-clicking flags the block.\n\t\t\t} else {\n\t\t\t\tblock.rightClick(false);\n\t\t\t}\n\t\t});\n\n\t\t// Right-clicking flags the block.\n\t\t$('.block').contextmenu(function() {\n\t\t\tlet row = $(this).parent().index();\n\t\t\tlet column = $(this).index();\n\t\t\tgetBlock(row, column).rightClick(false);\n\t\t});\n\t}", "title": "" }, { "docid": "0d43a2e9c1a4e112cc1b54b924dea82c", "score": "0.68176556", "text": "function createGrid(x, y) {\n // Setting the CSS variables\n document.documentElement.style.setProperty('--numCol', x);\n document.documentElement.style.setProperty('--numRow', y);\n let board = document.createElement('div')\n board.setAttribute('id', 'wrapper')\n bodyDoc.appendChild(board);\n\n for (let i = 0; i < (x * y); i++) {\n newDiv = document.createElement('div');\n newDiv.classList.add('block');\n newDiv.setAttribute('id', (i + 1));\n board.appendChild(newDiv);\n }\n\n createCleanButton();\n}", "title": "" }, { "docid": "886f05e577dd169e0276611b32301bc6", "score": "0.6811965", "text": "function grid() {\n //loop for grid\n for(let i = 0; i < 256; i++) {\n let item = document.createElement('div')\n item.classList.add('gridItem')\n item.style.border = '1px solid white';\n \n // add to the container\n gridContainer.appendChild(item);\n }\n}", "title": "" }, { "docid": "f0574f3e4cd8ba2d091f8ee14f0811b2", "score": "0.68106735", "text": "function grid(sizeX,sizeY)\r\n{\r\n this.caseSizeX = WIDTH/sizeX;\r\n this.caseSizeY = HEIGHT/sizeY;\r\n this.ID = 0;\r\n this.caseGrid = new Array();\r\n for(var i =0;i<sizeX;i++)\r\n this.caseGrid[i] = new Array();\r\n for(var i = 0;i<sizeX;i++)\r\n {\r\n for(var j=0;j<sizeY;j++)\r\n {\r\n this.caseGrid[i][j] = new gridCase(i*this.caseSizeX,j*this.caseSizeY,this.caseSizeX,this.caseSizeY,\"DEAD\");\r\n }\r\n }\r\n this.size = new Object();\r\n this.sizeX =sizeX;\r\n this.sizeY = sizeY;\r\n}", "title": "" }, { "docid": "6b77fef295728f25962ffea126969fa3", "score": "0.6809633", "text": "function Grid(width, height) {\n this.space = new Array(width * height); // area of the grid as an array. Note how the grid is translated from a two dimensional string (as shown above in the plan array) to an array of one dimension. \n this.width = width;\n this.height = height;\n}", "title": "" }, { "docid": "57f3e92bf318e346a96a1ad70c5e5b05", "score": "0.67984366", "text": "function intializeGrids() {\n let worldrow = this.worldSize.row;\n for (let row = 0; row < worldrow; row++) {\n let worldcol = this.worldSize.col;\n let matrix = [];\n matrix[row] = [];\n for (let col = 0; col < worldcol; col++) {\n matrix[row][col] = document.createElement(\"div\");\n matrix[row][col].style[\"grid-area\"] = `${row + 1} / ${col + 1} / ${\n row + 2\n } / ${col + 1}`;\n matrix[row][col].setAttribute(\"data-row\", row + 1);\n matrix[row][col].setAttribute(\"data-col\", col + 1);\n matrix[row][col].classList.add(\"tile\");\n if (row < 13) {\n matrix[row][col].classList.add(this.comp.main);\n } else if (row < 14) {\n matrix[row][col].classList.add(this.comp.element4.el);\n } else {\n matrix[row][col].classList.add(this.comp.element1.el);\n }\n this.gameWorld.appendChild(matrix[row][col]);\n }\n }\n}", "title": "" }, { "docid": "eb5a27a82e70cafe33c57e538240ba5e", "score": "0.6798139", "text": "function Grid(cellList) {\n this.cellList = cellList;\n}", "title": "" }, { "docid": "5345cec1985ee21a45bf23370b378684", "score": "0.67942667", "text": "function defaultGrid() {\n makeRows(100);\n makeColumns(50);\n}", "title": "" }, { "docid": "07e806a4f43f71984e819c4d0b9d8c7a", "score": "0.67900527", "text": "initCells() {\n for (let rowIdx = 0; rowIdx < this.degree * this.degree; rowIdx++) {\n let row = this.table.insertRow();\n this.grid.push([]);\n for (let colIdx = 0; colIdx < this.degree * this.degree; colIdx++) {\n let cell = row.insertCell();\n this.grid[rowIdx].push(cell);\n cell.classList.add(\"sudoku-cell\");\n\n // add sudoku-top, sudoku-bottom, sudoku-left, sudoku-right CSS classes\n function setEdgeClasses(idx, degree, firstSuffix, lastSuffix) {\n if (idx % degree === 0)\n cell.classList.add(\"sudoku-\" + firstSuffix);\n else if (idx % degree === degree - 1)\n cell.classList.add(\"sudoku-\" + lastSuffix);\n }\n setEdgeClasses(rowIdx, this.degree, \"top\", \"bottom\");\n setEdgeClasses(colIdx, this.degree, \"left\", \"right\");\n }\n }\n }", "title": "" }, { "docid": "e151e1d34d3d1d34e76ed7ca5675262c", "score": "0.67888397", "text": "_createGrid (type, cols, rows) {\n\t\tlet grid = [],\n\t\t\ttile;\n\t\tfor (let i = 0; i < cols; i++) {\n\t\t\tlet row = [];\n\t\t\tfor (let j = 0; j < rows; j++) {\n\t\t\t\tlet random = Math.random();\n\t\t\t\t// Creates border around map\n\t\t\t\t// i controls height and j controls width; below set to 8 because glitch if set to 7\n\t\t\t\tif (i < 7 || j < 7 || i > this.state.mapSize - 8 || j > this.state.mapSize - 7) {\n\t\t\t\t\ttile = 'R';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// Adjust to generate random obstacles for testing\n\t\t\t\t\t// Randomly generate grass or rock on tile\n\t\t\t\t\t//tile = random > 0.4 ? '_' : 'R';\n\t\t\t\t\ttile = 'R'\n\t\t\t\t}\n\t\t\t\trow.push(tile)\n\t\t\t}\n\t\t\tgrid.push(row);\n\t\t}\n\t\treturn grid\n\t}", "title": "" }, { "docid": "061b4ac84617c38705fccc2a8dd7415d", "score": "0.67844236", "text": "__buildGrid() {\n var grid = [];\n var colSpans = [];\n var rowSpans = [];\n\n var maxRowIndex = -1;\n var maxColIndex = -1;\n\n var children = this._getLayoutChildren();\n\n for (var i = 0, l = children.length; i < l; i++) {\n var child = children[i];\n var props = child.getLayoutProperties();\n\n var row = props.row;\n var column = props.column;\n\n props.colSpan = props.colSpan || 1;\n props.rowSpan = props.rowSpan || 1;\n\n // validate arguments\n if (row == null || column == null) {\n throw new Error(\n \"The layout properties 'row' and 'column' of the child widget '\" +\n child +\n \"' must be defined!\"\n );\n }\n\n if (grid[row] && grid[row][column]) {\n throw new Error(\n \"Cannot add widget '\" +\n child +\n \"'!. \" +\n \"There is already a widget '\" +\n grid[row][column] +\n \"' in this cell (\" +\n row +\n \", \" +\n column +\n \") for '\" +\n this +\n \"'\"\n );\n }\n\n for (var x = column; x < column + props.colSpan; x++) {\n for (var y = row; y < row + props.rowSpan; y++) {\n if (grid[y] == undefined) {\n grid[y] = [];\n }\n\n grid[y][x] = child;\n\n maxColIndex = Math.max(maxColIndex, x);\n maxRowIndex = Math.max(maxRowIndex, y);\n }\n }\n\n if (props.rowSpan > 1) {\n rowSpans.push(child);\n }\n\n if (props.colSpan > 1) {\n colSpans.push(child);\n }\n }\n\n // make sure all columns are defined so that accessing the grid using\n // this.__grid[column][row] will never raise an exception\n for (var y = 0; y <= maxRowIndex; y++) {\n if (grid[y] == undefined) {\n grid[y] = [];\n }\n }\n\n this.__grid = grid;\n\n this.__colSpans = colSpans;\n this.__rowSpans = rowSpans;\n\n this.__maxRowIndex = maxRowIndex;\n this.__maxColIndex = maxColIndex;\n\n this.__rowHeights = null;\n this.__colWidths = null;\n\n // Clear invalidation marker\n delete this._invalidChildrenCache;\n }", "title": "" }, { "docid": "aa6f5d0fde46a70451b30fbed94188a4", "score": "0.674396", "text": "function GridRenderer()\n{\n\tthis.pInstance = null;\n}", "title": "" }, { "docid": "0bf5031ab8a3d564cc3443bd55e1442b", "score": "0.672891", "text": "generate_grid_css() {\n let gutter = '3';\n\n jss.set(`.${this.row_class}`, {\n width: '98%'\n });\n jss.set(`.${this.row_class}:after`, {\n clear: 'both'\n });\n jss.set(`.${this.row_class}:before, .${this.row_class}:after`, {\n display: 'table',\n 'line-height': '0',\n 'content': '\"\"'\n });\n\n jss.set(`.${this.column_class}`, {\n 'display': 'block',\n 'float': 'left',\n 'width': '100%',\n 'min-height': '30px',\n 'box-sizing': 'border-box'\n });\n\n let margin_space = (this.n_columns - 1) * gutter;\n let computable_space = 100 - margin_space;\n let minimun_column_width = computable_space / this.n_columns;\n\n for (let i = 1; i <= this.n_columns; i++) {\n let column_width = minimun_column_width * i;\n let margin_width = gutter * (i - 1);\n\n jss.set(`[data-column-size=\"${i}\"]`, {\n 'width': column_width + margin_width + '%',\n 'margin-left': gutter + '%'\n });\n }\n\n jss.set(`.${this.column_class}:nth-of-type(1)`, {\n 'margin-left': '0'\n });\n }", "title": "" }, { "docid": "32f4079d83fcdd64810b3cbc3daff589", "score": "0.6726885", "text": "function createGrid(gridSize) {\n etchScreen.style.gridTemplateColumns = `repeat(${gridSize}, 1fr)`;\n etchScreen.style.gridTemplateRows = `repeat(${gridSize}, 1fr)`;\n for (let i = 0; i < gridSize * gridSize; i++){\n let cell = document.createElement(\"div\");\n cell.classList.add('cell');\n etchScreen.appendChild(cell);\n }\n\n let grid = document.querySelectorAll('.cell');\n grid.forEach ((cell) => {\n cell.addEventListener('mouseover', (e) => {\n cell.classList.add('active');\n }); \n });\n}", "title": "" }, { "docid": "1a9710b215f54badc0eb8de8d71788d0", "score": "0.6724433", "text": "function _crearGrid(fila, columna){\n\n const newGridLayout = new GridLayout();\n newGridLayout.columns = pageData.getColOp; \n newGridLayout.row=fila;\n newGridLayout.col=columna;\n\n return newGridLayout;\n}", "title": "" }, { "docid": "b5d0f946dc1ed56b79361e2ff7a1a304", "score": "0.6723441", "text": "function Grid(width,height){\n\tthis.width=width;\n\tthis.height=height;\n\tthis.nodes=this.makenodes(width,height);\n\tthis.hillweight=12;\n\tthis.valleyweight=1;\n\tthis.normal=5;\n}", "title": "" }, { "docid": "08e82c952aaaed4ec3340505a04d491b", "score": "0.6721336", "text": "function initGrid(gridColumns = 16, gridRows = 16,\n containerWidth = 100, containerHeight = 100) {\n const gridContainer = document.querySelector(\"#grid-container\");\n gridContainer.style.gridTemplateColumns = `repeat(${gridColumns}, ${containerWidth/gridColumns}px)`;\n gridContainer.style.gridTemplateRows = `repeat(${gridRows}, ${containerHeight/gridRows}px)`;\n for (let i = 0; i < gridRows; ++i) {\n for (let j = 0; j < gridColumns; ++j) {\n const newGrid = document.createElement(\"div\");\n newGrid.classList.add(\"grid\");\n newGrid.style.width = `${containerWidth/gridColumns}px`;\n newGrid.style.height = `${containerHeight/gridRows}px`;\n newGrid.style.backgroundColor = \"#FFFFFF\";\n newGrid.addEventListener(\"mouseover\", fillGrid);\n newGrid.id = `grid${j}-${i}`;\n gridContainer.appendChild(newGrid);\n }\n }\n}", "title": "" }, { "docid": "4eccef2bfae702d755adb117ab7e205f", "score": "0.67155963", "text": "function Grid(width, height, boundsWidth, boundsHeight, widthStep, heightStep) {\n\n\tthis.width = width * parseInt(widthStep);\n\tthis.height = height * parseInt(heightStep);\n\tthis.boundsWidth = boundsWidth * parseInt(widthStep);\n\tthis.boundsHeight = boundsHeight * parseInt(heightStep);\n\tthis.widthStep = widthStep;\n\tthis.heightStep = heightStep;\n\tthis.cells = [];\n\tthis.container = $('#grid');\n\tthis.parentContainer = $('#boundsForGrid');\n\tthis.cellSelected = false;\n this.acceptKeyPress = false\n\tthis.init();\n}", "title": "" }, { "docid": "d95552b02ef2097ab138b0bd4ccbba64", "score": "0.6701398", "text": "function createGrid(array) {\n array.forEach(obj => createTile(obj));\n document.getElementById('dino-compare').style.display = 'none';\n document.getElementById('grid').style.display = 'flex';\n }", "title": "" }, { "docid": "14d4fd18902704505249bd609d3388ee", "score": "0.66956353", "text": "function Grid(width, height) {\n this.space = new Array(width * height);\n this.width = width;\n this.height = height;\n}", "title": "" }, { "docid": "9153ed0610ec5710725e3c3d47cc667d", "score": "0.66943413", "text": "function makeGrid() {\n CANVAS.find('tbody').remove();\n\n // \"submit\" the size form to update the grid size\n let gridRows = heightInput.val();\n let gridCol = widthInput.val();\n\n // set tbody to the table\n CANVAS.append('<tbody></tbody>');\n\n let canvasBody = CANVAS.find('tbody');\n\n // draw grid row\n for (let i = 0; i < gridRows; i++) {\n canvasBody.append('<tr></tr>');\n }\n\n // draw grid col\n for (let i = 0; i < gridCol; i++) {\n CANVAS.find('tr').append('<td class=\"transparent\"></td>');\n }\n\n }", "title": "" }, { "docid": "d5ea0614c42f44136a75b56ea5080c67", "score": "0.66924417", "text": "function createGrid(rows, columns) {\n gridContainer.style.setProperty(\"--grid-rows\", rows);\n gridContainer.style.setProperty(\"--grid-columns\", columns);\n\n for (let i = 0; i < rows * columns; i++) {\n let cell = document.createElement(\"div\");\n cell.className = \"grid-cell\";\n gridContainer.appendChild(cell);\n }\n}", "title": "" }, { "docid": "69f8efaefa5475275f4cb00d293a7858", "score": "0.6688942", "text": "function createGrid() {\n\t\tvar positions = [],\n\t\t\ti,\n\t\t\tj;\n\t\t\n\t\t// Go through each row.\n\t\tfor ( i = 0; i < 8; i++ ) {\n\t\t\t// Go through each button in row.\n\t\t\tfor ( j = 0; j < 8; j++ ) {\n\t\t\t\tpositions.push( i * 16 + j );\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Return positions.\n\t\treturn positions;\n\t}", "title": "" }, { "docid": "949fb1214e4eaa7de280ccef4b1cc31c", "score": "0.6683842", "text": "function createGameGrid() {\n for (let y = CELL_SIZE.height + 10; y <= 6 * CELL_SIZE.height; y += CELL_SIZE.height) {\n for (let x = 3 * CELL_SIZE.width; x <= 11 * CELL_SIZE.width; x += CELL_SIZE.width) {\n gameGrid.push(new Cell(x, y))\n }\n }\n}", "title": "" }, { "docid": "efe1566abad1d6940109c300e8ef9a4e", "score": "0.66798645", "text": "generateGrid() {\n let board = document.getElementsByClassName(\"board\")[0];\n let totalCells = this.gridSize * this.gridSize;\n for (let i = 0; i < totalCells; i++) {\n console.log(i, \"I\");\n let tile = document.createElement(\"div\");\n tile.className = \"tile\";\n console.log(tile, \"TILE\");\n board.appendChild(tile);\n }\n }", "title": "" }, { "docid": "f30b862633583e5bf35f2c8811b7ae66", "score": "0.6670902", "text": "function createGrid(gridSize = 20){\n initializeSlider(gridSize);\n sketchContainer.setAttribute('style',`grid-template-columns: repeat(${gridSize}, 1fr);, grid-template-rows: repeat(${gridSize}, 1fr);` )\n appendPixels(gridSize);\n}", "title": "" }, { "docid": "d838cf7b03e017c1472e21a21cb12219", "score": "0.6663743", "text": "function buildGrid(size) {\r\n for (let i = 0; i < size ** 2; i++) {\r\n let square = document.createElement('div');\r\n square.className = \"square\";\r\n GRID.appendChild(square);\r\n }\r\n enableGrid()\r\n}", "title": "" }, { "docid": "24a1996cd11ed29cce9bb2aa1ec40708", "score": "0.66600376", "text": "function createGrid(num) {\n var gridNum = num\n var divNodeSize = 320 / num;\n \n //Removes any .div-wrapper from the page\n $(\".div-wrapper\").each(function() {\n $(this).remove();\n });\n \n //Adds a .div-wrapper then loops through adding num .div-wrapper(s) every num .div-node(s)\n $(\"#div-grid\").append(\"<div class = 'div-wrapper' </div>\");\n for (var i = 0; i < gridNum; i++) {\n for (var j = 0; j < gridNum; j++) {\n $(\".div-wrapper\").last().append(\"<div class = 'div-node' </div>\");\n }\n $(\"#div-grid\").append(\"<div class = 'div-wrapper' </div>\");\n }\n \n //CSS styling ensures the #div-grid size remains constant and the .div-nodes are square\n $(\".div-node\").css(\"height\", divNodeSize);\n $(\".div-node\").css(\"width\", divNodeSize);\n $(\".div-node\").css(\"background-color\", backgroundOrigin);\n \n colorStay();\n}", "title": "" }, { "docid": "cecbad5cbe5942017e28089a89fa64df", "score": "0.6656861", "text": "function createBoard () {\n for (let i = 0; i < layout.length; i++) {\n const square = document.createElement ('div')\n grid.appendChild(square)\n squares.push(square)\n\n // add layout to the board\n\n if(layout[i] === 1) {\n squares[i].classList.add('wall')\n } else if (layout[i] === 2) {\n squares[i].classList.add('ghost-lair')\n } else if (layout[i]=== 3) {\n squares[i].classList.add('power-pellet')\n } else if (layout[i] === 4) {\n squares[i].classList.add('pac-dot')\n }\n }\n}", "title": "" }, { "docid": "bfbcc88cf2de50eac2caea46b48675fc", "score": "0.66353303", "text": "function createNewGrid(size){\n container.setAttribute(\n \"style\", `display: grid; background-color: white; grid-template-columns: repeat(${newGridSize}, 1fr); grid-template-rows: repeat(${newGridSize}, 1fr); width: 75vmin;\n height: 75vmin;`);\n for (var i = 0; i < (`${newGridSize}` * `${newGridSize}`); i++) {\n let cell = document.createElement('div');\n cell.setAttribute(\"id\", i);\n cell.setAttribute(\"class\", \"cell\")\n container.appendChild(cell);\n }\n }", "title": "" } ]
cd40fba3b398a94f9d8cd86d381a995e
A lot faster than stringify/parse
[ { "docid": "41541930bdf25afb14c392749adb7c07", "score": "0.0", "text": "function cloneBounds(bounds /*: Bounds*/) /*: Bounds*/ {\n return {\n left: bounds.left,\n top: bounds.top,\n right: bounds.right,\n bottom: bounds.bottom\n };\n}", "title": "" } ]
[ { "docid": "a377fdb4ac27e03b22388b7c4db145c6", "score": "0.61210936", "text": "function stringify() {\n return parser.stringify();\n }", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.5834731", "text": "serialize() {}", "title": "" }, { "docid": "eee5d156e67b52b26d5863e9e69f2ada", "score": "0.5787522", "text": "function stringify(data) {\n\t\tif(JSON)\n\t\t\treturn(JSON.stringify(data));\n\t\telse {\n\t\t\t//Throw exception\n\t\t\t//TODO: Is there any other solution for non JSON? caniuse say there is a 96.58% coverage for JSON parsing...\n\t\t\tthrowEx('No JSON support.');\n\t\t\treturn(data);\t\t\t\t\n\t\t}\n\t}", "title": "" }, { "docid": "5f637ddd60af67cf2b9040391237570d", "score": "0.57447946", "text": "function serialize(o) {\n var p = 0, sb = [], ht = [], hv = 1;\n var classname = function(o) {\n if (typeof(o) == \"undefined\" || typeof(o.constructor) == \"undefined\") return '';\n var c = o.constructor.toString();\n c = utf16to8(c.substr(0, c.indexOf('(')).replace(/(^\\s*function\\s*)|(\\s*$)/ig, ''));\n return ((c == '') ? 'Object' : c);\n };\n var is_int = function(n) {\n var s = n.toString(), l = s.length;\n if (l > 11) return false;\n for (var i = (s.charAt(0) == '-') ? 1 : 0; i < l; i++) {\n switch (s.charAt(i)) {\n case '0':\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9': break;\n default : return false;\n }\n }\n return !(n < -2147483648 || n > 2147483647);\n };\n var in_ht = function(o) {\n for (k in ht) if (ht[k] === o) return k;\n return false;\n };\n var ser_null = function() {\n sb[p++] = 'N;';\n };\n var ser_boolean = function(b) {\n sb[p++] = (b ? 'b:1;' : 'b:0;');\n };\n var ser_integer = function(i) {\n sb[p++] = 'i:' + i + ';';\n };\n var ser_double = function(d) {\n if (isNaN(d)) d = 'NAN';\n else if (d == Number.POSITIVE_INFINITY) d = 'INF';\n else if (d == Number.NEGATIVE_INFINITY) d = '-INF';\n sb[p++] = 'd:' + d + ';';\n };\n var ser_string = function(s) {\n var utf8 = utf16to8(s);\n sb[p++] = 's:' + utf8.length + ':\"';\n sb[p++] = utf8;\n sb[p++] = '\";';\n };\n var ser_array = function(a) {\n sb[p++] = 'a:';\n var lp = p;\n sb[p++] = 0;\n sb[p++] = ':{';\n for (var k in a) {\n if (typeof(a[k]) != 'function') {\n is_int(k) ? ser_integer(k) : ser_string(k);\n __serialize(a[k]);\n sb[lp]++;\n }\n }\n sb[p++] = '}';\n };\n var ser_object = function(o) {\n var cn = classname(o);\n if (cn == '') ser_null();\n else if (typeof(o.serialize) != 'function') {\n sb[p++] = 'O:' + cn.length + ':\"';\n sb[p++] = cn;\n sb[p++] = '\":';\n var lp = p;\n sb[p++] = 0;\n sb[p++] = ':{';\n if (typeof(o.__sleep) == 'function') {\n var a = o.__sleep();\n for (var kk in a) {\n ser_string(a[kk]);\n __serialize(o[a[kk]]);\n sb[lp]++;\n }\n }\n else {\n for (var k in o) {\n if (typeof(o[k]) != 'function') {\n ser_string(k);\n __serialize(o[k]);\n sb[lp]++;\n }\n }\n }\n sb[p++] = '}';\n }\n else {\n var cs = o.serialize();\n sb[p++] = 'C:' + cn.length + ':\"';\n sb[p++] = cn;\n sb[p++] = '\":' + cs.length + ':{';\n sb[p++] = cs;\n sb[p++] = \"}\";\n }\n };\n var ser_pointref = function(R) {\n sb[p++] = \"R:\" + R + \";\";\n };\n var ser_ref = function(r) {\n sb[p++] = \"r:\" + r + \";\";\n };\n var __serialize = function(o) {\n if (o == null || o.constructor == Function) {\n hv++;\n ser_null();\n }\n else switch (o.constructor) {\n case Boolean: {\n hv++;\n ser_boolean(o);\n break;\n }\n case Number: {\n hv++;\n is_int(o) ? ser_integer(o) : ser_double(o);\n break;\n }\n case String: {\n hv++;\n ser_string(o);\n break;\n }\n/*@cc_on @*/\n/*@if (@_jscript)\n case VBArray: {\n o = o.toArray();\n }\n@end @*/\n case Array: {\n var r = in_ht(o);\n if (r) {\n ser_pointref(r);\n }\n else {\n ht[hv++] = o;\n ser_array(o);\n }\n break;\n }\n default: {\n var r = in_ht(o);\n if (r) {\n hv++;\n ser_ref(r);\n }\n else {\n ht[hv++] = o;\n ser_object(o);\n }\n break;\n }\n }\n };\n __serialize(o);\n return sb.join('');\n}", "title": "" }, { "docid": "2fa09b02a98402beffbb47d1f8ff97ce", "score": "0.5707002", "text": "function compareParse() {\n\n\tparseableStrings.forEach(function(test) {\n\tconsole.log(test);\n console.log(\"parseJSON = \" + parseJSON(test)); \n \n console.log(\"JSON.parse = \" + JSON.parse(test));\n\n console.log(\"stringified parseJSON = \" + JSON.stringify(parseJSON(test)));\n console.log(\"stringified JSON.parse = \" + JSON.stringify(JSON.parse(test)));\n\n console.log(\"=======================================\");\n });\n\n}", "title": "" }, { "docid": "482416b96898c2bd085576c17fd6952e", "score": "0.5667786", "text": "static stringParseEncodedObject(serializedObject,scope={},name='scope'){if(serializedObject.endsWith('.json')&&Tools.isFileSync(serializedObject))serializedObject=fileSystem.readFileSync(serializedObject,{encoding:'utf-8'});if(!serializedObject.startsWith('{'))serializedObject=eval('Buffer').from(serializedObject,'base64').toString('utf8');let result;try{result=new Function(name,`return ${serializedObject}`)(scope)}catch(error){}if(typeof result==='object')return result;return null}", "title": "" }, { "docid": "0304f5550677505366a922aaf93f208a", "score": "0.5634791", "text": "function test(){ /** JSON.stringify() and large integers */\r\n\tvar obj={\"largest non-double\":2147483647, \"smallest non-double\": -2147483648, \"the time - a double\":1278339272556}\r\n\tobj[16777215]='#ffffff in decimal, now as property name';\r\n\tvar str=JSON.stringify(obj);\r\n\tvar passed = str.indexOf( '16777215' ) >-1 &&\r\n\t\tstr.indexOf( '2147483647' ) >-1 &&\r\n\t\tstr.indexOf( '-2147483648' ) >-1 &&\r\n\t\tstr.indexOf( '16777215' ) >-1 &&\r\n\t\tstr.indexOf( '1278339272556' ) >-1 ; /* the last one is double internally but is expected to stringify fine.. */\r\n\treturn passed;\r\n}", "title": "" }, { "docid": "a63808ab29d4d3a7207e21adaf2bded9", "score": "0.55503386", "text": "function JSON_stringify(s, emit_unicode) {\n if (s) {\n var json = JSON.stringify(s);\n if (json) {\n return emit_unicode ? json : json.replace(jsonRegex, jsonRegexReplace);\n }\n else {\n return json;\n }\n }\n else {\n return s;\n }\n}", "title": "" }, { "docid": "600e0fe69d9c8c60512a120c50605725", "score": "0.5545554", "text": "function serializeJson(obj) {\r\n // firefox provides uneval()\r\n if (typeof uneval === \"function\") {\r\n var json = uneval(obj);\r\n return json.substring(1, json.length-1);\r\n }\r\n // others\r\n var buf = \"\";\r\n for (var attr in obj) {\r\n buf += \" \" + attr + \": \" + obj[attr];\r\n }\r\n return \"{\" + buf + \" }\";\r\n }", "title": "" }, { "docid": "d5ba8640e0a6e45a466ac3aeb373774d", "score": "0.54870814", "text": "function stringifyNumbers(obj) {\n\n}", "title": "" }, { "docid": "df8c54c53ee8f089d27995bf2ad98d67", "score": "0.54802066", "text": "function unserialize(data) {\n // discuss at: http://phpjs.org/functions/unserialize/\n // original by: Arpad Ray (mailto:arpad@php.net)\n // improved by: Pedro Tainha (http://www.pedrotainha.com)\n // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // improved by: Chris\n // improved by: James\n // improved by: Le Torbi\n // improved by: Eli Skeggs\n // bugfixed by: dptr1988\n // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // revised by: d3x\n // input by: Brett Zamir (http://brett-zamir.me)\n // input by: Martin (http://www.erlenwiese.de/)\n // input by: kilops\n // input by: Jaroslaw Czarniak\n // note: We feel the main purpose of this function should be to ease the transport of data between php & js\n // note: Aiming for PHP-compatibility, we have to translate objects to arrays\n // example 1: unserialize('a:3:{i:0;s:5:\"Kevin\";i:1;s:3:\"van\";i:2;s:9:\"Zonneveld\";}');\n // returns 1: ['Kevin', 'van', 'Zonneveld']\n // example 2: unserialize('a:3:{s:9:\"firstName\";s:5:\"Kevin\";s:7:\"midName\";s:3:\"van\";s:7:\"surName\";s:9:\"Zonneveld\";}');\n // returns 2: {firstName: 'Kevin', midName: 'van', surName: 'Zonneveld'}\n\n var that = this,\n utf8Overhead = function(chr) {\n // http://phpjs.org/functions/unserialize:571#comment_95906\n var code = chr.charCodeAt(0);\n if (code < 0x0080) {\n return 0;\n }\n if (code < 0x0800) {\n return 1;\n }\n return 2;\n };\n error = function(type, msg, filename, line) {\n throw new that.window[type](msg, filename, line);\n };\n read_until = function(data, offset, stopchr) {\n var i = 2,\n buf = [],\n chr = data.slice(offset, offset + 1);\n\n while (chr != stopchr) {\n if ((i + offset) > data.length) {\n error('Error', 'Invalid');\n }\n buf.push(chr);\n chr = data.slice(offset + (i - 1), offset + i);\n i += 1;\n }\n return [buf.length, buf.join('')];\n };\n read_chrs = function(data, offset, length) {\n var i, chr, buf;\n\n buf = [];\n for (i = 0; i < length; i++) {\n chr = data.slice(offset + (i - 1), offset + i);\n buf.push(chr);\n length -= utf8Overhead(chr);\n }\n return [buf.length, buf.join('')];\n };\n _unserialize = function(data, offset) {\n var dtype, dataoffset, keyandchrs, keys, contig,\n length, array, readdata, readData, ccount,\n stringlength, i, key, kprops, kchrs, vprops,\n vchrs, value, chrs = 0,\n typeconvert = function(x) {\n return x;\n };\n\n if (!offset) {\n offset = 0;\n }\n dtype = (data.slice(offset, offset + 1))\n .toLowerCase();\n\n dataoffset = offset + 2;\n\n switch (dtype) {\n case 'i':\n typeconvert = function(x) {\n return parseInt(x, 10);\n };\n readData = read_until(data, dataoffset, ';');\n chrs = readData[0];\n readdata = readData[1];\n dataoffset += chrs + 1;\n break;\n case 'b':\n typeconvert = function(x) {\n return parseInt(x, 10) !== 0;\n };\n readData = read_until(data, dataoffset, ';');\n chrs = readData[0];\n readdata = readData[1];\n dataoffset += chrs + 1;\n break;\n case 'd':\n typeconvert = function(x) {\n return parseFloat(x);\n };\n readData = read_until(data, dataoffset, ';');\n chrs = readData[0];\n readdata = readData[1];\n dataoffset += chrs + 1;\n break;\n case 'n':\n readdata = null;\n break;\n case 's':\n ccount = read_until(data, dataoffset, ':');\n chrs = ccount[0];\n stringlength = ccount[1];\n dataoffset += chrs + 2;\n\n readData = read_chrs(data, dataoffset + 1, parseInt(stringlength, 10));\n chrs = readData[0];\n readdata = readData[1];\n dataoffset += chrs + 2;\n if (chrs != parseInt(stringlength, 10) && chrs != readdata.length) {\n error('SyntaxError', 'String length mismatch');\n }\n break;\n case 'a':\n readdata = {};\n\n keyandchrs = read_until(data, dataoffset, ':');\n chrs = keyandchrs[0];\n keys = keyandchrs[1];\n dataoffset += chrs + 2;\n\n length = parseInt(keys, 10);\n contig = true;\n\n for (i = 0; i < length; i++) {\n kprops = _unserialize(data, dataoffset);\n kchrs = kprops[1];\n key = kprops[2];\n dataoffset += kchrs;\n\n vprops = _unserialize(data, dataoffset);\n vchrs = vprops[1];\n value = vprops[2];\n dataoffset += vchrs;\n\n if (key !== i)\n contig = false;\n\n readdata[key] = value;\n }\n\n if (contig) {\n array = new Array(length);\n for (i = 0; i < length; i++)\n array[i] = readdata[i];\n readdata = array;\n }\n\n dataoffset += 1;\n break;\n default:\n error('SyntaxError', 'Unknown / Unhandled data type(s): ' + dtype);\n break;\n }\n return [dtype, dataoffset - offset, typeconvert(readdata)];\n };\n\n return _unserialize((data + ''), 0)[2];\n }", "title": "" }, { "docid": "9e84cd011ad1b05e34bf73b467724df6", "score": "0.5476022", "text": "function ser (value){//why do you exist!! arrrrgh!!!\n return value = null ? null :\n JSON.parse(JSON.stringify(value))\n }", "title": "" }, { "docid": "bf743dd036e4621722e58873389e3324", "score": "0.54716957", "text": "serialize (target, encoding = \"json\") {\n const ref = new WeakMap()\n const simplify = (target, path) => {\n let result\n if (typeof target !== \"object\" && typeof target !== \"function\")\n result = target.valueOf()\n else {\n if (ref.has(target))\n result = { $t: \"Ref\", $d: [ ref.get(target) ] }\n else {\n ref.set(target, path)\n if (typeof target === \"object\") {\n if (target instanceof RegExp)\n result = { $t: \"RegExp\", $d: [ target.source, target.flags ] }\n else if (target instanceof Date)\n result = { $t: \"Date\", $d: [ target.valueOf() ] }\n else if (target instanceof Map)\n result = { $t: \"Map\", $d: Array.from(target.entries()).map((entry) => {\n entry[1] = simplify(entry[1], simoUtil.concatPath(path, entry[0]))\n return entry\n }) }\n else if (target instanceof Set) {\n let i = 0\n result = { $t: \"Set\", $d: Array.from(target.values()).map((val) =>\n simplify(val, simoUtil.concatPath(path, i++))\n ) }\n }\n else if (target instanceof Array) {\n let i = 0\n result = target.map((val) => simplify(val, simoUtil.concatPath(path, i++)))\n }\n else {\n /* store an Object in \"entries\" form to preserve ordering */\n result = { $t: \"Object\", $d: Array.from(Object.entries.call(null, target))\n .sort((a, b) => b[0].localeCompare(a[0]))\n .map((entry) => {\n entry[1] = simplify(entry[1], simoUtil.concatPath(path, entry[0]))\n return entry\n })\n }\n }\n }\n else if (typeof target === \"function\") {\n result = {\n $t: \"Function\",\n $d: [ target.toString(),\n Array.from(Object.entries.call(null, target))\n .sort((a, b) => b[0].localeCompare(a[0]))\n .map((entry) => {\n entry[1] = simplify(entry[1], simoUtil.concatPath(path, entry[0]))\n return entry\n })\n ]\n }\n }\n }\n }\n return result\n }\n const obj = simplify(target, \"\")\n const blob = JSON.stringify(obj)\n return blob\n }", "title": "" }, { "docid": "5c824e3bff966c67cbbe04607f834ba9", "score": "0.5466052", "text": "function unitTest_s_1()\n{\n var obj = 7;\n\n simpleStringifyTest(obj, null, '{\"jss\":1,\"v\":7}');\n}", "title": "" }, { "docid": "bdee9f3fe543c2c08867b14283239287", "score": "0.54462427", "text": "function str(text) {\n return JSON.stringify(text);\n}", "title": "" }, { "docid": "37690bafef745c053183a9a004eeaeea", "score": "0.5443979", "text": "function string(str) {\n return _serializeString(str);\n}", "title": "" }, { "docid": "4fc2bc61fb96c5e7d0d58bea8f4fbc0b", "score": "0.54351455", "text": "function stringify(attrs) {\n function walk(attr) {\n for (var k in attr) {\n if (isPlainObject(attr[k])) {\n walk(attr[k]);\n } else if (Array.isArray(attr[k])) {\n for (var i = 0; i < attr[k].length; i++) {\n walk(attr[k][i]);\n }\n } else {\n // as JSON.stringify(/test/) // => {}\n if (attr[k] instanceof RegExp) {\n attr[k] = attr[k].toString();\n }\n }\n }\n }\n walk(attrs);\n }", "title": "" }, { "docid": "05b1d15b3c03e31b7f2b57fd73fad8fc", "score": "0.54343134", "text": "function unStringify(str){\n // Searches for \" or ' at the Start and End index\n if((startIndex === '\\\"' || startIndex === '\\'') && (endIndex === '\\\"' || endIndex === '\\'')){\n //\n return str.slice(startIndex, endIndex);\n }\n return str;\n }", "title": "" }, { "docid": "e5a3382d787f2aa33cf0fc5039b7079f", "score": "0.5431235", "text": "function stringify(attrs) {\n function walk(attr) {\n for(var k in attr) {\n if(isPlainObject(attr[k])) {\n walk(attr[k]);\n } else if(Array.isArray(attr[k])) {\n for(var i = 0; i < attr[k].length; i++) {\n walk(attr[k][i]);\n }\n } else {\n // as JSON.stringify(/test/) // => {}\n if(attr[k] instanceof RegExp) {\n attr[k] = attr[k].toString();\n }\n }\n }\n }\n\n walk(attrs);\n}", "title": "" }, { "docid": "b7eb035441d727ae26bb78f01ede7b02", "score": "0.5429552", "text": "function fastAndSafeJsonStringify(rec) {\n try {\n return JSON.stringify(rec);\n } catch (ex) {\n try {\n return JSON.stringify(rec, safeCycles());\n } catch (e) {\n if (safeJsonStringify) {\n return safeJsonStringify(rec);\n } else {\n var dedupKey = e.stack.split(/\\n/g, 3).join('\\n');\n _warn('bunyan: ERROR: Exception in '\n + '`JSON.stringify(rec)`. You can install the '\n + '\"safe-json-stringify\" module to have Bunyan fallback '\n + 'to safer stringification. Record:\\n'\n + _indent(format('%s\\n%s', util.inspect(rec), e.stack)),\n dedupKey);\n return format('(Exception in JSON.stringify(rec): %j. '\n + 'See stderr for details.)', e.message);\n }\n }\n }\n}", "title": "" }, { "docid": "7bab4cea78745cd072e34e03e684543d", "score": "0.54169923", "text": "function testStringify(x) {\n var t = JSON.stringify(x);\n print(typeof t, t);\n}", "title": "" }, { "docid": "6bdf5209038d5854713fd2237777ebfe", "score": "0.54151595", "text": "function dstring(ostr) {\n // mapOnce(); // no longer needed, we compute contructors using getConstructor()\n var str = ostr;\n\n // to consider, should refmap be integrated into reviver ???\n var reviver = (key, value) => key === 'frameSaver' && !nwfs ? undefined : value; // TODO generalize or ...??? stephen 21/01/2017\n // var o = JSON.parse(str, reviver);\n let obj;\n //?? todo, separate yaml case by start with { or [}\n let isjson = ostr[0] === '{' || ostr[0] === '[';\n if (isjson)\n obj = JSON.parse(str, reviver);\n else\n obj = jsyaml.safeLoad(str);\n\n const map = isjson ? {} : 'NO MAP FOR YAML'; // map from #k to (possibly transformed) object\n var maxd = 0; // depth control\n var visited = isjson ? 'NO VISITED FOR JSON' : new Set(); // visited objects, to stop visit recursion\n var gxref = 0; // count to keep track of xref, used to patch missing array #k\n obj = refmap(obj, 0); // pass to recreate classes and compute #xref map if isjson\n if (isjson) {\n gxref = 0; // count to keep track of xref, used for debug\n repmap(obj, 0, ''); // map in the duplicate references #k/#xref\n }\n // log ('dstring maxd', maxd);\n return obj;\n\n // add class information from name2class, and call their Init() function if present\n // and make a map of all object references (isjson only)\n function refmap(o, d) {\n if (o === null) return;\n if (typeof o !== 'object') return o; // why did I not have that before???\n\n if (isjson) {\n const myxref = gxref;\n if (o['#k'] !== myxref) {\n if (o['#xref'] !== undefined) // its an xref object, does not count\n return o;\n else if (o instanceof Array)\n o['#k'] = myxref; // it's an Array and its #k field was lost by serialization\n else\n log('refmap', o['#k'], myxref, o); // something really is wrong\n }\n if ('#xref' in o) return o; // ref in JSON case\n gxref++;\n } else {\n // for yaml, which has already expanded multiple/circular references\n // note only the unclassed object will be polluted by #replaced, so no need to clean it up\n if (o['#replaced']) // revisit to yaml class object\n return o['#replaced']; //\n if (visited.has(o)) return o; // revisit to yaml non-call object\n visited.add(o);\n }\n\n // common to yaml or no yaml\n if (d > maxd) maxd = d;\n if (d > 25)\n log(\"stack?\", d);\n if (d > 30)\n throwe('stack overload in refmap');\n if (typeof o === \"object\") {\n // mark and recurse first, before we add extra prototype detail\n for (var i in o)\n if (i === 'frameSaver') // gets confused with frameSaver, we should have avoided saving it\n o[i] = undefined;\n else {\n let soi = o[i]; // remember old for debug\n // o[i] will change when a ##c Class object is replaced by a new Class object\n o[i] = refmap(o[i], map, d + 1);\n // o = o; // debug\n }\n\n // make an object of the correct class if such a class is defined\n const classname = o['##c'];\n if (classname) {\n //PJT when loading CSynth from website in Safari, I was seeing this fail to as lots of things had 'initGlobals.' prepended to name...\n //(as of this writing, the server isn't running on my dev machine for some reason, so not tested this change...)\n // const cl2 = name2class[classname] ? name2class[classname] : name2class['initGlobals.' + classname];\n let con2 = xconstructors[classname];\n if (!con2) con2 = xconstructors[classname] = getConstructor(classname);\n if (!con2) serious('no constructor found for class', classname);\n const newo = new con2(); // we have found the class, make a new objects\n if (typeof o.Init === \"function\") o.Init(); // call Init if there\n for (let k in o) // and copy over all the non-pollution fields\n if (k !== '##c') newo[k] = o[k];\n if (!isjson) o['#replaced'] = newo; // o is un-classed, newo is classed equivalent, save for yaml revisits\n o = newo;\n } else {\n if (typeof o.Init === \"function\") o.Init();\n } // classname\n\n }\n if ('#k' in o) {\n if (isjson)\n map[o['#k']] = o; // remember the object for its key, it will be the class object if appropriate\n else\n console.error('unexpected #k field for yaml in object', o)\n }\n return o;\n }\n\n\n // substitute all xref references with the appropriate object\n // does not apply in yaml case, yaml has done this work\n // will not be called in yaml case as map will be empty\n function repmap(o, d, path) { // ccc counts up xref\n if (d > 25)\n log(\"stack?\", d);\n if (o === null) return;\n if (typeof o === \"object\") {\n if (o['#k'] !== gxref && o['#k'] !== undefined)\n log('remap', o['#k'], gxref);\n // history note ... Array was special case becuase serialization lost #k field. Now handled in refmap above\n // #k serves two purposes.\n // One it to allow the cross references to be mapped (in refmap above)\n // The other is to ensure that the logic below applies to saved objects exactly once\n // and that no attempt is made to apply it to unsaved objects (eg recreated during class csontruction/Init)\n // Other undefined can be because of fields not saved in original serialization\n // but created by class reconstruction: eg Dispobj will automatically create a THREE.Scene\n if (o['#k'] === undefined) // && !(o instanceof Array))\n return;\n delete o['#k'];\n gxref++;\n for (var i in o) {\n var pd = Object.getOwnPropertyDescriptor(o, i);\n //if (!(i === \"constructor\" && !o.hasOwnProperty(\"constructor\")))\n if (!(pd && 'value' in pd)) continue;\n var oi = o[i];\n if (!oi) continue;\n var xref = oi['#xref'];\n delete oi['#xref']; // no need, xref object has done its task and is now orphaned\n if (xref !== undefined) {\n o[i] = map[xref];\n if (o[i] === undefined)\n console.log(\"unexpected #xref found: \" + xref);\n } else {\n repmap(oi, map, path + '.' + i);\n }\n }\n }\n }\n}", "title": "" }, { "docid": "09e6e553e7a00a3595ba8e75c0233582", "score": "0.53645307", "text": "function i(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "09e6e553e7a00a3595ba8e75c0233582", "score": "0.53645307", "text": "function i(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "09e6e553e7a00a3595ba8e75c0233582", "score": "0.53645307", "text": "function i(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "55a755858c8a79d3d85a0d01940886ee", "score": "0.53421676", "text": "_stringify(d){\n return JSON.stringify(d);\n }", "title": "" }, { "docid": "dfff9a4dc481f85bed462b64c8f4febc", "score": "0.5338041", "text": "serialize(value) {\n return value.toString();\n }", "title": "" }, { "docid": "bff46aa20ae280c1765952410bd550c4", "score": "0.5331462", "text": "function jsStringify(str) {\n return JSON.stringify(str);\n}", "title": "" }, { "docid": "bff46aa20ae280c1765952410bd550c4", "score": "0.5331462", "text": "function jsStringify(str) {\n return JSON.stringify(str);\n}", "title": "" }, { "docid": "bff46aa20ae280c1765952410bd550c4", "score": "0.5331462", "text": "function jsStringify(str) {\n return JSON.stringify(str);\n}", "title": "" }, { "docid": "68c55086033d51e601e850db05af3559", "score": "0.53208774", "text": "function r(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "68c55086033d51e601e850db05af3559", "score": "0.53208774", "text": "function r(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "68c55086033d51e601e850db05af3559", "score": "0.53208774", "text": "function r(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "82822987966636f51e145df775e24711", "score": "0.5312066", "text": "function str(val) {\n\treturn { \"@string\": val };\n}", "title": "" }, { "docid": "e9abbb520076a43a02913b313fcb9e98", "score": "0.53008306", "text": "function stringify(o) {\n\t\tvar stack = [];\n\n\t\tfunction _serialize(h, key) {\n\t\t\tvar value = h[key],\n\t\t\t\tt\t = typeof value,\n\t\t\t\ta\t = [],\n\t\t\t\tCOLON = ':',\n\t\t\t\tCOMMA = ',',\n\t\t\t\tNULL = 'null',\n\t\t\t\tarr, i, keys, k, v;\n\n\t\t\t// Per the ECMA 5 spec, toJSON is applied before the replacer is\n\t\t\t// called. Also per the spec, Date.prototype.toJSON has been added, so\n\t\t\t// Date instances should be serialized prior to exposure to the\n\t\t\t// replacer. I disagree with this decision, but the spec is the spec.\n\t\t\tif (value && typeof value === 'object' && typeof value.toJSON === 'function') {\n\t\t\t\tvalue = value.toJSON(key);\n\t\t\t}\n\n\t\t\tif (value !== h[key]) {\n\t\t\t\tt = typeof value;\n\t\t\t}\n\n\t\t\tif (value === null) return NULL;\n\n\t\t\tswitch (t) {\n\t\t\t\tcase 'object' : break;\n\t\t\t\tcase 'string' : return _string(value);\n\t\t\t\tcase 'number' : return isFinite(value) ? value + '' : NULL;\n\t\t\t\tcase 'boolean':\n\t\t\t\tdefault\t : return String(value);\n\t\t\t}\n\n\t\t\t// Check for cyclical references in nested objects\n\t\t\tfor (i = stack.length - 1; i >= 0; --i) {\n\t\t\t\tif (stack[i] === value) {\n\t\t\t\t\tthrow new Error(\"JSON.stringify. Cyclical reference\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tarr = toString.call(value) === '[object Array]' || (('length' in value) && value.slice);\n\n\t\t\t// Add the object to the processing stack\n\t\t\tstack.push(value);\n\n\t\t\tif (arr) { // Array\n\t\t\t\tfor (i = value.length - 1; i >= 0; --i) {\n\t\t\t\t\ta[i] = _serialize(value, i) || NULL;\n\t\t\t\t}\n\t\t\t} else { // Object\n\t\t\t\t// If whitelist provided, take only those keys\n\t\t\t\tkeys = value;\n\t\t\t\ti = 0;\n\n\t\t\t\tfor (k in keys) {\n\t\t\t\t\tif (keys.hasOwnProperty(k)) {\n\t\t\t\t\t\tv = _serialize(value, k);\n\t\t\t\t\t\tif (v) {\n\t\t\t\t\t\t\ta[i++] = _string(k) + COLON + v;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// remove the array from the stack\n\t\t\tstack.pop();\n\n\t\t\treturn arr ? '[' + a.join(COMMA) + ']': '{' + a.join(COMMA) + '}';\n\t\t}\n\n\t\t// process the input\n\t\treturn _serialize({'':o}, '');\n\t}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" }, { "docid": "aa9dab14fff55bcd625896a14045a8f9", "score": "0.52875483", "text": "function n(t){return null==t?\"\":\"object\"==typeof t?JSON.stringify(t,null,2):String(t)}", "title": "" } ]
c87d94629de56989a7c39ae00829b47c
The individual responsible for making the annotation.
[ { "docid": "d91fa62431420ca8b177433d3e98a2f2", "score": "0.0", "text": "get authorReference () {\r\n\t\treturn this._authorReference;\r\n\t}", "title": "" } ]
[ { "docid": "94373dcf82a3cd1e2265778b0ab87d07", "score": "0.612936", "text": "get individual() {\n\t\treturn this.__individual;\n\t}", "title": "" }, { "docid": "fe54ec14db14fbf1803d31950d9eb52c", "score": "0.59623784", "text": "function Annotation() {\n this.guid_ = tr.b.GUID.allocateSimple();\n this.view_ = undefined;\n }", "title": "" }, { "docid": "14bd28df2d121ae40c16c68c421da651", "score": "0.57922035", "text": "enterAnnotation_identifier(ctx) {\n\t}", "title": "" }, { "docid": "1c4620fcc70ee8f4fd2b1e4f8ffbe67d", "score": "0.565819", "text": "createBaseAnnotation(page, rect, contents, author) {\n let annot = new parser_1.Annotation();\n annot.type = \"/Annot\",\n annot.page = page,\n annot.object_id = this.parser.getFreeObjectId(),\n annot.id = this.generateUniqueIdentifier(),\n annot.rect = rect,\n annot.author = author,\n annot.pageReference = this.parser.getPage(page),\n annot.updateDate = util_1.Util.convertDateToPDFDate(new Date()),\n annot.contents = contents,\n annot.border = this.createDefaultBorder();\n return annot;\n }", "title": "" }, { "docid": "9e091eafd88fa0251fa9b4f9a878d953", "score": "0.56517684", "text": "function Annotation(annotationType, tmpSource, tmpTarget) {\n this.base = Relationship;\n this.base(\"Annotation\", \n tmpSource, \n tmpTarget, \n new Array(MASH_EVENT.OBJECT_MOVE), \n new Array(MASH_EVENT.OBJECT_MOVE)\n );\n this.type = annotationType;\n}", "title": "" }, { "docid": "d73a8e8017cd5dcc9c8b1570576cd793", "score": "0.5615035", "text": "function createAnnotation() {\n var annObj = {\n filename: fileNameStr,\n submitted_by: cudEmailStr,\n };\n\n if (currentHeaderPos || currentHeaderPos === 0) {\n annObj.position = currentHeaderPos\n }\n\n return annObj;\n}", "title": "" }, { "docid": "4a81170f66360026cc93be9583207009", "score": "0.5560231", "text": "get type() {\n return \"xeogl.Annotation\";\n }", "title": "" }, { "docid": "c9731a8b608d9803010baafb4e433a5b", "score": "0.5529988", "text": "add(annotation) {\n // this.SetPrint(annotation);\n this.doAdd(annotation);\n }", "title": "" }, { "docid": "c9731a8b608d9803010baafb4e433a5b", "score": "0.5529988", "text": "add(annotation) {\n // this.SetPrint(annotation);\n this.doAdd(annotation);\n }", "title": "" }, { "docid": "0cc0a736b1b520191a5cfe745511e3b3", "score": "0.54946357", "text": "function createAnnotation(type) {\n var component;\n var instanceName;\n if (type == TokenType.Font) {\n component = figma.currentPage.findOne(n => n.name === \"Token Annotation / Typography\");\n instanceName = \"Font Annotation\";\n }\n else {\n component = figma.currentPage.findOne(n => n.name === \"Token Annotation / Color\");\n instanceName = \"Color Token Annotation\";\n }\n if (component != undefined) {\n var instance = component.createInstance();\n instance.name = instanceName;\n return instance;\n }\n else {\n console.log(\"Error: Could not creat annotation instance\");\n }\n}", "title": "" }, { "docid": "40d074b6245858948ac4d590503e8168", "score": "0.5455473", "text": "function saveAnnotation(e)\n{\n // This can be an event in more than one way with more than one\n // object\n if (this.wrapper)\n {\n var anot = this.wrapper;\n }\n else\n {\n var anot = this;\n }\n\n jsonCall\n (\n 'Annotate',\n 'message=' + anot.contentEl.value\n + '&url=' + encodeURIComponent(currentPage)\n + '&element_id=' + anot.subjectElement.id\n + '&uniqid=' + anot.uniqid\n + '&x_pos=' + (parseInt(anot.style.left) - getOffset(anot.subjectElement, 'Left'))\n + '&y_pos=' + (parseInt(anot.style.top) - getOffset(anot.subjectElement, 'Top')),\n (function() { }),\n displayServerError\n );\n\n anot.inEdit = false;\n}", "title": "" }, { "docid": "c8c658dfbcfda7439e82ca9868a448e7", "score": "0.54195315", "text": "postAnnotation(req) {\n let annotation = req.body\n if (!annotation || !req.user) {\n return Promise.resolve(null)\n }\n // Set creator\n if (!annotation.creator) {\n annotation.creator = {\n id: req.user.uri,\n name: req.user.name\n }\n }\n // Add created and modified dates.\n let date = (new Date()).toISOString()\n if (!annotation.created) {\n annotation.created = date\n }\n // Remove type property\n _.unset(annotation, \"type\")\n // TODO: Validate annotation\n\n // Add _id and URI\n annotation._id = util.uuid()\n annotation.id = util.getBaseUrl(req) + \"annotations/\" + annotation._id\n // Make sure URI is a https URI (except in tests)\n if (!config.env == \"test\") {\n annotation.uri.replace(\"http:\", \"https:\")\n }\n // Save annotation\n return this.collection.insertOne(annotation)\n .then(() => {\n return annotation\n })\n .catch(error => {\n console.log(error)\n return null\n })\n }", "title": "" }, { "docid": "1ea8df3cead1370c2b74878da2fb2be4", "score": "0.5355796", "text": "enterAnnotation_constructor(ctx) {\n\t}", "title": "" }, { "docid": "d205fc19c3da52d0c410a75077b4757e", "score": "0.5326361", "text": "enterAnnotation_argument(ctx) {\n\t}", "title": "" }, { "docid": "b6f9c5729a2ac7673633f451dfa835f8", "score": "0.53062373", "text": "function Annotator() {\n this.wavesurfer;\n this.playBar;\n this.stages;\n this.workflowBtns;\n this.tasks = [];\n this.currentTask;\n this.numRemainingTasks;\n this.taskStartTime;\n this.hiddenImage;\n // only automatically open instructions modal when first loaded\n this.instructionsViewed = false;\n // Boolean, true if currently sending http post request\n this.sendingResponse = false;\n\n // Create color map for spectrogram\n var spectrogramColorMap = colormap({\n colormap: magma,\n nshades: 256,\n format: 'rgb',\n alpha: 1\n });\n\n // Create wavesurfer (audio visualization component)\n var height = 256;\n this.wavesurfer = Object.create(WaveSurfer);\n this.wavesurfer.init({\n container: '.audio_visual',\n waveColor: '#FF00FF',\n progressColor: '#FF00FF',\n // For the spectrogram the height is half the number of fftSamples\n fftSamples: height * 2,\n height: height,\n colorMap: spectrogramColorMap\n });\n\n // Create labels (labels that appear above each region)\n var labels = Object.create(WaveSurfer.Labels);\n labels.init({\n wavesurfer: this.wavesurfer,\n container: '.labels'\n });\n\n // Create hiddenImage, an image that is slowly revealed to a user as they annotate\n // (only for this.currentTask.data.content.feedback === 'hiddenImage')\n this.hiddenImage = new HiddenImg('.hidden_img', 100);\n this.hiddenImage.create();\n\n // Create the play button and time that appear below the wavesurfer\n this.playBar = new PlayBar(this.wavesurfer);\n this.playBar.create();\n\n // Create the annotation stages that appear below the wavesurfer. The stages contain tags\n // the users use to label a region in the audio clip\n this.stages = new AnnotationStages(this.wavesurfer, this.hiddenImage);\n this.stages.create();\n\n // Create Workflow btns (submit and exit)\n this.workflowBtns = new WorkflowBtns('/experiments/' + experiment_id + '/workflow/next');\n this.workflowBtns.create();\n\n this.addEvents();\n}", "title": "" }, { "docid": "5cd48759e0c4fedab707e3c257ef6658", "score": "0.5271769", "text": "function Person(){\n this[\"@context\"] = \"http://vitali.web.cs.unibo.it/twiki/pub/TechWeb16/context.json\";\n this[\"@type\"] = \"person\";\n this[\"@id\"] = \"mailto:\"+$scope.reviewer.email;\n this[\"name\"] = $scope.reviewer.given_name+\" \"+$scope.reviewer.family_name;\n this[\"as\"] = {\n \"@id\": \"#role1\",\n \"@type\": \"role\",\n \"role_type\": \"pro:reviewer\",\n \"in\": \"\"\n }\n }", "title": "" }, { "docid": "8f7c275663f3cfcca185e229ce41d6f2", "score": "0.52520084", "text": "static async addAnnotation({title, type, content}={}) {\n const editor = atom.workspace.getActiveTextEditor()\n if (!atom.workspace.isTextEditor(editor)) {\n atom.notifications.addInfo(\n 'Annotations can only be added to text editors.'\n )\n return\n }\n const cursors = (\n atom.workspace\n .getActiveTextEditor()\n .getCursorBufferPositions()\n )\n if (cursors.length > 1) {\n atom.notifications.addInfo(\n 'Adding an annotation to multiple cursors is not supported.'\n )\n return\n }\n const lineNumber = cursors[0].row + 1\n const annotationsDb = await AnnotationsDb.getInstance(\n editor,\n {createIfNeeded: true},\n )\n\n if (!title) {\n const titleDialog = new Dialog({\n prompt: 'Enter the title!',\n iconClass: 'tag',\n attach: true,\n handleConfirm: input => {\n if (input.length > 0) {\n return input\n }\n throw new ValueError('Annotation title must not be empty!')\n }\n })\n title = await titleDialog.awaitConfirm()\n }\n\n const possibleTypes = (\n Object.entries(RendererRegistry.getRenderers())\n .map(([name, {type}]) => type)\n )\n if (!type) {\n const typeDialog = new Dialog({\n prompt: (\n 'Choose the annotation type! Possible values: '\n + possibleTypes.join(', ')\n ),\n iconClass: 'paintcan',\n initialText: 'html',\n select: true,\n attach: true,\n handleConfirm: input => {\n input = input.toLowerCase()\n if (possibleTypes.indexOf(input) >= 0) {\n return input\n }\n throw new ValueError('Enter a valid annotation type!')\n }\n })\n type = await typeDialog.awaitConfirm()\n }\n else {\n if (!possibleTypes.includes(type)) {\n throw new Error(`Invalid annotation type '${type}'.`)\n }\n }\n\n if (!content) {\n try {\n content = await Annotation.askForContent(type, title)\n }\n catch (error) {\n if (error instanceof AbortError) {\n atom.notifications.addInfo(\n 'Annotation was not created. '\n + 'No annotations were deleted.'\n )\n return\n }\n else {\n throw error\n }\n }\n }\n\n const rawAnnotations = annotationsDb.getAnnotations()\n const similarRawAnnotations = (\n rawAnnotations\n .filter(({title: otherTitle, lineNumber: otherLineNumber}) =>\n otherTitle.toLowerCase() === title.toLowerCase()\n && otherLineNumber === lineNumber\n )\n )\n\n const numSimilar = similarRawAnnotations.length\n if (numSimilar > 0) {\n if (Config.get('dialogs.showReplaceConfirm')) {\n const message = REPLACE_CONFIRM_MESSAGE(similarRawAnnotations)\n const buttonIndex = await showMessageBox({\n message,\n buttons: ['Replace', 'Cancel'],\n })\n if (buttonIndex === 0) {\n annotationsDb.delete(similarRawAnnotations)\n }\n }\n }\n\n await annotationsDb.add([{\n lineNumber,\n title,\n content,\n type,\n }])\n // Either add an icon to the gutter or update the list of annotations\n // associated with an icon (if the new annotation is on the same line\n // as others).\n if (this.initializedEditors.has(editor)) {\n const annotations = await AnnotationsDb.getAnnotations(\n editor,\n lineNumber,\n )\n // The new annotation requires a new gutter icon.\n if (annotations.length === 1) {\n this._addGutterIcon(editor, lineNumber)\n }\n }\n // The annotation was already added to the DB thus it will be displayed\n // after initialization.\n else {\n await this._initEditor(editor)\n }\n }", "title": "" }, { "docid": "21f54793d60b764a8d2bbfb620856d17", "score": "0.5225284", "text": "of(value) {\n return new Annotation(this, value);\n }", "title": "" }, { "docid": "7be37114f42558e9d3f0323f59ceeb8c", "score": "0.5186521", "text": "function annotationSave() {\n $UI.message.add('Annotation Saved');\n}", "title": "" }, { "docid": "4f2e92e5986d9626848e49807c94878b", "score": "0.51731116", "text": "function SaveAnnotationEventHandler(sender) {\n this.sender = sender;\n }", "title": "" }, { "docid": "4f2e92e5986d9626848e49807c94878b", "score": "0.51731116", "text": "function SaveAnnotationEventHandler(sender) {\n this.sender = sender;\n }", "title": "" }, { "docid": "63cc972b8bcc0294b358714f07a7da2c", "score": "0.51709664", "text": "function initializeSubmitEditAnnotationButtonEventListener() {\n videoBase.elements.annotations.addEventListener('click', function(e) {\n var target = e.target;\n \n if(target.classList.contains('submit-edit-annotation')) {\n // submit edited annotation\n var annotationElement = target.closest(videoBase.selectors.annotationWrapper);\n var annotationElementBody = annotationElement.querySelector(videoBase.selectors.annotationBody);\n var annotationUserId = annotationElement.dataset['authorId'];\n var annotationId = annotationElement.dataset['id'];\n var newAnnotationComment = annotationElementBody.querySelector(videoBase.selectors.editAnnotationText).value;\n \n var existingAnnotation = new videoModel.ExistingAnnotation(annotationUserId, newAnnotationComment, annotationId);\n existingAnnotation.edit(annotationElementBody);\n }\n })\n}", "title": "" }, { "docid": "9176a26e1daec7013bfd2a746579cdcf", "score": "0.51653624", "text": "function annotation ( item, prop, value, resource, status ) {\n\t\tthis.item = item;\n\t\tthis.prop = prop;\n\t\tthis.value = value;\n\t\tthis.resource = resource;\n\t\tthis.status = status;\n\t}", "title": "" }, { "docid": "11c879ba5f8cd9bb219dfa04766130e1", "score": "0.51370984", "text": "function displayAnnotation(annotation) {\n note.innerHTML = annotation;\n}", "title": "" }, { "docid": "11c879ba5f8cd9bb219dfa04766130e1", "score": "0.51370984", "text": "function displayAnnotation(annotation) {\n note.innerHTML = annotation;\n}", "title": "" }, { "docid": "1aed4f6bf73203224cdcf305a9c0fd8f", "score": "0.5119922", "text": "visitAnnotation(ctx) {\r\n\t return this.visitChildren(ctx);\r\n\t}", "title": "" }, { "docid": "2f3674adb1d654851109f2551f7615de", "score": "0.5083335", "text": "function ThisTypeAnnotation() {\n this.push(\"this\");\n}", "title": "" }, { "docid": "5d1f0a4d0bc79707ae1fa5817b4541e4", "score": "0.5047791", "text": "enterAnnotation_argument_name(ctx) {\n\t}", "title": "" }, { "docid": "7303ae8616cc38f3e7f906af56bec791", "score": "0.5045275", "text": "writeAnnotationObject(annot) {\n if (!annot.author)\n annot.author = \"\";\n if (!annot.contents)\n annot.contents = \"\";\n if (!annot.object_id)\n throw Error(\"No object_id\");\n let ret = writer_util_1.WriterUtil.writeReferencePointer(annot.object_id);\n ret.push(Writer.SPACE);\n ret = ret.concat(Writer.OBJ);\n ret.push(Writer.SPACE);\n ret = ret.concat(Writer.DICT_START);\n ret = ret.concat(Writer.TYPE_ANNOT);\n ret.push(Writer.SPACE);\n if (annot.rect && annot.rect.length > 0) {\n ret = ret.concat(Writer.RECT);\n ret.push(Writer.SPACE);\n ret = ret.concat(writer_util_1.WriterUtil.writeNumberArray(annot.rect));\n ret.push(Writer.SPACE);\n }\n ret = ret.concat(Writer.SUBTYPE);\n ret.push(Writer.SPACE);\n ret = ret.concat(this.convertSubtype(annot.type));\n ret.push(Writer.SPACE);\n ret = ret.concat(Writer.UPDATE_DATE);\n ret.push(Writer.SPACE);\n ret = ret.concat(util_1.Util.convertStringToAscii(annot.updateDate));\n ret.push(Writer.SPACE);\n ret = ret.concat(Writer.AUTHOR);\n ret.push(Writer.SPACE);\n ret.push(Writer.BRACKET_START);\n ret = ret.concat(util_1.Util.convertStringToAscii(annot.author));\n ret.push(Writer.BRACKET_END);\n ret.push(Writer.SPACE);\n if (annot.contents) {\n ret = ret.concat(Writer.CONTENTS);\n ret.push(Writer.SPACE);\n ret.push(Writer.BRACKET_START);\n ret = ret.concat(util_1.Util.convertStringToAscii(annot.contents));\n ret.push(Writer.BRACKET_END);\n ret.push(Writer.SPACE);\n }\n ret = ret.concat(Writer.ID);\n ret.push(Writer.SPACE);\n ret = ret.concat(util_1.Util.convertStringToAscii(annot.id));\n ret.push(Writer.SPACE);\n if (annot.annotation_flag) {\n ret = ret.concat(Writer.FLAG);\n ret.push(Writer.SPACE);\n ret = ret.concat(util_1.Util.convertNumberToCharArray(annot.annotation_flag));\n ret.push(Writer.SPACE);\n }\n if (annot.color) {\n if (annot.color.r > 1)\n annot.color.r /= 255;\n if (annot.color.g > 1)\n annot.color.g /= 255;\n if (annot.color.b > 1)\n annot.color.b /= 255;\n ret.push(Writer.SPACE);\n ret = ret.concat(Writer.COLOR);\n ret.push(Writer.SPACE);\n ret = ret.concat(writer_util_1.WriterUtil.writeNumberArray([annot.color.r, annot.color.g, annot.color.b]));\n ret.push(Writer.SPACE);\n }\n let opacity = annot.opacity;\n if (opacity) {\n ret = ret.concat(Writer.OPACITY);\n ret.push(Writer.SPACE);\n ret = ret.concat(util_1.Util.convertNumberToCharArray(opacity));\n ret.push(Writer.SPACE);\n }\n if (annot.border) {\n ret.push(Writer.SPACE);\n ret = ret.concat(Writer.BORDER);\n ret.push(Writer.SPACE);\n ret = ret.concat(writer_util_1.WriterUtil.writeNumberArray([annot.border.horizontal_corner_radius, annot.border.vertical_corner_radius, annot.border.border_width]));\n ret.push(Writer.SPACE);\n }\n if (annot.defaultAppearance) {\n ret.push(Writer.SPACE);\n ret = ret.concat(Writer.DEFAULT_APPEARANCE);\n ret.push(Writer.SPACE);\n ret.push(Writer.BRACKET_START);\n ret = ret.concat(util_1.Util.convertStringToAscii(annot.defaultAppearance));\n ret.push(Writer.BRACKET_END);\n ret.push(Writer.SPACE);\n }\n if (!annot.pageReference)\n throw Error(\"No page reference\");\n if (annot.pageReference.object_id) {\n ret.push(Writer.SPACE);\n ret = ret.concat(Writer.PAGE_REFERENCE);\n ret.push(Writer.SPACE);\n ret = ret.concat(writer_util_1.WriterUtil.writeReferencePointer(annot.pageReference.object_id, true));\n ret.push(Writer.SPACE);\n }\n if (annot.quadPoints) {\n ret = ret.concat(Writer.QUADPOINTS);\n ret.push(Writer.SPACE);\n ret = ret.concat(writer_util_1.WriterUtil.writeNumberArray(annot.quadPoints));\n ret.push(Writer.SPACE);\n }\n if (annot.vertices) {\n ret = ret.concat(Writer.VERTICES);\n ret.push(Writer.SPACE);\n ret = ret.concat(writer_util_1.WriterUtil.writeNumberArray(annot.vertices));\n ret.push(Writer.SPACE);\n }\n if (annot.stampType) {\n ret = ret.concat(Writer.NAME);\n ret.push(Writer.SPACE);\n ret = ret.concat(Writer.DRAFT);\n ret.push(Writer.SPACE);\n }\n if (annot.caretSymbol) {\n ret = ret.concat(Writer.SY);\n ret.push(Writer.SPACE);\n ret.push(Writer.P);\n ret.push(Writer.SPACE);\n }\n if (annot.inkList) {\n ret = ret.concat(Writer.INKLIST);\n ret.push(Writer.SPACE);\n ret = ret.concat(writer_util_1.WriterUtil.writeNestedNumberArray(annot.inkList));\n ret.push(Writer.SPACE);\n }\n ret = ret.concat(Writer.DICT_END);\n ret.push(Writer.SPACE);\n ret = ret.concat(Writer.ENDOBJ);\n ret.push(Writer.CR);\n ret.push(Writer.LF);\n return { ptr: annot.object_id, data: ret };\n }", "title": "" }, { "docid": "b09c0a6839aa5ec958d701cc5da9160d", "score": "0.5033636", "text": "function CreateNewAnnotation( latitude , longitude , image , title , subtitle , isMyCar , priceFormatted , availableSpots )\n{\n var newID = null ;\n if( isMyCar )\n {\n // Nothing to do\n }\n else\n {\n newID = latitude.toString() + \"_\" + longitude.toString() ;\n if( newID in arAnnotations )\n {\n // Remove the previous annotation\n $.map.removeAnnotation( arAnnotations[newID].annotation ) ;\n }\n }\n\n var newAnnotation = Alloy.Globals.Map.createAnnotation(\n {\n id: newID ,\n latitude: latitude ,\n longitude: longitude ,\n image: image ,\n title: title ,\n subtitle: subtitle\n } ) ;\n\n if( typeof priceFormatted !== 'undefined' && priceFormatted != null )\n {\n newAnnotation.myPriceFormatted = priceFormatted ;\n }\n if( typeof availableSpots !== 'undefined' && availableSpots != null )\n {\n newAnnotation.myAvailableSpots = availableSpots ;\n }\n\n var leftView = null ;\n if( OS_IOS )\n {\n newAnnotation.setRightButton( Ti.UI.iPhone.SystemButton.INFO_LIGHT ) ;\n\n // iOS will use an ImageView\n leftView = Titanium.UI.createImageView(\n {\n image: '/images/navigator.png' ,\n width: 30 ,\n height: 30\n } ) ;\n }\n else\n {\n // Android will use a Button\n leftView = Ti.UI.createButton( { backgroundImage: '/images/navigator.png' } ) ;\n }\n newAnnotation.setLeftView( leftView ) ;\n\n $.map.addAnnotation( newAnnotation ) ;\n\n if( isMyCar )\n {\n newAnnotation.myId = 'car' ;\n }\n else\n {\n arAnnotations[newID] =\n {\n annotation: newAnnotation ,\n timestamp: new Date().getTime()\n } ;\n }\n\n return newAnnotation ;\n}", "title": "" }, { "docid": "7c58ef8b05fefd5f97c6a3673f5a8c96", "score": "0.5031994", "text": "addAnnotationText(annotation_text) {\n this.annotation_texts[annotation_text.annotation_text_id] = annotation_text;\n }", "title": "" }, { "docid": "e452ea3b288fcd1cfc722e5b1396e3ff", "score": "0.5016232", "text": "function setup (saveAnnotationText) {\n _saveAnnotationText = saveAnnotationText\n}", "title": "" }, { "docid": "3722fdcfdcf77f0ac330dd2727ac536a", "score": "0.49887326", "text": "function Agente(nombre) {\n // heredar el constructor de personas\n Persona.call(this, nombre);// call o Apply llaman a la función con el this que me apetezca \n}", "title": "" }, { "docid": "3ced044bd6127d3884246707d05cfb28", "score": "0.49775723", "text": "createStampAnnotation(page, contents, author, stampType = \"Draft\", color = { r: 1, g: 1, b: 0 }) {\n let annot = Object.assign(this.createBaseAnnotation(page, [50, 50, 80, 80], contents, author), {\n opacity: 1,\n initiallyOpen: false,\n annotation_flag: 4,\n color: color,\n stampType: stampType\n });\n annot.type = \"/Stamp\";\n this.annotations.push(annot);\n }", "title": "" }, { "docid": "d8a1ff1141aeb2f4780b854ee6e71d99", "score": "0.49690145", "text": "function Target () { }", "title": "" }, { "docid": "035c34e1d11beeb60170fac2f9e1cd9e", "score": "0.49558005", "text": "function AnnotationBase(control) {\n this.control = control;\n }", "title": "" }, { "docid": "aaadd585d0ee6c00c66fdda996dfd240", "score": "0.49542597", "text": "function saveAnnotation() {\n annoCallback.call(null, {\n id:\n $UI.annotOptPanel.setting.formSchemas[$UI.annotOptPanel._select_.value]\n .id,\n data: $UI.annotOptPanel._form_.value,\n });\n}", "title": "" }, { "docid": "1f9bf6397718a605f32b3c5900decb31", "score": "0.49201268", "text": "function annotationInitialize() {\n annotationGroupObject = new AnnotationGroup(graph, 0, 970);\n annotationAddButton = new AddAnnotationButton(svg, 30, 30, (width + margin.left * 1.2), (margin.top * 0.8));\n }", "title": "" }, { "docid": "e639e9415b75862c947e210c9bebcaf7", "score": "0.49183327", "text": "function annotate(fn, annotation) {\n fn.annotations = fn.annotations || [];\n fn.annotations.push(annotation);\n}", "title": "" }, { "docid": "e639e9415b75862c947e210c9bebcaf7", "score": "0.49183327", "text": "function annotate(fn, annotation) {\n fn.annotations = fn.annotations || [];\n fn.annotations.push(annotation);\n}", "title": "" }, { "docid": "8e78a6ab3a534a1600ed69341b2a5335", "score": "0.4917513", "text": "gatherDataAndSave() {\n\t\tvar annotation = this.props.activeAnnotation;\n\t\tvar data = {};\n\t\tif(this.state.classifications.length > 0) {\n\t\t\tdata['classifications'] = this.state.classifications;\n\t\t}\n\t\tif(this.state.comments.length > 0) {\n\t\t\tdata['comments'] = this.state.comments\n\t\t}\n\t\tif(this.state.links.length > 0) {\n\t\t\tdata['links'] = this.state.links\n\t\t}\n\t\tannotation.data = data;\n\t\tthis.props.saveAnnotation(annotation);\n\t}", "title": "" }, { "docid": "6fcd49b016dc017520818ee86229d954", "score": "0.4912916", "text": "get annotations() {\n return this.internalAnnotations;\n }", "title": "" }, { "docid": "6fcd49b016dc017520818ee86229d954", "score": "0.4912916", "text": "get annotations() {\n return this.internalAnnotations;\n }", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" }, { "docid": "1dd811f4e418982558eaa8e5e698cf94", "score": "0.48914364", "text": "function OwnerID() {}", "title": "" } ]
720b63c3b931b6dc2b076ce4a16a40f2
_[static]_ Determine if a given layer group contains base layers
[ { "docid": "8c55b8f00c55b5d8282cd9199f6d66f0", "score": "0.82641727", "text": "static isBaseGroup(grp) {\n if (grp instanceof LayerGroup) {\n const lyrs = grp.getLayers().getArray();\n return lyrs.length && lyrs[0].get('type') === 'base';\n }\n else {\n return false;\n }\n }", "title": "" } ]
[ { "docid": "a668d1a3a92a83b0bc4c3051dc769456", "score": "0.6448219", "text": "static ensureTopVisibleBaseLayerShown(map, groupSelectStyle) {\n let lastVisibleBaseLyr;\n LayerSwitcher.forEachRecursive(map, function (lyr, _idx, _arr) {\n if (lyr.get('type') === 'base' && lyr.getVisible()) {\n lastVisibleBaseLyr = lyr;\n }\n });\n if (lastVisibleBaseLyr)\n LayerSwitcher.setVisible_(map, lastVisibleBaseLyr, true, groupSelectStyle);\n }", "title": "" }, { "docid": "35bcb885644ed6b154582ab38c8e3cf3", "score": "0.6379424", "text": "wantsLayer(layer) {\n return (this.getOptimizedStyleSet(this.m_tmpOptimizedSubSetKey.set(layer, undefined)).length > 0);\n }", "title": "" }, { "docid": "73c8125aa05df7e3cf983df7264cba35", "score": "0.61369467", "text": "_hasLayer(name) {\r\n return !!this._piximData.layers[name];\r\n }", "title": "" }, { "docid": "688d42351e23616635e1143e7f984bc9", "score": "0.6126718", "text": "function checkLayer(name, context) {\n var checkOut;\n for (var i = 0; i < context.length; i++) {\n if (layer[i].name === name) {\n checkOut = true;\n break;\n }\n else {\n checkOut = false;\n };\n };\n return checkOut;\n}", "title": "" }, { "docid": "0488891325279a52041040844037141c", "score": "0.597779", "text": "function hasLayer(name) {\n\tvar result = false;\n\tif (isNav4) {\n\t\tif (document.layers[name]!=null) result=true;\n\t} else if (isIE) {\n\t\tif (eval('document.all.' + name)!=null) result=true;\n\t} else if (isNav) {\n\t\tvar theElements = document.getElementsByTagName(\"DIV\");\n\t\tvar theObj;\n\t\tvar j = -1;\n\t\tfor (i=0;i<theElements.length;i++) {\n\t\t\tif (theElements[i].id==name) result=true;\n\t\t}\n }\n\treturn result;\n}", "title": "" }, { "docid": "7318c74f29e3c0d3ad7f62eefb6fa2c9", "score": "0.59645474", "text": "hasLayers(json_maps) {\n let has_layers = true\n\n if(this.json_map) {\n if(json_maps.length && json_maps.length > 1) {\n json_maps.forEach(jm => {\n if(!this.map.hasLayer(jm)) {\n has_layers = false\n }\n })\n } else {\n if(!this.map.hasLayer(json_maps)) {\n has_layers = false\n } \n }\n } else {\n has_layers = false\n }\n\n return has_layers\n }", "title": "" }, { "docid": "41406a2b3f8cfc140ee84bb123dff979", "score": "0.5905909", "text": "function map_layer_check(map, layer)\n{\n\t\tif(!_.isUndefined(_.find(map.getLayers().getArray(), function(d){return d == layer;})))\n\t\t{return true;}\n\t\telse{return false;}\n}", "title": "" }, { "docid": "fc713d5bed369d3ccb7a074c1b22a539", "score": "0.58716214", "text": "function isLayerSpec(spec) {\n return spec['layer'] !== undefined;\n}", "title": "" }, { "docid": "a1decb2664a1521db73ea16f463b5fdb", "score": "0.58487064", "text": "function hasLayers() {\r\n var doc = activeDocument;\r\n if (doc.layers.length == 1 && doc.activeLayer.isBackgroundLayer) {\r\n alert('The active document has no layers.', 'No Layers', false);\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n}", "title": "" }, { "docid": "14da9b57dcb57c3beab977832a605bec", "score": "0.58110213", "text": "function checkIfActiveLayerAvailable() {\n\treturn true;\n}", "title": "" }, { "docid": "917e157cef78a47fdc3e39ab2273bd07", "score": "0.5764354", "text": "async function checkLayer() {\n await layerCenterGroup.clearLayers();\n await layerBuildingGroup.clearLayers();\n await layerStoreGroup.clearLayers();\n //if (map.hasLayer(layerStoreGroup)) {\n // await map.removeLayer(layerCenterGroup);\n // await map.removeLayer(layerStoreGroup);\n // await map.removeLayer(layerBuildingGroup);\n // layerCenterGroup = await new L.LayerGroup();\n // layerStoreGroup = await new L.LayerGroup();\n // layerBuildingGroup = await new L.LayerGroup();\n //}\n}", "title": "" }, { "docid": "4953e12f059616712a4058504f226229", "score": "0.57239014", "text": "function addBaseMapLayers(layerObj) {\n var baseMapLayer;\n\n switch (layerObj.layerType.toLowerCase()) {\n case \"imagewms\":\n baseMapLayer = new ol.layer.Image({\n title: layerObj.title,\n type: \"base\",\n visible: layerObj.options.visible,\n source: new ol.source.ImageWMS({\n url: layerObj.url,\n params: {\n VERSION: \"1.1.1\",\n LAYERS: layerObj.params.layers,\n FORMAT: layerObj.params.format\n },\n wrapX: false\n }),\n name: layerObj.title\n });\n break;\n case \"tilewms\":\n baseMapLayer = new ol.layer.Tile({\n title: layerObj.title,\n type: \"base\",\n visible: layerObj.options.visible,\n source: new ol.source.TileWMS({\n url: layerObj.url,\n params: {\n VERSION: \"1.1.1\",\n LAYERS: layerObj.params.layers,\n FORMAT: layerObj.params.format\n },\n wrapX: false\n }),\n name: layerObj.title\n });\n break;\n case \"xyz\":\n baseMapLayer = new ol.layer.Tile({\n title: layerObj.title,\n type: \"base\",\n visible: layerObj.options.visible,\n source: new ol.source.XYZ({\n url: layerObj.url,\n wrapX: false\n }),\n name: layerObj.title\n });\n break;\n }\n\n if (baseMapLayer != null) {\n // Add layer(s) to the layerSwitcher control\n baseMapGroup.getLayers().push(baseMapLayer);\n }\n }", "title": "" }, { "docid": "a1f0128fbd8deb80ae4a31d7ca516296", "score": "0.5687244", "text": "function floorHasThisLayer(floorPins, layer) {\n for (var i = 0; i < floorPins.length; i++) {\n var pin = floorPins[i];\n if (pin.LayerId === layer.Id) { // Case: the current floor has a pin corresponding to the given amenity/layer , return true\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "9957a9a3c6ccea12a5530294e841d71c", "score": "0.5679239", "text": "function validateLayer( __layer )\n{\n\tif ( __layer.kind == LayerKind.NORMAL ) {\n\t\tif ( __layer.typename == \"ArtLayer\" ) {\n\t\t\tif ( __layer.visible == true) {\n\t\t\t\t// if ( __layer.blendMode == BlendMode.NORMAL ) {\n\t\t\t\t\treturn true;\n\t\t\t\t// }\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false;\n}", "title": "" }, { "docid": "4f707a27bbe0b9dddd6f3d3a10761b87", "score": "0.5572033", "text": "function isConnectedToBase( stackElem, without, dbg_count )\n\t{\n\t\tif (typeof(dbg_count) == \"undefined\")\n\t\t\tdbg_count = 0;\n\t\t\t\n\t\tif (typeof(without) == \"undefined\")\n\t\t\twithout = null;\n\t\t\t\n\t\t$.bp( dbg_count > 150 );\t// oops, got stuck in a loop...\n\n\t\tif (stackElem == null)\n\t\t\treturn false;\n\t\t\t\n\t\tif (stackElem == without)\n\t\t\treturn false;\n\t\t\t\n\t\tif (stackElem.fConnectedTo == stackElem)\n\t\t\treturn true;\t\t// Already at base\n\t\treturn isConnectedToBase( stackElem.fConnectedTo, without, dbg_count + 1 );\n\t}", "title": "" }, { "docid": "e44e72ede576687d34c9de98bd8bd837", "score": "0.55500525", "text": "function ArtLayerNameCheck(name)\n{\n \n //check if layer name matches Rule Tile naming\n return Contains(name, \n [ \n \"Top\",\"Bottom\",\n \"Right\", \"Left\",\n \"Outer\", \"Inner\",\n \"Single\",\"Double\",\n \"Triple\", \"Quad\",\n ]);\n}", "title": "" }, { "docid": "6729c646f779bf244ce6eb77837bb8eb", "score": "0.5548346", "text": "drawGroupLayer(ctx, layer) {\n const { game } = this.props;\n\n const layerPosition = {\n x: (layer.x + layer.startx) * game.map.tilewidth + (layer.offsetx || 0),\n y: (layer.y + layer.starty) * game.map.tileheight + (layer.offsety || 0)\n };\n\n ctx.save();\n ctx.translate(layerPosition.x, layerPosition.x);\n\n layer.layers.forEach(layer => {\n this.drawLayer(ctx, layer);\n });\n\n ctx.restore();\n\n // Not cacheable as a whole, but all sublayers will be cached if possible.\n return false;\n }", "title": "" }, { "docid": "af1a49184064c00a37985bb4c879c5c3", "score": "0.553538", "text": "function layerIdsExist(occurence, network) {\n for (var i in occurence) {\n // Check all items in the occurence\n if (!layerIdExists(occurence[i].matchID, network)) {\n // Layer does not exist\n return false;\n }\n }\n return true; // All layers exist\n}", "title": "" }, { "docid": "abe99a46aa87c29090f0e40783d0d4c9", "score": "0.5527155", "text": "function removeAllEmptyLayerSets(obj) {\n var foundEmpty = true;\n for( var i = obj.layerSets.length-1; 0 <= i; i--) {\n if( removeAllEmptyLayerSets(obj.layerSets[i])) {\n obj.layerSets[i].remove();\n } else {\n foundEmpty = false;\n }\n }\n if (obj.artLayers.length > 0) {\n\t\tfoundEmpty = false;\n\t}\n return foundEmpty;\n}", "title": "" }, { "docid": "854fcb799628e1b64576cc58d3f2a1c4", "score": "0.54907084", "text": "function checkWin(){\n\t\tif(layerAmount == layerInD.length){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "ff7d6245d9e5ef73955ccb9214c204d2", "score": "0.5413825", "text": "isNewPosInBounds(layer, x, y, width, height){\n\t\tvar _x = layer.x;\n\t\tvar _y = layer.y;\n\t\tvar _width = layer.width;\n\t\tvar _height = layer.height;\n\t\t\n\t\tlayer.x = x;\n\t\tlayer.y = y;\n\t\tlayer.width = width;\n\t\tlayer.height = height;\n\t\t\n\t\tvar inbounds = true;\n\t\tlayer.getCorners().forEach(corner => {\n\t\t\tvar pos = Canvas.absolutePoint(corner.x, corner.y, layer.x, layer.y, layer.rotation);\n\t\t\tif (pos.x < 0 || pos.x > this.width || pos.y < 0 || pos.y > this.width) {\n\t\t\t\tinbounds = false;\n\t\t\t}\n\t\t});\n\t\tlayer.x = _x;\n\t\tlayer.y = _y;\n\t\tlayer.width = _width;\n\t\tlayer.height = _height;\n\t\treturn inbounds;\n\t}", "title": "" }, { "docid": "4d54898cc112548a20a93eac7f60ef65", "score": "0.5383998", "text": "hasBalancedGrouping(tokens) {\n const openStack = [];\n _.each(tokens, (token) => {\n if (token.type !== 'grouping') return;\n\n if (this.isOpenGroupToken(token)) {\n openStack.push(token);\n return;\n }\n\n if (this.openTokenMatchesCloser(_.last(openStack), token)) {\n openStack.pop();\n }\n });\n\n return _.isEmpty(openStack);\n }", "title": "" }, { "docid": "63f9d5f48dde0e30b57fcc888536c872", "score": "0.5375178", "text": "function isNeedExportLayer(layer) {\n\tif(layer.kind == LayerKind.TEXT || layer.visible == false) return false;\n\tvar type = getCtrlType(layer);\n\tfor each(var val in ArrNoNeedExport) {\n\t\tif(val == type) return false;\n\t}\n var arrParam = layer.name.split(\"_\");\n if(arrParam.length > 1) {\n return false;//公共资源不导出\n }\n\treturn true;\n}", "title": "" }, { "docid": "1e10aef4851a07c504845b2d411157ea", "score": "0.5373188", "text": "createLayer() {\n assert('BaseLayer\\'s \\'createLayer\\' should be overridden.');\n }", "title": "" }, { "docid": "8554046f868fa499de22e5c6d2184eee", "score": "0.53403306", "text": "function layerIdExists(id, network) {\n for (var i in network.layers) {\n // Iterate over all layers in the Network\n if (network.layers[i].id === id) {\n // Check if it has the searched ID\n return true;\n }\n }\n return false; // No layer with the searched ID\n}", "title": "" }, { "docid": "f3bf60a606e258341d8b34570770bad1", "score": "0.53284216", "text": "onlyDisplayValidLayers() {\n const validSource = 'regional';\n\n // get the layer list from the config file\n const { TMSLayers } = mapConfig;\n const layers = store.getStateItem('mapLayerDisplayStatus');\n\n // filter the layers based on current source\n Object.keys(layers).forEach((layer) => {\n const asource = TMSLayers.filter(TMSlayer => (\n TMSlayer.id === layer && TMSlayer.source === validSource\n ));\n\n // layer is on and not part of the tabs data so it needs to be off\n if (layers[layer] && asource.length === 0) {\n this.mapComponent.toggleVisLayerOff(layer);\n }\n\n // layer is on IS part of the tabs data os it needs to be on\n if (layers[layer] && asource.length > 0) {\n this.mapComponent.toggleVisLayerOn(layer);\n }\n });\n }", "title": "" }, { "docid": "9cc998aa1b3267c97f212a2b6307045f", "score": "0.5327151", "text": "getLayers(layerTypes) {\n //get the map layers\n var allLayers = this.map.getStyle().layers;\n //iterate through the layers to get the matching ones\n return allLayers.filter((layer) => {\n if (\n layer.hasOwnProperty(\"metadata\") &&\n layer.metadata.hasOwnProperty(\"type\")\n ) {\n return layerTypes.includes(layer.metadata.type);\n } else {\n return false;\n }\n });\n }", "title": "" }, { "docid": "21928ec3553e3d38980664aa03ebcf05", "score": "0.5323436", "text": "function CheckLayers(docLayers)\r{\r var list = STYLE_FABRIC_LAYERS.split(',');\r var listCount = list.length;\r var ontbreekt = \"\";\r var errorMsg = \"\";\r var meerDanEen = false;\r\r for ( i = 0; i < listCount; i++ )\r {\r\r var bestaat = false;\r var layerName = new String(list[i]);\r bestaat = IsElementOf(layerName, docLayers);\r\r if ( ! bestaat )\r {\r if ( ontbreekt != \"\" )\r {\r ontbreekt = ontbreekt + ', ';\r meerDanEen = true;\r }\r ontbreekt = ontbreekt + layerName\r }\r }\r if ( ontbreekt != \"\" ) {\r if ( meerDanEen )\r errorMsg = \"De volgende lagen ontbreken: \" + ontbreekt\r else\r errorMsg = \"De volgend laag ontbreekt: \" + ontbreekt;\r throw(errorMsg);\r }\r}", "title": "" }, { "docid": "d6d98a695e218f50f5d1e2949b619216", "score": "0.5304599", "text": "if (layer.name().startsWith('__') || layer.name().startsWith(SCType.SCBackground)) {\n continue;\n }", "title": "" }, { "docid": "ceb088b8bf8b7a2840df3cbaaf085ef0", "score": "0.5286423", "text": "function is_group_valid(group)\n{\n\tif (group.length <= 2)\n\t\treturn false;\n\t\n\tvar follow_num = true;\n\tvar same_colour = true;\n\tvar same_number = true;\n\tvar diffrent_colours = true;\n\t\n\tvar counter = null;\n\tvar colour = null;\n\tvar number = null;\n\tvar colours = [];\n\tfor (var i = 0; i < group.length; i++)\n\t{\n\t\tvar tile = group[i];\n\t\tif (counter == null)\n\t\t\tcounter = tile.number;\n\t\telse\n\t\t\tif (tile.number != ++counter)\n\t\t\t\tfollow_num = false;\n\t\t\n\t\tif (colour == null)\n\t\t\tcolour = tile.colour;\n\t\telse\n\t\t\tif (tile.colour != colour)\n\t\t\t\tsame_colour = false;\n\t\t\n\t\tif (number == null)\n\t\t\tnumber = tile.number;\n\t\telse\n\t\t\tif (tile.number != number)\n\t\t\t\tsame_number = false;\n\t\t\n\t\tif (colours.indexOf(tile.colour) != -1)\n\t\t\tdiffrent_colours = false;\n\t\tcolours.push(tile.colour);\n\t}\n\t\n\treturn (follow_num && same_colour) || (same_number && diffrent_colours);\n}", "title": "" }, { "docid": "09bba25c85050ce4c586ce3a784ae7b1", "score": "0.5275984", "text": "function isRoutingLayer(layer) {\n markers = placesLayer.eachLayer(function(marker) {return marker});\n numMarkers = markers.length;\n\n totalCount = 0\n latLonCount = 0\n layer.eachLayer(function(layer) {\n count += 1;\n if (layer.hasOwnProperty('_latlng')) {\n latLonCount += 1\n }\n });\n if (totalCount == numMarkers + 1 && latLonCount == totalCount - 1) {\n return true\n } else {\n return false\n }\n}", "title": "" }, { "docid": "237127f526c3c950bad7e97f84c7e157", "score": "0.5243351", "text": "_getBoundingBox() {\n assert('BaseLayer\\'s \\'_getBoundingBox\\' should be overridden.');\n }", "title": "" }, { "docid": "2381a1f6c828bb3ff5c72fb4bc31a639", "score": "0.5239474", "text": "function checkLayers(cat) {\n\t\t\t\tvar obj = this;\n\t\t\t\tentityIdx=pinLayers[cat];\n\t\t\t\tl=layers[cat];\n\t\t\t\tif((l!=undefined)&&(l.length!=0)) {\n\t\t\t\t\tif ( l[0].getVisible() ) {\n\t\t\t\t\t\t$('div#'+cat).removeClass('on');\n\t\t\t\t\t\t$('div#'+cat).children('ul.point-list').slideUp(); // to keep only one open - make option??\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( (cat != 'property') && (cat != 'featurepoint')) {\n\t\t\t\t\t\t\t$('.feature-list').each(function() {\n\t\t\t\t\t\t\t\tif ($(this).hasClass('on')) {\n\t\t\t\t\t\t\t\t\tvar featureid = $(this).attr('id').toString().substr(13);\n\t\t\t\t\t\t\t\t\tvar pinidx = getPinIndex(featureid);\n\t\t\t\t\t\t\t\t\tl2=layers[featureid];\n\n\t\t\t\t\t\t\t\t\t$('div#feature-list-'+featureid).removeClass('on');\n\t\t\t\t\t\t\t\t\t$('div#feature-list-'+featureid).addClass('off');\n\t\t\t\t\t\t\t\t\t$(this).removeClass('on');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tvar cats = cat===null?categories:[cat];\n\t\t\t\t\t\t\t$.each(cats, function(i, val) {\n\t\t\t\t\t\t\t\tvar shapes = [];\n\t\t\t\t\t\t\t\t$.each(items, function(j) {\n\t\t\t\t\t\t\t\t\tvar catSelectedArray = new Array( );\n\t\t\t\t\t\t\t\t\tvar currarray = String(items[j].category);\n\t\t\t\t\t\t\t\t\tcatSelectedArray = currarray.split(\",\");\n\n\t\t\t\t\t\t\t\t\tfor (x in catSelectedArray){\n\t\t\t\t\t\t\t\t\t\tif(catSelectedArray[x]==val) {\n\t\t\t\t\t\t\t\t\t\t\tvar loc = getCenterPoint(j);\n\t\t\t\t\t\t\t\t\t\t\tcenterArray.push(loc);\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});\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tcenterArray = $.uniqueArray(centerArray);\n\t\t\t\t\t\t\tsetBestView();\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t$('div#'+cat).removeClass('off');\n\t\t\t\t\t\t$('div#'+cat).addClass('on');\n\t\t\t\t\t}\n\t\t\t\t\tfor (i = 0; i < l.length; i++) {\n\t\t\t\t\t\tif(l[i]!=undefined) {\n\t\t\t\t\t\t\tif(l[i].getVisible() == true) {\n\t\t\t\t\t\t\t\tl[i].setVisible(false);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tl[i].setVisible(true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}", "title": "" }, { "docid": "b1d242ad78a323d300b350d194e49e09", "score": "0.52298504", "text": "function checkWFSLayers() {\n\t var layer = map.layers;\n\t var layerCounter = 0;\n\t for(var a = 0; a < layer.length; a++ ) {\n\t\tif(layer[a].CLASS_NAME == 'OpenLayers.Layer.Vector') {\n\t\t if(layer[a].getVisibility() == true) {\n\t\t\tlayerCounter = layerCounter + 1;\n\t\t }\n\t\t}\n\t };\n\t return layerCounter;\n\t}", "title": "" }, { "docid": "34d4d935ad1e09c08b34615895e8b1f8", "score": "0.5203372", "text": "function le(t) {\n return null !== t.collectionGroup;\n}", "title": "" }, { "docid": "d2cc1da5603e1bdaaadeda9ccf5d24db", "score": "0.519801", "text": "_hasAncestorOfType(type){return!1}", "title": "" }, { "docid": "daa7d220bcc918a7b9e91eb8a46ecf41", "score": "0.51847816", "text": "static isGroupLoaded(groupId) {\n return this._loadedGroups.indexOf(groupId) !== -1;\n }", "title": "" }, { "docid": "47a706f2344f2219734127039dc63755", "score": "0.516996", "text": "function getLayerVisibility() {\n var layers = {},\n hex = document.getElementById('hex'),\n points = document.getElementById('points');\n if (hex && points) {\n // If we have the controls, use their state as the config\n layers.hex = hex.checked;\n layers.points = points.checked;\n }\n return layers;\n }", "title": "" }, { "docid": "d26d926eadaa56c83812f8752d289c28", "score": "0.51573086", "text": "static getGroupsAndLayers(grp, filterFn) {\n const layers = [];\n filterFn =\n filterFn ||\n function (_lyr, _idx, _arr) {\n return true;\n };\n LayerSwitcher.forEachRecursive(grp, function (lyr, idx, arr) {\n if (lyr.get('title')) {\n if (filterFn(lyr, idx, arr)) {\n layers.push(lyr);\n }\n }\n });\n return layers;\n }", "title": "" }, { "docid": "5a9107c2f6635f91f102c5634a8b20a4", "score": "0.51570123", "text": "isValidGroup() {\n // To ensure we can find the keyboard root node to appropriately respond to\n // visibility changes, never mark it as invalid.\n return true;\n }", "title": "" }, { "docid": "2711b7a6ac010d04fab534b2ee60280c", "score": "0.5141496", "text": "function fn(t) {\n return null !== t.collectionGroup;\n}", "title": "" }, { "docid": "dc4a7cf104c3769355c16a0b64089ea5", "score": "0.5136749", "text": "wantsFeature(layer, geometryType) {\n return (this.getOptimizedStyleSet(this.m_tmpOptimizedSubSetKey.set(layer, geometryType))\n .length > 0);\n }", "title": "" }, { "docid": "2ee1aa9936796cedd707f906ce9804e6", "score": "0.5131374", "text": "function Zt(t) {\n return null !== t.collectionGroup;\n}", "title": "" }, { "docid": "91285eec97e78f0a8d88318090aea2dc", "score": "0.5129392", "text": "function ge(t) {\n return null !== t.collectionGroup;\n}", "title": "" }, { "docid": "72be0dc6ceb1741bc3006bdfd1a891ba", "score": "0.5121702", "text": "function shouldFetchGroup(state)\n{\n const group = state.group;\n\n if (!group.group) {\n return true;\n } else if (group.isFetching) {\n return false;\n } else {\n return group.didInvalidate;\n }\n}", "title": "" }, { "docid": "4466839ec01b64202caf6c48e0dc9272", "score": "0.5116094", "text": "function getSublayers(d) {\r\n //If object d has a sublayers property, return it\r\n if (d.hasOwnProperty('sublayers')) {\r\n return d.sublayers\r\n }\r\n //Otherwise return 0\r\n return 0\r\n }", "title": "" }, { "docid": "af74911eae8d75669825b833a3decaac", "score": "0.50863", "text": "isComposite() {\n return this.regions.length > 0;\n }", "title": "" }, { "docid": "dfb3e948e8cacd63571dc93bed31e55d", "score": "0.5078097", "text": "static isBitmapFontsLoaded(groupId) {\n if (!this._lazyBitmapFontsToLoad.find((elem) => {\n return elem.group.indexOf(groupId) !== -1;\n })) {\n return true;\n }\n return this._bitmapFontsLoadedGroups.indexOf(groupId) !== -1;\n }", "title": "" }, { "docid": "1d45507be926dda29267316d8f29fcb9", "score": "0.5058799", "text": "static isAssetsLoaded(groupId) {\n if (!this._lazyAssetToLoad.find((elem) => {\n return elem.group.indexOf(groupId) !== -1;\n })) {\n return true;\n }\n return this._assetsLoadedGroups.indexOf(groupId) !== -1;\n }", "title": "" }, { "docid": "50e6e108716f2777a028d75a1b38802b", "score": "0.50476176", "text": "function groupLayers(myComp,startIndex){\r \r var layers = myComp.layers;\r var refLayer = myComp.layer(startIndex);\r var refInPoint = refLayer.inPoint;\r var refOutPoint = refLayer.outPoint;\r var groupArray = new Array;\r groupArray.push(refLayer.index);\r alert(refInPoint);\r for (l=refLayer.index-1; l>=1; l--){\r var curLayerInPoint = layers[l].inPoint; \r var curLayerOutPoint = layers[l].outPoint; \r if((curLayerInPoint >= refInPoint)&&(curLayerOutPoint <= refOutPoint)){\r groupArray.push(layers[l].index);\r if(l==1){\r shotsArray.push(groupArray);\r }\r }else {\r shotsArray.push(groupArray);\r groupLayers(myComp,l);\r }\r \r }\r}", "title": "" }, { "docid": "96a7a6398b4baab89d4aa97d1b36c314", "score": "0.5033604", "text": "function hasCustomParameters (layerName) {\r\tvar result = false;\r\tif (layerName.search(patternRotate) != -1 || layerName.search(patternScale) != -1) {\r\t\tresult = true;\r\t}\r\r\treturn result;\r}", "title": "" }, { "docid": "e36de5d42f6a5b65b3c65fa3974f8312", "score": "0.5026706", "text": "function enableBaselayers(){\n\n // Store baselayer tiles\n var OpenStreetMap_HOT = L.tileLayer('http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', {\n maxZoom: 19,\n attribution: '&copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>, Tiles courtesy of <a href=\"http://hot.openstreetmap.org/\" target=\"_blank\">Humanitarian OpenStreetMap Team</a>'\n });\n\n var Stamen_Watercolor = L.tileLayer('http://stamen-tiles-{s}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png', {\n attribution: 'Map tiles by <a href=\"http://stamen.com\">Stamen Design</a>, <a href=\"http://creativecommons.org/licenses/by/3.0\">CC BY 3.0</a> &mdash; Map data &copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>',\n subdomains: 'abcd',\n minZoom: 1,\n maxZoom: 16,\n ext: 'png'\n });\n\n var Stamen_Toner = L.tileLayer('http://stamen-tiles-{s}.a.ssl.fastly.net/toner/{z}/{x}/{y}.png', {\n attribution: 'Map tiles by <a href=\"http://stamen.com\">Stamen Design</a>, <a href=\"http://creativecommons.org/licenses/by/3.0\">CC BY 3.0</a> &mdash; Map data &copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>',\n subdomains: 'abcd',\n minZoom: 0,\n maxZoom: 20,\n ext: 'png'\n });\n\n // Store above tiles in baselayers object - will iterate through object and add to DOM\n window.baselayers = {\n 0: {name: \"OSM HOT\", layer: OpenStreetMap_HOT},\n 1: {name: \"Stamen Watercolor\", layer: Stamen_Watercolor},\n 2: {name: \"Stamen Toner\", layer: Stamen_Toner}\n }\n\n // Turn on default baselayer or chosen layer from last session\n var selectedBaseLayer = document.cookie.replace(/(?:(?:^|.*;\\s*)selectedBaseLayer\\s*\\=\\s*([^;]*).*$)|^.*$/, \"$1\");\n if(selectedBaseLayer){\n map.addLayer(baselayers[selectedBaseLayer].layer); \n } else {\n map.addLayer(baselayers[0].layer);\n }\n\n // Populate basemap switcher dropdown menu\n for(x in baselayers){\n console.log(baselayers[x].name);\n $('#baselayersMenu').append('<li><a href=\"#\" onclick=\"switchBaselayer('+x+')\">'+baselayers[x].name+'</a></li>');\n \n // Show a loading css div when basemap tiles are loading\n $(baselayers[x].layer).on('loading', function(){\n $('#loaders').fadeIn();\n }); \n // Hide loading css when baselayer has finished loading\n $(baselayers[x].layer).on('load', function(){\n $('#loaders').fadeOut();\n });\n }\n}", "title": "" }, { "docid": "fb58395069ea9f569749b9f3e787985f", "score": "0.49983126", "text": "function initLayers() {\n\n var mapBaseTile = null;\n var mapGroundTile = null;\n\n for (var key in tilesets) {\n var tileset = tilesets[key];\n\n if (tileset.did === 0) {\n mapBaseTile = tileset;\n } else if (tileset.did === 1) {\n mapGroundTile = tileset;\n }\n if (isDefined(mapBaseTile) && isDefined(mapGroundTile)) {\n break;\n }\n }\n\n if (isDefined(mapBaseTile) && isDefined(mapBaseTile.image)) {\n tileMap.initBaseLayer({\n path: assetdir + mapBaseTile.image\n });\n }\n\n if (isDefined(mapGroundTile) && isDefined(mapGroundTile.image)) {\n tileMap.initGroundLayer({\n path: assetdir + mapGroundTile.image\n });\n }\n\n tileMap.setupGroundLayers();\n }", "title": "" }, { "docid": "cd55b23080305bf97668532c6a25063a", "score": "0.49925822", "text": "function isBaseClassOf(apiItem) {\n return apiItem.hasOwnProperty(_isOptional);\n }", "title": "" }, { "docid": "5df15c4ed2437867f45af9dfa82a60e2", "score": "0.49903056", "text": "checkIfDefault(group) {\n if(group.properties.default === null) { \n return true;\n \n } else { \n return false;\n }\n \n }", "title": "" }, { "docid": "7e3e4b84b01d531906ab346296b79867", "score": "0.4983518", "text": "function featureGroupOverRadiusCircle() {\n // Make sure groups are on map before bringing to front\n // if (json_group_four._map !== null) {\n // json_group_four.bringToFront();\n // }\n if (json_group_two._map !== null) {\n json_group_two.bringToFront();\n }\n if (json_group._map !== null) {\n json_group.bringToFront();\n }\n // if (json_group_three._map !== null) {\n // json_group_three.bringToFront();\n // }\n }", "title": "" }, { "docid": "2e477837d4d36cf57b4c9936fb5f1727", "score": "0.49817175", "text": "function toggleLayer(group, layer, toggle){\r\n\t \tif(group == 'null' || layer == 'null')\r\n\t\t\treturn;\r\n\r\n\t\t//toggle selection\r\n\t\tif(!toggle) {\r\n\t\t\t$('li[layer=\"' + layer +'\"][group=\"' + group +'\"]').toggleClass(\"active\");\r\n\t\t}\r\n\t\tfor (var i in layers[group][layer]) {\r\n//set search url\r\n\t\t\t$( \"#search\" ).combogrid( \"option\", \"url\", layers[group][layer][i][\"search_url\"]);\r\n\t\t\t//set grid url\r\n\t\t\tgrid_base_url = layers[group][layer][i][\"grid_url\"];\r\n\t\t\tupdateSiteGrid();\t\r\n\t\t\tswitch(layers[group][layer][i][\"type\"]){\r\n\t\t\t\r\n\t\t\t\tcase \"WMS\":\r\n\t\t\t\t\tif(layers[group][layer][i][\"layer\"] == undefined){\r\n\t\t\t\t\t\tlayers[group][layer][i][\"layer\"] = buildWMS(layer, layers[group][layer][i][\"url\"], layers[group][layer][i][\"options\"]);\r\n\t\t\t\t\t\tmap.addLayer(layers[group][layer][i][\"layer\"]);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\tmap.removeLayer(layers[group][layer][i][\"layer\"]);\r\n\t\t\t\t\t\tdelete layers[group][layer][i][\"layer\"];\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"KML\":\r\n\t\t\t\t\tif(layers[group][layer][i][\"layer\"] == undefined){\r\n\t\t\t\t\t \r\n\t\t\t\t\t\tlayers[group][layer][i][\"layer\"] = buildKML(layer, layers[group][layer][i][\"url\"]);\r\n\t\t\t\t\t\tmap.addLayer(layers[group][layer][i][\"layer\"]);\r\n\t\t\t\t\t\t//add cell tech legend\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tmap.removeLayer(layers[group][layer][i][\"layer\"]);\r\n\t\t\t\t\t\tdelete layers[group][layer][i][\"layer\"];\r\n\t\t\t\t\t\t//remove cell tech legend\r\n\t\t\t\t\t\tvar legend_url = layers[group][layer][i][\"legend_url\"];\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "1836d23d3d4cd85803cb6ba76ddd98e6", "score": "0.49779212", "text": "function initBaseLayer() {\n // set basemap tilelayer URL if it does not already exist\n if (!self.basemapUrl) {\n self.basemapUrl = self.getScopeDefaults().basemapUrl;\n }\n\n self._baseLayer = L.tileLayer(self.basemapUrl).addTo(self._map);\n }", "title": "" }, { "docid": "192c3316bbf6e0c79f1647df63ce7e23", "score": "0.49665502", "text": "function WLayer_isRendered()\n{\n return this.rendered;\n}", "title": "" }, { "docid": "70391fc080ea0c894f0fa106fa885ba0", "score": "0.49649334", "text": "connected(layer) {\n switch (true) {\n case (this.countAllToAll(layer) == this.size * layer.size) :\n return Layer.connectionType.ALL_TO_ALL;\n\n case (this.countOneToOne(layer) == this.size) :\n return Layer.connectionType.ONE_TO_ONE;\n }\n }", "title": "" }, { "docid": "0b7be3b1f3bccc2a113d781d5796c2b4", "score": "0.49629086", "text": "function updateDoubleBaseLayer()\n\t{\n\t\tmap = report.getComponent(\"map\");\n\t\tactiveMap = report.getComponent(\"activeMap\");\n\t\tmapData.noneBaseLayers = []; // Remove non-base layers from layer list.\n\n\t\tif (mapData.baseLayers.length > 1)\n\t\t{\n\t\t\tvar layer = mapData.baseLayers[1];\n\t\t\tlayer.dataField = dataGroup.thematic.getDataField();\n\t\t\tlayer.highlightColor = report.highlightColor;\n\t\t\tlayer.selectionColor = report.selectionColor;\n\t\t\tlayer.highlightOpacity = report.highlightOpacity;\n\t\t\tlayer.selectionOpacity = report.selectionOpacity;\n\t\t\tif (!layer.displayLabelsOnly) layer.interactive = true;\n\t\t\tlayer.dataLabel = report.config.getComponent(\"map\").getProperty(\"tip\"+dataGroup.suffix);\n\t\t\tlayer.tipFunction = function(item)\n\t\t\t{\n\t\t\t\tvar s = ia.tipFunction(item, \"map\", dataGroup.suffix);\n\t\t\t\treturn s;\n\t\t\t};\n\n\t\t\tif (report.config.template == ia.DOUBLE_BASELAYER_REPORT)\n\t\t\t{\n\t\t\t\tinteractionGroup.addComponent(layer);\n\t\t\t}\n\t\t\tif (report.config.template == ia.DOUBLE_BASELAYER_REPORT_NEW)\n\t\t\t{\n\t\t\t\tlayer.selectable = false;\n\t\t\t}\n\t\t\tmap.addLayer(layer);\n\t\t}\n\t}", "title": "" }, { "docid": "c3d61ffb1b281ff912c2249ed792d5fe", "score": "0.49577332", "text": "function hasAnyFeatures() {\n var has_features = false;\n markers.eachLayer(function (layer) {\n if (!$.isEmptyObject(layer)) {\n has_features = true;\n }\n });\n return has_features;\n }", "title": "" }, { "docid": "952cebeb6a5a23ed1bf31a388898c1fc", "score": "0.49522424", "text": "function addLayer(l)\n{\nvar added = false;\nfor (var i = 0;i<layers.length;i++ )\n{\nif (l.index == layers[i].index)\n{\nadded = true;\nbreak;\n}\n}\nif (!added) layers.push(l);\n}", "title": "" }, { "docid": "9b3f9303817758e531d26618227bdf51", "score": "0.49454865", "text": "function checkGroup(name, context) {\n var checkOut;\n for (var i = 0; i < context.length; i++) {\n if (group[i].name === name) {\n checkOut = true;\n break;\n }\n else {\n checkOut = false;\n };\n };\n return checkOut;\n}", "title": "" }, { "docid": "34b8e34fed4e412daf3d623fb0301f05", "score": "0.49447358", "text": "function getVisibleLayers() {\n // use .filter to count boolean true values\n // TODO: make nicer\n return layerRegistry.getLayersByType(Geo.Layer.Types.ESRI_FEATURE).concat(layerRegistry.getLayersByType(Geo.Layer.Types.ESRI_DYNAMIC)).filter(function (l) {\n return l.visibleAtMapScale;\n }).concat(layerRegistry.getLayersByType(Geo.Layer.Types.OGC_WMS)).length;\n }", "title": "" }, { "docid": "401b460edcf8797db6546abffb950f24", "score": "0.4942818", "text": "function hasMinorGroup(map)\n{\n for (var index in map)\n {\n if (index != 'weight')\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "8ed752a112b8bd542b42a214d25560e2", "score": "0.49340457", "text": "triggerToggleLayerGroup() {\n const datasetID = this.props.dataset.id;\n const addLayerGroup = !this.props.isLayerGroupAdded(datasetID);\n this.props.toggleLayerGroup(datasetID, addLayerGroup);\n }", "title": "" }, { "docid": "57e475776d15dd1582662ccd88bdcc16", "score": "0.4932358", "text": "get basicGeometryLoaded() {\n for (const kind of this.m_basicGeometryKinds) {\n if (!this.m_geometryKindsLoaded.has(kind)) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "061fedf6e20f22aa795f1fa31c3e1330", "score": "0.4931768", "text": "function removeLayer_check(map, layer)\n{\n\tif(map_layer_check(map, layer))\n\t{map.removeLayer(layer);}\n}", "title": "" }, { "docid": "ef540859bd2dd94a60a0fe3664bd87a3", "score": "0.4923869", "text": "function collectClippingLayers( )\n{\n\tvar i = layerIndex;\n\tvar currentLayer = layerParent.layers[ i ];\n\n\twhile ( currentLayer.grouped == true )\n\t{\n\t\tcurrentLayer = layerParent.layers[ i ];\n\t\tvar isvalid = validateLayer( currentLayer );\n\n\t\tif ( currentLayer.typename == \"LayerSet\" ) {\n\t\t\tcollectLayersBelow( 0, currentLayer );\n\t\t} else if ( isvalid == true ) {\n\t\t\tcollectedLayers.push( currentLayer );\n\t\t}\n\n\t\ti++;\n\t}\n}", "title": "" }, { "docid": "f41482e15fba3f442457017a702ffa71", "score": "0.49200445", "text": "function changeBaselayer(tmpDiv) {\n //***Remove old layer\n var layerDivs = d3.select(\"#baselayerListDropdown\").selectAll(\"div\");\n \n layerDivs[0].forEach(function(tmpLayer) {\n if(d3.select(tmpLayer).select(\"span\").style(\"visibility\") == \"visible\") {\n d3.select(tmpLayer).select(\"span\").style(\"visibility\", \"hidden\");\n map.removeLayer(layerNames.baseLayers.values[d3.select(tmpLayer).property(\"value\")]);\n }\n });\n\n //***Add new layer\n d3.select(tmpDiv).select(\"span\").style(\"visibility\", \"visible\");\n map.addLayer(layerNames.baseLayers.values[tmpDiv.value]);\n layerNames.baseLayers.values[tmpDiv.value].bringToBack(); \n }", "title": "" }, { "docid": "209d83f4c2a784e4409611812b6f5086", "score": "0.49195316", "text": "_isMountsBound () {\n log.trace('_isMountsBound')\n return !!this.boundMounts.length\n }", "title": "" }, { "docid": "e740f099a0d874a07b86f6240f43c152", "score": "0.48781425", "text": "function isBoundingBoxDrawn() {\n if (ll == undefined || ur == undefined) {\n return false;\n }\n var wblon = ll.lon.toFixed(2);\n var eblon = ur.lon.toFixed(2);\n var nblat = ur.lat.toFixed(2);\n var sblat = ll.lat.toFixed(2);\n if (!isNaN(wblon) && !isNaN(eblon) && !isNaN(nblat) && !isNaN(sblat) && submitFlag == 1) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "143c9acf535d81ae36fcfcf6c1164c9f", "score": "0.4876944", "text": "static _isExistsContextName(group) {\n const context = GameState.current;\n\n if (group === undefined || group.state === undefined) {\n return false;\n }\n\n if (group.state.config.name !== context.config.name) {\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "7a4dff19970926b1f8d402692aef09cc", "score": "0.48754674", "text": "_portalContainsElement(element) {\n // This might break our control when used inside a Layer...\n return false;\n //return element && !!this._root && FluentUIBaseComponent portalContainsElement(element, this._root.current);\n }", "title": "" }, { "docid": "c5fb08854375933314f956354fc305eb", "score": "0.4871643", "text": "function ae(t) {\n return null !== t.collectionGroup;\n}", "title": "" }, { "docid": "dceb73816ad93a996a4afad28eebde4c", "score": "0.4855741", "text": "function isGroupGeometry(geometry, state) {\n\t\treturn isGroupComponent(geometry, getGeometryData(state)[/* groupCountMap */8]);\n\t}", "title": "" }, { "docid": "c4a69b22d5a198cd94623dc0a7d3c90e", "score": "0.48534796", "text": "function hasOverlap(fabric, outputObj) {\n // iterate through all points included in the shape and determine if any have already been visited\n for (let i = outputObj.x; i < outputObj.xMax; i++) {\n for (let j = outputObj.y; j < outputObj.yMax; j++) {\n if (fabric[i][j] > 1){\n return true;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "f0a144652b84a7c44f4b6faa7235102b", "score": "0.48515216", "text": "function checkCrsForLayer(layer, crs) {\n var result = false;\n for (var i = 0; i < layer.crs.length; i++) {\n console.log(\"layer.crs[i]: \" + layer.crs[i]);\n if (layer.crs[i] === crs) {\n result = true;\n break;\n }\n }\n return result;\n}", "title": "" }, { "docid": "cff327f22a663d2ce2588559a841a53b", "score": "0.48443058", "text": "static hasTrainings(weeks) {\n function blockHasTrainings(block) {\n return Boolean(block.training_module_ids && block.training_module_ids.length);\n }\n function weekHasTrainings(week) {\n if (!week.blocks.length) { return false; }\n return Boolean(find(week.blocks, blockHasTrainings));\n }\n if (!weeks.length) { return false; }\n return Boolean(find(weeks, weekHasTrainings));\n }", "title": "" }, { "docid": "82fe04e621a2500be8aa190abc1f2841", "score": "0.48433942", "text": "function getTotal() {\n\n return layers.length;\n\n }", "title": "" }, { "docid": "652ac6e098765b48418a93b253ed097c", "score": "0.48330906", "text": "function isRequiredmentLayerAdded(reqid){\n var f=false;\n for(var i=0;i<$rootScope.capasreq.length;i++){\n var reqId=$rootScope.capasreq[i].nombre;\n if(reqId==reqid){\n f=true;\n break;\n }\n }\n return f;\n\n }", "title": "" }, { "docid": "98586ebb88248f5a14944825858a5215", "score": "0.48305976", "text": "hasGameParent(){\n\t\tlet parent = this.parent;\n\t\twhile( parent ){\n\t\t\tif( parent instanceof Game )\n\t\t\t\treturn true;\n\t\t\tparent = parent.parent;\n\t\t}\n\t}", "title": "" }, { "docid": "662c4c4e378a342a35a0eef12a584070", "score": "0.48297822", "text": "computeHasRelatedTabGroupsOrBookmarks_() {\n return this.memory.relatedTabGroups.length > 0 ||\n this.memory.bookmarks.length > 0;\n }", "title": "" }, { "docid": "7a1de65555655773f8f6e9bc29735f28", "score": "0.48295438", "text": "function switchBaselayer(layerNum){\n // Ask map if chosen layer already on: true / false\n var alreadyOn = map.hasLayer(baselayers[layerNum].layer);\n // If false remove current baselayer by looping thorugh baselayers object and removing all baselayers from map\n // better way to do this? layer ID?\n if(!alreadyOn){\n for(var x in baselayers){\n map.removeLayer(baselayers[x].layer);\n }\n }\n map.addLayer(baselayers[layerNum].layer);\n \n // Add base layer selected to cookie\n document.cookie = \"selectedBaseLayer=\"+layerNum;\n}", "title": "" }, { "docid": "43aec3377e364eab0712809e36569bb8", "score": "0.48261786", "text": "function calculateBase(groupItem) {\n var extent;\n var baseAxis = groupItem.axis;\n var seriesModels = groupItem.seriesModels;\n var seriesCount = seriesModels.length;\n var boxWidthList = groupItem.boxWidthList = [];\n var boxOffsetList = groupItem.boxOffsetList = [];\n var boundList = [];\n var bandWidth;\n\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n } else {\n var maxDataCount = 0;\n each(seriesModels, function (seriesModel) {\n maxDataCount = Math.max(maxDataCount, seriesModel.getData().count());\n });\n extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / maxDataCount;\n }\n\n each(seriesModels, function (seriesModel) {\n var boxWidthBound = seriesModel.get('boxWidth');\n\n if (!zrUtil.isArray(boxWidthBound)) {\n boxWidthBound = [boxWidthBound, boxWidthBound];\n }\n\n boundList.push([parsePercent(boxWidthBound[0], bandWidth) || 0, parsePercent(boxWidthBound[1], bandWidth) || 0]);\n });\n var availableWidth = bandWidth * 0.8 - 2;\n var boxGap = availableWidth / seriesCount * 0.3;\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\n var base = boxWidth / 2 - availableWidth / 2;\n each(seriesModels, function (seriesModel, idx) {\n boxOffsetList.push(base);\n base += boxGap + boxWidth;\n boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));\n });\n}", "title": "" }, { "docid": "43aec3377e364eab0712809e36569bb8", "score": "0.48261786", "text": "function calculateBase(groupItem) {\n var extent;\n var baseAxis = groupItem.axis;\n var seriesModels = groupItem.seriesModels;\n var seriesCount = seriesModels.length;\n var boxWidthList = groupItem.boxWidthList = [];\n var boxOffsetList = groupItem.boxOffsetList = [];\n var boundList = [];\n var bandWidth;\n\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n } else {\n var maxDataCount = 0;\n each(seriesModels, function (seriesModel) {\n maxDataCount = Math.max(maxDataCount, seriesModel.getData().count());\n });\n extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / maxDataCount;\n }\n\n each(seriesModels, function (seriesModel) {\n var boxWidthBound = seriesModel.get('boxWidth');\n\n if (!zrUtil.isArray(boxWidthBound)) {\n boxWidthBound = [boxWidthBound, boxWidthBound];\n }\n\n boundList.push([parsePercent(boxWidthBound[0], bandWidth) || 0, parsePercent(boxWidthBound[1], bandWidth) || 0]);\n });\n var availableWidth = bandWidth * 0.8 - 2;\n var boxGap = availableWidth / seriesCount * 0.3;\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\n var base = boxWidth / 2 - availableWidth / 2;\n each(seriesModels, function (seriesModel, idx) {\n boxOffsetList.push(base);\n base += boxGap + boxWidth;\n boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));\n });\n}", "title": "" }, { "docid": "070c1249a87b16da8c03d7fd24676459", "score": "0.48242676", "text": "function layerType(layerObj){//WIP\r try{\r var curLayer, instanceOfArray, instanceOfArrayLength, result;\r function avLayerType(lObj){\r try{\r var l= lObj;\r var iSource=l.source;\r var lMainSource= lSource.mainSource;\r var lFile= lMainSource.file;\r if(!l.hasVideo){\r return \"AudioLayer\"\r }\r else if(lSource instanceof CompItem){\r return \"PreCompLayer\"\r }\r else if(lSource.frameDuration<1){\r if(lMainSource instanceof PlaceholderSource){\r return \"PlaceholderVideoLayer\"; \r }\r else if(lSource.name.toString().indexOf(\"].\")!=(-1)){ //name [000-0001] CHEAT\r return \"ImageSequenceLayer\"; \r }\r else{\r return \"VideoLayer\"\r }\r }else if(lSource.frameDuration==1){\r \r }\r }catch(err){alert(err.line.toString() +\"\\r\" +err.toString())}\r }\r curLayer=layerObj;\r instanceOfArray= new Array(AVLayer,CameraLayer,LightLayer, ShapeLAyer, TextLayer);\r instanceOfArrayLength= instanceOfArray.length;\r for(var a=0;a<instanceOfArrayLength;a++){\r if(curLayer.guideLayer){\r return \"GuideLayer\";\r }\r else if(curLayer.isTrackMatte){ return \"TrackMatteLayer\";}\r else if(curLayer.adjustmentLayer){return \"AdjustmentLayer\";}\r else if(curLayer instanceof instanceOfArray[a]){\r result=instanceOfArray[a].name;\r break;\r }\r }\r if(result==\"AVLayer\"){\r result= avLayerType(curLayer);\r }\r return result;\r }\r catch(err){alert(err.line.toString() +\"\\r\" +err.toString())}\r }", "title": "" }, { "docid": "8d5ac7c49c37772ea0b63b73eba1d31a", "score": "0.4822939", "text": "getLayerCount() {\n return this.layers.length;\n }", "title": "" }, { "docid": "280ef5110f510d29adb4441d6d9ad672", "score": "0.48185524", "text": "function viewLayerGroup(layer, groupLayer) {\n console.log(\"entro al admin de capas!!\");\n if (layer.getVisible()) {\n groupLayer.setVisible(false);\n layer.setVisible(false);\n } else {\n groupLayer.setVisible(true);\n layer.setVisible(true);\n }\n }", "title": "" }, { "docid": "2b898d88e9c3da8e542356ac3d5060e3", "score": "0.48140097", "text": "function buildLeafBaseLayers() {\n\n\t\t// Create the default layers\n\t\tstreetMapLayer = L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {\n\t\t\tattribution: 'Imagery from <a href=\"http://mapbox.com/about/maps/\">MapBox</a> &mdash; Map data &copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>',\n\t\t\tsubdomains: 'abcd',\n\t\t\tid: 'juzzbott.mn25f8nc',\n\t\t\taccessToken: 'pk.eyJ1IjoianV6emJvdHQiLCJhIjoiMDlmN2JlMzMxMWI2YmNmNGY2NjFkZGFiYTFiZWVmNTQifQ.iKlZsVrsih0VuiUCzLZ1Lg'\n\t\t});\n\n\t\ttopoMapLayer = L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {\n\t\t\tattribution: 'Imagery from <a href=\"http://mapbox.com/about/maps/\">MapBox</a> &mdash; Map data &copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>',\n\t\t\tsubdomains: 'abcd',\n\t\t\tid: 'juzzbott.mn24imf3',\n\t\t\taccessToken: 'pk.eyJ1IjoianV6emJvdHQiLCJhIjoiMDlmN2JlMzMxMWI2YmNmNGY2NjFkZGFiYTFiZWVmNTQifQ.iKlZsVrsih0VuiUCzLZ1Lg'\n\t\t});\n\n\t\taerialMapLayer = L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {\n\t\t\tattribution: 'Imagery from <a href=\"http://mapbox.com/about/maps/\">MapBox</a> &mdash; Map data &copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>',\n\t\t\tsubdomains: 'abcd',\n\t\t\tid: 'juzzbott.mn74md27',\n\t\t\taccessToken: 'pk.eyJ1IjoianV6emJvdHQiLCJhIjoiMDlmN2JlMzMxMWI2YmNmNGY2NjFkZGFiYTFiZWVmNTQifQ.iKlZsVrsih0VuiUCzLZ1Lg',\n\t\t\tmaxZoom: 17\n\t\t});\n\t}", "title": "" }, { "docid": "c9e83b4b1b237765e0e481721d116cbb", "score": "0.4811098", "text": "get hasGroupableColumns() {\n return this.columnList.some((col) => col.groupable && !col.columnGroup);\n }", "title": "" }, { "docid": "c9e83b4b1b237765e0e481721d116cbb", "score": "0.4811098", "text": "get hasGroupableColumns() {\n return this.columnList.some((col) => col.groupable && !col.columnGroup);\n }", "title": "" }, { "docid": "6ec6f2110a81053fa3e7950eaf2baca9", "score": "0.4810479", "text": "function isAncestor(instA, instB) {\n !('_hostNode' in instA) ? \"development\" !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0;\n !('_hostNode' in instB) ? \"development\" !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0;\n\n while (instB) {\n if (instB === instA) {\n return true;\n }\n instB = instB._hostParent;\n }\n return false;\n}", "title": "" }, { "docid": "9c32897a4ce8ea3b199b1e17cdf7c0dd", "score": "0.48101634", "text": "canResizeActiveLayer(width, height){\n\t\tconst inBounds = this.isNewPosInBounds(this.activeLayer, this.activeLayer.x, this.activeLayer.y, width, height);\n\t\tif(this.activeLayer.forceBoundary && !inBounds) return false;\n\t\t\n\t\tvar w = this.activeLayer.width;\n\t\tvar h = this.activeLayer.height;\n\t\tthis.activeLayer.width = w;\n\t\tthis.activeLayer.height = h;\n\t\t\n\t\tvar canResize = true;\n\t\tfor(var i=0; i<this.layers.length; i++){\n\t\t\tif(this.layers[i] === this.activeLayer) continue;\n\t\t\tif(this.activeLayer.allowOverlap && this.layers[i].allowOverlap) continue;\n\t\t\tif(this.doLayersOverlap(this.activeLayer, this.layers[i])){\n\t\t\t\tcanResize = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.activeLayer.width = w;\n\t\tthis.activeLayer.height = h;\n\t\t\n\t\treturn canResize;\n\t}", "title": "" }, { "docid": "d434011069ef39ce793a6e4cbb9bd9be", "score": "0.48099244", "text": "function calculateBase(groupItem) {\n var extent;\n var baseAxis = groupItem.axis;\n var seriesModels = groupItem.seriesModels;\n var seriesCount = seriesModels.length;\n var boxWidthList = groupItem.boxWidthList = [];\n var boxOffsetList = groupItem.boxOffsetList = [];\n var boundList = [];\n var bandWidth;\n\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n } else {\n var maxDataCount = 0;\n each$18(seriesModels, function (seriesModel) {\n maxDataCount = Math.max(maxDataCount, seriesModel.getData().count());\n });\n extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / maxDataCount;\n }\n\n each$18(seriesModels, function (seriesModel) {\n var boxWidthBound = seriesModel.get('boxWidth');\n\n if (!util.isArray(boxWidthBound)) {\n boxWidthBound = [boxWidthBound, boxWidthBound];\n }\n\n boundList.push([parsePercent$9(boxWidthBound[0], bandWidth) || 0, parsePercent$9(boxWidthBound[1], bandWidth) || 0]);\n });\n var availableWidth = bandWidth * 0.8 - 2;\n var boxGap = availableWidth / seriesCount * 0.3;\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\n var base = boxWidth / 2 - availableWidth / 2;\n each$18(seriesModels, function (seriesModel, idx) {\n boxOffsetList.push(base);\n base += boxGap + boxWidth;\n boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));\n });\n}", "title": "" }, { "docid": "27ea22856010b55c3bc1c37f4e58a386", "score": "0.4809611", "text": "function collectVisibleLayers(theParent, allLayers) {\n if (!allLayers) {\n var allLayers = new Array;\n }\n var len = theParent.layers.length;\n for (var m = len - 1; m >= 0; m--) {\n var theLayer = theParent.layers[m];\n if (theLayer.typename == \"ArtLayer\") {\n if (isNeedExportLayer (theLayer)) {\n allLayers.push(theLayer);\n }\n } else {\n allLayers = (collectVisibleLayers(theLayer, allLayers)); // apply the function to layersets;\n }\n };\n return allLayers\n}", "title": "" }, { "docid": "3b2055bcb26188dc4922125c089fc695", "score": "0.48010752", "text": "update(instance) {\n\n // Remember visibility state of base layers.\n forEachLayer(instance.map.getLayerGroup(), (layer) => {\n if (layer.get('type') === 'base') {\n this.remember(layer);\n }\n });\n }", "title": "" }, { "docid": "b5afa827674bed2c64431762931eeb9b", "score": "0.4788467", "text": "check(layer){\n let correctKeys = [];\n let keys = Object.keys(layer);\n let safeLayers ={};\n let pass = 0;\n\n //prevents absurd abounts of layers by remapping layer keys\n var safeKeys = keys.map((item ,index)=>{\n let parsed = parseInt(item)\n if(!parsed){\n this.error('invaild Bubble layer key');\n\n }else if(keys.length > 10){\n this.error('too many layers...shorten to at most 10 layers');\n\n }else{\n safeLayers[index + 1] = layer[keys[index]];\n\n }\n });\n\n let layerNum = 0;\n this.test = [];\n let subsitute = Object.keys(safeLayers).map((Layer ,index)=>{\n layerNum++;\n let composeToReactComponent = safeLayers[Layer].map((items ,_index)=>{\n //this get each element in ech array\n // let createLayerItems = React.createElement(items[0],\n // {ref:'Bubble-layer'+_index,key:UID(),className:`_bubbles-${layerNum}`}\n // ,items.splice(1,items.length));\n let createLayerItems = <BubblesItem key={UID()} elm={'bubble-items-'+_index}>{items.splice(1,items.length)}</BubblesItem>\n\n //console.log(createLayerItems)\n return createLayerItems;\n });\n\n this.test.push(\n <BubblesLayer elm={'Bubble-layer-'+Layer} key={UID()}>\n {composeToReactComponent}\n </BubblesLayer>\n );\n\n\n //this.safe[Layer] = composeToReactComponent;\n });\n //console.log(test)\n pass = 1;\n //console.warn(keys , safeLayers)\n return pass;\n }", "title": "" }, { "docid": "a45634835b921986515a7006d5fb431d", "score": "0.4783255", "text": "function collectLayersBelow( __index, __parent )\n{\n\tfor ( var i = __index; i < __parent.layers.length; i++ ) {\n\n\t\tvar currentLayer = __parent.layers[ i ];\n\t\tvar isvalid = validateLayer( currentLayer );\n\n\t\tif ( currentLayer.typename == \"LayerSet\" ) {\n\t\t\tcollectLayersBelow( 0, currentLayer );\n\t\t} else if ( isvalid == true ) {\n\t\t\tcollectedLayers.push( currentLayer );\n\t\t\tcurrentLayer.allLocked = false;\n\t\t}\n\t}\n}", "title": "" } ]
fd0c67607d6c812e726cedbe2f21dc2f
12.14 The try statement
[ { "docid": "99f65120aaed9c240ef9328e5d120b74", "score": "0.0", "text": "function parseCatchClause() {\n var param;\n\n expectKeyword('catch');\n\n expect('(');\n if (!match(')')) {\n param = parseExpression();\n // 12.14.1\n if (strict && param.type === Syntax.Identifier && isRestrictedWord(param.name)) {\n throwErrorTolerant({}, Messages.StrictCatchVariable);\n }\n }\n expect(')');\n\n return {\n type: Syntax.CatchClause,\n param: param,\n body: parseBlock()\n };\n }", "title": "" } ]
[ { "docid": "45bc8c5537a1add033f26edd26a30e10", "score": "0.7532619", "text": "function TryStatement() {\n}", "title": "" }, { "docid": "524c3505676eb6dd7c51e2b094e45785", "score": "0.7301539", "text": "function attempt () {\n\t\t\t\t\t\t\ttry {\n\n\t\t\t\t\t\t\t} catch (f) {\n\n\t\t\t\t\t\t\t} finally {\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "title": "" }, { "docid": "86da8a80007f0bf4ecec98e79e955a15", "score": "0.7276756", "text": "function attempt () {\n\t\t\t\t\t\t\t\ttry {\n\n\t\t\t\t\t\t\t\t} catch (f) {\n\n\t\t\t\t\t\t\t\t} finally {\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}", "title": "" }, { "docid": "86da8a80007f0bf4ecec98e79e955a15", "score": "0.7276756", "text": "function attempt () {\n\t\t\t\t\t\t\t\ttry {\n\n\t\t\t\t\t\t\t\t} catch (f) {\n\n\t\t\t\t\t\t\t\t} finally {\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}", "title": "" }, { "docid": "72492361401407146944d246f2aaa7f9", "score": "0.7259928", "text": "function tryCatch() {\n if (false) {\n console.log(\"try\");\n return \"try\";\n } else {\n throw new Error(\"thrown error code 13\");\n }\n }", "title": "" }, { "docid": "80c0e34b5840eb67e71d98f4ffc0c8c1", "score": "0.7144046", "text": "function attempt () {\n\t\t\t\t\ttry {\n\n\t\t\t\t\t} catch (f) {\n\n\t\t\t\t\t} finally {\n\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" }, { "docid": "80c0e34b5840eb67e71d98f4ffc0c8c1", "score": "0.7144046", "text": "function attempt () {\n\t\t\t\t\ttry {\n\n\t\t\t\t\t} catch (f) {\n\n\t\t\t\t\t} finally {\n\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" }, { "docid": "1fab972b921a7efe40cd0adae2a56498", "score": "0.679478", "text": "function parseTryStatement() {\n var block, handlers = [], param, finalizer = null;\n\n expectKeyword('try');\n\n block = parseBlock();\n\n if (matchKeyword('catch')) {\n lex();\n expect('(');\n if (!match(')')) {\n param = parseExpression();\n }\n expect(')');\n\n handlers.push({\n type: Syntax.CatchClause,\n param: param,\n guard: null,\n body: parseBlock()\n });\n }\n\n if (matchKeyword('finally')) {\n lex();\n finalizer = parseBlock();\n }\n\n if (handlers.length === 0 && !finalizer) {\n throwError(Messages.NoCatchOrFinally);\n }\n\n return {\n type: Syntax.TryStatement,\n block: block,\n handlers: handlers,\n finalizer: finalizer\n };\n }", "title": "" }, { "docid": "ad73440658104eb4fd1ba2f43e9dd6b4", "score": "0.6732451", "text": "function parseTryStatement() {\n var node = createNode(225 /* TryStatement */);\n parseExpected(102 /* TryKeyword */);\n node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false);\n node.catchClause = token() === 74 /* CatchKeyword */ ? parseCatchClause() : undefined;\n // If we don't have a catch clause, then we must have a finally clause. Try to parse\n // one out no matter what.\n if (!node.catchClause || token() === 87 /* FinallyKeyword */) {\n parseExpected(87 /* FinallyKeyword */);\n node.finallyBlock = parseBlock(/*ignoreMissingOpenBrace*/ false);\n }\n return finishNode(node);\n }", "title": "" }, { "docid": "63394db955e9f9294ab550a3c555c303", "score": "0.67314404", "text": "function parseTryStatement() {\n var node = createNode(225 /* TryStatement */);\n parseExpected(102 /* TryKeyword */);\n node.tryBlock = parseBlock( /*ignoreMissingOpenBrace*/false);\n node.catchClause = token() === 74 /* CatchKeyword */ ? parseCatchClause() : undefined;\n // If we don't have a catch clause, then we must have a finally clause. Try to parse\n // one out no matter what.\n if (!node.catchClause || token() === 87 /* FinallyKeyword */) {\n parseExpected(87 /* FinallyKeyword */);\n node.finallyBlock = parseBlock( /*ignoreMissingOpenBrace*/false);\n }\n return finishNode(node);\n }", "title": "" }, { "docid": "caeb22b55da85b7185f00fe5a69bedcf", "score": "0.6696703", "text": "function k(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]),this.tryEntries.push(b)}", "title": "" }, { "docid": "8d4af1a248a4af01d738910028a83ba5", "score": "0.66153383", "text": "function parseTryStatement() {\n var node = createNode(223 /* TryStatement */);\n parseExpected(101 /* TryKeyword */);\n node.tryBlock = parseBlock( /*ignoreMissingOpenBrace*/false);\n node.catchClause = token() === 73 /* CatchKeyword */ ? parseCatchClause() : undefined;\n // If we don't have a catch clause, then we must have a finally clause. Try to parse\n // one out no matter what.\n if (!node.catchClause || token() === 86 /* FinallyKeyword */) {\n parseExpected(86 /* FinallyKeyword */);\n node.finallyBlock = parseBlock( /*ignoreMissingOpenBrace*/false);\n }\n return finishNode(node);\n }", "title": "" }, { "docid": "24b96ed49e3701b6af6cf2263ed88c68", "score": "0.65369165", "text": "visitTryStatement(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "e6fa6e333b0b7021c3f78aaf447b079e", "score": "0.6387802", "text": "function visitTryStatement(node) {\n return ts.visitEachChild(node, nestedElementVisitor, context);\n }", "title": "" }, { "docid": "e6fa6e333b0b7021c3f78aaf447b079e", "score": "0.6387802", "text": "function visitTryStatement(node) {\n return ts.visitEachChild(node, nestedElementVisitor, context);\n }", "title": "" }, { "docid": "bceef1ecaa4caf7bb3c0ccacbed8a6f9", "score": "0.6383057", "text": "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return{type:\"throw\",arg:err};}}", "title": "" }, { "docid": "bceef1ecaa4caf7bb3c0ccacbed8a6f9", "score": "0.6383057", "text": "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return{type:\"throw\",arg:err};}}", "title": "" }, { "docid": "bceef1ecaa4caf7bb3c0ccacbed8a6f9", "score": "0.6383057", "text": "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return{type:\"throw\",arg:err};}}", "title": "" }, { "docid": "bceef1ecaa4caf7bb3c0ccacbed8a6f9", "score": "0.6383057", "text": "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return{type:\"throw\",arg:err};}}", "title": "" }, { "docid": "bceef1ecaa4caf7bb3c0ccacbed8a6f9", "score": "0.6383057", "text": "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return{type:\"throw\",arg:err};}}", "title": "" }, { "docid": "6504a40317d7b0904c343627d87c309a", "score": "0.63821334", "text": "function tryCatchFn() {\n try {\n var x = ()=>this\n ;\n } catch (e) {\n var t = ()=>e + this\n ;\n } finally{\n var m = ()=>this + ''\n ;\n }\n}", "title": "" }, { "docid": "bc5504a5e0273bdf69edde0deee3dff7", "score": "0.6378831", "text": "function tryCatch(fn, obj, arg) { // 60\n try { // 61\n return { type: \"normal\", arg: fn.call(obj, arg) }; // 62\n } catch (err) { // 63\n return { type: \"throw\", arg: err }; // 64\n } // 65\n } // 66", "title": "" }, { "docid": "8ea68ca42e6dc20ca17bc0b6180bf543", "score": "0.63754964", "text": "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)}}catch(err){return{type:\"throw\",arg:err}}}", "title": "" }, { "docid": "3260f3b7ae141cd763d540c4ce02a03b", "score": "0.6326985", "text": "function HostTry() {}", "title": "" }, { "docid": "1dc49376ab538541a6648df75a982fd7", "score": "0.6311919", "text": "function findException(){\n try{\n\n }\n catch{\n\n }\n throw{\n \n }\n}", "title": "" }, { "docid": "4799e53b9a20994922e7e0ace7599a8e", "score": "0.6304574", "text": "function tryCatchFn() {\n try {\n var _this = this;\n var x = function() {\n return _this;\n };\n } catch (e) {\n var _this = this;\n var t = function() {\n return e + _this;\n };\n } finally{\n var _this1 = this;\n var m = function() {\n return _this1 + '';\n };\n }\n}", "title": "" }, { "docid": "5fe45980ea393086302d95fd3c6fecd2", "score": "0.62937653", "text": "function visitTryStatement(node) {\n return ts.visitEachChild(node, nestedElementVisitor, context);\n }", "title": "" }, { "docid": "6af83b675cc06f70300f8ee1079d482f", "score": "0.62712455", "text": "function disruptiveTryCatchStatement() {\n try {\n nonExistentFunction();\n }\n catch (error) {\n console.error(error);\n // expected output: ReferenceError: nonExistentFunction is not defined\n // Note - error messages will vary depending on browser\n }\n}", "title": "" }, { "docid": "1d3d9ef7075223b643f837c4f59089f3", "score": "0.6256077", "text": "function is_try_catch_statement(stmt) {\n return is_tagged_list(stmt, \"try_statement\");\n}", "title": "" }, { "docid": "2421cab3a60d081d93ff9ac93d64a8be", "score": "0.6214726", "text": "function attempt () {\n\t\t\t\t\t\t\t\t\t}", "title": "" }, { "docid": "19a8e6cb847c5766a4d67185338ded36", "score": "0.6090445", "text": "visitTryBlock(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "8ef2230fcd22141e457d7dfd63b0e0d7", "score": "0.6068556", "text": "function myFunction1(){\n try{\n return 1;\n }\n catch(err){\n \t$ERROR('#1.1: \"return 1\" inside function does not lead to throwing exception');\n return 0;\n }\n return 2;\n}", "title": "" }, { "docid": "c0a90bacda35029b3e709492966a060f", "score": "0.60683924", "text": "function test0() {\n while (undefined) {\n if (undefined) {\n continue;\n }\n try {\n continue;\n } catch (ex) {\n } finally {\n break;\n }\n }\n}", "title": "" }, { "docid": "ecaab9af482b5cd646b0a71dce5eb76a", "score": "0.6049597", "text": "function CatchStatement() {\n}", "title": "" }, { "docid": "e4f0c7ef3200a684038357b57f59bacd", "score": "0.5960382", "text": "function e(){\n try {\n(function(){\n try {\neval(o3);\n}catch(e){}\n })();\n}catch(Infinity){}\n }", "title": "" }, { "docid": "dd8665c38196328631d97a60b8789560", "score": "0.5903276", "text": "function tryCatch(\n fn,\n obj,\n arg\n ) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(\n obj,\n arg\n ),\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err,\n };\n }\n }", "title": "" }, { "docid": "8d6e53c2d37d22ec925bbce70e59c7dd", "score": "0.58820075", "text": "visitFunctionTryBlock(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "215f677a8c1eb26121c7687eb107e969", "score": "0.58675355", "text": "function foo(){\n try {\n console.log( '42' );\n }\n finally {\n console.log( 'this always runs');\n }\n console.log( 'never runs' );\n}", "title": "" }, { "docid": "ead7f4e0a656aa8258d8a5ada8647e4a", "score": "0.58610326", "text": "function tryCatch(fn, obj, arg) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(obj, arg),\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err,\n };\n }\n }", "title": "" }, { "docid": "688e94eaf928a6a89f79624c778d95c5", "score": "0.58520275", "text": "function f0() {\n var v00 = 0; // Break 1\n var v01 = 1;\n // Normal function call in a catch scope.\n try {\n throw 1;\n } catch (e) {\n try {\n f1();\n } catch (e) {\n var v02 = 2; // Break 13\n }\n }\n var v03 = 3;\n var v04 = 4;\n eval('var v05 = 5; // Break 14');\n var v06 = 6; // Break 15\n}", "title": "" }, { "docid": "8bc90fc72207316d30bdc104458430da", "score": "0.5847576", "text": "function beginExceptionBlock() {\n var startLabel = defineLabel();\n var endLabel = defineLabel();\n markLabel(startLabel);\n beginBlock({\n kind: 0 /* Exception */,\n state: 0 /* Try */,\n startLabel: startLabel,\n endLabel: endLabel\n });\n emitNop();\n return endLabel;\n }", "title": "" }, { "docid": "6d73950f8c1d074508051ffec342a6ee", "score": "0.5839103", "text": "function attempt () {\n\ttry {\n\n\t\t(function () {\n\t\t\t\n\t\t\t// do work ... send(), send(), send()\n\t\t\tfunction send() {\n\n\t\t\t\ttry {\n\n\t\t\t\t\t(function () {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// do work ... send(), send(), send()\n\t\t\t\t\t\tfunction send() {\n\n\t\t\t\t\t\t\ttry {\n\n\t\t\t\t\t\t\t\t(function () {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// do work ... send(), send(), send()\n\t\t\t\t\t\t\t\t\t// throw || attempt()\n\n\t\t\t\t\t\t\t\t\tfunction attempt () {\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}) ();\n\n\t\t\t\t\t\t\t} catch (f) {\n\n\t\t\t\t\t\t\t} finally {\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// throw || attempt()\n\n\t\t\t\t\t\tfunction attempt () {\n\t\t\t\t\t\t}\n\t\t\t\t\t}) ();\n\n\t\t\t\t} catch (f) {\n\n\t\t\t\t} finally {\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t// throw || attempt()\n\n\t\t\tfunction attempt () {\n\t\t\t\ttry {\n\n\t\t\t\t\t(function () {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// do work ... send(), send(), send()\n\t\t\t\t\t\t// throw || attempt()\n\n\t\t\t\t\t\tfunction attempt () {\n\t\t\t\t\t\t\ttry {\n\n\t\t\t\t\t\t\t} catch (f) {\n\n\t\t\t\t\t\t\t} finally {\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}) ();\n\n\t\t\t\t} catch (f) {\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\t(function () {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// do work ... send(), send(), send()\n\t\t\t\t\t\t\t// throw || attempt()\n\n\t\t\t\t\t\t\tfunction attempt () {\n\t\t\t\t\t\t\t\ttry {\n\n\t\t\t\t\t\t\t\t} catch (f) {\n\n\t\t\t\t\t\t\t\t} finally {\n\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} catch (e) {\n\n\t\t\t\t\t} finally {\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} finally {\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\t(function () {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// do work ... send(), send(), send()\n\t\t\t\t\t\t\t// throw || attempt()\n\n\t\t\t\t\t\t\tfunction attempt () {\n\t\t\t\t\t\t\t\ttry {\n\n\t\t\t\t\t\t\t\t} catch (f) {\n\n\t\t\t\t\t\t\t\t} finally {\n\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} catch (e) {\n\n\t\t\t\t\t} finally {\n\t\t\t\t\t\t\n\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} catch (e) {\n\n\t\ttry {\n\t\t\t(function () {\n\t\t\t\t\n\t\t\t\t// do work ... send(), send(), send()\n\t\t\t\t// throw || attempt()\n\n\t\t\t\tfunction attempt () {\n\t\t\t\t\ttry {\n\n\t\t\t\t\t} catch (f) {\n\n\t\t\t\t\t} finally {\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}) ();\n\t\t} catch (e) {\n\n\t\t} finally {\n\t\t\t\n\t\t}\n\t\t\n\t} finally {\n\n\t\ttry {\n\t\t\t(function () {\n\t\t\t\t\n\t\t\t\t// do work ... send(), send(), send()\n\t\t\t\t// throw || attempt()\n\n\t\t\t\tfunction attempt () {\n\t\t\t\t\ttry {\n\n\t\t\t\t\t} catch (f) {\n\n\t\t\t\t\t} finally {\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}) ();\n\t\t} catch (e) {\n\n\t\t} finally {\n\t\t\t\n\t\t}\n\t\t\n\t}\n}", "title": "" }, { "docid": "3e36a75e3049f30946df1950819a9b4a", "score": "0.5837848", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return {\n\t type: \"normal\",\n\t arg: fn.call(obj, arg)\n\t };\n\t } catch (err) {\n\t return {\n\t type: \"throw\",\n\t arg: err\n\t };\n\t }\n\t }", "title": "" }, { "docid": "3e36a75e3049f30946df1950819a9b4a", "score": "0.5837848", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return {\n\t type: \"normal\",\n\t arg: fn.call(obj, arg)\n\t };\n\t } catch (err) {\n\t return {\n\t type: \"throw\",\n\t arg: err\n\t };\n\t }\n\t }", "title": "" }, { "docid": "3e36a75e3049f30946df1950819a9b4a", "score": "0.5837848", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return {\n\t type: \"normal\",\n\t arg: fn.call(obj, arg)\n\t };\n\t } catch (err) {\n\t return {\n\t type: \"throw\",\n\t arg: err\n\t };\n\t }\n\t }", "title": "" }, { "docid": "a7f0c158c92274d2972a75f9a68952ff", "score": "0.5836678", "text": "function beginExceptionBlock() {\n var startLabel = defineLabel();\n var endLabel = defineLabel();\n markLabel(startLabel);\n beginBlock({\n kind: 0 /* Exception */\n , state: 0 /* Try */\n , startLabel: startLabel,\n endLabel: endLabel\n });\n emitNop();\n return endLabel;\n }", "title": "" }, { "docid": "a7f0c158c92274d2972a75f9a68952ff", "score": "0.5836678", "text": "function beginExceptionBlock() {\n var startLabel = defineLabel();\n var endLabel = defineLabel();\n markLabel(startLabel);\n beginBlock({\n kind: 0 /* Exception */\n , state: 0 /* Try */\n , startLabel: startLabel,\n endLabel: endLabel\n });\n emitNop();\n return endLabel;\n }", "title": "" }, { "docid": "c680b83a9fb7e5b9ba3322715a63f5bb", "score": "0.58107996", "text": "function foo(a) {\n try {\n a();\n } catch (e) {\n try {\n e();\n } catch (e) {\n e();\n }\n finally {\n e();\n }\n }\n finally {\n a();\n }\n}", "title": "" }, { "docid": "f7603c00da0defa6a217ce431e44df51", "score": "0.5798332", "text": "async function tryCatch(day) {\n try{\n const result = await cekHariKerja(day)\n console.log(result)\n }catch(error){\n throw error\n }\n}", "title": "" }, { "docid": "4438536b091d2f169c6d984bc908a9d2", "score": "0.5792823", "text": "function _TryStatementEmitter() {\n}", "title": "" }, { "docid": "48e0459a3b5ff3bfd0e70570a5841f51", "score": "0.57907176", "text": "function TryStatement(node, print) {\n this.keyword(\"try\");\n print.plain(node.block);\n this.space();\n\n // Esprima bug puts the catch clause in a `handlers` array.\n // see https://code.google.com/p/esprima/issues/detail?id=433\n // We run into this from regenerator generated ast.\n if (node.handlers) {\n print.plain(node.handlers[0]);\n } else {\n print.plain(node.handler);\n }\n\n if (node.finalizer) {\n this.space();\n this.push(\"finally \");\n print.plain(node.finalizer);\n }\n}", "title": "" }, { "docid": "7811aad9e7ecf22ce00b7fd50dce5ea0", "score": "0.57882094", "text": "async function someFunc() {\n //\"Try/catch\" blocks are how we handle the errors\n try {\n const result = await delayedAddition(2, 3);\n console.log(result); \n }\n catch(err) {\n console.log(\"Whoops, we had an error! \" + err.message);\n }\n //THIS BLOCK WILL JUMP TO THE CATCH BC THERE IS AN ERROR\n //(The delayedAddition function only wants numbers)\n try {\n const resultTwo = await delayedAddition(\"two\", \"three\");\n console.log(resultTwo);\n }\n catch(err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "4ab771b33df5d26c30e56236b3fb1d3f", "score": "0.5785981", "text": "function Serializer$CatchStatement$E() {\n}", "title": "" }, { "docid": "6ea035506ca3c2f76df499dc9a3d15f9", "score": "0.57758105", "text": "function f(){\n try{\n console.log(0);\n throw 'bogus';\n }\n catch(e){\n console.log(1);\n return true;\n console.log(2);\n \n }\n finally{\n console.log(3);\n return true; //this override all other throws and returns\n console.log(4);\n }\n \n console.log(5);\n}", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "7862258461b721ef5008aaa7289f270f", "score": "0.5760709", "text": "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "title": "" }, { "docid": "45f4a7ac5d8d7e326d26268fcd6bf161", "score": "0.57139766", "text": "function f()\n{\n try\n {\n eval(this.badSyntax);\n }\n catch(e)\n {\n return cnErrorCaught;\n }\n return cnErrorNotCaught;\n}", "title": "" }, { "docid": "06d56bf951c0b725fc6355a29be92b89", "score": "0.57110333", "text": "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "title": "" }, { "docid": "73c35a45c7872b650a58e81042599db7", "score": "0.5709922", "text": "function attempt(func, errorFunc) {\n try {\n func();\n } catch (exception) {\n if (errorFunc) {\n errorFunc();\n }\n }\n }", "title": "" }, { "docid": "73c35a45c7872b650a58e81042599db7", "score": "0.5709922", "text": "function attempt(func, errorFunc) {\n try {\n func();\n } catch (exception) {\n if (errorFunc) {\n errorFunc();\n }\n }\n }", "title": "" }, { "docid": "73c35a45c7872b650a58e81042599db7", "score": "0.5709922", "text": "function attempt(func, errorFunc) {\n try {\n func();\n } catch (exception) {\n if (errorFunc) {\n errorFunc();\n }\n }\n }", "title": "" }, { "docid": "b3b818d60887f9c217f55c0cf51e1418", "score": "0.56928635", "text": "function foo() {\n \n try {\n let z = bar(); // assume bar() throws error\n } catch (error) {\n console.log(z); // nope! z is undefined due to let's block scoping. \n }\n}", "title": "" }, { "docid": "66db129179bb224aed38134d4cb4f0e4", "score": "0.5689045", "text": "function tryCatch(fn, obj, arg) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(obj, arg),\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err,\n };\n }\n }", "title": "" }, { "docid": "13a3083117b2cc21b5763c0f6b3593b1", "score": "0.5683483", "text": "function o0()\n{\n var o892 = o839.o883.o893;\n try {\n(o421.o368 + 1) & 0xFF;\n}catch(e){}\n var o3 = 0;\n\n try {\nfor (var o2 = 4; o2 < 10; o2++)\n {\n try {\nif (o1 % 2 == 0)\n try { {} } catch(e) {}try { {} } catch(e) {}\n else\n {\n try {\nModule.abort = o3;\n}catch(o1){}\n }\n}catch(e){}\n }\n}catch(e){}\n try {\nreturn o3;\n}catch(e){}\n}", "title": "" }, { "docid": "b92fd076183815c40ea665b5f3b08fd2", "score": "0.5669337", "text": "function tryFn(fn, err) {\n try {\n return fn();\n }\n catch (e) {\n return err(e);\n }\n}", "title": "" }, { "docid": "5dc72286e624d1d2386e1aeba1765f2e", "score": "0.56646806", "text": "function tryCatch(fn, obj, arg) {\r\n try {\r\n return {\r\n type: \"normal\",\r\n arg: fn.call(obj, arg)\r\n };\r\n } catch (err) {\r\n return {\r\n type: \"throw\",\r\n arg: err\r\n };\r\n }\r\n }", "title": "" }, { "docid": "e38a4cfea0f83cc3047efed332db6d9f", "score": "0.5652838", "text": "function fail() {\r\n try {\r\n console.loog('this works');\r\n }\r\n catch (error) {\r\n // also have error.name, error.stack, error.message\r\n console.log('error', error, error.stack);\r\n }\r\n finally {\r\n return 'a wild finally appears';\r\n }\r\n}", "title": "" }, { "docid": "3b5afe245667826b722c640041399b2d", "score": "0.56432265", "text": "function tryCatch(fn, obj, arg) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(obj, arg)\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err\n };\n }\n }", "title": "" } ]
36c6772bab287aaa63d16de68d72ffcb
Frontend sends a request to play all songs in the queue database table
[ { "docid": "6ccf4a8c0d738eb4e72badd7156a0d83", "score": "0.0", "text": "playQue(e) {\n fetch(`${window.MyAppGlobals.serverURL}playQue`).then(res => res.json())\n .then(res => { \n this.result = Object.values(res); \n console.log(\"resultatet var: \" + this.result[0])\n \n })\n }", "title": "" } ]
[ { "docid": "33015abca3bd17896615732c60959f80", "score": "0.68767816", "text": "async function playlist() { \n const response = await fetch('http://localhost:3001/playlist')\n if (response.ok){\n registerMetric('play-clicked', 1)\n var i=0\n const jsonResponse = await response.json()\n const playlist = document.getElementById('playlist')\n let html = ''\n for (song of jsonResponse) {\n html += `<div>${song.name} - <audio controls>\n <source src=\"http://localhost:3000/${song.file}\" type=\"audio/ogg\"> \n </audio></div>`\n }\n playlist.innerHTML = html \n }\n}", "title": "" }, { "docid": "a35b76f2b3666c49529d35645223d408", "score": "0.67186356", "text": "function playSong(query, speaker) {\n query = querystring.stringify({media: 'music', term: query})\n console.log(query);\n\n var songUrl = 0;\n request('https://itunes.apple.com/search' + '?' + query, function(error, response, body) {\n console.log('search');\n console.log('error:', error); // Print the error if one occurred\n console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received\n // console.log(); Print the HTML for the Google homepage.\n var results = JSON.parse(body).results\n var item = results[0]\n // console.log(prettyjson.render(item));\n var id = 0;\n\n var trackUrl = new URL(item.trackViewUrl);\n var id = trackUrl.searchParams.get('i');\n var songUrl = '/' + speaker + '/applemusic/now/song:' + id\n console.log(songUrl);\n\n request(baseUrl + songUrl, function(error, response, body) {\n console.log('queueing');\n console.log('error:', error); // Print the error if one occurred\n console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received\n\n request(baseUrl + '/Basement/play', function(error, response, body) {\n console.log('playing');\n console.log('error:', error); // Print the error if one occurred\n console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received\n });\n });\n });\n}", "title": "" }, { "docid": "f78514922cc786d6c918c235286cbe5b", "score": "0.66887623", "text": "function enqueue() {\n\tqueue.add(this.id);\n\tqueue.draw();\n\tif (queue.length() == 1) {\n\t\tchangeSong(this.id);\n\t}\n}", "title": "" }, { "docid": "430f54f617ccc58b436a8d361942cfba", "score": "0.66359943", "text": "function call(){\n request(\"api/nowplaying\", \"\", function(result){\n var data = JSON.parse(result);\n var test = currentSong =! null ? currentSong : data.song.id;\n if(test == data.song.id) { // same song\n onSongRefresh(data);\n }\n else { // new song\n onSongChange(data);\n onSongRefresh(data);\n currentSong = data.song.id;\n }\n }, function(data){\n stopCall();\n $(\"#connection-error-alert\").modal({\n keyboard: false,\n backdrop:\"static\"\n }).modal(\"show\");\n });\n request(\"api/queue?limit=3\", \"\", function(result){\n var data = JSON.parse(result);\n onQueueRefresh(data);\n }, function(){\n stopCall();\n $(\"#connection-error-alert\").modal({\n keyboard: false,\n backdrop:\"static\"\n }).modal(\"show\");\n });\n}", "title": "" }, { "docid": "745bf970420fcada187fbf8572a0bc2e", "score": "0.65192026", "text": "function playSong() {\n\t\tfor (var i = 0; i < songTracks.length; i++)\n\t\t\tsongTracks[i].play();\n\t}", "title": "" }, { "docid": "8e2f32a7e54014f7b1b885a114efca4a", "score": "0.64914626", "text": "function listenAjax() {\n //calls query with music as only criteria first\n\n $.ajax({\n url: 'https://api.spotify.com/v1/search',\n data: {\n q: iWant.selectedNoun,\n type: 'track'\n },\n\n success: function (response) {\n // console.log('spotify', response);\n\n\n for (i = 0; i < response.tracks.items.length; i++) {\n\n var tracks = response.tracks.items[i];\n\n var song = {\n artist: tracks.artists[0].name,\n album: tracks.album.name,\n title: tracks.name,\n picture: tracks.album.images[0].url,\n audio: tracks.preview_url,\n link: tracks.external_urls.spotify\n };\n\n iWant.queueArray.push(song);\n }\n\n displayListen();\n\n\n }\n });\n}", "title": "" }, { "docid": "60a166903008ab63a6da7723b78662b2", "score": "0.6456316", "text": "enqueue(song) {\r\n this.items.push(song);\r\n }", "title": "" }, { "docid": "38447d88ecedb8eb1da4edc8ab89f305", "score": "0.64547926", "text": "function playNextSong(guild) {\r\n\t\tlet voiceConn = guild.voiceConn;\r\n\t\tlet queue = guild.queue;\r\n\t\t\r\n\t\tif (queue.length > 0) {\r\n\t\t\tconsole.log(\"Now playing: \" + queue[0].title + \"; \" + queue[0].url);\t\t\t\r\n\t\t\tvoiceConn.play(queue[0].url);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "e2efb807d4487f741c5dccce96453e9c", "score": "0.64454484", "text": "function playSongFromQueue(song) {\n setCurrentVideoId(song.videoId)\n context.player.loadVideoById(song.videoId)\n updateContext({ currentSong: song });\n }", "title": "" }, { "docid": "205c28d14117bf5ffe97b68377e37d90", "score": "0.6424254", "text": "function getQueue($play, $seek) {\n $.ajax({\n url: '/controller.php',\n dataType: 'json',\n data: 'r=getQueue',\n async: false,\n success: function(d) {\n _QUEUE.init(d.queue);\n skip = d.timestamp - d.queue[0].startplay; \n\n _QUEUE.updateQueue(d.queue);\n\n if (window.fluid) window.fluid.dockBadge = _QUEUE.length()-_QUEUE.ptr;\n refreshQueueDisplay(); \n refreshListeners(d.listeners); \n refreshRequestBadge(d.pendingRequests);\n }\n });\n}", "title": "" }, { "docid": "db5260d3bcfb9046c024bb63d02cd363", "score": "0.6399509", "text": "function list(message, serverQueue) {\n if (!serverQueue) {\n return message.channel.send(`${eAttention}` + \"There are no songs in the queue to list.\");\n } else {\n let playList = `${ePlaying} Playing: ` + serverQueue.songs[0].title + \"\\n\";\n for (let i = 1; i < serverQueue.songs.length; i++)\n playList = playList + `${eNext}` + (i) + \" - \" + serverQueue.songs[i].title + \"\\n\";\n message.channel.send(playList);\n }\n}", "title": "" }, { "docid": "14f8f5d7d123a516f1e0ebf580a64e7a", "score": "0.63866895", "text": "function playPlaylist(sequenceInPlaylist) {\n\t\tvar nextSongInSequence = 0;\n\t\tconsole.log(queuePlaylist);\n\t\t// Se sono arrivato all'ultima canzone, la successiva sarà la prima della coda\n\t\tif (sequenceInPlaylist === queuePlaylist.length - 1) {\n\t\t\tnextSongInSequence = 0;\n\t\t} else {\n\t\t\tnextSongInSequence = 1 + sequenceInPlaylist;\n\t\t}\n\n\t\tconsole.log(nextSongInSequence);\n\t\t\n\t\tserverServices.getSongPath(queuePlaylist[sequenceInPlaylist], function (response) {\n\t\t\tif (response.error) return;\n\t\t\telse {\n\t\t\t\tsessionStorage.setItem(\"songInReproductionId\", queuePlaylist[sequenceInPlaylist]);\n\t\t\t\tsessionStorage.setItem(\"nextSongInSequence\", nextSongInSequence);\n\n\t\t\t\tvar audioTag = document.getElementById(\"reproductionSong\");\n\t\t\t\t// rimuovo la canzone attualmente in esecuzione, se c'è\n\t\t\t\tif (document.getElementById('songInReproduction')) {\n\t\t\t\t\taudioTag.removeChild(document.getElementById('songInReproduction'));\n\t\t\t\t}\n\t\t\t\tvar songInfoEl = document.getElementById(\"songInfo\");\n\t\t\t\tif (songInfoEl.firstChild) {\n\t\t\t\t\tsongInfoEl.removeChild(songInfoEl.firstChild);\n\t\t\t\t}\n\t\t\t\tvar songEl = document.createElement('source');\n\t\t\t\tsongEl.id = \"songInReproduction\";\n\t\t\t\tsongEl.type = \"audio/mpeg\";\t\n\t\t\t\tvar text = response.title + \" - \" + response.author;\n\t\t\t\tvar path = response.path;\n\t\t\t\tsongInfoEl.appendChild(document.createTextNode(text));\n\t\t\t\tsongEl.src = path;\n\t\t\t\taudioTag.appendChild(songEl);\n\t\t\t\taudioTag.load();\n\t\t\t\taudioTag.oncanplay = function (event) {event.preventDefault(); audioTag.play()};\n\t\t\t\taudioTag.onpause = function (event) {event.preventDefault(); saveSongContext(parseInt(sessionStorage.getItem(\"songInReproductionId\")), false);};\n\t\t\t\t/* Per fare in modo che finita la canzone attuale parta la successiva della playlist */\n\t\t\t\taudioTag.onended = function (event) {event.preventDefault(); playPlaylist(parseInt(sessionStorage.getItem(\"nextSongInSequence\")))};\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "d4e5611b1d4dacce89f26e26c99c3ce9", "score": "0.63387156", "text": "async function listSongs() {\n const songs = await API.graphql(graphqlOperation(ListSongs))\n updateSongs(songs.data.listSongs.items)\n }", "title": "" }, { "docid": "8ee2d0f03a0a33d9ad80ae8c34efb8ba", "score": "0.62686175", "text": "handleQueue(){\n this.props.GetQueue(this.props.data_be.data_be._id,this.props.token.token);\n this.props.handleCurrentPlayList(null);\n this.props.SetIsQueue(true);\n }", "title": "" }, { "docid": "7209f876574ec43f8a07b52937010766", "score": "0.62595564", "text": "showSong(){\r\n\t\tvar div = this._div,\r\n\t\t\tsongs = this._songs,\r\n\t\t\taudio = this._audio;\r\n\t\tthis.msglog = ajaxRequest(this._id+'/songs', 'GET');\t\t\r\n\t\tthis.msglog = this.msglog.data.songs;\r\n\t\tfor( var i=0; i< this.msglog.length; i++){\r\n\t\t\tthis._arrSongs[i] = new Song(i, this.msglog[i].name, this.msglog[i].url, songs, audio);\t\t\t\r\n\t\t\tthis._arrSongs[i].toView();\r\n\t\t}\r\n\t\t//this._arrSongs[0].play();\r\n\t\t//arrPLlist[div.id].playSong(arrPLlist[div.id]._arrSongs[this.getAttribute(\"data-id\")].url, audio);\r\n\t\t//audio.src=this.msglog[0].url;\r\n\t}", "title": "" }, { "docid": "8ef0cb33450e641604925fa95d18a5db", "score": "0.621503", "text": "function playNext() {\n if (songName != -1) {\n var i = 0;\n for (element of request) {\n if (element.nombre_cancion == songName) {\n break;\n } else {\n i++\n }\n }\n console.log(request[i + 1]);\n if (i < request.length - 1) {\n getSongData(request[i + 1]);\n player.loadVideoById(songKey);\n isPlaying = true;\n } else {\n getSongData(request[i]);\n player.loadVideoById(songKey);\n isPlaying = true;\n }\n } else {\n getSongData(request[i]);\n player.loadVideoById(songKey);\n isPlaying = true;\n }\n}", "title": "" }, { "docid": "37d8865bf0db4beab696233bd818333f", "score": "0.6213636", "text": "function loadQueue() {\n showLoadingDialog();\n $.ajax({\n type: 'GET',\n url: '/getQueue',\n dataType: 'json',\n success: (data) => {\n // Queue has been loaded. Display the media items as a grid on screen.\n hideLoadingDialog();\n showPreview(data.parameters, data.photos);\n hideLoadingDialog();\n console.log('Loaded queue.');\n },\n error: (data) => {\n hideLoadingDialog();\n handleError('Could not load queue', data)\n }\n });\n}", "title": "" }, { "docid": "da22c429edaa1be6b514fa8b7ca2f083", "score": "0.6179073", "text": "function songClick(id){\n\n var song = getSongFromId(id);\n var simpleSong = convertSong(song);\n var address= getExactAddress();\n\n console.log(JSON.stringify(simpleSong));\n\n //make sure its hidden at at the correct html render location\n document.getElementById('queue').style.visibility=\"visible\";\n\n //sent to the TBA que to be checked\n $.ajax({\n type: \"POST\",\n url: address+\"/queueSong\",\n contentType: \"application/Json\",\n data: JSON.stringify(simpleSong),\n success: function(response){\n console.log(\"sent to TBAqueue\");\n },\n error: function(jqXhr, textStatus, errorMessage){\n console.log(errorMessage);\n }\n });\n\n\n}", "title": "" }, { "docid": "c2772a3e078ca09d85ff85c1a8c4ce0d", "score": "0.61762756", "text": "async play() {\n if (!this.stillThere || !this.queue.length) return this.PlayerShutdown()\n this.current = this.queue.shift()\n await this.player.playTrack(this.current.track);\n }", "title": "" }, { "docid": "367b60e7bd01d7b0f9cf62893e6439af", "score": "0.61721975", "text": "async function song_() {\r\n\r\n //if no tracks found return info msg\r\n\r\n if (!res.tracks[0])\r\n return message.reply({embeds: [new MessageEmbed()\r\n .setColor(ee.wrongcolor)\r\n .setTitle(String(\"❌ Error | Found nothing for: **`\" + search).substr(0, 256 - 3) + \"`**\")\r\n .setDescription(eval(client.la[ls][\"handlers\"][\"playermanagers\"][\"request\"][\"variable1\"]))\r\n ]}).catch(e => console.log(String(e).grey.italic.dim));\r\n //create a player if not created\r\n\r\n //if the player is not connected, then connect and create things\r\n if (player.state !== \"CONNECTED\") {\r\n //set the variables\r\n player.set(\"message\", message);\r\n player.set(\"playerauthor\", message.author.id);\r\n player.connect();\r\n message.react(\"863876115584385074\").catch(e => console.log(String(e).grey.italic.dim));\r\n //add track\r\n player.queue.add(res.tracks[0]);\r\n //play track\r\n player.play();\r\n player.pause(false);\r\n } else if (!player.queue || !player.queue.current) {\r\n //add track\r\n player.queue.add(res.tracks[0]);\r\n //play track\r\n player.play();\r\n player.pause(false);\r\n }\r\n //otherwise\r\n else {\r\n //add track\r\n player.queue.add(res.tracks[0]);\r\n }\r\n }", "title": "" }, { "docid": "aa65283fedcde3c38626bba6760bfcbe", "score": "0.6115202", "text": "function all() {\n var url = user_id == 'demo' ?\n \"/assets/demo-data/a-playlists.json\" :\n \"https://api.spotify.com/v1/users/\"+user_id+\"/playlists\";\n \n return query(url,\n new Resolver(function(data){\n this.deferred.notify(data);\n if (data.next) {\n send_ajax(data.next, this);\n } else {\n this.deferred.resolve();\n }\n }));\n }", "title": "" }, { "docid": "e8f74c06df1b983911ccd2af01ead6af", "score": "0.6035787", "text": "function playSong(url, username){\n\t\tsocket.emit('playSong', {\n\t\t\tpath: url,\n\t\t\tartist: username\n\t\t});\n\t}", "title": "" }, { "docid": "f6cb9c4eb2762dfebd61939784ea6cab", "score": "0.60207254", "text": "function startPlay() {\n // Listen for the click on the play button\n $(document).on('click', '.results .play-button', function () {\n // Get the video id\n var id = $(this).data('video-id'),\n // Get the object id\n objectId = $(this).data('object-id'),\n // Fetch the video object from the foundVideos array based on\n // the found id\n obj = foundVideos[objectId];\n\n // Create the song object\n currentSong = {\n 'position': count,\n 'videoId': id,\n 'title': obj['snippet']['title'],\n 'duration': convert_time(obj['contentDetails']['duration']),\n 'thumbnail': obj['snippet']['thumbnails']['high']['url']\n };\n\n // Start the song\n player.loadVideoById(id);\n\n // Set the bottom player equal to the current song\n displayCurrentSong();\n\n // If the queue is non-existent we have to display\n // suggestions based on the current song\n if (queue.length == 0 || queue.length < 1) {\n showSuggestions(id);\n }\n });\n}", "title": "" }, { "docid": "ac417b5162c1bfb6ebb2a6073514dd77", "score": "0.6019753", "text": "function play(connection, message){\n\n\t\t\t\tvar server = servers[message.guild.id];\n\t\t\t\tvar server2 = played[message.guild.id];\n\n\t\t\t\tserver.dispatcher = connection.play(ytdl(server.queue[0], { filter: format => format.container === 'mp4' }));\n\n\t\t\t\t// Saving music on permanent history\n\t\t\t\tfs.appendFile('./history/played-musics.txt', server.queue[0].slice(0) + \"\\n\" , (err) => {\n \t\t\t\tif(err) throw err;\n \t\t\t\t});\n\n \t\t\t\t// Saving music on recent history\n\t\t\t\tserver2.queue.push(server.queue[0].slice(0));\n\n\t\t\t\t//remove a música que acabou de tocar da queue\n\t\t\t\tserver.queue.shift();\n\n\t\t\t\tserver.dispatcher.on(\"end\",function(){\n\t\t\t\t\tif(server.queue[0]){\n\t\t\t\t\t\tplay(connection, message);\n\t\t\t\t\t} else{\n\t\t\t\t\t\tconnection.disconnect();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "2b9e83be6358be3b649359e93087ccae", "score": "0.6003361", "text": "function sendPlay()\n{\n\tsocket.emit(\"play\");\n}", "title": "" }, { "docid": "485191a20d80da9c98eae0d1b67e84d2", "score": "0.5992443", "text": "startPartyEventLoop() {\n let allParties = db['parties'].find();\n allParties.forEach((globParty) => {\n if (currentEventLoopParties[globParty.id] === undefined) {\n console.log(`[MUSIC] Starting party ${globParty.id}`);\n currentEventLoopParties[globParty.id] = setInterval(async () => {\n if (playerOutgoingSocket.length > 0) {\n let message = getMessageFromQueue();\n console.log(message);\n playerIO.to(message.partyId).emit(message.event, message.data);\n }\n\n if (frontOutgoingSocket.length > 0) {\n let message = getMessageFromFrontQueue();\n frontIO.to(message.partyId).emit(message.event, message.data);\n }\n\n try {\n let party = db['parties'].findOne({id: globParty.id});\n addMessageToFrontQueue(new Message(globParty.id, 'update', party));\n switch (party.state) {\n case 0: // currently playing\n if ((party.oldStatus === 0 || party.oldStatus === 1) && party.status === 1) {\n updatePartyState(party.id, 1);\n }\n break;\n case 1: // currently idle\n if (party.playlist.length > 0) {\n updatePartyState(party.id, 2);\n }\n break;\n case 2: // playing next song\n console.log('playing next song state');\n let song = party.playlist.shift();\n console.log({song});\n if (song) {\n db['parties'].update({\n id: party.id\n }, {\n playlist: party.playlist\n });\n console.log('emit the play event');\n db['parties'].update({\n id: party.id\n }, {\n currentlyPlaying: song\n });\n addMessageToQueue(new Message(party.id, 'play', {\n path: song.songUrl,\n mode: 'name'\n }));\n updatePartyState(party.id, 0);\n } else {\n updatePartyState(party.id, 1);\n }\n break;\n }\n updatePartyOldState(party.id);\n } catch (e) {\n console.error(`Error in the main party thread with party: ${globParty.id}`);\n console.log(e);\n }\n }, 500);\n }\n });\n }", "title": "" }, { "docid": "38b8755a7f7d66d3b82e3d9d7859542d", "score": "0.5984368", "text": "function playSong(song, enqueueAll) {\n var filesToPlay = [];\n var toPlay = path.join(musicRootDir, song);\n if (!toPlay) {\n return;\n }\n var ls = null;\n try {\n ls = fs.lstatSync(toPlay);\n } catch (e) {}\n\n if (ls && ls.isDirectory()) {\n filesToPlay = utils.songsInDir(toPlay).map(function(song) {\n return path.join(toPlay, song);\n });\n if (!enqueueAll) {\n if (filesToPlay.length >= 1) {\n player.play(filesToPlay[0]);\n }\n if (filesToPlay.length >= 2) {\n player.enqueue(filesToPlay.slice(1));\n }\n currPlayIndex = 0;\n } else {\n player.enqueue(filesToPlay);\n }\n\n\n } else {\n if (toPlay) {\n filesToPlay = [toPlay];\n if (!enqueueAll) {\n currPlayIndex = 0;\n player.play(toPlay);\n } else {\n player.enqueue(toPlay);\n }\n }\n }\n\n var pl = filesToPlay.map(function(fileToPlay) {\n return { fileName: path.relative(musicRootDir, fileToPlay) };\n });\n if (!enqueueAll) {\n playlist = pl;\n currPlayIndex = 0;\n } else {\n playlist = playlist.concat(pl);\n }\n //get song info for existing files (not urls)\n if (ls) {\n player.getSongInfo(filesToPlay, function(result) {\n console.log(result);\n result.forEach(function(item) {\n item.fileName = path.relative(musicRootDir, item.fileName);\n });\n if (!enqueueAll) {\n playlist = result;\n } else {\n playlist = playlist.concat(result);\n }\n\n });\n }\n}", "title": "" }, { "docid": "6b43ceaea677f27e8aa847d14b5194aa", "score": "0.597619", "text": "function listPlaylists() {\r\n return gapi.client.youtube.playlists.list({\r\n \"part\": \"snippet\",\r\n \"maxResults\": 50,\r\n \"mine\": true\r\n })\r\n .then(function(response) {\r\n // Handle the results here (response.result has the parsed body).\r\n console.log(\"Response\", response);\r\n\r\n let length = response.result.items.length;\r\n for(let i=0; i<length; i++){\r\n if(response.result.items[i].snippet.title === \"Queue\"){\r\n chrome.storage.sync.set({'playlistId': response.result.items[i].id});\r\n return;\r\n }\r\n }\r\n insertQueuePlaylist();\r\n },\r\n function(err) { console.error(\"Execute error\", err); });\r\n}", "title": "" }, { "docid": "e5ccf533b333e6bc6f5d920151de2da9", "score": "0.59649646", "text": "addToQue(songUrl) {\n if (this.state.playArray.has(songUrl)) {\n this.state.playArray.get(songUrl).pause()\n this.state.playArray.delete(songUrl)\n console.log( \"Sound removed\",this.state.playArray)\n } else {\n this.state.playArray.set(songUrl,new Audio(songUrl))\n console.log(\"Sound added\",this.state.playArray)\n }\n }", "title": "" }, { "docid": "fa982a7f3b9633f15335e4c8fb192730", "score": "0.5959077", "text": "function startPlayList() {\n\t\t//play first track\n\t\tif (_playList.length > 0) {\n\t\t\tplayTrackRow(_playList[0]);\n\t\t}\n\t}", "title": "" }, { "docid": "cc9c508c7002ec1157addba7ceb68834", "score": "0.59550816", "text": "async function execute(message, serverQueue) {\n const args = message.content.split(' ');\n\n //Join voice channel if not already joined\n if(!serverQueue || serverQueue.afk) {\n if(!await join(message, serverQueue)) {\n //Something went wrong when joining voicechannel\n return false;\n }\n serverQueue = serverMap.get(message.guild.id);\n }\n //Store searching message for later editing/deletion\n let msg;\n\n //Let the user know we read the command\n message.channel.send(\"Searching...\").then((m) => {\n msg = m;\n });\n\n const request = message.content.substr(6).trim();\n let searchTerm = request;\n\n //Check if searchTerm is a link\n if(!request.includes(\"https://\")) {\n searchTerm = \"ytsearch:\" + searchTerm;\n }\n\n //Get song info from ytdl\n await getInfo(searchTerm).then((info) => {\n //Is true for playlists\n if(info.partial) {\n info.on('video', (v) => {\n //Create new song object\n const song = {\n title: v.title,\n url: v.webpage_url.toString(),\n };\n\n //Push song to queue\n serverQueue.songs.push(song);\n\n console.log(`Song added: ${song.title}`);\n console.log(song);\n\n //We are not already playing a song\n if(!serverQueue.playing) {\n try {\n //Play music\n console.log(\"Trying to play song\");\n play(message.guild, serverQueue.songs[0]);\n console.log(\"Executed play function\");\n serverQueue.playing = true;\n message.channel.send(`Now playing: ${serverQueue.songs[0].title}`);\n } catch (err) {\n serverQueue.playing = false;\n serverQueue.songs.clear();\n execute(message, serverQueue);\n }\n }\n\n if(msg != null) {\n msg.edit(`Adding songs to queue...`);\n } else {\n message.channel.send(`Adding songs to queue...`);\n }\n });\n info.on('done', () => {\n if(msg != null) {\n return msg.edit(`${info.items.length} songs added to queue`);\n } else {\n return message.channel.send(`${info.items.length} songs added to queue`);\n }\n })\n } else {\n //Single song\n //Create new song object\n const song = {\n title: info.items[0].title,\n url: info.items[0].webpage_url.toString(),\n };\n\n //Push song to queue\n serverQueue.songs.push(song);\n\n console.log(`Song added: ${song.title}`);\n console.log(song);\n\n //We are not already playing a song\n if(!serverQueue.playing) {\n try {\n //Play music\n play(message.guild, serverQueue.songs[0]);\n serverQueue.playing = true;\n } catch(err) {\n serverQueue.playing = false;\n serverQueue.songs.clear();\n execute(message, serverQueue);\n }\n if(msg != null) {\n msg.edit(`Now playing: ${serverQueue.songs[0].title}`);\n return true;\n } else {\n message.channel.send(`Now playing: ${serverQueue.songs[0].title}`);\n return true;\n }\n } else {\n if(msg != null) {\n msg.edit(`${song.title} added to queue`);\n return true;\n } else {\n message.channel.send(`${song.title} added to queue`);\n return true;\n }\n }\n }\n }).catch((err) => {\n console.log(err);\n if(msg != null) {\n msg.edit(`Could not find any song matching ${searchTerm}`);\n return false;\n } else {\n message.channel.send(`Could not find any song matching ${searchTerm}`);\n return false;\n }\n });\n return true;\n}", "title": "" }, { "docid": "c7e1f16c708289ca0fee61558b8c25ec", "score": "0.5953034", "text": "function song(client, message, args, type) {\n var search, res, player, state, song_, playlist_;\n return regeneratorRuntime.async(function song$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n playlist_ = function _ref2() {\n var playlistembed;\n return regeneratorRuntime.async(function playlist_$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n if (res.tracks[0]) {\n _context2.next = 2;\n break;\n }\n\n return _context2.abrupt(\"return\", message.channel.send(new MessageEmbed().setColor(ee.wrongcolor).setFooter(ee.footertext, ee.footericon).setTitle(String(\"Found nothing for: **`\" + search).substr(0, 256 - 3) + \"`**\").setDescription(\"Please retry!\")));\n\n case 2:\n //if the player is not connected, then connect and create things\n if (player.state !== \"CONNECTED\") {\n //set the variables\n player.set(\"message\", message);\n player.set(\"playerauthor\", message.author.id);\n player.connect(); //add track\n\n player.queue.add(res.tracks); //play track\n\n player.play();\n player.pause(false);\n } else if (!player.queue || !player.queue.current) {\n //add track\n player.queue.add(res.tracks); //play track\n\n player.play();\n player.pause(false);\n } else {\n //add the tracks\n player.queue.add(res.tracks);\n } //send information\n\n\n playlistembed = new MessageEmbed().setTitle(\"Added Playlist \\uD83E\\uDE78 **`\".concat(res.playlist.name).substr(0, 256 - 3) + \"`**\").setURL(res.playlist.uri).setColor(ee.color).setFooter(ee.footertext, ee.footericon).setThumbnail(\"https://img.youtube.com/vi/\".concat(res.tracks[0].identifier, \"/mqdefault.jpg\")).addField(\"⌛ Duration: \", \"`\".concat(format(res.playlist.duration), \"`\"), true).addField(\"🔂 Queue length: \", \"`\".concat(player.queue.length, \" Songs`\"), true).setFooter(\"Requested by: \".concat(message.author.tag), message.author.displayAvatarURL({\n dynamic: true\n }));\n message.channel.send(playlistembed).then(function (msg) {\n if (msg) msg[\"delete\"]({\n timeout: 4000\n })[\"catch\"](function (e) {\n return console.log(\"couldn't delete message this is a catch to prevent a crash\".grey);\n });\n });\n\n case 5:\n case \"end\":\n return _context2.stop();\n }\n }\n });\n };\n\n song_ = function _ref() {\n var playembed;\n return regeneratorRuntime.async(function song_$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!(player.state !== \"CONNECTED\")) {\n _context.next = 9;\n break;\n }\n\n //set the variables\n player.set(\"message\", message);\n player.set(\"playerauthor\", message.author.id); //connect\n\n player.connect(); //add track\n\n player.queue.add(res.tracks[0]); //play track\n\n player.play();\n player.pause(false);\n _context.next = 18;\n break;\n\n case 9:\n if (!(!player.queue || !player.queue.current)) {\n _context.next = 15;\n break;\n }\n\n //add track\n player.queue.add(res.tracks[0]); //play track\n\n player.play();\n player.pause(false);\n _context.next = 18;\n break;\n\n case 15:\n //add the latest track\n player.queue.add(res.tracks[0]); //send track information\n\n playembed = new MessageEmbed().setTitle(\"Added to Queue \\uD83E\\uDE78 **`\".concat(res.tracks[0].title).substr(0, 256 - 3) + \"`**\").setURL(res.tracks[0].uri).setColor(ee.color).setFooter(ee.footertext, ee.footericon).setThumbnail(\"https://img.youtube.com/vi/\".concat(res.tracks[0].identifier, \"/mqdefault.jpg\")).addField(\"⌛ Duration: \", \"`\".concat(res.tracks[0].isStream ? \"LIVE STREAM\" : format(res.tracks[0].duration), \"`\"), true).addField(\"💯 Song By: \", \"`\".concat(res.tracks[0].author, \"`\"), true).addField(\"🔂 Queue length: \", \"`\".concat(player.queue.length, \" Songs`\"), true).setFooter(\"Requested by: \".concat(res.tracks[0].requester.tag), res.tracks[0].requester.displayAvatarURL({\n dynamic: true\n }));\n return _context.abrupt(\"return\", message.channel.send(playembed).then(function (msg) {\n if (msg) msg[\"delete\"]({\n timeout: 4000\n })[\"catch\"](function (e) {\n return console.log(\"couldn't delete message this is a catch to prevent a crash\".grey);\n });\n }));\n\n case 18:\n case \"end\":\n return _context.stop();\n }\n }\n });\n };\n\n search = args.join(\" \");\n player = client.manager.players.get(message.guild.id);\n\n if (player) {\n _context3.next = 8;\n break;\n }\n\n if (message.member.voice.channel) {\n _context3.next = 7;\n break;\n }\n\n throw \"NOT IN A VC\";\n\n case 7:\n player = client.manager.create({\n guild: message.guild.id,\n voiceChannel: message.member.voice.channel.id,\n textChannel: message.channel.id,\n selfDeafen: config.settings.selfDeaf\n });\n\n case 8:\n state = player.state;\n\n if (state !== \"CONNECTED\") {\n //set the variables\n player.set(\"message\", message);\n player.set(\"playerauthor\", message.author.id);\n player.connect();\n player.stop();\n }\n\n _context3.prev = 10;\n\n if (!(type.split(\":\")[1] === \"youtube\" || type.split(\":\")[1] === \"soundcloud\")) {\n _context3.next = 17;\n break;\n }\n\n _context3.next = 14;\n return regeneratorRuntime.awrap(client.manager.search({\n query: search,\n source: type.split(\":\")[1]\n }, message.author));\n\n case 14:\n res = _context3.sent;\n _context3.next = 20;\n break;\n\n case 17:\n _context3.next = 19;\n return regeneratorRuntime.awrap(client.manager.search(search, message.author));\n\n case 19:\n res = _context3.sent;\n\n case 20:\n if (!(res.loadType === \"LOAD_FAILED\")) {\n _context3.next = 24;\n break;\n }\n\n throw res.exception;\n\n case 24:\n if (res.loadType === \"PLAYLIST_LOADED\") {\n playlist_();\n } else {\n song_();\n }\n\n case 25:\n _context3.next = 31;\n break;\n\n case 27:\n _context3.prev = 27;\n _context3.t0 = _context3[\"catch\"](10);\n console.log(String(_context3.t0.stack).red);\n return _context3.abrupt(\"return\", message.channel.send(new MessageEmbed().setColor(ee.wrongcolor).setFooter(ee.footertext, ee.footericon).setTitle(\"There was an error while searching:\").setDescription(\"```\".concat(_context3.t0.message, \"```\"))));\n\n case 31:\n if (res.tracks[0]) {\n _context3.next = 33;\n break;\n }\n\n return _context3.abrupt(\"return\", message.channel.send(new MessageEmbed().setColor(ee.wrongcolor).setFooter(ee.footertext, ee.footericon).setTitle(String(\"Found nothing for: **`\" + search).substr(0, 256 - 3) + \"`**\").setDescription(\"Please retry!\")));\n\n case 33:\n case \"end\":\n return _context3.stop();\n }\n }\n }, null, null, [[10, 27]]);\n}", "title": "" }, { "docid": "1ed43eee33ab9d2f7974d21b20b28a60", "score": "0.5936916", "text": "function syncUserSong() {\n $.get(\"/musicify/sync-user-song/\"+host)\n .done(function(data) {\n var audioPlayer = $(\"#id-music-player\");\n var currentSong = audioPlayer[0];\n\n // The song only plays when the user is in his channel\n if (data.track_id !== '' && !isUserLeftChannel && parseInt(data.start_time) <= parseInt(data.length)){\n $('#id-loading').hide();\n $('#id-waiting-content').hide();\n $('#id-not-live-icon').hide();\n $('#id-live-icon').show();\n $(\"#id-page-content\").show();\n $(\"#messaging-content\").removeClass('col-md').addClass('col-md-6');\n if (current_track_id !== data.track_id){\n $(\"#id-cover\").attr(\"src\", data.cover);\n $(\"#id-name\").text(parseHtmlEnteties(data.name));\n $(\"#id-artist\").text(parseHtmlEnteties(data.artist));\n $(\"#id-track\").val(data.track_id);\n current_track_id = data.track_id;\n $(\"#id-page-content\").show();\n start_time = parseInt(data.start_time);\n\n // Play song from current data\n audioPlayer.attr(\"src\", data.preview);\n currentSong.currentTime = data.start_time;\n }\n\n if (data.status !== 'Playing' && currentSong.played){\n currentSong.pause();\n } else if (data.status === 'Playing' && currentSong.paused) {\n // Use this to avoid the race condition between play() and pause()\n setTimeout(function () {\n currentSong.play();\n }, 150);\n }\n } else { // User NOT in their channel:\n $('#id-loading').show();\n $(\"#id-page-content\").hide();\n $(\"#messaging-content\").removeClass('col-md-6').addClass('col-md');\n $('#id-waiting-content').show();\n $('#id-not-live-icon').show();\n $('#id-live-icon').hide();\n if (currentSong.played){\n currentSong.pause();\n }\n }\n })\n}", "title": "" }, { "docid": "c4ae5f5d871356ea76cb5f232b172fd5", "score": "0.59364337", "text": "async function playsongyes(message, queue, song) {\n const emojiList = {\n PlayPause: \"851372996660428824\",\n Next: \"851372996023418902\",\n Backward: \"851372995779887126\",\n Forward: \"851372995518791710\",\n Stop: \"851372996051861504\",\n Loop: \"851372997000429589\",\n Queue: \"851372999684915200\",\n VolumeUp: \"851372997763399720\",\n VolumeDown: \"851372997678989312\",\n Refresh: \"851377294739374091\",\n };\n playingMessage;\n try {\n let isPaused = await client.distube.isPaused(message);\n let embed1 = new Discord.MessageEmbed()\n .setColor(\"#0099ff\")\n .setTitle(isPaused ? \"Paused\" : \"Now Playing\")\n .setDescription(\n `Playing ${song.name}\\nDuration: **${\n song.formattedDuration\n }**\\nDuration ${queue.formattedCurrentTime} / ${\n song.formattedDuration\n }\\nRequested by: ${song.user}\\nAutoplay: ${\n queue.autoplay ? \"✅\" : \"❌\"\n }\\nVolume: ${queue.volume}%\\n Loop: ${\n queue.repeatMode\n ? queue.repeatMode === 2\n ? \"✅ Queue\"\n : \"✅ Song\"\n : \"Off\"\n }\\nFilter: ${queue.filter || \"❌\"}`\n )\n .setFooter(\n message.author.tag,\n message.member.user.displayAvatarURL({ dynamic: true })\n )\n .setThumbnail(song.thumbnail);\n var playingMessage = await message.channel.send(embed1);\n try {\n await playingMessage.react(emojiList.Stop);\n await playingMessage.react(emojiList.Next);\n await playingMessage.react(emojiList.PlayPause);\n await playingMessage.react(emojiList.Backward);\n await playingMessage.react(emojiList.Forward);\n await playingMessage.react(emojiList.VolumeDown);\n await playingMessage.react(emojiList.VolumeUp);\n await playingMessage.react(emojiList.Loop);\n await playingMessage.react(emojiList.Queue);\n await playingMessage.react(emojiList.Refresh);\n } catch (error) {\n message.reply(\"Missing permissions, i need to add reactions!\");\n console.log(error);\n }\n const emojiName = {\n PlayPause: client.emojis.cache.get(emojiList.PlayPause).name,\n Next: client.emojis.cache.get(emojiList.Next).name,\n Backward: client.emojis.cache.get(emojiList.Backward).name,\n Forward: client.emojis.cache.get(emojiList.Forward).name,\n Stop: client.emojis.cache.get(emojiList.Stop).name,\n Loop: client.emojis.cache.get(emojiList.Loop).name,\n Queue: client.emojis.cache.get(emojiList.Queue).name,\n VolumeUp: client.emojis.cache.get(emojiList.VolumeUp).name,\n VolumeDown: client.emojis.cache.get(emojiList.VolumeDown).name,\n Refresh: client.emojis.cache.get(emojiList.Refresh).name,\n };\n const filter = (reaction, user) =>\n [emojiName] && user.id !== message.client.user.id;\n var collector = playingMessage.createReactionCollector(filter, {\n time: song.duration > 0 ? song.duration * 1000 : 600000,\n });\n collector.on(\"collect\", async (reaction, user) => {\n let isPaused = await client.distube.isPaused(message);\n let queue = await client.distube.getQueue(message);\n if (!message.member.voice.channel) {\n reaction.users.remove(user).catch(console.error);\n return message.channel.send(\n \"You must be in a voice channel to use the reaction commands.\"\n );\n }\n if (!queue) return;\n const member = message.guild.member(user);\n if (\n member.voice.connection &&\n member.voice.connection !== member.guild.me.voice.connection\n )\n return;\n\n switch (reaction.emoji.name) {\n case emojiName.Next:\n client.distube.skip(message);\n embedbuilder(\n client,\n message,\n \"#0099ff8\",\n \"SKIPPED!\",\n `Skipped the song`\n ).then((message) =>\n message.delete({ timeout: 3000 }).catch(console.error)\n );\n playingMessage.reactions.removeAll().catch(console.error);\n break;\n\n case emojiName.Stop:\n client.distube.stop(message);\n const stopEmbed = new Discord.MessageEmbed()\n .setColor(\"#0099ff\")\n .setTitle(\"STOPPED\")\n .setDescription(\"Thanks for using the bot bye! byee!👋\");\n message.channel.send(stopEmbed);\n playingMessage.reactions.removeAll().catch(console.error);\n break;\n\n case emojiName.VolumeDown:\n reaction.users.remove(user).catch(console.error);\n await client.distube.setVolume(message, Number(queue.volume) - 10);\n embedbuilder(\n client,\n message,\n \"#0099ff\",\n \"Volume!\",\n `Redused the Volume to \\`${queue.volume}\\``\n ).then((msg) => msg.delete({ timeout: 3000 }).catch(console.error));\n await playingMessage.edit(curembed(message)).catch(console.error);\n break;\n\n case emojiName.VolumeUp:\n reaction.users.remove(user).catch(console.error);\n await client.distube.setVolume(message, Number(queue.volume) + 10);\n embedbuilder(\n client,\n message,\n \"#0099ff\",\n \"Volume!\",\n `Raised the Volume to \\`${queue.volume}\\``\n ).then((msg) => msg.delete({ timeout: 3000 }).catch(console.error));\n await playingMessage.edit(curembed(message)).catch(console.error);\n break;\n\n case emojiName.Backward:\n reaction.users.remove(user).catch(console.error);\n let seektime = queue.currentTime - 10000;\n if (seektime < 0) seektime = 0;\n await client.distube.seek(message, Number(seektime));\n playingMessage.edit(curembed(message)).catch(console.error);\n embedbuilder(\n client,\n message,\n \"#0099ff\",\n \"Seeked!\",\n `Seeked the song for \\`-10 seconds\\``\n ).then((msg) => msg.delete({ timeout: 3000 }).catch(console.error));\n\n break;\n\n case emojiName.Forward:\n reaction.users.remove(user).catch(console.error);\n let seektime2 = queue.currentTime + 10000;\n if (seektime2 >= queue.songs[0].duration * 1000) {\n seektime2 = queue.songs[0].duration * 1000 - 1;\n }\n console.log(seektime2);\n await client.distube.seek(message, seektime2);\n playingMessage.edit(curembed(message)).catch(console.error);\n embedbuilder(\n client,\n message,\n \"#0099ff\",\n \"Seeked!\",\n `Seeked the song for \\`+10 seconds\\``\n ).then((msg) => msg.delete({ timeout: 3000 }).catch(console.error));\n break;\n case emojiName.PlayPause:\n reaction.users.remove(user).catch(console.error);\n if (isPaused) {\n client.distube.resume(message, queue);\n } else if (!isPaused) {\n client.distube.pause(message, queue);\n }\n playingMessage.edit(curembed(message)).catch(console.error);\n embedbuilder(\n client,\n message,\n \"#0099ff\",\n isPaused ? \"Resume\" : \"Paused\",\n `The music was ${isPaused ? \"resume\" : \"paused\"}`\n ).then((msg) => msg.delete({ timeout: 3000 }).catch(console.error));\n break;\n case emojiName.Queue:\n reaction.users.remove(user).catch(console.error);\n let currentPage = 0;\n if (!queue)\n return embedbuilder(\n client,\n message,\n \"RED\",\n \"There is nothing playing!\"\n ).then((msg) => msg.delete({ timeout: 5000 }).catch(console.error));\n\n const embeds = QueueEmbed(queue.songs);\n const queueEmbed = await message.channel.send(\n `\n **Current Page - ${currentPage + 1}/${embeds.length}**`,\n embeds[currentPage]\n );\n try {\n await queueEmbed.react(\"⬅️\");\n await queueEmbed.react(\"⏹\");\n await queueEmbed.react(\"➡️\");\n } catch (error) {\n console.error(error);\n }\n const filter = (reaction, user) =>\n [\"⬅️\", \"⏹\", \"➡️\"].includes(reaction.emoji.name) &&\n message.author.id === user.id;\n const collector = queueEmbed.createReactionCollector(filter, {\n time: 60000,\n });\n collector.on(\"collect\", async (reaction, user) => {\n try {\n if (reaction.emoji.name === \"➡️\") {\n if (currentPage < embeds.length - 1) {\n currentPage++;\n queueEmbed.edit(\n `**Current Page - ${currentPage + 1}/${embeds.length}**`,\n embeds[currentPage]\n );\n }\n } else if (reaction.emoji.name === \"⬅️\") {\n if (currentPage !== 0) {\n --currentPage;\n queueEmbed.edit(\n `**Current Page - ${currentPage + 1}/${embeds.length}**`,\n embeds[currentPage]\n );\n }\n } else {\n collector.stop();\n reaction.message.reactions.removeAll();\n }\n await reaction.users.remove(message.author.id);\n } catch (error) {\n console.error(error);\n }\n });\n break;\n\n case emojiName.Loop:\n client.distube.setRepeatMode(message);\n playingMessage.edit(curembed(message)).catch(console.error);\n embedbuilder(\n client,\n message,\n \"#0099ff\",\n `Loop ${\n queue.repeatMode\n ? queue.repeatMode === 2\n ? \"✅ Queue\"\n : \"✅ Song\"\n : \"Off\"\n }`,\n `Loop: ${\n queue.repeatMode\n ? queue.repeatMode === 2\n ? \"✅ Queue\"\n : \"✅ Song\"\n : \"Off\"\n }`\n ).then((msg) => msg.delete({ timeout: 3000 }).catch(console.error));\n await reaction.users.remove(message.author.id);\n break;\n case emojiName.Refresh:\n reaction.users.remove(user).catch(console.error);\n playingMessage.edit(curembed(message)).catch(console.error);\n await reaction.users.remove(message.author.id);\n break;\n default:\n reaction.users.remove(user).catch(console.error);\n break;\n }\n });\n collector.on(\"end\", () => {\n playingMessage.reactions.removeAll().catch(console.error);\n });\n } catch (error) {\n console.log(error);\n }\n}", "title": "" }, { "docid": "d81db74c0eef0ba65707e91c65005c51", "score": "0.59339184", "text": "function getSongs() {\n $.ajax({\n type: 'GET',\n url: '/songs',\n success: function(data) {\n $('#song-list').empty();\n // append each song to the DOM\n data.forEach(function(song, i) {\n appendDOM(song);\n });\n }\n });\n }", "title": "" }, { "docid": "e13c8b61078c4368397109ea7df6c35a", "score": "0.59332544", "text": "function playQueue(position) {\n //If empty queue, just return\n if (localStorage.getItem(\"length\") === null) {\n return;\n }\n\n //If top title doesn't exist insert it\n if(!$('#top-search-form').length) {\n insertTopSearchBar();\n $(\"#ppQueue\").empty();\n $(\"#ppQueue\").append(\"<button onclick='pauseQueue(0)'><i class='fa fa-pause'></i></button>\");\n }\n\n //Gets top of list on queue\n var found = false;\n var i = position;\n\n // Continues to find the next song that is available closest to the position\n while (!found) {\n //At the end of length\n if(i == parseInt(localStorage.getItem('length')) && loop == false) {\n closeAllVideo();\n $(\"#ppQueue\").empty();\n $(\"#ppQueue\").append(\"<button onclick='playQueue(0)'><i class='fa fa-play'></i></button>\");\n return;\n }\n else if (i == parseInt(localStorage.getItem('length')) && loop == true) {\n playQueue(0);\n return;\n }\n\n if (localStorage.getItem(i.toString()) != null) {\n found = true; \n // Highlights the song on the queue bar\n $('#li' + i).css('background-color','#71B500');\n $('#li' + i + ' button').css('background-color','#71B500');\n // Set the position to the song currently playing position\n setCurrentPosition(i.toString());\n // Go to displaying song if youtube or soundcloud\n displayVideoOrTrack(localStorage.getItem(i.toString())); \n }\n ++i;\n }\n}", "title": "" }, { "docid": "e11972240dfe87e208a5b82241d4cf4d", "score": "0.5924375", "text": "youtubePlayer (msg) {\r\n msg.member.voiceChannel.join()\r\n .then(connection => {\r\n ytSearch(musicQue.playList[0])\r\n .then((data) => {\r\n const stream = ytdl(data.link, { filter: 'audioonly' });\r\n const dispatcher = connection.playStream(stream);\r\n dispatcher.on('end', () => {\r\n if (musicQue.playList[1]) {\r\n musicQue.playList.shift();\r\n msg.say('Now playing ' + musicQue.playList[0])\r\n this.youtubePlayer(msg)\r\n } else {\r\n msg.member.voiceChannel.leave(),\r\n musicQue.playList.shift()\r\n }\r\n })\r\n })\r\n })\r\n }", "title": "" }, { "docid": "7be7de194b93e05ace6d0bff04e8d361", "score": "0.5916247", "text": "function playNowFromQueue() {\n // Listen for a click\n $(document).on('click', '.video-queue .play-now', function () {\n // Fetch the passed video id\n var videoId = $(this).data('video-id');\n // Fetch the position of the chosen song\n var position = $(this).data('position');\n\n // Remove the clicked element\n $('#' + position).remove();\n\n // If the queue is empty\n if (queue.length == 0 || queue.length < 1) {\n // We need to build the currentSong from the suggestions list\n currentSong = {\n 'position': position,\n 'videoId': videoId,\n 'title': suggestions[position]['snippet']['title'],\n 'duration': convert_time(suggestions[position]['contentDetails']['duration']),\n 'thumbnail': suggestions[position]['snippet']['thumbnails']['high']['url']\n };\n // If there is a queue\n } else {\n // Get the song from the queue list based on it's position\n currentSong = findElement(queue, 'position', position);\n\n // Start the video\n player.loadVideoById(currentSong['videoId']);\n\n // If the previous song was in queue\n if (findElement(queue, 'videoId', currentSong['videoId']) !== 'undefined') {\n // Remove it\n findAndRemove(queue, 'videoId', currentSong['videoId']);\n }\n\n // Show suggestions based on the new song\n showSuggestions(videoId);\n }\n\n // Show suggestions based on the new song\n showSuggestions(currentSong['videoId']);\n // Start the new song\n player.loadVideoById(currentSong['videoId']);\n // Display the song information in the bottom tray\n displayCurrentSong();\n });\n}", "title": "" }, { "docid": "d1fc5c3154fa802869630bc1956f740d", "score": "0.59047335", "text": "function sendQueue() {\n\tfor (var i = 0; i < queue.length; ++i) {\n\t\tvar record = queue[i];\n\t\tfetch('/api/v1/records', {\n\t\t\tmethod: 'POST', // *GET, POST, PUT, DELETE, etc.\n\t\t\tmode: 'same-origin', // no-cors, *cors, same-origin\n\t\t\tcache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached\n\t\t\tcredentials: 'same-origin', // include, *same-origin, omit\n\t\t\theaders: {\n\t\t\t\t// 'Content-Type': 'application/json'\n\t\t\t\t// 'Content-Type': 'application/x-www-form-urlencoded',\n\t\t\t\t'Content-Type': 'application/vnd.api+json'\n\t\t\t},\n\t\t\tredirect: 'follow', // manual, *follow, error\n\t\t\treferrerPolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url\n\t\t\tbody: JSON.stringify({\n\t\t\t\tdata: {\n\t\t\t\t\ttype: 'records',\n\t\t\t\t\tattributes: {\n\t\t\t\t\t\tgeohash: record.hash,\n\t\t\t\t\t\thits: record.hits,\n\t\t\t\t\t\treaction: record.type\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}) // body data type must match \"Content-Type\" header\n\t\t}).then((response) => {\n\t\t\treturn response.json();\n\t\t}).then((data) => {\n\t\t\tconsole.log(data);\n\t\t});\n\t}\n}", "title": "" }, { "docid": "3f53c520cd3bb04a9d2deedfa059e52a", "score": "0.58983886", "text": "async function Start() {\n var temp = await getAllSoundtracks();\n temp = globalSongs;\n request = temp;\n}", "title": "" }, { "docid": "b486325a4bdb0f565d9b74eca00c54fe", "score": "0.58809793", "text": "function updateUserQueue(updated_queue) {\n queue = updated_queue[getCookie(\"user_id\")];\n console.log(\"Updating user queue!\");\n document.getElementById(\"userQueue\").innerHTML = \"\";\n for (let song of queue) {\n var songInfo = song[0];\n // Note: songInfo[0] is song URI\n var albumImg = song[1];\n var queueImg = document.createElement(\"img\");\n queueImg.src = albumImg;\n queueImg.style.width = \"100%\";\n document.getElementById(\"userQueue\").appendChild(queueImg);\n }\n}", "title": "" }, { "docid": "eb5ec7a6d6ee9d63e57a8d9952c2ad45", "score": "0.5866461", "text": "function refreshSongList() {\r\n masterGame = $('#game').val();\r\n masterSongList = [];\r\n utils_socket.emit('game', gameDict[masterGame]);\r\n}", "title": "" }, { "docid": "a632e4de63cc102e54d4a678d9b9fe81", "score": "0.5863859", "text": "function playsong() {\n\t$('.play_song_class').click(function() {\n\t\tvar song_id = $(this).data('song');\n\t\tvar song_name = $(this).data('song_name');\n\t\tvar artist_name = $(this).data('artist_name');\n\t\tvar artist_id = $(this).data('artist_id');\n\t\tvar album_id = $(this).data('album_id');\n\t\tvar cover = $(this).data('cover');\n\n\t\t// set jquery sessions for playbar\n\t\t$.session.set('song_id', song_id);\n\t\t$.session.set('song_name', song_name);\n\t\t$.session.set('artist_name', artist_name);\n\t\t$.session.set('artist_id', artist_id);\n\t\t$.session.set('album_id', album_id);\n\t\t$.session.set('cover', cover);\n\n\t\t// add 1 play\n\t\t$.ajax({\n\t\t\turl: 'classes/class.artist.php',\n\t\t\ttype: \"POST\",\n\t\t\tdata: {\n\t\t\t\tsong_id: song_id,\n\t\t\t\taction: 'add_play',\n\t\t\t},\n\t\t\tsuccess: function(response) {\n\t\t\t\tconsole.log(response);\n\t\t\t}\n\t\t});\n\n\t\t// load playbar again for setting new song data\n\t\t$('#playbar_wrapper_loader').load('includes/playbar.php');\n\t\tsetTimeout(function(){\n\t\t\t$('#play-btn').trigger('click');\n\t\t}, 300);\n\t});\n}", "title": "" }, { "docid": "49136c7384c0910a6889faaa183a4963", "score": "0.58592504", "text": "componentDidMount() {\n this.socket = io();\n let that = this;\n $.ajax({\n method: 'GET',\n url: \"http://192.168.1.19:3000/songQueue\",\n contentType: 'application/json',\n dataTyle: 'json',\n success: data => {\n that.setState({\n firstSong: data.shift(),\n songInfo: data\n });\n // listen for playSong emit events\n this.socket.on('playSong', this.handleServerPlayEvent);\n }\n });\n }", "title": "" }, { "docid": "55b3df5cab1b0fd8a5760a462feb9545", "score": "0.5851971", "text": "function loadSongs() {\n API.getSongs()\n .then((res) => setSongs(res.data))\n .catch((err) => console.log(err));\n }", "title": "" }, { "docid": "5b8c0f59737e1e7ac0e9de9a96debbfa", "score": "0.584566", "text": "function refreshPlayList () {\n\t\tplayList = []\t\t\n\t\tvar trs = $('#tabla_usuario tr')\n\t\ttrs.each(function() {\n\t\t\tvar nombre = $(this).find('.nombre_de_cancion a').attr('data-nombre')\n\t\t\tvar mp3 = $(this).find('.nombre_de_cancion a').attr('data-url')\n\t\t\tvar item_id = $(this).attr('id')\n\t\t\tplayList.push({ nombre: nombre, mp3: mp3, item_id: item_id })\t\t\t\t\n\t\t})\t\n\t\tif (playList.length == 1) {\t\t\t\n\t\t\t$('#jquery_jplayer_1').jPlayer(\"setMedia\", {\n\t \tmp3: playList[0].mp3\n \t\t})\n \t\t$(\"#jquery_jplayer_1\").jPlayer(\"play\"); \n\t\t $('.jp-title ul li').text(playList[0].nombre)\n\t\t} \t\t\t\t\t\n\t}", "title": "" }, { "docid": "e1c6c1ea7f9752c049d6eec398ae5514", "score": "0.5840909", "text": "async function songClicked($this) {\n\tconsole.log('songClicked');\n\t// update the current song\n\tawait updateSong($this);\n\t// render the room\n\trenderRoom();\n}", "title": "" }, { "docid": "bd8e2a4ee3f4c28a26d0fae0c11bf143", "score": "0.58402884", "text": "getAllSounds() {\n this.get('api').request('getAllSounds');\n }", "title": "" }, { "docid": "c3dbedfa0a14a74ee46c58cd102499a5", "score": "0.58387405", "text": "function songs(){\n const spotify = new Spotify({\n id: keys.spotify.id,\n secret: keys.spotify.secret\n });\n \n spotify.search({ type: \"track\", query: info }, function(err, data) {\n if (!err) {\n for(var i = 0; i < data.tracks.items.length; i++){\n var songData = data.tracks.items[i];\n //artist\n console.log(\"Artist: \" + songData.artists[0].name);\n //song name\n console.log(\"Song: \" + songData.name);\n //spotify preview link\n console.log(\"Preview URL: \" + songData.preview_url);\n //album name\n console.log(\"Album: \" + songData.album.name);\n console.log(\"------------------------------------------------------------------------------\");\n }\n }\n else{\n console.log('Error occurred.');\n }\n \n });\n \n }", "title": "" }, { "docid": "ea41e0a8cefa004a2d1de2a71dbbbdb8", "score": "0.58370084", "text": "function play(connection, message) {\n var server = servers[message.guild.id];\n // Download link to YT video, and plays it\n // Filter out the video to save bandwidth\n server.dispatcher = connection.playStream(ytdl(server.queue[0], {filter: \"audioonly\"}));\n server.queue.shift();\n server.dispatcher.on(\"end\", function() {\n // If there is another song to play in the queue\n if (server.queue[0]) {\n play(connection, message);\n } else {\n connection.disconnect();\n }\n });\n\n }", "title": "" }, { "docid": "a5352eb6566128cb50c3943a21b0d32e", "score": "0.58366114", "text": "function requestPlay(i){\n ipcRenderer.send('playRequest', i);\n ipcRenderer.on('toPlay', (event, file) => {\n\tconsole.log('voy a intentar reproducir a ver que pasa');\n\t//file.appendTo('body');\n })\n}", "title": "" }, { "docid": "b15474c1fb31bc8d854b1a78e24e2621", "score": "0.58319867", "text": "function index (req, res, next) {\n Playlist.find({ owner: req.decoded._id}, {songs: 0}, function(err, playlists){\n if (err) return console.log(err)\n\n res.json(playlists);\n })\n}", "title": "" }, { "docid": "33704cd22264f6a568b5cf02449fc6ab", "score": "0.5826362", "text": "function getPlayingSong(req,res,next){\n\tvar query = \"SELECT title,artist,album,nsurl FROM users u, currentSongs c WHERE c.clientID='\" + req.params.clientID + \"' and c.clientID = u.clientID;\";\t\n\tconsole.log(query);\t\n\tconnection.query(query, function(err, results) {\n if(err) res.send(400);\n res.send(results);\n next();\n \t});\n}", "title": "" }, { "docid": "d75bdba9a35a54518efb816de0e93ba3", "score": "0.5824579", "text": "playSong() {\n const { track } = this.props;\n if (track) {\n // update the song to show as playing so the list will not\n // reorder and move this item\n Meteor.collection('tracks').update(track._id, {\n $set: {\n playing: true,\n },\n });\n if (this.state.initialized) {\n fade(true);\n SpotifyAuth.playURI(track.uri, () => {\n setPlaying(track.uri);\n this.startPlayBackPositionTimer();\n });\n }\n }\n }", "title": "" }, { "docid": "3176ba659db5a14de84ef78291bffd85", "score": "0.5820786", "text": "async function execute(message, serverQueue) {\n const args = message.content.split(' ');\n const voiceChannel = message.member.voiceChannel;\n if(!voiceChannel) return message.channel.send('You need to be in a voice channel to play music!');\n const permissions = voiceChannel.permissionsFor(message.client.user);\n if(!permissions.has('CONNECT') || !permissions.has('SPEAK')) {\n return message.channel.send('I need the permissions to join and speak in your voice channel!')\n }\n\n //get song info and save into a song object\n const songInfo = await ytdl.getInfo(args[2])\n const song = {\n title: songInfo.title,\n url: songInfo.video_url,\n };\n\n //create a contract we can add to our queue\n if(!serverQueue) {\n const queueContruct = {\n textChannel: message.channel,\n voiceChannel: voiceChannel,\n connection: null,\n songs: [],\n volume: 5,\n playing: true,\n };\n\n queue.set(message.guild.id, queueContruct);\n\n queueContruct.songs.push(song);\n\n try {\n var connection = await voiceChannel.join();\n queueContruct.connection = connection;\n play(message.guild, queueContruct.songs[0]);\n } catch (err) {\n console.log(err);\n queue.delete(message.guild.id);\n return message.channel.send(err);\n }\n }\n else {\n serverQueue.songs.push(song);\n console.log(serverQueue.song);\n return message.channel.send(`${song.title} has been added to the queue!`);\n }\n\n}//end execute", "title": "" }, { "docid": "192e2d4af15a6e70fe176f254b0cff64", "score": "0.5820023", "text": "function getMusic() {\r\n var artist = document.getElementById('artist').value;\r\n itunes.getMusicByArtist(artist).then(drawSongs);\r\n}", "title": "" }, { "docid": "ba3d58f7f52f953e6caeab08d0967169", "score": "0.58180237", "text": "async function getSongs (req,res){\n try{\n var songs = await controller.findAllSongs();\n res.status(200).send(songs);\n }\n catch(e){\n res.status(500).send('hubo un error al mostrar la lista de canciones' + e);\n }\n}", "title": "" }, { "docid": "60a68988a5a00c67a4413e29ba5e16db", "score": "0.58156514", "text": "function playSong(id) {\n //Stop the sound from playing\n\t\n soundManager.destroySound(mySound);\n\t\n\t//console.log('playing song id => '+ id);\n //If we're under, just go to the end!\n if (id < 0)\n id = songs.length - 1;\n \n //If we're over, choose what to do via the repeat flag\n if (id >= songs.length)\n id = 0;\n \n //Save some variables\n playingSongId = id;\n playingSong = songs[playingSongId];\n\tsetCoverart(playingSong.visual);\n //Toggle the pause\n setPauseState(soundManager.togglePause(mySound).paused);\n \n var track_url = playingSong.filepath.replace('/home/galizur/public_html/', 'http://www.galizur.com/'); \n $.post('http://www.galizur.com/home/mobile/update_play', {myid : playingSong.myid}, 'activate', 'jsonp');\n //Create the sound and begin playing whenever!\n \n soundManager.setup({\n\t\turl :'swf/',useHTML5Audio: true,\n\t\tpreferFlash: true,\n\t\tonready: function() {\n // SM2 has started - now you can create and play sounds!\n soundManager.createSound({\n id: mySound,\n url: track_url,\n autoPlay: true,\n stream: true,\n onplay: function () {\n setPlayingInfo(playingSong.basename);\n setPauseState(false);\n setPlayTime();\n\t\t\t\t\t\t//playerFooter.prepend($('<div>'+playingSong.basename+'</div>')).fadeIn('Slow');\n playerFooter.html('<div>'+playingSong.basename+'</div>').fadeIn('Slow');\n\n },\n onfinish: function() {\n //We'll only continue if we're shuffling or repeating if we past the end...\n if (shuffle == false && (playingSongId + 1 >= songs.length) && repeat == false) {\n //No more songs...\n setPlayingInfo();\n setPauseState(false);\n setPlayTime();\n playingSong = null;\n playingSongId = null;\n return;\n }\n else {\n playNextSong();\n }\n },\n onload: function () {\n playingSong.duration = this.duration / 1000;\n },\n whileplaying: function () {\n setPlayTime(this.position / 1000, playingSong.duration, this.durationEstimate / 1000);\n }\n });\n\t\n\t}\n\t\n});\n \n}", "title": "" }, { "docid": "ff1990570c783568d5ab221c3fbac0f2", "score": "0.58079493", "text": "getNowPlaying(){\n getNowPlaying()\n .then(data => {\n this.setState({items: data.results}, this.setAvailableGenres);\n this.updateList()},\n (error) => {this.error(error)});\n }", "title": "" }, { "docid": "651726732fd29831116ddb54cffd8a45", "score": "0.58070487", "text": "function deezer_play(query) {\n DZ.api('/search/?q=' + query + '&index=0&nb_items=5&output=json', function(response) {\n var tracks = $.map(response.data, function(track) { return track.id })\n if(tracks.length) {\n DZ.player.playTracks(tracks);\n }\n });\n}", "title": "" }, { "docid": "56010b1b1ae077ce489fcda15c215f34", "score": "0.5806765", "text": "_onSubmit(event) {\n event.preventDefault();\n\n this.audioPlayer.setSong(this.songThemeMap.songValue);\n this.audioPlayer.setKickCallback(this._onKick);\n this.audioPlayer.play();\n }", "title": "" }, { "docid": "9a2cf44e2ce8039571a9dc40f4823daf", "score": "0.5804129", "text": "function updatePlayCount() {\n /*\n Richiama la pagina contenente la query che aggiorna il database aggiungendo 1 al numero di riproduzioni della\n traccia attualmente riprodotta dall'utente.\n */\n\n $.ajaxSetup({\n headers: {\n 'X-CSRF-TOKEN': $('meta[name=\"csrf-token\"]').attr('content')\n }\n });\n $.post(\"/listened/\" + parseInt(Amplitude.getActiveSongMetadata().id), {}, function (data, status, xhr) {}, \"json\");\n}", "title": "" }, { "docid": "946c832274c5b15f6aa46d374486a8f3", "score": "0.579815", "text": "playNextVox() {\n console.log(\"playNextVox this.vox_queue = \", this.vox_queue);\n var data = this.vox_queue.shift(); // unshift PUTS elements\n console.log(\"voxEnd event dispatched\");\n if (this.vox_queue.length !== 0) {\n var doPlay = (delay) => {\n if (this.vox_queue[0].state() !== \"loaded\") {\n setTimeout(doPlay, Math.min(1000, delay * 2));\n console.log(\"Waiting for voice to load.\");\n return;\n } else {\n this.vox_queue[0].play();\n console.log(\"Voice loaded.\");\n }\n }\n doPlay(50);\n } else {\n document.dispatchEvent(\n new CustomEvent('allVoxEnd', {\n detail: {\n name: data._src.substring(data._src.lastIndexOf(\"/\"))\n }\n })\n );\n console.log(\"allVoxEnd event dispatched\");\n return;\n }\n }", "title": "" }, { "docid": "21256a8c31549cf467d3ad87b6049c3b", "score": "0.57952654", "text": "function jElectroPlay() {\n playSong2();\n }", "title": "" }, { "docid": "25ad071e68efac18b9037f7150ed40be", "score": "0.57764596", "text": "play() {\n\t\tthis.updatePlayState();\n\t\tthis.callback('play');\n\t}", "title": "" }, { "docid": "67ee76174a071a12c87c6d365477810a", "score": "0.57713926", "text": "function play(guild, song) {\n const serverQueue = queue.get(guild.id);\n\n if (!song) {\n serverQueue.voiceChannel.leave();\n queue.delete(guild.id);\n return;\n }\n\n // after that, start playing song with playStream function and URL of our song\n // this is a recursive function, so it cal itself over and over again = play the next song when the song is finished\n const dispatcher = serverQueue.connection\n .playStream(ytdl(song.url))\n .on(\"end\", () => {\n console.log(\"Music ended !\");\n // Deöete the finished song from the queue\n serverQueue.songs.shift();\n // call the PLAY() again with next song\n play(guild, serverQueue.songs[0]);\n })\n .on(\"error\", error => {\n console.error(error);\n });\n dispatcher.setVolumeLogarithmic(serverQueue.volume / 5);\n}", "title": "" }, { "docid": "1466a1187b37fb69f12f3175b661c7fe", "score": "0.57701373", "text": "async function searchSong() {\n let response = await fetch(\n 'https://yt-music-api.herokuapp.com/api/yt/songs/' + input,\n )\n let result = await response.json()\n setSongs(result.content)\n }", "title": "" }, { "docid": "da53deb8cdec509dfa41622e7fddad8f", "score": "0.5769967", "text": "onUpdate() {\n if (this._player) {\n if (!this.is_progress_dirty) {\n this.setState({\n progress: this._player.currentTime / this._player.duration\n });\n }\n if (this._player.ended){\n var songID=this.props.data_be.data_be.queue.find(el => el == this.props.song.song._id)\n if(songID!==undefined){\n this.props.RemoveQueue(songID,this.props.data_be.data_be._id,this.props.token.token,this.props.isQueue.isQueue)\n }\n if(this.props.isQueue.isQueue === false && this.props.currentPlaylist.currentPlaylist)\n {\n this.onPlayerNext();\n }\n else if(this.props.isQueue.isQueue === true && this.props.queue.queue)\n {\n this.props.PlayTheFooter(this.props.queue.queue[0])\n }\n }\n }\n }", "title": "" }, { "docid": "b1b8c3cd4e198c1e801f0edea61d7658", "score": "0.57626903", "text": "addEventsToQueue(events) {\n console.log('PlaybackStore::addEventsToQueue()');\n\n for (var e of events) {\n var songs = Array();\n var _pbstore = this;\n e.eventArtists.forEach(function (ea) {\n ea.artist.songs.forEach(function (s) {\n _pbstore.songQueue.push(s);\n });\n });\n }\n\n this.currentSong = this.songQueue[this.positionInQueue];\n this.storeUpdated();\n }", "title": "" }, { "docid": "d3cd03fa716b5b049b73ca2cddf75afb", "score": "0.57624626", "text": "handleSongFinished() {\n this.next();\n }", "title": "" }, { "docid": "9f7ac128d101dd2c9e579d503aaa2671", "score": "0.5761812", "text": "async play(db, text) {\n let res = await axios.post(`http://${this.host}:${this.port}/voiceDB/local/play`, {\n db,\n text\n })\n return res.data;\n }", "title": "" }, { "docid": "101f3d60498502dfc8e42a2c9b883433", "score": "0.57597923", "text": "next ()\n {\n // Try to pop an item from the queue and start playing it.\n let next = this.queue.shift();\n\n if(next)\n {\n // Move on to playing the next thing\n this.context.startPlay(next);\n }\n else\n {\n // Done playing everything.\n this.context.stopPlay();\n }\n }", "title": "" }, { "docid": "052acc29aebd6d0a58e753f099e3b1dc", "score": "0.5755538", "text": "function play(guild, song) {\n const serverQueue = queue.get(guild.id);\n if (!song) {\n serverQueue.voiceChannel.leave();\n queue.delete(guild.id);\n return;\n }\n const dispatcher = serverQueue.connection\n .play(ytdl(song.url, {quality: 'highestaudio', highWaterMark: 1 << 25}))\n .on(\"finish\", () => {\n serverQueue.songs.shift();\n play(guild, serverQueue.songs[0]);\n })\n .on(\"error\", error => console.error(error));\n dispatcher.setVolumeLogarithmic(serverQueue.volume / 5);\n serverQueue.textChannel.send(`${ePlaying}Start playing: **${song.title}**`);\n}", "title": "" }, { "docid": "4485d3e1d8e273cad2e38b699ae8c208", "score": "0.5755535", "text": "function playSong0(){\n currentIndex = 0;\n var nextIndex = currentIndex;\n playTrack(nextIndex)\n }", "title": "" }, { "docid": "c3fa30f7377c5c77382417662f06cb23", "score": "0.57506824", "text": "function playSong1(){\n currentIndex = 1;\n var nextIndex = currentIndex;\n playTrack(nextIndex);\n console.log(\"playing J-hip-hop\");\n }", "title": "" }, { "docid": "71f5830d812564cecdea8cd986868c02", "score": "0.57422894", "text": "getMusic(e) {\n e.preventDefault();\n var artist = e.target.artist.value;\n //changes the button to loading while songs load\n //@ts-ignore\n $('#get-music-button').text('LOADING....');\n itunesService.getMusicByArtist(artist).then(results => {\n drawSongs(results)\n //changes button back to GET MUSIC once songs are loaded\n //@ts-ignore\n $('#get-music-button').text('GET MUSIC');\n })\n }", "title": "" }, { "docid": "c6a6858b6f3a3acce04b1e240125115c", "score": "0.57409316", "text": "function jTraditional() {\n playSong0();\n console.log('playing song1');\n }", "title": "" }, { "docid": "b9d457ecf57366c8bfaa3112575274a8", "score": "0.574017", "text": "play(nextSong) {\n const channel = this.client.channels.get(this.message.member.voiceChannelID);\n\n channel.join().then(connection => {\n\n if (nextSong && nextSong.url) {\n this.message.reply(nextSong.url);\n this.playYoutubeSong(nextSong, connection);\n } else {\n return this.getYoutubeSearchResults().then(song => {\n this.message.reply(song.url);\n this.playYoutubeSong(song, connection)\n });\n }\n });\n }", "title": "" }, { "docid": "ea2996ba1d8a7c371e9db5467ee2ee30", "score": "0.57393384", "text": "function playSound(){\n songObj.song.play();\n \n }", "title": "" }, { "docid": "0f976f3b55de45c8dceea9dea1b89116", "score": "0.5737815", "text": "function showSongsList(){\n\t\n\t $.mobile.changePage(\"#showSongsLists\");\n\t $.each(songs, function(key, data){\n\t\tvar a = $(\"<a href='#player'><h5 class='ui-li-heading'>\" + data.basename + \"</h5>\\n\\n\\\n\t\t<p>Artist: \"+data.artist+\" </p><p> <span class='ui-li-count'>plays \"+ data.plays +\"</span></p></a>\");\n $(a).click({ id: key }, function (event) {\n playSong(event.data.id);\n });\n $('#playlistsSongs').append($(\"<li></li>\").html(a));\n\t\t\n\t\t});\n\t\t$('#playlistsSongs').listview('refresh');\n\t\t\n\treturn false;\n}", "title": "" }, { "docid": "9fe53e808a098909ce70bf0a5475dde9", "score": "0.57362247", "text": "@action\n start() {\n const proms = this.players.map(player => this.api.savePlayer(player.name));\n Promise.all(proms)\n .then(result => result.map(res => res.data))\n .catch(console.error);\n }", "title": "" }, { "docid": "fc49c3d033559667aee6a72df2c9df7b", "score": "0.57353073", "text": "function BL_updateNowPlaying() {\n var title = BL_getTrack();\n var artist = BL_getArtist();\n var duration = BL_getDuration();\n var newTrack = title + \" \" + artist;\n\n // Update scrobbler if necessary\n if ( newTrack != \" \" && newTrack != BL_LAST_TRACK && duration > 0 ) {\n //console.log(\"Submitting a now playing request. artist: \"+artist+\", title: \"+title+\", duration: \"+duration);\n\n BL_LAST_TRACK = newTrack;\n chrome.runtime.sendMessage({type: 'validate', artist: artist, track: title}, function(response) {\n if (response != false) {\n // submit the validated song for scrobbling\n var song = response;\n chrome.runtime.sendMessage({type: 'nowPlaying', artist: song.artist, track: song.track, duration: duration});\n } else {\n // on failure send nowPlaying 'unknown song'\n console.log( \"Song validation failed!\" );\n chrome.runtime.sendMessage({type: 'nowPlaying', duration: duration});\n }\n });\n }\n}", "title": "" }, { "docid": "42bda0f3200f45c9417c0d13694d3822", "score": "0.57342213", "text": "function refreshSongList(){\n\n\t// load in current songs to the player\n\t$.ajax({\n\t\ttype: \"GET\",\n\t\turl: 'http://localhost:3000/api/get_song_list',\n\t\tdataType: 'json',\n\t\tsuccess: function(res) {\n\t\t\tcurrentDisplayedSongs = res;\n\n\t\t\t// empty previous list\n\t\t\t$(\"#song_list\").empty();\n\n\t\t\t// if there are songs to display\n\t\t\tif (res.length > 0) {\n\n\t\t\t\t// display current playing song\n\t\t\t\tvar image = new Image();\n\t\t if (res[0].cover_url != null) image.src = res[0].cover_url;\n\t\t \n\t\t // insert image\n\t\t var html = \"<li class=\\\"li_live\\\"><img class=\\\"song_album_art_live\\\" src=\\\"\"+image.src+\"\\\" />\";\n\n\t\t // insert track info\n\t\t html += \"<div class=\\\"song_group_live\\\" >\";\n\t\t html += \"<div class=\\\"song_name_live\\\" >\"+res[0].name+\"</div>\";\n\t\t html += \"<div class=\\\"song_artist_live\\\" > \"+res[0].artist+\"</div>\";\n\t\t html += \"<div class=\\\"song_album_live\\\">\"+res[0].album+\"</div></div></li><br>\";\n\t\t // add song to list\n\t\t $('#song_list').append(html);\n\n\n\t\t\t\t// fill the other songs in\n\t\t\t\tfor (var x = 1; x < res.length; x++)\n\t\t\t\t{\n\t\t\t\t\timage = new Image();\n\t\t\t if (res[x].cover_url != null) image.src = res[x].cover_url;\n\t\t\t \n\t\t\t // insert image\n\t\t\t var html = \"<li><img class=\\\"song_album_art\\\" src=\\\"\"+image.src+\"\\\" />\";\n\n\t\t\t // insert track info\n\t\t\t html += \"<div class=\\\"song_group\\\" >\";\n\t\t\t html += \"<div class=\\\"song_name\\\" >\"+res[x].name+\"</div>\";\n\t\t\t html += \"<div class=\\\"song_artist\\\" > \"+res[x].artist+\"</div>\";\n\t\t\t html += \"<div class=\\\"song_album\\\">\"+res[x].album+\"</div></div>\";\n\n\t\t\t // insert voting box\n\t\t\t html +=\t\"<div class=\\\"song_voteBox\\\">\";\n\t\t\t html += \"<button class=\\\"song_voteUp\\\" id=\\\"up-\"+x+\"\\\"> /\\\\ </button>\"\n\t\t\t html += \"<button class=\\\"song_voteDwn\\\" id=\\\"dwn-\"+x+\"\\\"> \\\\/ </button>\"\n\t\t\t html += \"</div><div class=\\\"song_voteNum\\\">\"+res[x].votes+\"</div>\"\n\t\t\t\t\thtml += \"</li><br>\";\n\n\t\t\t // add song to list\n\t\t\t $('#song_list').append(html);\n\n\t\t\t // apply listener to song_voteUp buton\n\t\t\t\t\t$('#up-'+x).click(function() {\n\n\t\t\t\t\t\t// get song id \n\t\t\t\t\t\tvar tokens = $(this).attr('id').split(\"-\");\n \t\t\t\t\t\tvar songID = tokens[1];\n\n\t\t\t\t\t\t// post song vote\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t\t\turl: 'http://localhost:3000/api/vote_for_song',\n\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t'song': currentDisplayedSongs[songID].uri,\n\t\t\t\t\t\t\t\t'vote': 'up'\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tdataType: 'json'\n\t\t\t\t\t\t});\t\n\t\t\t\t\t});\n\n\t\t\t\t\t// apply listener to song_voteDwn buton\n\t\t\t\t\t$('#dwn-'+x).click(function() {\n\n\t\t\t\t\t\t// get song id \n\t\t\t\t\t\tvar tokens = $(this).attr('id').split(\"-\");\n \t\t\t\t\t\tvar songID = tokens[1];\n\n\t\t\t\t\t\t// post song vote\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t\t\turl: 'http://localhost:3000/api/vote_for_song',\n\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t'song': currentDisplayedSongs[songID].uri,\n\t\t\t\t\t\t\t\t'vote': 'dwn'\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tdataType: 'json'\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t }\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "d07c43b0f563c077e63e70519a4f1ca1", "score": "0.5733467", "text": "function addSongsToViewMusic(sentSongs) {\n\n if (sentSongs === null ) { // If there are no songs sent to it then get the song info from the local songCollection Object\n sentSongs = songCollection;\n }\n let songString = \"\";\n $.each(sentSongs, (i, currentSong) => { \n songString += `<div class=\"row\" db-key=\"${i}\">`; // Gives each <li> song item a special key based on the database key\n songString += `<div class=\"col-xs-2\">`;\n songString += `<span class=\"glyphicon glyphicon-trash dlt-song\" aria-hidden=\"true\"></span>`;\n songString += `<span class=\"glyphicon glyphicon-edit edit-song\" aria-hidden=\"true\"></span>`;\n songString += `</div>`;\n songString += `<div class=\"col-xs-10\">`;\n songString += `<li>`;\n songString += `${currentSong.title} > ${currentSong.artist} on the album ${currentSong.album}`.replace(/[|;$!%@\"<()+,*]/g, \"\").replace(/\\>/g, \"-\");\n songString += `</li>`;\n songString += `</div>`;\n songString += `</div>`;\n });\n $(\"#song-holder-list\").prepend(songString);\n}", "title": "" }, { "docid": "b6862ddeae092b98f5db1132f02504eb", "score": "0.5731922", "text": "async getSongsForFrontend( songId = null ) {\n\t\tlet songs = [];\n\t\tlet args = { getAll: true }\n\t\tif ( songId != null ) args = { id: songId, getAll: false };\n\t\tlet { data, more } = await this.getSongs( args );\n\t\tfor ( let songdata of data ) {\n\t\t\tsongdata.arrangement = {}\n\n\t\t\tlet res = await this.getSongArrangements( { songId: songdata.id } );\n\t\t\tif ( res.data.length > 0 ) {\n\t\t\t\tsongdata.arrangement = res.data[ 0 ];\n\t\t\t\tlet song = this.songFromSongDataWithArrangement( songdata );\n\t\t\t\tsongs.push( song );\n\t\t\t}\n\t\t}\n\t\treturn songs;\n\t}", "title": "" }, { "docid": "2b27165a1a13fffaa9d81b5738713b16", "score": "0.57242966", "text": "play() {\n this.setStatus({isPlaying: true, isBuffering: true});\n this.sendControlRequest(\"play\");\n }", "title": "" }, { "docid": "f6d3643b386c888679894e5bff254e38", "score": "0.5720337", "text": "_play() {\n \tthis.audioPlayer = new AudioPlayer();\n\tthis.audioPlayer.setSong(this.obj.songValue);\n this.playButton = new PlayButton(this._pause, this._replay);\n\tthis.gifDisplay = new GifDisplay(this.Info, this._showMusicPage);\n\tthis.audioPlayer.setKickCallback(this.gifDisplay._nextGif);\n }", "title": "" }, { "docid": "8d075d1519ee7580c5bbafc0f324cca4", "score": "0.5718855", "text": "createPlaylist (list) {\r\n console.log (\"Creating new playlist\");\r\n var jsonObj = {\r\n SongList : list\r\n }\r\n let promise = fetch (`https://localhost:5001/api/mediaplayer`, {\r\n method: \"POST\",\r\n headers: {\r\n \"Content-Type\": \"application/json\"\r\n },\r\n body: JSON.stringify(jsonObj)\r\n });\r\n\r\n return promise;\r\n }", "title": "" }, { "docid": "ab49e073b45cce733443bb6d854e23c0", "score": "0.57166684", "text": "function findSong() {\n\n\tvar search = $('#tbx_search').val();\n\n\t// send request\n\t$.ajax({\n\t\t\ttype: \"GET\",\n\t\t\turl: 'http://localhost:3000/api/find_song',\n\t\t\tdata: {\n\t\t\t\tsrch: search,\n\t\t\t\t'access_token': access_token\n\t\t\t},\n\t\t\tdataType: 'json',\n\t\t\tsuccess: function(found){\n\n\t\t\t\t// on receiving songs, add them to the search list\n\n\t\t\t\t// empty previous search and populate new search\n\t\t\t\t$(\"#search_list\").empty();\n\t\t\t\tcurrentSearchedSongs = found;\n\n\t\t\t\tfor (var x = 0; x < found.tracks.length; x++)\n\t\t\t\t{\n\t\t\t\t\tvar image = new Image();\n\t\t\t if (found.tracks[x].cover_url != null) image.src = found.tracks[x].cover_url;\n\t\t\t \n\t\t\t // insert image\n\t\t\t var html = \"<li><img class=\\\"song_album_art\\\" id=\\\"link-\"+x+\"\\\" src=\\\"\"+image.src+\"\\\" />\";\n\n\t\t\t // insert track info\n\t\t\t html += \"<div class=\\\"song_group\\\" >\";\n\t\t\t html += \"<div class=\\\"song_name\\\" >\"+found.tracks[x].name+\"</div>\";\n\t\t\t html += \"<div class=\\\"song_artist\\\" > \"+found.tracks[x].artist+\"</div>\";\n\t\t\t html += \"<div class=\\\"song_album\\\">\"+found.tracks[x].album+\"</div></div></li><br>\";\n\n\t\t\t // add song to list\n\t\t\t $('#search_list').append(html);\n\n\t\t\t // apply listener to image\n\t\t\t\t\t$('#link-'+x).click(function() {\n\n\t\t\t\t\t\t// get song id \n\t\t\t\t\t\tvar tokens = $(this).attr('id').split(\"-\");\n \t\t\t\t\t\tvar songID = tokens[1];\n\n\t\t\t\t\t\t// post song to be added\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t\t\turl: 'http://localhost:3000/api/choose_song',\n\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t'song': currentSearchedSongs.tracks[songID]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tdataType: 'json'\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t \trefreshSongList();\n\t\t\t\t\t \tupdateLiveSong();\n\t\t\t\t\t }, 1000);\n\t\t\t\t\t});\n\t\t\t }\n\t\t\t},\n\t\t});\n}", "title": "" }, { "docid": "3060ba74901720c6a495cee37e50f69c", "score": "0.57113075", "text": "function gotAllSongs(err) {\n console.log(\"gotAllSongs()\");\n\n // report an error, you'd want to do something better than this in production\n if (err) {\n console.log(\"error loading data\");\n console.error(err);\n return;\n }\n\n // call functions to log and show the books\n consoleLogSongs();\n showSongs();\n}", "title": "" }, { "docid": "7e16575199b248e6165e2a4ffaaabea7", "score": "0.5707014", "text": "function playSong() {\n console.log(\"song is playing\")\n uno.style.display = 'none'\n due.style.display = 'block'\n song.loop();\n }", "title": "" }, { "docid": "ca1dcc0681940edd9e64666e75c28c44", "score": "0.57033116", "text": "async start() {\n for (let current of this.active) {\n const isPlaying =\n current.currentTime > 0 &&\n !current.paused &&\n !current.ended &&\n current.readyState > current.HAVE_CURRENT_DATA;\n // because there is sometimes an error that the pause() was interrupted by the play() I tried to make sure the sound is paused.\n // It is sometimes still show that error and I know its because the pause() and play() are asynchronous but I didn't manage to completely solve it.\n if (!isPlaying) {\n await current.play().catch((error) => {\n console.error(error);\n });\n }\n }\n }", "title": "" }, { "docid": "57be5c3cb794a36558267e9e62e5473c", "score": "0.5691717", "text": "getMusic(e) {\n e.preventDefault();\n var artist = e.target.artist.value;\n //changes the button to loading while songs load\n document.querySelector('#get-music-button').textContent = 'LOADING....'\n itunesService.getMusicByArtist(artist, drawSongs)\n }", "title": "" }, { "docid": "dd1eea10fdb5a7b781eda78fc911514a", "score": "0.5684153", "text": "getAllSongs () {\r\n console.log (\"Getting all songs\");\r\n let promise = fetch (`https://localhost:5001/api/mediaplayer`, {\r\n method: \"GET\",\r\n headers: {\r\n \"Content-Type\": \"application/json\"\r\n // \"Authorization\":t\r\n }\r\n });\r\n return promise;\r\n }", "title": "" }, { "docid": "b43025e16ade4b1f7e42396f53e005f2", "score": "0.56813", "text": "function play(connection, message) {\n var server = servers[message.guild.id];\n\n server.dispatcher = connection.playStream(ytdl(server.queue[0], {filter: \"audioonly\"}));\n\n server.queue.shift()\n\n server.dispatcher.on(\"end\", function() {\n if(server.queue[0]) play(connection, message);\n else connection.disconnect;\n })\n}", "title": "" }, { "docid": "8607b1f76e077dbd74b6a1553cb86402", "score": "0.56798357", "text": "function handleAPILoaded() {\n requestUserUploadsPlaylistId();\n}", "title": "" }, { "docid": "229de91cb96f6b911a6aed3de7520bb2", "score": "0.5665038", "text": "function runPlayLinkCommand(message, args, mgid) {\r\n if (!message.member.voice.channel) {\r\n return;\r\n }\r\n if (!args[1]) {\r\n if (dispatcherMap[mgid] && dispatcherMapStatus[message.member.voice.channel] === \"pause\") {\r\n message.channel.send(\"*playing*\");\r\n }\r\n return message.channel.send(\"Where's the link? I can't read your mind... unfortunately.\");\r\n }\r\n if (!args[1].includes(\".\")) {\r\n // message.channel.send(\"*I think you should be using \" + prefixMap[mgid] + \"d but ok then...*\");\r\n return runDatabasePlayCommand(args, message, mgid, false, false);\r\n }\r\n if (!servers[mgid])\r\n servers[mgid] = {\r\n queue: [],\r\n queueHistory: []\r\n };\r\n // in case of force disconnect\r\n if (\r\n !message.guild.client.voice ||\r\n !message.guild.voice ||\r\n !message.guild.voice.channel\r\n ) {\r\n servers[mgid].queue = [];\r\n servers[mgid].queueHistory = [];\r\n }\r\n let queueWasEmpty = false\r\n if (servers[mgid].queue.length < 1) {\r\n queueWasEmpty = true;\r\n }\r\n let pNums = 1;\r\n while (args[pNums]) {\r\n let linkZ = args[pNums];\r\n if (linkZ.substring(linkZ.length - 1) === \",\") {\r\n linkZ = linkZ.substring(0, linkZ.length - 1);\r\n }\r\n // push to queue\r\n servers[mgid].queue.push(args[pNums]);\r\n pNums += 1;\r\n }\r\n // make pNums the number of added songs\r\n pNums--;\r\n // if queue was empty then play\r\n if (queueWasEmpty) {\r\n playSongToVC(message, args[1], message.member.voice.channel, true);\r\n } else if (pNums < 2) {\r\n message.channel.send(\"*added to queue*\");\r\n } else {\r\n message.channel.send(\"*added \" + pNums + \" to queue*\");\r\n }\r\n}", "title": "" }, { "docid": "40cc7b8ea2773ec89a52fb6a0a4394e9", "score": "0.5662432", "text": "handleSubmitNextRound(e, i) {\n e.preventDefault();\n const { totalRounds } = this.props;\n\n if(i + 1 === totalRounds) {\n const audio = new Audio();\n audio.src = 'assets/sounds/Ryan_VanEerde_Sci-Fi_Explosion_2_20.mp3';\n audio.play();\n } else {\n const audio = new Audio();\n audio.src = 'assets/sounds/zapsplat_science_fiction_vehicles_zoom_by_ultra_sonic_whoosh_002_55942.mp3';\n audio.play();\n }\n this.props.handleNextRound();\n }", "title": "" }, { "docid": "8b11c718ec3dc77f9e3469db0a900acc", "score": "0.5660637", "text": "function playAll() {\n\t\tfor (var i = 0; i < threads.length; i++) {\n\t\t\tthreads[i].play();\n\t\t}\n\t}", "title": "" }, { "docid": "464cab870ee54ab9e09391d4d8ff19fc", "score": "0.5656447", "text": "async updateQueueTracksInfo({ state }, token) {\n state.queueNextTracks = [];\n\n var i;\n var tempTrackUrl;\n var songId;\n\n for (i = 0; i < state.queueTracks.length; i++) {\n tempTrackUrl = state.queueTracks[i];\n\n songId = tempTrackUrl.slice(\n tempTrackUrl.indexOf(\"/tracks/\") + \"/tracks/\".length,\n tempTrackUrl.length\n );\n if (state.trackId == songId) {\n break;\n }\n }\n\n var tracks = [];\n\n //request the data\n for (var j = i + 1; j < state.queueTracks.length; j++) {\n tempTrackUrl = state.queueTracks[j];\n\n let songID = tempTrackUrl.slice(\n tempTrackUrl.indexOf(\"/tracks/\") + \"/tracks/\".length,\n tempTrackUrl.length\n );\n\n var track = {\n name: undefined,\n artistName: undefined\n };\n\n await axios\n .get(\"/v1/users/track/\" + songID, {\n headers: {\n Authorization: token\n }\n })\n .then(response => {\n let trackData = response.data;\n\n track.name = trackData.name;\n track.durationMs = trackData.durationMs;\n\n track.artistName = trackData.artist.name;\n\n track.trackAlbumName = trackData.album.name;\n });\n tracks.push(track);\n }\n state.queueNextTracks = tracks;\n\n state.isCurTrkReady = true;\n }", "title": "" }, { "docid": "ca54bc282d3d3ebead644b0ffc3a81ef", "score": "0.56523633", "text": "getMusic(e) {\n e.preventDefault();\n var artist = e.target.artist.value;\n //changes the button to loading while songs load\n $('#get-music-button').text('LOADING....');\n itunesService.getMusicByArtist(artist).then(results => {\n drawSongs(results)\n //changes button back to GET MUSIC once songs are loaded\n $('#get-music-button').text('GET MUSIC');\n })\n }", "title": "" } ]
9d4216745a92021afb93dbc904b94b42
is the current page a duckduckgo.com page? switch to the google url
[ { "docid": "f2290c7b60dccea7fe3b87fee9f6c9cc", "score": "0.7803325", "text": "function switchURL() {\n\tif (isDCK) {\n\t\tvar searchTerm;\n\t\tvar splitted = currentURL.split(/(\\?|\\&)/);\n\n\t\tfor (var i = 0; i < splitted.length; i++) {\t\n\t\t\tif (splitted[i].match(/^q=.*$/)) {\n \t\t\t\tsearchTerm = splitted[i];\n \t\t\t}\n\t\t}\n\t\t\n\t\tvar google_url = \"https://google.com/search?\" + searchTerm;\n\t\tbrowser.tabs.update({url: google_url});\n\t} else {\n\t\tconsole.log('Error: Not a duckduckgo.com site');\n\t}\n}", "title": "" } ]
[ { "docid": "8b6ef607a5a36d73237da882b6d0cc97", "score": "0.6438335", "text": "function _gotoFirstPage() {\n window.location.href = \"/visitor_page\";\n\n return false\n}", "title": "" }, { "docid": "43c67de9222b5883eb8d21f85f70db24", "score": "0.63341933", "text": "function whichPage(){\n if ((document.URL).includes(\"you-can-do-it\")) {\n return \"work\"\n }\n else {\n return \"relax\"\n }\n}", "title": "" }, { "docid": "cc2a2ec72fcb7fa9d53ce71bfae7be64", "score": "0.6312278", "text": "function sys_jump_page(url){\r\n if(url){\r\n \twindow.location = url;\r\n }\r\n}", "title": "" }, { "docid": "cd95d24da9ec21a09bf8d051c4ead9bd", "score": "0.6306668", "text": "function gotoUrl(){\n if(location.hash !== ''){\n var pageName = location.hash.split('#')[1];\n var contentData = location.href.split('#')[0] + '/projects/' + pageName + '.html';\n\n if( pageName === 'work' || pageName === 'about'){\n var contentData = location.href.split('#')[0] + '/' + pageName + '.html';\n }\n showPage(contentData, pageName);\n }\n }", "title": "" }, { "docid": "a336b15bc472b83cde97e0023461b788", "score": "0.63032496", "text": "function detectUrlChange() {\n currentUrl = window.location.href\n if (currentUrl !== savedUrl){\n fLog('> Url changed to '+currentUrl, 3);\n if (currentUrl.indexOf('youtube.com/watch?') !== -1) {\n activateScript();\n }\n savedUrl = currentUrl;\n }\n}", "title": "" }, { "docid": "2eae88cb54d4cf5ba0304d59962e72b3", "score": "0.62838894", "text": "function gotoUrl(url) {\r\n\twindow.location = url;\r\n}", "title": "" }, { "docid": "2f8ed70ca198c617e458c744a4ec8ba9", "score": "0.6184985", "text": "function goTo(url) {\n window.location.href = url;\n}", "title": "" }, { "docid": "de32576b2393f019b98906f0e3deba05", "score": "0.61500293", "text": "goToPage() {\n I.amOnPage(this.url);\n }", "title": "" }, { "docid": "b986ce7ab3d42303838bab1f58679af1", "score": "0.61274785", "text": "function goHere(url) {\r\n\twindow.location=url;\r\n}", "title": "" }, { "docid": "5b3524713abd99ce84fe00381f4fe86a", "score": "0.6080684", "text": "function MM_goToURL() { //v3.0\n var i, args=MM_goToURL.arguments; document.MM_returnValue = false;\n for (i=0; i<(args.length-1); i+=2) eval(args[i]+\".location='\"+args[i+1]+\"'\");\n}", "title": "" }, { "docid": "a759679604bfeed10a0b692f8b606fcf", "score": "0.60680616", "text": "function goTo(url) {\n if (url.indexOf(\".html\") == -1) {\n window.location.href = url + \".html\";\n }\n else {\n window.location.href = url;\n }\n}", "title": "" }, { "docid": "fac4a810518752fbfe1e1f8d18c1ba72", "score": "0.6056887", "text": "function goToURL(url){\n\twindow.location.href = url;\n}", "title": "" }, { "docid": "6aeccbb3b469b05306b65809d4dc6a9c", "score": "0.6049196", "text": "function iGoTo(goTo){\n Cala.say(\"Going to: \" + goTo);\n window.location.href = goTo;\n}", "title": "" }, { "docid": "788842a76e2f4ffff8c3c3d9e5d7f692", "score": "0.6040291", "text": "function goPage(go_page)\n{\n\ttop.location.href = go_page;\n return;\n} //end function: goPage();", "title": "" }, { "docid": "4318d24b03afff745f034e89ebd62d04", "score": "0.5999355", "text": "function gotourl(url) {\n\twindow.location = url;\n}", "title": "" }, { "docid": "af7d1c8b3791b7c1dbad3f06d521b978", "score": "0.59751743", "text": "function gotosite(site) {\r if (site != \"\") {\r window.location=site;\r }\r}", "title": "" }, { "docid": "59b5985f2fbc7147964859f1ffd527f7", "score": "0.5940114", "text": "function Go_To_Next_Loterie()\r\n{\r\n\tvar host\t\t= Get_Host();\r\n\r\n\tvar current_loterie_found = false;\r\n\tvar next_loterie_url = '';\r\n\tfor (c_host in loteries)\r\n\t{\r\n\t\tif (current_loterie_found == true)\r\n\t\t{\r\n\t\t\tnext_loterie_url = loteries[c_host]['url'];\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tif (c_host == host)\r\n\t\t{\r\n\t\t\tcurrent_loterie_found = true;\r\n\t\t}\r\n\t}\r\n\tif (next_loterie_url != '')\r\n\t{\r\n\t\twindow.location.href = next_loterie_url;\r\n\t}\r\n}", "title": "" }, { "docid": "8a0a36b426aac310f1f28e21bf891157", "score": "0.59187555", "text": "function goto(to){\n window.location = to;\n}", "title": "" }, { "docid": "708952c4c88517ddcd2dc76201e299d5", "score": "0.59117967", "text": "function jump_site(){\n sitevar= document.searchForm.dropdown.selectedIndex;\n if(sitevar != 0){\n location.href = document.searchForm.dropdown.options[sitevar].value;\n }\n}", "title": "" }, { "docid": "e9b2d04cba88978d34b87229a814d9e1", "score": "0.5895727", "text": "function isThisPageDorf1() { return (isPageDorf1(document.location.href)); }", "title": "" }, { "docid": "37ad7dfd822c92bbe53e5909cf50b219", "score": "0.5894809", "text": "function goToDecks() {\n document.location = \"homepage.html\";\n}", "title": "" }, { "docid": "2d235607b8d536a5159c4f70c40f8e53", "score": "0.5894442", "text": "goTo() {\n browser.get(this.url, this.timeout);\n }", "title": "" }, { "docid": "89f10814a1590369e76d4ebe14c2707e", "score": "0.5870659", "text": "function navigateTo(url) {\n window.location = url;\n }", "title": "" }, { "docid": "229c98ea3f13a97ecd25427f7d5d1edd", "score": "0.5863665", "text": "function VisitPage(url) {\n window.location = url;\n}", "title": "" }, { "docid": "60c34067dbf9b6a18f2e0a750835eac8", "score": "0.5857147", "text": "function goToUrl(newPage) {\n window.location = newPage;\n}", "title": "" }, { "docid": "5f4daa5ac5990331564f1a6cbeb3a94f", "score": "0.58434886", "text": "function gotosite(site) {\n if (site != \"\") {\n window.location=site;\n }\n}", "title": "" }, { "docid": "ddcf002c1544c9ad6cb5d54eb55d1b32", "score": "0.5817462", "text": "async goToContact(url) {\n const {page} = this;\n await page.goto(url, {\n timeout: 0\n });\n }", "title": "" }, { "docid": "90cccd716d70ed9b9e62ed319c1a0f43", "score": "0.58030313", "text": "function goTo() {\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\twindow.location.href=\"other.html\";\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}", "title": "" }, { "docid": "f623681e0e807fe74f45e2260f22483a", "score": "0.5788514", "text": "function gotoseeker()\n{\n window.location.href=\"seeker.html\"\n}", "title": "" }, { "docid": "6b2369c1f3c30fc8352a27bdee056782", "score": "0.5775409", "text": "function gotoNextPage(){\n setCurrentPageUrl(nextPageUrl)\n }", "title": "" }, { "docid": "35234c52883148fc4cab56815981d8df", "score": "0.576355", "text": "function goHomeButtonClicked() {\n var page = document.getElementById(\"page\");\n page.stop();\n navigateTo(\"https://www.google.com/\")\n}", "title": "" }, { "docid": "d5ca3e10b7f629d3920005d82fe937ff", "score": "0.5763419", "text": "function updateDCK() {\n\tvar pattern = /^(http|https):\\/\\/duckduckgo\\.com\\/[^\\s]*(\\?|\\&)q=.{1,}$/;\n\tisDCK = pattern.test(currentURL);\n}", "title": "" }, { "docid": "5537d566b5eb59e98c0f5873291f06f2", "score": "0.5751249", "text": "function onPopAndStart(){\n\n var l = location.href;\n var pageName = l.substring(l.lastIndexOf(\"/\")+1);\n pageName = pageName || \"home\";\n\n showPage(pageName);\n }", "title": "" }, { "docid": "20578ed82912c7e81007e5371e3ba779", "score": "0.57439005", "text": "function gotoBrowserWindow(url)\r\n\t{\r\n\t\tair.navigateToURL( new air.URLRequest( url ), \"_blank\" );\r\n\r\n\t\t$('sp_wpOr').innerHTML = lang['TELL_ME'];\r\n\t\t$('sp_wpOr').className='created';\r\n\t}", "title": "" }, { "docid": "1bfa585f2d0546c5128bbf89c5b613ec", "score": "0.57383114", "text": "function getGoNext() {\n var href = window.location.href,\n goNext;\n return href.replace(window.location.protocol + \"//\" + window.location.host + \"/cgi-bin/setup.cgi?gonext=\", \"\");\n}", "title": "" }, { "docid": "64c381624322e7ec840d145c36b8b1e9", "score": "0.5735852", "text": "function go_quicklink2(){\r\n var resultPage=document.sitebar2.siteChoice2;\r\n for (var i = 0; i < document.sitebar2.siteChoice2.length; i++)\r\n {\r\n if (resultPage.options[i].selected == true)\r\n if (resultPage.options[i].value != \"\")\r\n parent.location.href=resultPage.options[i].value;\r\n }\r\n }", "title": "" }, { "docid": "88d7f8318f68ea006e50bc3c1c1c227f", "score": "0.5728029", "text": "function loadPageNoExplore() {\n window.location.href='/thesis/'\n }", "title": "" }, { "docid": "253277eb4ec9375a45d0130406ba3f66", "score": "0.57274765", "text": "function go_quicklink(){\r\n var resultPage=document.sitebar1.siteChoice1;\r\n for (var i = 0; i < document.sitebar1.siteChoice1.length; i++)\r\n {\r\n if (resultPage.options[i].selected == true)\r\n if (resultPage.options[i].value != \"\")\r\n parent.location.href=resultPage.options[i].value;\r\n }\r\n }", "title": "" }, { "docid": "b33a5dd070ea30e191f155d847670cad", "score": "0.57145673", "text": "function go_to_entrance() {\n /* Visit the entrance page. Depending on session state, it might\n present a login challenge or it might present the top-level\n contents associated with the logged-in account. */\n // Use a string url so our transit machinery registers a visit.\n $.mobile.changePage(my.combo_root_url); }", "title": "" }, { "docid": "a9564bc7c65d4ca96e5811403873ccb0", "score": "0.5711344", "text": "function isThisPageVillage() { return isPageVillage(document.location.href); }", "title": "" }, { "docid": "333bb631c8f88a3db9dd65dfdcd7f9ad", "score": "0.5710735", "text": "function Goto(valeur){\n var debuturl = window.location.origin;\n switch(valeur){\n case 1:window.location=debuturl+\"/Professionnel.html\";break;\n case 2:window.location=debuturl+\"/Piano.html\";break;\n case 3:window.location=debuturl+\"/News.html\";break;\n default: windows.location=debuturl;\n }\n}", "title": "" }, { "docid": "a89a82047cb3e0adc82d011e23c6d5b1", "score": "0.57092404", "text": "function PageTurn (URL) {\n if (typeof URL !== 'string') { return 0; }\n\n if (URL.length > 0) { window.location = URL; }\n else { window.location.reload(true); }\n}", "title": "" }, { "docid": "0bdc65c55ba445173f0cc915bed54505", "score": "0.56878334", "text": "checkLinkType() {\n // TODO: Make sure the website is not part of the stackexchange network and not limit ourselves to stackoverflow\n if (this.CURRENT_TAB != 'stackoverflow.com' && this.redirectLink.includes('/questions/')) {\n return 'question';\n } else {\n return 'unknown';\n }\n }", "title": "" }, { "docid": "8c499cb0ac234efcdbfbbe53d66a7229", "score": "0.568136", "text": "function checkLink() {\n let buttons = $(\":button[go]\");\n for (const btn of buttons) {\n let go = $(btn).attr(\"go\");\n let index = window.location.href.indexOf(go);\n if (index >= 0) {\n let link = window.location.href.slice(index);\n link = link.split(\"/\").join(\"\");\n go = go.split(\"/\").join(\"\");\n if (link === go) {\n btnActivate($(btn).attr(\"id\"));\n break;\n }\n }\n }\n}", "title": "" }, { "docid": "02c67fad8d7ade331d563ebbf3851c3c", "score": "0.5680292", "text": "function go_quicklink1(){\r\n var resultPage=document.sitebar1.siteChoice1;\r\n for (var i = 0; i < document.sitebar1.siteChoice1.length; i++)\r\n {\r\n if (resultPage.options[i].selected == true)\r\n if (resultPage.options[i].value != \"\")\r\n parent.location.href=resultPage.options[i].value;\r\n }\r\n }", "title": "" }, { "docid": "1f1ec0ced37684251b44db303215b79f", "score": "0.5675057", "text": "function gotoP(page) {\n location.href = page;\n}", "title": "" }, { "docid": "9a98dffdccf4b98d8afb01ac7843aa0d", "score": "0.5672991", "text": "function jumpTo(page){\n\tdocument.location.href =page;\n}", "title": "" }, { "docid": "79743503c9a48e929f1b7be219b8e8c8", "score": "0.5670163", "text": "function navigate(url) {\n window.location.assign(url);\n chrome.tabs.query({\n active: true,\n currentWindow: true\n }, function(tabs) {\n chrome.tabs.update(tabs[0].id, {\n url: url\n });\n });\n}", "title": "" }, { "docid": "de0887be9a2a9a350ac63280c2ce3733", "score": "0.56680423", "text": "function tieptucmuahang(base_url)\n{\n\twindow.location = base_url;\n}", "title": "" }, { "docid": "6eac20b90662c0b074f9dcfd800f6923", "score": "0.56596977", "text": "function isThisPageDorf3() { return (isPageDorf3(document.location.href)); }", "title": "" }, { "docid": "764fd89270c771ddde1fb735b4cba467", "score": "0.5656237", "text": "function changePage(url){\n location.replace(url);\n}", "title": "" }, { "docid": "5bc88d97b007a60cb8dee335f807e536", "score": "0.5639255", "text": "function changePage(url) {\n location.replace(url);\n}", "title": "" }, { "docid": "08c4fe789eb1156dbcf5036b9523faab", "score": "0.56363654", "text": "function start_url() {\t\n\tquery_id = \"\";\n\tfilterLabel = \"\";\n\ttimeout = 3;\t\n\t\n\tdasty_mainpage_name = findDastyHtmlPageName('page_name') + \".\" + findDastyHtmlPageName('ext_name');\n\tconfiguration();\n\tdefault_query_parameters();\n\t\n\tsetDastyURLParam();\n}", "title": "" }, { "docid": "dff571e07085f2342e1147213e2da8e6", "score": "0.5624279", "text": "function discover() {\n //redirecting to profile page\n window.location = \"discover.html\";\n\n //Return true to jump out of the function, since we now have all we need\n return true;\n}", "title": "" }, { "docid": "fa450e713e6478fefdddac04b7105e1f", "score": "0.5607525", "text": "function linkCurrentPage() {\r\n chrome.tabs.query({\r\n active: true,\r\n currentWindow: true\r\n }, function(tabs) {\r\n chrome.tabs.sendMessage(tabs[0].id, {\r\n action: 'link'\r\n }, function(response) {\r\n if (response) {\r\n // Looked for links successfully\r\n updateStatus(response.linkCount);\r\n } else {\r\n // Didn't get a response, might be on chrome page or page loading\r\n // Show no links found\r\n updateStatus(0);\r\n }\r\n });\r\n });\r\n }", "title": "" }, { "docid": "f61c2f47077983f28433cc728e481fcd", "score": "0.5606776", "text": "async function navigateTo(url, page) {\n let navigated = false;\n try {\n await page.goto(url, {\n waitUntil: \"networkidle0\",\n timeout: configuration.timeoutms,\n });\n logger.logToConsole(\n {\n message: \"Navigated to URL : > \",\n info: url,\n },\n \"log\"\n );\n navigated = true;\n } catch (e) {\n logger.logToConsole(\n {\n message: \"Error: Wasn't able to Navigate to URL\",\n error: e,\n },\n \"error\"\n );\n }\n return navigated;\n}", "title": "" }, { "docid": "283e7fa9e57405e6c252e9e436c8a572", "score": "0.55848897", "text": "function loginGoogle() {\n window.location.href = '/auth/google';\n}", "title": "" }, { "docid": "484705ce0cade09dd4cf051cb15d510b", "score": "0.5583128", "text": "function redirect(){\r\n window.location.assign('https://www.bloggingprince.com');\r\n }", "title": "" }, { "docid": "2715f946d98625e060cd5fbe08d5c642", "score": "0.557622", "text": "function doNotKnowTheProblem(){\n window.location = getNextUrlToDrill();\n}", "title": "" }, { "docid": "40591ff17f662ab440e0d7c878d14691", "score": "0.55753934", "text": "function go(url, newWindow = false) {\r\n newWindow ? window.open(url) : window.location.href = url;\r\n}", "title": "" }, { "docid": "3d4390c8d1e5b337ff873fe89ffb41a7", "score": "0.55729705", "text": "function gotoURL(a){\n\tchrome.tabs.create({'url': a});\n\tself.close();\n\t_gaq.push(['_trackEvent', 'gotoZippyshare', 'clicked']);\n}", "title": "" }, { "docid": "571bf486244a42aa6f3e040a595ddb55", "score": "0.55718064", "text": "function jump_page(e) {\n var t = $(\"#\" + e).val();\n var n = $(\".url_jump\").val();\n window.location.href = n + t;\n}", "title": "" }, { "docid": "0863af97adf352d48a4af67d24b51264", "score": "0.5559143", "text": "function checkForValidUrl(tabId, changeInfo, tab) {\n\t\t\t// Check if page is a presentation.\n\t\t\tif (tab.url.indexOf('docs.google.com/presentation') > -1) {\n\t\t\t\t// ... show the page action.\n\t\t\t\tchrome.pageAction.show(tabId);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "2944ef92abea86f348c7ab3f5dfc6086", "score": "0.55566496", "text": "checkUrl( /*e*/ ) {\n var current = this.getFragment();\n // If the user pressed the back button, the iframe's hash will have\n // changed and we should use that for comparison.\n if (current === this.fragment && this.iframe) {\n current = this.getHash(this.iframe.contentWindow);\n }\n if (current === this.fragment) {\n return false;\n }\n if (this.iframe) {\n this.navigate(current);\n }\n this.loadUrl();\n }", "title": "" }, { "docid": "5ad52c997e66b410aad11f95aaaf8101", "score": "0.5556273", "text": "function go_newfeeds( check1) {\r\n\r\n\tvar currentLocation = window.location;\r\n\r\n\tif ( currentLocation.pathname === \"/xti.php\" ) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif ( currentLocation.pathname === \"/home.php\" ) {\r\n\t\treturn true;\r\n\t} else {\r\n\t\ttmp_page = 0;\r\n\t}\r\n\r\n\tif (tmp_page !== 0 && check1 === 0) { \r\n\r\n\t\treturn true; \r\n\t}\r\n\tif (tmp_page === 0) {\r\n\t\ttmp_page = 1;\r\n\t}\r\n\r\n\tvar inputs2 = document.querySelector('div#feed_jewel a'); \r\n\tif ( inputs2 !== null) {\r\n\t\tinputs2.click();\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "6d58163556a212a9f1822b1e0ea976b0", "score": "0.5554297", "text": "function go2page(link) {\n $('.slide').hide();\n $('#' + link).show();\n $('.control').add($('#navbar_items a')).removeClass('hilite');\n $('#' + link + '_control').add($('#navbar_items a[href~=\"#' + link + '\"]')).addClass('hilite');\n \n //Inhaltsverzeichnis der Seite\n fixPageindex();\n\n // toggle position thesaurus pageindex, s.u.\n \n // track a page view\n _paq.push(['setCustomUrl', URI().href()]);\n _paq.push(['trackPageView']);\n }", "title": "" }, { "docid": "2ac52a7c7d7194ff97e9f9f0f99a97a3", "score": "0.55539715", "text": "function isThisPageKarte2MapPage() { return (isPageKarte2MapPage(document.location.href)); }", "title": "" }, { "docid": "e7bd14f04b61f3920325c59a2d7e208d", "score": "0.554125", "text": "function checkForValidUrl(tabId, changeInfo, tab) {\n if (tab.url.indexOf('.notonthehighstreet.com') > -1 || tab.url.indexOf('.noths.com') > -1) {\n chrome.pageAction.show(tabId);\n }\n}", "title": "" }, { "docid": "77fbbce89bf3acd4e6fe50b5042d4ce0", "score": "0.55335146", "text": "function goto(page) {\n\tif(page === 'index') {\n\t\t// When goto command is issued for 'index', we goto to root\n\t\tpage = ''; \n\t}\n\tvar gotoURL = 'http://' + window.location.hostname + ':' + location.port + '/' + page;\n\tconsole.log('Redirecting to ' + gotoURL);\n\twindow.location.href = gotoURL;\n}", "title": "" }, { "docid": "8348d3bfc7fdb5b1d6f6223a1deead6d", "score": "0.55307555", "text": "function showPage(url) {\n try {\n window.top.$j(\"#gsft_main\").attr('src', url);\n return false;\n } catch (ex) {\n jslog(errorLogPrefix + \" showPage: \" + ex.message);\n }\n}", "title": "" }, { "docid": "71de1ed63b0825dd7dbeba687606ccec", "score": "0.551412", "text": "function checkURL() {\nvar currentLocation = window.location.href;\n\tif (currentLocation == \"https://kzlv.me/\") {\n\t\tdocument.getElementById('kai').innerHTML += \"<font face=\\\"verdana\\\"><font color=\\\"#FF69B4\\\">[kai]</font> official site</font>\";\n}\t\nelse {\n\t\tdocument.getElementById('kai').innerHTML += \"<font face=\\\"verdana\\\"><font color=\\\"#FF69B4\\\">[kai]</font> unverified site current site \" + window.location.href + \" differs from official site kzlv.me</font>\";\n\t}\n}", "title": "" }, { "docid": "86e8d56bd785f6bff5cb5a5034302bb5", "score": "0.55121624", "text": "function go_page(link){ \r\n\tif (link=='#') {return false;}\r\n\t\r\n\t$.ajax({\r\n method: \"GET\",\r\n dataType: \"html\",\r\n url: link,\r\n beforeSend: function() {\r\n $(\".content-wrapper\").css(\"background-color\", 'white');\r\n $(\".load\").css(\"display\", 'block');\r\n $(\".content-wrapper2\").css(\"display\", 'none');\r\n\r\n },\r\n complete: function() {\r\n $(\".content-wrapper\").css(\"background-color\", '#ecf0f5');\r\n $(\".load\").css(\"display\", 'none');\r\n $(\".content-wrapper2\").css(\"display\", 'block');\r\n },\r\n success: function(res){\r\n $('.content-wrapper2').html(res);\r\n $('.ui-pnotify-closer').click();\r\n }\r\n });\r\n return false;\r\n}", "title": "" }, { "docid": "40cd0f96792df66d4df265d45427baf5", "score": "0.5511795", "text": "function getCurrentPage(url){\n if(url.includes(\"play.google\")){\n return{\n name:\"Google-Play-Music-Config\",\n color:\"#FF5722\",\n color2:\"#ffffff\",\n fftUni:16384,\n bottom:90,\n }\n }\n else if(url.includes(\"music.youtube\")){\n return{\n name:\"YouTube-Music-Config\",\n color:\"#FFFFFF\",\n fftUni:16384,\n bottom:83,\n }\n }\n else if(url.includes(\"youtube\")){\n return{\n name:\"YouTube-Config\",\n color:\"#FF0000\",\n fftUni:8192,\n bottom:0,\n }\n }\n else{\n return{\n name:\"Default-Config\",\n color:\"#aaaaaa\",\n fftUni:16384,\n bottom:0,\n }\n }\n}", "title": "" }, { "docid": "e999fd18672b227572761cb612148631", "score": "0.55039865", "text": "function wrapMe(){ //this gets called by each content page to check if it is wrapped or not.\r\n\t\t\tif (self.location.href == top.location.href){\r\n\t\t\t top.location.href = 'index.htm?zurl=' + self.location.href;\t\t\t \r\n\t\t\t}\r\n }", "title": "" }, { "docid": "efacaa21a697a1621388a07d3ea44cba", "score": "0.54999936", "text": "function letsJQuery() {\r\n\t\tif($('a[href=\"#toggle_video\"]').text().indexOf(\"High Def\") != -1)\r\n\t\t {\r\n\t\t\t\r\n\t\t\tvar url = window.location.toString();\r\n\t\t\tvar query_char='?';\r\n\t\t\t\r\n\t\t\tif( url.indexOf('hd=1')!=-1)\r\n\t\t\t{\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif( url.indexOf('?')!=-1)\r\n\t\t\t{\r\n\t\t\t\tquery_char='&';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif( url.indexOf('#')!=-1 )\r\n\t\t\t{\r\n\t\t\t\ttmp=url.split('#');\r\n\t\t\t\turl=tmp[0];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twindow.location.replace(url + query_char + 'hd=1');\r\n\t\t }\r\n }", "title": "" }, { "docid": "fed04d87403855176616de7254279532", "score": "0.5492463", "text": "function onBeforeNavigate(details) {\n // check to see if redirect is enabled before redirecting\n chrome.storage.sync.get({[KEY_ENABLED]: true}, function(items) {\n if(items.enabled) {\n // redirect the tab\n let tabId = details.tabId;\n let url = details.url;\n setTabUrl(tabId, getRedirectedUrl(url));\n }\n });\n}", "title": "" }, { "docid": "ce17225fdabb3a57b60d28b2b212d357", "score": "0.54922706", "text": "function goToLoftPage(page) {\n\tvar obj = {currentPage: page};\n\thistory.pushState(obj, \"\", window.location.href);\n\tSession.set(\"currentPage\", page); \n}", "title": "" }, { "docid": "bcff056374609f9e13347c0d252f394a", "score": "0.54901934", "text": "function redirigirA(url) {\n win.location.href = urlBase + url;\n }", "title": "" }, { "docid": "967ce126d2b6126a872df39bfb08869f", "score": "0.54894596", "text": "goToPage(page) {}", "title": "" }, { "docid": "015f1e67a9e0eaa6a49d8c59871cc756", "score": "0.54804206", "text": "assertNavigation(result) {\n return this.doesItcontain(result, \"google.com\");\n }", "title": "" }, { "docid": "23e8a098175fdf228116c203760d31cc", "score": "0.5476007", "text": "function isThisPageIGM() { return (isPageIGM(document.location.href)); }", "title": "" }, { "docid": "1c9ae8c2276000878c104e21cd3706e2", "score": "0.5475034", "text": "function have_try(){\n\t\twindow.location.href = \"home.php\";\n\t}", "title": "" }, { "docid": "b4737010ce9c112f1f0b06a4c9f063d5", "score": "0.54735684", "text": "function gotoBlog()\r\n\t{\t\r\n\t\tisInBlog=true;\r\n\t\tBee.Application.acceptDrag = true;\r\n\t\tselectPage('blogPage');\r\n\t\tsetBlogState('view', true);\r\n\t}", "title": "" }, { "docid": "28067db3fbaaa2b423a82dac8943e4a9", "score": "0.5469273", "text": "function ni_LoadUrl(url, title, trigger)\n{ \n ni_TrackHit(NI_SE, NI_SC, \"\", NI_ST, NI_SV, trigger, \"\", \"\", title, url, NI_IW, \"\", \"\", \"\");\n document.location.href = url;\n}", "title": "" }, { "docid": "6701595f50067a632f151cecef1bf112", "score": "0.54655796", "text": "function checkForUrl(tabId, changeInfo, tab) {\n if (tab.url.indexOf(HH_URL) == 0) {\n if (!added) {\n\t chrome.pageAction.onClicked.addListener(function(tab) {\n\t chrome.tabs.executeScript(tab.id, { 'code': 'start();' });\n\t });\n\t}\n\tadded = true;\n chrome.pageAction.show(tabId);\n }\n}", "title": "" }, { "docid": "d3b01c6818bd48423673d4fdf8451f8f", "score": "0.54607856", "text": "function linkToGoogleSite() {\n linkToGoogleSiteWithTitle(\"Google Sites Publishing Page\");\n}", "title": "" }, { "docid": "cd7395d01cf192834556a86811ca31ac", "score": "0.5457359", "text": "function seccheck(sa){\n\t\tif ( sa == 'y' ){\n\t\t\twindow.location.replace(\"other.html\")\n\t\t} else {\n\t\t\twindow.location.replace(\"b2b.html\")\n\t\t}\n }", "title": "" }, { "docid": "9503a4f4afaa07399d36f12ad39b1bb0", "score": "0.5457001", "text": "function changePage() {\r\n var link = location.hash.replace(\"#\", \"\"); //delete # simvol from string\r\n if (link == ''){ //if hash empty then redirect to main page(first visit for example)\r\n link = \"mainPage\";\r\n } \r\n //rewrite main content content!\r\n $.get('pages/'+ link + '.php', function(data) {\r\n $('#main-content').html(data);\r\n lazy_img_load();\r\n $(window).scrollTop(0);\r\n $('#menu-list>li').removeClass('active');\r\n if (link.includes(\"orderbasket\")){\r\n link = \"orderbasket\";\r\n } \r\n if (link.includes(\"cms\") || link.includes(\"registration\") ){\r\n link = \"\";\r\n } else {\r\n $('.'+link).addClass('active');\r\n }\r\n })\r\n//If page not exist (if error)\r\n .fail(function() {\r\n $.get('pages/404.php', function(data) { \r\n $('#main-content').html(data);\r\n $(window).scrollTop(0);\r\n })\r\n })\r\n}", "title": "" }, { "docid": "855dc947e93127a9a1436441abaf24e8", "score": "0.5454894", "text": "function check() {\n if (window.location.href.includes(\"/server/\")) {\n checkInject(function(shouldInject) {\n if (shouldInject) {\n go();\n }\n });\n }\n}", "title": "" }, { "docid": "ee8a724540ba58765866dc7b02ceafad", "score": "0.54546297", "text": "function goToFrontpage(){\n window.location.replace(\"https://bigchungus420.github.io/EduGames/src/index.html\");\n}", "title": "" }, { "docid": "abd22ed663ad46275c8be8e0c6fc0776", "score": "0.54520464", "text": "function tooYoung() {\n window.location.replace('https://disneyland.disney.go.com/');\n}", "title": "" }, { "docid": "4f1d43cc0f336cf64c42d186b7eeca07", "score": "0.54501975", "text": "function navigate(num) {\n console.log(\"Navigating to \" + num);\n if (typeof num !== \"undefined\" && num != \"home\") {\n window.location.href = \"https://ithelp.uoregon.edu/Ticket/Display.html?id=\" + num;\n } else {\n window.location.href = \"https://ithelp.uoregon.edu\";\n }\n}", "title": "" }, { "docid": "734a0ad93f6412a34ea84e5fdfec9627", "score": "0.54458654", "text": "function openPageCheckUrl(input) {\n if (input == \"y\" || input == \"yes\") {\n resetInputStream();\n openPage(tempUrl, true, true);\n } else if (input == \"n\" || input == \"no\") {\n resetInputStream();\n output(\"Action aborted.\");\n } else if (input == \"a\") {\n resetInputStream();\n openPage(\"http://\" + tempUrl);\n }\n}", "title": "" }, { "docid": "6dcac1efb2b337b91393299b6e18b293", "score": "0.5434316", "text": "function redirectToHome() {\n switch (currentPageType) {\n case \"default\":\n window.open(\"index.html\", \"_self\");\n break;\n case \"user\":\n window.open(\"homepage.html\", \"_self\");\n break;\n case \"admin\":\n window.open(\"admin-profile.html\", \"_self\");\n break;\n }\n}", "title": "" }, { "docid": "4b1849d447fc01135ead453a456515bb", "score": "0.5433607", "text": "function goToExplore() {\r\n console.log(\"Redirecting to explore page\");\r\n location.href = \"explorepage.html\";\r\n}", "title": "" }, { "docid": "d22795739c54042eed5f8e524abc9fc1", "score": "0.5433561", "text": "function redirectToGoogleAuthentication() {\n window.location = '/auth/google';\n}", "title": "" }, { "docid": "2dd3709d4aa600d72503eed95357d949", "score": "0.54318386", "text": "function askDestinationPage(response) {\n response.end(ASK_URL_TO_GET_PAGE);\n}", "title": "" }, { "docid": "b81618da1b708b4cf4289c269cace8f5", "score": "0.5428747", "text": "function gotos(gotourl){\n\tvar URL4 = document.gotourl.gotosec.options[document.gotourl.gotosec.selectedIndex].value;\n\tif (URL4 != '') {\n\t\twindow.open(URL4);\n\t}\n}", "title": "" }, { "docid": "b81112d1e0c382cc7d8465957605c32b", "score": "0.5418758", "text": "function is_page(name){\n return is_link(name,document.location.href);\n}", "title": "" }, { "docid": "66e853eb93efdc349ad02358f0ccb811", "score": "0.54173046", "text": "function landing(){\n\tif(window.location.hash == \"#about\"){\n\t\tabout_open();\n\t}else if(window.location.hash == \"#projects\"){\n\t\tproject_open();\n\t}else if(window.location.hash == \"#contact\"){\n\t\tcontact_open();\n\t}\n}", "title": "" } ]
e89915e8aa22d99f21ff514852199218
helper function to create a unit with a fixed prefix
[ { "docid": "b35043967721cca4fedcbd7ac4c0732f", "score": "0.71195364", "text": "function fixedUnit(str) {\n var unit = type.Unit.parse(str);\n unit.fixPrefix = true;\n return unit;\n }", "title": "" } ]
[ { "docid": "b6f119e67f2be1106ee3c2f436f3bcfb", "score": "0.71431434", "text": "function fixedUnit(str) {\n var unit = type.Unit.parse(str);\n unit.fixPrefix = true;\n return unit;\n } // Source: https://en.wikipedia.org/wiki/Physical_constant", "title": "" }, { "docid": "4fc677d72cd84bb35704a5474845716e", "score": "0.69279677", "text": "function fixedUnit(str) {\n\t\t\tvar unit = type.Unit.parse(str);\n\t\t\tunit.fixPrefix = true;\n\t\t\treturn unit;\n\t\t}", "title": "" }, { "docid": "c508458a8828d56f4410696247e03953", "score": "0.6602577", "text": "function unitFactory(name, valueStr, unitStr) {\n var dependencies = ['config', 'Unit', 'BigNumber'];\n return factory_factory(name, dependencies, (_ref) => {\n var {\n config,\n Unit,\n BigNumber\n } = _ref;\n // Note that we can parse into number or BigNumber.\n // We do not parse into Fractions as that doesn't make sense: we would lose precision of the values\n // Therefore we dont use Unit.parse()\n var value = config.number === 'BigNumber' ? new BigNumber(valueStr) : parseFloat(valueStr);\n var unit = new Unit(value, unitStr);\n unit.fixPrefix = true;\n return unit;\n });\n} // helper function to create a factory function which creates a numeric constant,", "title": "" }, { "docid": "b196519b323ecf4c591309afa50fc039", "score": "0.6602374", "text": "function withUnit (unit, count) {\n return `${count} ${pluralize(unit, count)}`;\n}", "title": "" }, { "docid": "868b72faa442b7ca8825ed7814908a62", "score": "0.6439161", "text": "prefixed(prefix) {\n return this.name.replace(/^(\\W*)/, `$1${prefix}`)\n }", "title": "" }, { "docid": "5b290519612c98c6eb68a742339604ec", "score": "0.6417857", "text": "prefixed(prefix) {\n let spec, value\n ;[spec, prefix] = flexSpec(prefix);\n\n if (spec === 2009) {\n if (this.name === 'flex') {\n value = 'box';\n } else {\n value = 'inline-box';\n }\n } else if (spec === 2012) {\n if (this.name === 'flex') {\n value = 'flexbox';\n } else {\n value = 'inline-flexbox';\n }\n } else if (spec === 'final') {\n value = this.name;\n }\n\n return prefix + value\n }", "title": "" }, { "docid": "9261813d51d94167785a4b135e03a306", "score": "0.6409786", "text": "function unitFactory(name, valueStr, unitStr) {\n var dependencies = ['config', 'Unit', 'BigNumber'];\n return Object(_utils_factory__WEBPACK_IMPORTED_MODULE_0__[\"factory\"])(name, dependencies, function (_ref) {\n var config = _ref.config,\n Unit = _ref.Unit,\n BigNumber = _ref.BigNumber;\n // Note that we can parse into number or BigNumber.\n // We do not parse into Fractions as that doesn't make sense: we would lose precision of the values\n // Therefore we dont use Unit.parse()\n var value = config.number === 'BigNumber' ? new BigNumber(valueStr) : parseFloat(valueStr);\n var unit = new Unit(value, unitStr);\n unit.fixPrefix = true;\n return unit;\n });\n} // helper function to create a factory function which creates a numeric constant,", "title": "" }, { "docid": "a5693c0e3ba7e7ed13b88adbb0a206af", "score": "0.6293313", "text": "prefixed(prop, prefix) {\n return prefix + prop\n }", "title": "" }, { "docid": "202f8e5670cf02648750572cdb6b8057", "score": "0.6210306", "text": "function fixUnitAbbreviations(unit) {\n if (unit) {\n return unit.replace('uL', 'microL')\n .replace('µ', 'micro')\n .replace('DegC', 'Deg C');\n }\n return undefined;\n}", "title": "" }, { "docid": "b7ce91e35b098414abffb87f1562497f", "score": "0.6141734", "text": "function genID(prefix) {\n return prefix + '$' + (num++);\n}", "title": "" }, { "docid": "6c96d50fa014d98a3a18ec8e4c984f36", "score": "0.61061794", "text": "function setPrefix( name, prefix){\n return (''+ prefix=== prefix)?( prefix? prefix+ name.charAt().toUpperCase()+ name.substr( 1): name) : undefined /* aka prefix */ ;\n}", "title": "" }, { "docid": "0dda8e4b7b36e627789552e136c9d12d", "score": "0.6055573", "text": "function setUpCustomUnits() {\n for (var i = 0 ; i < Converter.customUnits.length ; i++) {\n math.createUnit(\n Converter.customUnits[i].name,\n Converter.customUnits[i].factor\n )\n };\n}", "title": "" }, { "docid": "59660afce6d2ff2cb482c29a6697b7db", "score": "0.60193264", "text": "function getUnitSymbol(prefixAndUnit) {\n let PrefixSymbol = getPrefixSymbol(prefixAndUnit);\n if (prefixAndUnit) {\n return prefixAndUnit.replace(PrefixSymbol, '');\n }\n return null;\n}", "title": "" }, { "docid": "d2150102ce296a7b5fff3aafbd28a321", "score": "0.60087466", "text": "static formatUnit(unit) {\n return unit === 1 ? 'Lbs' : 'Kg';\n }", "title": "" }, { "docid": "5ed2bbf4a496ed20de1591be13f66b98", "score": "0.59662217", "text": "function replaceUnit(exp) {\n switch (exp) {\n case 'minute':\n case 'min':\n case 'hour':\n case 'h':\n case 'day':\n case 'd':\n return \"s\";\n case 'degree':\n case '°':\n case \"'\":\n case 'second':\n case '\"':\n return \"rad\";\n case 'hectare':\n case 'ha':\n return \"m\" + \"2\".sup();\n case 'litre':\n case 'l':\n return \"m\" + \"3\".sup();\n case 'tonne':\n case 't':\n return \"kg\";\n default:\n return exp;\n }\n}", "title": "" }, { "docid": "2a0198eb07ab8cae7e7485e010ac29b8", "score": "0.5956518", "text": "uniqueName(prefix) { return `${prefix}${this.nextNameIndex++}`; }", "title": "" }, { "docid": "d8d72f1ab2fe9dcf9f50ce78c84d507a", "score": "0.5935587", "text": "function withPrefix(prefix) {\n if (typeValidation(prefix))\n return function (name) {\n if (typeValidation(name)) return `${prefix}${name}`;\n };\n}", "title": "" }, { "docid": "db93b5b9e0ff1d720d450f74a45fdc70", "score": "0.59129876", "text": "function unit(i, units) {\r\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\r\n return i;\r\n } else {\r\n return \"\" + i + units;\r\n }\r\n }", "title": "" }, { "docid": "db93b5b9e0ff1d720d450f74a45fdc70", "score": "0.59129876", "text": "function unit(i, units) {\r\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\r\n return i;\r\n } else {\r\n return \"\" + i + units;\r\n }\r\n }", "title": "" }, { "docid": "db93b5b9e0ff1d720d450f74a45fdc70", "score": "0.59129876", "text": "function unit(i, units) {\r\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\r\n return i;\r\n } else {\r\n return \"\" + i + units;\r\n }\r\n }", "title": "" }, { "docid": "e1d6f0a6f3709481f1ef55106c9bf910", "score": "0.59116423", "text": "function addPrefix(prefix) {\n return function(str) {\n let prefixedStr = `prefix is : ${prefix} and string is ${str}`;\n return prefixedStr;\n };\n}", "title": "" }, { "docid": "ff4c7103f6b4ced44b3eccaac0e671b0", "score": "0.5901048", "text": "constructor(prefix = '') {\n this.prefix = prefix;\n }", "title": "" }, { "docid": "4c6ede79165b1d7f45f786a30f024ab1", "score": "0.5895227", "text": "function getPrefixSymbol(prefixAndUnit) {\n // let myRegexp = /^[KkMm]+/g;\n let myRegexp = new RegExp('[' + PREFIX_REGEX_SYMBOLS.join() + ']', 'g');\n let match = myRegexp.exec(prefixAndUnit);\n if (match && match[0]) {\n return match[0];\n }\n return null;\n}", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.58795464", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.58795464", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.58795464", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.58795464", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.58795464", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.58795464", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.58795464", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.58795464", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.58795464", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.58795464", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.58795464", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "65e9b3d9b4177f922a48e63d4acfa23e", "score": "0.58723056", "text": "declarePrefix(string, string) {\n\n }", "title": "" }, { "docid": "3e09efbc43be6ac6075ce1dfe142c948", "score": "0.58709866", "text": "function getUnit(input){\nreturn String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1]||'';\n}// Emulate the sass function \"unitless\"", "title": "" }, { "docid": "9f385dc02b1f4f11480edd9817abe733", "score": "0.5867532", "text": "prefixed(prop, prefix) {\n if (prop.includes('-start')) {\n return prefix + prop.replace('-block-start', '-before')\n }\n return prefix + prop.replace('-block-end', '-after')\n }", "title": "" }, { "docid": "d531f46e8b437071b8811aaffa98224c", "score": "0.58307374", "text": "static getUnitName ( abbr ) {\n if ( typeof abbr !== \"string\" ) {\n throw new Error( \"ByteCalc.getUnitName only accepts strings: use an \"\n + \"abbreviation like 'KB', or 'KiB'\"\n );\n } else {\n let names;\n let type = this.determineFormat( abbr );\n\n if ( type === \"IEC\" ) {\n names = IEC_PREFIX;\n } else if ( type === \"METRIC\" ) {\n names = METRIC_PREFIX;\n }\n\n return names[ UNITS.indexOf( abbr[0] ) ] + \"bytes\";\n }\n }", "title": "" }, { "docid": "a193098a5e7218c9d67cdf3c448ef261", "score": "0.58252144", "text": "prefixed(prop, prefix) {\n return `${prefix}column-${prop}`\n }", "title": "" }, { "docid": "3840ad434ead69d019347d1c03ce7ec6", "score": "0.5808773", "text": "function UnitName(name){\n switch(name){\n\n ///-----------Metric-----------\n // Lenght\n case \"cm\":\n return \"Centimeter\";\n\n case \"m\":\n return \"Meter\";\n\n case \"km\":\n return \"Kilometer\";\n // Mass\n case \"g\":\n return \"Grams\";\n\n case \"mg\":\n return \"Milligram\";\n\n case \"kg\":\n return \"Kilogram\";\n\n // Volume\n case \"l\":\n return \"Liter\";\n\n case \"ml\":\n return \"Milliliter\";\n\n // Temperature\n case \"c\":\n return \"Celsius\";\n\n case \"k\":\n return \"Kelvin\";\n\n ///-----------Imperial-----------\n // Lenght\n case \"\\'\\\"\":\n case \"in\":\n return \"Inch\";\n\n case \"ft\":\n return \"Foot\";\n\n case \"ya\":\n return \"Yard\";\n \n case \"mi\":\n return \"Mile\"\n // Mass\n case \"oz\":\n return \"Ounce\";\n\n case \"lb\":\n return \"Pound\";\n\n case \"st\":\n return \"Stone\";\n\n // Volume\n case \"floz\":\n return \"Fluid Ounce\";\n\n case \"lg\":\n return \"Liquid Gallon\";\n\n // Temperature\n case \"f\":\n return \"Fahrenheit\";\n\n ///-----------Time-----------\n case \"ms\":\n return \"Millisecond\";\n\n case \"s\":\n return \"Second\";\n\n case \"mn\":\n return \"Minute\";\n\n case \"h\":\n return \"Hour\";\n\n case \"d\":\n return \"Day\";\n\n case \"w\":\n return \"Week\";\n\n case \"mo\":\n return \"Month\";\n\n case \"y\":\n return \"Year\";\n }\n}", "title": "" }, { "docid": "b052d3886633558a641c7ea85cb265dc", "score": "0.5795017", "text": "newVar (prefix) {\n prefix = prefix || this.newVarPrefix;\n return prefix + (this.maxVarSuffix (prefix) + 1);\n }", "title": "" }, { "docid": "f51b0df60d8aa88a26d5d668726c5785", "score": "0.5788379", "text": "prefixed(prop, prefix) {\n let spec\n ;[spec, prefix] = flexSpec(prefix)\n if (spec === 2009) {\n return prefix + 'box-pack'\n }\n if (spec === 2012) {\n return prefix + 'flex-pack'\n }\n return super.prefixed(prop, prefix)\n }", "title": "" }, { "docid": "a6956422b84a6630e89d04878d0ddfe2", "score": "0.57780087", "text": "function setUnit(unit, input) {\n CUSTOM_LENGTH.from(unit, input);\n return {\n toFeet: CUSTOM_LENGTH.to(FEET),\n toMeters: CUSTOM_LENGTH.to(METERS),\n toInches: CUSTOM_LENGTH.to(INCHES)\n };\n }", "title": "" }, { "docid": "7b2c40863b9539c59d1e163d1a588ac7", "score": "0.5761289", "text": "prefixed(prop, prefix) {\n let spec\n ;[spec, prefix] = flexSpec(prefix);\n if (spec === 2009) {\n return prefix + 'box-flex'\n }\n if (spec === 2012) {\n return prefix + 'flex-positive'\n }\n return super.prefixed(prop, prefix)\n }", "title": "" }, { "docid": "bbc71cf10af6e25e81b6f045b885006f", "score": "0.5759265", "text": "function ensureUnit(val) {\n return val + (Object(__WEBPACK_IMPORTED_MODULE_0_min_dash__[\"l\" /* isNumber */])(val) ? 'px' : '');\n}", "title": "" }, { "docid": "bce3ebb78c81428e0b25cfd52680a9ab", "score": "0.57541776", "text": "function prefix(prefix){\n return ($(prefix).length) ? (prefix + ' ') : '';\n}", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.5747197", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.5747197", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.5747197", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.5747197", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.5747197", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.5747197", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.5747197", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.5747197", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.5747197", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.5747197", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.5747197", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.5747197", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "2df229f86eacbcaf345194952f47635d", "score": "0.5747057", "text": "function makeName(prefix){\n var name = prefix + Math.random() * 1000;\n while(getElementById(name) != null)\n name = prefix + Math.random() * 1000;\n return name;\n}", "title": "" }, { "docid": "5212d88140a2e2c402bb41cf45aadb88", "score": "0.5742971", "text": "set prefix(value) { this._prefix = value; }", "title": "" }, { "docid": "7e1edc08b4e15c4e2f6afeab7e9927e4", "score": "0.57421446", "text": "prefixed(prop, prefix) {\n let spec\n ;[spec, prefix] = flexSpec(prefix);\n if (spec === 2009) {\n return prefix + 'box-ordinal-group'\n }\n if (spec === 2012) {\n return prefix + 'flex-order'\n }\n return super.prefixed(prop, prefix)\n }", "title": "" }, { "docid": "1632f15ecfd441eb030abde68d3a1615", "score": "0.5724241", "text": "prefix(newPrefix) {\n const self = this;\n self._prefix = newPrefix;\n return self;\n }", "title": "" }, { "docid": "6470ebaa4f89666397e514cd0e751af6", "score": "0.57118493", "text": "prefixed(prop, prefix) {\n let spec\n ;[spec, prefix] = flexSpec(prefix);\n if (spec === 2009) {\n return prefix + 'box-pack'\n }\n if (spec === 2012) {\n return prefix + 'flex-pack'\n }\n return super.prefixed(prop, prefix)\n }", "title": "" }, { "docid": "627aa2df9f626cc5c4b97df6db84a00f", "score": "0.56968635", "text": "function prefixItem (prefix) {\n return function (item) {\n return (item.indexOf(prefix) == -1 ? prefix + ' ' : '') + item;\n };\n}", "title": "" }, { "docid": "2be539611c113374101dd1b2cb25403c", "score": "0.56673545", "text": "function tw(units) {\n\treturn `${units * 4 / 16}rem`\n}", "title": "" }, { "docid": "64fbb13f35587ecc722a20c719b65c71", "score": "0.56656784", "text": "function prefixZero(num) {\n num = num || 0;\n if (String(num).length >= 2) {\n return num;\n } else {\n return '0' + String(num);\n }\n }", "title": "" }, { "docid": "06d202adecaa6f5c8b450ef46cad61d9", "score": "0.5645715", "text": "function make_card_id(id, prefix) {\n\t\tif (typeof prefix == \"undefined\") {\n\t\t\tprefix = \"card_\";\n\t\t}\n\t\treturn prefix + id;\n\t}", "title": "" }, { "docid": "145c660169f9ba899fdec760d83a6c67", "score": "0.5633756", "text": "prefixed(prop, prefix) {\n return prefix + prop.replace('-inline', '')\n }", "title": "" }, { "docid": "efa259aa4f02316fcb0762b466bf98ba", "score": "0.5597308", "text": "function zeroPrefixer(val) {\n return (val < 10 ? '0' : '') + val;\n}", "title": "" }, { "docid": "a489da61c49109e86aadc043305005d0", "score": "0.5590228", "text": "function unit(value) {\n return [value];\n}", "title": "" }, { "docid": "a107f99b53db2390d82caa25541c6a51", "score": "0.5585285", "text": "generateTag(prefix = \"\", name = \"\") {\n try {\n prefix = prefix.trim()\n name = name.toString().trim()\n\n // Lightning wants the first letter to always be capitalized\n prefix = prefix.charAt(0).toUpperCase() + prefix.slice(1)\n return `${prefix}${name}`\n } catch (e) {\n Log.error(e)\n }\n }", "title": "" }, { "docid": "414876baf6b171cea227489f37bc3a93", "score": "0.55816567", "text": "function makeUnitVal(v) {\n if (typeof v == \"string\")\n return UnitValue(stripUnits(v), v.replace(/[0-9.-]+/g, \"\"));\n if (typeof v == \"number\")\n return UnitValue(v, DOMunitToCSS[app.preferences.rulerUnits]);\n}", "title": "" }, { "docid": "108571ce6d7b98837ab7c55f0906a296", "score": "0.55793804", "text": "function create_prefix_Rules (pNONTERM) {\n\tvar vPrefix = pNONTERM.split(/_/)[0];\n\t//alert(\"vPrefix=\"+vPrefix+\"\\nrules.js:697\");\n\treturn vPrefix;\n}", "title": "" }, { "docid": "fc9239267fd48d719fcfc7eaa0ec8fdb", "score": "0.55787975", "text": "prefixed(prop, prefix) {\n let spec\n ;[spec, prefix] = flexSpec(prefix);\n if (spec === 2009) {\n return prefix + 'box-flex'\n }\n return super.prefixed(prop, prefix)\n }", "title": "" }, { "docid": "ce1a9a8fd25e6b311e9791e5f97d4fc6", "score": "0.55674946", "text": "prefixed(prop, prefix) {\n prop = vendor.unprefixed(prop);\n return this.decl(prop).prefixed(prop, prefix)\n }", "title": "" }, { "docid": "8da301cf1e8af78896a35042e0080627", "score": "0.55655193", "text": "function prefixNumber(num, places) {\n if (num < 0) return \"-\" + prefixNumber(-num, places);\n\n var pos = Math.floor(Math.log(num) / Math.log(1000));\n if (pos < 0) pos = 0;\n var num = num / Math.pow(1000, pos);\n \n var pre = prefixes[pos];\n if (pre === undefined) pre = \"???\";\n\n num = round(num, places);\n\n return num + pre;\n}", "title": "" }, { "docid": "9802bdebeaa6b2ee4269ffd7216b5598", "score": "0.5561531", "text": "function uniqueId(prefix) {\n const id = ++idCounter;\n return prefix ? String(prefix) + id : id;\n }", "title": "" }, { "docid": "ced07f9c2e7ae1154fea0a53bbb2dd14", "score": "0.55548173", "text": "function makeFOTSUdl(unit) {\r\n var udl = `${unit.info.name},${unit.state.stats.beam},${unit.state.stats.shield}`;\r\n return udl;\r\n }", "title": "" }, { "docid": "1cccedcdb2350b8ea0cc1250a7daa416", "score": "0.5549877", "text": "function makeUnitVal(v) {\n if (typeof v == 'string')\n return UnitValue(stripUnits(v), v.replace(/[0-9.-]+/g, ''));\n if (typeof v == 'number')\n return UnitValue(v, DOMunitToCSS[app.preferences.rulerUnits]);\n}", "title": "" }, { "docid": "32ddbfd8acf002b4595779ec4a4d1cdc", "score": "0.554817", "text": "function addPrefixToPropertyName(name, prefix) {\n\t\tif (!prefix) {\n\t\t\treturn name;\n\t\t}\n\n\t\tvar parts = name.split(\".\");\n\t\tvar result = \"\";\n\t\tfor (var i = 0; i < parts.length - 1; i++) {\n\t\t\tresult += parts[i] + \".\";\n\t\t}\n\t\tvar lastPart = parts[parts.length - 1];\n\t\tif (prefixRequiresNextInitialCap(prefix)) {\n\t\t\tresult += prefix + lastPart.substring(0, 1).toUpperCase() + lastPart.substring(1);\n\t\t} else {\n\t\t\tresult += prefix + lastPart;\n\t\t}\n\t\treturn result;\n\t}", "title": "" }, { "docid": "77b549048f9379340d570a42ee866363", "score": "0.55381113", "text": "function ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}", "title": "" }, { "docid": "77b549048f9379340d570a42ee866363", "score": "0.55381113", "text": "function ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}", "title": "" }, { "docid": "77b549048f9379340d570a42ee866363", "score": "0.55381113", "text": "function ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}", "title": "" }, { "docid": "77b549048f9379340d570a42ee866363", "score": "0.55381113", "text": "function ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}", "title": "" }, { "docid": "77b549048f9379340d570a42ee866363", "score": "0.55381113", "text": "function ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}", "title": "" }, { "docid": "ca79c4adff1a915939e6872c8dd7ba11", "score": "0.55305034", "text": "prefixName(prefix, name) {\n if (prefix === '-moz-') {\n return name + '--moz-device-pixel-ratio'\n } else {\n return prefix + name + '-device-pixel-ratio'\n }\n }", "title": "" }, { "docid": "549dc8adc64d977218a4df6f2512765c", "score": "0.55272096", "text": "function uniqueId(prefix) {\n var id = ++idCounter;\n return prefix ? String(prefix) + id : id;\n}", "title": "" }, { "docid": "6bf33929f6875905af652bfff0cab6d7", "score": "0.55266196", "text": "normalizeUnit(str, full) {\n let num = parseFloat(str);\n let deg = (num / full) * 360;\n return `${deg}deg`\n }", "title": "" }, { "docid": "5f2843868d7995ea10cb8543f4174d16", "score": "0.55231136", "text": "function prefix(symbol) {\n\t\t\t\tif (typeof arguments[1] === 'number') {\n\t\t\t\t\tvar parselet = new self.nodes.parselets.Prefix(arguments[1]);\n\t\t\t\t} else {\n\t\t\t\t\tvar parselet = arguments[1];\n\t\t\t\t}\n\n\t\t\t\tself.register('prefix', symbol, parselet);\n\t\t\t}", "title": "" }, { "docid": "93fb335a8b4734935f61bd2602604621", "score": "0.5515397", "text": "function uniqueId(prefix) {\n const id = ++idCounter;\n return prefix ? String(prefix) + id : id;\n}", "title": "" }, { "docid": "05714a7d03bf1dd9dfaa6eb0a4266368", "score": "0.55122715", "text": "function replaceUnit( u ) {\n if( u.includes( 'yavaa:' ) ) {\n u = u.replace( 'yavaa:', '' )\n return UnitStore.getUnit( `http://yavaa.org/ns/units/${u}` );\n } else {\n return UnitStore.getUnit( `http://www.wurvoc.org/vocabularies/om-1.8/${u}` );\n }\n }", "title": "" }, { "docid": "bc4cd90561bbc0f0a2106b9f4cec8349", "score": "0.5504761", "text": "prefixed(prop, prefix) {\n let spec\n ;[spec, prefix] = flexSpec(prefix);\n if (spec === 2009) {\n return prefix + 'box-align'\n }\n if (spec === 2012) {\n return prefix + 'flex-align'\n }\n return super.prefixed(prop, prefix)\n }", "title": "" }, { "docid": "801e50aeec1b790c9b183a8cb4df9084", "score": "0.5499754", "text": "function getFormatedUnits (arg) {\n var lowered = arg.toLowerCase();\n\n if (lowered.indexOf('fl.oz.') != -1) { return 'Ounce'; }\n if (lowered.indexOf('fl oz') != -1) { return 'Ounce'; }\n if (lowered.indexOf('gallon') != -1) { return 'Gallon'; }\n if (lowered.indexOf('pound') != -1) { return 'Pound'; }\n if (lowered.indexOf('ounce') != -1) { return 'Ounce'; }\n if (lowered.indexOf('oz') != -1) { return 'Ounce'; }\n if (lowered.indexOf('oz.') != -1) { return 'Ounce'; }\n if (lowered.indexOf('ml') != -1) { return 'ml'; }\n if (lowered.indexOf('g') != -1) { return 'Gram'; }\n if (lowered.indexOf('gram') != -1) { return 'Gram'; }\n if (lowered.indexOf('pack') != -1) { return 'Pack'; }\n if (lowered.indexOf('dram') != -1) { return 'Dram'; }\n if (lowered.indexOf('count') != -1) { return 'Item'; }\n\n return arg;\n}", "title": "" }, { "docid": "07800644dee78919641ce1047656ce86", "score": "0.5469789", "text": "function getUid(prefix) {\n if (prefix === void 0) { prefix = ''; }\n if (!(prefix in _uidPrefixes)) {\n _uidPrefixes[prefix] = 0;\n }\n _uidPrefixes[prefix] += 1;\n return prefix + _uidPrefixes[prefix].toString();\n}", "title": "" }, { "docid": "f2154f010697c6412983cb0e44565380", "score": "0.5468996", "text": "function registerUnit(unit) {\n lookupTbl.set(unit.toString(), unit);\n}", "title": "" }, { "docid": "5aaeb93ee65ae10d6a65dadf616ef66d", "score": "0.5468006", "text": "function getNextUnit(unit) {\n switch (unit) {\n case \"year\":\n return;\n case \"month\":\n return \"year\";\n case \"week\":\n return \"month\";\n case \"day\":\n return \"month\"; // not a mistake\n case \"hour\":\n return \"day\";\n case \"minute\":\n return \"hour\";\n case \"second\":\n return \"minute\";\n case \"millisecond\":\n return \"second\";\n }\n}", "title": "" }, { "docid": "8b2ff502851d9493dcbf15cc7e54c6c8", "score": "0.5468", "text": "static ustring(indent, msg, prefix='', suffix='') {\n return \" \".repeat(indent) + prefix + msg + suffix;\n }", "title": "" } ]
e5805592cacb12f452da3105cbceb169
9 Dash between Even Numbers Write a JavaScript program which accepts a number as input and inserts dashes () between two consecutive even numbers. Test: dash_in_even(012345684); Output: "01245684"
[ { "docid": "d2689236fdc550b0d354a69890493384", "score": "0.8415265", "text": "function dash_in_even(number) {\n var x=number.toString();\n var y=x[0];\n for(var i=1;i<x.length;i++)\n {\n if((parseInt(x[i-1])%2==0) && (parseInt(x[i])%2==0) )\n {\n y=y+\"-\"+x[i];\n \n }\n else\n {\n y+=x[i];\n }\n }\n return y;\n}", "title": "" } ]
[ { "docid": "2b79a9448d3043857409bb892646d528", "score": "0.81194633", "text": "function dashes_between_even(number) {\n\n const number_string = number.toString();\n\n let result = number_string[0];\n\n const length = number_string.length;\n\n for (let i = 1; i < length; i++) {\n // if ((number_string[i] % 2 === 0) && (number_string[i - 1] % 2 === 0)) {\n // result = number_string.slice(0, i) + '-';\n // }\n // else {\n // result = result + number_string[i];\n // }\n\n if ((number_string[i] % 2 === 0) && (number_string[i - 1] % 2 === 0)) {\n result = result.concat('-' + number_string[i]);\n }\n else {\n result = result.concat(number_string[i]);\n }\n\n\n }\n\n return result;\n}", "title": "" }, { "docid": "8207418cd3f88792fff3b25847ecac2e", "score": "0.78192204", "text": "function dash (numString) {\n // define your function here\n for (var i = 0; i < numString.length - 1; i++) {\n if (parseInt(numString[i]) % 2 === 0 && parseInt(numString[i + 1]) % 2 === 0) {\n numString = numString.replace(numString[i], numString[i] + '-')\n i += 1\n }\n }\n return numString\n}", "title": "" }, { "docid": "1cd18ee13e97a9f2df0a826f802101c8", "score": "0.7814699", "text": "function insertDash(num) {\n // turns string into array\n var arr = num.toString().split(\"\")\n // for loop that iterates through the digits\n for(i=0; i<arr.length; i++) {\n // compares consecutive digits to see if both are odd\n if(parseInt(arr[i])%2===1 && parseInt(arr[i+1])%2===1)\n { // inserts dash between odd numbers\n arr.splice(i+1,0,\"-\");\n }\n }\n\n// turn array into a number\narr = arr.join(\"\");\n// return number\nreturn arr;\n}", "title": "" }, { "docid": "e6a7580a7e32759f0b71f97ec2d6a905", "score": "0.777794", "text": "function dash_in_even(number) {\n console.log(\"even numbers separated by dashes\");\n var str = number.toString();\n var result = [str[0]];\n\nfor(var x=1; x<str.length; x++)\n {\n if((str[x-1]%2 === 0)&&(str[x]%2 === 0))\n {\n result.push('-', str[x]);\n }\n else\n {\n result.push(str[x]);\n }\n }\nconsole.log(result.join(''));\n}", "title": "" }, { "docid": "7af8ad1c31c9c1f7dd2c8e8cac2ef89d", "score": "0.7718444", "text": "function DashInsert(num) {\n //convert number to string\n //convert string to array\n var array = num.toString().split(\"\");\n var output = \"\";\n\n //loop through array\n for (var i = 0; i < array.length; i++) {\n //add character to output\n output += array[i];\n //if current character is odd and last character is odd\n if (array[i] % 2 !== 0 && array[i+1] % 2 === 1) {\n output += \"-\";\n }\n }\n\n return output;\n\n}", "title": "" }, { "docid": "eae4e9db13f989a3f64d3f99bb5b0e70", "score": "0.7655578", "text": "function dashInsert(num) {\n\tvar output = \"\";\n\tvar array = num.toString().split(\"\");\n\tfor (var i = 0; i < array.length; i++){\n\t\tif ( array[i]% 2 === 1 && array [i+ 1]% 2 === 1) // Every time the loop run it changes the value you of i [\"4\",\"2\",\"3\"]\n\t\t{\n\t\t\toutput = output + array[i] + \"-\";\n\t\t} else {\n\t\t\touput = output + array[i];\n\t\t}\n\t}\n\treturn output;\n}", "title": "" }, { "docid": "a4d577a7a0c60ec1217141e3e1891e8c", "score": "0.7645843", "text": "function insertDash(num) {\n let digit;\n let digits = '';\n let numString = num.toString();\n for (let i = 0; i < numString.length; i++){\n digit = numString.charAt(i);\n if (parseInt(digit) % 2 && parseInt(numString.charAt(i + 1)) % 2){\n digit += '-';\n }\n digits += digit;\n }\n return digits;\n}", "title": "" }, { "docid": "ea82ea9f8c6642d0e40c394f8605dc32", "score": "0.7545936", "text": "function DashInsert(str) { \r\n\r\n // code goes here \r\nvar numbers=str.split(\"\");\r\nvar result=[];\r\nfor(var i=0;i<numbers.length;i++){\r\n if((numbers[i]%2&&numbers[i+1]%2)==1){\r\n numbers[i]=numbers[i]+\"-\";\r\n\r\n }\r\n result.push(numbers[i]);\r\n}\r\nreturn result.join(\"\");\r\n}", "title": "" }, { "docid": "c7e7440bfc058f23550e9252b7c257f2", "score": "0.7543408", "text": "function dash (numString) {\n // define your function here\n var numStr = numString\nvar numStrArrMinus = []\n\nfor (var i = 0; i < numStr.length ; i++)\nif (numStr[i]%2===0 && numStr[i+1]%2 ===0 ){\nnumStrArrMinus.push(numStr[i]+\"-\")\n}\nelse {\nnumStrArrMinus.push(numStr[i])\n}\n\nreturn(numStrArrMinus.join(''))\n}", "title": "" }, { "docid": "89d126a9cba00d0d8f79f47f5441c4ef", "score": "0.75008684", "text": "function insertDash(num) {\n return num.toString().split('').map(function(val, i, arr){\n if( parseInt(val) % 2 && parseInt(arr[i + 1]) % 2 ) val += '-';\n return val;\n }).join('');\n}", "title": "" }, { "docid": "173f27bf9ccf8f20ac2de5bf84828e0b", "score": "0.7473589", "text": "function insertDash(num) {\n //code me\n var result = []\n var subresult = String(num).split('');\n subresult.forEach((item,index,array) => {\n //check if next index is \n if(array[index - 1] % 2 !== 0 && item % 2 !== 0 && index !== 0){\n result.push(`-${item}`)\n }\n else{\n result.push(String(item))\n }\n })\n return result.join('')\n}", "title": "" }, { "docid": "b63d3201500163ee344613bb5d964664", "score": "0.7368599", "text": "function DashInsert(num) {\n\n // First, we convert the input number into a string\n // This allows us to add the character to our answer rather than summing the two.\n num = num.toString();\n // Next, we declare and initialize a variable to hold our answer string.\n var answer = \"\";\n\n // After that, we loop through each character in our input number...\n for (var i = 0; i < num.length; i++) {\n // ...and for every character after the first, we check if the current and previous character are odd.\n if ((i > 0) && (num[i] % 2 === 1) && (num[i - 1] % 2 === 1)) {\n // If both are, we add a dash to our answer.\n answer += \"-\";\n }\n // No matter whether or not we add a dash, we add the current number to our answer string.\n answer += num[i];\n }\n\n // Finally, we return our answer.\n return answer;\n}", "title": "" }, { "docid": "701b7e4f75be416c422d4da9f8889e34", "score": "0.71643424", "text": "function DashInsert(str) {\n\nvar arr = str.split(\"\");\nvar arr2 = [];\n\nfor (var i = 0; i < arr.length; i++) {\n if ((arr[i] === 0) || (i == arr.length-1)) {\n arr2.push(arr[i]);\n }\n else if ((arr[i] % 2 !== 0) && (arr[i+1] % 2 !== 0)) {\n arr2.push(arr[i] + \"-\");\n } else {\n arr2.push(arr[i]);\n }\n}\n return arr2.join(\"\");\n\n\n}", "title": "" }, { "docid": "06562d8ab08aaa66160f7188f7282340", "score": "0.7129298", "text": "function separateEven(n) {\r\n var arr = n.toString().split('')\r\n var sep = [];\r\n for (var i = 0; i < arr.length; i++) {\r\n if (arr[i] % 2 == 0 && arr[i + 1] %2 == 0 ) {\r\n sep.push(arr[i]);\r\n sep.push(\"-\");\r\n } else {\r\n sep.push(arr[i])\r\n }\r\n } \r\n var x = sep.join(\"\").toString();\r\n return x;\r\n}", "title": "" }, { "docid": "4fad9b2a790a1a311afc3bf5b79b3ec9", "score": "0.7128818", "text": "function dashes1(n) {\n let str = '';\n for (let i = 0; i < n.length; i++) {\n if (n[i] % 2 === 0 && n[i+1] % 2 === 0) {\n str += `${n[i]}-`\n } else {\n str += n[i]\n }\n }\n return str\n}", "title": "" }, { "docid": "8c34937802718c1ec1c41eff3f352e9e", "score": "0.70021003", "text": "function addDashBetweenNumber(number) {\n\n}", "title": "" }, { "docid": "05efc21455d9223456b24390b613ea1a", "score": "0.68747", "text": "function tambahDash(str) {\n var string = \"\";\n for (let i = 0; i < str.length; i++) {\n if (str.charAt(i) % 2 == 1 && str.charAt(i+1) % 2 == 1) {\n string+=str.charAt(i) + \"-\"\n } else {\n string+=str.charAt(i)\n }\n }\n return string\n}", "title": "" }, { "docid": "92fcd7a7998435198704365f02841e6e", "score": "0.68280965", "text": "function tambahDash(str) {\n var string = \"\";\n\n for (let i = 0; i < str.length; i++) {\n if (str[i] % 2 == 1 && str[i - 1] % 2 == 1) {\n string += \"-\" + str[i];\n } else {\n string += str[i];\n }\n }\n\n return string;\n}", "title": "" }, { "docid": "7a9745ebdad158805ef4ce2482bf49fe", "score": "0.6502554", "text": "function oddnumberinrange(x,n){\n let str = \"\";\n for(let i =x; i<n;i++){\n if(i%2==1){\n str = str + i + \" \";\n }\n }\n return str;\n}", "title": "" }, { "docid": "6248a6136f8a64496ca78b979f51c58e", "score": "0.6348123", "text": "function evenNumbers(num1, num2) {\r\n\r\nfor (var i = 0; i<=num2; i++) {\r\n if (num1<=i && i%2==0) {\r\nvar exist = false;\r\n var newDigit = i%10;\r\n var newNum = (i-newDigit)/10;\r\n var str = \"\" + newNum;\r\n var length = str.length;\r\n for (var f=0; f<=length; f++) {\r\n if ((newNum%10)%2===0) {\r\n exist = false;\r\n break;\r\n }\r\n var newDigit2 = newNum%10;\r\n newNum = (newNum-newDigit2)/10;\r\n console.log(i);\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "55c3894e44ba6bfbf63e9ad7d242165b", "score": "0.61885315", "text": "function staircase(n) {\n // for (let i = 1; i <= n; i++) {\n // let col = i;\n // for (let j = 1; j <= n - col; j++) {\n // process.stdout.write(' ');\n // }\n // for (let j = 1; j <= col; j++) {\n // process.stdout.write('#');\n // }\n // process.stdout.write('\\n');\n // }\n\n let separator = '';\n for (let i = 1; i <= n; i++) {\n separator += ' '.repeat(n - i) + '#'.repeat(i) + '\\n';\n }\n process.stdout.write(separator)\n}", "title": "" }, { "docid": "2ee6194ece14e3025a85a40294bca7dc", "score": "0.6160992", "text": "function staircase(num) {\n for (let i=1; i <= num; i++) {\n let spaces = num - i\n console.log(\" \".repeat(spaces) + \"#\".repeat(i))\n }\n }", "title": "" }, { "docid": "b70a02425e2cb4db72d65fd3b3779033", "score": "0.61482483", "text": "function substituir(n1) {\n let numeros = n1.split('');\n var result = [numeros[0]];\n\n for (let j = 1; j < numeros.length - 1; j++) {\n const element = numeros[j];\n if (parseInt(numeros[j-1]) % 2 === 0 && parseInt((numeros[j])) % 2 === 0) {\n result.push('-',numeros[j]);\n console.log(result);\n\n }\n else if (parseInt(numeros[j-1]) % 2 !== 0 && parseInt((numeros[j])) % 2 !== 0) {\n result.push('#',numeros[j]);\n console.log(result);\n }\n else {\n result.push(numeros[j]);\n }\n }\n\n if (parseInt(numeros[numeros.length - 2]) % 2 === 0 && parseInt((numeros[numeros.length - 1])) % 2 === 0) {\n result.push('-', numeros[numeros.length - 1]);\n console.log(result);\n\n }\n if (parseInt(numeros[numeros.length - 2]) % 2 !== 0 && parseInt((numeros[numeros.length - 1])) % 2 !== 0) {\n result.push('#', numeros[numeros.length - 1]);\n }\n\n\n\n return result.join('');\n}", "title": "" }, { "docid": "6c77b1a8d320ce48ca57a2cb59e7157d", "score": "0.613908", "text": "function displayHyphen() {\n var hyphen = \"\";\n for (var i = 0; i < 56; i++) {\n hyphen += \"*\";\n }\n return console.log(hyphen);\n}", "title": "" }, { "docid": "4e096fa17b41d531e4853d9e95daec8c", "score": "0.6115568", "text": "function staircase(n) {\n\tfor (let i = 1; i <= n; i++) {\n\t\tconsole.log('#'.repeat(i).padStart(n, ' '))\n\t}\n}", "title": "" }, { "docid": "2bc6016dcbe23118a308972774bb7b32", "score": "0.6101854", "text": "function staircase(n) {\n\tfor (let i = 0; i < n; i++) {\n\t\tfor (let j = 0; j < n - i - 1; j++) {\n\t\t\tprocess.stdout.write(' ');\n\t\t}\n\t\tfor (let j = n - i - 1; j < n; j++) {\n\t\t\tprocess.stdout.write('#');\n\t\t}\n\t\tprocess.stdout.write('\\n');\n\t}\n}", "title": "" }, { "docid": "fa95ad5a2e0f216cd92e634f407287b8", "score": "0.60825264", "text": "function createDash(wordToGuess) {\n document.getElementById(\"dash\").innerHTML = \"\";\n for (let i = 0; i < wordToGuess.length; i++) {\n wordDashes[i] = \"- \";\n document.getElementById(\"dash\").innerHTML += wordDashes[i];\n }\n}", "title": "" }, { "docid": "65a7cbe7868c46908ae2fc347434a876", "score": "0.60816646", "text": "function staircase(n) {\n let star = '';\n let spaces = '';\n for (let i = 0; i < n; i++) {\n for (let j = 0; j < n-i-1; j++)\n spaces += ' ';\n star += '#';\n process.stdout.write(spaces + star);\n spaces = '';\n if (i != n-1)\n process.stdout.write(\"\\n\");\n }\n\n}", "title": "" }, { "docid": "a3741019adb130bee1219dafdbd85672", "score": "0.6053355", "text": "function EvenOdd(number)\n{\n if(!Number.isInteger(number))\n {\n return \"Not a valid number\";\n }\n if(number == 0)\n {\n return \"Even\";\n }\n else if (number == 1)\n {\n return \"Odd\";\n }\n else\n {\n return(EvenOdd(number - 2));\n }\n}", "title": "" }, { "docid": "08cbce89810adbaf9a59fc04e65521cc", "score": "0.6021206", "text": "function evenOdd(number){\n if( number % 2 === 0){\n return \"even\";\n } else {\n return \"odd\";\n } \n }", "title": "" }, { "docid": "639767da7024e62bf80ecb1323f28693", "score": "0.6020397", "text": "function dashNumber(number) {\n const numberAsArray = number.toString().split();\n return numberAsArray.join('-');\n }", "title": "" }, { "docid": "fad457565a0191b45745a7554ec9bbc5", "score": "0.6008995", "text": "function Even() {\n for (var i = 0; i <=10; i++){ // \n if ((i % 2) == 0) // if remainder of i % 2 = 0 then its even\n console.log(i + \" Even \\n\");\n }\n }", "title": "" }, { "docid": "e25b7363ced44ae58a5b0fed04e8216c", "score": "0.6006857", "text": "function showNumber(input) {\n for (let i = 1; i <= input; i++) {\n if (i % 2 !== 0) {\n console.log(i + ' Odd');\n } else {\n console.log(i + ' Even')\n }\n }\n}", "title": "" }, { "docid": "6fdd85b11c6d43d1305d24ca7a2d1d3d", "score": "0.5938005", "text": "function staircase(n) {\n let hash = \"#\";\n let space = \" \";\n let x = n - 1;\n let y = n - (n - 1);\n for (let i = 0; i < n; i++) {\n console.log(`${space.repeat(x)}${hash.repeat(y)}`);\n x -= 1;\n y += 1;\n }\n}", "title": "" }, { "docid": "81c48d4dbbeba557ac80e30ddcdd0ab5", "score": "0.59184766", "text": "function two(n) {\n var s = '00' + n;\n return s.slice(-2);\n}", "title": "" }, { "docid": "3934323ac662fb44d139c0df6d2a0920", "score": "0.59183526", "text": "function evenOdd(num) {\n if (num % 2 === 0) {\n return \"even\";\n } else return \"odd\";\n}", "title": "" }, { "docid": "de1870542f897c7c2c8a18ad512d0b26", "score": "0.58929354", "text": "function oddOrEvenString(num){\n if (num.length %2== 0)\n return \"This string length is TOTALLY even! ..\";\n else (num.length % 1== 0)\n return \"This string's length is odd\";\n}", "title": "" }, { "docid": "b135c0b8c197c142fc4d08123ef957c2", "score": "0.58721966", "text": "function evenMultiplyTable() {\n for (let i = 0; i < 10; i++ ) {\n \tlet lines = `${i} `;\n \tfor (let j = 1; j < 10; j++) {\n \t\tif (i === 0) {\n \t\t\tlines += `${j} `;\n \t\t} else if ((i * j)%2 === 0) {\n \t\t\tlines += \"+ \";\n \t\t} else {\n \t\t\tlines += \"- \";\n \t\t}\n \t}\n \tconsole.log(lines);\n \t}\n}", "title": "" }, { "docid": "d3e18626f124bfeb135ae88f90229c1d", "score": "0.5863893", "text": "function oddOrEvenString (myString){\n if (myString.length %2==0){\n console.log (\"This String is TOTALLY Even\");\n}else { if (myString.length%2 != 0)\nconsole.log (\" This is Odd \");\n}\n}", "title": "" }, { "docid": "d1f73bf1d95decea3cad40f37229ca37", "score": "0.5841992", "text": "function staircase(n) {\n for (let x = 1; x <= n; x++) {\n let stair = \" \".repeat(n - x) + \"#\".repeat(x);\n console.log(stair);\n }\n}", "title": "" }, { "docid": "cd3399d17e73324ab0b147c2ce06d65c", "score": "0.5832901", "text": "function siftEvenOddChars(str) {\n let even = '';\n let odd = '';\n\n for (let i = 0; i < str.length; i++) {\n const char = str.charAt(i);\n\n if (isEven(i)) {\n even += char;\n } else {\n odd += char;\n }\n }\n\n console.log(even, odd);\n\n}", "title": "" }, { "docid": "4cf4698b22074db9c1b2d2dc5f5fd7fc", "score": "0.5828755", "text": "function evenOrOdd(n) {\n if (parseInt(n) % 2 === 0) {\n return 'even';\n } else {\n return 'odd';\n }\n}", "title": "" }, { "docid": "332430e971cd71c099d003bcfae31206", "score": "0.5824486", "text": "function staircase(n) {\n let spaces = \" \".repeat(n - 1);\n let symbol = \"#\";\n for (let i = 1; i <= n; i++) {\n console.log(`${spaces}${symbol}`);\n spaces = spaces.slice(0, spaces.length - 1);\n symbol += \"#\";\n }\n}", "title": "" }, { "docid": "ecf7638131a6b339ebfe241697e8a656", "score": "0.5818134", "text": "function oddEven(numb) {\n if(numb % 2 == 0) {\n return \"Even\"\n }\n else {\n return \"Odd\"\n }\n}", "title": "" }, { "docid": "742afe90ebf8549d844b87b68d95cee4", "score": "0.58121353", "text": "function evenorodd(num){\r\n if(num%2 == 0){\r\n return \"even\";\r\n }\r\n else{\r\n return \"odd\";\r\n }\r\n}", "title": "" }, { "docid": "df5818dc7df46b99aa22cfc10e584ad8", "score": "0.58096945", "text": "function staircase(n) {\n var line = Array(n + 1).fill(' ');\n line[n] = '\\n';\n for (var i = n - 1; i >= 0; i--) {\n line[i] = '#';\n process.stdout.write(line.join(''));\n }\n\n\n}", "title": "" }, { "docid": "bef4c831668dcd2fdb575c48ec9346d7", "score": "0.58072", "text": "function OddEven(a) {\n if(a >= 0) {\n if( (a % 2) == 0) {\n console.log(\"even\");\n }\n else {\n console.log(\"odd\");\n }\n }\n else\n console.log(\"invalid:negative no.\");\n}", "title": "" }, { "docid": "4d046f03d498f5050af7b7169b1bd2c8", "score": "0.5799183", "text": "function convertNumberToLine() {\n var tossOutcome = tossResult();\n\n if (tossOutcome % 2 === 0) {\n return (\"____ ____ even \");\n } else {\n return (\"___________ odd \");\n }\n\n }", "title": "" }, { "docid": "c82a799d8dc2e22bff866f0078046d1e", "score": "0.5797775", "text": "function staircase(n) {\n let hashes = ''\n let result = ''\n for (let i = 1; i <= n; i++) { \n hashes += '#'\n // concat n - i amount of spaces\n let spaces = \" \".repeat(n - i)\n // add another line of correct amount of spaces and hashes\n result += spaces + hashes + \"\\n\"\n }\n console.log(result)\n}", "title": "" }, { "docid": "7912ce6e4a127d094a40c1b8fdfc8aa4", "score": "0.57885814", "text": "function doDashes2(str) {\n return replaceNonChar(str, '-');\n}", "title": "" }, { "docid": "c0371e637740464544f974e85cc8bce5", "score": "0.57802844", "text": "function staircase(n) {\n var space = \" \";\n var pound = \"#\";\n for (var i = 1; i <= n; i++) {\n while (i <=n) {\n return space.repeat(n-i) + pound.repeat(i);\n }\n }\n}", "title": "" }, { "docid": "26d4f4592ad87ca5dd0f79016774d0a7", "score": "0.5777767", "text": "function staircase(n) {\n for(var i = 1; i <= n; i++){\n var diff = n - i;\n var row = \" \".repeat(diff) + '#'.repeat(i);\n console.log(row);\n }\n}", "title": "" }, { "docid": "7455f8145bd83d1de052cc546a7ed07e", "score": "0.57728046", "text": "function oddEven(num) {\n if (num % 2 === 0) {\n return (num + \" is an even number.\")\n } else {\n return (num + \" is an odd number.\")\n }\n}", "title": "" }, { "docid": "809a7ef5499d95ef522bed8df2d5310e", "score": "0.576709", "text": "function forst(st2){\n for ( let i =0 ; i <10;i++){\n document.write ( st2 + \"-\")\n }\n }", "title": "" }, { "docid": "46f831885f3167078c1ff48904125363", "score": "0.5753866", "text": "function getDisplay(word)\r\n{ \r\n var dashes = '';\r\n for (var i=0; i<word.length; i++){\r\n dashes += '-';\r\n }\r\n \r\n return dashes;\r\n}", "title": "" }, { "docid": "bbf5dff7d6ca5bce3b8d88c9406840e8", "score": "0.5752014", "text": "function even_or_odd(number) {\n if (number % 2 == 0)\n return \"Even\";\n return \"Odd\";\n}", "title": "" }, { "docid": "27a83ad849645232a71c65f01577e82d", "score": "0.57514924", "text": "prependSpaceIfLengthIsEven($ascii_number, $length) {\n if (this.isOdd($length)) {\n return ` ${$ascii_number}`;\n }\n\n return $ascii_number;\n }", "title": "" }, { "docid": "b443b5bdcd6c54dd508a592565167fef", "score": "0.5749132", "text": "function oddEven()\r\n{\r\n \r\n \r\n for(i=0;i<=15;i++)\r\n {\r\n if(i==0)\r\n {\r\n console.log(i+\" even\");\r\n document.getElementById(\"output5\").innerHTML+=i+\" is\"+\" Even\"+'<br>';\r\n \r\n }\r\n else if(i%2==0)\r\n {\r\n console.log(i+\" Even\");\r\n document.getElementById(\"output5\").innerHTML+=i+\" is\"+\" Even\"+\"<br>\";\r\n \r\n }\r\n else\r\n {\r\n console.log(i+\" odd\");\r\n document.getElementById(\"output5\").innerHTML+=i+\" is\"+\" Odd\"+\"<br>\";\r\n \r\n }\r\n }\r\n}", "title": "" }, { "docid": "4aa5d9c3b1ff9dcaf31432aadc07d1e3", "score": "0.57444686", "text": "function oddEven(d){\nif(d/2 !==0 ){\n console.log(d+' '+'is odd');\n}else{\n console.log(d+' '+'is even');\n}\n}", "title": "" }, { "docid": "c75c4be1ba69e74568197a49b6b8f2b5", "score": "0.5740021", "text": "function evenDigitsOnly(n) {\n return String(n).split(\"\").every(x=>x%2===0)\n}", "title": "" }, { "docid": "596dd82ffc9498176a00345a9f2f219b", "score": "0.57398826", "text": "function square(number){\r\n var specialChar = \"#\"\r\n if(number > 0){\r\n for(var i = 1; i <= number; i++){\r\n console.log(specialChar.repeat(i));\r\n }\r\n\r\n }else if(number < 0){\r\n number = number*(-1)\r\n for(var i = number; i >= 0; i--){\r\n console.log(specialChar.repeat(i));\r\n }\r\n }\r\n \r\n}", "title": "" }, { "docid": "a57b79bda3286a85d252bb2763c8a38b", "score": "0.5725356", "text": "function Even(){ \r\n for( i=1; i<=200; i++){ \r\n x = i % 2; \r\n if(x == 0){ \r\n document.write(i + \"<br>\"); \r\n console.log(i); \r\n } \r\n } \r\n}", "title": "" }, { "docid": "6eea9139c0ff647d9d130f796cbafc3e", "score": "0.5719841", "text": "static twoDigitInt(number){\n return `${(\"0\" + number).slice(-2)}`;\n }", "title": "" }, { "docid": "411b9294b97a4b004d79be12caa07bc0", "score": "0.5718074", "text": "function calculateEvens(startNum, endNum, step) { \n var output = \"\\n\";\n for (var i = startNum; i < endNum; i += step) {\n if (i % 2 == 0) {\n output += i; //ig js auto converts i to a string???\n output += \"\\n\";\n }\n }\n return output; \n}", "title": "" }, { "docid": "46a8b7ec3b9c29f0496a5b1e5820b012", "score": "0.5702626", "text": "function iseven(n){\n\twhile(n >=0){\n\t\tif(n === 0){\n \treturn \"Even\";\n }\n n=n-2;\n }\n return \"odd\";\n}", "title": "" }, { "docid": "a28158b9629e0fd0e9c3d0deb6c74f75", "score": "0.5694767", "text": "function front_times (string, int){\n var output = string.substring(0,3);\n var outputTwo = string.substring(0,3);\n if (int == 0){\n return false;\n } else {\n for (var i = 1; i < int; i ++){\n output+=outputTwo;\n }\n }\n return output;\n}", "title": "" }, { "docid": "2fca35c41edc645ea30ca199b141caf5", "score": "0.56895006", "text": "function even_or_odd(number) {\n if (number % 2 === 0) {\n return \"Even\"\n } else {\n return \"Odd\"\n }\n}", "title": "" }, { "docid": "7ddfad97972d43b1299dada58766949d", "score": "0.56818503", "text": "function makeDash(word) {\r\n dashArray = [];\r\n for (var i = 0; i < word.length; i++) {\r\n dashArray.push(\"_\");\r\n }\r\n}", "title": "" }, { "docid": "7d156be729177fc74a1422e1d0d08021", "score": "0.56745356", "text": "function dashify(str){\n return str.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase();\n}", "title": "" }, { "docid": "8a014ad0fe6d8c9b106cca0fd27e737c", "score": "0.5668239", "text": "function staircase(n) {\n\tvar line = Array(n + 1).fill(\" \");\n\tline[n] = \"\\n\";\n\tfor (var i = n - 1; i >= 0; i--) {\n\t\tline[i] = \"#\";\n\t\tprocess.stdout.write(line.join(\"\"));\n\t}\n}", "title": "" }, { "docid": "49963ee1406088734a6c1aaccfc4ef57", "score": "0.56681174", "text": "function makeIntoDashes(word) {\n\tvar dashes = \"\";\n\tfor (i = 0; i < word.length - 1; i++) {\n\t\tdashes += \"_ \";\n\t}\n\tdashes += \"_\";\n\treturn dashes;\n}", "title": "" }, { "docid": "9fdf369524085d12f43604241fbf6f7b", "score": "0.5666551", "text": "function aa(n){\r\n var a=1\r\n for(var i=1;i<=n;i++){\r\n var str=\"\"\r\n for(var j=i;j>=1;j--){\r\n str=str+(j%2)\r\n \r\n }\r\n console.log(str)\r\n }\r\n \r\n }", "title": "" }, { "docid": "e5160854e8bbe62fb8d292647935b576", "score": "0.56650484", "text": "function weave(a_string, a_num) {\n let new_string = \"\";\n for (let i = 0; i < a_string.length; i++) {\n //take into account zero index and treat as one index\n if ((i + 1) % a_num === 0) {\n new_string = new_string + 'x';\n } else {\n new_string = new_string + a_string.charAt(i);\n }\n } //end of for loop\n return new_string;\n }", "title": "" }, { "docid": "cda9385dc7bc233f7da33d6e8284087c", "score": "0.5660958", "text": "function stairCase(num){\n var test = \"#\";\n for(var i = 1; i <= num; i++){\n var string = test.repeat(i);\n console.log(string);\n }\n // return string;\n}", "title": "" }, { "docid": "285984e9e31d04b7f8ec089e6e7469b1", "score": "0.564807", "text": "function isEven(str){\n\treturn str.length % 2 === 0; \n}", "title": "" }, { "docid": "95b52158aa78d2c174725ea5c1efe5f0", "score": "0.56403625", "text": "function main (n) {\n for (let i = n - 1; i >= 0; i--) {\n console.log(' '.repeat(i).padEnd(n, '#'))\n }\n return ''\n}", "title": "" }, { "docid": "4782c483eec887b2f727e72a6b015ee2", "score": "0.5638466", "text": "function staircase(n) {\n let result = '';\n let x = n-1;\n for(let i = 0; i < n; i++) {\n for( let j = 0; j < n; j++) {\n (j >= x) ? result += '#' : result += ' '; \n }\n x--;\n result += '\\n'\n }\n console.log(result);\n}", "title": "" }, { "docid": "2a860ef98168c79be89eeca9e7b47e47", "score": "0.56341463", "text": "function fixTrytes(input){\n return input.length % 2 ? input + '9' : input;\n}", "title": "" }, { "docid": "1bf6dc007e0be30edece6b21761b0ae0", "score": "0.56331223", "text": "function isEven(number) {\n if (number % 2 == 0) {\n console.log(\"EVEN\")\n }\n else {\n console.log(\"ODD\")\n }\n}", "title": "" }, { "docid": "7d193559e8db4495203bf998707d4d4e", "score": "0.5632401", "text": "function twoDigits(number) {\r\n\tvar ddnum = \"\";\r\n\tddnum = (\"00\" + number).slice(-2);\r\n\tconsole.log(ddnum);\r\n\treturn ddnum\r\n}", "title": "" }, { "docid": "18869ee54aef6b8754be45e83686dfc6", "score": "0.56296283", "text": "function isEven(num) {\n //WRITE YOUR CODE BETWEEN THIS LINE: ↓ ↓ ↓ ↓\n if (num % 2 == 0) {\n return 'even';\n } else {\n }\n //AND THIS LINE ↑↑↑↑↑\n}", "title": "" }, { "docid": "b30544170c881a5806846c43cb58ee37", "score": "0.56232876", "text": "function oddNumsToN(n) {\n for (let i = 1; i <= n; i += 2) {\n if (i % 2 !== 0) {\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "b9f3445a7c08003cb972f48c0b7413c7", "score": "0.5617606", "text": "function isEven(num){\r\n if(num %2 ==0){\r\n return \"this number is even\";\r\n }else {\r\n return \"this number is odd\";\r\n }\r\n }", "title": "" }, { "docid": "c26b53f17b8e082be23e7f1dfd9397e1", "score": "0.5615802", "text": "_2digit(n) {\n return ('00' + n).slice(-2);\n }", "title": "" }, { "docid": "c26b53f17b8e082be23e7f1dfd9397e1", "score": "0.5615802", "text": "_2digit(n) {\n return ('00' + n).slice(-2);\n }", "title": "" }, { "docid": "c26b53f17b8e082be23e7f1dfd9397e1", "score": "0.5615802", "text": "_2digit(n) {\n return ('00' + n).slice(-2);\n }", "title": "" }, { "docid": "462196a18c0f55753dcb4e98e162c347", "score": "0.56097615", "text": "function evenNumber(number,callback){ \n if(number%2===0)\n result=\"even\";\n else\n result=\"odd\";\n callback(); \n }", "title": "" }, { "docid": "308a7afeaf838fc048197fa1f11f0cf9", "score": "0.56046474", "text": "function even_or_odd(number) {\n return number % 2 ? \"Odd\" : \"Even\"\n}", "title": "" }, { "docid": "47a873836a13ae053995550047c77058", "score": "0.56016713", "text": "function isEven(number) {\n if (number %2) {\n console.log(\"This number is Odd\");\n }\n else {\n console.log(\"This number is Even\");\n }\n\n}", "title": "" }, { "docid": "2786eaeee606ef8b337780b2d1bec75b", "score": "0.5598078", "text": "function isEven(num) {\n\n}", "title": "" }, { "docid": "d8b63d48e19daecc34686b66fb471691", "score": "0.5577436", "text": "function two(x) {\r\n var d = '00' + x\r\n return d.substr(d.length - 2)\r\n }", "title": "" }, { "docid": "1a1cdf71120ef3fcaae1d711d917fe85", "score": "0.5573504", "text": "function isEven(number) {\n\n}", "title": "" }, { "docid": "1fb2d5839c091af0ef53d20606119999", "score": "0.5573206", "text": "function staircase(n) {\n // Write your code here\n let stairs = '#'\n let spaces = Array(n).join(' ')\n for (let i=0; i < n; i++) {\n console.log(spaces + stairs)\n stairs += '#'\n spaces = Array(n - 1 - i).join(' ')\n }\n\n}", "title": "" }, { "docid": "b052f9ee138d5ee34c6cb72c1057a3bd", "score": "0.55671054", "text": "function odd(a) {\n var res = ''\n if (a % 2 === 0) {\n res = 'the number ' + a + ' is even'\n } else {\n res = 'the number ' + a + ' is odd'\n }\n\n return res\n}", "title": "" }, { "docid": "b508084e58894cc76801f2301b8be887", "score": "0.55608845", "text": "function removeEvenCharacters(string) {\n\n let mystring='';\n\tif(string === undefined){\n\t\treturn \"missing argument\";\n\t} else if(typeof string !=='string'){\n\t\treturn \"argument not string\";\n\t}\n for (let i = 0; i < string.length; i++) {\n if (i % 2 !== 0) {\n mystring+=string[i];\n\t}\n }\n return mystring;\n console.log(mystring);\n}", "title": "" }, { "docid": "399f18c2a602c9aa7984612291ee78ec", "score": "0.5560222", "text": "function padToEven(a) {\n return a.length % 2 ? \"0\" + a : a;\n}", "title": "" }, { "docid": "399f18c2a602c9aa7984612291ee78ec", "score": "0.5560222", "text": "function padToEven(a) {\n return a.length % 2 ? \"0\" + a : a;\n}", "title": "" }, { "docid": "399f18c2a602c9aa7984612291ee78ec", "score": "0.5560222", "text": "function padToEven(a) {\n return a.length % 2 ? \"0\" + a : a;\n}", "title": "" }, { "docid": "399f18c2a602c9aa7984612291ee78ec", "score": "0.5560222", "text": "function padToEven(a) {\n return a.length % 2 ? \"0\" + a : a;\n}", "title": "" }, { "docid": "399f18c2a602c9aa7984612291ee78ec", "score": "0.5560222", "text": "function padToEven(a) {\n return a.length % 2 ? \"0\" + a : a;\n}", "title": "" } ]
e2b3b020f10ed3c7c9cbe9c3e5b32c72
common function used for validation
[ { "docid": "027f7bc4f80cebc808d2cc79e7b51aa7", "score": "0.0", "text": "function validateCourse(course){\n const schema = {\n name: Joi.string().min(3).required()\n };\n return Joi.validate(course, schema);\n}", "title": "" } ]
[ { "docid": "c0a7655d0d51c9ae8ba639759bd33757", "score": "0.7258242", "text": "validate() {\n\n }", "title": "" }, { "docid": "12d273ab92672cff7df1171f15f8ac3d", "score": "0.7239957", "text": "validate(_value, _utils) {\n return false;\n }", "title": "" }, { "docid": "ad9c3a6f8bd76588ccfb525877d50997", "score": "0.7189689", "text": "validationWithParams () {}", "title": "" }, { "docid": "e215ebc6bef72574db4496488ab0c7dd", "score": "0.71617365", "text": "validate() {\n }", "title": "" }, { "docid": "189c2c76d7d3dea4cff1b8764827f292", "score": "0.70162266", "text": "function ValidationHelper() {\n}", "title": "" }, { "docid": "4bea808e8d14a3c34e96c31108eae632", "score": "0.6966872", "text": "isValid(){ /** todo */ }", "title": "" }, { "docid": "1c1447cc5e55e7d340900f1f55f12b14", "score": "0.68849194", "text": "setupValidations() {}", "title": "" }, { "docid": "951515dc2f0d6703df9089ecf7439103", "score": "0.688399", "text": "static validate(params)\n {\n //signature of each paramater\n const keys = [\n {\n name : \"username\",\n type : \"string\",\n check : (val)=>{\n const MIN_USERNAME_LEN = 3;\n const MAX_USERNAME_LEN = 20;\n\n return (\n val.match(/^[A-Za-z0-9_]+$/g) != null &&\n val.length > MIN_USERNAME_LEN &&\n val.length < MAX_USERNAME_LEN\n );\n }\n },\n {\n name : \"avatar\",\n type : \"string\"\n },\n {\n name : \"dob\",\n type : \"number\",\n check : (val) => {\n const MS_IN_YEAR = 31536000000;\n const MIN_AGE = 13;\n const maxDate = Date.now() - (MS_IN_YEAR * MIN_AGE);\n return (val <= maxDate);\n }\n },\n {\n name : \"token\",\n type : \"string\"\n },\n {\n name : \"email\",\n type : \"string\",\n check : (val) => {\n let match = val.match(/\\S+@\\S+\\.\\S+/);\n return !(match === null || match[0] !== match.input);\n }\n },\n {\n name : \"country\",\n type : \"string\",\n check : (val) => {\n return (val.length === 2);\n }\n }\n ];\n\n return Validation.checkParams(params, keys);\n }", "title": "" }, { "docid": "dfad416da9750afdda11552613b6cfa8", "score": "0.6813194", "text": "function validData() {\n //\n}", "title": "" }, { "docid": "f60141eb38ac7bedd96622a3d6965be6", "score": "0.6794226", "text": "validationNot () {}", "title": "" }, { "docid": "118713d337b8367b96d2102a48747f67", "score": "0.6764349", "text": "validationAnd () {}", "title": "" }, { "docid": "ee27ac5a3f06033f7e91ed7cf699e90d", "score": "0.6717506", "text": "function Validation() {\n}", "title": "" }, { "docid": "f034af7e0b36db75f05815c5266e1bb5", "score": "0.67085576", "text": "function validate (){\n\t return true;\n }", "title": "" }, { "docid": "cadc118349ffaca108cdec6cb9da0b67", "score": "0.6680783", "text": "function validatedata(dname,x_elements,y_elements){\r\n \tvar newdata_value=x_elements;\r\n switch(y_elements){\r\n \t\t case 'required':\r\n\t\t\t if(newdata_value == \"\" || newdata_value == null || newdata_value.length==0 )\r\n\t\t\t{ \r\n\t\t\t\t\r\n\t\t\t\t \r\n\t\t\t \tmyApp.alert(capitalize(dname)+': This is required field','Error Message!');\r\n\t\t\t return false;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase 'number':\r\n\t\t\t if(valueIsNaN(newdata_value) || newdata_value == \"\" || newdata_value == null || newdata_value.length==0){\r\n\t\t\t \t myApp.alert(capitalize(dname)+': Please Enter Numaric value.','Error Message!');\r\n\t\t\t return false;\r\n\t\t }\r\n\t\t break;\r\n\t\t case 'email':\r\n\t\t\t\t if(check_email(newdata_value)==false){\r\n\t\t\t\t \tmyApp.alert(capitalize(dname)+': Please Enter Valid Email Address','Error Message!');\r\n\t\t\t\t\t return false;\r\n\t\t\t\t }\r\n\t\t\tbreak;\r\n\t\t\tcase 'phone':\r\n\t\t\t\t if(phonenumber(newdata_value)==false){\r\n\t\t\t\t \t myApp.alert(capitalize(dname)+': Please Enter Valid Phone Number','Error Message!');\r\n\t\t\t\t return false;\r\n\t\t\t\t } \r\n\t\t break;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t \r\n\t if(y_elements!=null){\r\n\t \t var newdata=y_elements.split(',');\r\n for (var k=0; k < newdata.length; k++){\r\n\t\t \r\n\t\t if(validatedata(x_elements,newdata[k])===false){\r\n\t\t \r\n\t \t\t break;\r\n\t \t }\r\n\t\t \r\n\t\t \r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n }", "title": "" }, { "docid": "de48b3dc6ef83d8959ec7136c73d0942", "score": "0.6680593", "text": "validate () {\n let { type, required, minLength, maxLength } = this.props\n let { value } = this.state\n let isValid = !(required || minLength)\n let errorText = ''\n if (value === null && required) {\n isValid = validator.isLength(String(value), { min: minLength })\n errorText = ERROR_TXT.REQUIRED\n }\n if (required) {\n if (type === 'number') {\n isValid = !isNaN(value) && value !== ''\n } else {\n isValid = !validator.isEmpty(value)\n }\n errorText = isValid ? '' : ERROR_TXT.REQUIRED\n }\n // Check also for validity in the next validations\n // Prevents from passing validation if a previous condition decided it was invalid\n if (isValid) {\n if (type === 'email') {\n isValid = validator.isEmail(value)\n errorText = errorText || ERROR_TXT.EMAIL\n }\n if (minLength) {\n isValid = validator.isLength(String(value), { min: minLength })\n errorText =\n errorText || `El campo debe contener al menos ${minLength} caracteres`\n }\n if (maxLength) {\n isValid = validator.isLength(String(value), { max: maxLength })\n errorText =\n errorText || `El campo debe contener máximo ${maxLength} caracteres`\n }\n }\n this.setState({ isValid, errorText })\n return isValid\n }", "title": "" }, { "docid": "cd82159a10bea4b0081e8c4f9c382760", "score": "0.66689974", "text": "is_valid() {\n\n /**\n * validates , list for validate function\n * value, control value\n * error_message,errorMessage, error message, error_message for old version\n */\n const { \n validates,\n value,\n errorMessages,\n errorMessage,\n error_message } = this.props;\n\n /**\n * Empty error list before check\n */\n this.error_list = [];\n\n /**\n * check validation\n */\n _.forEach(validates, func => {\n if (_.functions(func)) {\n const message = func(value);\n if (message) {\n\n /**\n * get error message\n */\n let error_mgs = '';\n\n /// gets errors message from error messages list\n if (errorMessages && message.type && errorMessages[message.type]) {\n error_mgs = errorMessages[message.type];\n\n /**\n * if message is a object like { message: '' }\n */\n } else if (message.message) {\n error_mgs = message.message;\n } else {\n error_mgs = message || errorMessage || error_message;\n }\n\n this.error_list.push(error_mgs);\n }\n }\n });\n\n return this.error_list.length === 0;\n }", "title": "" }, { "docid": "57ffc64f68b4ba047494980cfc3ba8e9", "score": "0.6658826", "text": "function validateAllInputFields()\n{\n validatePizzaRating();\n validatePriceRating();\n validateCustomerName();\n validateCustomerEmail();\n validateSuggestions();\n}", "title": "" }, { "docid": "24f84e34d3f31014bd29361bb9218b96", "score": "0.6656762", "text": "_validateFoodProvided(foodProvidedValue){\n\n let isValid;\n // Validate for Empty Field\n this._isFoodProvidedValid = isValid = this._validateForEmptyField(foodProvidedValue);\n \n return isValid\n\n }", "title": "" }, { "docid": "a26658449b34ebde255e1f21c4d8ce43", "score": "0.66069144", "text": "function validate_form(){\n return validate_name() && validate_number() && validate_email();\n}", "title": "" }, { "docid": "819daa2bf8208a2e7925c948f6827a3c", "score": "0.65907013", "text": "validate() {\n\t\t\n\t\tconst valid = (\n\t\t\tvalidateName('firstName', this.state.firstName, (name, val, msg) => this.setError(val, msg)) &&\n\t\t\tvalidateName('lastName',this.state.lastName, (name, val, msg) => this.setError(val, msg)) &&\n\t\t\tvalidateHCN('HCN', this.state.HCN, (name, val, msg) => this.setError(val, msg)) &&\n\t\t\tvalidateEmail('email', this.state.email, (name, val, msg) => this.setError(val, msg)) &&\n\t\t\tvalidateAddress('address', this.state.address, (name, val, msg) => this.setError(val, msg)) &&\n\t\t\tvalidatePostalCode('postalCode', this.state.postalCode, (name, val, msg) => this.setError(val, msg)) &&\n\t\t\tvalidateDoctorID('doctorID', this.state.doctorID, (name, val, msg) => this.setError(val, msg)) \n\t\t);\n\t\t\n\t\treturn valid;\n\t}", "title": "" }, { "docid": "3f2ed77ce9b3510f15b9deb22e92307c", "score": "0.6589136", "text": "validationOr () {}", "title": "" }, { "docid": "4863072784c335abadcacad132025291", "score": "0.65698695", "text": "_validate() {\n let validators = [];\n if(this.props.required && !this.props.value) {\n return 'This field is required.';\n }\n\n return run_validators(validators, this.props.value);\n }", "title": "" }, { "docid": "7a7ed39289a21c76f524fa5df83087a0", "score": "0.65338117", "text": "function checkAllInputFields()\n{\n // Variable names must be different from function names :-(\n isPizzaRatingValid = checkIfPizzaRatingIsValid();\n isPriceRatingValid = checkIfPriceRatingIsValid();\n isCustomerNameValid = checkIfCustomerNameIsValid();\n isCustomerEmailValid = checkIfCustomerEmailIsValid();\n areSuggestionsValid = checkIfSuggestionsAreValid();\n}", "title": "" }, { "docid": "7b6c0b127e101e5836832bbe610c6fb5", "score": "0.6529378", "text": "validateRequired (inputs) {\n // define validation result\n const validations = [];\n // loop through data array\n for (let input of inputs) {\n if (input.type == 'string-number') {\n if (\n this.validation.isString (input.data) &&\n this.validation.notEmptyString (input.data)\n ) {\n // continue\n } else {\n if (Number.isNaN (input.data - input.data)) {\n let result = {\n message: input.message ||\n `${input.name} is required and should be string or number`,\n fieldName: input.name,\n };\n // push the result into validations array\n validations.push (result);\n }\n }\n }\n // check if type of input is string\n if (input.type == 'string') {\n if (\n this.validation.isString (input.data) &&\n this.validation.notEmptyString (input.data)\n ) {\n // continue\n } else {\n let result = {\n message: input.message ||\n `${input.name} is required and should be a valid ${input.type}`,\n fieldName: input.name,\n };\n validations.push (result);\n }\n }\n // method to check if the input is number\n if (input.type == 'number') {\n if (Number.isNaN (input.data - input.data)) {\n let result = {\n message: input.message ||\n `${input.name} is required and should be a valid ${input.type}`,\n fieldName: input.name,\n };\n // push the result into validations array\n validations.push (result);\n }\n }\n // check if type of input is object\n if (input.type == 'object') {\n if (\n this.validation.isObject (input.data) &&\n this.validation.notEmpty (input.data)\n ) {\n // continue\n } else {\n let result = {\n message: input.message ||\n `${input.name} is required and should be an ${input.type}`,\n fieldName: input.name,\n };\n validations.push (result);\n }\n }\n // check if the input is email\n if (input.type == 'email') {\n // continue\n if (\n this.validation.isString (input.data) &&\n this.validation.notEmptyString (input.data) &&\n this.validation.checkEmail (input.data)\n ) {\n // continue\n } else {\n let result = {\n message: input.message ||\n `${input.name} is required and should be a valid ${input.type}`,\n fieldName: input.name,\n };\n validations.push (result);\n }\n }\n // check if the input is phone number\n if (input.type == 'phone') {\n if (\n this.validation.isString (input.data) &&\n this.validation.notEmptyString (input.data) &&\n input.data.length == 11 &&\n input.data.startsWith ('0')\n ) {\n // continue\n } else {\n let result = {\n message: input.message ||\n `${input.name} is required and should be a valid ${input.type}, with 11 digit`,\n fieldName: input.name,\n };\n validations.push (result);\n }\n }\n // check if the type is file\n if (input.type == 'image') {\n // check if there are data\n if (!input.data) {\n // return error\n let result = {\n message: input.message ||\n `${input.name} is required and should be an ${input.type}`,\n fieldName: input.name,\n };\n // push validation errors into validations array\n validations.push (result);\n } else {\n // check if the mime type is image\n if (this.imagMimeTypes[input.data.mimetype]) {\n // continue\n } else {\n let result = {\n message: input.message ||\n `${input.name} should be an ${input.type}`,\n fieldName: input.name,\n };\n validations.push (result);\n }\n }\n }\n if (input.type == 'array') {\n if (Array.isArray (input.data) && input.data.length > 0) {\n // continue\n } else {\n let result = {\n message: input.message ||\n `${input.name} should be an ${input.type} and shouldn't be empty`,\n fieldName: input.name,\n };\n validations.push (result);\n }\n }\n // check the object has two properties\n if (input.type == 'object' && input.length == '>=2') {\n if (\n this.validation.isObject (input.data) &&\n this.validation.notEmpty (input.data) &&\n Object.keys (input.data).length >= 2\n ) {\n // continue\n } else {\n let result = {\n message: input.message ||\n `${input.name} should be an ${input.type} and shouldn't be empty`,\n fieldName: input.name,\n };\n validations.push (result);\n }\n }\n if (input.type == 'boolean') {\n if (input.data == true || input.data == false) {\n // continue\n } else {\n let result = {\n message: input.message || `${input.name} should be a ${input.type}`,\n fieldName: input.name,\n };\n validations.push (result);\n }\n }\n }\n // return validations array\n return validations;\n }", "title": "" }, { "docid": "e22b9cab7a9a5ad877c9365acfc5e6cc", "score": "0.65292364", "text": "function MakeValidation() {\n vi=this;\n vi.nameToMsg = function(str) // converts lowercase, hyphen separated input name to space separated Word Capitalized\n {\n var splitStr = str.toLowerCase().split('-');\n for (var i = 0; i < splitStr.length; i++) {\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);\n }\n return splitStr.join(' ');\n };\n vi.validate = function (item,type) // this does the validation\n {\n var err = 0;\n var name = item.attr('name');\n var value = item.val();\n var msg = \"\";\n switch (type)\n {\n case 'required':\n if(value == '' || value === undefined) {\n err = 1;\n msg = vi.nameToMsg(name)+\" is a required field.\";\n }\n break;\n case 'phone-usa':\n if(!value.match(/^\\d\\d\\d\\-\\d\\d\\d-\\d\\d\\d\\d$/)) {\n err = 1;\n msg = \"Please enter a valid phone number\";\n }\n break;\n // Add more validation types below\n }\n if(err > 0){\n item.addClass('invalid');\n }\n $(\"#\"+name+\"-err-message\").text(msg);\n // console.log( name+' '+value+' '+type+((err != 0)?' ERROR':' OK') );\n return err;\n };\n vi.doValidation = function(item) {\n if(item.attr('validate') === undefined) return 0;\n var errors = 0;\n var err = 0;\n // the validation attribute is a comma separated list of validation types to apply to the input\n var validations = item.attr('validate').split(',');\n validations.forEach(function (type) {\n if (err === 0) {\n item.removeClass('invalid');\n err = vi.validate(item, type);\n errors += err;\n }\n });\n return errors;\n };\n}", "title": "" }, { "docid": "6834b3db993e61702e7d1b980cd5fa4d", "score": "0.6497495", "text": "static validate(userData){\n return userValidator.validate(userData);\n }", "title": "" }, { "docid": "e07e8e021ded5c0ec9aaae6e386e2499", "score": "0.64555436", "text": "validatefirsname(firsname){\n if(validator.isEmpty(firsname)){\n return 'firstname is required';\n }\n if(!validator.isAlpha(firsname)){\n return 'name must be in letter';\n }\n\n if(!validator.isLength(firsname, { min: 6 })){\n return 'Name should be minimum 6 characters';\n }else{\n\n }\n return false;\n }", "title": "" }, { "docid": "6095999d75241111fedba781d49efeaa", "score": "0.6433366", "text": "_validateFields(){\n\n let isValid = true;\n\n // Validate project state date value\n isValid = this._validateProjectStartDate(this.state.projectStartDateValue);\n if(!isValid)\n return isValid;\n\n // Validate project end date value\n isValid = this._validateProjectEndDate(this.state.projectEndDateValue);\n if(!isValid)\n return isValid;\n\n // Validate food provided value\n isValid = this._validateFoodProvided(this.state.foodProvidedValue);\n if(!isValid)\n return isValid;\n\n // Validate current status value\n isValid = this._validateCurrentStatus(this.state.currentStatusValue);\n if(!isValid)\n return isValid;\n\n // Validate project type value\n isValid = this._validateProjectType(this.state.projectTypeValue);\n if(!isValid)\n return isValid;\n\n return isValid\n\n }", "title": "" }, { "docid": "4ef48eefa76f5451051f9501dc1f3f54", "score": "0.6429415", "text": "_validate() {\n let validators = [new IntegerValidator()];\n if(this.props.required && (this.props.value === null || this.props.value === undefined)) {\n return 'This field is required.';\n }\n\n if(this.props.min_value) {\n validators.push(new MinValueValidator(this.props.min_value));\n }\n if(this.props.max_value) {\n validators.push(new MaxValueValidator(this.props.max_value));\n }\n\n return run_validators(validators, this.props.value);\n }", "title": "" }, { "docid": "1a4b31911ac7440ac0aa2c59bf25a8f1", "score": "0.6423574", "text": "static validate(items, types) {}", "title": "" }, { "docid": "f7b743f88313c79bd2654bb2cd625cec", "score": "0.6414443", "text": "function formDataValidate() {\r\n\r\n\tvar date_format_regex = /^\\d{4}\\/\\d{2}\\/\\d{2}$/;\r\n\r\n\tif (inputGetter.getBookName == BLANK) {\r\n\t\talert('Chưa nhập tên sách');\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif (inputGetter.getBookTypeId == '0') {\r\n\t\talert('Chưa chọn chủng loại sách');\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif (inputGetter.getAuthorId == '0') {\r\n\t\talert('Chưa chọn tác giả');\r\n\t\treturn false;\r\n\t}\r\n\r\n\r\n\t// check date in format yyyy/MM/dd\r\n\tif (!inputGetter.getPublishDate.match(date_format_regex)) {\r\n\t\talert('Ngày xuất bản không đúng định dạng năm-tháng-ngày (yyyy/MM/dd)');\r\n\t\treturn false;\r\n\t} else {\r\n\t\t//check date valid\r\n\t\tvar publishDate = new Date(inputGetter.getPublishDate);\r\n\t\tif (date.toString() == \"Invalid Date\") {\r\n\t\t\talert('Ngày xuất bản không hợp lệ');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tif (inputGetter.getOriginPrice > inputGetter.getSellPrice) {\r\n\t\talert('Giá bán phải không được thấp hơn giá gốc');\r\n\t\treturn false;\r\n\t}\r\n\r\n\treturn true;\r\n}", "title": "" }, { "docid": "132cfedf83ad548cfda1cbf5e578724c", "score": "0.6406183", "text": "validate(detailName, value) {\n\n switch (detailName) {\n\n case 'name':\n // name must not be blank. setting max length to 75 characters. Prefer to allow nonstandard names (like Q.Dogs) rather than risk a user not being able to enter their actual name. See: http://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/\n return value && value.length <= 75\n\n case 'email':\n //this guy has thought of all of the edge cases - https://hackernoon.com/the-100-correct-way-to-validate-email-addresses-7c4818f24643 https://hackernoon.com/how-to-reduce-incorrect-email-addresses-df3b70cb15a9 .\n //For the sake of learning, let's assume that my contacts will have email addresses that\n //1. are not null (email is required)\n //2. are 100 characters max\n //3. match the sample email validation regex provided by MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email#Validation\n const emailRegex = RegExp(/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/);\n\n return value && value.length <= 100 && emailRegex.test(value);\n\n case 'phoneNumber':\n //Phone number is not required, but if provided, it should take the form of xxx-xxx-xxxx. If I were dealing with non-US numbers, I would expand this to include country code, different formats, etc. This won't catch invalid US numbers (like 111-111-1111), but the format will be correct.\n const phoneNumberRegEx = RegExp(/^([0-9]{3}-[0-9]{3}-[0-9]{4})$/);\n return value === null || phoneNumberRegEx.test(value);\n\n case 'imageUrl':\n // I REALLY wanted to check whether images were broken, but as far as I can tell that requires some async skills I don't have yet. Alas. Will just check that value is of format somestring.someimageextension.\n const imageUrlRegEx = RegExp(/(.)\\.(jpeg|jpg|gif|png|JPEG|JPG|GIF|PNG)$/);\n return value === null || imageUrlRegEx.test(value);\n\n default:\n break;\n }\n }", "title": "" }, { "docid": "5dac0788c7e09156532721b536f8d032", "score": "0.64045626", "text": "function validate() {\r\n\tvalid = true;\r\n\tif (activeCategoryId == '')\t{\r\n\t\talert ('Please select a Category.');\r\n\t\tvalid = false;\r\n\t} else if (activeSubcategoryId == '' && $('#data_point_sublist').css('display') == 'block') {\r\n\t\talert ('Please select a Subcategory.');\r\n\t\tvalid = false;\r\n\t} else if (objEntityForm.isDateRequired == 'Y' && $('#datepicker').val() == '') {\r\n\t\talert ('Please select a Date.');\r\n\t\tvalid = false;\r\n\t} else if ($('#transcription').val() =='') {\r\n\t\talert ('Please insert a Transcription.');\r\n\t\tvalid = false;\r\n\t} else if (objEntityForm.isStatusRequired == 'Y' && $('#statusAlert').val() == '') {\r\n\t\talert ('Please select a Status from the list.');\r\n\t\tvalid = false;\r\n\t}\r\n\telse if (objEntityForm.isDateRequired == 'Y') \r\n\t{\r\n\t\t// For IWS-250 date validation In step 2, Data Date field on the data point entry form\r\n\t\tvar datePicker = $('#datepicker').val();\r\n\t\tif(isNaN(datePicker))\r\n\t\t{\r\n\t\t\tif(checkDateFormat(datePicker))\r\n\t\t\t{\r\n\t\t\t\tvalid = true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn valid;\r\n}", "title": "" }, { "docid": "c9e0122609d09a9022782633b87fea8a", "score": "0.63992596", "text": "validate(value){ //value represents the value given to the email while creatign instance of te model\n if(!validator.isEmail(value)){\n throw new Error('Email is invalid')\n }\n }", "title": "" }, { "docid": "a2e905f2325786a8676f4b28fa0a2805", "score": "0.6372368", "text": "function validate_inputs() {\t\n\tcheck_empty_fields();\n\tcompare_passwords();\n\tvalidate_email();\n}", "title": "" }, { "docid": "7677dde3c2764b1eef8122cfa876ab63", "score": "0.6367633", "text": "validateForm() {\n const validName = this.validateName();\n const validSerialNumber = this.validateSerialNumber();\n\n return validName && validSerialNumber;\n }", "title": "" }, { "docid": "03b811b989b3cfeafd67c95f9c53b04b", "score": "0.63629246", "text": "function validateTrue(nothing){\n return true;\n}", "title": "" }, { "docid": "e0903d5727fe7f8b1191a42baa80488c", "score": "0.63581455", "text": "isValidRecord(){ /** todo */ }", "title": "" }, { "docid": "a48ec7834d112913baad16610d6d3b01", "score": "0.63546103", "text": "function validation(name, value, entityName, model) {\n switch (name) {\n case 'email':\n return (value || '').isEmail();\n case 'price':\n return value.parseFloat() > 0;\n case 'firstname':\n case 'lastname':\n case 'telephone':\n case 'address':\n case 'name':\n return (value || '').length > 0;\n }\n}", "title": "" }, { "docid": "84fbf2a8a33466bbbefd642a6f187b0a", "score": "0.6352498", "text": "validateInput(item,name,min,max) {\nif(item.length==\"\") {\nthis.toast(name+\"is required\");\nreturn false;\n}else if(item.length<min) {\n this.toast(name+\"should be more than\"+min+\"characters\")\n\n return false;\n}else if(item.length>max) {\n this.toast(name+\"should less than\"+max+\"characters\")\n return false;\n}else {\n return item;\n}\n}", "title": "" }, { "docid": "69c30560120b7f546906a3b8495ebc2b", "score": "0.6347611", "text": "validate(fieldName, value, onSuccess, onError) {\r\n // If no validations property, do not validate\r\n if (!this.state.fields) {\r\n return\r\n }\r\n\r\n // We initially set isValid to true and then flip it if we\r\n // run a validator that invalidates the input\r\n let isValid = true\r\n \r\n let field = this.state.fields[fieldName]\r\n\r\n // We only validate if the input has value or if it is required\r\n if ((value || field.required) && typeof field.validations === 'string') {\r\n // We split on comma to iterate the list of validation rules\r\n field.validations.split(',').forEach((validation) => {\r\n\r\n // By splitting on \":\"\" we get an array of arguments that we pass\r\n // to the validator. ex.: isLength:5 -> ['isLength', '5']\r\n let args = validation.split(':')\r\n\r\n // We remove the top item and are left with the method to\r\n // call the validator with ['isLength', '5'] -> 'isLength'\r\n let validateMethod = args.shift()\r\n\r\n // We use JSON.parse to convert the string values passed to the\r\n // correct type. Ex. 'isLength:1' will make '1' actually a number\r\n args = args.map((arg) => { \r\n return JSON.parse(arg) \r\n })\r\n\r\n // We then merge two arrays, ending up with the value\r\n // to pass first, then options, if any. ['valueFromInput', 5]\r\n args = [value].concat(args)\r\n\r\n // So the next line of code is actually:\r\n // validator.isLength('valueFromInput', 5)\r\n if (typeof validator !== 'undefined') {\r\n if (!validator[validateMethod].apply(validator, args)) {\r\n isValid = false\r\n } \r\n }\r\n })\r\n }\r\n \r\n return isValid\r\n }", "title": "" }, { "docid": "52bba3f9fcfed2cdd8d8c5f080d3fa47", "score": "0.63446355", "text": "function validator1() {\n\n return {\n stringValidator: isItAllCap,\n passwordValidator: areThereNum,\n colorValidator: trueColor,\n yearValidator: yearInterval\n };\n\n}", "title": "" }, { "docid": "cdbe755719283e9ae385f6a417712eb7", "score": "0.6310223", "text": "validate() {\n this.checkValidInputs();\n let errorInputs = this.checkSets();\n this.setErrors(errorInputs);\n }", "title": "" }, { "docid": "c972f486bda0faadd5555077525dc026", "score": "0.6273746", "text": "function validBasedOnClass(thisClass) {\r\n\t\t\tvar classBack = \"\";\r\n\t\t\t\r\n\t\t\tswitch(thisClass) {\r\n\t\t\t\tcase \"\":\r\n\t\t\t\tcase \"invalid\":\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"reqd\":\r\n\t\t\t\t\tif (allGood && thisTag.value == \"\") {\r\n\t\t\t\t\t\t\tclassBack = \"invalid \";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tclassBack += thisClass;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"radio\":\r\n\t\t\t\t\tif (allGood && !radioPicked(thisTag.name)) {\r\n\t\t\t\t\t\tclassBack = \"invalid \";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tclassBack += thisClass;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"email\":\r\n\t\t\t\t\tif (allGood && !validEmail(thisTag.value)) {\r\n\t\t\t\t\t\tclassBack = \"invalid \";\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tclassBack += thisClass;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"confirm\":\r\n\t\t\t\t\tif(document.getElementById(\"email\").value != document.getElementById(\"confirmEmail\").value){\r\n\t\t\t\t\t\tclassBack = \"invalid \";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tclassBack += thisClass;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"phone\":\r\n\t\t\t\t\tif (allGood && !validPhone(thisTag.value)){\r\n\t\t\t\t\t\tclassBack = \"invalid \";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tclassBack += thisClass;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tif (allGood && !crossCheck(thisTag,thisClass)) {\r\n\t\t\t\t\t\tclassBack = \"invalid \";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tclassBack += thisClass;\r\n\t\t\t}\r\n\t\t\treturn classBack;\r\n\t\t\t\r\n\t\t\t// function crossCheck takes parameters for current tag being observed as inTag and current class being observed as otherFieldID\r\n\t\t\t// if otherFieldID doesn't exist there's a problem, return false\r\n\t\t\t// finally, boolean var is returned dependent upon whether the values for these parameters match or not\r\n\t\t\tfunction crossCheck(inTag,otherFieldID) {\r\n if (!document.getElementById(otherFieldID)) {\r\n return false;\r\n }\r\n return (inTag.value == document.getElementById(otherFieldID).value);\r\n }\r\n\t\t}", "title": "" }, { "docid": "fc2b3959986b59a3d457f87a171b5d6b", "score": "0.62711847", "text": "validate() {\n Object.entries(TOP_LEVEL_FIELDS).some(([field, { required }]) => {\n if (required && !(field in this.fields))\n throw new Error(`Missing field ${field}`);\n return false;\n });\n\n // authenticationToken && webServiceURL must be either both or none\n if ('webServiceURL' in this.fields) {\n if (!('authenticationToken' in this.fields))\n throw new Error(\n 'While webServiceURL is present, authenticationToken also required!',\n );\n if (this.fields.authenticationToken.length < 16)\n throw new Error(\n 'authenticationToken must be at least 16 characters long!',\n );\n } else if ('authenticationToken' in this.fields)\n throw new Error(\n 'authenticationToken is presented in Pass data while webServiceURL is missing!',\n );\n\n // validate color fields\n // valid values must be like rgb(123, 2, 22)\n Object.keys(TOP_LEVEL_FIELDS)\n .filter(v => v.endsWith('Color'))\n .filter(v => v in this.fields)\n .forEach(colorFieldName => {\n const value = this.fields[colorFieldName];\n try {\n /^rgb\\(\\s*(\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\s*\\)$/\n .exec(value)\n .slice(1)\n .map(v => parseInt(v, 10))\n .some(v => {\n if (isNaN(v) || v < 0 || v > 255)\n throw new Error(`Invalid color value ${value}`);\n return false;\n });\n } catch (e) {\n throw new Error(\n `Color value \"${value}\" for field \"${colorFieldName}\" is invalid, must be an rgb(...)`,\n );\n }\n });\n }", "title": "" }, { "docid": "44142158049a0455dd0f5aec7f2fb08e", "score": "0.6271135", "text": "validate() {\n\n var is = this.is()\n\n if(is.err) return is\n\n var results = [],\n validator = this\n\n /*\n NOTE: rules are type options\n */\n Object.keys(this.options).forEach( (rule) => {\n\n let result = validator[rule](validator.options[rule])\n\n if(result.err) {\n result.err.ruleKey = rule\n results.push(result.err)\n }\n\n })\n\n if(results.length == 0) {\n return {valid: true}\n }\n\n return {\n err: results\n }\n\n }", "title": "" }, { "docid": "77701d81cab965fa04ae056fc340121e", "score": "0.62684166", "text": "function iecMinimalValidaion(){\r\n\tvar response = true;\r\n\tvar error = \"\";\r\n\tvar category_classname = \"\";\r\n\tvar errorPartA = \"\";\r\n\tvar errorPartB = \"\";\r\n\tvar errorPartC1_C5 = \"\";\r\n\tvar phoneRegex = /[0-9 -()+]+$/;\r\n\tvar emailRegex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,6}$/;\r\n\tif($(\"#entity_name\").val() == \"\"){\r\n\t\terrorPartA += \"Entity name cannot be empty\"+'<br/>';\r\n\t\tresponse = false;\r\n\t}\r\n\tif($(\"#entity_telephone\").val() != \"\" ){\r\n\t\tif(($(\"#entity_telephone\").val().length < 6) || (!phoneRegex.test($(\"#entity_telephone\").val()))){\r\n\t\t\terrorPartA += \"Please enter valid landline number\"+'<br/>';\r\n\t\t\tresponse = false;\r\n\t\t}\r\n\t}\r\n\tif($(\"#entity_mobile1\").val() != \"\" ){\r\n\t\tif(($(\"#entity_mobile1\").val().length < 6) || (!phoneRegex.test($(\"#entity_mobile1\").val()))){\r\n\t\t\terrorPartA += \"Please enter valid primary mobile number\"+'<br/>';\r\n\t\t\tresponse = false;\r\n\t\t}\r\n\t}\r\n\tif($(\"#entity_mobile2\").val() != \"\" ){\r\n\t\tif(($(\"#entity_mobile2\").val().length < 6) || (!phoneRegex.test($(\"#entity_mobile2\").val()))){\r\n\t\t\terrorPartA += \"Please enter valid other mobile number\"+'<br/>';\r\n\t\t\tresponse = false;\r\n\t\t}\r\n\t}\r\n\tif($(\"#entity_email1\").val() != \"\" ){\r\n\t\tif(!emailRegex.test($(\"#entity_email1\").val())){\r\n\t\t\terrorPartA += \"Please enter valid primary email address\"+'<br/>';\r\n\t\t\tresponse = false;\r\n\t\t}\r\n\t}\r\n\tif($(\"#entity_email2\").val() != \"\" ){\r\n\t\tif(!emailRegex.test($(\"#entity_email2\").val())){\r\n\t\t\terrorPartA += \"Please enter valid alternate email address\"+'<br/>';\r\n\t\t\tresponse = false;\r\n\t\t}\r\n\t}\r\n\tif($(\"#entity_fax\").val() != \"\" ){\r\n\t\tif(!phoneRegex.test($(\"#entity_fax\").val())){\r\n\t\t\terrorPartA += \"Please enter valid FAX number\"+'<br/>';\r\n\t\t\tresponse = false;\r\n\t\t}\r\n\t}\r\n\tif (!$('input[name=\"entity[category]\"]:checked').val()) {\r\n\t\terrorPartA += \"Please select the nature of concern/entity\"+'<br/>';\r\n\t\tresponse = false;\r\n\t}\r\n\tif($(\"#branch_total\").val() != '') {\r\n\t\tif(!$.isNumeric($(\"#branch_total\").val())){\r\n\t\t\terrorPartB += \"Please enter valid number for total branches\"+'<br/>';\r\n\t\t\tresponse = false;\r\n\t\t}\r\n\t\t\r\n\t}\r\n\tif(response){\r\n\t\t$('#error_message').hide();\r\n\t\t/*\r\n\t\tbootbox.confirm(\"Are you sure you want only to SAVE this form?\",'No','Yes',function(result) {\r\n\t\t if (result) {\r\n\t\t \talert('hai');\r\n\t\t \treturn true;\r\n\t\t } \r\n\t\t});*/\r\n\t\treturn true;\r\n\t}else{\r\n\t\tvar show_target = $(\"#error_message\").offset().top;\r\n\t\tbootbox.alert(\"Form validaion failed, kindly check the error message before proceeding.\",function() {\r\n\t\t\t$(\"html, body\").animate({ scrollTop: 100 }, \"slow\");\r\n\t\t});\r\n\t\tif(errorPartA){\r\n\t\t\terror += \"<b>Part A:</b><br/>\"+errorPartA+\"<br/>\";\r\n\t\t}\r\n\t\tif(errorPartB){\r\n\t\t\terror += \"<b>Part B:</b><br/>\"+errorPartB+\"<br/>\";\r\n\t\t}\r\n\t\tif(errorPartC1_C5){\r\n\t\t\terror += errorPartC1_C5;\r\n\t\t}\r\n\t\t//$(\"#error_message\").attr('class', 'alert alert-error');\r\n\t\t$('#error_message').show();\r\n\t\t$(\"#error_message\").html(error);\r\n\t\treturn false;\r\n\t}\r\n}", "title": "" }, { "docid": "de90c2d9407d76d91d0fb84bb20dde07", "score": "0.6262441", "text": "function MSJT_validate_field(el_input, fldName) {\n //console.log(\" ----- MSJT_validate_field ----\")\n //console.log(\"fldName\", fldName)\n let msg_err = null;\n if (el_input){\n const value = el_input.value;\n //console.log(\"value\", value)\n if ([\"code\", \"name\"].includes(fldName)) {\n const caption = (fldName === \"code\") ? loc.Abbreviation : loc.Name;\n const max_length = (fldName === \"code\") ? 8 : 50;\n if (!value) {\n msg_err = caption + loc.cannot_be_blank;\n } else if (value.length > max_length) {\n msg_err = caption + ( (fldName === \"code\") ? loc.is_too_long_MAX10 : loc.is_too_long_MAX50 );\n }\n } else if([\"sequence\"].includes(fldName)){\n if (!value) {\n msg_err = loc.Sequence + loc.cannot_be_blank;\n } else {\n const arr = b_get_number_from_input(loc, fldName, el_input.value);\n msg_err = arr[1];\n }\n }\n }\n return msg_err;\n } // MSJT_validate_field", "title": "" }, { "docid": "301e47651327f9fe041713ddf9ce9366", "score": "0.6260221", "text": "handleValidation() {\n const { siteConstants } = this.props.language;\n\n let fields = this.state.user;\n // let errors = {};\n let formIsValid = true;\n\n //Name\n if (\n fields.firstname == \"\" ||\n fields.lastname == \"\" ||\n fields.mobile_number == \"\"\n ) {\n formIsValid = false;\n if (fields.firstname == \"\") {\n this.setState({\n errors: { firstname: siteConstants.ERR_CAN_NOT_BLANK }\n });\n }\n if (fields.lastname == \"\") {\n this.setState({\n errors: { lastname: siteConstants.ERR_CAN_NOT_BLANK }\n });\n }\n\n if (fields.mobile_number == \"\") {\n this.setState({ errors: { contact: siteConstants.ERR_CAN_NOT_BLANK } });\n }\n }\n\n if (fields.firstname !== \"\" && fields.firstname !== undefined) {\n if (fields.firstname.match(/^[a-zA-Z]+$/) === null) {\n formIsValid = false;\n this.setState({\n errors: { firstname: siteConstants.ERR_ONLY_LETTERS }\n });\n }\n }\n\n if (fields.lastname !== \"\" && fields.lastname !== undefined) {\n if (fields.lastname.match(/^[a-zA-Z]+$/) === null) {\n formIsValid = false;\n this.setState({ errors: { lastname: siteConstants.ERR_ONLY_LETTERS } });\n }\n }\n\n if (fields.mobile_number !== \"\" && fields.mobile_number !== undefined) {\n if (String(fields.mobile_number).match(/^[0-9]*$/) === null) {\n formIsValid = false;\n this.setState({ errors: { contact: siteConstants.ERR_ONLY_NUMBERS } });\n }\n }\n\n return formIsValid;\n }", "title": "" }, { "docid": "bb3197470d0302ddbc693d336d87aae2", "score": "0.6245587", "text": "function valid(){\n if (!$scope.account.Attributes)$scope.account.Attributes = [];\n var attrValidation = [];\n\n for(var i = 0 ; i < 12; i++) {\n $scope['attrVldn_' + i] = [];\n }\n\n for(var i = 0 ; i < $scope.account.Attributes.length; i++) {\n $scope['attrVldn_' + i] = validationClass($scope.account.Attributes[i].Name, false);\n attrValidation = attrValidation.concat($scope['attrVldn_' + i]);\n }\n $scope.nameVldn = $scope.usernameVldn = [];\n $scope.nameVldn = validationClass($scope.account.DisplayName, false);\n $scope.usernameVldn = validationClass($scope.account.Username, false);\n return !$scope.nameVldn.concat($scope.usernameVldn).concat(attrValidation).includes('invalid');\n }", "title": "" }, { "docid": "3cfafde72df76463e1dd367377d104e8", "score": "0.6243738", "text": "function validate(data)\r\n {\r\n if(data.length > 0){return true;}else{return false;}\r\n }", "title": "" }, { "docid": "37702a082c0773ccbf5ea97e4e33bd38", "score": "0.6236657", "text": "validate () {\n const { required, minLength, maxLength, value } = this.props\n let isValid = !(required || minLength)\n let errorText = ''\n if (required) {\n isValid = !validator.isEmpty(value)\n errorText = isValid ? '' : ERROR_TXT.REQUIRED\n }\n // Check also for validity in the next validations\n // Prevents from passing validation if a previous condition decided it was invalid\n if (isValid) {\n if (minLength) {\n isValid = validator.isLength(String(value), { min: minLength })\n errorText =\n errorText || `El campo debe contener al menos ${minLength} caracteres`\n }\n if (maxLength) {\n isValid = validator.isLength(String(value), { max: maxLength })\n errorText =\n errorText || `El campo debe contener máximo ${maxLength} caracteres`\n }\n }\n this.setState({ isValid, errorText })\n return isValid\n }", "title": "" }, { "docid": "e0d27207f8594a93ad2d9aa6df8e865f", "score": "0.62342066", "text": "function validateMandatoryFields(){\n\n\terrMsg = new Array();\n\terrCount=0;\n\n\t//Colocar en el estado inicial al campo resaltado\n\tresetFields(field);\n\tfirstErr=null;\n\n\t//Llamado a las funciones de validacion de los campos\n\tvalidate_treatment();\t\n\tvalidate_name();\t\n\tvalidate_lastname();\t\t\n\tvalidate_company_nm();\t\n\tvalidate_cli_e_mail();\t\n\tvalidate_cli_country_cd();\t\n\tvalidate_cli_address();\t\n\tvalidate_cli_postal_cd();\t\n\tvalidate_cli_ident_num();\n\tvalidate_user_login();\t\n\tvalidate_user_pass();\n\tvalidate_conf_user_pass();\n\t\n\t\n\n\tif(errCount>0){\n\t\tfor(i=0;i<1;i++){\n\t\talert(errMsg[i]);\n\t }\n\t\t\n\t\tfield=firstErr.id;\n\t\t//Resaltar el primer campo donde existe un error\n\t\tdocument.getElementById('title_'+firstErr.id+'_underline').style.display='block';\n\t\tdocument.getElementById('label_'+firstErr.id+'_underline').style.background='#FFFFCC';\n\t\tdocument.getElementById('input_'+firstErr.id+'_underline').style.background='#FFFFCC';\n\n\t\t//Fijar el foco en el campo en el que se presenta el primer error\n\t\tfirstErr.focus();\n\t\tdocument.getElementById('title_'+firstErr.id+'_underline').scrollIntoView(true);\n\n\t\t//Mostrar la nota al pie aclarando el mensaje de error\n\t\tdocument.getElementById('notaerror').style.display='inline';\n\n\n\t}else{\n\n\t\tdocument.forma.submit();\n\t}\n\n\n}", "title": "" }, { "docid": "f404f8c89c88cac546993d8d5bbb4daa", "score": "0.62325394", "text": "function validations() {\n let layersModel = learningSystem.machineLearningLibrary.typeOfLearning.typeOfModel.model.api.layersModel;\n if (layersModel === undefined) {\n requiredErr(\">layers model<\");\n }\n\n // Model Structure Validations:\n if (layersModel.inputLayer === undefined) {\n requiredErr(\">input layer<\");\n }\n if (layersModel.outputLayer === undefined) {\n requiredErr(\">output layer<\");\n }\n if (layersModel.inputLayer.inputFeatures === undefined) {\n requiredErr(\">input features<\");\n }\n if (layersModel.outputLayer.outputLabels === undefined) {\n requiredErr(\">output labels<\");\n }\n if (layersModel.inputLayer.inputFeatures.dataFeatures.length === 0) {\n requiredErr(\">input data features<\");\n }\n if (layersModel.outputLayer.outputLabels.dataLabels.length === 0) {\n requiredErr(\">output data labels<\");\n }\n if (layersModel.layers.length === 0) {\n requiredErr(\">Could not find any layers<\");\n }\n if (layersModel.inputLayer.referenceParent === undefined) {\n requiredErr(\">input layer missing reference parent<\");\n }\n\n // Model Compiler Validations:\n if (learningSystem.machineLearningLibrary.typeOfLearning.typeOfModel.model.compile === undefined) {\n requiredErr(\">compile node<\");\n }\n if (learningSystem.machineLearningLibrary.typeOfLearning.typeOfModel.model.compile.lossFunction === undefined) {\n requiredErr(\">loss function<\");\n }\n if (learningSystem.machineLearningLibrary.typeOfLearning.typeOfModel.model.compile.lossFunction.config.value === undefined) {\n requiredErr(\">loss function value<\");\n }\n if (learningSystem.machineLearningLibrary.typeOfLearning.typeOfModel.model.compile.optimizer === undefined) {\n requiredErr(\">optimizer node<\");\n }\n if (learningSystem.machineLearningLibrary.typeOfLearning.typeOfModel.model.compile.optimizer.optimizerType === undefined) {\n requiredErr(\">optimizer type node<\");\n }\n\n //* Feature Validations: */\n \n // Data Features must be Uniquely Named:\n /*let duplicates = () => {\n let names = [];\n layersModel.inputLayer.inputFeatures.dataFeatures.forEach(e => names.push(e.name));\n return names;\n };\n if (layersModel.inputLayer.inputFeatures.dataFeatures.length !==\n new Set(duplicates()).size) {\n requiredErr(\">All Data Feature nodes must be uniquely named<\");\n }*/\n }", "title": "" }, { "docid": "82c3d275b7a1f704a86e6364f515fa40", "score": "0.621718", "text": "isValid(force, callValidation = true) {\r\n let ok = true;\r\n let elems = this.findAll('.bbn-input-component');\r\n if (Array.isArray(elems)) {\r\n bbn.fn.each(elems, a => {\r\n if ((bbn.fn.isFunction(a.isValid) && !a.isValid(a, callValidation))\r\n || (bbn.fn.isFunction(a.validation) && !a.validation())\r\n ) {\r\n ok = false;\r\n }\r\n if ( !ok ){\r\n return false;\r\n }\r\n });\r\n }\r\n if (ok && this.validation && callValidation) {\r\n ok = this.validation(this.source, this.originalData, force)\r\n }\r\n return !!ok;\r\n }", "title": "" }, { "docid": "4046e5a6e5b0433e232431f53dfd0204", "score": "0.6208849", "text": "validfields(f1,f2){\n //if they are full its time for next validation\n if(f1 !== '' && f2 !== ''){\n //if url is valid its time for name length\n if(f2.search('.com') !== -1){\n if(f1.length < 16){\n //everything is good so book should be added\n return 'done';\n }\n //if intered info unvalid we should tell user what is wronge\n else{\n alert('name must be shorter');\n }\n }\n else{\n alert('(.com) in url is missing');\n }\n }\n else{\n alert('please fill the fields');\n }\n }", "title": "" }, { "docid": "f52d592f93fb277e7c1059ddde44f151", "score": "0.6208147", "text": "handleValidation(){\n let fields = this.state.fields;\n let errors = {};\n let formIsValid = true;\n \n //Name\n if(!fields[\"name\"]){\n formIsValid = false;\n errors[\"name\"] = \"*Name is required\";\n }\n \n \n \n //Email\n if(!fields[\"email\"]){\n formIsValid = false;\n errors[\"email\"] = \"*Email is Required\";\n }\n \n if(typeof fields[\"email\"] !== \"undefined\"){\n let lastAtPos = fields[\"email\"].lastIndexOf('@');\n let lastDotPos = fields[\"email\"].lastIndexOf('.');\n \n if (!(lastAtPos < lastDotPos && lastAtPos > 0 && fields[\"email\"].indexOf('@@') === -1 && lastDotPos > 2 && (fields[\"email\"].length - lastDotPos) > 2)) {\n formIsValid = false;\n errors[\"email\"] = \"Email is not valid\";\n }\n } \n \n \n if(!fields[\"verifyno\"]){\n formIsValid = false;\n errors[\"verifyno\"] = \"*Verify Code Required\";\n } \n if(typeof fields[\"verifyno\"] !== \"undefined\"){\n if(!fields[\"verifyno\"].match(/^[0-9]+$/)){\n formIsValid = false;\n errors[\"verifyno\"] = \"Only Digits Allow\";\n } \n }\n\n \n\n \n if(!fields[\"password\"]){\n formIsValid = false;\n errors[\"password\"] = \"*Password Is Required\";\n } \n \n if(!fields[\"cpassword\"]){\n formIsValid = false;\n errors[\"cpassword\"] = \"*Conform Password Is Required\";\n } \n \n this.setState({errors: errors});\n return formIsValid;\n }", "title": "" }, { "docid": "50993bdbddb2e8e0cc6e6780a6c766e0", "score": "0.62042546", "text": "function FValidation( obj, property, value, options ){\n\n}", "title": "" }, { "docid": "ebc0c78510c24fd29e7d389783d872a1", "score": "0.62036854", "text": "function validateInfo(){\r\n\tvalidateEmail();\r\n\tvalidatePhone();\r\n\tvalidateAddress();\r\n\tvalidateDate();\r\n\tvalidateTime();\r\n\t\r\n\treturn false;\r\n}\t// End validateInfo", "title": "" }, { "docid": "58147b22f63f20d8d4167cb73fc12d6c", "score": "0.6194574", "text": "function validate(data, model, toCheck){\n\n\t\t\tvar errors = {}; \n\t\t\tvar hasErrors = false; \n\t\t\tvar thisModel = models[model];\n\n\t\t\ttoCheck.forEach(function(field){\n\t\t\t\tvar formattedData = thisModel[field].format(data[field]);\n\t\t\t\tif (!thisModel[field].regex.test(formattedData)) {\n\t\t\t\t\terrors[field] = thisModel[field].errMessage; \n\t\t\t\t\thasErrors = true; \n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif (hasErrors) return errors;\n\t\t\telse return null; \n\t\t}", "title": "" }, { "docid": "06a56ec8a4bc33897c9cd55f3a852ca3", "score": "0.6192889", "text": "function formValidation()\r\n{\r\n// Declaring form elements from line5 to line14\r\nvar uid = document.registration.userid;\r\nvar passid = document.registration.passid;\r\nvar uname = document.registration.username;\r\nvar uadd = document.registration.address;\r\nvar ucountry = document.registration.country;\r\nvar uzip = document.registration.zip;\r\nvar uemail = document.registration.email;\r\nvar umsex = document.registration.msex;\r\nvar ufsex = document.registration.fsex; \r\n\r\n// calling respective validation method for each element\r\nif(userid_validation(uid,5,12))\r\n{\r\nif(passid_validation(passid,7,12))\r\n{\r\nif(allLetter(uname))\r\n{\r\nif(alphanumeric(uadd))\r\n{ \r\nif(countryselect(ucountry))\r\n{\r\nif(allnumeric(uzip))\r\n{\r\nif(ValidateEmail(uemail))\r\n{\r\nif(validsex(umsex,ufsex))\r\n{\r\n}\r\n} \r\n}\r\n} \r\n}\r\n}\r\n}\r\n}\r\nreturn false;\r\n\r\n//Defining userid validation method using three parameters\r\n}", "title": "" }, { "docid": "510e4355926f39a3b5312f1a32b9f4eb", "score": "0.61901623", "text": "_validateField(name, value, schemaField) {\n\n schemaField._validateSchemaField.call(this, value, schemaField);\n\n //additional validation\n if (typeof schemaField.validation === \"function\")\n if (!schemaField.validation.call(this, value, name, schemaField))\n throw new Exception(\"Additional Validation was not passed\", {name});\n\n return true;\n }", "title": "" }, { "docid": "cc757349ee88cc4260e8b2ef3e0f2d8d", "score": "0.6189634", "text": "_validateProjectType(projectTypeValue){\n\n let isValid;\n\n // Validate for Empty Field\n this._isProjectTypeValid = isValid = this._validateForEmptyField(projectTypeValue);\n\n return isValid\n\n }", "title": "" }, { "docid": "0be67132b48e598a48ee2947fe11a264", "score": "0.61877275", "text": "getValidationState(key) {\n var input = this.state[key];\n if (!input) return null;\n if (key === 'phone') {\n var phone_num = /^\\+(\\d+)\\d{10}/.exec(input);\n var all_num = /^(\\d{10})$/.exec(input);\n if (phone_num || all_num) return 'success';\n else return 'error';\n }\n if (key === 'email') {\n return (emailRegex.test(input) ? 'success' : 'error');\n }\n if (key === 'name') return (/^[A-Za-z\\s]+$/.test(input) ? 'success' : 'error');\n }", "title": "" }, { "docid": "c2b42109a5425a5496148e95dc496b2d", "score": "0.6185785", "text": "function ValidationHelper() {\n var SectionIDs = new Array();\n var CurrentValidationSectionID;\n var _excludedIDsInCurrentSection = [];\n\n this.AddSectionID = function(sectionId) {\n SectionIDs.push(sectionId);\n };\n\n this.SetCurrentValidationSectionID = function(sectionId, excludedControlIDs) {\n CurrentValidationSectionID = sectionId;\n\n if (excludedControlIDs) {\n _excludedIDsInCurrentSection = excludedControlIDs;\n } else {\n _excludedIDsInCurrentSection = [];\n }\n };\n\n this.IsNeedValidate = function(controlId) {\n if (SectionIDs.length == 0) {\n return true;\n }\n\n // Always vlidate the field if user input a invalid value and left it.\n var e = getEvent();\n\n if (e != null) {\n if (e.type == \"blur\") {\n return true;\n }\n }\n\n if (CurrentValidationSectionID == null || CurrentValidationSectionID == '')//don't need to validate the field in editor form\n {\n if (_excludedIDsInCurrentSection.contains(controlId)) {\n return false;\n }\n\n for (var i = 0; i < SectionIDs.length; i++) {\n if (controlId.indexOf(SectionIDs[i]) > -1) {\n return false;\n }\n }\n\n return true;\n } else// validate the fields of section which indicated by \"CurrentValidationSectionID\"\n {\n var isInCurrentSection = controlId.indexOf(CurrentValidationSectionID) > -1;\n var isExcludedControl = _excludedIDsInCurrentSection.contains(controlId);\n\n return isInCurrentSection && !isExcludedControl;\n }\n };\n}", "title": "" }, { "docid": "81b2535f138d08ee96392e180638428b", "score": "0.6183326", "text": "function validateForm()\n{\n \n return(validateTaskName() && \n validateStatus() && \n validateAssignee() && \n validateDueDate() && \n validateDescriptionBox());\n }", "title": "" }, { "docid": "5b1fdb85d195b0d1e5cf6078d34aa32e", "score": "0.6182998", "text": "_validate(input) {\n const {name, email, suggestion} = input\n let isValid = true\n\n if (name && name.trim()) {\n this.setState({\n invalidName: false\n })\n } else {\n isValid = false\n this.setState({\n invalidName: true\n })\n }\n\n if (suggestion && suggestion.trim()) {\n this.setState({\n invalidSuggestion: false\n })\n } else {\n isValid = false\n this.setState({\n invalidSuggestion: true\n })\n }\n\n if (validateEmail(email)) {\n this.setState({\n invalidEmail: false\n })\n } else {\n isValid = false\n this.setState({\n invalidEmail: true\n })\n }\n\n return isValid\n\n function validateEmail(email) {\n const re = /^\\w+@[a-zA-Z_]+?\\.[a-zA-Z]{2,3}$/\n return re.test(email)\n }\n }", "title": "" }, { "docid": "01f01030aff646197d8cdd87d762ffaa", "score": "0.6178051", "text": "function Section_Validate_Variable____________________________________________(){}", "title": "" }, { "docid": "01f01030aff646197d8cdd87d762ffaa", "score": "0.6178051", "text": "function Section_Validate_Variable____________________________________________(){}", "title": "" }, { "docid": "1d10982b36234b86eddd8bda4734d7d9", "score": "0.61778975", "text": "validateRequest(req, res, next) {\n let isValid = true;\n \n req.body.email ? isValid = validateEmail(req.body.email) : isValid = false;\n req.body.cnpj ? isValid = validateCNPJ(req.body.cnpj) : isValid = false;\n if (!req.body.slug) isValid = false;\n if (!req.body.razao_social) isValid = false;\n \n if (isValid) {\n next()\n }\n else {\n return responses.failure(res, 'ERROR: body invalid');\n }\n }", "title": "" }, { "docid": "8c0c8269ace8ffd3b37efe42a5598eb6", "score": "0.6172024", "text": "function testValidateAux(){\n //Cases to be tested\n const cases = [\n {input:{name:{value:\"\",type:\"\"}, gender:{value:\"\",type:\"\"}, email:{value:\"\",type:\"email\"}, iseasy:{value:\"\",type:\"\"}},\n output:{name:false, gender:false, email:false, iseasy:false}},\n {input:{name:{value:\" \",type:\"\"}, gender:{value:\" \",type:\"\"}, email:{value:\" \",type:\"email\"}, iseasy:{value:\" \",type:\"\"}},\n output:{name:false, gender:false, email:false, iseasy:false}},\n {input:{name:{value:\"Vin\",type:\"\"}, gender:{value:\"Male\",type:\"\"}, email:{value:\"vin@vin\",type:\"email\"}, iseasy:{value:\"true\",type:\"\"}},\n output:{name:true, gender:true, email:false, iseasy:true}},\n {input:{name:{value:\"Bob\",type:\"\"}, gender:{value:\"Male\",type:\"\"}, email:{value:\"bobby@.com\",type:\"email\"}, iseasy:{value:\" \",type:\"\"}},\n output:{name:true, gender:true, email:false, iseasy:false}},\n {input:{name:{value:\"Vin Ndokaj\",type:\"\"}, gender:{value:\"Male\",type:\"\"}, email:{value:\"@.com\",type:\"email\"}, iseasy:{value:\"true\",type:\"\"}},\n output:{name:true, gender:true, email:false, iseasy:true}},\n {input:{name:{value:\"Haidar\",type:\"\"}, gender:{value:\"Male\",type:\"\"}, email:{value:\"haidar@e.e\",type:\"email\"}, iseasy:{value:\"false\",type:\"\"}},\n output:{name:true, gender:true, email:false, iseasy:true}},\n {input:{name:{value:\"Isabella\",type:\"\"}, gender:{value:\"Female\",type:\"\"}, email:{value:\"iz@.edu\",type:\"email\"}, iseasy:{value:\"true\",type:\"\"}},\n output:{name:true, gender:true, email:false, iseasy:true}},\n {input:{name:{value:\"Tyna\",type:\"\"}, gender:{value:\"Female\",type:\"\"}, email:{value:\"bpl@bpl.e\",type:\"email\"}, iseasy:{value:\"\",type:\"\"}},\n output:{name:true, gender:true, email:false, iseasy:false}},\n {input:{name:{value:\"Ronnie Coleman\",type:\"\"}, gender:{value:\"Male\",type:\"\"}, email:{value:\"yeah@buddy.com\",type:\"email\"}, iseasy:{value:\"true\",type:\"\"}},\n output:{name:true, gender:true, email:true, iseasy:true}},\n ]\n\n //goes through test cases and checks for correct output\n console.log(\"Test cases:\");\n var i;\n for(i = 0; i < cases.length; i++){\n if(\n validateAux(cases[i].input.name) != cases[i].output.name ||\n validateAux(cases[i].input.gender) != cases[i].output.gender ||\n validateAux(cases[i].input.email) != cases[i].output.email ||\n validateAux(cases[i].input.iseasy) != cases[i].output.iseasy\n ) {console.log(\"Case \" + i + \" failed.\");}\n else {console.log(\"Case \" + i + \" passed.\");}\n }\n} //end testValidateAux", "title": "" }, { "docid": "b1a120df8bb171fd93debf6c38069c31", "score": "0.61719114", "text": "validate() {\n return true;\n }", "title": "" }, { "docid": "36ee8b4656fba75bdc28b2dc7782ca5d", "score": "0.61716396", "text": "validate(method=\"all\") {\n if(method != \"all\" && method != \"touched\") {\n throw \"Unknown validation method \" + method;\n }\n\n // convinence func to check method before showing\n const methodShow = (input, name, message) => {\n // check method for showing the error message\n if(method == \"all\" || (method == \"touched\" \n && $(input).data(\"touched\") === \"true\")) {\n this.show(name, message);\n }\n }\n \n var isValid = true;\n // check if required fields have content\n $(\"[required]\").each((_, input) => {\n // .trim() to ignore whitespace\n if($(input).val().trim().length <= 0) {\n const name = $(input).attr(\"name\");\n methodShow(input, name, name + \" is required\");\n isValid = false;\n }\n });\n\n // check if passwords match\n const password = $(\"#student-password\").val();\n const confirmPassword = $(\"#student-confirm-password\").val();\n if(password.length > 1 && password !== confirmPassword)\n {\n methodShow($(\"#student-password\").get(0),\n \"password\", \"Passwords do not match\");\n isValid = false;\n }\n\n // check if mentor selected is valid\n if(this.extractMentor() == null) {\n methodShow($(\"#student-mentor\").get(0),\n \"mentorId\", \"Name a single lecturer to be your mentor\");\n isValid = false;\n }\n\n // check if skillsets selected are valid\n // only if any skillsets has been added\n const skillsets = this.extractSkillsets();\n if(skillsets == null && $(\"#student-skillsets\").data(\"touched\") == \"true\") {\n this.show(\"skillSets\", \"Please select skillsets only the provided skillsets\");\n isValid = false;\n }\n \n // check if the photo selected is valid \n // (ie is it actually a photo)\n const file = this.extractPhoto();\n if(file != null && /^image\\/[a-zA-Z]+$/.test(file.type) == false) {\n methodShow($(\"#student-photo\").get(0),\n \"picture\", \"Please select a image file\");\n }\n\n\n if(isValid === false) this.scrollFirstShown();\n\n return isValid;\n }", "title": "" }, { "docid": "20bc4771e43bfac9d6d4e66c96a0c07a", "score": "0.61700076", "text": "function validate() {\n if (name === null) {\n alert(\"Enter the name please\");\n return false;\n }\n if (className === null) {\n alert(\"Enter class name please\");\n return false;\n }\n if (location === null) {\n alert(\"Enter location please\");\n return false;\n }\n if (edu === null) {\n alert(\"Enter the Education Buddy please\");\n return false;\n }\n if (pd === null) {\n alert(\"Enter the personal development buddy\");\n return false;\n }\n if (gitHub === null) {\n alert(\"Enter github id please\");\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "20bc4771e43bfac9d6d4e66c96a0c07a", "score": "0.61700076", "text": "function validate() {\n if (name === null) {\n alert(\"Enter the name please\");\n return false;\n }\n if (className === null) {\n alert(\"Enter class name please\");\n return false;\n }\n if (location === null) {\n alert(\"Enter location please\");\n return false;\n }\n if (edu === null) {\n alert(\"Enter the Education Buddy please\");\n return false;\n }\n if (pd === null) {\n alert(\"Enter the personal development buddy\");\n return false;\n }\n if (gitHub === null) {\n alert(\"Enter github id please\");\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "9203ce10bdd04cfb3bdf34f864658344", "score": "0.61684406", "text": "checkInput() {\n // Check if `libccurl` is available\n if (!this.libccurl.hasOwnProperty('ccurl_pow')) {\n return new Error('Hashing not available');\n }\n\n // Check if valid `trunkTransaction` was passed\n if (!this.iota.valid.isHash(this.trunkTransaction)) {\n return new Error('Invalid trunkTransaction');\n }\n\n // Check if valid `branchTransaction` was passed\n if (!this.iota.valid.isHash(this.branchTransaction)) {\n return new Error('Invalid branchTransaction');\n }\n\n // Check if a valid `minWeightMagnitude` was passed\n if (!this.iota.valid.isValue(this.minWeightMagnitude)) {\n return new Error('Invalid minWeightMagnitude');\n }\n\n // Check if the passed trytes are valid\n if (!this.iota.valid.isArrayOfTrytes(this.trytes)) {\n return new Error('Invalid trytes supplied');\n }\n }", "title": "" }, { "docid": "54549765102022c44eb1066427f02889", "score": "0.6163745", "text": "function MSUBJ_validate_field(el_input, fldName) {\n //console.log(\" ----- MSUBJ_validate_field ----\")\n //console.log(\"fldName\", fldName)\n let msg_err = null;\n if (el_input){\n const value = el_input.value;\n //console.log(\"value\", value)\n if ([\"code\", \"name_nl\", \"name_en\", \"name_pa\"].includes(fldName)) {\n const caption = (fldName === \"code\") ? loc.Abbreviation : loc.Name;\n const max_length = (fldName === \"code\") ? 8 : 50;\n // \"name_en\" and \"name_pa\" can be blank\n if (!value && [\"code\", \"name_nl\"].includes(fldName)) {\n msg_err = caption + loc.cannot_be_blank;\n } else if (value.length > max_length) {\n msg_err = caption + ( (fldName === \"code\") ? loc.is_too_long_MAX10 : loc.is_too_long_MAX50 );\n };\n } else if([\"sequence\"].includes(fldName)){\n if (!value) {\n msg_err = loc.Sequence + loc.cannot_be_blank;\n } else {\n const arr = b_get_number_from_input(loc, fldName, el_input.value);\n msg_err = arr[1];\n };\n };\n };\n return msg_err;\n }", "title": "" }, { "docid": "60cdf49fd6f978c0f93a3f3be97444ae", "score": "0.6161838", "text": "function validated() {\n if (username.value.length < 1) {\n username.styleborder = \"1px solid red\";\n name_err.style.display = \"block\";\n username.focus();\n return false;\n }\n if (email.value.length < 9) {\n email.styleborder = \"1px solid red\";\n email_err.style.display = \"block\";\n email.focus();\n return false;\n }\n if (password.value.length < 9) {\n password.styleborder = \"1px solid red\";\n password_err.style.display = \"block\";\n password.focus();\n return false;\n }\n}", "title": "" }, { "docid": "257d0e5fa4fd43d29ad5c40a67a9d330", "score": "0.61411536", "text": "function makeValid(field) {\n var errorMessage;\n //update styling on the valid element\n field.attr('aria-invalid', 'false');\n //check if multi field row\n if (field.parent().hasClass('multiInput')) {\n //check that the other field in row is not invalid (include each type in selector)\n if (($('input, fieldset, select', field.parent().siblings()).attr('aria-invalid')) === 'false') {\n field.closest('.formRow').removeClass('mfHighlightError');\n }\n } else {\n field.closest('.formRow').removeClass('mfHighlightError');\n //also remove styling to acceptance text\n if (field.data('extvaltype') === 'terms') {\n field.parent().removeClass('mfHighlightError');\n }\n if ((field.data('extvaltype') === 'checkbox') || (field.data('extvaltype') === 'radio') || (field.data('extvaltype') === 'dob')) {\n errorMessage = $('div[aria-describedby=\"' + field.data('extvalname') + '-label\"]');\n } else {\n errorMessage = $('div[aria-describedby=\"' + field.attr('id') + '-label\"]');\n }\n errorMessage.hide();\n }\n }", "title": "" }, { "docid": "299a6e0d96e1780e0b2f6715004a9ce9", "score": "0.6134056", "text": "async beforeValidate () {}", "title": "" }, { "docid": "299a6e0d96e1780e0b2f6715004a9ce9", "score": "0.6134056", "text": "async beforeValidate () {}", "title": "" }, { "docid": "299a6e0d96e1780e0b2f6715004a9ce9", "score": "0.6134056", "text": "async beforeValidate () {}", "title": "" }, { "docid": "62bc40d0e82cb6b4f39b3a56e5de9cf6", "score": "0.6130443", "text": "function nkc_validate_fields(input){\n //input is an object of fields awaiting validation.\n for(i in nkc_validate_rules){\n if(input[i]!==undefined&&input[i]!==null) //if field exists\n if(nkc_validate_rules[i].test(input[i])==false)\n throw i.toString() +' not in correct format';\n }\n return true;\n}", "title": "" }, { "docid": "5ac8c9253b1a11fe26d41c2ee02c99ba", "score": "0.6124356", "text": "function insert_validation(item) {\r\n }", "title": "" }, { "docid": "ea63178bdf44ae683ffe72e50493fc24", "score": "0.6123359", "text": "function validateForm(){\n //validate first name at least 2 letters long\n if(firstName.value.length < 2){\n firstName.classList.add(\"error\");\n firstName.setAttribute(\"placeholder\", \"FIRST NAME IS REQUIRED\");\n }else{\n firstName.classList.remove(\"error\");\n }\n //validate geoLocation at least 10 letters long\n if(geoLocation.value.length < 8){\n geoLocation.classList.add(\"error\");\n geoLocation.setAttribute(\"placeholder\", \"LOCATION IS REQUIRED\");\n }else{\n geoLocation.classList.remove(\"error\");\n }\n // if it passes both validations, send to createFormObject //\n if((firstName.value.length > 2) && (geoLocation.value.length > 8)){\n createFormItem();\n }\n}", "title": "" }, { "docid": "d334c41084d014c5ba9d7f7625b20aef", "score": "0.61220765", "text": "valid(value) {\n\t\treturn true\n\t}", "title": "" }, { "docid": "cec833eb7f3b258403fdd6bda02b04da", "score": "0.6117035", "text": "checkValidInputs(objScope) {\n // Function check Error Input Field and display \n let height = 126;\n var validateFunctions = {\n \"email\": this.validateEmail,\n \"number\": this.checkValidNumber,\n \"tax\": this.checkTaxNumber,\n \"id\": this.checkIdNumber\n }\n let check = true;\n let content = \"\";\n let errorBlockContent = document.querySelector('.error-content');\n errorBlockContent.innerHTML = \"\";\n //Check required field\n let requiredFields = document.querySelectorAll('.input-information .user-input.required');\n requiredFields.forEach(element => {\n if (element.value == \"\") {\n content = \"Thiếu trường \\\"\" + element.parentElement.parentElement.querySelector('.name-information').innerText + \"\\\"\";\n errorBlockContent.appendChild(createErrorContent(content));\n check = false;\n height += 36\n }\n })\n let userInputs = $('.input-information .user-input');\n userInputs.each((index, element) => {\n let classListElement = element.classList;\n if (classListElement.contains(\"number-input\")) {\n content = \"Thông tin \\\"số điện thoại\\\" bị nhập sai\";\n if (!validateFunctions.number($(element).val()) || $(element).val() == \"\") {\n check = false;\n errorBlockContent.appendChild(createErrorContent(content));\n height += 36\n }\n } else if (classListElement.contains(\"email-input\")) {\n content = \"Thông tin \\\"email\\\" bị nhập sai\";\n if (!validateFunctions.email($(element).val())) {\n check = false;\n errorBlockContent.appendChild(createErrorContent(content));\n height += 36\n }\n } else if (classListElement.contains(\"tax-input\")) {\n content = \"Thông tin \\\"mã số thuế\\\" bị nhập sai\";\n if (!validateFunctions.tax($(element).val(), objScope)) {\n check = false;\n errorBlockContent.appendChild(createErrorContent(content));\n height += 36\n }\n } else if (classListElement.contains(\"input-currency\")) {\n content = \"Thông tin \\\"lương cơ bản\\\" bị nhập sai\";\n if (!validateFunctions.number($(element).val())) {\n check = false;\n errorBlockContent.appendChild(createErrorContent(content));\n height += 36\n }\n } else if (classListElement.contains(\"id-input\")) {\n content = \"Thông tin \\\"CMND\\\" bị nhập sai\";\n if (!validateFunctions.id($(element).val(), objScope)) {\n check = false;\n errorBlockContent.appendChild(createErrorContent(content));\n height += 36\n }\n }\n })\n // Check date picker field\n let datePickerField = document.querySelectorAll('.input-information input[type=\"date\"]');\n datePickerField.forEach(element => {\n if (element.value == \"\") {\n content = \"Thiếu trường \\\"\" + element.parentElement.querySelector('.name-information').innerText + \"\\\"\";\n errorBlockContent.appendChild(createErrorContent(content));\n check = false;\n height += 36\n }\n })\n $(\".popup-list\").css(\"height\", height + \"px\");\n return check;\n // Create error content\n function createErrorContent(content) {\n let blockErrorContent = document.createElement('div');\n blockErrorContent.classList.add('block-content');\n let iconError = document.createElement('div');\n iconError.classList.add('icon-error-list');\n let contentError = document.createElement('div');\n contentError.innerText = content;\n blockErrorContent.appendChild(iconError);\n blockErrorContent.appendChild(contentError);\n return blockErrorContent;\n }\n }", "title": "" }, { "docid": "5754151e869f32221cd5953e7ef926f4", "score": "0.6115914", "text": "function formValidation(){\r\n clearErrors();\r\n if (validateFname() && validateLname() && validateStreetname() && validateCity() && validatePassword() && validateConfirmPassword() && validatePhone() && validatePostalCode() && validateUserName())\r\n return true;\r\n else\r\n return false;\r\n}", "title": "" }, { "docid": "7e618134f5169d18926bcfba97e3438f", "score": "0.6115883", "text": "validateForm() {\n\n let isValid = this.validateAmount();\n\n if(!this.validateType()) {\n isValid = false;\n }\n\n if(!this.validateDescription()) {\n isValid = false;\n }\n\n return isValid;\n }", "title": "" }, { "docid": "d6e9ee1f649d624d8cf67fdc3c9afad9", "score": "0.6114689", "text": "validate(data) {\n if (!data.message) data.message = [];\n if (!data.errors) data.errors = [];\n\n let value = data[this.field];\n let err = this.validator(value);\n if (err) data.errors.push(err);\n else data.message.push(this.field + \": \" + value);\n\n return data;\n }", "title": "" }, { "docid": "04a7e7d69f30b9d595fbf31dcfb723d8", "score": "0.6113246", "text": "validateInputs(){\n if(!this.state.value.name){\n alert(\"Display name can't be blank\");\n return false;\n }else if(this.state.value.password1.length < 6){\n alert(\"Password must be greater than 6 characters\");\n return false;\n }else if(this.state.value.password1 != this.state.value.password2){\n alert(\"Passwords must match\");\n return false;\n }else{\n return true;\n }\n }", "title": "" }, { "docid": "9c38b4628881a75d2fb9e47bc3637efa", "score": "0.6111847", "text": "function validateField(inputObj){ \n switch(inputObj.id){\n case(\"regUsr\"): \n return (checkLength(('#'+inputObj.id),\"username\",3,16)) && checkRegExp(('#'+inputObj.id),usrRegex,\"Username may consist of a-z, 0-9,'_'\");\n break;\n case(\"regEml\"): \n return(checkLength(('#'+inputObj.id),\"email\", 6,250) && checkRegExp(('#'+inputObj.id),emailRegex,\"eg. ab@abcde.com\"));\n break;\n case(\"regPwd\"): \n resetField(\"#pwdC\");//it resets the password confirmation field (textarea).\n return(checkLength(('#'+inputObj.id),\"password\",5,16) && checkRegExp(('#'+inputObj.id),pwdRegex,\"Insert at least 5 characters and 1 number\"));\n break;\n case(\"pwdC\"):\n return(passwordConfirm(\"#regPwd\",\"#pwdC\"));\n break;\n }\n}", "title": "" }, { "docid": "cd5c1a0afa6415d5bd387a065f3f4dcc", "score": "0.611082", "text": "validateField(e) {\n let errors = []\n const { lead } = this.state\n return validateEmail(errors, lead.email)\n }", "title": "" }, { "docid": "fbff6f9fd628262fcda2307de39c2fc7", "score": "0.61075515", "text": "validate(data) { // eslint-disable-line class-methods-use-this\n return data;\n }", "title": "" }, { "docid": "eea8d2149ff0301d4da1772a02833ba6", "score": "0.6104734", "text": "function validateField( field ) {\n var errorText = \"\",\n error = false,\n value = field.val(),\n siblings = field.siblings( \".demo-errors\" );\n \n\nswitch ( field.attr( \"name\" ) ) {\n \n\n case \"FirstName\": \n if ( !validateLength( value, 3 ) ) {\n error = true;\n errorText += \"First Name too short ! <br />\";\n \n }\n \n if ( !expLettersOnly.test( value ) ) {\n error = true;\n errorText += \"The name can only contain letters and spaces!\";\n }\n break ; \n \n \n case \"LastName\": \n if ( !validateLength( value, 3 ) ) {\n error = true;\n errorText += \" Last Name too short ! <br />\";\n \n }\n \n if ( !expLettersOnly.test( value ) ) {\n error = true;\n errorText += \"The name can only contain letters and spaces!\";\n }\n break ; \n \n\n\n\n\n\n case \"FName\": \n if ( !validateLength( value, 3 ) ) {\n error = true;\n errorText += \" Father Name too short ! <br />\";\n }\n \n if ( !expLettersOnly.test( value ) ) {\n error = true;\n errorText += \"The name can only contain letters and spaces!\";\n }\n\n \n\n\n\n break;\n\n case \"MName\": \n if ( !validateLength( value, 3 ) ) {\n error = true;\n errorText += \" Mother name is too short!<br />\";\n }\n \n if ( !expLettersOnly.test( value ) ) {\n error = true;\n errorText += \"The name can only contain letters and spaces!\";\n }\n \n \n break;\n \n case \"DOB\": \n if ( !validateLength( value, 0 ) ) {\n error = true;\n errorText += \"Enter Date of Birth !<br />\";\n }\n \n break ; \n\n case \"Cast_Category\": \n \n if(validateSelect( $( \"#Cast_Category\" ) ))\n {\n\n error = true;\n errorText += \"Select Category<br />\";\n }\n\n break ; \n \n\n case \"Religion\": \n \n \n if(validateSelect( $( \"#Religion\" ) ))\n {\n\n error = true;\n errorText += \"Select Religion<br />\";\n \n }\n\n break ; \n \n case \"Stu_Category\": \n \n \n if(validateSelect( $( \"#Stu_Category\" ) ))\n {\n \n error = true;\n errorText += \"Select Student Category<br />\";\n \n }\n\n break ; \n \n case \"Email_id\": \n \n if ( !validateLength( value, 0 ) ) {\n error = true;\n errorText += \"Enter Email_id !<br />\";\n \n }\n \n\n if ( !expEmail.test( value ) ) {\n error = true;\n errorText += \"The email address format is invalid!\";\n }\n \n break;\n \n case \"Mobile_no\": \n \n if ( !expNumbers.test( value ) ) {\n error = true;\n errorText += \"Mobile no. Contain only Numbers \";\n }\n\nif ( !validateLength( value, 9 ) ) {\n error = true;\n errorText += \"Mobile Number lenght should be 10 !<br />\";\n \n }\n\nif ( !MobvalidateLength( value, 11 ) ) {\n error = true;\n errorText += \"Mobile Number lenght should be 10 !<br />\";\n \n }\n\n\n\n break;\n\n case \"Address\": \n \n if ( !validateLength( value, 0 ) ) {\n error = true;\n errorText += \"Enter Address !<br />\";\n \n }\n break;\n\n case \"City\": \n \n if ( !validateLength( value, 0 ) ) {\n error = true;\n errorText += \"Enter City !<br />\";\n \n }\n break;\n \n case \"Stu_Category\": \n \n \n if(validateSelect( $( \"#state\" ) ))\n {\n \n error = true;\n errorText += \"Select State<br />\";\n \n }\n\n break ; \n\n case \"Course\": \n \n \n if(validateSelect( $( \"#Course\" ) ))\n {\n \n error = true;\n errorText += \"Select Course<br />\";\n \n }\n\n break ; \n\n case \"Semester\": \n \n \n if(validateSelect( $( \"#Semester\" ) ))\n {\n \n error = true;\n errorText += \"Select Semester<br />\";\n \n }\n\n break ; \n\n case \"amount\": \n \n \n if ( !validateLength( value, 0 ) ) \n {\n error = true;\n errorText += \"Enter amount !<br />\";\n \n }\n if ( !expNumbers.test( value ) ) {\n error = true;\n errorText += \"Amount only contain number!\";\n }\n \n\n break ; \n\n case \"Draft_no\": \n \n \n if ( !validateLength( value, 0 ) ) \n {\n error = true;\n errorText += \"Enter Draft_no. !<br />\";\n \n }\n\n if ( !expNumbers.test( value ) ) {\n error = true;\n errorText += \"Draft no only contain number!\";\n }\n\n\n\n break ; \n \n case \"Draftdate\": \n \n \n if ( !validateLength( value, 0 ) ) \n {\n error = true;\n errorText += \"Enter Draft_no. !<br />\";\n \n }\n\n break ; \n\n case \"Payable\": \n \n \n if ( !validateLength( value, 0 ) ) \n {\n error = true;\n errorText += \"Enter Payable at : field !<br />\";\n \n }\n\n break ; \n\n case \"Bank1\": \n \n \n if(validateSelect( $( \"#Bank1\" ) ))\n {\n \n error = true;\n errorText += \"Select Bank<br />\";\n \n }\n\n break ; \n\n\n}\n\nsiblings.html( errorText );\n \nreturn !error;\n}", "title": "" }, { "docid": "0ad27b1473ab33ff5131623f8a16af9d", "score": "0.6103933", "text": "function validate_employee_form(arg_object) {\n //\n var error = false;\n var basic_val_error = false;\n var emp_id_str_err = false;\n var unique_id_error = arg_object.unique_id_error;\n //\n // performing basic empty value validation for all input and select elements\n if (document.getElementById('department-select').value == 'transportation') {\n basic_val_error = basic_validate('add_employee','pay_rate,comments,emp-internal-id,base-rate-level,case-rate-level,stop-rate-level');\n }\n else {\n basic_val_error = basic_validate('add_employee','pay_rate,comments,base-rate-select,case-rate-select,stop-rate-select,base-rate-input,case-rate-input,stop-rate-input,base-rate-level,case-rate-level,stop-rate-level,emp-internal-id');\n }\n //\n if (basic_val_error) {\n error = true;\n }\n if (unique_id_error) {\n alert(\"The supplied Employee ID: \"+document.getElementById('emp-id').value+\" is already in use.\");\n add_class('invalid-field','emp-id')\n remove_class('hidden-elm','emp-id-uni-err')\n error = true;\n }\n else {\n remove_class('invalid-field','emp-id')\n add_class('hidden-elm','emp-id-uni-err')\n }\n //\n //\n if (error) {\n remove_class('hidden-elm','form-errors');\n }\n else {\n add_class('hidden-elm','form-errors');\n submit_employee_form(arg_object)\n }\n\n}", "title": "" }, { "docid": "fae524c2d2a33e10c9a12c3ead0ef57a", "score": "0.60949004", "text": "validate(value) {\n\t\treturn this.test(value);\n\t}", "title": "" }, { "docid": "532ef311c4bade204e5805d3e8ad7ae1", "score": "0.6086355", "text": "validateForm() {\n return (this.validateName() === 'success'\n && this.validateEmail() === 'success'\n && this.validateEmails() === 'success'\n );\n }", "title": "" }, { "docid": "e0d8cc2b062b16857e815c918ce33c58", "score": "0.60860467", "text": "validate() {\n // Get generic API validation errors\n this._super();\n var errors = get(this, 'errors')||[];\n if ( !get(this, 'cluster.name') ) {\n errors.push('Name is required');\n }\n\n\n if ( !get(this, 'config.sshPublicKeyContents') ) {\n errors.push(intl.t('validation.required', { key: intl.t('clusterNew.oracleoke.ssh.label') }));\n }\n\n\n // Add more specific errors\n\n // Check something and add an error entry if it fails:\n // if ( parseInt(get(this, 'config.memorySize'), defaultRadix) < defaultBase ) {\n // errors.push('Memory Size must be at least 1024 MB');\n // }\n\n // Set the array of errors for display,\n // and return true if saving should continue.\n if ( get(errors, 'length') ) {\n set(this, 'errors', errors);\n return false;\n } else {\n set(this, 'errors', null);\n return true;\n }\n }", "title": "" }, { "docid": "273e87700778f691ff6340a07ab1814b", "score": "0.608225", "text": "async validate() {\n // Set error if required field is empty.\n let thisValue = this.formInstance ? this.context.post[this.formInstance.id][this.name] : undefined;\n if (this.data.required && !thisValue) {\n // Set a general error message (that won't be repeated multiple times).\n // TODO: Translate.\n this.formInstance.setError('requiredFieldEmpty', 'Please fill in the required fields.');\n // Set an empty error message, to highlight the field in the theme.\n this.formInstance.setError(this.name, '');\n }\n\n // TODO: Flesh this out. We probably need to pass more information to the\n // validateFunction!\n for (let validateFunction of this.validateRegistry.getIterator()) {\n await validateFunction();\n }\n\n // Process sub-elements.\n for (let element of this.instanceRegistry.getIterator()) {\n if (element.validate) {\n await element.validate();\n }\n }\n }", "title": "" }, { "docid": "61edc23f9229948ae2b2edb7e4c0a580", "score": "0.6080131", "text": "function validate(username,password){\nif(!Validation.username(username)){\nreturn \"2\";\n}\nif(!Validation.password(password)){\nreturn \"3\"\n}\nreturn \"1\";\n}", "title": "" } ]
7e710619df243d78015af0988cc66468
cloned and reversed json_data: most recent data first; use with timeline
[ { "docid": "d85ff580e1ec8de36be8713012ac6eea", "score": "0.0", "text": "function getTimelineSearch(){\r\n\t$('#timeline-search').keyup(function () {\r\n\t\tvar output, inQuotes;\r\n\t\tvar searchField = $(this).val();\r\n\t\tif (searchField === '') {\r\n\t\t\t$('#timeline').html('');\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t//check if in quotes\r\n\t\tif ((searchField.charAt(0)==\"'\") || (searchField.charAt(0)==\"\\\"\")){\r\n\t\t\tinQuotes = true;\r\n\t\t\tquoteChar = searchField.charAt(0)\r\n\t\t} else {\r\n\t\t\tinQuotes = false;\r\n\t\t}\r\n\t\tvar regex = new RegExp(searchField, \"i\");\r\n\t\tvar count = 1;\r\n\t\t$.each(cloneJson_data, function (key, val) {\r\n\t\t\tvar time, date;\r\n\t\t\t//if ((val.employee_salary.search(regex) != -1) || (val.employee_name.search(regex) != -1)) {//two criteria\r\n\t\t\tif ((inQuotes) && ((quoteChar+val.subject_id+quoteChar).search(regex) != -1)) {\r\n\t\t\t\tconsole.log('quotes')\r\n\t\t\t\tdate=moment(val.end_time).format(\"L\")\r\n\t\t\t\ttime=[moment(val.start_time).format(\"hh:mm\"),moment(val.end_time).format(\"hh:mma\")];\r\n\t\t\t\toutput +=[\r\n\t\t\t\t\t'<div class=\"frst-timeline-block '+val.location+'-item frst-timeline-completed\" data-animation=\"slideInUp\">',\r\n\t\t\t\t\t\t'<div class=\"'+val.location+'-timeline-img\"> <span></span> </div>',\r\n\t\t\t\t\t\t'<!-- frst-timeline-img -->',\r\n\t\t\t\t\t\t'<div class=\"frst-timeline-content animated rotateInDownRight\" style=\"position: relative;\">',\r\n\t\t\t\t\t\t\t'<div class=\"frst-timeline-content-inner\">',\r\n\t\t\t\t\t\t\t\t'<span class=\"frst-date\">'+date+'<br>'+time[0]+' - '+time[1]+'</span>',\r\n\t\t\t\t\t\t\t\t'<h2>'+val.subject_id+'</h2>',\r\n\t\t\t\t\t\t\t\t'<p>session: '+val.subject_session+'-'+val.subject_subsession+'</p>', \r\n\t\t\t\t\t\t\t\t'<p>score: '+val.score+'</p>', \r\n\t\t\t\t\t\t\t\t'<p>location: '+val.location+'</p>',\r\n\t\t\t\t\t\t\t'</div>',\r\n\t\t\t\t\t\t\t'<!-- frst-timeline-content-inner -->',\r\n\t\t\t\t\t\t'</div>',\r\n\t\t\t\t\t\t'<!-- frst-timeline-content -->',\r\n\t\t\t\t\t'</div>'\r\n\t\t\t\t].join('');\r\n\t\t\t} else if ((val.subject_id.search(regex) != -1) && (!inQuotes)) {\r\n\t\t\t\tconsole.log('no quotes')\r\n\t\t\t\tdate=moment(val.end_time).format(\"L\")\r\n\t\t\t\ttime=[moment(val.start_time).format(\"hh:mm\"),moment(val.end_time).format(\"hh:mma\")];\r\n\t\t\t\toutput +=[\r\n\t\t\t\t\t'<div class=\"frst-timeline-block '+val.location+'-item frst-timeline-completed\" data-animation=\"slideInUp\">',\r\n\t\t\t\t\t\t'<div class=\"'+val.location+'-timeline-img\"> <span></span> </div>',\r\n\t\t\t\t\t\t'<!-- frst-timeline-img -->',\r\n\t\t\t\t\t\t'<div class=\"frst-timeline-content animated rotateInDownRight\" style=\"position: relative;\">',\r\n\t\t\t\t\t\t\t'<div class=\"frst-timeline-content-inner\">',\r\n\t\t\t\t\t\t\t\t'<span class=\"frst-date\">'+date+'<br>'+time[0]+' - '+time[1]+'</span>',\r\n\t\t\t\t\t\t\t\t'<h2>'+val.subject_id+'</h2>',\r\n\t\t\t\t\t\t\t\t'<p>session: '+val.subject_session+'-'+val.subject_subsession+'</p>', \r\n\t\t\t\t\t\t\t\t'<p>score: '+val.score+'</p>', \r\n\t\t\t\t\t\t\t\t'<p>location: '+val.location+'</p>',\r\n\t\t\t\t\t\t\t'</div>',\r\n\t\t\t\t\t\t\t'<!-- frst-timeline-content-inner -->',\r\n\t\t\t\t\t\t'</div>',\r\n\t\t\t\t\t\t'<!-- frst-timeline-content -->',\r\n\t\t\t\t\t'</div>'\r\n\t\t\t\t].join('');\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t$('#timeline').html('');\r\n\t\t\t}\r\n\t\t});\r\n\t\t$('#timeline').html(output.replace('undefined',''))//most recent subject on top bar\r\n\t});\r\n}", "title": "" } ]
[ { "docid": "a55b3401d992ed51b96a346abcc16a49", "score": "0.60497373", "text": "function timelineData() {\n var array = [];\n var date = results[0] ? new Date(results[0].values[0].timestamp): new Date();\n for (var i = 0; i < 7; i++) {\n array.push({value:date, tooltip:{showContent: false}});\n date = new Date(date.getTime() + 86400000);\n }\n for (var i = 2; i < weeks.length-1; i++) {\n var date = new Date(results[i].values[0].timestamp);\n\n array.push({value:date, tooltip:{showContent: false}});\n if (i == weeks.length-1) {\n //** use last item temporarily, might not be the latest time\n var last = results[i].values.length-1\n console.log(last);\n console.log(results[i].values[last])\n var date = new Date(results[i].values[last].timestamp);\n\n array.push({value:date, tooltip:{showContent: false}});\n }\n }\n //console.log(array)\n return array;\n }", "title": "" }, { "docid": "ffd03265bb295757c83bfe8686430d73", "score": "0.58610046", "text": "cleanJSON(json) {\n let cleanJSONData = {\n timestampdate: [],\n close: [],\n open: [],\n low: [],\n high: [],\n };\n\n let rawDate = []\n\n json.forEach(stockData => {\n rawDate.push(new Date(stockData.timestamp))\n cleanJSONData.timestampdate.push(new Date(stockData.timestamp).toLocaleDateString())\n cleanJSONData.low.push(stockData.low);\n cleanJSONData.high.push(stockData.high);\n cleanJSONData.open.push(stockData.open);\n cleanJSONData.close.push(stockData.close);\n })\n\n cleanJSONData.timestampdate.reverse()\n cleanJSONData.close.reverse()\n cleanJSONData.open.reverse()\n cleanJSONData.low.reverse()\n cleanJSONData.high.reverse()\n\n // Set the min and max dates\n if (this.state.firstFetch) {\n this.setState(({\n from: new Date(Math.min.apply(null,rawDate)).toISOString().slice(0,10).split(\"-\").reverse().join(\"/\"),\n to: new Date(Math.max.apply(null,rawDate)).toISOString().slice(0,10).split(\"-\").reverse().join(\"/\"),\n dateMin: new Date(Math.min.apply(null,rawDate)).toISOString().slice(0,10).split(\"-\").reverse().join(\"/\"),\n dateMax: new Date(Math.max.apply(null,rawDate)).toISOString().slice(0,10).split(\"-\").reverse().join(\"/\"),\n firstFetch: false\n }))\n }\n\n return cleanJSONData\n }", "title": "" }, { "docid": "80b6ccbcc7c7b104e88b85f9e876791f", "score": "0.5829011", "text": "function getNewList(){\r\n\tvar newJson = _.uniqBy(cloneJson_data, 'subject_id');\r\n\tvar newL = newJson.length - 1\r\n\tvar newElement;\r\n\tif (newL < 10){len = newL+1} else {len=10};\r\n\tfor (i = 0; i < len; i++) {\r\n\t\tvar recentSubject = newJson[i];\r\n\t\tsubject = recentSubject.subject_id;\r\n\t\tloc=recentSubject.location;\r\n\t\tsession=recentSubject.subject_session;\r\n\t\tsubsession=recentSubject.subject_subsession;\r\n\t\tscore=recentSubject.score;\r\n\t\tdate=moment(recentSubject.end_time).format(\"L\");\r\n\t\ttime=[moment(recentSubject.start_time).format(\"hh:mm\"),moment(recentSubject.end_time).format(\"hh:mma\")];\r\n\t\tnewElement += [\r\n\t\t\t'<div class=\"feed-element\">',\r\n\t\t\t\t'<a class=\"pull-left\">',\r\n\t\t\t\t\t'<div alt=\"image\" class=\"location-color-'+loc+'\"></div>',\r\n\t\t\t\t'</a>',\r\n\t\t\t\t'<div class=\"media-body\">',\r\n\t\t\t\t\t'<small class=\"pull-right\">'+moment(recentSubject.end_time).fromNow()+'</small>',\r\n\t\t\t\t\t'<strong>'+subject+'</strong> completed session <strong>'+session+'-'+subsession+'</strong> at '+loc+', scoring <strong>'+score+'</strong> points.<br>',\r\n\t\t\t\t\t'<small class=\"text-muted\">'+time[0]+' - '+time[1]+'</small>',\r\n\t\t\t\t'</div>',\r\n\t\t\t'</div>'\r\n\t\t].join('');\r\n\t}\r\n\t$('#new-subject-container').html(newElement.replace('undefined',''))//most recent subject on top bar\r\n}", "title": "" }, { "docid": "293c5e177dd1f41043899e58bd4d9585", "score": "0.5820765", "text": "function newJsonData(data) {\r\n 'use strict';\r\n var seriesName,\r\n seriesID,\r\n embargoDate;\r\n\r\n data.Release[0].DataSet.forEach(function(dataSet) {\r\n dataSet.Series.forEach(function(series) {\r\n seriesName = series.Attributes.SERIES_NAME;\r\n embargoDate = series.EmbargoDate;\r\n seriesID = (seriesName + ' ' + getShortDate(embargoDate));\r\n for (var i = _series.length - 1; i >= 0; i--) {\r\n if (_series[i].id === seriesID) {\r\n var newSeries = {};\r\n newSeries.id = seriesID;\r\n\r\n loadObservations(series.Observations, newSeries, false);\r\n if (newSeries.minDate.getTime() < _minDate.getTime()) {\r\n _minDate = newSeries.minDate;\r\n startPicker.min(_minDate);\r\n }\r\n if (newSeries.maxDate > _maxDate) {\r\n _maxDate = newSeries.maxDate;\r\n endPicker.max(_maxDate);\r\n }\r\n _series[i].observations = newSeries.observations;\r\n _series[i].color = _seriesColor.shift();\r\n _series[i].minDate = newSeries.minDate;\r\n _series[i].maxDate = newSeries.maxDate;\r\n\r\n if (numUnits < 2 && !unitExists(_series[i].units + _series[i].unitMult)) {\r\n numUnits++;\r\n var axisType = {\r\n lineType: 'dashed',\r\n label: _series[i].units + _series[i].unitMult\r\n };\r\n if (_series[i].format !== null) {\r\n axisType.format = _series[i].format;\r\n }\r\n if (_axes[0].lineType === 'dashed') {\r\n axisType.lineType = 'straight';\r\n _axes.unshift(axisType);\r\n chart.options.valueAxis[0].visible = true;\r\n\r\n } else {\r\n chart.options.valueAxis[1].visible = true;\r\n _axes.push(axisType);\r\n }\r\n }\r\n if ((numUnits === 2 && (_series[i].units + _series[i].unitMult) === _axes[1].label) || ((_series[i].units + _series[i].unitMult) === _axes[0].label && _axes[0].lineType === 'dashed')) {\r\n _series[i].lineType = 'dashed';\r\n }\r\n for (var h = _series[i].observations.length - 1; h >= 0; h--) {\r\n _rawData.options.data.push(_series[i].observations[h]);\r\n }\r\n _rawData.read();\r\n _plotSeriesCollection.push(_series[i]);\r\n setColor();\r\n setSeriesType();\r\n if ($('#LogScale').prop('checked')) {\r\n for (var j = chart.options.series.length - 1; j >= 0; j--) {\r\n chart.options.series[j].field = 'log';\r\n }\r\n }\r\n _series.splice(i, 1);\r\n }\r\n }\r\n });\r\n });\r\n $('#listView').data('kendoListView').dataSource.data(_series);\r\n $('#legendView').data('kendoListView').dataSource.data(_plotSeriesCollection);\r\n chart.redraw();\r\n initChartNav();\r\n hideProgressAnimation();\r\n if (!navVisible) {\r\n $('svg g [x=-24]').attr('x', 80);\r\n }\r\n}", "title": "" }, { "docid": "6cda1a73924d0ae2a608251144dc541b", "score": "0.56779015", "text": "function fillTimeline(){\r\n let timeline = groupTimelineById();\r\n \r\n ditoJson.events.forEach((element) => {\r\n let transId;\r\n \r\n element.custom_data.forEach((key) => {\r\n if(key.key === 'transaction_id') {\r\n transId = key.value;\r\n }\r\n });\r\n\r\n timeline.forEach((timelineElement) => {\r\n if(timelineElement.transaction_id === transId) {\r\n if(element.event === 'comprou') {\r\n timelineElement.revenue = element.revenue;\r\n \r\n element.custom_data.forEach((key) => {\r\n if(key.key === 'store_name') {\r\n timelineElement.store_name = key.value;\r\n }\r\n });\r\n }\r\n \r\n if(element.event === 'comprou-produto') {\r\n let obj = { name: '', price: '' };\r\n\r\n element.custom_data.forEach((key) => {\r\n if(key.key === 'product_name') obj.name = key.value;\r\n if(key.key === 'product_price') obj.price = key.value;\r\n });\r\n\r\n timelineElement.products.push(obj);\r\n }\r\n }\r\n });\r\n });\r\n\r\n sortTimeline(timeline);\r\n\r\n return timeline;\r\n }", "title": "" }, { "docid": "ecc1979f0c763797d74159986ad8be99", "score": "0.5671591", "text": "function cloneJSON(json) {\n return JSON.parse(JSON.stringify(json));\n}", "title": "" }, { "docid": "72606b4c1f62591a20281ce23a549ee6", "score": "0.5644603", "text": "reverse() {\n var copy = this._data.map(function (item) {\n return item;\n });\n copy.reverse();\n\n var that = this;\n copy.forEach(function (value, index) {\n if (value !== that._data[index]) {\n that[index] = value;\n }\n })\n }", "title": "" }, { "docid": "14b80af7021b2074396c59c0a37a3dfd", "score": "0.5642831", "text": "cloneData(data) {\n const results = [];\n for (const item of data) {\n const copy = {\n name: item['name']\n };\n if (item['value'] !== undefined) {\n copy['value'] = item['value'];\n }\n if (item['series'] !== undefined) {\n copy['series'] = [];\n for (const seriesItem of item['series']) {\n const seriesItemCopy = Object.assign({}, seriesItem);\n copy['series'].push(seriesItemCopy);\n }\n }\n if (item['extra'] !== undefined) {\n copy['extra'] = JSON.parse(JSON.stringify(item['extra']));\n }\n results.push(copy);\n }\n return results;\n }", "title": "" }, { "docid": "14b80af7021b2074396c59c0a37a3dfd", "score": "0.5642831", "text": "cloneData(data) {\n const results = [];\n for (const item of data) {\n const copy = {\n name: item['name']\n };\n if (item['value'] !== undefined) {\n copy['value'] = item['value'];\n }\n if (item['series'] !== undefined) {\n copy['series'] = [];\n for (const seriesItem of item['series']) {\n const seriesItemCopy = Object.assign({}, seriesItem);\n copy['series'].push(seriesItemCopy);\n }\n }\n if (item['extra'] !== undefined) {\n copy['extra'] = JSON.parse(JSON.stringify(item['extra']));\n }\n results.push(copy);\n }\n return results;\n }", "title": "" }, { "docid": "14b80af7021b2074396c59c0a37a3dfd", "score": "0.5642831", "text": "cloneData(data) {\n const results = [];\n for (const item of data) {\n const copy = {\n name: item['name']\n };\n if (item['value'] !== undefined) {\n copy['value'] = item['value'];\n }\n if (item['series'] !== undefined) {\n copy['series'] = [];\n for (const seriesItem of item['series']) {\n const seriesItemCopy = Object.assign({}, seriesItem);\n copy['series'].push(seriesItemCopy);\n }\n }\n if (item['extra'] !== undefined) {\n copy['extra'] = JSON.parse(JSON.stringify(item['extra']));\n }\n results.push(copy);\n }\n return results;\n }", "title": "" }, { "docid": "14b80af7021b2074396c59c0a37a3dfd", "score": "0.5642831", "text": "cloneData(data) {\n const results = [];\n for (const item of data) {\n const copy = {\n name: item['name']\n };\n if (item['value'] !== undefined) {\n copy['value'] = item['value'];\n }\n if (item['series'] !== undefined) {\n copy['series'] = [];\n for (const seriesItem of item['series']) {\n const seriesItemCopy = Object.assign({}, seriesItem);\n copy['series'].push(seriesItemCopy);\n }\n }\n if (item['extra'] !== undefined) {\n copy['extra'] = JSON.parse(JSON.stringify(item['extra']));\n }\n results.push(copy);\n }\n return results;\n }", "title": "" }, { "docid": "d6b0138521f62f4edd8bd7c0c4ddae91", "score": "0.56272763", "text": "function cloneData(data){\n return JSON.parse(JSON.stringify(data));\n }", "title": "" }, { "docid": "a091f35122757f0ae5cc7f7c585e59dd", "score": "0.5576152", "text": "function cloneIncomingData(data) {\n let forkliftSpeed = data.maxForkliftSpeed;\n let vertices = [];\n for (let verticeKey in data[\"graph\"][\"vertices\"]) {\n let adjacentVertexIds = [];\n for (let adjacentVertexKey in data[\"graph\"][\"vertices\"][verticeKey][\"adjacentVertexIds\"]) {\n adjacentVertexIds.push(data[\"graph\"][\"vertices\"][verticeKey][\"adjacentVertexIds\"][adjacentVertexKey]);\n }\n let scheduleItems = [];\n for (let scheduleItemsKey in data[\"graph\"][\"vertices\"][verticeKey][\"scheduleItems\"])\n position.push(data[\"graph\"][\"vertices\"][verticeKey][\"scheduleItems\"][scheduleItemsKey]);\n vertices.push({\n adjacentVertexIds: adjacentVertexIds,\n id: data[\"graph\"][\"vertices\"][verticeKey][\"id\"],\n isVisited: data[\"graph\"][\"vertices\"][verticeKey][\"isVisited\"],\n label: data[\"graph\"][\"vertices\"][verticeKey][\"label\"],\n position: {\n x: data[\"graph\"][\"vertices\"][verticeKey][\"position\"][\"x\"],\n y: data[\"graph\"][\"vertices\"][verticeKey][\"position\"][\"y\"]\n\n },\n previousVertex: data[\"graph\"][\"vertices\"][verticeKey][\"previousVertex\"],\n scheduleItems: scheduleItems\n })\n }\n let newData = {\n\n graph: {\n vertices: vertices\n },\n forkliftSpeed: forkliftSpeed\n };\n return newData;\n}", "title": "" }, { "docid": "bceb9f9a9b2708639538f3eceaeefcad", "score": "0.55543196", "text": "function getLineData(data){\n\n // process fetched data\n var items = data.Items; //get all the items\n var labelArr = [];\n var dataArr = [];\n var prev = getTime(currentDate + SPACE + items[0].time);\n var labelPath = [];\n var dataPath = [];\n for(var i = 0; i < data.Count; ++i){\n var curTime = getTime(currentDate + SPACE + items[i].time);\n if(curTime - prev < 12000){ // difference between two times is within 4 seconds\n labelPath.push(items[i].time);\n dataPath.push(items[i].speed);\n prev = curTime;\n continue;\n }\n // if the difference between curTime and prevTime is greater than 4 seconds, push the previous label and data path\n labelArr.push($.extend(true,[], labelPath));\n dataArr.push($.extend(true, [], dataPath));\n labelPath = [];\n dataPath = [];\n prev = curTime;\n i--;\n }\n if(labelPath.length > 0 && dataPath.length > 0){ //push the last time bucket\n labelArr.push($.extend(true,[], labelPath));\n dataArr.push($.extend(true, [], dataPath));\n }\n\n var result = [];\n result.push(labelArr);\n result.push(dataArr);\n return result;\n}", "title": "" }, { "docid": "39e14bb328715a93c41d1a5f9b59777f", "score": "0.55276084", "text": "function copyJson(old) {\r\n return JSON.parse(JSON.stringify(old));\r\n}", "title": "" }, { "docid": "fda286adcf4ad4705e0c2f20f910dad3", "score": "0.5504296", "text": "function cloneData(data) {\n return data;\n //return JSON.parse(JSON.stringify(data));\n}", "title": "" }, { "docid": "fda286adcf4ad4705e0c2f20f910dad3", "score": "0.5504296", "text": "function cloneData(data) {\n return data;\n //return JSON.parse(JSON.stringify(data));\n}", "title": "" }, { "docid": "cffa8ddad0aa2887a830df734b3cec17", "score": "0.55000466", "text": "function breakdownJsonData(newData) {\n\t/*\n\t * For..in (loop) will move over all items in the JSON array.\n\t * The loop begins by assigning each new held asteroid value in the list to a new variable.\n\t * The newAsteroid is an object that is parsed for mass, id, and year.\n\t */\n\tfor (var asteroid in newData) {\n\n\t\t// Assign each held object in the list to a new variable called 'newAsteroid'\n\t\tlet newAsteroid = newData[asteroid];\n\n\t\t// Get the mass and id for storing into array as key-value pairs.\n\t\tlet asteroidId = newAsteroid[\"id\"];\n\t\tlet asteroidMass = newAsteroid[\"mass\"];\n\t\tlet updatedAsteroidYear = newAsteroid[\"year\"]; // Unformatted (Raw)\n\n\t\t// Basic null handling.\n\t\t// On condition that the mass is provided in the data, then add the asteroidId as\n\t\t// the index marker for the asteroidMass value.\n\t\tif (asteroidMass != null && updatedAsteroidYear != null) {\n\t\t\t// asteroidCount++;\n\t\t\tasteroidYears.push(updatedAsteroidYear);\n\t\t\tasteroidComparables[asteroidId] = asteroidMass;\n\t\t}\n\t}\n\t// Add data set of comparable data to array\n\t// which leaves a 973 item array that contains\n\t// an index and corresponding ID.\n\tasteroids = Object.keys(asteroidComparables);\n}", "title": "" }, { "docid": "9a710614b642fdf58790d9cf17640541", "score": "0.54986125", "text": "_createFullJSON() {\n\n var self = this;\n\n var fullDataReady = $.Deferred();\n var dataToGet = new Set();\n\n // we start by fetching the initial dataUrl from the HTML\n var getData = self._fetch(self.options.dataUrl);\n\n // once the data is here.....\n getData.done((data) => {\n\n self.data = data;\n\n // go through the data and pull out and JSON we need to retrieve and make a set of values\n dataToGet = self._recursiveSearch(self.data, self.options.dataKey, dataToGet);\n\n // go through the data set, ajax in the actual JSON and refull\n recursiveGet(dataToGet);\n\n });\n\n function recursiveGet(dataToGet) {\n\n // if we enter here and there is no data, maybe it was a super simple JSON with no dataURLs, we just resolve\n if (dataToGet.size === 0) {\n fullDataReady.resolve();\n return;\n }\n\n // we find out how many items we have to get\n var size = dataToGet.size;\n\n // go through the data we found\n dataToGet.forEach((value) => {\n\n // get the JSON \n var getData = self._fetch(value);\n\n // once we are done, we replace the _dataUrl entry in the JSON with the actual data to \n // create a nice and pretty JSON object\n getData.done((data) => {\n\n self.data = self._replaceUrlWithData(self.data, self.options.dataKey, value, data);\n\n // we remove the item we just got out of our list\n dataToGet.delete(value); \n\n // if this was the last one, and there is nothing to get....\n if (dataToGet.size === 0) {\n\n // look through the \"new\" self.data and see if we now have any new _dataUrls\n var matchesLeft = self._recursiveSearch(self.data, self.options.dataKey, dataToGet);\n\n // if we do, let's start this part over again and get those\n if (matchesLeft.size > 0) {\n recursiveGet(matchesLeft);\n } else {\n // if there are no left, we are finally done. Resolve\n fullDataReady.resolve();\n }\n }\n\n });\n\n });\n \n }\n\n return fullDataReady;\n\n }", "title": "" }, { "docid": "87da892f11bdadcd7a19a562b97641f3", "score": "0.547979", "text": "function getDataBeforeTime(data, lastTime) {\r\n \r\n var reducedData = [];\r\n \r\n data.map(function(item) {\r\n \r\n if (item.timestamp > lastTime) {\r\n reducedData.push( item );\r\n }\r\n });\r\n\r\n return reducedData;\r\n}", "title": "" }, { "docid": "e31cde1df3cc42fe0b048f06305ebdbf", "score": "0.54684454", "text": "function fixUpData(json) {\n var data = json.map(j => j);\n data.push({ age: d3.max(json, d => d.age), males: 0, females: 0, total: 0 });\n data.push({ age: d3.min(json, d => d.age), males: 0, females: 0, total: 0 });\n return data;\n }", "title": "" }, { "docid": "fd1fdd26528e184fd521ef07cd405063", "score": "0.54402566", "text": "static latest(data) {\n return data.length && data.filter(clear).length ?\n first(data.filter(clear).sort((a, b) => new Date(b).valueOf() - new Date(a).valueOf())) : undefined;\n }", "title": "" }, { "docid": "5d501babd49960eb20fcc47697c8b95f", "score": "0.54316056", "text": "function simplifyJSON (data){\n var gls = data.skybitz.gls;\n gls.forEach(element => {\n if (element.landmark){\n var location = {\n name: element.landmark.geoname,\n city: element.landmark.city, \n latitude: element.latitude, \n longitude: element.longitude, \n time: new Date (element.time)\n };\n\n stops.push(location);\n // if (!landmarks[location.city]){\n // stops.push(location);\n // landmarks[location.city] = location.city;\n // }\n }\n });\n stops.sort(compare);\n}", "title": "" }, { "docid": "e3fcb1eeaadb914275e912ee93571624", "score": "0.5431354", "text": "function cleanupData(){\n for(var i = 0; i < rawData.length; i++){\n var item = rawData[i];\n\n // Only include role models who have explicitly approved entering their data\n if(item[\"approval\"] == \"Approved\"){\n var newItem = {};\n for(var k in item) {\n var newKey = dataKeys[k];\n newItem[newKey] = item[k];\n }\n\n if(newItem[\"joined-date\"] == \"\") {\n newItem[\"joined-date\"] = newItem[\"event-timestamp\"];\n }\n\n newItem.id = i + 2;\n newItem.visible = true; //visible by default - this is important for the Popup\n data.push(newItem);\n }\n }\n\n data = data.sort(dateSort);\n}", "title": "" }, { "docid": "17d9ee5392c58e1cc84bb14f61d311b3", "score": "0.54174453", "text": "getPrevStandings(){\n try{\n let numChunk = Number( this.getCookie( `numChunk-${this.taskId}` ) );\n let tmp = '';\n for(let i=0; i<numChunk; i++){\n let s = this.getCookie( `standings-${this.taskId}-${i}` );\n tmp += s;\n }\n let json = decodeURIComponent( tmp );\n let arr = JSON.parse( json );\n let prev = {};\n arr.forEach( e=>{\n prev[ e[0] ] = e;\n });\n return prev;\n }catch(e){\n console.log(e);\n return {};\n }\n }", "title": "" }, { "docid": "7adcd93421339994599a95e3f4ce142a", "score": "0.5410354", "text": "function populateHistory (json)\n{\n Brandwatch.stores.historyStore.removeAll ();\n\n for (var i = 0; i < json.brandData.days.length; i++)\n {\n //The date comes back in an odd format with dashes and is fixed manually.\n var fixDate = json.brandData.days[i].date.replace (\"-\", \"/\");\n fixDate = fixDate.replace (\"-\", \"/\");\n fixDate = fixDate.split (\"T\")[0];\n\n var date = new Date (fixDate);\n date = formatDate (date);\n var mentionDate = new Date (fixDate);\n var mentions = json.brandData.days[i].mentions;\n var negDay = json.brandData.days[i].negative;\n var posDay = json.brandData.days[i].positive;\n var neuDay = json.brandData.days[i].neutral;\n\n Brandwatch.stores.historyStore.add ({'date':date, 'formatteddate':mentionDate, 'mentions':mentions, 'negative':negDay, 'positive':posDay, 'neutral':neuDay});\n }\n}", "title": "" }, { "docid": "1a66e5301ba9cf2beffdd957df18e3c7", "score": "0.53994876", "text": "function mirror(data) {\n const sort = data.slice().sort((a, b) => a - b);\n return [...sort, ...sort.reverse().slice(1)];\n}", "title": "" }, { "docid": "844f048b4e7fdfb380ad28e154462584", "score": "0.53960073", "text": "function prepareJsonData(json){\r\n\r\n\t// check with the requests or job\r\n\tif(json.type === TYPE.JOB){\r\n\t\tfor(let i = 0; i < json.data.length; i++){\r\n\t\t\tfor(let k = 0; k < jobs.length; k++){\r\n\t\t\t\tif(json.data[i] === jobs[k][JOBS.ID]){\r\n\t\t\t\t\tjson.data[i] = jobs.splice(k, 1)[0]; // remove the match (faster iteration) and keep it in cid_array\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tfor(let i = 0; i < json.data.length; i++){\r\n\t\t\tfor(let k = 0; k < requests.length; k++){\r\n\t\t\t\tif(json.data[i] === requests[k][CLIENT.CID]){\r\n\t\t\t\t\tjson.data[i] = requests.splice(k, 1)[0]; // remove the match (faster iteration) and keep it in cid_array\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "51f0fe9d12a73e2a94f855cf0982321a", "score": "0.5372041", "text": "function importWellHistoryDto(data, parent) { return $.map(data || [], function (item) { return datacontext.createWellHistory(item, parent); }); }", "title": "" }, { "docid": "18e98652cbfc1c6f94b7f88da4e56c58", "score": "0.5355409", "text": "function _copyJSONObj (json) {\n return JSON.parse( JSON.stringify(json) );\n}", "title": "" }, { "docid": "697f4a677b3c7f2b73d4437e4f585dea", "score": "0.5351896", "text": "function transformJsonToGraphData(json) {\n\tnumberOfUtilities = json.utilities.length;\n\tcurrentYear = json.currYear;\n\tpreviousYear = json.prevYear;\n\n\tconsole.log(\"Number of utilities is: \" + numberOfUtilities);\n\tconsole.log(\"Current year is: \" + currentYear);\n\tconsole.log(\"Prev year is: \" + previousYear);\n\t\n\tdata = [];\n\t\n\tfor (i = 0; i < numberOfUtilities; i++) {\n\t\tutil = json.utilities[i];\n\n\t\tif (util.currMeasurement == null) continue;\n\n\t\tconsole.log(\"Consumable: \" + util.type + \" Year: \" + currentYear + \" Value: \" + util.currMeasurement);\n\t\tdata.push({ \"Consumable\":util.type, \"Year\":currentYear, \"Value\": util.currMeasurement});\n\t\tdata.push({ \"Consumable\":util.type, \"Year\":previousYear, \"Value\": util.prevMeasurement});\n\t}\n\t\n\tconsole.log(data);\n\t\n\treturn data;\n}", "title": "" }, { "docid": "ba595686160627a779d5afa4ca55c168", "score": "0.5288941", "text": "function loadJson() {\n historicalData = JSON.parse(fs.readFileSync(__dirname + '/data/' + exchange + '_' + pair + '_' + interval + '.json', 'utf8'));\n main();\n}", "title": "" }, { "docid": "f7d2000e78ecb5e6e166e4509308cecb", "score": "0.5288412", "text": "function createLines(json) {\n var meta = json.meta;\n var data = json.data;\n\n var newLines = [];\n\n for (var i=0; i < meta.lines.length; i++) {\n // Get the tag\n var lineTag = meta.lines[i].tag;\n\n newLines.push([]);\n // Generate the list of data (month, measurement)\n for (var j=0; j < data.length; j++) {\n // Assumes data has a \"Month\" tag in each element\n newLines[i].push([data[j][\"Month\"], data[j][lineTag]]);\n }\n }\n return newLines;\n }", "title": "" }, { "docid": "564b58d6f5bfc082a40ce783269a43aa", "score": "0.52828133", "text": "function parseJSONData(objs, row = []){\r\n for (var i in objs) {\r\n if(!objs[i].hasOwnProperty('sub')){\r\n \r\n row.push(objs[i].key)\r\n row.push(objs[i].descr)\r\n row.push(objs[i].src)\r\n row.push(objs[i].url)\r\n row.push(objs[i].coords)\r\n\r\n // get years for first row of array (push it after)\r\n for(y in objs[i].values){\r\n row.push(objs[i].values[y].val)\r\n if(jsonYears.indexOf(objs[i].values[y].year) === -1) \r\n jsonYears.push(objs[i].values[y].year)\r\n } \r\n\r\n if(arrayData.length){\r\n for (var j = 0; j < arrayData[0].length - row.length; j++) {\r\n row.unshift('')\r\n }\r\n }\r\n\r\n arrayData.push(row.splice(0))\r\n row.length = 0\r\n }\r\n\r\n if(objs[i].hasOwnProperty('sub')){\r\n row.push(objs[i].key)\r\n parseJSONData(objs[i].sub, row)\r\n }\r\n }\r\n }", "title": "" }, { "docid": "f7afb8b97dbbf372767c0bcd51e7f7e3", "score": "0.52764654", "text": "function pop(){\n const tempRemove = Object.keys(json)[Object.keys(json).length-1];\n delete json[tempRemove];\n console.log(json);\n document.getElementById(\"changed-text\").innerHTML = JSON.stringify(json);\n}", "title": "" }, { "docid": "41253d8c4e4e9e4588c0627c6bde7d86", "score": "0.5270185", "text": "function processSheetData(data, tabletop) {\n // let prevjson = JSON.parse(fs.readFileSync('./RawData/VideoData.json'))\n let prevjson = {\"cities\":{},\"totalVideos\":0}\n // let prevTotalVideos = prevjson.totalVideos ? prevjson.totalVideos : 0;\n //if (prevTotalVideos === data.length) {\n // console.log(\"No New Videos\")\n // return (prevjson)\n //} else {\n let lines = data\n for (let i = 0; i < lines.length; i++) {\n let currentline = lines[i];\n if (prevjson.cities && prevjson.cities[currentline['City']]) {\n prevjson.cities[currentline['City']].videos.push({\n link: currentline['Link'],\n caption: currentline['Caption'],\n date: currentline['Date']\n })\n } else {\n if (!prevjson.cities) {\n prevjson.cities = {}\n }\n prevjson.cities[currentline['City']] = {\n videos: [{\n link: currentline['Link'],\n caption: currentline['Caption'],\n date: currentline['Date']\n }],\n coordinates: {\n latitude: currentline['Latitude (°N)'],\n longitude: currentline['Longitude (°E)']\n }\n }\n }\n }\n prevjson.totalVideos = lines.length;\n return (prevjson)\n //}\n}", "title": "" }, { "docid": "1a4fe54e24f67be056a900d23cc3a154", "score": "0.52607197", "text": "getSortedTimeline(statsData) {\n let timelineSorted = [];\n let timelineSettings = pathOr(null, ['timeline', 'settings'], statsData);\n let timelineData = pathOr(null, ['timeline', 'data'], statsData);\n if (timelineData && timelineSettings) {\n for (let key of Object.keys(timelineData)) {\n let entry = timelineData[key];\n entry.tc = parseInt(key);\n entry.ts = entry.tc * (timelineSettings.bucket_duration || 60000);\n timelineSorted.push(entry);\n }\n }\n // Sort it by timecode ascending\n timelineSorted.sort(function(a, b) {\n return a.tc - b.tc;\n });\n return timelineSorted;\n }", "title": "" }, { "docid": "6e776380b376abadba9e964249820974", "score": "0.52212006", "text": "function parseJson() {\n\t\tvar json;\n\t\ttry {\n\t\t\tjson = JSON.parse(result.data);\n\t\t} catch (excp) {\n\t\t\tthrow \"No json format: \" + excp;\n\t\t}\n\t\tresult.json = json.locations ? json : { locations: json };\n\n\t\tresult.times[2] = Date.now();\n\t\tresult.times[1] = result.times[2] - result.times[1];\n\t\tshowStatus(\"json: \" + result.times[1] + \"ms, json.locations.length=\" + result.json.locations.length);\n\t\t\n\t\t// check for google location.json layout\n\t\tvar loc = result.json.locations;\n\t\tif (loc && loc.length && \"timestampMs\" in loc[0] && \"latitudeE7\" in loc[0]) {\n\t\t\t// init dates obj\n\t\t\tresult.dates = {\n\t\t\t\t// google is reverse order; avoid sec with fraction\n\t\t\t\tminMillis: Math.floor(+loc[loc.length - 1].timestampMs / 1000) * 1000,\n\t\t\t\tmaxMillis: Math.ceil(+loc[0].timestampMs / 1000) * 1000\n\t\t\t};\n\t\t\tresult.dates.startMillis = result.dates.minMillis;\n\t\t\tresult.dates.endMillis = result.dates.maxMillis;\n\n\t\t\tsetSelected();\n\t\t\tshowStatus(\"location data\" +\n\t\t\t\t\" from \" + result.dates.startDate + \" \" + result.dates.startTime +\n\t\t\t\t\" to \" + result.dates.endDate + \" \" + result.dates.endTime);\n\t\t} else {\n\t\t\tshowStatus(\"no location data found\");\n\t\t\treturn;\n\t\t}\n\n\t\t// chain to next step\n\t\t//next(sliceTimes);\n\t\tnext();\t// done\n\t}", "title": "" }, { "docid": "10a38bac664eb50e099ca90fad84cecb", "score": "0.5211868", "text": "deepClone(data) {\n return JSON.parse(JSON.stringify(data));\n }", "title": "" }, { "docid": "5be2cfed6d8db94b26b572066be49fa9", "score": "0.5202415", "text": "function GetGraphData (callback) {\r\n \r\n $.getJSON('/api/series', function (data) {\r\n \r\n return callback(data.reverse());\r\n \r\n });\r\n \r\n}", "title": "" }, { "docid": "af6b030bb50d1515b3d56d941fde6b3f", "score": "0.51961774", "text": "function setDataObject(dt) {\n\n var dataFilter = [];\n var dmtIndex = 0;\n if (dt !== null) {\n\n dataFilter.push([dt[0][\"created_at\"],\n dt[0][\"firstname\"],\n dt[0][\"lastname\"],\n dt[0][\"city\"],\n dt[0][\"zip\"],\n dt[0][\"birthday\"],\n [dt[0][\"feldersDatum\"]]]);\n\n for (let i = 1; i < dt.length - 1; i++) {\n\n if (dt[i][\"created_at\"] !== dt[i - 1][\"created_at\"]) {\n dmtIndex++;\n dataFilter.push([dt[i][\"created_at\"],\n dt[i][\"firstname\"],\n dt[i][\"lastname\"],\n dt[i][\"city\"],\n dt[i][\"zip\"],\n dt[i][\"birthday\"],\n [dt[i][\"feldersDatum\"]]\n ]);\n } else {\n dataFilter[dmtIndex][6].push(dt[i][\"feldersDatum\"]);\n }\n }\n //console.log(dataFilter);\n return dataFilter;\n\n }\n}", "title": "" }, { "docid": "bfa5eca73486e74d2c277aa6adbc8ba3", "score": "0.5184731", "text": "function combineJson(jsonObj, oldJsonObj){\n for (let i = 0; i < jsonObj.data.stations.length; i++) {\n jsonObj.data.stations[i].name = oldJsonObj.data.stations[i].name;\n }\n return jsonObj;\n}", "title": "" }, { "docid": "59be5d2f1344caf9ef5fbb55a4bfb58a", "score": "0.5159301", "text": "function scrubData(data) {\n var scrubbed = [];\n for (var i = 0; i < data.length; i++) {\n if (i == 0) {\n scrubbed.push([]);\n scrubbed[scrubbed.length - 1].push(data[i]);\n }\n else if (scrubbed[scrubbed.length - 1][0].city != data[i].city) {\n if (data[i].pop > 4500)\n scrubbed.push([]);\n scrubbed[scrubbed.length - 1].push(data[i]);\n }\n else {\n scrubbed[scrubbed.length - 1].push(data[i]);\n }\n }\n return scrubbed;\n }", "title": "" }, { "docid": "3b2a0b7994c80703a08fe0c99088e5e8", "score": "0.515619", "text": "getHistoricalMotorData(num) {\n fetch(serverAddress + `/historical-motor-data?quantity=${encodeURIComponent(num)}`)\n .then(rawData => rawData.json())\n .then(objData => objData.data)\n .then(arrData => arrData.map(item => JSON.parse(item).date).reverse())\n .then(finalData => this.setState({ historicalMotorData: finalData}))\n \n }", "title": "" }, { "docid": "1eb2b54b6d5ca730fb6e1d2bbe1d1eff", "score": "0.5153236", "text": "on_update_data(json) {\n if (json == null) {\n this.series_time = null\n this.series = {}\n this.instruction_nums = []\n this.indices = []\n this.addresses = []\n this.targets = []\n this.modality = {}\n this.y_extents = [-1,1]\n this.downsampling = -1\n this.add_status_msg(BaseWidget.NO_DATA_FOR_TIME_RANGE)\n this.downsampling_span.html('?')\n this.points_span.html('0')\n return\n }\n\n const msg = json.raw_binary_data\n\n const nseries = json.processorSpecific.numSeries\n const points_per_series = json.processorSpecific.pointsPerSeries\n const series_blob_offset = json.processorSpecific.seriesBlobOffset\n const modalities_offset = json.processorSpecific.modalitiesOffset\n this.downsampling = json.processorSpecific.downsampling\n const instruction_nums_offset = json.processorSpecific.instructionNumsOffset\n const indices_offset = json.processorSpecific.indicesOffset\n const addresses_offset = json.processorSpecific.addressesOffset\n const targets_offset = json.processorSpecific.targetsOffset\n\n this.downsampling_span.html(this.downsampling > 1 ? ('/' + this.downsampling.toString()) : 'none')\n this.points_span.html(points_per_series.toString())\n\n // Parse out heatmap binary data\n if (nseries == 0 || points_per_series == 0) {\n this.series_time = null\n this.series = {}\n this.instruction_nums = []\n this.indices = []\n this.addresses = []\n this.targets = []\n this.modality = {}\n this.downsampling = -1\n this.y_extents = [-1,1]\n this.add_status_msg(BaseWidget.NO_DATA_FOR_TIME_RANGE)\n return\n }\n\n const data = new Float32Array(msg, series_blob_offset, nseries * points_per_series) // Skip dims\n const modalities = new Int16Array(msg, modalities_offset, nseries)\n this.series_time = data.subarray(0, points_per_series)\n this.series = {}\n this.modality = {}\n this.y_extents = json.processorSpecific.yExtents\n for (let i = 0; i < this._stat_cols.length; i++) {\n const begin = (i + 1) * points_per_series\n const end = begin + points_per_series\n this.series[this._stat_cols[i]] = data.subarray(begin, end)\n this.modality[this._stat_cols[i]] = modalities[i + 1]\n }\n\n\n // Capture some bp-specific stuff (this should be moved to the bp widget instead)\n if (typeof instruction_nums_offset != 'undefined')\n this.instruction_nums = new BigInt64Array(msg, instruction_nums_offset, points_per_series)\n else\n this.instruction_nums = []\n if (typeof indices_offset != 'undefined')\n this.indices = new BigInt64Array(msg, indices_offset, points_per_series)\n else\n this.indices = []\n if (typeof addresses_offset != 'undefined')\n this.addresses = new BigInt64Array(msg, addresses_offset, points_per_series)\n else\n this.addresses = []\n if (typeof targets_offset != 'undefined')\n this.targets = new BigInt64Array(msg, targets_offset, points_per_series)\n else\n this.targets = []\n }", "title": "" }, { "docid": "48bc0bc935ce2739e7e95c7c75025c24", "score": "0.51362735", "text": "addOpeningMoment(data, keys) {\n let priorData = data.filter(x => x.date <= this.minDate);\n // If no prior data no need to add opening moment\n // - expandMomentsCumulative will start with zero moment for all keys at min date\n if (priorData.length !== 0) {\n let lastPriorDatum = priorData[priorData.length - 1];\n // No need to add opening moment if there is already a cumulative datum at the min date\n if (lastPriorDatum.date.getTime() !== this.minDate.getTime()) {\n let openingMoment = this.newMoment(lastPriorDatum, keys);\n // Change date from last prior moment to minDate\n openingMoment.date = new Date(this.minDate.getTime());\n this.moments.unshift(openingMoment);\n }\n }\n }", "title": "" }, { "docid": "3b4b3375190c18a2c7598672ade71af9", "score": "0.5130049", "text": "function processMainChart(data, callback, update){\n\n\t\t\t// Some more data processing before drawing the chart\n\t\t\t// Adding a last element to each val_history array,\n\t\t\t// with the current timestamp (so all lines extend till the current time)\n\t\t\tvar fullTimeline = _.each(data, function(element, index, list){\n\t\t\t\tvar d = new Date();\n\t\t\t\tcurrentTimestamp = d.getTime();\n\t\t\t\tvar newHistory = {\n\t\t\t\t\tface_val: element.val_history[element.val_history.length - 1].face_val,\n\t\t\t\t\tsocial_val: element.val_history[element.val_history.length - 1].social_val,\n\t\t\t\t\tts: currentTimestamp\n\t\t\t\t}\n\t\t\t\telement.val_history.push(newHistory);\n\t\t\t});\t\t\t\n\n\t\t\tcallback(fullTimeline, update);\n\t\t}", "title": "" }, { "docid": "74c3e58deec00e47b70ae04a68fa126d", "score": "0.51270944", "text": "function ReverseJson(JsonResponse) {\n // Response / input of Json Object Response By Sequence\n PickPackingCtrl.ePage.Masters.JsonObjectResponse = $filter('orderBy')(JsonResponse, 'Sequence');\n\n // Function call to convert the json\n if (PickPackingCtrl.ePage.Masters.JsonObjectResponse.length > 0) {\n ConvertJson(PickPackingCtrl.ePage.Masters.JsonObjectResponse);\n }\n else {\n PickPackingCtrl.ePage.Masters.FramedObject = [];\n }\n\n // Assigning the parent child json to the Tree Object (ng-repeat Obj)\n PickPackingCtrl.ePage.Masters.tree = PickPackingCtrl.ePage.Masters.FramedObject;\n\n if (PickPackingCtrl.ePage.Masters.tree.length > 0) {\n // for first obj response select true \n PickPackingCtrl.ePage.Masters.tree[0].IsSelectedValue = true;\n\n }\n\n }", "title": "" }, { "docid": "ce31685cdd15caa847fe31c4f517a202", "score": "0.5116562", "text": "function processJSON(json_data){\n // verify that the json data is valid\n if('dev_id' in json_data && 'clock' in json_data){\n // set the new newest time\n sensor_data_array[json_data.dev_id-1].newest_time = json_data.clock\n \n // check if the sensor array index doesn't exist, create it.\n while( typeof sensor_data_array[json_data.dev_id-1] == 'undefined'){\n sensor_data_array.push(sensor_data);\n }\n // add the data values from the packet to the sensor_data_array\n if('pressure' in json_data){\n sensor_data_array[json_data.dev_id-1].\n pressure.data.push([json_data.clock, json_data.pressure])\n sensor_data_array[json_data.dev_id-1].\n pressure.data.sort()\n }\n if('temp' in json_data){\n sensor_data_array[json_data.dev_id-1].\n temp.data.push([json_data.clock, json_data.temp])\n sensor_data_array[json_data.dev_id-1].\n temp.data.sort()\n }\n if('humidity' in json_data){\n sensor_data_array[json_data.dev_id-1].\n humidity.data.push([json_data.clock, json_data.humidity])\n sensor_data_array[json_data.dev_id-1].\n humidity.data.sort()\n }\n if('light' in json_data){\n sensor_data_array[json_data.dev_id-1].\n light.data.push([json_data.clock, json_data.light])\n sensor_data_array[json_data.dev_id-1].\n light.data.sort()\n }\n if('moisture' in json_data){\n sensor_data_array[json_data.dev_id-1].\n moisture.data.push([json_data.clock, json_data.moisture])\n sensor_data_array[json_data.dev_id-1].\n moisture.data.sort()\n }\n }\n //console.log(sensor_data_array[json_data.dev_id-1].pressure.data)\n //console.log(sensor_data_array[json_data.dev_id-1].temp.data)\n //console.log(sensor_data_array[json_data.dev_id-1].humidity.data)\n //console.log(sensor_data_array[json_data.dev_id-1].light.data)\n //console.log(sensor_data_array[json_data.dev_id-1].moisture.data)\n}", "title": "" }, { "docid": "88d9a73683cd92464e793cbcd92ff48c", "score": "0.51095", "text": "static fromJSON(json) {\n let sections = [],\n inserted = [];\n\n for (let i = 0; i < json.length; i++) {\n let part = json[i];\n\n if (typeof part == \"number\") {\n sections.push(part, -1);\n } else if (part.length == 1) {\n sections.push(part[0], 0);\n } else {\n while (inserted.length < i - 1) inserted.push(_text.Text.empty);\n\n inserted[i] = _text.Text.of(part[1]);\n sections.push(part[0], inserted[i].length);\n }\n }\n\n return new ChangeSet(sections, inserted);\n }", "title": "" }, { "docid": "f1a644982e2f7fdc9d9f312b14c91d45", "score": "0.508408", "text": "function updateTraffic(json) {\n lim = Math.min(index + 50, json.length - 1)\n while (index < lim) {\n addPage(json[index++])\n }\n if (lim < json.length -1) updateView();\n}", "title": "" }, { "docid": "26c30a545c0a090999b69f867b3641a8", "score": "0.50815725", "text": "_addHistory(array, data) {\n array.push(data);\n if (array.length > 10) { // limit history length\n array.splice(0, 1);\n }\n }", "title": "" }, { "docid": "1a39dfa600deee25a57bbe16dbb2c8e0", "score": "0.5077135", "text": "function resetData(){\n $.getJSON('http://www.whateverorigin.org/get?url=' + encodeURIComponent(topAppsurl) + '&callback=?', function(data){\n let onlyNewItems = new Set();\n let t = $(data.contents).find('div.Vpfmgd');\n for(let i=0; i<t.length; i++){\n let item = {\n link: $(t[i]).find('a.poRVub').attr('href').split('?')[1],\n img: $(t[i]).find('img.T75of').attr('data-src'),\n title: $(t[i]).find('div.WsMG1c').text(),\n };\n if(!titleDataSet.has(item.title)){\n onlyNewItems.add(item);\n titleDataSet.add(item.title);\n dataset.add(item);\n }\n }\n appendNewParticularChildrens(onlyNewItems);\n\n //clear onlyNewItems because items are no longer new to us, they have been added to DOM\n onlyNewItems.clear();\n });\n}", "title": "" }, { "docid": "29db4fb1b43c8c5c89c05dc8803bb74c", "score": "0.50696844", "text": "static earliest(data) {\n return data.length && data.filter(clear).length ?\n last(data.filter(clear).sort((a, b) => new Date(b).valueOf() - new Date(a).valueOf())) : undefined;\n }", "title": "" }, { "docid": "db1f15df0237f5ffd1e53880195dcb22", "score": "0.50583583", "text": "undo() {\n this.history.pop();\n const last = _.last(this.history);\n _.each(last, (value, key) => {\n this[key] = JSON.parse(JSON.stringify(value));\n });\n }", "title": "" }, { "docid": "c5ca16397c06a4b9d03445cc98998f72", "score": "0.50537", "text": "function JSONClone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "c5ca16397c06a4b9d03445cc98998f72", "score": "0.50537", "text": "function JSONClone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "c5ca16397c06a4b9d03445cc98998f72", "score": "0.50537", "text": "function JSONClone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "c5ca16397c06a4b9d03445cc98998f72", "score": "0.50537", "text": "function JSONClone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "c5ca16397c06a4b9d03445cc98998f72", "score": "0.50537", "text": "function JSONClone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "title": "" }, { "docid": "e91bac7d02f57fa2e4cc953cb7ce85ac", "score": "0.5049681", "text": "function fixFlickrJSON(data) {\n\n var content = null;\n \n for (var key in data) {\n\n if (key == '_content') {\n content = data._content;\n break;\n } else if (typeof(data[key]) == 'object') {\n data[key] = fixFlickrJSON(data[key]);\n }\n \n }\n \n if (content != null) {\n data = content;\n }\n \n return data;\n \n}", "title": "" }, { "docid": "3b79255da7b6fb315952b7a1af95cb46", "score": "0.5042081", "text": "bootstrap(json) {\n if (!json) {\n return;\n }\n\n this.cached = this.cached.update(() => {\n return Immutable.fromJS(JSON.parse(json));\n });\n return this.cached;\n }", "title": "" }, { "docid": "11a1c2baff3d46a4197e0a762ab19b43", "score": "0.5038528", "text": "function previousComments(data){\n //console.log(data.Comments.length)\n for (var i = 0; i < data.Comments.length; i++) {\n //create li for each of the comments\n var newlist = createList(data.Comments, i)\n //console.log(i)\n $(`#${data._id}`).append(newlist)\n }\n\n }", "title": "" }, { "docid": "39e99a2fea76b2054caec9a28253afcd", "score": "0.5037856", "text": "fixJsonData() {\n return this.data.map((row, i) => {\n // Create an array with the string splited by separator\n stringSplited = row.o.split(\"/\");\n let result = this.extractData(stringSplited, row.n);\n return result;\n });\n }", "title": "" }, { "docid": "a2c8d0fca5d8d24f9aaa5550e6fd7e89", "score": "0.502556", "text": "function sortData(data) {\n data.sort(function (a, b) {\n return a.start - b.start\n });\n return data;\n }", "title": "" }, { "docid": "b367ccaf43a04c4c0cfa47d239ea647d", "score": "0.5011954", "text": "function LoadData() {\n\n //Creating the new timeline \n var timelineContainer = $('#timeline_container')\n var documentBody = $(document.body);\n \n // Remove old timeline\n $('#timeline').remove();\n\n // Create a new timeline\n var appending = $('<div>').attr('id', 'timeline').appendTo(timelineContainer);\n var timeline_data = [];\n var Features = {};\n\n \n $('#timeline').addClass('TimelineContainer');\n \n\n}", "title": "" }, { "docid": "cd68e4a5b5b1c3b6f34b0949a6d2a23f", "score": "0.501151", "text": "getProcessedJson(data, header) {\n let keys = this.getKeys(data, header);\n let newData = [];\n let _self = this;\n data.map(function(item, index) {\n let newItem = {};\n for (let label in keys) {\n let property = keys[label];\n newItem[label] = _self.getValue(property, item);\n }\n newData.push(newItem);\n });\n\n return newData;\n }", "title": "" }, { "docid": "07be25e9b86437e51f2955011b45334f", "score": "0.5011288", "text": "update()\n { \n let nextTime = this.time + 1;\n this.history.set(nextTime, []);\n for (let x=1; x != this.values.length - 1; ++x)\n {\n for (let y=1; y != this.values[x].length - 1; ++y)\n {\n let tmp_next = this.getNext(x, y);\n if (this.values[x][y] !== tmp_next)\n this.history.get(nextTime).push({'x': x, 'y': y, 'new': tmp_next, 'old': this.values[x][y]});\n }\n }\n return this;\n }", "title": "" }, { "docid": "8d93bc7be9da3c97c6570752cd1b0bbb", "score": "0.50085366", "text": "function transformData(data) {\n var newData = [];\n for (var key in data) {\n var value = data[key];\n var tempObject = {\n key: key\n };\n tempObject.values = value;\n newData.push(tempObject);\n }\n\n return newData;\n }", "title": "" }, { "docid": "8d489db59a2fd3e93bd3c52a4b109758", "score": "0.5002793", "text": "async function readAndParseGithubData() {\n const dataFile = readFileSync('./data.json', { encoding: 'utf-8' })\n const parsed = JSON.parse(dataFile)\n\n let total = parsed.length\n let count = parsed.length - 100\n let res = []\n\n while (total > 0) {\n const arrayContent = parsed.slice(count, total)\n\n if (arrayContent.length > 0) {\n res = res.concat([arrayContent])\n }\n\n total = total - 100\n count = count - 100\n }\n\n if (total > -100) {\n total = total + 100\n res = res.concat([parsed.slice(0, total)])\n }\n\n const resParsed = await res.map((item, i) => {\n console.log(`${i} = ${item.length}`)\n\n return item.map(it => ({\n collectionId: 18455651,\n title: it.full_name,\n link: it.html_url,\n tags: [\"github\", `${it.language}`],\n created: it.created_at,\n excerpt: it.description\n }))\n })\n console.log(`total = ${resParsed.length}`)\n await writeFileSync('./newData.json', JSON.stringify(resParsed))\n}", "title": "" }, { "docid": "acf81b344cc77e2a61ba5047bc1c26a5", "score": "0.4998871", "text": "function DeepCopy(initialState){\n motionEntityList=[]\n for(i=0;i<initialState.motionEntityList.length;i++){\n //motionEntityList.push(Object.assign({Entity},initialState.motionEntityList[i]));\n motionEntityList.push($.extend(true,{},initialState.motionEntityList[i]));\n }\n staticEntityList=[]\n for(i=0;i<initialState.staticEntityList.length;i++){\n //staticEntityList.push(Object.assign({Entity},initialState.staticEntityList[i]));\n staticEntityList.push($.extend(true,{},initialState.staticEntityList[i]));\n }\n backgroundList=[]\n for(i=0;i<initialState.backgroundList.length;i++){\n //backgroundList.push(Object.assign({Entity},initialState.backgroundList[i]));\n backgroundList.push($.extend(true,{},initialState.backgroundList[i]));\n }\n return new levelData(motionEntityList,staticEntityList,backgroundList);\n}", "title": "" }, { "docid": "4b24fa6670c4638202b8ccec8571473e", "score": "0.49936724", "text": "function JSONClone (obj) {\n return JSON.parse(JSON.stringify(obj))\n}", "title": "" }, { "docid": "9ffdb09dfb2f546d887c1749a37384f0", "score": "0.4991459", "text": "shiftItems(index){\n for(let i = index; i < this.length - 1; i++){\n this.data[i] = this.data[i+1];\n }\n delete this.data[this.length - 1];\n this.length--;\n }", "title": "" }, { "docid": "3f49f26c0ce7c78d8aa962b0014ce092", "score": "0.49850726", "text": "function refreshJSON() {\n if (typeof players !== 'undefined' && players.length > 0) {\n lastPlayers = players.slice();\n }\n players = [];\n duration = [];\n xmlhttp.open('GET', url, false);\n xmlhttp.send();\n for (i in playerData) {\n players.push(playerData[i].name);\n duration.push(playerData[i].playtime);\n }\n}", "title": "" }, { "docid": "51ab8ade0ec38dd881a299a782595ab6", "score": "0.4978438", "text": "static createListFromJson(jsonObj)\n\t{\n\t\tvar answer = [];\n\t\tfor (var nextBlogPostIndex = 0; nextBlogPostIndex < jsonObj.length; nextBlogPostIndex++)\n\t\t{\n\t\t\tanswer.push(NextBlogPostCard.createFromJson(jsonObj[nextBlogPostIndex]));\n\t\t}\n\t\treturn answer;\n\t}", "title": "" }, { "docid": "156a518b0fab69db1c1de04d818f4dbc", "score": "0.4976484", "text": "function retainCommonTimeFrame(widget, data) {\n\t\t\tif (!data || data.length == 0)\n\t\t\t\treturn [];\n\t\t\tif (widget.options.drawAggregates !== false && widget.options.drawAggregates !== undefined)\n\t\t\t\treturn addHistory(widget, data);\n\t\t\tlet now = Date.now();\n\t\t\tlet startOfLastMinute = now - 60000;\n\t\t\tlet startOfShortestSeries = data.reduce((high, e) => Math.max(e.points[0], high), 0);\n\t\t\tlet startCutoff = data.length == 1 ? startOfShortestSeries : Math.min(startOfLastMinute, startOfShortestSeries);\n\t\t\tlet endOfShortestSeries = data.reduce((low, e) => {\n\t\t\t\tlet endTime = e.points[e.points.length - 2];\n\t\t\t\treturn endTime > now - 4000 ? Math.min(endTime, low) : low;\n\t\t\t}, now);\n\t\t\tlet endCutoff = endOfShortestSeries;\n\t\t\tdata.forEach(function(seriesData) {\n\t\t\t\tlet src = seriesData.points;\n\t\t\t\tif (src.length == 4 && src[2] >= startCutoff) {\n\t\t\t\t\tif (src[1] == src[3]) {\n\t\t\t\t\t\t// extend a straight line between 2 points to cutoff\n\t\t\t\t\t\tseriesData.points = [Math.max(seriesData.observedSince, Math.min(startOfShortestSeries, src[2] - 59000)), src[1], src[2], src[3]];\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlet points = [];\n\t\t\t\t\tfor (let i = 0; i < src.length; i += 2) {\n\t\t\t\t\t\tif (src[i] >= startCutoff && src[i] <= endCutoff) {\n\t\t\t\t\t\t\tpoints.push(src[i]);\n\t\t\t\t\t\t\tpoints.push(src[i+1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tseriesData.points = points;\t\t\t\t\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn data.filter(seriesData => seriesData.points.length >= 2 \n\t\t\t\t&& seriesData.points[seriesData.points.length - 2] > startOfLastMinute);\n\t\t}", "title": "" }, { "docid": "546f232e294721daaf638a128477085b", "score": "0.497135", "text": "function formatData(data) {\n for (var i=0; i < data['list'].length; i++) {\n var day = retrieveDay(data['list'][i]['dt']);\n data['list'][i]['day'] = day;\n var icon = retrieveWeatherIcon(data['list'][i]['weather'][0]['main']);\n data['list'][i]['icon'] = icon\n data['list'][i]['dt'] = convertUnixTimeStamp(data['list'][i]['dt'], '');\n data['list'][i]['deg'] = degreeToText(data['list'][i]['deg']);\n data['list'][i]['sunrise'] = convertUnixTimeStamp(data['list'][i]['sunrise'], 'hours');\n data['list'][i]['sunset'] = convertUnixTimeStamp(data['list'][i]['sunset'], 'hours');\n }\n\n return data\n}", "title": "" }, { "docid": "609828ecdd6a18ca513048617e219844", "score": "0.49659622", "text": "function prepData() {\n var t, v;\n var dt = Number($scope.datasource.deltaT);\n var len = Math.ceil($scope.trange / (dt * $scope.tscale ));\n var dlen = $scope.buffer.data.length;\n if (len > dlen) {\n len = dlen;\n }\n\n var plotData = [];\n\n for (var i = 0; i < len; i++) {\n t = -dt * i * $scope.tscale;\n v = $scope.buffer.data[dlen - 1 - i];\n //t = $scope.buffer.time[dlen-1-i] * $scope.tscale;\n plotData.push([t, v]);\n }\n return plotData;\n }", "title": "" }, { "docid": "e30b847cc7b80d3b8c048b5c345c89a4", "score": "0.4962687", "text": "downloadData(){\n let jsonData = JSON.parse(JSON.stringify(this.graphData));\n // data is an array of objects that might be deeply nested (with more than 1 level)\n let flatJSONData = []\n _.forEach(jsonData, function(item){\n flatJSONData.push(flatten(item));\n });\n return flatJSONData;\n }", "title": "" }, { "docid": "6d2f9f1587f19a45a0bf3178bef0767a", "score": "0.49579963", "text": "function JSONLoader() {\n var navdata;\n var count;\n var length;\n\n /**\n * Loads a JSON-file.\n * @param {File} file - The JSON-file.\n */\n this.loadJSON = function(file) {\n fr = new FileReader();\n fr.onload = function (e) {\n lines = e.target.result;\n navdata = (JSON.parse(lines))[0].data;\n length = navdata.length;\n count = 0;\n console.log(navdata);\n };\n\n fr.readAsText(file);\n };\n\n /**\n * Returns the next set of navdata.\n * @returns {Navdata}\n */\n this.getNextDataSet = function() {\n // check if end of object is reached\n if (count == length) {\n return null;\n }\n\n dataSet = navdata[count];\n count++;\n\n navdataSet = new Navdata(\n dataSet.roll != undefined ? dataSet.roll : null,\n dataSet.pitch != undefined ? dataSet.pitch : null,\n dataSet.yaw != undefined ? dataSet.yaw : null,\n dataSet.thrust != undefined ? dataSet.thrust : null,\n dataSet.deapth != undefined ? dataSet.deapth : null,\n dataSet.hdgd != undefined ? dataSet.hdgd : null,\n dataSet.acclx != undefined ? dataSet.acclx : null,\n dataSet.accly != undefined ? dataSet.accly : null,\n dataSet.acclz != undefined ? dataSet.acclz : null,\n dataSet.magx != undefined ? dataSet.magx : null,\n dataSet.magy != undefined ? dataSet.magy : null,\n dataSet.magz != undefined ? dataSet.magz : null,\n dataSet.gyrox != undefined ? dataSet.gyrox : null,\n dataSet.gyroy != undefined ? dataSet.gyroy : null,\n dataSet.gyroz != undefined ? dataSet.gyroz : null,\n dataSet.lacclx != undefined ? dataSet.lacclx : null,\n dataSet.laccly != undefined ? dataSet.laccly : null,\n dataSet.lacclz != undefined ? dataSet.lacclz : null,\n dataSet.gravx != undefined ? dataSet.gravx : null,\n dataSet.gravy != undefined ? dataSet.gravy : null,\n dataSet.gravz != undefined ? dataSet.gravz : null,\n dataSet.timestamp != undefined ? dataSet.timestamp : null\n );\n\n console.log(\"JSONLoader received data set \" + count);\n return navdataSet;\n }\n}", "title": "" }, { "docid": "f68dae2a4b0da41da1043aa043cd50d9", "score": "0.49573034", "text": "function loadData()\n{\n loadJSON('lastSearch.json', loadedData);\n}", "title": "" }, { "docid": "7c7eaae7b808629957bdbffc77cafa9f", "score": "0.49534792", "text": "function parseJson(json_data) {\n sitesObj = JSON.parse(json_data);\n\n // Once the json file has been stored, we retrieve the source file\n loadingJson = false;\n getFile(chrome.runtime.getURL(\"sourcefile.tsv\"));\n}", "title": "" }, { "docid": "582467049edba892756cc0b468668e48", "score": "0.49519426", "text": "function sortTimeline(timeline){\r\n timeline.sort((a, b) => (a.timestamp.localeCompare(b.timestamp)) * -1);\r\n }", "title": "" }, { "docid": "0368a6327e376582c4ec79c2b6fe8b07", "score": "0.4938829", "text": "function getLatestTempData() {\n\t\n\tvar request = new XMLHttpRequest;\n\trequest.overrideMimeType(\"application/json\");\n\trequest.open(\"GET\", window.location.origin + \"/temp_data.json\", true);\n\trequest.onload = function() {\n\t\twindow.g_lastTempData = JSON.parse(request.responseText);\n\t\t// console.log(\"new temps: \" + JSON.stringify(window.g_lastTempData));\n\t};\n\trequest.send(null);\n}", "title": "" }, { "docid": "9aa83ab41ed5aebf14450a64a045d2c3", "score": "0.49303198", "text": "function extendCompletedSPChart(dataSet) {\r\n var count = dataSet.length;\r\n\r\n //next date\r\n var nextDate = new Date().getTime();\r\n\r\n dataSet.push({ x: nextDate, y: dataSet[count - 1].y });\r\n}", "title": "" }, { "docid": "79e30d0f574bd71a00343fb834a3a57d", "score": "0.49267483", "text": "function modifyJSON(data) {\n let polished = alpha.util.polish(data).data;\n for (curr in polished) {\n delete polished[curr].market_open;\n delete polished[curr].market_high;\n delete polished[curr].market_low;\n delete polished[curr].market_close;\n delete polished[curr].cap;\n }\n let str = JSON.stringify(polished);\n str = str.replace(\"\\\"usd_open\\\":\", \"\\\"open\\\":\");\n str = str.replace(\"\\\"usd_high\\\":\", \"\\\"high\\\":\");\n str = str.replace(\"\\\"usd_low\\\":\", \"\\\"low\\\":\");\n str = str.replace(\"\\\"usd_close\\\":\", \"\\\"close\\\":\");\n polished = JSON.parse(str);\n return polished;\n}", "title": "" }, { "docid": "7eb5e03bc41e1edc6240d8367de20989", "score": "0.49253213", "text": "function json_to_laps(json, xObject) { \n var laps = [];\n var time_x0 = 0, distance_x0 = 0;\n for (var i = 0, n = json.laps.length; i < n; i++) { \n var lap = {\n time: { \n x0: time_x0,\n width: time.value(json.laps[i]) - time_x0\n },\n distance: { \n x0: distance_x0,\n width: distance.value(json.laps[i]) - distance_x0\n }\n };\n time_x0 = time_x0 + lap.time.width; \n distance_x0 = distance_x0 + lap.distance.width; \n // alert (lap.x0 + \" \" + lap.x1);\n laps.push(lap);\n }\n return laps;\n}", "title": "" }, { "docid": "364f9f486c1ef9ceeaaa9c56695e2cfc", "score": "0.49251643", "text": "function reformatData(obj) {\n var dataDict = {};\n for (var repo in obj['data']) {\n if (obj['data'].hasOwnProperty(repo)) {\n var repoDict = obj['data'][repo],\n issuesClosed = repoDict['issues_Closed']['totalCount'],\n issuesOpen = repoDict['issues_Open']['totalCount'],\n doubleKey = [issuesClosed, issuesOpen];\n if (!Object.keys(dataDict).contains(doubleKey)) {\n dataDict[doubleKey] = [];\n }\n dataDict[doubleKey].push(repo);\n }\n }\n var data = [];\n for (var doubleKey in dataDict) {\n if (dataDict.hasOwnProperty(doubleKey)) {\n var numbers = doubleKey.split(',');\n var dataset = {\n names: dataDict[doubleKey].sort(),\n valueX: +numbers[0], // issues closed\n valueY: +numbers[1] // issues open\n };\n data.push(dataset);\n }\n }\n return data;\n }", "title": "" }, { "docid": "781f02ac87d335bcd5bb4c7a42ae2fcd", "score": "0.49177715", "text": "getHistoricalSensorData(num) {\n fetch(serverAddress + `/historical-sensor-data?quantity=${encodeURIComponent(num)}`)\n .then(rawData => rawData.json())\n .then(objData => objData.data)\n .then(arrData => arrData.map(item => JSON.parse(item)).reverse()) \n .then(finalData => this.setState({ historicalSensorData: finalData }))\n }", "title": "" }, { "docid": "b896fae7ea27f3bbe7a30814726cdb2a", "score": "0.49157742", "text": "function parseData(json){\n\n var blockData = [];\n\n $.each(json.data, function(key1, item) {\n blockData.push({\"height\": item.height, \"block_time\": item.block_time});\n });\n\n evalTime(blockData);\n}", "title": "" }, { "docid": "5228305dbeb8ed1a82775622b21be11f", "score": "0.4901937", "text": "function genRow(data) {\n\t\t\tif (typeof(data[4]) === \"string\" && data[4].indexOf(\"{\") > -1) {\n\t\t\tvar tmp = $.parseJSON(data[4]);\n\t\t\tdata[4] = tmp.oldStatus;\n\t\t\tdata[5] = null;\n\t\t\t}\n\t\t\treturn data;\n\t\t}", "title": "" }, { "docid": "c51662dd576661da7e0550f5522fd5ac", "score": "0.48934305", "text": "function flipy(grid) {\n\tlet data = JSON.parse(JSON.stringify(grid));\n\tdata.body.reverse();\n\treturn data;\n}", "title": "" }, { "docid": "c357c9a870f9a0ecad4f8ed877e56e90", "score": "0.48925528", "text": "function callback(result) {\n var data = result;\n console.log(data);\n API_data =[\n {\n name: 'Alex',\n data: [\n [Date.UTC(2011, 1, 1), 8],\n [Date.UTC(2011, 2, 1), 9],\n [Date.UTC(2011, 3, 1), 10],\n [Date.UTC(2011, 4, 1), 10],\n [Date.UTC(2011, 5, 1), 8],\n [Date.UTC(2011, 6, 1), 7],\n [Date.UTC(2011, 7, 1), 6],\n [Date.UTC(2011, 8, 1), 7],\n [Date.UTC(2011, 9, 1), 5],\n [Date.UTC(2011, 10, 1), 4],\n [Date.UTC(2011, 11, 1), 4]\n ]},\n {\n name: \"Sally\",\n data: [\n [Date.UTC(2011, 1, 1), 1],\n [Date.UTC(2011, 2, 1), 3],\n [Date.UTC(2011, 3, 1), 1],\n [Date.UTC(2011, 4, 1), 1],\n [Date.UTC(2011, 5, 1), 1],\n [Date.UTC(2011, 6, 1), 4],\n [Date.UTC(2011, 7, 1), 3],\n [Date.UTC(2011, 8, 1), 6],\n [Date.UTC(2011, 9, 1), 7],\n [Date.UTC(2011, 10, 1), 7],\n [Date.UTC(2011, 11, 1), 8]\n ]},\n {\n name: \"Erin\",\n data: [\n [Date.UTC(2011, 1, 1), 3],\n [Date.UTC(2011, 2, 1), 2],\n [Date.UTC(2011, 3, 1), 3],\n [Date.UTC(2011, 4, 1), 4],\n [Date.UTC(2011, 5, 1), 5],\n [Date.UTC(2011, 6, 1), 7],\n [Date.UTC(2011, 7, 1), 8],\n [Date.UTC(2011, 8, 1), 6],\n [Date.UTC(2011, 9, 1), 6],\n [Date.UTC(2011, 10, 1), 6],\n [Date.UTC(2011, 11, 1), 7]\n ]}\n ]\n\n\n\n Highcharts.chart('container', {\n credits: {\n enabled: false\n },\n\n exporting: {\n enabled: false\n },\n\n subtitle: {\n text: 'Year 2017'\n },\n\n\n title: {\n text: 'My Group Netflix Usage'\n },\n\n subtitle: {\n text: 'Year 2017'\n },\n\n yAxis: {\n title: {\n text: 'Hours of Netflix Usage'\n }\n },\n xAxis: {\n type: 'datetime',\n tickInterval: 30 * 24 * 3600 * 1000,\n min: Date.UTC(2011, 1, 1),\n max: Date.UTC(2011, 12, 1),\n labels: {\n rotation: 45,\n step: 1,\n style: {\n fontSize: '13px',\n fontFamily: 'Arial,sans-serif'\n }\n },\n dateTimeLabelFormats: { // don't display the dummy year\n month: '%b \\'%y',\n year: '%Y'\n }\n },\n legend: {\n layout: 'vertical',\n align: 'right',\n verticalAlign: 'middle'\n },\n\n plotOptions: {\n series: {\n label: {\n connectorAllowed: false\n },\n pointStart: 2010\n }\n },\n\n series: API_data,\n\n\n responsive: {\n rules: [{\n condition: {\n maxWidth: 500\n },\n chartOptions: {\n legend: {\n layout: 'horizontal',\n align: 'center',\n verticalAlign: 'bottom'\n }\n }\n }]\n }\n\n });\n}", "title": "" }, { "docid": "2c41eba585baac41fb4ddd5b4ee5e8c8", "score": "0.48900074", "text": "static rearrangeData(data, keyName) {\n let array = [...data];\n array = array\n .sort((a, b) => a[keyName] - b[keyName])\n .filter(record => record[keyName] !== 0);\n\n const result = [];\n\n while (array.length) {\n result.push(array[array.length - 1]);\n array.pop();\n\n if (array.length) {\n result.push(array[0]);\n array.shift();\n }\n }\n\n return result;\n }", "title": "" }, { "docid": "f11e7188e56b0f4db66938bc8ce43b6a", "score": "0.48860875", "text": "function parseDataFromGitHub (response) {\n return JSON.parse(response)\n .reduce(function(res, elem) {\n var parsed = elem.name.split('.')[0].split('-');\n var title = parsed.splice(3).join(' ');\n var date = {\n year: parsed[0],\n month: parsed[1],\n day: parsed[2]\n };\n\n elem.title = title;\n elem.date = date;\n\n res.push(elem);\n return res;\n }, [])\n .filter(function (elem) {\n return elem.title.length > 0;\n })\n .reverse();\n }", "title": "" }, { "docid": "86ddf0290a45950f56ac589bf6376e16", "score": "0.48792696", "text": "timelineData(){\n return {\n content: this.name,\n start: this.start,\n end: this.end\n }\n }", "title": "" }, { "docid": "7e732e0d6fa3d690a63b83944ea996d6", "score": "0.48783526", "text": "static latestTime(data) {\n return data.length && data.filter(clear).length ?\n first(data.filter(clear).map(v => new Date(v)).sort((a, b) => new Date().setHours(b.getHours(), b.getMinutes(), b.getSeconds()) -\n new Date().setHours(a.getHours(), a.getMinutes(), a.getSeconds()))) : undefined;\n }", "title": "" }, { "docid": "0d62228736aafda472da12c177454fba", "score": "0.48738995", "text": "_shiftItems(index) {\n for (let i = index; i < this.length - 1; i++) {\n this.data[i] = this.data[i + 1];\n }\n // delete the last item and decrease the length.\n delete this.data[this.length - 1];\n this.length--;\n }", "title": "" }, { "docid": "69cae8d35af436d740744de1820690be", "score": "0.48522097", "text": "displayReverse() {\r\n let current = this.tail;\r\n console.log(current.data);\r\n while (current !== this.head) {\r\n current = current.prev;\r\n console.log(current.data);\r\n }\r\n }", "title": "" }, { "docid": "5a4114804787530d1d53e30797b2c1ad", "score": "0.48520094", "text": "unnestData(data) {\n let unnestedData = [];\n for (let [target, sourcePosts] of Object.entries(data)) {\n for (let key in sourcePosts) {\n let post = Object.assign({}, sourcePosts[key]);\n post.SOURCE_SUBREDDIT = target;\n unnestedData.push(post);\n }\n }\n return unnestedData;\n }", "title": "" }, { "docid": "cdb53667c25fbb41c316d1a27df194cc", "score": "0.48515603", "text": "function prepareNestedDataFromJson(data) {\n\n for (let currentKey in data) {\n\n if (data[currentKey] !== null) {\n\n if (typeof (data[currentKey]) === \"object\") {\n\n if (parent === \"trajectory-data\") {\n currentTime = currentKey;\n if (!timeSteps.includes(currentKey)) {\n timeSteps.push(parseFloat(currentKey));\n nestedData.set(currentKey, d3.map());\n vesicleStates.set(currentKey, d3.map());\n }\n }\n\n if (parent === \"data\") {\n currentNode = currentKey;\n\n if (!nodeIdentifiers.includes(currentKey)) {\n nodeIdentifiers.push(currentKey)\n\n }\n nestedData.get(currentTime).set(currentNode, d3.map())\n\n }\n\n if (parent === \"subsections\") {\n currentCompartment = currentKey;\n if (!compartmentIdentifiers.includes(currentKey)) {\n compartmentIdentifiers.push(currentKey);\n\n }\n if (nestedData.get(currentTime).get(currentNode) !== undefined) {\n nestedData.get(currentTime).get(currentNode).set(currentCompartment, d3.map())\n }\n }\n\n if (currentKey === \"positions\") {\n if (nestedData.get(currentTime).get(currentNode) !== undefined) {\n nestedData.get(currentTime).get(currentNode).get(currentCompartment).set(currentKey, data[currentKey]);\n }\n }\n const grandparent = parent;\n parent = currentKey;\n prepareNestedDataFromJson(data[currentKey]);\n parent = grandparent;\n\n } else {\n\n if (parent === \"concentrations\") {\n currentSpecies = currentKey;\n if (!speciesIdentifiers.includes(currentKey)) {\n speciesIdentifiers.push(currentKey);\n }\n if (nestedData.get(currentTime).get(currentNode) !== undefined) {\n nestedData.get(currentTime).get(currentNode).get(currentCompartment).set(currentKey, data[currentKey]);\n\n }\n\n }\n\n if (currentKey === \"state\") {\n vesicleStates.get(currentTime).set(currentNode, data[currentKey]);\n }\n\n if (currentKey === \"timeSteps-unit\") {\n timeUnit = data[currentKey];\n } else if (currentKey === \"concentration-unit\") {\n concentrationUnit = data[currentKey]\n } else if (currentKey === \"simulation-width\") {\n simulationWidth = data[currentKey]\n } else if (currentKey === \"simulation-height\") {\n simulationHeight = data[currentKey]\n }\n\n }\n }\n }\n}", "title": "" } ]
4ab5bbb65e12683265797fe4f9c1b7a0
Handler for dragging no longer over an element.
[ { "docid": "88e018ce6dd4a8728f293e6d44550b5c", "score": "0.62451595", "text": "function handleDragLeave() {\n this.classList.remove('over');\n }", "title": "" } ]
[ { "docid": "9f6cade4ec8489708c8d2880a4511b37", "score": "0.70727825", "text": "function stopDragover() {\n placeholder.remove();\n element.removeClass(\"dndDragover\");\n return true;\n }", "title": "" }, { "docid": "5a8b6f436c0c5c9bf8a8dc172943fe45", "score": "0.6992945", "text": "function stopDragover() {\n placeholder.remove();\n element.removeClass(\"dndDragover\");\n return true;\n }", "title": "" }, { "docid": "5a8b6f436c0c5c9bf8a8dc172943fe45", "score": "0.6992945", "text": "function stopDragover() {\n placeholder.remove();\n element.removeClass(\"dndDragover\");\n return true;\n }", "title": "" }, { "docid": "eb4d4e5f2be2ffc51f0cfd28c487ba7b", "score": "0.6974002", "text": "function stopDragover() {\n placeholder.remove();\n element.removeClass('dndDragover');\n return true;\n }", "title": "" }, { "docid": "c00571fcf84c2b47d0666c4a6d623a82", "score": "0.673683", "text": "function onMouseUp()\n{\n document.removeEventListener(getMouseMove(), onMouseMove); //stop drag\n}", "title": "" }, { "docid": "c0fa273a594f118b76e71ed4ace5240b", "score": "0.6631138", "text": "clearDragOver() {\n this._clearEvent(this.dragOverEvents);\n }", "title": "" }, { "docid": "3717ae30a7c7bbfb0e3503d8a5da8ecb", "score": "0.66038203", "text": "function draggingOver(event) {\n event.preventDefault();\n // console.log(event.target)\n}", "title": "" }, { "docid": "d5a8cfeea91435e9ce9d6acf909aff33", "score": "0.6595426", "text": "function mouseReleased() {\n dragging = false;\n}", "title": "" }, { "docid": "ea4b225eec39109ec715540254cd3c9c", "score": "0.6592969", "text": "function dragOver(e) {\n // console.log('Event:', 'dragover');\n e.preventDefault();\n}", "title": "" }, { "docid": "85f8c44d854bf3b66d7b12d5b1427881", "score": "0.65906394", "text": "onMouseUp(event) {\r\n this.isDragging = false;\r\n this.isPanning = false;\r\n if (this.layout && typeof this.layout !== 'string' && this.layout.onDragEnd) {\r\n this.layout.onDragEnd(this.draggingNode, event);\r\n }\r\n }", "title": "" }, { "docid": "71c86dde907b22de5e35ffb50ac73fd4", "score": "0.6590283", "text": "function dragOver(event) {\n event.preventDefault();\n}", "title": "" }, { "docid": "1649489363a429d8b27da7faf71d8315", "score": "0.6561757", "text": "handleDragOver(event) {\n event.preventDefault();\n }", "title": "" }, { "docid": "7f68cd4ce15976da2006c6103e5af152", "score": "0.6552457", "text": "function OnMouseUp(e)\n{\n if (dragElement != null)\n {\n dragElement.style.zIndex = oldZIndex;\n document.onmousemove = null;\n dragElement = null;\n }\n}", "title": "" }, { "docid": "1203c1a425d95d62769416e185d281a1", "score": "0.65521634", "text": "function dragOver(e) {\n e.preventDefault();\n //console.log('over');\n\n}", "title": "" }, { "docid": "0a883cc5d1d36071f8864615f33a0b2e", "score": "0.65491474", "text": "_onChildDragOver(evt, element) {\n if (!this._allowDrag || !this._dragging) return;\n\n if (element.allowDrop && this._dragItems.indexOf(element) === -1) {\n this._dragOverItem = element;\n } else {\n this._dragOverItem = null;\n }\n\n this._updateDragHandle();\n this._onDragMove(evt);\n }", "title": "" }, { "docid": "774af1bbd2ff8524a450cd8e3bc36b42", "score": "0.6538517", "text": "function mouseUp(e) {\n dragok = false;\n if (target != null) {\n target.unDrag();\n }\n }", "title": "" }, { "docid": "e4eda4e0d15df20e2b9a9279a4f1b3f5", "score": "0.6537797", "text": "removeDragOver(dragOverEvent) {\n this._removeEvent(dragOverEvent, this.dragOverEvents);\n }", "title": "" }, { "docid": "d142f9eec98db0ce1705eb3f7a519295", "score": "0.6536569", "text": "_onMouseLeave(evt) {\n if (!this._allowDrag || !this._dragging) return;\n\n this._dragOverItem = null;\n this._updateDragHandle();\n }", "title": "" }, { "docid": "adf8b880b3ed309fc133ce3cc430fb26", "score": "0.6534266", "text": "function handleDragOver(event){\n event.preventDefault();\n}", "title": "" }, { "docid": "7e039d3b8c479b0462adff64e00d9673", "score": "0.65334845", "text": "_onChildDragOver(evt, element) {\n if (!this._allowDrag || !this._dragging) return;\n\n if (element.allowDrop && this._dragItems.indexOf(element) === -1) {\n this._dragOverItem = element;\n } else {\n this._dragOverItem = null;\n }\n\n this._updateDragHandle();\n this._onDragMove(evt);\n }", "title": "" }, { "docid": "0efadb384aa2d75b70c6a052196ffe72", "score": "0.65288705", "text": "handleDragOver(event) {\n event.preventDefault();\n }", "title": "" }, { "docid": "87a5295db69290ddf7319578fa797214", "score": "0.6528662", "text": "postDrop(element) {\n this.currentDraggedElement.setAttribute('aria-grabbed', false);\n this.currentDraggedElement = null;\n }", "title": "" }, { "docid": "11a3709b855aeb45ea66073e29b38f1d", "score": "0.65258473", "text": "function handleDragOver(ev) {\n if (ev.preventDefault) {\n ev.preventDefault();\n }\n ev.dataTransfer.dropEffect = 'move';\n return true;\n }", "title": "" }, { "docid": "9eece3119333725182ea06891e609a46", "score": "0.65207", "text": "function dragOverHelperFunction(ev){\n\n ev.preventDefault();\n\n}", "title": "" }, { "docid": "1f870e48c8da0d1ea2bd6301c180df99", "score": "0.6486635", "text": "handleDraggableDragLeave() {\n this.dropzoneElement = null;\n }", "title": "" }, { "docid": "8e84746d029dac8a7f135651f2d64f7f", "score": "0.6474049", "text": "function _onDragOver(evt) {\n evt.preventDefault();\n }", "title": "" }, { "docid": "ce1ab9c6add32f9d43c97e65e7234984", "score": "0.6470983", "text": "function dragOver(ev) {\n ev.preventDefault();\n let messageToUpdate = {\n dropTargetOn: ev.target.id,\n };\n currentState = update(messageToUpdate, currentState);\n viewUpdate(currentState);\n}", "title": "" }, { "docid": "e9f10bafd0019694f3d661473af08e98", "score": "0.6463714", "text": "_onMouseLeave(evt) {\n if (!this._allowDrag || !this._dragging) return;\n\n this._dragOverItem = null;\n this._updateDragHandle();\n }", "title": "" }, { "docid": "60ec49e658cfaf1b41a917d26a669711", "score": "0.6415572", "text": "function dragOverOverflow (event) {\n if (event.dataTransfer.getData('text') < (this._table.rows.length-1)) {\n event.preventDefault(); // Necessary. Allows us to drop.\n \n event.dataTransfer.dropEffect = 'move';\n }\n else\n event.dataTransfer.dropEffect = 'none';\n }", "title": "" }, { "docid": "a7263cbcd64604ec5efb87389ef2e21f", "score": "0.64124405", "text": "handleDragEnd(event) {\n // this/e.target is the source node.\n event.target.classList.remove('over');\n }", "title": "" }, { "docid": "96843ba98694628e73a69f350b9cd1d9", "score": "0.6407588", "text": "function dragend_handler(ev) { }", "title": "" }, { "docid": "2248f59f1970a8b8b8d392c76c8c464e", "score": "0.6406434", "text": "function dragOver() {\n console.log('DRAGOVER');\n fireMouseEvent('dragover', elemDrop, dragStartEvent.dataTransfer);\n }", "title": "" }, { "docid": "44b22ab7abb8b7aeab1ce88e88d83941", "score": "0.63954407", "text": "notPressed(x, y) {\n this.dragging = false\n }", "title": "" }, { "docid": "43ba5ed980278b13782278657a25f8ca", "score": "0.6390033", "text": "function dragLeave(e) { \n \n\n\t}", "title": "" }, { "docid": "4aa7886565347c249e7c9c44da45ab1f", "score": "0.6388651", "text": "onDragOver(event) {\n this.preventAndStopEventPropagation(event);\n if (!this.isOver && !this.disabled) {\n this.isOver = true;\n this.itemDragOver.emit();\n }\n }", "title": "" }, { "docid": "83135e4dcefde56881bf19a32bb921e0", "score": "0.63798857", "text": "function onPointerOut() {\n\t\tonPanCancel()\n\t}", "title": "" }, { "docid": "10384f6989709264569ff28b3cce7000", "score": "0.63797474", "text": "function dragOver(e) { \n\n\t\t// Obtenemos el valor objeto del contenedor sobre el que se posa el objeto arrastrable\n\t\tobjContenedor = this;\n \n if (!posicionOK()) return;\n\n\t\t// El cursor del navegador indica el tipo de operación que se va a realizar\n\t\te.dataTransfer.dropEffect = 'move';\n\n\t\t// Necesario para dejar caer el objeto arrastrado\n\t\tif(e.preventDefault)\n\t\t\te.preventDefault();\n\n\t}", "title": "" }, { "docid": "43a8004b5f9b382f708f374b44e74cca", "score": "0.6379503", "text": "function mouseUp() {\n lastPos = null;\n $(handle.ownerDocument)\n .off('mouseup', mouseUp)\n .off('mousemove', mouseMove);\n }", "title": "" }, { "docid": "10e7ea0dd3296ad68d37f03360341787", "score": "0.6359505", "text": "mouseReleased() {\n if (this.isMoving) {\n this.isMoving = false;\n }\n\n }", "title": "" }, { "docid": "ffbee94eef75ebc1d287f1e1937bca48", "score": "0.6348307", "text": "function onMouseUp(e) {\n\t\t\t\t\t\tdragging = offset = null;\n\t\t\t\t\t\tstartPoint = undefined;\n\t\t\t\t\t\tgrapher.off('mousemove');\n\t\t\t\t\t\tgrapher.off('mouseup');\n\t\t\t\t\t}", "title": "" }, { "docid": "80f3cdc0e1e7646c9f2e83b560dae551", "score": "0.63413244", "text": "function handleDragOverAbort(evt) {\n evt.preventDefault();\n evt.dataTransfer.dropEffect = 'none'; // nice cursor\n return false;\n}", "title": "" }, { "docid": "407786f3d27c1281377c6ed270fa266f", "score": "0.6335779", "text": "function handleDragOver(e) \n{\n\n //WARNING: You must have this if statement or the drop event will not be called.\n if (e.preventDefault) e.preventDefault();\n\n e.dataTransfer.dropEffect = 'move'; \n\n return false;\n}", "title": "" }, { "docid": "b34bf5ace7f18ce711bd7a1cdfc75d58", "score": "0.6297415", "text": "dragOver(e) {\n e.preventDefault();\n this.dragged.style.display = \"none\";\n if (e.target.className === 'placeholder') return;\n this.over = e.target;\n e.target.parentNode.insertBefore(placeholder, e.target);\n }", "title": "" }, { "docid": "5e174a959b2f912a8a6951c0181aa916", "score": "0.6291059", "text": "function dragMouseOut(e) {\r\n\t$dragableElement = getDragableElement($(e.target));\r\n\tif( $dragableElement != undefined ) {\r\n\t\t//remove the red border of the hovered element\r\n\t\t$dragableElement.css(\"border\", \"0\");\r\n\t}\r\n\t\r\n\tif($draggedElement != undefined) {\r\n\t\t//add green border on the currently dragged element\r\n\t\t$draggedElement.css(\"border\", \"1px solid #00FF00\");\r\n\t}\r\n}", "title": "" }, { "docid": "12e94dc38d483ce824cbc9a5c634890a", "score": "0.6286048", "text": "dragend(){\r\n if ( this.removable ){\r\n this.visibleBin = false;\r\n this.draggedIdx = -1;\r\n }\r\n }", "title": "" }, { "docid": "3240836ee366b65856c3e72ef25548d6", "score": "0.6269718", "text": "function dragover(e) {\n e.preventDefault();\n}", "title": "" }, { "docid": "2ee9759f5e0e9e142bccd9233ef99905", "score": "0.6260848", "text": "function handleDragOver(evt) {\n // Stop the default browser behavior\n evt.stopPropagation();\n evt.preventDefault();\n dropZone.style('background','#AAAAAA');\n }", "title": "" }, { "docid": "f8d3feebbc4f2662d5d9f92c6b2e055a", "score": "0.6257968", "text": "_dragOver(event) {\n let { preventDefault, listenElement } = this;\n\n /* Put mouse as a reference in the event. */\n event.mouse = this;\n\n /* Skip the default behaviours upon this event. */\n if (preventDefault === true) {\n event.preventDefault();\n }\n\n /* Update the mouse relative position. */\n let offsetPosition = getOffsetPosition(listenElement);\n\n this._updatePosition({\n x: event.clientX - offsetPosition.x,\n y: event.clientY - offsetPosition.y\n });\n\n /* Perform action for drag over event. */\n this._fireEvents(this.dragOverEvents, event);\n }", "title": "" }, { "docid": "366eb893d832d375a2c16cf622538271", "score": "0.6242163", "text": "dragOver(e) {\n e.preventDefault();\n this.dragged.style.display = \"none\";\n if(e.target.className == \"placeholder\") return;\n this.over = e.target;\n // Inside the dragOver method, check if item need to be inserted above or below target element\n let relY = e.clientY - this.over.offsetTop;\n let height = this.over.offsetHeight / 2;\n let parent = e.target.parentNode;\n \n if(relY > height) {\n this.nodePlacement = \"after\";\n parent.insertBefore(placeholder, e.target.nextElementSibling);\n }\n else if(relY < height) {\n this.nodePlacement = \"before\"\n parent.insertBefore(placeholder, e.target);\n }\n }", "title": "" }, { "docid": "990669f5e74e2b2dd5c4c3a03ad0e091", "score": "0.6239243", "text": "function makeUndraggable(element) {\n element.container.draggable = false;\n element.container.ondragstart = undefined;\n }", "title": "" }, { "docid": "d945fd4ab06c6bdfcff89ffed92b5fb3", "score": "0.6233623", "text": "onMouseUp(e) {\n // we have finished dragging\n this.isMouseDown = false;\n\n // remove specific styles\n this.options.element.classList.remove(\"dragged\");\n\n // update our end position\n this.endPosition = this.currentPosition;\n\n // send our mouse/touch position to our hook\n let mousePosition = this.getMousePosition(e);\n\n // drag ended hook\n this.onDragEnded(mousePosition);\n }", "title": "" }, { "docid": "8137c246c5c4ebaba2127dace752ff10", "score": "0.6222913", "text": "function dragOver(event) {\n\t\tevent.preventDefault();\n\t\tvar draggingItem = document.querySelector('.dragging');\n\t\tvar currIndex = parseInt(draggingItem.dataset.index);\n\t\tvar overIndex = parseInt(event.target.dataset.index);\n\t\tvar direction = currIndex > overIndex ? 'up' : 'down';\n\t\tif (draggingItem !== event.target && event.target.nodeName === 'LI') {\n\t\t\tif (direction === 'up') {\n\t\t\t\tevent.target.parentNode.insertBefore(draggingItem, event.target);\n\t\t\t} else {\n\t\t\t\tevent.target.parentNode.insertBefore(draggingItem, event.target.nextSibling);\n\t\t\t}\n\t\t\tupdateLinkOrder();\n\t\t}\n\t}", "title": "" }, { "docid": "e8dfa8b76da569efe380e10858eb92c4", "score": "0.6221499", "text": "function _mouseUp() {\n _mdown = false;\n _dragging=false;\n //the dragged thing will be autodestroyed in 1/10 seconds...\n setTimeout(function() {_draggedThing=null;}, 100);\n }", "title": "" }, { "docid": "94a1df94f8f1fc765591f60c178e3728", "score": "0.6219619", "text": "handleMouseup() {\n this._dragging = false;\n document.body.classList.remove('graph_dragging');\n }", "title": "" }, { "docid": "d31d145b49def5dcd4ff4fcef8274f63", "score": "0.6219429", "text": "function CdkDragEnd() { }", "title": "" }, { "docid": "d31d145b49def5dcd4ff4fcef8274f63", "score": "0.6219429", "text": "function CdkDragEnd() { }", "title": "" }, { "docid": "9742ee60a9b7f9aad4c6a15784f5ca33", "score": "0.61872303", "text": "onDragLeave(event) {\n this.preventAndStopEventPropagation(event);\n if (this.isOver && this.isTrueLeave(event) && !this.disabled) {\n this.isOver = false;\n this.itemDragLeave.emit();\n }\n }", "title": "" }, { "docid": "94962c5fe85f458fb1ce2130085b702f", "score": "0.6186624", "text": "function w_dragLeave(event, element)\n{\n\telement.style.borderColor = \"transparent\";\n\n\tevent.stopPropagation();\n\tevent.preventDefault();\n}", "title": "" }, { "docid": "6125ca14d69f406cc3b444e515352139", "score": "0.6176918", "text": "function dragstop()\r\n{\r\n dragobject = null;\r\n dragging = false;\r\n}", "title": "" }, { "docid": "c22b7643eb6f22599579160f7a4e32b8", "score": "0.61692095", "text": "function dragLeave(e){\n\te.stopPropagation();\n\te.preventDefault();\n\tta.style.background = \"\";\n}", "title": "" }, { "docid": "27edb25c705f824651476067490f01b9", "score": "0.61563456", "text": "function mouseUp() {\n if (!isDragging) {\n return;\n }\n\n isDragging = false;\n onChangeCallback();\n }", "title": "" }, { "docid": "4e07f0c10479ccb46e94e6b354615617", "score": "0.6142881", "text": "onDragStop(ev) {\n if (!ev.data.originalSource)\n return;\n if (ev.data.originalSource.parentElement === this.domDel)\n this.remove(ev.data.originalSource);\n else\n this.update();\n }", "title": "" }, { "docid": "09d2f5f782d75f12e619f0f7ca6e4e55", "score": "0.6138968", "text": "function $cleanDragFix() {\n if ($tmpWinMouseMoveListener != null &&\n $pointerPressedEvents[LMOUSE] == null &&\n $pointerPressedEvents[RMOUSE] == null )\n {\n window.removeEventListener(\"mousemove\", $tmpWinMouseMoveListener, true);\n $tmpWinMouseMoveListener = null;\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "cabe6898f3a12cdd10882da63af623b3", "score": "0.61373013", "text": "function handleDragLeave(e)\r\n {\r\n this.classList.remove('over');\r\n }", "title": "" }, { "docid": "5c6d774ad739fccd0b34120989a0e1bb", "score": "0.61365163", "text": "function CdkDragExit() { }", "title": "" }, { "docid": "5c6d774ad739fccd0b34120989a0e1bb", "score": "0.61365163", "text": "function CdkDragExit() { }", "title": "" }, { "docid": "d42bab4546c9008de9e95b600c3b8eed", "score": "0.61325294", "text": "function stop_drag(e){\nismoving=false;\n\ntry{\ndocument.removeEventListener('mousemove',drag_moving,false);\ndocument.removeEventListener('mouseup', stop_drag ,false);\n}\ncatch(e){ //error but blah cbf putting in error checking :P}\n\n}\n}", "title": "" }, { "docid": "e0c300c927da8da8bf37c7a85bcdf60d", "score": "0.61118054", "text": "_dragLeave(e) {\n this._setDropzone(false);\n }", "title": "" }, { "docid": "89d81cb697c41832a6dea601535f620b", "score": "0.6107622", "text": "function handleDragOver(evt) {\r\n if (pictureOn === false) {\r\n pictureOn = true;\r\n src.removeChild(tableHeaders);\r\n src.removeChild(intTable);\r\n src.removeChild(myFlightHeader);\r\n src.appendChild(img);\r\n }\r\n evt.stopPropagation();\r\n evt.preventDefault();\r\n evt.dataTransfer.dropEffect = \"copy\";\r\n }", "title": "" }, { "docid": "ec80b7c411f5db9326cb2cef97d5a1b8", "score": "0.6103861", "text": "evtDragLeave(event) {\n event.preventDefault();\n event.stopPropagation();\n const dropTarget = DOMUtils.findElement(this.node, DROP_TARGET_CLASS);\n if (dropTarget) {\n dropTarget.classList.remove(DROP_TARGET_CLASS);\n }\n }", "title": "" }, { "docid": "fe8802fda5d84eaf7710f08ce27b548a", "score": "0.6098082", "text": "function CdkDragEnter() { }", "title": "" }, { "docid": "fe8802fda5d84eaf7710f08ce27b548a", "score": "0.6098082", "text": "function CdkDragEnter() { }", "title": "" }, { "docid": "bd4bedfb51c6e68265fba6ee246be7fe", "score": "0.6094111", "text": "function drop(e){\r\n //Remove the listneres since nothing is being dragged\r\n document.onmousemove = null;\r\n document.onmouseup = null;\r\n\r\n //If we are not dragging the piece to the home area\r\n if(pieceDrop != null){\r\n //Swapping the x and y of each variable \r\n var tmp = {xPos:pieceCurrent.xPos,yPos:pieceCurrent.yPos};\r\n pieceCurrent.xPos = pieceDrop.xPos;\r\n pieceCurrent.yPos = pieceDrop.yPos;\r\n pieceDrop.xPos = tmp.xPos;\r\n pieceDrop.yPos = tmp.yPos;\r\n }\r\n //Simultaneously, we check if the game has been won\r\n reset();\r\n}", "title": "" }, { "docid": "0fae25517c7d5fe599304fac92441ca3", "score": "0.60709345", "text": "function handleDragLeave(e) \n{\n this.classList.remove('over');\n}", "title": "" }, { "docid": "021a237e78db3135f8c552e1b742b378", "score": "0.6069294", "text": "function onStopDrag(e, position) {\n let overlappingItem = Object.values(boxes).filter(item => item.id !== props.boxId).find(item => item.x === position.lastX && item.y === position.lastY);\n if(overlappingItem !== undefined) {\n setX(null);\n setX(x);\n store.dispatch(boxDragged(props.boxId, x, y));\n } else {\n setX(position.lastX);\n setY(position.lastY);\n }\n }", "title": "" }, { "docid": "aa2f390db214cb854b6bd189ef75aec4", "score": "0.6069254", "text": "function dragExceeded(data,event){var dx=Math.abs(event.clientX-data.pressX);var dy=Math.abs(event.clientY-data.pressY);return dx>=Private.DRAG_THRESHOLD||dy>=Private.DRAG_THRESHOLD;}", "title": "" }, { "docid": "3ca31377f7abbb704af733c6abc82b78", "score": "0.60559744", "text": "function mouseDragged() {\n //prevent default\n\n return false;\n\n}", "title": "" }, { "docid": "ba29778f718281b81e835cd2579dfeb5", "score": "0.6055238", "text": "function dropZoneDragLeave(e)\n {\n // we use a timeout here as this removes flickering\n $.doTimeout(overlayTimeoutId, DRAG_LEAVE_DELAY, function ()\n {\n $overlay.removeClass(\"ilFileDragOver\");\n });\n }", "title": "" }, { "docid": "9a1e56fe253341968d872db22bbf2314", "score": "0.6055206", "text": "onDragOver(eventObj, index /* , type, external */) {\n // disable dropping at index zero because here the mighty placeholder for date shifting lives\n return index !== 0;\n }", "title": "" }, { "docid": "3ee435b7a2d05891f8ede7b50ed483dc", "score": "0.6042235", "text": "resetDragged () {\n this.$element_.css('position', '')\n }", "title": "" }, { "docid": "3916c33238981362b54b5e3d4f9af9c3", "score": "0.60373133", "text": "function dragEnded(event) {\n if(sticky == null){\n return;\n }\n \n moveSticky(event);\n \n sticky = null;\n}", "title": "" }, { "docid": "fba6b5eba11a71dd33632af57d1345e5", "score": "0.6036823", "text": "evtDragOver(event) {\n event.preventDefault();\n event.stopPropagation();\n event.dropAction = event.proposedAction;\n const dropTarget = DOMUtils.findElement(this.node, DROP_TARGET_CLASS);\n if (dropTarget) {\n dropTarget.classList.remove(DROP_TARGET_CLASS);\n }\n const index = Private.hitTestNodes(this._items, event);\n this._items[index].classList.add(DROP_TARGET_CLASS);\n }", "title": "" }, { "docid": "9d181e64a62219154663459b34d6f82a", "score": "0.6036809", "text": "static mouseReleased() {\n Drag.selected = null;\n }", "title": "" }, { "docid": "27f59d8ffef7a1bb4691fa6987556000", "score": "0.6030104", "text": "function mouseDragged() {}", "title": "" }, { "docid": "e1c638254b47c5bd50d074cdc47b1201", "score": "0.602243", "text": "cancelDrag() {\n if (this.proxy) {\n document.body.removeEventListener('mousemove', this.mouseMove);\n document.body.removeEventListener('mouseup', this.mouseUp);\n this.proxy.parentElement.removeChild(this.proxy);\n this.proxy = null;\n this.payload = null;\n this.lastTarget = null;\n }\n }", "title": "" }, { "docid": "65381a17bf8b6364d7d705a01f294502", "score": "0.60181785", "text": "function drop(cnv) {\n var cnv = document.getElementById('main');\n cnv.removeEventListener('mousemove',move,false);\n cnv.removeEventListener('mouseup',drop,false);\n cnv.style.cursor = \"crosshair\";\n}", "title": "" }, { "docid": "484182aaadc0dda8b2b872cbd09661ca", "score": "0.60130334", "text": "function mouseUp(evt)\n{\n\tif(evt.which == 1)\n\t{\n\t\tisDragging = false;\n\t}\n}", "title": "" }, { "docid": "47a5dd576b8d7eafaf5b0e8830970fc3", "score": "0.6010925", "text": "onMouseUp(evt) {\n invariant(this.proxy, 'not expecting mouse events when not dragging');\n const globalPosition = this.mouseToGlobal(evt);\n const target = this.findTargetAt(globalPosition);\n if (target && target.options && target.options.drop) {\n target.options.drop.call(this, globalPosition, this.payload);\n }\n // ensure lastTarget gets a dragLeave incase they rely on it for cleanup\n if (this.lastTarget && this.lastTarget.options.dragLeave) {\n this.lastTarget.options.dragLeave.call(this);\n }\n\n this.cancelDrag();\n }", "title": "" }, { "docid": "05656d5016ecaa530e89e84b82819747", "score": "0.6009622", "text": "handleDragLeave(evt) {\n const el = this.shadowRoot.getElementById(\"drop_zone\");\n\n if (el) {\n el.style.borderWidth = \"0px\";\n }\n\n const hint = this.shadowRoot.getElementById(\"drop_hint\");\n\n if (hint) {\n hint.style.display = \"none\";\n }\n\n if (evt) {\n evt.stopPropagation();\n evt.preventDefault();\n }\n }", "title": "" }, { "docid": "ae1094d66a658086e2d45abe8d9cb215", "score": "0.60087997", "text": "function handleUp(e) {\n mouseD = false;\n mouseM = false;\n oldY = 0;\n // y = 0;\n\n if (!mouseD) {\n dragBar.removeEventListener('mousemove', handleMove)\n }\n}", "title": "" }, { "docid": "5b839d12ad27ca8d7d8a04bd4e74cc2b", "score": "0.59824353", "text": "cancelDrag() {\n if (this.proxy) {\n document.body.removeEventListener('mousemove', this.mouseMove);\n document.body.removeEventListener('mouseup', this.mouseUp);\n this.proxy.parentElement.removeChild(this.proxy);\n this.proxy = null;\n this.payload = null;\n this.lastTarget = null;\n this.lastMonitor = new Set();\n document.body.classList.remove('prevent-selection');\n }\n }", "title": "" }, { "docid": "b7fba4dc5027f838471e1f5a265441cd", "score": "0.5981188", "text": "function out() {\n if (canBeMoved(this) !== null) {\n this.style.borderColor = \"black\";\n this.style.cursor = \"default\";\n }\n }", "title": "" }, { "docid": "44fbbe78a6f5210a690ce6f177e21887", "score": "0.59751284", "text": "function onDragEnd() {\r\n drag = null;\r\n pointX = null;\r\n pointY = null;\r\n}", "title": "" }, { "docid": "c1e63267bba3871cb35d3b052099f1da", "score": "0.5972657", "text": "function drag(e) {\r\n\tif($draggedElement != undefined) {\r\n\t\t//move the currently dragged element\r\n\t\t$draggedElement.css(\"left\",(dragElementOffsetX + e.clientX + /*mouseStartDragX*/ + 5) + 'px');\r\n\t\t$draggedElement.css(\"top\",(dragElementOffsetY + e.clientY - mouseStartDragY) + 'px');\r\n\t\t\r\n\t\t//keep the green highlight\r\n\t\t$dragableElement.css(\"border\", \"1px solid #00FF00\");\r\n\t\t\r\n\t\t//determine if mouse is over a drop target, to properly change the cursor state\r\n\t\tvar dropTarget = getDropTarget(e.clientX, e.clientY);\r\n\t\tif(dropTarget != undefined) {\r\n\t\t\t$(\"#overlay\").css(\"cursor\", \"default\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$(\"#overlay\").css(\"cursor\", \"no-drop\");\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}\r\n}", "title": "" }, { "docid": "04854118d0b683ddc19c11dfdabdd683", "score": "0.5959983", "text": "function handleDragOver(e)\r\n {\r\n if (e.preventDefault)\r\n {\r\n e.preventDefault();\r\n ///Evento en donde se deben obtener las coordenadas///\r\n }\r\n e.dataTransfer.dropEffect = 'copy';\r\n return false;\r\n }", "title": "" }, { "docid": "b7fb95e559c1f2dfaac7c3ee1ba522dc", "score": "0.5952431", "text": "function onDocumentDragOver(evt) {\n evt.preventDefault();\n}", "title": "" }, { "docid": "b7fb95e559c1f2dfaac7c3ee1ba522dc", "score": "0.5952431", "text": "function onDocumentDragOver(evt) {\n evt.preventDefault();\n}", "title": "" }, { "docid": "b7fb95e559c1f2dfaac7c3ee1ba522dc", "score": "0.5952431", "text": "function onDocumentDragOver(evt) {\n evt.preventDefault();\n}", "title": "" }, { "docid": "b7fb95e559c1f2dfaac7c3ee1ba522dc", "score": "0.5952431", "text": "function onDocumentDragOver(evt) {\n evt.preventDefault();\n}", "title": "" }, { "docid": "b7fb95e559c1f2dfaac7c3ee1ba522dc", "score": "0.5952431", "text": "function onDocumentDragOver(evt) {\n evt.preventDefault();\n}", "title": "" } ]
8cc80fec48cedb5927ea979ec2cd8927
Return time in hours for how long one can rent an offer for the given sum
[ { "docid": "ff65356f7ff09b96ce4597bfa1fbdd59", "score": "0.71285266", "text": "function getHours4Quote(offer, sum) {\n\n if (offer.setup != \"\" ) {\n // Subtract setup cost\n sum = sum - offer.setup;\n }\n console.log(\"hours4quote \"+offer.shortname+\" sum=\"+sum);\n if (sum <=0) {\n return 0;\n }\n var h = 0;\n if (offer.hourly != \"\" ) {\n h = Math.floor(sum / offer.hourly); // max hours can rent for given sum.\n //console.log(\"hours4quote \"+offer.shortname+\" hours=\"+h);\n } else if (offer.weekly != \"\" ) {\n var period_w = Math.floor(sum / offer.weekly);\n //console.log(\"hours4quote \"+offer.shortname+\" weeks=\"+period_w);\n h = period_w * (24 * 7);\n } else if (offer.monthly != \"\" ) {\n var period_m = Math.floor(sum / offer.monthly);\n //console.log(\"hours4quote \"+offer.shortname+\" months=\"+period_m);\n h = getHours4Months(period_m);\n } else if (offer.yearly != \"\" ) {\n var period_y = Math.floor(sum / offer.yearly);\n console.log(\"hours4quote \"+offer.shortname+\" years=\"+period_y);\n h = getHours4Months(period_y * 12);\n } else {\n console.log(offer);\n }\n return h;\n}", "title": "" } ]
[ { "docid": "9b37ced5e8fd2a23e3bdba7a4db617c6", "score": "0.6523558", "text": "function getQuote4Hours(offer, h) {\n var cost = 0;\n if (offer.setup != \"\" ) {\n cost += offer.setup;\n }\n if (\"continuous\" in offer && offer.continuous != \"\" ) {\n\n if (offer.continuous == 1) {\n var periods = Math.ceil(h / offer.time_limit);\n cost += periods * offer.yearly;\n return cost;\n } else if (offer.continuous == 2.5) {\n // Tsubame 2.5\n // koeff3 is 1 for jobs running <= 1 day.\n var koeff3 = 1;\n var nodes = 1;\n var periods = Math.ceil(h * koeff3 * nodes / offer.time_limit);\n //console.log(offer.shortname+\" periods=\"+periods+\" for hours=\"+h);\n cost += periods * offer.yearly;\n return cost;\n }\n }\n // Apply monthly limit\n if (\"month_limit\" in offer && offer.month_limit != \"\" ) {\n //console.log(\"Month limit for \"+offer.shortname+\" is \" + offer.month_limit);\n var months = getMonths4Hours(h);\n cost += offer.month_limit * months[0];\n h = months[1]; // use leftover time to calculate additional cost\n }\n if (\"minutely\" in offer && offer.minutely != \"\") {\n var cost1 = 60 * h * offer.minutely;\n // Apply monthly limit\n if (\"month_limit\" in offer && offer.month_limit != \"\" ) {\n if (cost1 > offer.month_limit) {\n cost1 = offer.month_limit;\n }\n }\n cost += cost1;\n }\n else if (\"hourly\" in offer && offer.hourly != \"\" ) {\n var cost1 = h * offer.hourly;\n // Apply monthly limit\n if (\"month_limit\" in offer && offer.month_limit != \"\" ) {\n if (cost1 > offer.month_limit) {\n cost1 = offer.month_limit;\n }\n }\n cost += cost1;\n } else if (\"weekly\" in offer && offer.weekly != \"\" ) {\n var period_w = Math.ceil(h / (24 * 7));\n cost1 = period_w * offer.weekly;\n // Apply monthly limit\n if (\"month_limit\" in offer && offer.month_limit != \"\" ) {\n if (cost1 > offer.month_limit) {\n cost1 = offer.month_limit;\n }\n }\n cost += cost1;\n } else if (\"monthly\" in offer && offer.monthly != \"\" ) {\n var months = getMonths4Hours(h);\n var more_than_a_month = 0;\n if (months[1] > 0) {\n more_than_a_month = 1;\n }\n cost += (months[0] + more_than_a_month)* offer.monthly;\n //console.log(\"Monthly: \"+ offer.shortname + \" \"+offer.monthly);\n //console.log(months);\n } else if (\"yearly\" in offer && offer.yearly != \"\" ) {\n // Year is counted as 365 days\n var period_y = Math.ceil(h / (24 * 365));\n cost += period_y * offer.yearly;\n }\n return cost;\n}", "title": "" }, { "docid": "54bcb003f0ff95282253e18bf0a90203", "score": "0.6221985", "text": "calcHours() {\n let hours = Math.floor(this.availableMins / 60)\n let mins = this.availableMins % 60\n this.timeRem = hours + \"h \" + mins + \"m\"\n }", "title": "" }, { "docid": "854d6cd241d752fd081751ce0a7fa88b", "score": "0.6201337", "text": "function calculateTime(departure, arrival) {\n\n var year = new Date().getFullYear();\n var newDeparture = new Date(year + \" \" + departure);\n var newArrival = new Date(year + \" \" + arrival);\n\n\n\n var result = (newArrival - newDeparture);\n\n //TODO:\n var hours = Math.floor(result / 36e5);\n var minutes = Math.floor((result % 36e5) / 6e4);\n var seconds = Math.floor(((result % 36e5) % 6e4) / 1000);\n return hours + \" Hours \" + minutes + \" minutes \" + seconds + \" seconds\";\n}", "title": "" }, { "docid": "d49ee37d07c5e0406dd3c26343404853", "score": "0.61936146", "text": "function main(restTime, pricePerHardware, pricePerSoftware, frappePrice) {\n let computerHardwareTime = 3 * 2;\n let softwareTime = 2 * 2;\n let timeSpent = 5 + computerHardwareTime + softwareTime;\n let remainingTime = restTime - timeSpent;\n let moneySpent = (pricePerHardware * 3) + (pricePerSoftware * 2) + frappePrice;\n console.log(moneySpent.toFixed(2));\n console.log(remainingTime);\n}", "title": "" }, { "docid": "25b7d108e3491fafdb30f65b274bf54c", "score": "0.6036661", "text": "calcTime() {\n const numIng = this.ingredients.length;\n const periods = Math.ceil(numIng / 3);\n this.time = periods * 15;\n }", "title": "" }, { "docid": "4126865dffdafcf2ebb7eb8f16d00b18", "score": "0.59662", "text": "calculateTime() {\n const numIng = this.ingredients.length;\n const periods = Math.ceil(numIng / 3);\n this.time = periods * 15;\n }", "title": "" }, { "docid": "95e5351af54959298ae142adb0d56fa7", "score": "0.59063345", "text": "calcTime() {\n this.cookingTime = Math.ceil(this.ingredients.length / 3) * 15;\n }", "title": "" }, { "docid": "69bfa26cc7ebb7588c6ace4d6cb4857b", "score": "0.59019727", "text": "function hotelCost(time) {\n var cost = 0;\n if (time < 0) {\n return \"Time is won't be Negative.\"\n }\n //This is about staying 10 days in hotelCost.\n else if (time <= 10) {\n cost = time * 100;\n }\n // This is about staying 20 days in hotelCost.\n else if (time <= 20) {\n var firstStay = 10 * 100;\n var countTime = time - 10;\n var secondStay = countTime * 80;\n cost = firstStay + secondStay;\n }\n // This is about staying 21 days or more in hotelCost.\n else {\n var firstStay = 10 * 100;\n var secondStay = 10 * 80;\n var countTime = time - 20;\n var thirdStay = countTime * 50;\n cost = firstStay + secondStay + thirdStay;\n }\n return cost;\n}", "title": "" }, { "docid": "763bba0e86bf18c616c32b943121069d", "score": "0.58640164", "text": "function getQuote4Seconds(offer, sec, nodes) {\n //console.log(sec+\"sec\");\n var cost = 0;\n if (nodes == null || nodes == \"\") {\n nodes = 1;\n }\n if (offer.setup != \"\" ) {\n cost += offer.setup * nodes; // Assume setup price is per node\n }\n if (\"continuous\" in offer && offer.continuous != \"\" ) {\n var h = Math.ceil(sec / 3600); // sec -> hours for cost calculations\n var hours = offer.time_limit;\n if (offer.continuous == 1) {\n var periods = Math.ceil(h / hours);\n cost += periods * offer.yearly * nodes;\n return cost;\n } else if (offer.continuous == 2.5) {\n // Tsubame 2.5\n var koeff3 = tsubame_koeff[0];\n for (var k=0; k < tsubame_border.length; k++) {\n if (tsubame_border[k] < h) {\n koeff3 = tsubame_koeff[k+1];\n } else {\n break;\n }\n }\n if (koeff3 < 0) {\n console.log(offer.shortname + \" cannot be used for \"+h+\" hours and \"+ nodes + \" nodes.\");\n return -1; // Jobs cannot be run for more than 96 hours on Tsubame2.5\n }\n var periods = Math.ceil(h * nodes * koeff3 / hours);\n //console.log(\" periods=ceil(\"+h+\"x\"+nodes+\"x\"+ koeff3+\"/\"+hours+\")=\"+(periods));\n cost = periods * offer.yearly;\n //console.log(\" getQuote4Seconds 2 cost: \"+periods+\" x \"+offer.yearly+ \" = \"+cost);\n return cost;\n }\n }\n // Apply monthly limit\n if (\"month_limit\" in offer && offer.month_limit != \"\" ) {\n //console.log(\"Month limit for \"+offer.shortname+\" is \" + offer.month_limit);\n var months = getMonths4Seconds(sec);\n //console.log(\"Months:\"+months);\n cost += offer.month_limit * months[0] * nodes;\n sec = months[1]; // use leftover time to calculate additional cost\n }\n if (\"minutely\" in offer && offer.minutely != \"\") {\n var cost1 = Math.ceil(sec / 60) * offer.minutely * nodes;\n // Apply monthly limit\n if (\"month_limit\" in offer && offer.month_limit != \"\" ) {\n if (cost1 > offer.month_limit * nodes) {\n cost1 = offer.month_limit * nodes;\n }\n }\n cost += cost1;\n }\n else if (\"hourly\" in offer && offer.hourly != \"\" ) {\n var cost1 = Math.ceil(sec / 3600) * offer.hourly * nodes;\n //console.log (\" \"+sec+\"sec. cost1= \"+Math.ceil(sec / 3600)+\"x\"+offer.hourly+\" = \"+cost1);\n // Apply monthly limit\n if (\"month_limit\" in offer && offer.month_limit != \"\" ) {\n if (cost1 > offer.month_limit * nodes) {\n cost1 = offer.month_limit * nodes;\n }\n }\n cost += cost1;\n } else if (\"weekly\" in offer && offer.weekly != \"\" ) {\n var period_w = Math.ceil(sec / (24 * 7 * 3600));\n var cost1 = period_w * offer.weekly * nodes;\n // Apply monthly limit\n if (\"month_limit\" in offer && offer.month_limit != \"\" ) {\n if (cost1 > offer.month_limit * nodes) {\n cost1 = offer.month_limit * nodes;\n }\n }\n cost += cost1;\n } else if (\"monthly\" in offer && offer.monthly != \"\" ) {\n var months = getMonths4Seconds(sec);\n var more_than_a_month = 0;\n if (months[1] > 0) {\n more_than_a_month = 1;\n }\n cost += (months[0] + more_than_a_month)* offer.monthly * nodes;\n //console.log(\"Monthly: \"+ offer.shortname + \" \"+offer.monthly+\" cost=\"+cost);\n } else if (\"yearly\" in offer && offer.yearly != \"\" ) {\n // Year is counted as 365 days\n var period_y = Math.ceil(sec / (3600 * 24 * 365));\n cost += period_y * offer.yearly * nodes;\n }\n return cost;\n}", "title": "" }, { "docid": "f2a25f1781259d4ad14f88f50643f367", "score": "0.5846417", "text": "timeLeft(){\n let time = new Date().getTime()\n let dateFinReservation = (parseInt(this.dateReservation)+(20*60000));\n return dateFinReservation - time;\n }", "title": "" }, { "docid": "9d1fe5c1a25c4a41252a7e38f5029fc8", "score": "0.5834692", "text": "getRemainingTime() {\n if( this.expired() ) {\n return 0;\n }\n \n // never return a neg number + account for pause time\n let rt = this.startTime + this.duration + this.getPauseTime() - millis();\n if( rt < 0 )\n rt = 0;\n return rt;\n }", "title": "" }, { "docid": "9fcb433f78104a32b9afedc89a336383", "score": "0.58283395", "text": "function timer(){\n const currentDate = new Date();\n const offerTime = new Date(\"31 July 2021\");\n const totalSec = (offerTime-currentDate)/1000;\n \n const remainingDays = Math.floor(totalSec/(3600*24)) > 0 ? Math.floor(totalSec/(3600*24)) : 0;\n const remainingHours = Math.floor((totalSec/3600)%24) > 0 ? Math.floor((totalSec/3600)%24) : 0;\n const remainingMinutes = Math.floor((totalSec/60)%60) > 0 ? Math.floor((totalSec/60)%60) : 0;\n const remainingSecs = Math.floor(totalSec%60) >= 0 ? Math.floor(totalSec%60) : 0;\n \n $('#days').html(remainingDays);\n $('#hours').html(remainingHours);\n $('#minutes').html(remainingMinutes);\n $('#seconds').html(remainingSecs);\n}", "title": "" }, { "docid": "016a0e7bf16a9c3d26a1638155fce86b", "score": "0.5781841", "text": "function hours_spent () {\n\t\n\teval_pages = document.roi_calculator.e_pages.value;\n\teval_client = formatInt(document.roi_calculator.e_client.value);\n\teval_replace = formatInt(document.roi_calculator.e_replace.value);\n\tprnt_time = formatInt(document.roi_calculator.e_prnt_time.value);\n\ttotal_prnt_return = eval_client + (eval_replace * 50);\n\thr_spent = total_prnt_return *(prnt_time/60);\n\tdocument.roi_calculator.e_hr_spent.value = formatCurrency(hr_spent) + 'hrs';\n\t\n}", "title": "" }, { "docid": "cc81081109d89f870296e08cb4184fd7", "score": "0.5781678", "text": "function lateRide(n) {\n let h = n / 60;\n let r = h % 1;\n let m = r * 60;\n let str = String(Math.floor(h)) + String(Math.round(m));\n let tot = 0;\n for (let num in str) {\n tot += Number(str[num]);\n }\n console.log(str);\n return tot;\n}", "title": "" }, { "docid": "309fe4e86d9e91c5d5cb24bf8fc7a99c", "score": "0.5742347", "text": "static roundRemainingTime() {\n let round;\n if ((round = TurkServer.currentRound()) == null) {\n return;\n }\n if (round.endTime == null) {\n return;\n }\n return Math.max(0, round.endTime - TimeSync.serverTime());\n }", "title": "" }, { "docid": "333fdd6fa17a42807e2682b2d726481d", "score": "0.57392764", "text": "function question6(){\n bgn=hmstosec('09:00:00');\n end=hmstosec('00:00:00');\n end += 60*60*24;\n onedayduration = end - bgn;\n totalDuration=0;\n tasks.forEach(function(value){\n totalDuration += value.duration;\n });\n days=totalDuration*60/onedayduration;\n return days;\n}", "title": "" }, { "docid": "8ba3783010c3d4e4bf269e631c9ce874", "score": "0.57280236", "text": "function mineTimeEstimate(){//outputs to console.log estimated time to mine in Hours Mins Seconds. Returns estimted time in seconds.\n\tadjustedHashRate=admin.miner.hashrate()*1000*1.04;//1000 is to fix an error. 1.08 is assuming at least 2 uncles every 25 blocks.\n\t//Remove the factor of 1000 once this issue has been fixed in the version of geth which you are using.\n\testimatedSeconds=eth.getBlock(\"latest\").difficulty/adjustedHashRate;\n\tconsole.log(Math.floor(estimatedSeconds/3600.)+\" Hrs, \"+Math.floor((estimatedSeconds%3600)/60)+\" Mins, \"+Math.floor(estimatedSeconds%60)+\" Sec, estimated time until next successful block mined.\");\n\treturn estimatedSeconds;\n}", "title": "" }, { "docid": "9666042d3ba7e858fa802a92821d15fc", "score": "0.5717128", "text": "function getIdealSleepHours() {\n return 7*7;\n}", "title": "" }, { "docid": "3cdc15ce42cacad78e0ec007a65fa4a0", "score": "0.57038945", "text": "function question4(){\n var typeDuration=[]\n employeeType.forEach(function(value){\n bgn=hmstosec(value.work_begin);\n end=hmstosec(value.work_end);\n if (bgn > end){\n end += 60*60*24;\n }\n var secondDuration = end-bgn;\n typeDuration.push(secondDuration);\n });\n totalworksec=0;\n employees.forEach(function(value){\n var worktype=value.type;\n var perduration=typeDuration[worktype-1];\n totalworksec += perduration;\n });\n var totalworkhour=totalworksec/3600;\n return totalworkhour;\n}", "title": "" }, { "docid": "8d9561b803dee5584b424782dde8eb2a", "score": "0.56767744", "text": "function _hrDuration() { var t1 = clk(); for (var i=0; i<timeRuns; i++) clk(); return (clk() - t1) / (timeRuns + 1) }", "title": "" }, { "docid": "aa92e457d8a4e50b74edd79ad10fc4ea", "score": "0.5663311", "text": "function getActualSleepHours(){\n let monday=getSleepHours('Monday');\n let tuesday=getSleepHours('Tuesday');\n let wednesday=getSleepHours('Wednesday');\n let thursday=getSleepHours('thursday');\n let friday=getSleepHours('friday');\n let saturday=getSleepHours('saturday');\n let sunday=getSleepHours('sunday');\n let totalSleep;\n totalSleep=monday + tuesday+wednesday+thursday+friday+saturday+sunday;\n return totalSleep;\n}", "title": "" }, { "docid": "50df5b9a25dec54016eca918527bdeaf", "score": "0.56487036", "text": "function getTimeRemaining(endtime) {\n\n let t = Date.parse(endtime) - Date.parse(new Date()),\n seconds = Math.floor((t / 1000) % 60), //?????????, ????? ??????????? ? ????????? ? ??????? - ???????? ??????? ?? ???????\n minutes = Math.floor((t / 1000 / 60) % 60),\n /* hours = Math.floor( (t / (1000 * 60 * 60)) );// - ??? ?? ?????*/\n hours = Math.floor((t) % (24 * 60 * 60 * 1000) / (60 * 60 * 1000));\n\n\n return {\n total: t,\n hours: hours,\n minutes: minutes,\n seconds: seconds\n };\n }", "title": "" }, { "docid": "2e887e34ed42411b91690b9763dea6bd", "score": "0.5631369", "text": "function calculateSleepDebt() {\n if (getIdealSleepHours() === getActualSleepHours()) {\n console.log('There is no sleep debt!')\n } else if (getIdealSleepHours() < getActualSleepHours()) {\n console.log('You have a sleep surplus of ' + (getActualSleepHours() - getIdealSleepHours()) + ' hours.')\n } else if (getIdealSleepHours() > getActualSleepHours()) {\n console.log('You have a sleep debt of ' + (getIdealSleepHours() - getActualSleepHours()) + ' hours.')\n } else {\n console.log('The fuck have you done bruv?');\n }\n}", "title": "" }, { "docid": "b57405a325f893fadb0050ca0d4fb48e", "score": "0.56279373", "text": "static breakRemainingTime() {\n let nextRound, round;\n if ((round = TurkServer.currentRound()) == null) {\n return;\n }\n const now = Date.now();\n if (round.startTime <= now && round.endTime >= now) {\n // if we are not at a break, return 0\n return 0;\n }\n\n // if we are at a break, we already set next round to be active.\n if ((nextRound = RoundTimers.findOne({ index: round.index + 1 })) == null) {\n return;\n }\n if (nextRound.startTime == null) {\n return;\n }\n return Math.max(0, nextRound.startTime - TimeSync.serverTime());\n }", "title": "" }, { "docid": "9c2e2abfd472a75bf35d6cb0ebdf736c", "score": "0.5599546", "text": "function getActualSleepHours() {\n var total = 0;\n total += getSleepHours('Monday');\n total += getSleepHours('Tuesday');\n total += getSleepHours('Wednesday');\n total += getSleepHours('Thursday');\n total += getSleepHours('Friday');\n total += getSleepHours('Saturday');\n total += getSleepHours('Sunday');\n return total;\n}", "title": "" }, { "docid": "f81e9596c08f272a975df0f6d9e8aac7", "score": "0.5588797", "text": "function remaining_time(){\n var duration = base_time - ( (new Date()).getTime() - time_tracker );\n var seconds = parseInt((duration / 1000) % 60);\n var minutes = parseInt((duration / (1000 * 60)) % 60);\n var hours = parseInt((duration / (1000 * 60 * 60)) % 24);\n\n hours = (hours < 10) ? \"0\" + hours : hours;\n minutes = (minutes < 10) ? \"0\" + minutes : minutes;\n seconds = (seconds < 10) ? \"0\" + seconds : seconds;\n\n return hours + \":\" + minutes + \":\" + seconds;\n }", "title": "" }, { "docid": "1bba9ea465746cf3d39826c6ed45c4bc", "score": "0.55787003", "text": "static roundElapsedTime() {\n let round;\n if ((round = TurkServer.currentRound()) == null) {\n return;\n }\n if (round.startTime == null) {\n return;\n }\n return Math.max(0, TimeSync.serverTime() - round.startTime);\n }", "title": "" }, { "docid": "509ff7d5487aa8695cf5089ce1ab9afd", "score": "0.5577676", "text": "function getHourTime() {\n let time = 60;\n return (Math.floor(new Date()/1000) + time * 60);\n}", "title": "" }, { "docid": "a173e90ad588795d7a3a4276bd4bef1f", "score": "0.5550564", "text": "timeInHours(minutes){\r\n minutes*=Min\r\n console.log(Hr)\r\n return minutes/Hr\r\n }", "title": "" }, { "docid": "8aa2a477fcacbfa10a1fa9cf255165c8", "score": "0.5504384", "text": "getEstimatedShareHashrate(difficulty, timeToFindSeconds )\n {\n if(timeToFindSeconds!= null && timeToFindSeconds>0)\n {\n\n var hashrate = web3utils.toBN(difficulty).mul( web3utils.toBN(2).pow( web3utils.toBN(22) )).div( web3utils.toBN( timeToFindSeconds ) )\n\n return hashrate.toNumber(); //hashes per second\n\n }else{\n return 0;\n }\n }", "title": "" }, { "docid": "f3bbde747a4efe757f8bed133d217fdc", "score": "0.5494408", "text": "static hours_per_week() { return Starship.hours_per_day() * Starship.days_per_week() }", "title": "" }, { "docid": "be3a6a095be7c87757cf26412b1e8de6", "score": "0.5489626", "text": "function totalCost(number_of_days, booking_cost_per_night) {\n return number_of_days * booking_cost_per_night;\n}", "title": "" }, { "docid": "b7f7b82d8744785192d148db1ddfc5e3", "score": "0.5481771", "text": "function computeTime(distance) {\n return 100 + Math.sqrt(distance) * 30;\n}", "title": "" }, { "docid": "69dfcaf819977a075f9b134b5c525774", "score": "0.5480879", "text": "function calculateTimeToCoffee() {\n // let timeCalculated = moment().toNow();\n session.send(textContent.inProgress);\n }", "title": "" }, { "docid": "7ecd0460b852bc9963f6975346025223", "score": "0.5466228", "text": "calculateTime(){\n const numIng = 4\n const periods = Math.ceil(numIng / 3)\n this.time = periods * 15\n }", "title": "" }, { "docid": "e74cdc63896caaf961ba0a1ecf9acfd5", "score": "0.54587615", "text": "function returnTime() {\n time_at_the_end = new Date().getTime();\n total_banner_time = (time_at_the_end - time_at_the_beginig) * 0.001;\n console.log(total_banner_time + ' seconds.');\n}", "title": "" }, { "docid": "daca2ea2d7b03dd4de29b0d73bc9ee74", "score": "0.5457624", "text": "function calcularTiempoEjecucion(){\r\n\t\tvar tiempo = new Date().getTime() - tiempo_ejecucion;\r\n\t\tvar div = find(\"//div[@id='ltime']\", XPFirst);\r\n\t\tdiv.appendChild(elem(\"P\", \"TB: \" + tiempo + \" ms\"));\r\n\t}", "title": "" }, { "docid": "d6eef811fbcc17df4019501167ba7a98", "score": "0.5438358", "text": "function GS_getDuration( ) {\n var timeArr = $(\"span#time-total\").text().split(\":\");\n return parseInt( timeArr[0] ) * 60 + parseInt( timeArr[1] );\n}", "title": "" }, { "docid": "7ded8fb0f56194c923a84be176e67f63", "score": "0.54355186", "text": "function tripTime(start, end) {\n start = start.split(':');\n end = end.split(':')\n var dep = new Date();\n dep.setHours(start[0], start[1], start[2])\n var arr = new Date();\n arr.setHours(end[0], end[1], end[2]);\n var int = arr - dep;\n var h, m, s;\n h = Math.floor(int / 1000 / 60 / 60);\n m = Math.floor((int - h * 3600000) / 1000 / 60);\n s = Math.floor((int - h * 3600000 - m * 60000) / 1000);\n return h + ' hours ' + m + ' minutes ' + s + ' seconds';\n}", "title": "" }, { "docid": "276fceb6915dbe699eb559ad5cf4daf1", "score": "0.5433992", "text": "function getTimeSpent(){\n\t\t\tvar settings = {\n \"async\": false,\n \"crossDomain\": true,\n \"url\": \"/api/Rest/v1/Users/\" + userId + \"/enrollments/\" + courseId,\n\t\t\t\t\"tryCount\" : 0,\n\t\t\t\t\"retryLimit\" : 3,\n \"method\": \"GET\",\n \"headers\": {\n //\"Authorization\": token,\n \"Content-Type\": \"application/json\",\n \"cache-control\": \"no-cache\"\n }\n }\n\n $.ajax(settings).done(function (response) {\n TimeSpentTicks = response.TimeSpentTicks;\n }).fail(function (msg) {\n\t\t\t\tSaveClose(\"There was an issue loading your course. Please close all internet browsers and try again. If you continue to receive this error please reach out to our student support team (904.999.4923 or support@xcelsolutions.com) and provide error code 7728.\");\n });\n\t\t\t\n\t\t\tvar convertTimeTicks = \"<span style='color:white'>\" + Math.floor(((TimeSpentTicks/10000000)/60)/60) + \"</span> Hours: <span style='color:white'> \" + Math.floor(((TimeSpentTicks/10000000)/60) % 60) + \"</span> Minutes\";\n\t\t\treturn convertTimeTicks;\n\t\t}", "title": "" }, { "docid": "86526d2d6370379d405a108bfb5f3bdd", "score": "0.5430013", "text": "function getTimeLeft(time){\n var today = new Date();\n currentTime = today.getTime();\n today.setHours(time.split(\":\")[0]);\n today.setMinutes(time.split(\":\")[1]);\n var firstTrainTime = today.getTime();\n //return in minutes\n return (currentTime - firstTrainTime) / 1000 / 60;\n}", "title": "" }, { "docid": "171a8d7c3fc4dabfa1330adf8a43fed6", "score": "0.54199433", "text": "function timingOut() {\n const date = Date.now()\n const tom = new Date().getDate()+1;\n\n console.log(date - tom)\n // const hour = 1000 * 60 * 60;\n // const anHourAgo = date - hour;\n // date > anHourAgo;\n\n // let timing = 0\n // for(let t of tasks){\n // if (t.due_date == true){\n // console.log(t)\n // timing += 1\n // }\n // }\n // return timing;\n\n}", "title": "" }, { "docid": "fc9b3ec1d593aba00b9aa809fc5bda14", "score": "0.541798", "text": "function calcWage(empHrs) {\n return empHrs * WAGE_PER_HOUR;\n}", "title": "" }, { "docid": "edef67e828753e93038486c8c729e84e", "score": "0.54124844", "text": "function departureHour(time) {\n if (time - moment() > 0) {\n return time;\n } else {\n return moment(time).add(1, \"days\")\n }\n}", "title": "" }, { "docid": "f97a68dd42d19713656560c52e866d19", "score": "0.5401591", "text": "function getTimeByHalfs(n)\n{\n\tvar today = new Date();\n\tvar current_hour = today.getHours();\n\tvar current_minutes = today.getMinutes();\n\tvar minutes = current_minutes > 30 ? 1 : 0.5;\n\treturn current_hour + n + minutes;\t\n}", "title": "" }, { "docid": "ebc588fc55479f0f594ee502302d83be", "score": "0.5394902", "text": "estimatedShareHashrate(difficulty, timeToFindSeconds) {\n\t if(timeToFindSeconds && timeToFindSeconds > 0) {\n\t return this.web3.utils.toBN(difficulty)\n\t \t\t.mul( this.web3.utils.toBN(2).pow( this.web3.utils.toBN(22) ))\n\t \t\t.div( this.web3.utils.toBN( timeToFindSeconds ))\n\t \t\t.toNumber()\n\t }\n\t return 0\n\t}", "title": "" }, { "docid": "a8f329394d653f0892e9e861973c205f", "score": "0.5392269", "text": "function hotelCost (nightSpent){\n var bill = 0;\nif (nightSpent <= 10){\n bill = nightSpent * 100;\n}\nelse if (nightSpent <=20){\n var firstPhase = 10 * 100;\n var remaining = nightSpent - 10;\n var secondPhase = remaining * 80;\n bill = firstPhase + secondPhase;\n}\nelse {\n var firstPhase = 10 * 100;\n var secondPhase = 10 * 80;\n var remaining = nightSpent - 20;\n var thirdPhase = remaining * 50;\n bill = firstPhase + secondPhase + thirdPhase;\n}\nreturn bill;\n}", "title": "" }, { "docid": "284b196aaa5aaf499bfb2c9ba0853e24", "score": "0.53882074", "text": "function timeRemain(time)\r\n{\r\n var remain = (time - $.now()) / 60000;\r\n return remain.toFixed(0);\r\n}", "title": "" }, { "docid": "1ccad9ce9ca7bc4053aa7c70c11aa428", "score": "0.53855205", "text": "function routeTime(route) {\n var acc = 0;\n for (i = 0; i < route.legs.length; i++) {\n acc = acc + route.legs[i].duration.value;\n }\n return acc;\n}", "title": "" }, { "docid": "51f63a6137654da13679a5452d094f47", "score": "0.53770775", "text": "function timer_add_hours(time,id){\n\n var dt = time;\n dt.setHours( dt.getHours() + 3 );\n \n const second = 1000,\n minute = second * 60,\n hour = minute * 60,\n day = hour * 24;\n\n let countDown = dt.getTime(),\n x = setInterval(function() \n {\n \n let now = new Date().getTime(),\n distance = countDown - now;\n\n var countdowntimer = \"countdowntimer\" + id;\n document.getElementById(countdowntimer).innerHTML = (Math.floor((distance % (day)) / (hour))) + ':' + (Math.floor((distance % (hour)) / (minute))) +':' + (Math.floor((distance % (minute)) / (second)));\n \n //do something after 3 hours are completed.\n if (distance < 0) {\n clearInterval(x);\n $('#start_bidding'+id).hide();\n $('#bidding_time'+id).css('display','none');\n $('#countdowntimer'+id).hide();\n $('#winner'+id).show();\n \n }\n }, 1000) \n}", "title": "" }, { "docid": "9eeddf0a38a20eddb37a62ea03da871a", "score": "0.5366027", "text": "function totaltime () {\n let time1 = new Date(\"2016-12-11T00:37:52Z\").getTime();\n let time2 = new Date(\"2016-12-11T05:41:50Z\").getTime();\n const totaltime = (time2 - time1)/1000; //in seconds\n return totaltime + ' seconds';\n}", "title": "" }, { "docid": "a6e6c2d6e64f586773cd0494f0003590", "score": "0.53659475", "text": "calcPay() {\n let toPayAmount = this.#hourlyPay * this.#hoursWorked;\n this.#hoursWorked = 0;\n return toPayAmount;\n }", "title": "" }, { "docid": "e813045b51b46b5db5d8060339dad0b0", "score": "0.5353032", "text": "function timeAfterDifficulties() {\n if (difficulty == \"Easy\") {\n return 3000;\n } else if (difficulty == \"Medium\") {\n return 2000;\n } else {\n return 1000;\n }\n}", "title": "" }, { "docid": "7ef56f3b725a5dad00b7a31da58b0f73", "score": "0.5344263", "text": "calculateTotalTime() {\n return (\n this.convertToTimeStamp(this.config.end_date) -\n this.convertToTimeStamp(this.config.start_date)\n )\n }", "title": "" }, { "docid": "e7a00919535945915101f3dc8bb5e329", "score": "0.5342564", "text": "function getHoursTime(timer){\n var seconds = timeLeftGM(timer);\n if(seconds == 0) return 0;\n if(isNaN(seconds)) return undefined;\n var num = parseInt(seconds);\n var strTime = '';\n if(num){\n num /= 60;\n if(num >= 60){\n num /= 60;\n strTime = parseInt(num)+'h ';\n num -= parseInt(num); num *= 60;\n }\n strTime += parseInt(num)+'m ';\n num -= parseInt(num); num *= 60;\n strTime += parseInt(num)+'s';\n }\n return strTime;\n}", "title": "" }, { "docid": "04a31baae332f97192166cc79bb6d2ff", "score": "0.53420067", "text": "function getTravelTime(object){\n //hours is calculated by roounding of the lower integer\n const hours = Math.floor(object.destinationDistance/object.speed);\n //minutes is calculated from the remainder of distace/speed \n const minutes = Math.floor(((object.destinationDistance%object.speed)/object.speed)*60);\n const outPut = `${hours} hours and ${minutes} minutes`;\n return outPut;\n }", "title": "" }, { "docid": "b13461855dfd47069aac60673957f367", "score": "0.533888", "text": "timeRemaining(timeObject = false) {\n\t\tvar dTod = new Date(), dTom = new Date(dTod.toUTCString());\n\t\tdTom.setDate(dTom.getDate() + 1); dTom.setUTCHours(0); dTom.setUTCMinutes(0); dTom.setUTCSeconds(0); dTom.setUTCMilliseconds(0);\n\t\tvar baseDeltaH = Math.floor( (dTom - dTod) / (this._HOUR_IN_MS) );\n\t\tvar baseDeltaM = Math.round( (dTom - dTod - baseDeltaH * this._HOUR_IN_MS) / (this._MIN_IN_MS) );\n\t\treturn ( !timeObject ? \n\t\t\tbaseDeltaH + \":\" + (baseDeltaM < 10 ? \"0\" : \"\" ) + baseDeltaM :\n\t\t\t{quest: this.getDailyQuest(dTod), hours: baseDeltaH, minutes: baseDeltaM } ) ;\n\t}", "title": "" }, { "docid": "735b5ad74e7a203cbd66e5839cc95d63", "score": "0.5332124", "text": "function hotelCost(stayDuration) {\n if (stayDuration >= 1 && stayDuration <= 10) {\n return (100 * stayDuration);\n }\n else if (stayDuration >= 11 && stayDuration <= 20 ) {\n \n return ((stayDuration-10) * 80) + 1000;\n }\n else if (stayDuration >= 21) {\n return ((stayDuration-20) * 50) + 1800;\n }\n else{\n return (\"Please input a valid number!\")\n }\n}", "title": "" }, { "docid": "972eda98d8da89a74fccdd4f4b5c5802", "score": "0.5317996", "text": "function calc_attack_hours(start_attack_level, end_attack_level, strength_level) {\n var total_hours = 0;\n for (; start_attack_level < end_attack_level; start_attack_level++) {\n var hours_to_level = calc_time_to_next_level(start_attack_level, strength_level, 1)[0];\n total_hours = total_hours + hours_to_level;\n }\n return total_hours;\n }", "title": "" }, { "docid": "8854247b05e01d89dec533fbc0429ec7", "score": "0.5311569", "text": "getHours(){\n let start = ((this.startTime.getHours()*60) + this.startTime.getMinutes());\n let end = ((this.endTime.getHours()*60) + this.endTime.getMinutes());\n end < start ? end += (24 * 60) : end;\n let diffMins = end - start;\n let hours = (diffMins/60).toFixed(2);\n return hours;\n }", "title": "" }, { "docid": "3ae15c638401b70abcd156d850ff7660", "score": "0.5309714", "text": "function getPay() {\n return hoursWorked * hourlyRate;\n }", "title": "" }, { "docid": "a44f32a6f38e04b39e540e809e708d28", "score": "0.5306086", "text": "function hotelCost(days) {\n if (days <= 10) {\n var fastOffer = days * 100;\n return fastOffer;\n }\n else if (days <= 20) {\n var fastOffer = 10 * 100;\n var remaining = days - 10;\n var secondOffer = remaining * 80;\n var total = fastOffer + secondOffer;\n return total;\n }\n else {\n var fastOffer = 10 * 100;\n var secondOffer = 10 * 80;\n var remaining = days - 20;\n var luckyOffer = remaining * 50;\n var total = fastOffer + secondOffer + luckyOffer;\n return total;\n }\n}", "title": "" }, { "docid": "4f8b910c1c68488dd101e9c0bdd83a17", "score": "0.53001875", "text": "function calcDuration(alert){\n\tvar startDate = new Date(alert.activationDate);\n\tvar endDate;\n\tif(alert.alert_horizon[0] == null || alert.alert_horizon[0].end_date == null || alert.alert_horizon[0].end_date == null){\n\t\treturn 'Unable to determine the duration of this alert; '+\n\t\t\t'Alerts without an end date are still active and will not yet have a duration';\n\t} else {\n\t\tendDate = new Date(alert.alert_horizon[0].end_date);\n\t\treturn formatDuration((endDate.getTime() - startDate.getTime()));\n\t}\n}", "title": "" }, { "docid": "408ecb4ca6b5cb90fe3945afeedd0e9b", "score": "0.5295606", "text": "function hotelCost(days) {\r\n var expense = 0;\r\n if (days <= 10) {\r\n expense = days * 100;\r\n }\r\n else if (days <= 20) {\r\n var offer1 = 10 * 100;\r\n var remaining = days - 10;\r\n var offer2 = remaining * 80;\r\n expense = offer1 + offer2;\r\n }\r\n else {\r\n var offer1 = 10 * 100;\r\n var offer2 = 10 * 80;\r\n var remaining = days - 20;\r\n var offer3 = remaining * 50;\r\n expense = offer1 + offer2 + offer3;\r\n }\r\n return expense;\r\n}", "title": "" }, { "docid": "bba85b542b42efbde502781872eb9c50", "score": "0.528358", "text": "function timeRemaining(timeStr) { \n\tlet now = new Date(), time = new Date(), output;\n\tlet timeArr = timeStr.split(\":\"); // split between hours (index 0) and minutes (index 1)\n\ttime.setHours(timeArr[0]);\n\ttime.setMinutes(timeArr[1]);\n\ttime.setSeconds(0);\n\ttime.setMilliseconds(0);\n\n\t// if time has already passed today, increment day\n\tif (now > time) {\n\t\ttime.setDate(time.getDate() + 1);\n\t}\n\tconsole.log(\"now: \" + now + \"\\ntime: \" + time);\n\n\toutput = (time - now) / 1000 * 16000000; // find difference, divide by milliseconds, multiply by clock speed\n\tconsole.log(\"output: \" + output);\n\treturn output + \"\"; // return output as string\n}", "title": "" }, { "docid": "53babd0d018927ab366f2ae1b04fccbe", "score": "0.5282334", "text": "function gettimeRemaining(aryOfCoords){\n return aryOfCoords.routes[0].legs[0].duration.text.split(' ')[0]*1;\n}", "title": "" }, { "docid": "cdddb65a8987074ed6ca7342ffe7acbb", "score": "0.5268743", "text": "function calcDailyWage(empHrs) {\n return empHrs * WAGE_PER_HOUR;\n}", "title": "" }, { "docid": "f5c9d93c1ba13177f113816951e28c6b", "score": "0.5262233", "text": "function wagesEarnedOnDate(employeeObj, day) {\n let hours = hoursWorkedOnDate(employeeObj, day);\n let rate = employeeObj.payPerHour\n return hours * rate\n}", "title": "" }, { "docid": "d04c7ddcba20387d7b997e2f6f920531", "score": "0.5250791", "text": "function getSumFreeTime(freeTimeArr) {\n //console.debug(\"getSumFreeTime()\"); //Test\n\n let total = 0;\n\n freeTimeArr.forEach((freeTime) => {\n if (freeTime.duration) {\n total += freeTime.duration.asMilliseconds();\n }\n });\n\n return dayjs.duration(total);\n }", "title": "" }, { "docid": "be380a55c531e2bb4b506698d1a6120a", "score": "0.524408", "text": "function calculateDuration() {\r\n\t\t\treturn endTime - startTime;\r\n\t\t}", "title": "" }, { "docid": "6f8177da979f02b440c74eb6ca05556f", "score": "0.52409965", "text": "function calculateDailyWage(empHrs) {\n return empHrs * WAGE_PER_HOUR;\n}", "title": "" }, { "docid": "b71711d3069d53933b78b224b866df98", "score": "0.52406394", "text": "function shoppingTime(memberId, money) {\n if (memberId == '' || memberId == undefined) {\n return 'Mohon maaf, toko X hanya berlaku untuk member saja'\n } else if (money < 50000){\n return 'Mohon maaf, uang tidak cukup'\n }\n \n var temp = {}\n temp.memberId = memberId;\n temp.money = money;\n var moneyNew = money;\n var listPurchasedTemp = [];\n while(true){\n if (moneyNew >= 1500000) {\n listPurchasedTemp.push('Sepatu Stacattu')\n moneyNew -= 1500000\n } else if (moneyNew >= 500000) {\n listPurchasedTemp.push('Baju Zoro')\n moneyNew -= 500000\n } else if (moneyNew >= 250000) {\n listPurchasedTemp.push('Baju H&N')\n moneyNew -= 250000\n } else if (moneyNew >= 175000) {\n listPurchasedTemp.push('Sweater Uniklooh')\n moneyNew -= 175000\n } else if (moneyNew >= 50000) {\n listPurchasedTemp.push('Casing Handphone')\n moneyNew -= 50000\n } else {\n break;\n }\n }\n temp.listPurchased = listPurchasedTemp;\n temp.changeMoney = moneyNew;\n return temp\n}", "title": "" }, { "docid": "ee952437afbb3700aaf26bf9d4b5370e", "score": "0.5239424", "text": "function _diffHrTime( hrTim) {\n\n let s = hrTim[0] - previousDataPointsMag[3][0][0];\n let ns = hrTim[1] - previousDataPointsMag[3][0][1];\n return s + ns * 1.0e-9;\n}", "title": "" }, { "docid": "898cca0f5f2cc2954e2e0aa0eda7ba59", "score": "0.5236685", "text": "function calcTotalTime() {\n\tvar allWatches = watches.getWatches(),\n\t\ttotalTime = 0,\n\t\ttotalRoundedTime = 0,\n\t\t$total = $('.sum'),\n\t\t$roundedTotal = $('.rounded-sum');\n\n\tallWatches.forEach(function(watch) {\n\t\ttotalTime += watch.get('totalTime');\n\t\ttotalRoundedTime += _roundTime(watch.get('totalTime'));\n\t});\n\n\ttotalRoundedTime += \" \" + ((totalRoundedTime === 1) ? 'hour' : 'hours');\n\n\t$total.text(formatTime(totalTime));\n\t$roundedTotal.text(totalRoundedTime);\n}", "title": "" }, { "docid": "5a5f82faa5c35c3d08b56bab73c2b109", "score": "0.5234955", "text": "function calculateFinalTime() {\n // Calculates the time between clicked rabbits and their appearance and adds it to finalTime\n for (let i = 0; i < rabbitAppearTimes.length; i++) {\n if (rabbitClickedTimes[i] != null) {\n finalTime += rabbitClickedTimes[i] - rabbitAppearTimes[i];\n }\n }\n\n // Calls the function to calculate the average reaction time and uppdate the variable with the result\n avReactSpeed = calculateAverageReaction(finalTime, rabbitAppearTimes.length - missedRabbitPenalty) / 1000;\n\n finalTime += missedRabbitPenalty * 4000; // adds the penalty-time for all the missed rabbits\n finalTime += misclickPenalty * 1000; // adds the penalty-time for all the missclicks on screen\n\n finalTime = finalTime / 1000; // sets final Highscore to seconds\n finalTime = finalTime.toFixed(2); // convertint to string and rounding to 2 decimals\n avReactSpeed = avReactSpeed.toFixed(2); // convertint to string and rounding to 2 decimals\n return finalTime; // returning finalTime\n}", "title": "" }, { "docid": "f4ba47d9595a8834f82460f2ac60cb48", "score": "0.52332634", "text": "function goalTimeCalc(distance, hopefulPace) {\n const goalTime = distance * hopefulPace;\n console.log(hopefulPace);\n const totalTime = \"Your total time for \" + distance + \" miles is \" + goalTime;\n return totalTime;\n }", "title": "" }, { "docid": "d143e8770837b3b8ca384621d88c61c8", "score": "0.5229504", "text": "averageHoursSlept() {\n let totalHoursSlept = 0;\n this.records.forEach(record => {\n totalHoursSlept += record.hoursSlept\n });\n return Math.ceil(totalHoursSlept / this.records.length);\n }", "title": "" }, { "docid": "f76d48f9e34cfe004219f03355763348", "score": "0.5227046", "text": "function timeCalc (){\n var tFrequency = sv.frequency;\n var firstTime = sv.first;\n\n var firstTimeConverted = moment(firstTime, \"HH:mm\").subtract(1, \"years\");\n\n var diffTime = moment().diff(moment(firstTimeConverted), \"minutes\");\n\n var tRemainder = diffTime % tFrequency;\n\n minAway = tFrequency - tRemainder;\n\n nextArrive = moment().add(minAway, \"minutes\").format(\"hh:mm\");\n\n }", "title": "" }, { "docid": "c7fa6e03a7bc58712b3abe9c9a311b8b", "score": "0.5222191", "text": "function FindHoursDifferencebetweenPickupAndDrop(dt2, dt1) {\n // console.log(dt1.getTime());\n var diff = (dt2.getTime() - dt1.getTime()) / 1000;\n diff /= 60;\n diff /= 60;\n return Math.abs(Math.round(diff));\n}", "title": "" }, { "docid": "601075e761542d6e96eb294d494e2e9f", "score": "0.5222126", "text": "function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}", "title": "" }, { "docid": "601075e761542d6e96eb294d494e2e9f", "score": "0.5222126", "text": "function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}", "title": "" }, { "docid": "601075e761542d6e96eb294d494e2e9f", "score": "0.5222126", "text": "function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}", "title": "" }, { "docid": "73d2deb5f4c51d6b97f27afccbb0372c", "score": "0.5220317", "text": "function cookingTime(eggs){\n return Math.ceil(eggs / 8) * 5;\n}", "title": "" }, { "docid": "43ebb31a15def32a394daeada0735c77", "score": "0.5218337", "text": "function calculateElapsedTime() {\n let currTime = new Date();\n if (isPaused) gamePausedTime = currTime - gameCurrTime;\n if (!hasWon) gameCurrTime = currTime - gamePausedTime;\n}", "title": "" }, { "docid": "b9c954f0e9ea5fa607a02873cc08b291", "score": "0.5209115", "text": "function getHoursPerWeek() {\n hoursPerWeek = hoursPerDay * daysPerWeek;\n\n\n}", "title": "" }, { "docid": "1e8e3ad5f95ceca557d603b85dc85628", "score": "0.520206", "text": "function remainingTime(timestr) {\n const targetTime = timestr.split(\":\");\n let hours = parseInt(targetTime[0]) - time.getHours();\n if (hours < 0) hours = 24 + hours;\n let minutes = parseInt(targetTime[1]) - time.getMinutes();\n if (minutes < 0) {\n if (hours === 0) hours = 24;\n hours --;\n minutes += 60;\n }\n if ((hours === 0) && (minutes === 0)) setNotDisplayTime(true);\n else if (hours === 0) return `${minutes} min`\n else if (minutes === 0) return `${hours} h`\n return `${hours} h ${minutes} min`;\n }", "title": "" }, { "docid": "4d938200e0d94dbc5f471cea748cae2d", "score": "0.52008194", "text": "function hoursWorkedOnDate(employee, dateOfDiff) {\n let inEvent = employee.timeInEvents.find((e) => e.date === dateOfDiff);\n let outEvent = employee.timeOutEvents.find((e) => e.date === dateOfDiff);\n\n // let hourseWorked = employee.timeOutEvents.hour - employee.timeInEvents.hour;\n\n return (outEvent.hour - inEvent.hour) / 100;\n}", "title": "" }, { "docid": "17249534c51918b98948533ffafe1839", "score": "0.51945835", "text": "function calculateDuration() {\n return endTime - startTime;\n }", "title": "" }, { "docid": "4d3df9a815bf8aa8183c8558481cfb80", "score": "0.5193312", "text": "timeInDays(hours){\r\n hours*=Hr\r\n return hours/Day\r\n }", "title": "" }, { "docid": "d998dbe93ca5bd4a851a5341c71fc2df", "score": "0.51924", "text": "function getTimeRemaining (endtime){ // A function that calculates the remainder of the time and receives hours, minutes and seconds.\r\n let t = Date.parse(endtime) - Date.parse(new Date()), \r\n seconds = Math.floor((t / 1000) % 60), // We get seconds through the remainder. \r\n minutes = Math.floor((t / 1000 / 60) % 60), // We get minutes.\r\n hours = Math.floor((t / (1000*60*60))); // We get the minutes.\r\n // days = Math.floor((t / (1000*60*60*24))); // Get the days.\r\n\r\n return { // We create an object with the obtained values and return it. getTimeRemaining(endtime).seconds, getTimeRemaining(endtime).seconds, getTimeRemaining(endtime).hours.\r\n 'total' : t,\r\n 'seconds' : seconds,\r\n 'minutes' : minutes,\r\n 'hours' : hours\r\n };\r\n }", "title": "" }, { "docid": "42e1635541131d20a707332fe4698582", "score": "0.51910955", "text": "function getTotalTime() {\n // Create Temporal Total Time\n let total_time = 0;\n\n // Add Time by Service\n servicesContracted.map(\n (service) =>\n (total_time += servicesList.filter(\n (serviceFilter) => serviceFilter.id == service\n )[0].duration)\n );\n\n // Return Total Time\n return total_time;\n }", "title": "" }, { "docid": "ae85c63a68c72bb603a1359421a06343", "score": "0.51896214", "text": "function howManySeconds(hours) {\n return hours*(60 * 60)\n\n\n}", "title": "" }, { "docid": "c3f8804a1f9f9a774d742f8bdb4cade6", "score": "0.51855505", "text": "get arrivalTime() {\r\n\t\treturn this.launchTime + this.totalTime;\r\n\t}", "title": "" }, { "docid": "6dc75a8f29ff3a678e8ae109ff1387a5", "score": "0.5185063", "text": "function timeLeft(typeLateMeal, hour, min)\n{\n var hourLeft\n var minLeft;\n\n if (typeLateMeal == 0) // lunch late meal\n {\n hourLeft = 15 - hour;\n minLeft = (45 + (60 * hourLeft)) - min;\n /*if (minLeft > 45) // 2:45 - 3 window\n {\n hourLeft = 0;\n } */\n\n if (hourLeft != 0 && minLeft <= 45)\n {\n document.getElementById(\"timeUntil\").innerHTML = \"&nbsp\" + hourLeft + \" hour and \" + minLeft + \" minutes until Late Meal ends.\" + \"&nbsp\";\n }\n else if (hourLeft != 0 && (minLeft - 60) > 0)\n {\n document.getElementById(\"timeUntil\").innerHTML = \"&nbsp\" + hourLeft + \" hour and \" + (minLeft - 60) + \" minutes until Late Meal ends.\" + \"&nbsp\";\n }\n else\n {\n document.getElementById(\"timeUntil\").innerHTML = \"&nbsp\" + minLeft + \" minutes until Late Meal ends.\" + \"&nbsp\";\n }\n }\n else // dinner late meal\n {\n hourLeft = 21 - hour; // hour remaining only if it's before 9\n minLeft = 60 - min;\n\n if (hourLeft != 0)\n {\n document.getElementById(\"timeUntil\").innerHTML = \"&nbsp\" + hourLeft + \" hour and \" + minLeft + \" minutes until Late Meal ends.\" + \"&nbsp\";\n }\n else\n {\n document.getElementById(\"timeUntil\").innerHTML = \"&nbsp\" + minLeft + \" minutes until Late Meal ends.\" + \"&nbsp\";\n }\n }\n}", "title": "" }, { "docid": "5758111b7d1bb3622e439abf8990c9fd", "score": "0.5181131", "text": "function retrieveTime(){\r\n\tlet t = (new Date().getTime() - time) / 1000;\r\n\t return Math.trunc(t);\t\r\n}", "title": "" }, { "docid": "4156b271fd9bb0a83823bd38baecd6a9", "score": "0.517832", "text": "function calcTravelTime(travelDate) {\n let today = new Date();\n // Number of milliseconds per day\n const msPerDay = 24 * 60 * 60 * 1000; \n\n let daysAway = (travelDate.getTime() - today.getTime())/msPerDay;\n daysAway = Math.floor(daysAway);\n let dateInfo = document.getElementById('date-info');\n dateInfo.innerHTML = \"\";\n\n const p = document.createElement(\"P\");\n p.innerHTML = `Your trip is ${daysAway} days away`;\n dateInfo.appendChild(p);\n\n return daysAway;\n}", "title": "" }, { "docid": "4e908bf7c87332bb7c8c2a1257efd363", "score": "0.5168434", "text": "function calculatePay()\n{\n var hours=prompt(\"Enter hours of work: \",\"hours of work\")\n var rph=prompt(\"Enter rate per hour: \",\"rate per hour\")\n console.log('Your weekly earning is ',parseInt(hours)*parseInt(rph))\n}", "title": "" }, { "docid": "ba44a11ba990a8acb8d83b6a038f0b37", "score": "0.51560515", "text": "function calc_strength_hours(start_strength_level, end_strength_level, attack_level) {\n var total_hours = 0;\n for (; start_strength_level < end_strength_level; start_strength_level++) {\n var hours_to_level = calc_time_to_next_level(attack_level, start_strength_level, 2)[0];\n total_hours = total_hours + hours_to_level;\n }\n return total_hours;\n }", "title": "" }, { "docid": "b1cd5cbf53e20652bcde98a56ff9c6b2", "score": "0.5150969", "text": "function calculateWage(arr){\n\n //Converts the minutes to decimal value, i.e: 16:30 -> 16.5, 16:05 -> 16.08\n function minutesToDecimal(minutes){\n //Divide by 60 in order to make time decimal and remove any periods.\n let decimal = String(minutes / 60).replace(`.`, ``);\n //If the number is bigger than 0.1, remove the zero, i.e: 07 -> 7\n if (decimal >= 0.1)\n decimal = decimal.replace(0, ``);\n\n return decimal;\n }\n\n let wage = document.getElementById(\"input_wage\").value;\n let overtime = 8;//After 8 hours of work it is considered overtime, 7 on friday\n let pay = 0;\n let averagePay = 0;\n let weeklyHours = 0;\n let totalHoursWorked = 0;\n let totalOvertimeHours = 0;\n let totalOvertimePay = 0;\n let count = 0;\n\n for (let day of arr)\n {\n count++;\n //Take the input and make an array out of it, [0] = Hour, [1] = Minutes\n let end = day.End.split(\":\");\n let start = day.Start.split(\":\");\n\n let startMinutes = minutesToDecimal(start[1]);\n let endMinutes = minutesToDecimal(end[1]);\n let shiftStart = Number(start[0] + \".\" + startMinutes);\n let shiftEnd = Number(end[0] + \".\" + endMinutes);\n\n let hoursWorked = shiftEnd - shiftStart;\n totalHoursWorked += hoursWorked;\n\n let overtimeHours = hoursWorked - overtime;\n let overtimePay = 0;\n\n //Overtime system\n if (overtimeHours > 0)\n {\n let extraOvertime = 0;\n let extra = false;\n\n //150% Overtime system - if worked over 10 hours\n if (hoursWorked > 10){\n extra = true;\n extraOvertime = hoursWorked - 10;\n overtimePay += extraOvertime * wage * 1.5;\n }\n\n totalOvertimeHours += overtimeHours;\n if (extra)\n overtimeHours -= extraOvertime;\n\n overtimePay += overtimeHours * wage * 1.25;\n totalOvertimePay += overtimePay;\n\n if (extra)\n overtimeHours += extraOvertime;\n }\n\n let dailyPay = (hoursWorked - overtimeHours) * wage + overtimePay;\n pay += dailyPay;\n averagePay += dailyPay;\n }\n\n let msg = `You have worked ${totalHoursWorked.toFixed(1)} hours and earned a total of ${Math.round(pay)} shekels.`;\n msg += `<br>Your average pay is ${(averagePay/count).toFixed(0)} shekels per day.`;\n\n if (totalOvertimePay > 0)\n msg += `<br>That includes ${totalOvertimeHours.toFixed(1)} hours overtime that yielded ${Math.round(totalOvertimeHours*wage*1.25 - totalOvertimeHours*wage)} extra shekels.`;\n\n document.getElementById(\"para\").innerHTML = msg;\n}", "title": "" }, { "docid": "1b2a9f25941709c05bc02efee8317457", "score": "0.51500773", "text": "function returnElapsedTime() {\n\n let now = performance.now();\n\n // Find the distance between now and the starting time\n let distance = now - startGameTime;\n\n // Time calculations for minutes and seconds\n let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));\n let seconds = Math.floor((distance % (1000 * 60)) / 1000);\n\n return minutes + \"m \" + seconds + \"s \";\n}", "title": "" } ]
945e982445722fb5be026421c828b313
active state for visible element on the viewport
[ { "docid": "47cb8f62a3a19da8828e9ebc7e152733", "score": "0.0", "text": "function scrollNav() {\n $(\"nav a\").click(function(e) {\n e.preventDefault();\n $('html,body').animate({\n scrollTop: ($(this.hash).offset().top - 100)\n }, 600);\n\n });\n\n var aChildren = $(\"nav li\").find('a'),\n aArray = [];\n\n for (var i = 0; i < aChildren.length; i++) {\n var aChild = aChildren[i],\n ahref = $(aChild).attr('href');\n aArray.push(ahref);\n }\n\n $(window).scroll(function() {\n var windowPos = $(window).scrollTop(),\n windowHeight = $(window).height(),\n docHeight = $(document).height();\n\n for (var i = 0; i < aArray.length; i++) {\n var theID = aArray[i],\n divPos = $(theID).offset().top - 100,\n divHeight = $(theID).height();\n\n if (windowPos >= divPos && windowPos < (divPos + divHeight)) {\n $(\"a[href='\" + theID + \"']\").addClass(\"is-active\");\n } else {\n $(\"a[href='\" + theID + \"']\").removeClass(\"is-active\");\n }\n }\n\n if (windowPos + windowHeight == docHeight) {\n if (!$(\"nav li:last-child a\").hasClass(\"is-active\")) {\n var navActiveCurrent = $(\".is-active\").attr(\"href\");\n $(\"a[href='\" + navActiveCurrent + \"']\").removeClass(\"is-active\");\n $(\"nav li:last-child a\").addClass(\"is-active\");\n }\n }\n });\n\n // back to top link\n $('.back-to-top a').on('click', function(e) {\n e.preventDefault();\n $('html, body').animate({\n scrollTop: 0\n }, 600);\n });\n}", "title": "" } ]
[ { "docid": "753fd2aadc13a906756ac678a4a12330", "score": "0.7436931", "text": "function activeView(element) {\n const postion = element.getBoundingClientRect();\n return (\n // the first two values to insure that every section is on the top of the screen or down a bit.\n postion.top >= 0 &&\n postion.left >= 0 &&\n //these vakues is used to make sure the section is still active while it is on the viewport.\n postion.bottom <=\n (window.innerHeight || document.documentElement.clientHeight) &&\n postion.right <= (window.innerWidth || document.documentElement.clientWidth)\n );\n}", "title": "" }, { "docid": "17aafea549bf11885616d9e8b246c26c", "score": "0.6587437", "text": "_checkVisible() {\n const viewHeight = Math.max(document.documentElement.clientHeight, \n window.innerHeight);\n const rect = this.container.getBoundingClientRect();\n const offSet = 300;\n const visible = !(rect.bottom < (0 - offSet) \n || rect.top - viewHeight >= (0 + offSet));\n\n if(this.state.visible !== visible) {\n this.setState({visible});\n } \n }", "title": "" }, { "docid": "e1049bc21470d171236c213a0f0c7f35", "score": "0.6584574", "text": "get visible() { return (this._visible); }", "title": "" }, { "docid": "e2fba2ddbdc55a65609dd3d15be5d12d", "score": "0.6545421", "text": "function checkviewportvisible() {\n viewport = jQuery(window).height();\n jQuery('.bos').each(function(){\n\n scrollwindow = viewport + jQuery(window).scrollTop()\n element = jQuery(this);\n \n if (element.offset().top <= scrollwindow ) {\n element.animate({\n 'top': '0',\n 'opacity': 1\n }, 1000);\n } \n });\n }", "title": "" }, { "docid": "369218f60a97993ad34c610417c76425", "score": "0.6540943", "text": "function isVisibleOnPage(elem){var docViewTop = $(window).scrollTop();var elemTop = $(elem).offset().top; var windowHeight = $(window).height(); return (elemTop <= docViewTop + 100);}", "title": "" }, { "docid": "369218f60a97993ad34c610417c76425", "score": "0.6540943", "text": "function isVisibleOnPage(elem){var docViewTop = $(window).scrollTop();var elemTop = $(elem).offset().top; var windowHeight = $(window).height(); return (elemTop <= docViewTop + 100);}", "title": "" }, { "docid": "903c449baeb5af5319ec89ebfcd2e57c", "score": "0.6497301", "text": "function checkActive(section){\n const OFFSET = 350;\n const anchor = document.querySelector(`a[href=\"#${section.id}\"]`);\n const sectionViewPoint = section.getBoundingClientRect();\n \n //if the viewpoint is within the offset then it's the active section\n if(sectionViewPoint.top <= OFFSET && (sectionViewPoint.height * -1 + OFFSET) <= sectionViewPoint.top){\n section.classList.add(\"your-active-class\");\n anchor.parentElement.classList.add(\"your-active-class\");\n }\n //remove active if viewpoint is not visable or in the main visablity.\n else{\n section.classList.remove(\"your-active-class\");\n anchor.parentElement.classList.remove(\"your-active-class\");\n }\n}", "title": "" }, { "docid": "e83920525d57eb910b76c2a05531e573", "score": "0.6489123", "text": "isActive() {\n var _a;\n return ((_a = this.tabEl) === null || _a === void 0 ? void 0 : _a.classList.contains(\"active\")) || false;\n }", "title": "" }, { "docid": "5fdfe41b7cfde811b7f291a34057e744", "score": "0.6446921", "text": "function isVisible($el) {\r\n var winTop = $(window).scrollTop();\r\n var winBottom = winTop + $(window).height();\r\n var elTop = $el.offset().top;\r\n var elBottom = elTop + $el.height();\r\n return ((elBottom <= winBottom) && (elTop >= winTop));\r\n}", "title": "" }, { "docid": "251ed8c6f7e8bf0446bd6c7301dc8136", "score": "0.6369589", "text": "function isActive() {\n for (let section of sections) {\n if (isInViewport(section)) {\n section.classList.add('your-active-class');\n } else {\n section.classList.remove('your-active-class');\n }\n }\n}", "title": "" }, { "docid": "4473c95a92024fb74b10b5165d96eaa8", "score": "0.63664967", "text": "function isVisible(el) {\n const rect = el.getBoundingClientRect();\n const windowHeight =\n window.innerHeight || document.documentElement.clientHeight;\n const windowWidth = window.innerWidth || document.documentElement.clientWidth;\n\n const vertInView = rect.top <= windowHeight && rect.top + rect.height >= 0;\n const horInView = rect.left <= windowWidth && rect.left + rect.width >= 0;\n\n return vertInView && horInView;\n}", "title": "" }, { "docid": "0856c2217ea313490ef597ec3c4a5406", "score": "0.6354982", "text": "function setToActive(){\n for (let i = 0; i < sections.length; i++){\n if (isInViewport(sections[i])){\n sections[i].classList.add(\"your-active-class\");\n }else{\n sections[i].classList.remove(\"your-active-class\");\n }\n }\n}", "title": "" }, { "docid": "bc89dcc6a5abf9ed2d9437fd40694f80", "score": "0.63430625", "text": "isVisible() {\n return this.visible;\n }", "title": "" }, { "docid": "ea4b7d541781eaf2109a1d3ef3770258", "score": "0.6326344", "text": "function viewportCheck() {\n let sectionList = document.querySelectorAll('section');\n for (listItem of sectionList) {\n let isInViewport = function (listItem) {\n let posSection = listItem.getBoundingClientRect();\n return (posSection.top > -300 && 300 > posSection.top);\n };\n const notActive = document.querySelector('.your-active-class')\n if (isInViewport(listItem)) {\n notActive.classList.remove('your-active-class');\n listItem.classList.add('your-active-class');\n }\n }\n }", "title": "" }, { "docid": "500eefe72a1f7e3fab37b7a0f57e4d76", "score": "0.63238287", "text": "isVisible() {\n return this._visibility === 'visible';\n }", "title": "" }, { "docid": "5186066eaed882515f675bd49f1681e1", "score": "0.6322", "text": "function isScrolledIntoView(el) {\r\n\t var elemTop = el.getBoundingClientRect().top;\r\n\t var elemBottom = el.getBoundingClientRect().bottom;\r\n\r\n\t var isVisible = (elemTop >= 0) && (elemBottom <= window.innerHeight);\r\n\t\t\t// $('.img-brand-block').addClass(\"fadeInDown\");\r\n\t\t\t// console.log(\"Element is in view!\");\r\n\t return isVisible;\r\n\t}", "title": "" }, { "docid": "31990e738ec9061016da26bb842c01bc", "score": "0.63170195", "text": "get visible()\n {\n return this.elt.getBoundingClientRect().height > 0;\n }", "title": "" }, { "docid": "cd7abe7b371df7ab11e744978190d0a5", "score": "0.63136846", "text": "function active()\n{ \n document.addEventListener('scroll',function () \n { \n for(const section of sections)\n {\n const pos= section.getBoundingClientRect();//get the section position reletive to the viewport\n if(pos.bottom> 0 && pos.bottom <= screen.height)//condition when section is in the viewport add class='active'\n {\n section.classList.add('active');\n const dataValue = section.getAttribute('data-nav');\n activeAnchor(dataValue);\n }\n else//if the section isn't in viewport remove class='active' \n {\n section.classList.remove('active');\n } \n }\n });\n}", "title": "" }, { "docid": "16b59529b4f32efb5138cb618f151984", "score": "0.6311569", "text": "function inView(){\n var sections = document.querySelectorAll('section');\n for (var x = 0; x< sections.length; x++){\n var sec = sections[x].id;\n var el = document.getElementById(sec);\n var pos = el.getBoundingClientRect();\n if (pos.top > -150 && pos.top < window.innerHeight - pos.top){\n var liCol = document.querySelectorAll('li');\n liCol[x].classList = 'active_li';\n }else{\n var liCol = document.querySelectorAll('li');\n liCol[x].classList.remove('active_li');\n }\n }\n}", "title": "" }, { "docid": "212fea21c64b36d1634e219b1e69c285", "score": "0.63022393", "text": "function makeVisible(element) {\n var selfTop = element.offset().top;\n if ( scrollPos > (selfTop - windowHeight + 100)) {\n element.addClass('visible');\n }\n }", "title": "" }, { "docid": "f1c6d05c454ccebdb1651afec0d67235", "score": "0.62850773", "text": "function check_element_visible() {\n var browser_height = $browser.height();\n var browser_top_position = $browser.scrollTop();\n var browser_bottom_position = (browser_top_position + browser_height);\n \n \n $.each($animate_el, function () {\n var $element = $(this);\n var element_height = $element.outerHeight();\n var element_top_position = $element.offset().top;\n var element_bottom_position = (element_top_position + element_height);\n \n \n if ((element_bottom_position >= browser_top_position) && (element_top_position <= browser_bottom_position)) {\n $element.addClass('visible');\n } else {\n $element.removeClass('visible');\n }\n \n });\n}", "title": "" }, { "docid": "a45b3dd6e4eb058647b8b745de97ce85", "score": "0.6284215", "text": "function activeClass() {\n const secTop = [];\n let inView = 10000;\n Array.prototype.forEach.call(sections, section => {\n secTop.push(section.getBoundingClientRect().top)\n })\n Array.prototype.forEach.call(secTop, elem => {\n if (elem >= 0 && elem < inView) {\n inView = elem;\n }\n })\n Array.prototype.forEach.call(sections, section => {\n if (section.getBoundingClientRect().top == inView) {\n if (!section.classList.contains('your-active-class')) {\n section.classList.add('your-active-class');\n }\n } else {\n section.classList.remove('your-active-class');\n }\n })\n}", "title": "" }, { "docid": "297c18a043ca8c0bc7daefffdc67ce7b", "score": "0.6261826", "text": "function activeClass(){\r\n\r\n for (let i=0; i < sections.length; i++){\r\n\r\n if (isInViewport(sections[i])){\r\n\r\n sections[i].classList.add(\"your-active-class\");\r\n\r\n }else{\r\n\r\n sections[i].classList.remove(\"your-active-class\");\r\n \r\n }\r\n }\r\n}", "title": "" }, { "docid": "f67e27e4839b5a07477c3c372712c76c", "score": "0.6244689", "text": "isElementVisible(el) {\n var rect = el.getBoundingClientRect();\n if (rect.width === 0) return false;\n if (rect.height === 0) return false;\n if (rect.top < 0) return false;\n if (rect.left < 0) return false;\n if (rect.bottom > (window.innerHeight || document.documentElement.clientHeight)) return false;\n if (rect.right > (window.innerWidth || document.documentElement.clientWidth)) return false;\n return true;\n }", "title": "" }, { "docid": "2e7870e27a183dfc2d9d93938a6fd3bf", "score": "0.622341", "text": "function getViewActive() {\n\t /**\n\t * Finds particular Node by ClassName.\n\t * @param par - ClassName - string\n\t * @return Nodes of particular Class\n\t *\n\t */\n\t function searchPlace(par) {\n\t return document.getElementsByClassName(par);\n\t }\n\t\n\t var listTodos = searchPlace(\"todos-item_undone-mark-w\");\n\t\n\t for (var i = 0; i < listTodos.length; i++) {\n\t listTodos[i].parentNode.style.display = \"block\";\n\t }\n\t\n\t listTodos = searchPlace(\"todos-item_done-mark-w\");\n\t\n\t for (var i = 0; i < listTodos.length; i++) {\n\t listTodos[i].parentNode.style.display = \"none\";\n\t }\n\t\n\t listTodos=null;\n\t\n\t}", "title": "" }, { "docid": "ac47e3f48513884fda6c8b78057a4d59", "score": "0.62101734", "text": "function toggleActiveState() {\n\n let options = {\n root: document,\n rootMargin: '0px',\n threshold: [1.0]\n };\n // Set sections as active\n let handleIntersect = (entries, observer) => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n entry.target.classList.add('your-active-class');\n } else {\n entry.target.classList.remove('your-active-class');\n }\n\n });\n };\n\n const observer = new IntersectionObserver(handleIntersect, options);\n Array.prototype.forEach.call(sections, (el) => {\n observer.observe(el);\n });\n}", "title": "" }, { "docid": "ef28e13ee5856722ee57fc949ab59bd3", "score": "0.6201167", "text": "function isVisible(element) {\n var viewport = $(window);\n\n var topOfViewport = $(window).scrollTop();\n var bottomOfViewport = topOfViewport + viewport.height();\n\n var topOfElement = element.offset().top;\n var bottomOfElement = topOfElement + element.height();\n\n var ease = element.height() / 2;\n\n var isInsideViewport = ((topOfElement + ease >= topOfViewport) && (bottomOfElement - ease <= bottomOfViewport));\n\n return isInsideViewport;\n}", "title": "" }, { "docid": "2f17d2c7bb92dedc5cd2462610989835", "score": "0.61827475", "text": "function activeSection() {\n for (let i = 0; i < sections.length; i++) {\n const visibleSection = sections[i].getBoundingClientRect();\n if (visibleSection.top <= 150 && visibleSection.bottom >= 150){\n sections[i].classList.add('your-active-class');\n } else {\n sections[i].classList.remove('your-active-class');\n };\n };\n}", "title": "" }, { "docid": "cd801671e366c9843d962bfacbc0f1a9", "score": "0.6179745", "text": "async isActive() {\n const host = await this.host();\n return host.hasClass('mdc-tab--active');\n }", "title": "" }, { "docid": "d1275855d61500429d530c4fa19135b9", "score": "0.6168258", "text": "function setActiveState($el) {\n $activeHeaderTrigger.removeClass(\"isSelected\");\n $activeHeaderTrigger.attr(\"aria-expanded\", \"false\");\n $activeHeaderTrigger\n .find(\".site-nav__chevron-down\")\n .removeClass(\"hide\");\n $activeHeaderTrigger.find(\".site-nav__chevron-up\").addClass(\"hide\");\n $(document).find(\"[data-header-overlay]\").css('z-index', -1);\n\n if ($el !== \"\") {\n $el.addClass(\"isSelected\");\n $el.attr(\"aria-expanded\", \"true\");\n $el.find(\".site-nav__chevron-down\").addClass(\"hide\");\n $el.find(\".site-nav__chevron-up\").removeClass(\"hide\");\n $(document).find(\"[data-header-overlay]\").css('z-index', 4);\n }\n }", "title": "" }, { "docid": "621b47d1a130960119c5585365c57bb8", "score": "0.6163659", "text": "function makeactive(event) {\n for (let section of sections) {\n var rect = section.getBoundingClientRect();\n if (rect.top < 700 & rect.top > -120){\n section.className = \"your-active-class\";\n }\n else{\n section.className = \"\";\n }\n }\n}", "title": "" }, { "docid": "81cd110c277693e361c501e848c28024", "score": "0.6135477", "text": "get active() {\n return this.hasAttribute(\"active\");\n }", "title": "" }, { "docid": "879809f829131aab19b864c4e33dab81", "score": "0.6128646", "text": "get visible() {\n return this._visible;\n }", "title": "" }, { "docid": "86387a4e030ab6253b6fa985a2e84cbb", "score": "0.61255133", "text": "get visible() {\n return this._visible\n }", "title": "" }, { "docid": "5fe9f8ae9c7faa330a2b1494737ae3a2", "score": "0.6111018", "text": "function activeStatus(){\n\nfor (i=0 ; i<(sections.length);i++){\n\n//https://www.w3schools.com/jsref/met_element_getboundingclientrect.asp\n const view = sections[i].getBoundingClientRect();\n\n//check the position of section\n if(view.top <= 150 && view.bottom > 150){\n\n sections[i].classList.add('your-active-class');\n\n const activeAnchor = document.querySelectorAll('a')[i];\n// check the style of active anchor\n activeAnchor.style.cssText = \"background: red;\";\n\n }\n\n else {\n\n sections[i].classList.remove('your-active-class');\n\n const inactiveAnchor = document.querySelectorAll('a')[i];\n\n inactiveAnchor.style.cssText = \"background: green;\";\n\n }\n }\n}", "title": "" }, { "docid": "12b8acd646b8eb1d0d1272c32be5351f", "score": "0.6107882", "text": "function addActiveClass(){ \n for (section of sections){\n if (isInViewport(section)){\n section.classList.add(\"your-active-class\");\n }else{\n section.classList.remove(\"your-active-class\");\n } \n } \n}", "title": "" }, { "docid": "ce44eebabee2f760ee60cc156440352c", "score": "0.60985214", "text": "function checkVisibleSection() {\n\t\tvar scrollTop = $(window).scrollTop(),\n\t\t\twindowHeight = $(window).height();\n\n\t\t$('[data-type=\"slider-item\"]').each(function(){\n\t\t\tvar actualBlock = $(this),\n\t\t\t\toffset = scrollTop - actualBlock.offset().top;\n\t\t\t//add/remove .is-visible class if the section is in the viewport - it is used to navigate through the sections\n\t\t\t( offset >= 0 && offset < windowHeight ) ? actualBlock.addClass('is-visible') : actualBlock.removeClass('is-visible');\n\t\t});\n\t}", "title": "" }, { "docid": "28572b41be965d2f620a33d2991cd87f", "score": "0.6098519", "text": "function isVisible(ele) {\n const { top, bottom } = ele.getBoundingClientRect();\n const vHeight = (window.innerHeight || document.documentElement.clientHeight);\n return ((top > 0 || bottom > 0) && top < vHeight);\n }", "title": "" }, { "docid": "a8c6961dd296d28d330fa5d4d2f554ba", "score": "0.6087095", "text": "isVisible() {\n return this.ampdoc.isVisible();\n }", "title": "" }, { "docid": "4d164107c20091afc94593408303a719", "score": "0.6085932", "text": "function makeActiv () {\n for (let sec of sections) {\n let box = sec.getBoundingClientRect(); // get coordinates of each section element\n let link = sec.id;\n let uLink = document.querySelector(`.${link}`);\n\n if (box.top <= 150 && box.bottom >= 150) { // if box-top coordinate (extracted via getBoundingClientRect) within 150px from the viewport and until box bottom is at 150px or more from the viewport\n sec.classList.add('your-active-class');\n uLink.classList.add('active');\n }\n else {\n sec.classList.remove('your-active-class');\n uLink.classList.remove('active');\n }\n }\n}", "title": "" }, { "docid": "85883dbac3c7a36021b326ab4f665c51", "score": "0.60822797", "text": "active(){\n return this.isActive;\n }", "title": "" }, { "docid": "e96bf8c7ee0bf4fd153e14630b30f305", "score": "0.60636544", "text": "isVisible(element) {\n return hasGeometry(element) && getComputedStyle(element).visibility === 'visible';\n }", "title": "" }, { "docid": "e96bf8c7ee0bf4fd153e14630b30f305", "score": "0.60636544", "text": "isVisible(element) {\n return hasGeometry(element) && getComputedStyle(element).visibility === 'visible';\n }", "title": "" }, { "docid": "cd26e4049c5358894e630653370969ed", "score": "0.6058441", "text": "isActive() {\n return (\n (this.props.active.type === EnumSelection.Step) &&\n (this.props.active.step === this.props.step.key)\n );\n }", "title": "" }, { "docid": "754e7d92d1d617888f380db13b7b6b73", "score": "0.60568374", "text": "function isVisible(ele) {\n\t\tconst { top, bottom } = ele.getBoundingClientRect();\n\t\tconst vHeight = (window.innerHeight || document.documentElement.clientHeight);\n\t\treturn (\n\t\t\t(top > 0 || bottom > 0) && top < vHeight);\n\t}", "title": "" }, { "docid": "ef0b2db0777c8fff16fd656704583b56", "score": "0.6055098", "text": "function activateSectionInView(){\n for (const el of sectionElements) {\n const navListElement = document.querySelector(`.menu__link[data-link='${el.id}']`);\n if (isInViewport(el)) {\n el.classList.add('your-active-class');\n navListElement.classList.add('active__link');\n } else {\n el.classList.remove('your-active-class');\n navListElement.classList.remove('active__link');\n }\n }\n}", "title": "" }, { "docid": "ed9538a73e6faf4a4b625136bc25542e", "score": "0.60414815", "text": "nodeActiveFn() {\n return this.nodeVisibleFn_;\n }", "title": "" }, { "docid": "909347ee6b81b1352605076090ffa351", "score": "0.6040609", "text": "get visible() {\n return this._visible;\n }", "title": "" }, { "docid": "83d21f1e7e7481ac1a74afb15cc33f87", "score": "0.6039501", "text": "get faceVisible() {\n return this.face.is(':visible');\n }", "title": "" }, { "docid": "340bfa99f2e668f72e4e54de9388024f", "score": "0.603272", "text": "function elementInViewport(el) {\n const rect = el.getBoundingClientRect();\n\n return (\n rect.top >= 0\n && rect.left >= 0\n && rect.top <= (window.innerHeight || document.documentElement.clientHeight)\n )\n }", "title": "" }, { "docid": "836b2fa4ca321cecec79282e1d628045", "score": "0.60320586", "text": "get Active() {}", "title": "" }, { "docid": "98e2fb8cb32f0eacbb2379997be743a3", "score": "0.60278046", "text": "function objVisibleOnScreen(obj){\n if (aqObject.CheckProperty(obj, \"Visible\", cmpEqual, true)){\n blnFlag=true; \n }\n else{\n blnFlag=false;\n }\n return blnFlag; \n }", "title": "" }, { "docid": "c9274b9e228bded4b70d1f8f438624f4", "score": "0.6018778", "text": "function isVisible(element) {\n var bottom_of_object = element.offset().top + element.outerHeight();\n var bottom_of_window = $(window).scrollTop() + $(window).height();\n \n if( bottom_of_window > bottom_of_object ) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "f45b8ab6fb353da78fe6c95155cedbe2", "score": "0.6008596", "text": "function _isInViewport() {\n $outerWrapper.toggleClass(_this.classes.above, $outerWrapper.offset().top + $outerWrapper.outerHeight() + itemsHeight > $win.scrollTop() + $win.height());\n }", "title": "" }, { "docid": "f08c54a682e6632576006f95860a979c", "score": "0.60077494", "text": "isActive(active) {\n if (this.menuPosition === 'auto') {\n if (active) {\n this.calcDropdownInViewportVertical();\n } else {\n // Timeout to wait for the animation to finish before recalculating\n setTimeout(() => {\n this.calcDropdownInViewportVertical();\n }, 100);\n }\n }\n }", "title": "" }, { "docid": "af7705000c9df92a7dd6ed4b34915e71", "score": "0.59980804", "text": "set visible(v) {\n super.visible = v;\n this.button.className = v ? \"tabSelected\" : \"tabUnselected\";\n this.element.className = v ? \"tabSelected\" : \"tabUnselected\";\n }", "title": "" }, { "docid": "af7705000c9df92a7dd6ed4b34915e71", "score": "0.59980804", "text": "set visible(v) {\n super.visible = v;\n this.button.className = v ? \"tabSelected\" : \"tabUnselected\";\n this.element.className = v ? \"tabSelected\" : \"tabUnselected\";\n }", "title": "" }, { "docid": "38598bea62bc41ff48c21f5eb6ac7216", "score": "0.5992033", "text": "function check_if_in_view() {\n //get current window information\n var window_height = web_window.height();\n var window_top_position = web_window.scrollTop();\n var window_bottom_position = window_top_position + window_height;\n\n //iterate through elements to see if its in view\n $.each(animation_elements, function () {\n //get the element sinformation\n var element = $(this);\n var element_height = $(element).outerHeight();\n var element_top_position = $(element).offset().top;\n var element_bottom_position = element_top_position + element_height;\n\n //check to see if this current container is visible (its viewable if it exists between the viewable space of the viewport)\n if (\n element_bottom_position >= window_top_position &&\n element_top_position <= window_bottom_position\n ) {\n element.addClass(\"in-view\");\n }\n // else {\n // element.removeClass(\"in-view\");\n // }\n });\n }", "title": "" }, { "docid": "a949823a71083e0b0395b7cf5b735f92", "score": "0.5987122", "text": "function show() {\n var notViewed = document.querySelectorAll('.notViewed')\n var windowTopPos = document.documentElement.scrollTop || document.body.scrollTop;\n var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight\n var rect;\n for (var i = 0; i < notViewed.length; i++) {\n rect = notViewed[i].getBoundingClientRect()\n if (windowTopPos + rect.top < windowHeight + windowTopPos) {\n console.log(windowHeight + windowTopPos)\n //console.log(windowTopPos + rect.top)\n notViewed[i].classList.add('viewed')\n notViewed[i].classList.remove('notViewed')\n //console.log('element: ' + i + ' ' + notViewed[i] + ', offset: ' + notViewed[i].offsetTop + ', windowHeight: ' + windowHeight + ', windowTopPos: ' + windowTopPos)\n }\n }\n}", "title": "" }, { "docid": "02514d5c5bbbe000115f6bdb24dd4452", "score": "0.59863585", "text": "function isVisible(element) {\n const elementPosition = element.getBoundingClientRect().top;\n const screenHeight = window.innerHeight;\n if (elementPosition < screenHeight / 1.18) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "888058477343e734bcc2ac37ac292517", "score": "0.5981784", "text": "function initInViewport() {\n jQuery('.has-anim').itemInViewport({\n activeClass: 'anim-active',\n visibleMode: 3\n });\n\n // jQuery('.top-bar *, .header-holder *, news-bar *, main > div *, main > section *, footer > div *').itemInViewport({\n // activeClass: 'opacity-active',\n // visibleMode: 3\n // });\n}", "title": "" }, { "docid": "adff91ed5643d21669e8460935165881", "score": "0.59601426", "text": "function active(){\n const observer = new IntersectionObserver(\n function (views){\n for (view of views) {\n if (view.isIntersecting){\n view.target.classList.add('your-active-class');\n let navs = document.querySelectorAll('li');\n //add class 'active' to navbar\n for(nav of navs){\n if (view.target.id == nav.textContent){\n nav.classList.add('active');\n }else{nav.classList.remove('active');\n }\n }\n }else{view.target.classList.remove('your-active-class')};\n };\n \n }, {threshold: [0.65]});\n parts.forEach(part => {observer.observe(part)});\n}", "title": "" }, { "docid": "13a7c849f2144eb96f90574ad9a2d634", "score": "0.59473467", "text": "checkActive (value) {\n if(this.props.currentView === value) {\n return 'active'\n }\n }", "title": "" }, { "docid": "d42df54059c32a948642a0bee8296066", "score": "0.5944997", "text": "function highLightActiveSection() {\n \n let section ;\n let view ;\n for (section of arrayOfSections) {\n let pos = section.getBoundingClientRect();\n // this conditional statement is to check the view port \n if ( pos.top >=-1 && ( pos.bottom <= window.innerHeight || pos.bottom <= window.innerHeight + 350 || pos.bottom <= window.innerHeight + 400) ) {\n let viewId = section.getAttribute('id');\n view = document.getElementById(viewId);\n for (section of arrayOfSections) {\n section.classList.remove('your-active-class');\n } \n view.classList.add('your-active-class');\n \n }\n \n }\n \n}", "title": "" }, { "docid": "c6f027ff84b0532c45f5a3678ead63cd", "score": "0.59424436", "text": "function setActive () {\n window.addEventListener('scroll', function (event) {\n let section = getActiveElem();\n section.classList.add('your-active-class');\n // set other sections as inactive\n for (let item of sections) {\n if (item.id != section.id & item.classList.contains('your-active-class')) {\n item.classList.remove('your-active-class');\n }\n }\n });\n}", "title": "" }, { "docid": "fe9d95bc9bf1537e76a4ba904681377d", "score": "0.5941147", "text": "function setActiveState() {\n var active = true;\n // If we have autoOpen set active to this state.\n if (angular.isDefined(vm.facetAutoOpen) && vm.facetAutoOpen === 'false') {\n active = false;\n }\n vm.active = active;\n }", "title": "" }, { "docid": "92c0fbabb24c7c333b93ab4aa8a7de75", "score": "0.59394914", "text": "function is_in_view(elem) {\n\t\t\t\t var docViewTop = $(window).scrollTop(); \n\t\t\t\t var docViewBottom = docViewTop + $(window).height(); \n\t\t\t\t var elemTop = $(elem).offset().top; \n\t\t\t\t var elemBottom = elemTop + $(elem).height();\n\t\t\t\t var result = ((elemBottom >= docViewTop) && (elemTop <= docViewBottom));\n\t\t\t\t return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom)); \n\t\t\t\t}", "title": "" }, { "docid": "202dd93e5dec2d483ca511ab31343846", "score": "0.59375584", "text": "function EZvisible(el, trueFalse)\n{\n\treturn trueFalse === true || EZisTrue(trueFalse) ? EZshow(el) : EZhide(el, true, 'visibility');\n}", "title": "" }, { "docid": "202dd93e5dec2d483ca511ab31343846", "score": "0.59375584", "text": "function EZvisible(el, trueFalse)\n{\n\treturn trueFalse === true || EZisTrue(trueFalse) ? EZshow(el) : EZhide(el, true, 'visibility');\n}", "title": "" }, { "docid": "24449920589f9c0a7f85aa6e30ba5a58", "score": "0.59367234", "text": "function sectionActive() {\n for (const section of allSections) {\n const box = section.getBoundingClientRect();\n if (box.top <= 170 && box.bottom >= 170) {\n section.classList.add('active-class');\n document.querySelector(`.${section.id}`).classList.add('active-link');\n } else {\n section.classList.remove('active-class');\n document.querySelector(`.${section.id}`).classList.remove('active-link');\n }\n }\n}", "title": "" }, { "docid": "ad0a2f8fbe5b3c221eb23ca04557c720", "score": "0.59366125", "text": "_updateActive(/*evt, elem, scrollPos*/) {\n if (this.mutexScrollLocked()) return;\n\n var winPos = /*scrollPos ||*/ parseInt(window.pageYOffset, 10),\n curIdx;\n\n if(winPos + this.winHeight === this.docHeight){ curIdx = this.points.length - 1; }\n else if (winPos < this.points[0]){ curIdx = -1; }\n else{\n var isDown = this.scrollPos < winPos,\n _this = this,\n curVisible = this.points.filter(function(p, i){\n return isDown ? p <= winPos : p - _this.options.threshold <= winPos;//&& winPos >= _this.points[i -1] - _this.options.threshold;\n });\n curIdx = curVisible.length ? curVisible.length - 1 : 0;\n }\n\n this.$active.removeClass(this.options.activeClass);\n this.scrollPos = winPos;\n\n if (curIdx >= 0) {\n this.$active = this.$targets.eq(curIdx).addClass(this.options.activeClass);\n\n if(this.options.deepLinking) {\n this.options.updateUrl(this.$active);\n }\n }\n else {\n this.$active = $();\n this.options.updateUrl(null);\n }\n\n /**\n * Fires when magellanhash is finished updating to the new active element.\n * DIFFERENCE: no need in this\n * @event MaggelanHash#update\n */\n //this.$element.trigger('update.zf.magellanhash', [this.$active]);\n }", "title": "" }, { "docid": "cefff897e21f670199c05bbb9265a8db", "score": "0.5934395", "text": "get active() {\n return this.hasAttribute('active');\n }", "title": "" }, { "docid": "efb83e6ee7773bc7607048d7c95b4334", "score": "0.5917236", "text": "function is_active (a) {\n\t\t\tif (a.is_active == 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "title": "" }, { "docid": "03b6f89b8ecd6487d393e63cb932aa97", "score": "0.59145916", "text": "get active() {\n return this._isActive;\n }", "title": "" }, { "docid": "4842856066416946403e57ff571769a3", "score": "0.5913717", "text": "function active() {\n return (M.mq(activeMediaQuery) && !menuActive) || floaterState(false);\n }", "title": "" }, { "docid": "defa3181e9e30038efc57f8a2f824d08", "score": "0.59070534", "text": "function inView(el) {\n\t\t\t\tvar rect = el.getBoundingClientRect();\n\t\t\t\treturn (\n\t\t\t\t\trect.top <= (window.innerHeight - 100 || document.documentElement.clientHeight)\n\t\t\t\t);\n\t\t\t}", "title": "" }, { "docid": "4296493d849535509461dcbba3b22588", "score": "0.59034276", "text": "isVisible() {\n return this.toolbarSelector.hasClass(\"fadeIn\");\n }", "title": "" }, { "docid": "97ae7a7afcbf592c3089c0a5abc3466c", "score": "0.5900354", "text": "function check_if_in_view() {\n //get current window information\n var window_height = web_window.height();\n var window_top_position = web_window.scrollTop();\n var window_bottom_position = (window_top_position + window_height);\n\n //iterate through elements to see if its in view\n $.each(animation_elements, function() {\n\n //get the element sinformation\n var element = $(this);\n var element_height = $(element).outerHeight();\n var element_top_position = $(element).offset().top;\n var element_bottom_position = (element_top_position + element_height);\n\n //check to see if this current container is visible (its viewable if it exists between the viewable space of the viewport)\n if ((element_bottom_position >= window_top_position) && (element_top_position <= window_bottom_position)) {\n element.addClass('in-view');\n } else {\n element.removeClass('in-view');\n }\n });\n\n }", "title": "" }, { "docid": "97ae7a7afcbf592c3089c0a5abc3466c", "score": "0.5900354", "text": "function check_if_in_view() {\n //get current window information\n var window_height = web_window.height();\n var window_top_position = web_window.scrollTop();\n var window_bottom_position = (window_top_position + window_height);\n\n //iterate through elements to see if its in view\n $.each(animation_elements, function() {\n\n //get the element sinformation\n var element = $(this);\n var element_height = $(element).outerHeight();\n var element_top_position = $(element).offset().top;\n var element_bottom_position = (element_top_position + element_height);\n\n //check to see if this current container is visible (its viewable if it exists between the viewable space of the viewport)\n if ((element_bottom_position >= window_top_position) && (element_top_position <= window_bottom_position)) {\n element.addClass('in-view');\n } else {\n element.removeClass('in-view');\n }\n });\n\n }", "title": "" }, { "docid": "7f07683255fdef878c06634e410a2f24", "score": "0.58967084", "text": "isVisible() {\n return this.toolbarSelector.is(\":visible\");\n }", "title": "" }, { "docid": "848a1215a197bcb62329b66841020f3f", "score": "0.5890996", "text": "isActive() {\n return this.getHealth() > 0;\n }", "title": "" }, { "docid": "a88a9b9b0e1538052a10c403f9f82557", "score": "0.5889728", "text": "get visible() {\n return super.visible;\n }", "title": "" }, { "docid": "a88a9b9b0e1538052a10c403f9f82557", "score": "0.5889728", "text": "get visible() {\n return super.visible;\n }", "title": "" }, { "docid": "0becec6b6a01f8cb8a18525524b00fed", "score": "0.5868889", "text": "onScreen() {\n if (0 <= this.x && this.x <= 900) {\n this.displayed = true;\n } else {\n this.displayed = false;\n }\n }", "title": "" }, { "docid": "992a3906342ce3c00a69023a2460e708", "score": "0.5868435", "text": "function isVisible(element) {\n\t\tvar top = element.getBoundingClientRect().y,\n\t\t\theight = document.documentElement.clientHeight;\n\t\treturn (window.scrollY + height) > top;\n\t}", "title": "" }, { "docid": "f2e59eb7838fd0a87800b57b6b6ca76f", "score": "0.5868021", "text": "activate () {\n this._isActive = true\n }", "title": "" }, { "docid": "3d8c898afb997ef1068173db1d2fd5be", "score": "0.58657706", "text": "function showActiveSection() {\n const sections = document.querySelectorAll(\"section[data-nav]\");\n\n sections.forEach(section => {\n navItems.forEach(item => {\n if (item.hash === ('#' + section.id)) {\n if (isInViewport(section)) {\n item.classList.add(\"active\");\n } else {\n item.classList.remove(\"active\");\n }\n }\n });\n });\n}", "title": "" }, { "docid": "96fb63932dcb39768a91cabc145b77fa", "score": "0.58652383", "text": "function check_if_in_view() {\r\n //get current window information\r\n var window_height = web_window.height();\r\n var window_top_position = web_window.scrollTop();\r\n var window_bottom_position = (window_top_position + window_height);\r\n\r\n //iterate through elements to see if its in view\r\n $.each(animation_elements, function() {\r\n\r\n //get the elements information\r\n var element = $(this);\r\n var element_height = $(element).outerHeight();\r\n var element_top_position = $(element).offset().top;\r\n var element_bottom_position = (element_top_position + element_height);\r\n\r\n //check to see if this current container is visible (its viewable if it exists between the viewable space of the viewport)\r\n if ((element_bottom_position >= window_top_position) && (element_top_position <= window_bottom_position)) {\r\n element.addClass('in-view');\r\n } else {\r\n element.removeClass('in-view');\r\n }\r\n });\r\n\r\n }", "title": "" }, { "docid": "d0b259da37862d584bdd86b7cc35325e", "score": "0.5852267", "text": "get active() {\n\t\treturn this.getAttribute('active');\n\t}", "title": "" }, { "docid": "79df21332578b4eac663f19dca5d9872", "score": "0.5852252", "text": "checkVisible() {\n\t\tif (this.parentNode) {\n\t\t\tlet numCards = document.body.clientWidth > MOBILE_RESOLUTION ? 3 : 1;\n\t\t\tthis.isVisible = Array.from(this.parentNode.children).indexOf(this) < numCards;\n\t\t}\n\t}", "title": "" }, { "docid": "273f6df97c9e73bca98967b7e19c1492", "score": "0.58458555", "text": "function classActive(element) {\r\n\t\tif($(element).hasClass('active')) {\r\n\t\t\t$(element).removeClass('active');\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$('.btn-paint').removeClass('active'); \r\n\t\t\t$(element).addClass('active');\r\n\t\t}\r\n\r\n\t\t$('#pipette').hasClass('active') == true ? \r\n\t\t$('#pipette-setup').css('display', 'block') : \r\n\t\t$('#pipette-setup').css('display', 'none');\r\n\r\n\t\t$('#text').hasClass('active') == true ? \r\n\t\t$('#text-setup').css('display', 'block') : \r\n\t\t$('#text-setup').css('display', 'none');\r\n\r\n\t\t$('#degrade').hasClass('active') == true ? \r\n\t\t$('#degrade-setup').css('display', 'block') : \r\n\t\t$('#degrade-setup').css('display', 'none');\r\n\t}", "title": "" }, { "docid": "19b8f8f638bf7f650ce6d607e6e60a8e", "score": "0.5838367", "text": "isActive() {\n return this.enabled;\n }", "title": "" }, { "docid": "a062d24380b6ffbf758798ffce713073", "score": "0.5835376", "text": "function checkView () {\n let isInViewport = function (elem) {\n let bounding = elem.getBoundingClientRect();\n return (\n bounding.top >= 0 &&\n bounding.left >= 0 &&\n bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\n bounding.right <= (window.innerWidth || document.documentElement.clientWidth)\n );\n };\n\n const features = document.querySelector('content-features');\n window.addEventListener('scroll', function (event) {\n if (isInViewport(features)) {\n let featView = document.querySelector('Features');\n featView.classList.add(\"active\");\n }\n }, false);\n}", "title": "" }, { "docid": "91ad6be91fb1ac64fcd06c1092fe69bc", "score": "0.5826505", "text": "visible() {\n return this.actor_attribute_key == AttributeKey.classes;\n }", "title": "" }, { "docid": "5ad0309b93594a83dd4e32e35157b5de", "score": "0.58253556", "text": "function elementInViewport(el) {\n\t\t\t\t var top = el.offsetTop,\n\t\t\t\t left = el.offsetLeft,\n\t\t\t\t width = el.offsetWidth,\n\t\t\t\t height = el.offsetHeight;\n\n\t\t\t\t while(el.offsetParent) {\n\t\t\t\t el = el.offsetParent;\n\t\t\t\t top += el.offsetTop;\n\t\t\t\t left += el.offsetLeft;\n\t\t\t\t }\n\n\t\t\t\t return (\n\t\t\t\t top < (window.pageYOffset + window.innerHeight) + 56 &&\n\t\t\t\t left < (window.pageXOffset + window.innerWidth) + 56 &&\n\t\t\t\t (top + height) > window.pageYOffset + 56 &&\n\t\t\t\t (left + width) > window.pageXOffset + 56\n\t\t\t\t );\n\t\t\t}", "title": "" }, { "docid": "91b191a4df8ddbf4c2649c3991d76687", "score": "0.5825278", "text": "function isElementInView(el, n) {\n const rect = el.getBoundingClientRect();\n const elemTop = rect.top\n const elemBottom = rect.bottom\n const isVisible = (elemTop >= 0) && ((elemBottom/n) <= ((window.innerHeight) || (document.documentElement.clientHeight)));\n return isVisible\n}", "title": "" }, { "docid": "a9e80d7b932c8be506a5033bfffaf587", "score": "0.5821083", "text": "function activeSection(){\n for(section of allSections){ \n\t// check if the section in the viewport of the screen\n\t if(sectionPosition(section)){\n\t// check if the section has the active class or not\n\t if(section.classList.contains(\"your-active-class\")){\n\t \tsection.classList.remove(\"your-active-class\"); }\n\t else{\n\t section.classList.add(\"your-active-class\");}\n\t }\n }\n}", "title": "" }, { "docid": "18983c94060fa872191dc736a35a9b32", "score": "0.5819175", "text": "activeClass() {\n const curSlide = this.config.loop ? this.curSlide + this.visibleSlides : this.curSlide;\n const classCount = this.visibleSlides;\n const availableItems = this.selector.querySelectorAll(this.config.itemSelector);\n const itemSelector = this.config.itemSelector.replace('.', '');\n const activeClass = itemSelector + '-active';\n\n if (availableItems) {\n for (let i = 0; i < availableItems.length; i += 1) {\n availableItems[i].classList.remove(activeClass);\n }\n\n for (let j = 0; j < classCount; j += 1) {\n availableItems[curSlide + j].classList.add(activeClass);\n }\n\n // centered mode\n if (this.config.centerMode) {\n this.centerMode(itemSelector);\n }\n }\n\n }", "title": "" }, { "docid": "1825671ec828ba3284fd36debaf6722b", "score": "0.58177483", "text": "function visible(element){var visibility=element.css(\"visibility\");while(visibility===\"inherit\"){element=element.parent();visibility=element.css(\"visibility\");}return visibility!==\"hidden\";}", "title": "" }, { "docid": "6ad7951bc64c27c040b8f21c93398a89", "score": "0.5817723", "text": "getVisibilityState() {\n return this.ampdoc.getVisibilityState();\n }", "title": "" }, { "docid": "2663b5bb9efa2783a79fdfa89384d6f7", "score": "0.58143425", "text": "function check_if_in_view(){\n var window_height = $window.height();\n var window_top_position = $window.scrollTop();\n var window_bottom_position = (window_top_position + window_height);\n\n $.each($index_article_img, function(){\n var $element = $(this);\n var element_height = $element.outerHeight();\n var element_top_position = $element.offset().top;\n var element_bottom_position = (element_top_position + element_height);\n\n if ((element_bottom_position >= window_top_position) && (element_top_position <= window_bottom_position)){\n $element.addClass('in-view');\n } else {\n $element.removeClass('in-view');\n }\n });\n}", "title": "" } ]
3f60cf2e59a963e38b7ed84a35f35a3d
Get Game List using Steam API
[ { "docid": "1971d5c6f15cf983e64d80a56f529f48", "score": "0.64932305", "text": "getGames(steamid){\n\t//set steamID to user's entered id\n\tthis.steamID = steamid;\n\tlet sortedObj;\n\tlet playerName;\n\t//run get request via http library, and return sorted object\n\treturn http.get(`https://cors-anywhere.herokuapp.com/http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=${this.APIkey}&include_appinfo=1&include_played_free_games=1&steamid=${this.steamID}&format=json`)\n\t\t.then(results => {\n\t\t\t//check for error in results\n\t\t\tif(results.response.game_count){\n\t\t\t\t//sort games via function\n\t\t\t\tsortedObj = this.sortGames(results.response);\n\t\t\t\t//return the sorted games object\n\t\t\t\treturn sortedObj;\n\t\t\t} else{\n\t\t\t\treturn 'error';\n\t\t\t}\n\t\t\t\t})\n\t\t.catch(err => console.log(err));\t\n\t\t\n\t}", "title": "" } ]
[ { "docid": "4dcc33453988784deb2c1831a624db70", "score": "0.7437258", "text": "function fetchGameList(){\n\tfetch(\"https://rawg-video-games-database.p.rapidapi.com/games?page=1\", {\n\t\"method\": \"GET\",\n\t\"headers\": {\n\t\t\"x-rapidapi-host\": \"rawg-video-games-database.p.rapidapi.com\",\n\t\t\"x-rapidapi-key\": \"ba56e18dfbmsha0533de8919d27bp10d3dcjsn5229ce979bb3\"\n\t}\n\t})\n\t.then((resp) => resp.json())\n\t.then(function (response) {\n\t\t\tvar jsonGameList = response;\n\t\t\t//Envia el ID de cada uno de los juegos en la primera página\n\t\t\tfor(var i = 0; i < 19; i++){\n\t\t\t\tfetchGameInfo(jsonGameList.results[i].id);\n\t\t\t}\n\t})\n\t.catch(function (err) {\n\t\t\tconsole.log(\"No se puedo obtener el recurso\", err);\n\t});\n}", "title": "" }, { "docid": "41d762be1471ec420765517ebdd2fd9d", "score": "0.71969146", "text": "async listGames(init) {\r\n return this.request('/games', init);\r\n }", "title": "" }, { "docid": "0e6cf68431c24b1ee832f26985632670", "score": "0.6822302", "text": "async function getGameData() {\n var res = await fetch(\"/games/search?limit=-1\")\n var resp = await res.json();\n return resp\n}", "title": "" }, { "docid": "1066df36c0a14daa4705407b2a563ef5", "score": "0.68061924", "text": "async getGameInfos() {\n\t\tawait this.login(LOGIN_ACCOUNT_GAUTIER)\n\t\tconst game = await this.sendRequest({ rsn:'2ynbmhanlb',guide:{ login:{ language:1,platform:'gaotukc',ug:'' } } }, '699002934')\n\n\t\treturn game.a\n\t}", "title": "" }, { "docid": "c52b1b7e052c80341cc8b0338a9364d5", "score": "0.67902493", "text": "list(req, res) {\n Game.findAll()\n .then((games) => {\n res.status(200).json(games);\n })\n .catch((error) => {\n res.status(500).json(error);\n });\n }", "title": "" }, { "docid": "ca87a146dc41ceb01c192fa99a3d7d28", "score": "0.6733176", "text": "function getGames(cmd, str, callbackObj) {\n let gamesJSON = [];\n\n let requestURL = \"http://api.steampowered.com/ISteamApps/GetAppList/v0002\";\n\n let r = request(requestURL, function (err, res, body) {\n search(cmd, str, JSON.parse(body).applist.apps, callbackObj);\n });\n}", "title": "" }, { "docid": "1bdd524af421dcc6bc5fdcee86cbb598", "score": "0.67256856", "text": "function getAllGames()\n {\n ajaxHelper(gamesUri, 'GET').done(function (data)\n {\n self.games(data);\n });\n }", "title": "" }, { "docid": "e62f5abf9f30bd76b4e9b09047ae5e93", "score": "0.67047113", "text": "getGames(){\n let games = fetch(API_URL +'/api/games',\n {method: 'GET'}).then((response) => response.json())\n return games;\n }", "title": "" }, { "docid": "20b1acd602d869936792e0046bdd0f87", "score": "0.6700918", "text": "async myGames (data = {}) {\n return await this.request('get', '/my-games', data, {games: ensureArray})\n }", "title": "" }, { "docid": "848162a2a6a38c4c8f6462f2917ec741", "score": "0.6609713", "text": "async function games() {\n const allGamesResponse = await axios.get(`https://api.steampowered.com/ISteamApps/GetAppList/v2/`);\n // console.log(allGames);\n // console.log(allGames.data.applist.apps);// indiviudal item will be an element inside the array apps; the entire array of apps exist would be data.applist.apps\n const allGames = allGamesResponse.data.applist.apps\n return allGames;\n}", "title": "" }, { "docid": "18a31b4415c7e43c19da6e05cc3d7e04", "score": "0.66035795", "text": "retrieveAllGames() {\n return freendiesApi.retrieveAllGames()\n }", "title": "" }, { "docid": "747a67a778d93e31c82cd1d1badc30e9", "score": "0.6552598", "text": "getLiveLeagueGames() {\n const query_params = {\n key: this.apiKey\n }\n return fetch(BASE_URL + DOTA_MATCHES + 'GetLiveLeagueGames/v1/?' + handleQueryParams(query_params))\n .then(response => responseHandler(response))\n .catch(e => e)\n }", "title": "" }, { "docid": "70319906e6f2c58a2515bc105323debd", "score": "0.65334445", "text": "async function getAllGameIds(url = defaultUrl) {\n const response = await fetch(`/api/game`, {\n method: \"GET\",\n headers: {\n 'Content-Type': 'application/json'\n }\n });\n return await response.json();\n}", "title": "" }, { "docid": "2fbd5e7e4306ad1c0a5bc6dc8fdaa946", "score": "0.6528095", "text": "function getOwnedGames(force_update = false){\n\tif (settings.steam_id.length != 17){\n\t\tmyApp.alert('Invalid Steam ID 64 supplied,<br/>Must be 17 characters long..');\n\t\treturn;\n\t}\n\t//check if we have a steamID & check if it has been 24 hours since last update\n\tif (!!force_update || +local_settings.owned_apps_next_update < +new Date().getTime() ){\n\t\t$.ajax({\n\t\t\tcache: false,\n\t\t\tdataType: 'json',\n\t\t\turl: 'https://store.steampowered.com/dynamicstore/userdata/',\n\t\t\tsuccess: (res) => {\n\t\t\t\tconst rgOwnedApps = res.rgOwnedApps || [];\n\t\t\t\tconst rgOwnedPackages = res.rgOwnedPackages || [];\n\t\t\t\tconst ownedApps = [...new Set([...rgOwnedPackages, ...rgOwnedApps])];\n\t\t\t\tif (ownedApps.length <= 0){\n\t\t\t\t\tmyApp.alert('No owned games found,<br/>Try signing into steam first.<br/><br/>Attempting fallback server, Less owned games will be retrieved though.');\n\t\t\t\t\tgetOwnedGamesFallback(force_update);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// Set owned apps\n\t\t\t\tlocal_settings.owned_apps = ownedApps;\n\t\t\t\t// Set current time + 24 hours as next updated time\n\t\t\t\tlocal_settings.owned_apps_next_update = +new Date().getTime() + (24 * 60 * 60 * 1000);\n\t\t\t\tsave_options('local');\n\t\t\t\tmyApp.alert(`Owned Games List Updated!<br/>Games Found: ${ownedApps.length}`);\n\t\t\t},\n\t\t\terror: (err) => {\n\t\t\t\tmyApp.alert('Are you signed into steam?<br/>Attempting fallback server, Less owned games will be retrieved though.');\n\t\t\t\tgetOwnedGamesFallback(force_update);\n\t\t\t}\n\t\t});\n\t}\n}", "title": "" }, { "docid": "6ddab0ad9e6bb478c1fe34a5ee9f0d9c", "score": "0.64364207", "text": "async getAllUserGames ({ auth, response }) {\n const allUserGames = await Game.query()\n .where('user_id', auth.current.user.id)\n return response.json({\n status: 'success',\n data: allUserGames\n })\n }", "title": "" }, { "docid": "90a4f1864a967a002ee2a3b387de08b9", "score": "0.6419179", "text": "getGames() {\n return axios.get(Constants.GAMES_ENDPOINT)\n .then((result) => {\n return result.data;\n })\n }", "title": "" }, { "docid": "e570265c28785bba58dd8937aaf1a773", "score": "0.6360097", "text": "getAllGames(){\t\n\t\tlet games = [];\n\t\tfor(let i = 0;i<this.games.length();i++){\n\t\t\tgames.push(this.games.at(i).getLobbyVersion());\n\t\t}\n\t\treturn games;\n\t}", "title": "" }, { "docid": "0a751b42979d1293e9bbc0301f86e4ec", "score": "0.6340395", "text": "function getGames(player) {\n playerId = player || \"\";\n if (playerId) {\n playerId = \"/?player_id=\" + playerId;\n }\n $.get(\"/api/games\" + playerId, function(data) {\n console.log(\"Games\", data);\n games = data;\n if (!games || !games.length) {\n displayEmpty(player);\n }\n else {\n initializeRows();\n }\n });\n }", "title": "" }, { "docid": "bfcc58c3039bf373064ebe249707848b", "score": "0.6327575", "text": "async function loadGames() {\n const allGameInfoResponse = await fetch(url + '/readAllGames', {\n method: \"GET\",\n headers: {\n \"Content-type\": \"application/json; charset=UTF-8\"\n }\n });\n if (allGameInfoResponse.ok) {\n const games = await allGameInfoResponse.json();\n window.games = games;\n console.log(games);\n }\n else {\n console.log(allGameInfoResponse);\n }\n}", "title": "" }, { "docid": "140c319a5c6736fdd31a65f616f2602a", "score": "0.6281858", "text": "function getTeamList() {\n if (\"caches\" in window) {\n caches.match(ENDPOINT_EPL + \"teams\").then(function (response) {\n if (response) {\n response.json().then(function (data) {\n showTeamList(data);\n })\n }\n })\n }\n\n fetchAPI(ENDPOINT_EPL + \"teams\")\n .then(data => {\n showTeamList(data);\n })\n .catch(error);\n}", "title": "" }, { "docid": "b3e8dbf07437e6e260772d792f7782eb", "score": "0.62816083", "text": "function getLiChessGames(username){\n var url = \"https://us-central1-lazhack7-3b615.cloudfunctions.net/games?username=\" + username;\n return $http.get(url)\n .then(function(result){\n var gameStrings = result.data.replace(/(\\r\\n|\\n|\\r)/gm,\"\\n\").split(\"\\n\");\n var games = [];\n gameStrings.forEach(function(str) {\n try {\n games.push(JSON.parse(str));\n } catch(e){\n\n }\n });\n return games;\n });\n }", "title": "" }, { "docid": "21f713b348d4baf7cc87d59c20484ceb", "score": "0.6223511", "text": "async getGame() {\n return (await this._client.helix.games.getGameById(this._data.game_id));\n }", "title": "" }, { "docid": "4f2bd050522117b1bbd91fdf94670809", "score": "0.6222597", "text": "async function getUserGameplays(user, type) {\n return fetch(URL + '/players/' + user.id + '/games?gameType=' + type, {\n method: 'GET',\n mode: 'cors',\n headers: {\n 'Authorization': 'Bearer ' + user.token\n }\n }).then(res => res.json());\n}", "title": "" }, { "docid": "9a5aaa8c075c1a5ab08955654a053133", "score": "0.62211716", "text": "static fetchAllGames(url) {\n fetch(url)\n .then(res => res.json())\n .then(gamesObjects => {\n\n // Show the \"Create New Game\" form on the page\n Game.showCreateGameForm();\n\n gamesObjects.forEach(gameObject => {\n \n \n\n // Create a new Game object on the front-end\n const game = new Game(gameObject.id, gameObject.name, gameObject.status, gameObject.phase)\n gameObject.players.forEach(playerObject => {\n const player = new Player(playerObject.id, playerObject.name);\n game.players.push(player);\n }) \n \n // Renders a specific game on the page\n game.renderGameListCard();\n\n })\n\n // Open websocket connection with new games\n Game.createGamesWebsocketConnection();\n\n })\n }", "title": "" }, { "docid": "fb9b05e051d9e4f291f219d8492e585c", "score": "0.62157345", "text": "async function getSteam (req, res, next) {\n const steamId = req.user.steam;\n const params = { l: 'english', steamid: steamId, key: process.env.STEAM_KEY };\n const getAsync = promisify(request.get);\n \n // get the list of the recently played games, pick the most recent one and get its achievements\n const getPlayerAchievements = () =>\n getAsync({ url: 'http://api.steampowered.com/IPlayerService/GetRecentlyPlayedGames/v0001/', qs: params, json: true })\n .then(({ request, body }) => {\n if (request.statusCode === 401) {\n throw new Error('Invalid Steam API Key');\n }\n if (body.response.total_count > 0) {\n params.appid = body.response.games[0].appid;\n return getAsync({ url: 'http://api.steampowered.com/ISteamUserStats/GetPlayerAchievements/v0001/', qs: params, json: true })\n .then(({ request, body }) => {\n if (request.statusCode === 401) {\n throw new Error('Invalid Steam API Key');\n }\n return body;\n });\n }\n });\n const getPlayerSummaries = () => {\n params.steamids = steamId;\n return getAsync({ url: 'http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/', qs: params, json: true })\n .then(({ request, body }) => {\n if (request.statusCode === 401) {\n throw Error('Missing or Invalid Steam API Key');\n }\n return body;\n });\n };\n const getOwnedGames = () => {\n params.include_appinfo = 1;\n params.include_played_free_games = 1;\n return getAsync({ url: 'http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/', qs: params, json: true })\n .then(({ request, body }) => {\n if (request.statusCode === 401) {\n throw new Error('Missing or Invalid Steam API Key');\n }\n return body;\n });\n };\n try {\n const { playerstats } = await getPlayerAchievements();\n const playerSummaries = await getPlayerSummaries();\n const ownedGames = await getOwnedGames();\n res.render('original/example/steam', {\n title: 'Steam Web API',\n ownedGames: ownedGames.response,\n playerAchievemments: playerstats.success ? playerstats : null,\n playerSummary: playerSummaries.response.players[0]\n });\n } catch (err) {\n next(err);\n }\n}", "title": "" }, { "docid": "15900c1c4ad81d3afa57650f121919e0", "score": "0.62093765", "text": "async getGame() {\n return this.__request(`${this.api_url}/game/start`, \"POST\");\n }", "title": "" }, { "docid": "2762153d5fbaa4ba9f2a4dc1880e5fe0", "score": "0.61890465", "text": "function getGameInfo() {\n limiter.request({\n url: `https://global.api.pvp.net/api/lol/static-data/euw/v1.2/champion?champData=all&${api}`,\n method: 'GET',\n json: true,\n }, (error, response) => {\n if (!error && response.statusCode === 200) {\n champions = response.body.data;\n version = response.body.version;\n console.log(champions);\n }\n if (error) {\n throw new Error('Cannot connect to Riot API');\n }\n });\n}", "title": "" }, { "docid": "07a7b007ff777bc1a15fd09c98e2299d", "score": "0.61703235", "text": "function getLiveGames(){\n\n fetch('https://api.opendota.com/api/live')\n .then(convertToJSON) \n .then(getMatchInfo)\n .then(filterTeams)\n .then(writeMatchInfo)\n\n}", "title": "" }, { "docid": "793e8dcbd9772803002844bd966b9ed5", "score": "0.616957", "text": "searchGames(game, callback){\n\n console.log(\"Searching for: \", game)\n\n fetch('https://api.twitch.tv/kraken/search/games?query=' + game, {\n method: 'GET',\n headers: {\n 'Accept': 'application/vnd.twitchtv.v5+json',\n 'Client-ID': Twitch.clientID\n }\n }).then(response => response.json()).then(json => {\n console.log(json.games);\n callback(json.games)\n })\n }", "title": "" }, { "docid": "eba22228867c8229f5eb9e5d41e7f953", "score": "0.61151683", "text": "function getGames (champion, player) {\n request('https://' + oneTricks[champion][player][\"region\"] + '.api.pvp.net/api/lol/' + oneTricks[champion][player][\"region\"] + '/v2.2/matchlist/by-summoner/' + oneTricks[champion][player][\"id\"] + '?championIds=' + champion + '&seasons=SEASON2016&api_key=' + RIOT_KEY, function (err, res, data) {\n if (data !== undefined && JSON.parse(data).status === undefined) {\n data = JSON.parse(data);\n if (data.matches === undefined || data.matches.length < 10) {\n delete oneTricks[champion][player];\n } else {\n data = data[\"matches\"].slice(0,10);\n console.log(data);\n for (var j=0; j < data.length; j++) {\n oneTricks[champion][player][\"matchDetails\"][j][\"matchId\"] = data[j];\n }\n }\n } else {\n getGames(champion, player);\n }\n });\n}", "title": "" }, { "docid": "5591b27117834ce3e2b49234161c98e7", "score": "0.60765016", "text": "function getGames(query) {\n const params = {\n id: query,\n };\n const queryString = formatQueryParams(params);\n const url = searchUrl + \"?\" + queryString;\n //fetches api from events url\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) => displayEventResults(responseJson))\n .catch((err) => {\n $(\"#js-error-message\").text(`Something went wrong:${err.message}`);\n });\n}", "title": "" }, { "docid": "0dcb5d7b21f077ae8166c0b70bda6617", "score": "0.59533584", "text": "getGamesByTeam(team) {\n TTTPost(\"/games-by-team\", {\n team_id: team.team_id\n })\n .then(res => {\n this.setState({team: team, games: res.data.games});\n });\n }", "title": "" }, { "docid": "89570917721c45cf3740924d67f865c1", "score": "0.5934758", "text": "function getLevelList(gameName) {\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: '../../../../../backend/getLevelList.php',\n\t\tdata: {game_name: gameName},\n\t\tsuccess: function(data){\n\t\t\t//since AJAX is async, its up to the current game to implement loadLevel and handle async on its own\n\t\t\tdisplayLevelList(data);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "d03a3817bfbf77c05683598f34896451", "score": "0.5903512", "text": "function fetchGames(callback){\n var url = 'http://wap.mlb.com/gdcross/components/game/mlb/year_'+year+'/month_'+month+'/day_'+day+'/miniscoreboard.json';\n console.log('fetching url: ' + url);\n http.get(url, function(res){\n var body = '';\n res.on('data', function(chunk) {\n body += chunk;\n });\n res.on('end', function() {\n var mlbResponse = JSON.parse(body)\n callback(mlbResponse.data.games.game);\n });\n });\n}", "title": "" }, { "docid": "8614bdfeac3d20a5d7f8844b90cf9e36", "score": "0.5897309", "text": "getCurrentGames() {\n\n // TODO: AXIOS Requeset to get information about active games for this user\n\n let activeGamesList = [];\n\n let numGames = 0;\n\n // Axios request\n // Iterating on games\n\n if (numGames === 0) {\n // No past games :(\n activeGamesList.push(\n <div className = \"noPast\">You are currently not part of any games</div>\n );\n }\n\n return activeGamesList;\n }", "title": "" }, { "docid": "28c825dcc638df2dfb7ea5bd41e2cde2", "score": "0.5895521", "text": "async function displayAllGames(){\n //getting games from server\n const gamesFromServer = await fetchApi.getGamesList();\n \n //turning the array of games from server in an array of game objects\n const gamesList = gamesFromServer.map(gameServer => new Game(gameServer._id,\n gameServer.title,\n gameServer.imageUrl,\n gameServer.description\n )\n )\n \n //creating an array of DOM objects\n const domGamesArr = gamesList.map(game => game.displayGame());\n //creating the container and appending each game (DOM object) to it\n const container = document.querySelector('.container');\n domGamesArr.forEach((domGame => container.appendChild(domGame)));\n}", "title": "" }, { "docid": "6e6b8b7fd4814c68f694594f7f8f50f7", "score": "0.5891269", "text": "loadMujeresForGame () {\n return http.get(\"auth/data/gameMujeres\", User.getToken());\n }", "title": "" }, { "docid": "d2a6cd31ba2bf64551e8299ea77f1e03", "score": "0.58833456", "text": "function ListUsers(ws) {\n var returnMessage = {}\n returnMessage[\"type\"] = \"user-list\";\n returnMessage[\"data\"] = [];\n \n switch (ws.gamemode) {\n case \"server\":\n wss.clients.forEach(function each(client) {\n var user = {}\n user[\"user-id\"] = client.userId;\n user[\"user-name\"] = client.userName;\n user[\"lobby-id\"] = client.lobbyId;\n user[\"gamemode\"] = client.gamemode;\n returnMessage.data.push(user);\n });\n break;\n case \"player\" || \"spectator\":\n if (ws.lobbyId === -1) {\n SendUserError(ws, \"list-users\", \"not in a lobby\")\n return;\n }\n for (var i=0; i<lobbies[lobbyId][\"users\"].length; i++) {\n var user = {}\n user[\"user-id\"] = lobbies[lobbyId][\"users\"][i].userId;\n user[\"user-name\"] = lobbies[lobbyId][\"users\"][i].userName;\n user[\"lobby-id\"] = lobbies[lobbyId][\"users\"][i].lobbyId;\n user[\"gamemode\"] = lobbies[lobbyId][\"users\"][i].gamemode;\n returnMessage.data.push(user);\n }\n break;\n }\n ws.send(JSON.stringify(returnMessage));\n}", "title": "" }, { "docid": "f8c4811069e32cc506d0a145737e6b50", "score": "0.5876842", "text": "function STEAMSTAT() {\n // Steam (Not currently in use)\n var qryURL = {\n //\"url\": \"https://cors-anywhere.herokuapp.com/steamspy.com/api.php?request=appdetails&appid=620\",\n \"url\" : \"https://cors-any-m.herokuapp.com/api.steampowered.com/ISteamUserStats/GetGlobalStatsForGame/v0001/?format=xml&appid=17740&count=1&name[0]=global.map.emp_isle\",\n \"async\": true,\n \"crossDomain\": true,\n \"method\": \"GET\"\n }\n\n $.ajax(qryURL).done(function (steamInfo) {\n console.log(steamInfo)\n });\n}", "title": "" }, { "docid": "7d1af891e278c9e53bd1f7dd35e21294", "score": "0.5861581", "text": "async getGamesWithApplication ({ request, auth, response }) {\n const user = auth.current.user\n try {\n const applics = await Application.all()\n return response.json({\n status: 'success',\n data: applics\n })\n } catch (error) {\n return response.status(400).json({\n status: 'error',\n message: 'Tivemos um problema. Por favor tente novamente.'\n })\n }\n }", "title": "" }, { "docid": "510b7266ec8957ce9ed6029a4e41c5f2", "score": "0.5860687", "text": "function getAndDisplayBoardGames() {\n $.getJSON(GAMES_URL, function(result) {\n \tlet element = result.boardGames;\n let boardGameElements = $(element).map(function(i) {\n return makeBoardGame(\n element[i].id, \n element[i].name, \n element[i].type, \n element[i].players, \n element[i].plays, \n element[i].averageScore,\n element[i].winsAndLosses\n );\n }).get();\n\t\t$('.game-box').html(boardGameElements); \n\t\t$('.js-bgame').velocity(\"transition.swoopIn\", { duration: 600, stagger: 100 })\n }); \n}", "title": "" }, { "docid": "ef9c65b3f5216b662638cc1c2ace0b57", "score": "0.5854332", "text": "function activeGames(jwt) {\n const activeGamesURL = BASE_URL + '/game/active_games'\n return httpRequestJWT(activeGamesURL, 'get', jwt)\n}", "title": "" }, { "docid": "0bb63f5bb1496ea3399498cd2ead8217", "score": "0.5834768", "text": "function gamesGET (req, res, next) {\n\n\tvar page = 'games';\n\tvar title = 'Games';\n\n\tif (req.session.user)\n\t\tUser\n\t\t.findOne({\n\t\t\temail : req.session.user.email\n\t\t})\n\t\t.exec(function (err, user) {\n\t\t\tif (err)\n\t\t\t\tres.send(err);\n\t\t\telse\n\t\t\t\tGame\n\t\t\t\t.find({ \n\t\t\t\t\tid : {\n\t\t\t\t\t\t$nin : [\"congkak\"]\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.exec(function (err, games) {\n\t\t\t\t\tif (err)\n\t\t\t\t\t\tres.send(err);\n\t\t\t\t\telse\n\t\t\t\t\t\tres.render(page, {\n\t\t\t\t\t\t\tuser : user,\n\t\t\t\t\t\t\ttitle : title,\n\t\t\t\t\t\t\tisGamesPage : true,\n\t\t\t\t\t\t\tgames : games,\n\t\t\t\t\t\t\tpartials : {\n\t\t\t\t\t\t\t\theader : 'header',\n\t\t\t\t\t\t\t\tfooter : 'footer'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t});\n\t\t});\n\telse\n\t\tGame\n\t\t.find({})\n\t\t.exec(function (err, games) {\n\t\t\tif (err)\n\t\t\t\tres.send(err);\n\t\t\telse\n\t\t\t\tres.render(page, {\n\t\t\t\t\ttitle : title,\n\t\t\t\t\tisGamesPage : true,\n\t\t\t\t\tgames : games,\n\t\t\t\t\tpartials : {\n\t\t\t\t\t\theader : 'header',\n\t\t\t\t\t\tfooter : 'footer'\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t});\n}", "title": "" }, { "docid": "12d5e1ce5783f1ba39791736ae0a119b", "score": "0.5834505", "text": "function getMatchList() {\n if (\"caches\" in window) {\n caches.match(ENDPOINT_EPL + \"matches\").then(function (response) {\n if (response) {\n response.json().then(function (data) {\n showMatchList(data);\n })\n }\n })\n }\n\n fetchAPI(ENDPOINT_EPL + \"matches\")\n .then(data => {\n showMatchList(data);\n })\n .catch(error)\n}", "title": "" }, { "docid": "47d4822113fda510e9df7a3149860697", "score": "0.5833585", "text": "async function getGamesFromUser(username)\n{\n // Get the user\n var user = await get(username);\n\n // Return the games\n return gamesdb.idsToGames(user.games);\n}", "title": "" }, { "docid": "97898c0caa621b34afa6a6f6b401a562", "score": "0.58261156", "text": "async function getGames(season) {\n try {\n const response = await fetch(`https://hasses-sega-gubbar.herokuapp.com/games/${season}`, {});\n const data = await response.json();\n setSeasonGames(data)\n } catch {\n console.log(\"Error\");\n }\n }", "title": "" }, { "docid": "feb22e93e79331bf7bd810a4c7cde6f6", "score": "0.58139956", "text": "function getAvailableGames() {\n ticTacToeData\n .getAvailableGames(auth.access_token())\n .then(function (data) {\n $scope.availableGames = data;\n $scope.allMyGames = $scope.allMyGames.concat(data);\n });\n }", "title": "" }, { "docid": "38488de78217a2f81c97e453763f7908", "score": "0.5806788", "text": "async function getAllTeams(){\n return await season_utils.getTeamsBySeasonId(18334);\n}", "title": "" }, { "docid": "5c076096f8113896c91172badb90a4c9", "score": "0.58048105", "text": "function getListOfGames() {\r\n var dropdowns = document.getElementsByClassName(\"dropdown-content\");\r\n multiplayer.server.list().done(function (result) {\r\n if (result) {\r\n var list = document.getElementById(\"listDrpdwn\");\r\n for (var i = 0; i < result.length; i++) {\r\n if (!isContains(list, result[i])) {\r\n var op = document.createElement('option');\r\n op.value = result[i];\r\n op.text = result[i];\r\n list.appendChild(op);\r\n }\r\n }\r\n }\r\n });\r\n}", "title": "" }, { "docid": "4210e5dd2126c35fd6ce7bb823ed9abf", "score": "0.57855904", "text": "function _handleRequestGames(data) {\r\n\tconsole.log('REQUESTED GAMES:', data.toString().trim());\r\n\tstate = SELECT_GAME;\r\n\r\n\tauthServer.write('N\\t' + game + '\\n');\r\n}", "title": "" }, { "docid": "cef5b57e2563666e978ee0369dcc50b4", "score": "0.5781876", "text": "function getAllGamesListed(){\n console.log(\"getting all the games in the database for the select list....\");\n var url = \"/getGames\";\n callAjax(url, handleGamesListed);\n}", "title": "" }, { "docid": "1d0f05f7f7a344ff00d08bb4d8e41c94", "score": "0.57777464", "text": "function displayGame(gameName, game) {\n var gameUrl = 'http://boardgamegeek.com/boardgame/';\n var userUrl = 'http://boardgamegeek.com/user/';\n var gameClass = 'game-' + game.id;\n var liGame;\n \n // If game doesn't exist in list, create it\n if($('.' + gameClass).length)\n {\n liGame = $('.' + gameClass);\n }\n else\n {\n // Creates hyperlink for game\n var gameAnchorString = $('<a>', {href:gameUrl + game.id})\n .append(gameName)\n .prop('outerHTML');\n \n // Creates list item for game\n liGame = $('<li>', {class:gameClass}).append(gameAnchorString);\n }\n \n // Creates <span> of comma-separated hyperlinks for each user\n var userAnchorsString = \n $.map(\n getUnique(game.owners)\n .filter(function(item) {\n return $('.' + gameClass + ' .user-list a').length == 0 || \n $('.' + gameClass + ' .user-list a:not(:contains(\"' + item + '\"))').length > 0;\n }),\n function(item, index) {\n return $('<a>', {href:userUrl + item})\n .append(item)\n .prop('outerHTML')\n }\n )\n .sort()\n .join(', ');\n var spanUserList = $('<span>', {'class':'user-list'}).append(userAnchorsString);\n liGame.append(spanUserList);\n \n $('#olGamesAvailable').append(liGame);\n}", "title": "" }, { "docid": "fcb86891ebdc8066fb0d72c729229d11", "score": "0.5769379", "text": "function sendSearch(){\r\n let xhttp = new XMLHttpRequest();\r\n xhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n gamesArr= JSON.parse(this.responseText); //this should be an array now?\r\n //update the currentTurn so that we start at the end of the games\r\n if(gamesArr.length !== 0){\r\n currentTurn = gamesArr[0].turns.length - 1;\r\n }\r\n displayCurrGame();\r\n console.log(gamesArr);\r\n }\r\n };\r\n console.log(getQuery());\r\n xhttp.open(\"GET\", getQuery(), true); //I need the user object\r\n xhttp.send();\r\n\r\n}", "title": "" }, { "docid": "8247a994d8113675ab8e52117c1e87cb", "score": "0.57683754", "text": "function getMatches (gameArray) {\n\tlet num = 0;\n\tgameArray.forEach(function (id) {\n\t\t$.ajax({\n\t\t\turl: RIOT_ENDPOINT + `/lol/match/v3/matches/${id}?api_key=${apiKey}`,\n\t\t\ttype: 'GET',\n\t\t\tdataType: 'json',\n\t\t\tsuccess: function (e) {\n\t\t\t\tnum++\n\t\t\t\trenderScreen(e, num)\n\t\t\t}\n\t\t})\n\t})\n}", "title": "" }, { "docid": "2c91c775247510b35c0fa8a89a52841d", "score": "0.5767244", "text": "function getJoinedGames() {\n ticTacToeData\n .getJoinedGames(auth.access_token())\n .then(function (data) {\n $scope.joinedGames = data;\n $scope.allMyGames = $scope.allMyGames.concat(data);\n });\n }", "title": "" }, { "docid": "bb1505441ecf472870290e730b0e4838", "score": "0.5763073", "text": "getGameData () {\n let siteIdIndex = window.location.search('games/');\n let gameId = window.location.slice(siteIdIndex + 6);\n fetch(API_URL.games + `/${gameId}`, {\n headers: {\n 'Authorization': `Bearer ${this.props.authToken}`\n }\n })\n .then(res=> res.json())\n .then(data=> {\n this.props.dispatch(loadGameState(data));\n })\n .catch(err=> {\n console.log(JSON.stringify(err));\n //display in status component, don't redirect\n //this.props.dispatch(updateGameStatusError(err))\n })\n }", "title": "" }, { "docid": "02de2927a86fb147091e0f6aac5821e4", "score": "0.5762754", "text": "function getUsersGames(req, res, next) {\n Games.findAll()\n .then((data) => {\n const games = [];\n data.forEach((g) => {\n const game = g.get({ plain: true });\n if (game.user_ids.indexOf(Number(req.params.user_id)) > -1)\n games.push(game);\n });\n res.status(constants.http_ok)\n .json({\n status: 'success',\n content: games,\n message: 'Got all games'\n });\n })\n .catch((err) => {\n res.status(constants.http_bad_request)\n .json({\n status: 'failure',\n content: err.message,\n message: 'Failed to get user\\'s games'\n });\n });\n}", "title": "" }, { "docid": "05cb23289769066d9030ef8039607e1d", "score": "0.575588", "text": "function getShowAllTeams() {\n if ('caches' in window) {\n caches.match(ENDPOINT_SHOW_ALL_TEAMS).then(function (response) {\n if (response) {\n response.json().then((data) => getViewTeamPremierLeague(data));\n }\n });\n }\n\n fetchAPI(ENDPOINT_SHOW_ALL_TEAMS)\n .then(status)\n .then(json)\n .then(data => getViewTeamPremierLeague(data))\n .catch(error);\n}", "title": "" }, { "docid": "013865ce484f07440075c9c69f6b142f", "score": "0.57332647", "text": "getGameStatus() {\n this.setMethod('GET');\n this.setPlayerId();\n return this.getApiResult(`${Config.PLAY_API}/${this.playerId}/status`);\n }", "title": "" }, { "docid": "abe5cab94466895aea9aaa3b2e2eb63d", "score": "0.57321054", "text": "getPastGames() {\n\n // TODO: AXIOS Requeset to get information about old games for this user\n\n let pastGamesList = [];\n\n let numGames = 0;\n\n // Axios request\n // Iterating on games\n\n if (numGames === 0) {\n // No past games :(\n pastGamesList.push(\n <div className = \"noPast\">You have not participated in any games</div>\n );\n }\n\n return pastGamesList;\n }", "title": "" }, { "docid": "2f86044db945a4550ea1bc1650265702", "score": "0.5715093", "text": "function fetchSuggestedGames(game) {\r\n return fetch(\"/api/games\", {\r\n method: \"post\",\r\n body:\r\n \"fields name, summary, cover; where id=(\" +\r\n game.similar_games.join(\", \") +\r\n \");\",\r\n headers: {\r\n \"Content-Type\": \"text/plain\"\r\n }\r\n })\r\n .then(\r\n response => response.json(),\r\n\r\n error => console.log(\"An error occurred.\", error)\r\n )\r\n .then(json => {\r\n return json;\r\n });\r\n}", "title": "" }, { "docid": "15d30545c3fb63c18a8792ef9efd4ccc", "score": "0.5704835", "text": "function fetchGame(gameUrl) {\n switch(gameUrl) {\n case 'stryk':\n return fetch(URL_STRYKTIPSET)\n .then(result => result.json())\n .then(data => parseGameData_(data)) \n\n break;\n case 'europa':\n return fetch(URL_EUROPATIPSET)\n .then(result => result.json())\n .then(data => parseGameData_(data)) \n break;\n case 'topp':\n return fetch(URL_TOPPTIPSET)\n .then(result => result.json())\n .then(data => parseGameData_(data)) \n break;\n default: console.warn('Wrong API call');\n }\n }", "title": "" }, { "docid": "2803d0125e3647a08880d2d30f077745", "score": "0.5699265", "text": "async function getSteam(){\n try {\n //get the Json data from the steam api\n const response = await fetch(api_url);\n const data = await response.json();\n console.log(data);\n // aswell as casting it into html on the page\n document.getElementById(\"imaginedude\").innerHTML = `\n <h1 class=\"sameColor text-center\"> Recent games played</h1>\n ${data.response.games.map(gamelogoTemplate).join('')}`\n\n } catch (error) {\n document.getElementById(\"imaginedude\").innerHTML =`API failed to load please try again later`;\n console.log(\"steam no work\");\n console.log(error);\n }\n \n}", "title": "" }, { "docid": "cc84805abbcae405362808e4a0242945", "score": "0.5696814", "text": "function loadGame() {\n\ttry {\n\t\tvar gameArray = [];\n\t\t\n\n\t\tfor (var i = 0; i < gameList.length; i++) {\n\t\t\tif (gameList[i].Notification == 1) {\n\n\t\t\t\t//Ti.API.info('gameIcons', \"/images/gameIcons/\" + \"C\" + gameList[i].CTestID + \".png\");\n\n\t\t\t\tgameArray.push({\n\t\t\t\t\ttemplate : \"gameListTemplate\",\n\n\t\t\t\t\tgameNameLabel : {\n\t\t\t\t\t\ttext : gameList[i].CTestName\n\t\t\t\t\t},\n\t\t\t\t\ticonImage : {\n\t\t\t\t\t\timage : \"/images/gameIcons/\" + \"C\" + gameList[i].CTestID + \".png\"\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\t$.lstSection.setItems(gameArray);\n\n\t} catch(ex) {\n\t\tcommonFunctions.handleException(\"welcomeContentScreen\", \"loadGame\", ex);\n\t}\n}", "title": "" }, { "docid": "25159e415be7f29dae39911fe20302ab", "score": "0.56882066", "text": "async function getAllGameInfo(game){\n const res = await fetch(\"/api/game/info\",{\n method:\"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n info:{\n game: game,\n admin: adminId\n }\n })\n });\n return res.json();\n}", "title": "" }, { "docid": "77c0b90e0a16bfe9f981d9128da26490", "score": "0.56851804", "text": "function getGameID (callback){\n console.log('enter getGameID');\n \n // steam api url\n var url1 ='https://api.steampowered.com/ISteamApps/GetAppList/v2';\n var tempData = '';\n var tempdata1;\n \n // calls the steam url and processes\n https.get(url1, function(response) {\n \n // while response event is data, add all incoming data to tempData variable\n response.on(\"data\", function (data) {\n tempData += data;\n });\n \n // on end event parse json and add data to appData variable\n response.on(\"end\", function() {\n tempdata1 = JSON.parse(tempData);\n appData = tempdata1.applist.apps;\n console.log('exit getGameID');\n //console.log(appData.length);\n callback();\n //msg.reply('App ID : ' + info.appid + '\\nGame Name : ' +info.name);\n });\n });\n\n}", "title": "" }, { "docid": "03dcd2e7cfb8fe00397b82b0124f77dc", "score": "0.5680731", "text": "function getGames(f) {\n request({url: \"/lobby-games\", method: \"GET\"})\n .then(data => {\n console.log(\"success, updating games\");\n f(data);\n })\n .catch(error => {\n console.log(\"error: \" + error);\n });\n}", "title": "" }, { "docid": "a3ce02b6287bf28e1577bd15e20aeab9", "score": "0.56801754", "text": "function getPlayerList(){\n var db = getPlayersDatabase();\n var result = new Array()\n\n try {\n db.transaction(function(tx) {\n var rs = tx.executeSql('SELECT * FROM players_storage');\n for(var i = 0; i < rs.rows.length; i++) {\n var dbItem = rs.rows.item(i);\n result[i] = {\n 'name': dbItem.name,\n 'wins': dbItem.wins,\n 'loses': dbItem.loses\n }\n }\n })\n } catch(e) {\n return []\n }\n return result;\n}", "title": "" }, { "docid": "2f5f2090f1b6cd09576f50d2ca9a9518", "score": "0.5676075", "text": "async function requestGameState() {\n await fetch(`/api/game/state/${roomId}`).then(res => res.json());\n}", "title": "" }, { "docid": "6bcedfb43aa328efd3ed4b7026c3e9d5", "score": "0.5671723", "text": "function getRecentGames(summoner, callback)\n{\n // Summary info\n irelia.getRecentGamesBySummonerId(summoner.region, summoner.id, function (err, summonerRecentGames) {\n if(err) {\n // Play catch\n callback({status: 'error', data: err});\n console.log(err);\n } else {\n // Play catch\n //console.log(summonerRecentGames.games);\n callback({status: 'success', data: summonerRecentGames});\n }\n });\n}", "title": "" }, { "docid": "4e3a265bc2e6fe9896b6f31f5fd79902", "score": "0.5667258", "text": "function getStates(game) {\n\n}", "title": "" }, { "docid": "416d26d165cc4dd47ae5b61ac8839848", "score": "0.5665826", "text": "getGameInfos() {\n return game_infos;\n }", "title": "" }, { "docid": "4c0afca19c06e559ddf15cb80d0f6115", "score": "0.56647044", "text": "function getGame(gameName) {\r\n return fetch('api/games', {\r\n method: \"post\",\r\n body: 'fields name, similar_games; where name ~\"' + gameName+ '\";',\r\n headers: {\r\n \"Content-Type\": \"text/plain\"\r\n }\r\n })\r\n .then(\r\n response => response.json(),\r\n\r\n error => console.log(\"An error occurred.\", error)\r\n )\r\n .then(json => {\r\n return json[0];\r\n });\r\n}", "title": "" }, { "docid": "393b581bce59b16c958dd25fe37b90d5", "score": "0.5662635", "text": "function get_games_current() {\n var dataObj = {\n \"content\" : [ {\n \"session_id\" : get_cookie()\n } ]\n };\n call_server('games_current', dataObj);\n}", "title": "" }, { "docid": "b36ccbe6f2f2ab7a7cfc724b20fabaf3", "score": "0.5657", "text": "function loadGames(){\n\tvar request = loadViaAjax(\"AllGames.json\");\n\trequest.done(function(data) {\n\t\tGames = data;\n\t\tcreateGameCategories();\n\t\tcreateGameCategoryAll();\n\t});\n\treturn request;\n}", "title": "" }, { "docid": "f0f3f080e08c441e9dd6e6606bcaaf80", "score": "0.56551373", "text": "function getLeagueList() {\n return League.find({}, \"name\").exec();\n}", "title": "" }, { "docid": "721ca0a581c3664a212d031ee3d9a51a", "score": "0.56337976", "text": "async function getStat() {\n const responseFromServer = await fetch('/game-data');\n game_data = await responseFromServer.json();\n \n displayPrompt();\n}", "title": "" }, { "docid": "b8f1b04474b89771623aee22e3548b5b", "score": "0.56310344", "text": "function getTeams() {\n\tvar teams = [];\n\tajax.controllers.Application.getTeams().ajax({\n\t\tasync: false,\n\t success: function(data) {\n\t \tteams = data;\n\t },\n\t\terror: function(data) {\n\t\t\talert(\"Erro ao obter os times\");\n\t\t}\n\t});\n\t\n\treturn teams;\n}", "title": "" }, { "docid": "6f56ec583256cc32809e60113888aaa4", "score": "0.562757", "text": "function getProviderPlaylists() {\n let playlistsRequest = new Request(`http://${PROXY_SERVER}/playlists/`);\n let headers = playlistsRequest.headers;\n headers.append('X-Audiowings-DeviceId', MAC_ADDRESS);\n return fetch(playlistsRequest)\n .then(status)\n .then(response => response.json())\n .catch(error => console.log(':( Request failed', error));\n}", "title": "" }, { "docid": "fbdd5cba66e198ebf5c7fea2c3c67633", "score": "0.5625745", "text": "getBotsList() {\n let bot_status = {};\n bot_status.count = utils.objectLength(this.bots);\n let bots_list = [];\n for (const idx in this.bots) {\n let url = new URL(this.bots[idx].page.url());\n let room_url = url.origin + url.pathname;\n bots_list.push({\n uuid: this.bots[idx].uuid,\n name: this.bots[idx].name,\n room_url: room_url,\n avatar_id: this.bots[idx].avatar_id,\n });\n }\n bot_status.bots = bots_list;\n return utils.buildJsonResponse({\n command: \"bots list\",\n success: true,\n message: \"Ok\",\n data: bots_list,\n });\n }", "title": "" }, { "docid": "3c6775debc9373329353b9deef6cd4e3", "score": "0.56244206", "text": "function getAwaitedGames() {\n let xmlContent = \"\";\n fetch(\"https://gamezone.ninja/Resources/games.xml\").then((response) => {\n response.text().then((xml) => {\n xmlContent = xml;\n let parser = new DOMParser();\n let xmlDOM = parser.parseFromString(xmlContent, \"application/xml\");\n let games = xmlDOM.querySelectorAll(\"game\");\n var xmlContent2 = \"\";\n\n xmlContent2 = assembleContent(\"awaited\", xmlContent2, games);\n document.getElementById(\"games-game-list\").innerHTML = xmlContent2;\n });\n });\n}", "title": "" }, { "docid": "6879161fade928b7706969b393354165", "score": "0.5611254", "text": "async getPlaylists() {\n const accessToken = this.accessToken || this.getAccessToken();\n const headers = { Authorization: `Bearer ${accessToken}` };\n const userID = await this.getUserID();\n //GET method\n try {\n const response = await fetch(\n 'https://api.spotify.com/v1/me/playlists?limit=50',\n { headers: headers }\n );\n if (response.ok) {\n const jsonResponse = await response.json();\n if (jsonResponse && jsonResponse !== {}) {\n return jsonResponse.items\n .filter(playlist => playlist.owner.id === userID)\n .map(playlist => {\n return {\n id: playlist.id,\n name: playlist.name,\n tracksURL: playlist.tracks.href,\n image: playlist.images[1],\n uri: playlist.uri,\n };\n });\n }\n } else {\n throw new Error('Request to GET Playlists Failed!');\n }\n } catch (err) {\n this.authFailed();\n console.log(err);\n }\n }", "title": "" }, { "docid": "6162655fb716a2bb71e1e3b2a25c536c", "score": "0.5599031", "text": "function getStreams(gameIDs, token, cursor = \"\") {\n return rp.get(\"https://api.twitch.tv/helix/streams\", {\n headers: {\n \"Client-ID\": config[\"twitch-client-id\"],\n \"Authorization\": \"Bearer \" + token,\n },\n qs: {\n \"game_id\": gameIDs,\n \"first\": 99,\n \"type\": 'live',\n \"after\": cursor\n },\n json: true,\n });\n}", "title": "" }, { "docid": "0bcff9ab21855613aecf8d9cf3786783", "score": "0.5593518", "text": "function getGameSessions() {\n $.ajax({\n url: SERVER_HOST + \"api/gamesession/list\",\n type: \"GET\",\n success: function (gameSessions) {\n $(GAME_SESSIONS_ID).empty();\n\n let tableHeaders = '<tr><th>Название сессии</th><th>Количество игроков</th><th></th><th></th></tr>';\n $(GAME_SESSIONS_ID).append(tableHeaders);\n\n for (let i = 0; i < gameSessions.length; i++) {\n appendGameSession(gameSessions[i]);\n }\n }\n });\n}", "title": "" }, { "docid": "b1d7ef542b99f2af79dbce01771b37fd", "score": "0.55812955", "text": "function getTopRatedGames() {\n let xmlContent = \"\";\n fetch(\"https://gamezone.ninja/Resources/games.xml\").then((response) => {\n response.text().then((xml) => {\n xmlContent = xml;\n let parser = new DOMParser();\n let xmlDOM = parser.parseFromString(xmlContent, \"application/xml\");\n let games = xmlDOM.querySelectorAll(\"game\");\n var xmlContent2 = \"\";\n\n xmlContent2 = assembleContent(\"top\", xmlContent2, games);\n document.getElementById(\"games-game-list\").innerHTML = xmlContent2;\n });\n });\n}", "title": "" }, { "docid": "0b5df43e985a1e4bcc41d6a48e465dff", "score": "0.5566806", "text": "async function getGame(req, res) {\n const game = await Game.findByIdAndUser(req.params.id, req.user);\n\n res.json(game.outputForUser(req.user._id));\n}", "title": "" }, { "docid": "2510c7e8dd4a54c81324e1f05550e6c3", "score": "0.5564799", "text": "function getGame(name) {\n let xmlContent = \"\";\n fetch(\"https://gamezone.ninja/Resources/games.xml\").then((response) => {\n response.text().then((xml) => {\n xmlContent = xml;\n let parser = new DOMParser();\n let xmlDOM = parser.parseFromString(xmlContent, \"application/xml\");\n let games = xmlDOM.querySelectorAll(\"game\");\n var xmlContent2 = \"\";\n\n games.forEach((gameXmlNode) => {\n if (gameXmlNode.children[0].innerHTML.includes(name)) {\n xmlContent2 +=\n \"<div class='category'>\" +\n \" Category: \" +\n gameXmlNode.children[8].innerHTML +\n \"</div>\" +\n \"<img class='gamePic' src=\" +\n gameXmlNode.children[2].innerHTML +\n \" alt=''>\" +\n \"<div class='publisher'>\" +\n \"Publisher: \" +\n gameXmlNode.children[6].innerHTML +\n \"</div>\" +\n \"<div class='release'>\" +\n \"Release Date: \" +\n gameXmlNode.children[4].innerHTML +\n \"</div>\" +\n \"<div class='rating'>\" +\n \"Rating: \" +\n gameXmlNode.children[7].innerHTML +\n \"</div>\" +\n \"<div class='description'>\" +\n \"<h3>Description</h3> <br/>\" +\n gameXmlNode.children[1].innerHTML +\n \"</div>\" +\n \"<iframe width='1200' height='700' src='\" +\n gameXmlNode.children[3].innerHTML +\n \"' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe>\" +\n \"<div class='review'>\" +\n \"<h3>Review</h3> <br/>\" +\n gameXmlNode.children[5].innerHTML +\n \"</div>\";\n }\n });\n document.getElementById(\"games-game-list\").innerHTML = xmlContent2;\n });\n });\n}", "title": "" }, { "docid": "205bd4326a36cabcb3acb5da405ba743", "score": "0.5551379", "text": "function getSports() {\n hideButtonsAndText();\n let url = INDEX_URL + \"sport=list\";\n fetch(url, {mode: 'cors'})\n .then(checkStatus)\n .then(showSports)\n .catch(printError);\n }", "title": "" }, { "docid": "0f226f04871e47a9a1664986fccb2763", "score": "0.5551213", "text": "function renderGames() {\n var rows = document.getElementsByClassName(\"Tst-table Table\")[0].rows;\n var playerInfo;\n\n //go through rows of table\n for (var i = 1; i < rows.length; i++) {\n //grab all text from the <td> that includes the team/player name\n playerInfo = rows[i].cells[1].innerText.split(\" \");\n teamsString += getTeamFromInfo(playerInfo) + \",\";\n }\n //console.log(teamsString)\n var dateString = getFormattedDate();\n var leagueIDString = \"leagueID=\" + getLeagueID();\n //console.log(\"dateString = \" + dateString);\n var url =\n \"https://www.sportswzrd.com/gamesremaining/?pageName=transactionTrends&\" +\n teamsString +\n \"&format=json&date=\" +\n dateString +\n \"&\" +\n leagueIDString;\n //console.log(\"before request\");\n chrome.runtime.sendMessage(\n {\n endpoint: \"gamesremaining\",\n date: dateString,\n leagueID: getLeagueID(),\n teams: teamsString,\n pageName: \"yTransactionTrends\"\n },\n function(response) {\n addGames(response.data);\n }\n );\n}", "title": "" }, { "docid": "326baa0c05d4d7e1cb1eaa3413ffdab0", "score": "0.5539648", "text": "async function getAllGroups() {\n try {\n // This return the id [g:1:${id}]\n const { response } = await doAjax({\n type: \"GET\",\n url: \"https://api.steampowered.com/ISteamUser/GetUserGroupList/v1/\",\n data: {\n key: SteamApiKey,\n steamid: steamId,\n },\n dataType: \"json\",\n });\n\n return response.groups.map(function (groups) {\n return groups.gid;\n });\n } catch (error) {\n return Promise.reject(error);\n }\n }", "title": "" }, { "docid": "9e4e0a33a7ba181be839a1feedd5b17d", "score": "0.5522911", "text": "getFeaturedPlayers(){\n return client({\n method: 'GET',\n path: PLAYER_SEARCH_ROOT+\"getAllByOrderByEloDesc\",\n params: {\n page: 0,\n size: 3\n }\n })\n }", "title": "" }, { "docid": "e60ef9b686d39d9588ce7c03aef76b26", "score": "0.55207723", "text": "function generateGamesList(game) {\n $('.js-gameUl').html('');\n $.each(game, function(index, value) { \n let gameElement = generateGameElement(value);\n $('.js-gameUl').append(gameElement);\n });\n}", "title": "" }, { "docid": "954f53a8e95f4f20ff029c7d58c28be6", "score": "0.551993", "text": "async getMatchListing() {\n console.log(\"Entering getMatchListing()\");\n // Defining rest-api endpoint for querying state data\n let stateRequest = 'http://rest-api:8008/state?address=' + addressDeleted;\n let stateResponse = await fetch(stateRequest);\n let stateJSON = await stateResponse.json();\n return stateJSON;\n }", "title": "" }, { "docid": "13bd0f85dcd57f4718abad33f359ed9d", "score": "0.5513846", "text": "function getMatches() {\n if (\"caches\" in window) {\n caches.match(`${BASE_URL}competitions/2015/teams`).then((res) => {\n if (res) {\n res.json().then((data) => {\n renderCardList(data);\n });\n }\n });\n }\n\n fetch(`${BASE_URL}competitions/2015/teams`, header)\n .then(status)\n .then(json)\n .then((data) => {\n renderCardList(data);\n })\n .catch(error);\n}", "title": "" }, { "docid": "4ad0b21865087f0d280e0954e55bfaff", "score": "0.55127376", "text": "getPlayers(){\n let players = fetch(API_URL + '/api/players',\n {method: 'GET'}).then((response) => response.json())\n return players;\n }", "title": "" }, { "docid": "2333eeeed2cfb95886d8b7495cc8d548", "score": "0.5506753", "text": "function getPreviousGames() {\n\t$.getJSON(\"/games\").done(function(response){\n\t\tconsole.log(response.games);\n\t\tshowGames(response.games);\n\t});\n}", "title": "" }, { "docid": "84c61fd96e48eee0e45dfcb82cb91919", "score": "0.5501252", "text": "function getData() {\nvar url1 = 'http://localhost:8080/api/game_view/' + myParam\n fetch(url1)\n .then(response => response.json())\n .then(response => {\n let slvGames = response\n console.log(response)\n main(slvGames)\n })\n .catch(err => console.log(err));\n}", "title": "" }, { "docid": "2b130870f33f068b54fd18918daad368", "score": "0.54991794", "text": "function printGames(game) {\n let queryUrl = `https://rawg.io/api/games?search=${game}&platforms=23`;\n $.ajax({\n url: queryUrl,\n method: 'GET'\n }).then(function (response) {\n console.log(response);\n let p = $('#results');\n p.empty();\n $('#info').empty();\n let array = response.results;\n for (let i = 0; i < array.length; i++) {\n let span = $('<span>');\n let name = $('<div>').text(array[i].name).attr('class','name');\n let image = $('<img>').attr({\n 'class': 'image thumbnail',\n 'src': array[i].background_image,\n 'alt': array[i].name\n });\n span.append(name, image);\n p.append(span);\n }\n listOfResults = response.results;\n })\n $('.boxdescription').css('height', '350px');\n\n }", "title": "" }, { "docid": "142be8aa7e3c5bf08109ce406f2b1f29", "score": "0.5495462", "text": "function loadTeams() {\n doAjax(TEAM_URL + '/get').then(data => {\n data.forEach(team => {\n console.log('Team ->', team.name);\n });\n });\n}", "title": "" }, { "docid": "21ef7dc53c3b20993ffabcae7f6e12a3", "score": "0.54927665", "text": "function get_game_overview(game_id) {\n view_game_id = game_id;\n var dataObj = {\n \"content\" : [ {\n \"session_id\" : get_cookie()\n }, {\n \"game_id\" : game_id\n } ]\n };\n call_server('game_overview', dataObj);\n}", "title": "" } ]
a1dc34970fec7ab79a35de215a33066d
This function will redirect you to a page where you can edit this person's profile page.
[ { "docid": "d3f9d0150e96509c6b74a72095074dc2", "score": "0.0", "text": "function handleEdit(e) {\n e.preventDefault();\n setEdited(true);\n \n }", "title": "" } ]
[ { "docid": "611e91bb3036b274e8968d9efe39942c", "score": "0.80398744", "text": "function goEditProfile() {\n var dirPath = dirname(location.href);\n var fullPath = dirPath + \"/editprofile.html\";\n window.location = fullPath;\n}", "title": "" }, { "docid": "b437445df49582a8c23cfc41c76277ca", "score": "0.78915787", "text": "editProfie() {\n window.location.replace('http://localhost:3000/EditProfile');\n }", "title": "" }, { "docid": "885ec5432b5ddaf069cdeb05e30cb9ac", "score": "0.71922606", "text": "function goToProfile(){\n\tvar text = Parse.User.current().id;\n\twindow.location.href = \"../profile.html?\" + text;\n}", "title": "" }, { "docid": "30793aca92e5361ccea66325cd812088", "score": "0.714225", "text": "function handelEdit (){\n let uid = this.id ?? \"\";\n window.location.href=`${USER_ADD_FORM_URL}?uid=${uid}`;\n}", "title": "" }, { "docid": "31e80f3476318fa7ffbbaf105254f570", "score": "0.709794", "text": "function toCorppassProfileLandingPage() {\n\twindow.location = corppassProfileLandingPage;\n}", "title": "" }, { "docid": "aab622a35255405fddba9b15aabec9f1", "score": "0.6970729", "text": "function redirect() {\n // this.html(\"Redirecting to my profile...\");\n window.location = \"/profile/\";\n}", "title": "" }, { "docid": "ec8ef0c240ad785477835e75ecf2bbc1", "score": "0.6859175", "text": "function _editBtn() {\n $state.go(\"profileEditor\");\n }", "title": "" }, { "docid": "de90bc3c2b8930d32a7d4aa9a77459d3", "score": "0.6756414", "text": "function editUser() {\n $location.path('/user/' + vm.user.id);\n }", "title": "" }, { "docid": "c7dc2fb491cf5657b51002f97dcaaedb", "score": "0.674889", "text": "function redirect() {\n $location.path('/profile');\n }", "title": "" }, { "docid": "2c5d7208c44d0a6df8aa50dc14f2e093", "score": "0.66651034", "text": "function redirectToWidgetEdit() {\n res.redirect(\"/assignment/#/user/\" + userId + \"/website/\" + websiteId + \"/page/\" + pageId + \"/widget/\" + widgetId);\n }", "title": "" }, { "docid": "a6ba59be037a2fc5c58be1c6013e782f", "score": "0.6597479", "text": "function editProfile(response, user, navbar) {\r\n\r\n\tvar profile = builder.editProfile(user);\r\n\r\n\tvar head = builder.head(\"Profile\");\r\n\tvar body = builder.body(navbar, profile);\r\n\tvar page = builder.page(head, body);\r\n\r\n\tmisc.buildResponse(response, page);\r\n\r\n}", "title": "" }, { "docid": "9959396ffaac9185a5995363bce8d9c5", "score": "0.65849245", "text": "Goedit() {\n this.presentToast('goedit');\n let navigationExtras = {\n state: {\n dataUser: this.dataUser\n }\n };\n this.router.navigate(['asso-edit-profile'], navigationExtras);\n }", "title": "" }, { "docid": "ca40d58032067fe2b73ab07fc5100f43", "score": "0.6433912", "text": "function profileClick(accountID) {\n $(\"#profile-new\").click(function (event) {\n window.location.href = \"/gwa/pages/profile.html?accountID=\" + accountID;\n })\n }", "title": "" }, { "docid": "c40027d2d206248f8ecdc3da072d9920", "score": "0.6412225", "text": "function show (err, req, res) {\n req.model.load('profile', req)\n req.model.load('whoshiring')\n req.model.end(function (er, m) {\n var profile = m.profile\n var statusCode = 200\n if (er || !profile || !profile.name) {\n req.session.set('done', req.url)\n return res.redirect('/login')\n }\n if (er || profile.error) {\n return res.error(er || profile.error)\n }\n var locals = {\n profile: profile,\n hiring: m.whoshiring,\n fields: profile.fields,\n title: 'Edit profile',\n error: err\n }\n\n if (err) {\n statusCode = 400\n }\n\n res.template(\"profile-edit.ejs\", locals, statusCode)\n })\n}", "title": "" }, { "docid": "7835a315b88c17a8dbf9952d6f1e926d", "score": "0.6389545", "text": "editProfile() {\n this.$router.push({ name: \"profile-edit\" });\n }", "title": "" }, { "docid": "ce60b3af1cc9252b5c8ce371ff8ac54d", "score": "0.638096", "text": "function profileClick(accountID) {\n $(\"#profile-new\").click(function (event) {\n window.location.href = \"/gwa/pages/profile.html?accountID=\" + accountID;\n })\n }", "title": "" }, { "docid": "00c26036e2b171d7cc89311ff2841c0b", "score": "0.63564277", "text": "function edition(req, res) {\n var id = req.session.user._id\n\n db.collection('users').updateOne({\n _id: new mongo.ObjectID(id)\n }, {\n $set: {\n firstname: req.body.firstname,\n lastname: req.body.lastname,\n place: req.body.place,\n bio: req.body.bio\n }\n }, done)\n\n function done(err, data) {\n if (err) {\n res.status(404).render('error.ejs', {\n id: 404,\n title: 'Not found',\n detail: 'Oops, er gaat wat mis...'\n })\n } else {\n res.redirect('/profile/' + id)\n }\n }\n}", "title": "" }, { "docid": "afdca51eda6a1f0f97deb47c31a57f1f", "score": "0.63535625", "text": "function changeProfile(req, res) {\n // finds the current user of the app, and sends data\n User.findById(req.session.users, function(err, users) {\n if (err) {\n console.log(err);\n } else {\n res.render(\"changeprofile.ejs\", {\n pageTitle: \"Change profile\",\n users: users\n });\n }\n });\n}", "title": "" }, { "docid": "b877581d7673e2927d0fed77a8f00fb7", "score": "0.6332271", "text": "function view_profile(child_id)\n{\n window.location.href='profiles-page/' + child_id;\n}", "title": "" }, { "docid": "154fc6fd58f5e5b00228a4868a3fb2ab", "score": "0.62579685", "text": "function goToSettings() {\n const url = 'user_settings.html';\n location.href = url;\n}", "title": "" }, { "docid": "eade30a48d0f222e573fcef6a5a863fd", "score": "0.6257514", "text": "function goMyProfile() {\n if (localStorage[config.app.storage_key+\"_session\"] == null) {\n visitHomePage();\n } else {\n var Session = JSON.parse(localStorage[config.app.storage_key+\"_session\"]);\n if (Session == null) {\n visitHomePage();\n } else {\n if (Session[\"login_status\"] == \"Active\") {\n var dirPath = dirname(location.href);\n var fullPath = dirPath + \"/profile.html\";\n window.location = fullPath;\n } else {\n visitHomePage();\n }\n }\n }\n}", "title": "" }, { "docid": "3b9f875a38f8b323c78ee96b937986aa", "score": "0.6230687", "text": "function profileEdit (req, res) {\n // show a form if it's a GET, or accept body if it's a POST.\n switch (req.method) {\n case 'POST':\n case 'PUT':\n req.maxLen = 1024 * 1024\n return req.on('form', function (data) {\n saveThenShow(data, req, res)\n })\n\n case 'HEAD':\n case 'GET':\n return show(null, req, res)\n\n default:\n return res.error(405)\n }\n}", "title": "" }, { "docid": "29d5d95860e1b78e839ce4faadc5118a", "score": "0.62222755", "text": "goToCurrentUploadersProfile() {\n const href = this.getCurrentUploadersProfileURL();\n if (href)\n location.href = href;\n }", "title": "" }, { "docid": "7da216af5791f6474ef9b4189dc2ad68", "score": "0.6189225", "text": "editUserInfo() {\n this.props.history.push('/edit-user');\n }", "title": "" }, { "docid": "76f1a6054deb9c029068130d3d2ebdee", "score": "0.61850387", "text": "function goTothisPage() {\r\n window.location.replace(\"budgetEditBudgetPage.html\");\r\n}", "title": "" }, { "docid": "aab48bfa7d84c1ac83610db95efce57d", "score": "0.61760134", "text": "function reloadProfile() {\n var url = window.location.href;\n window.location.href = url;\n}", "title": "" }, { "docid": "553c0efdede90f99359a5613747929e3", "score": "0.61736935", "text": "function editUser() {\n\n\tvar obj = getContext ();\n\t\n\t/* show form */\n\tvar form = new Form(\"cocoon:/page/model/userData?mode=edit\");\n\tform.createBinding(\"cocoon:/page/binding/userData?mode=edit\");\n form.load(obj);\n form.showForm(\"page/form/userData?mode=edit\");\n}", "title": "" }, { "docid": "b341ed5987c5e52839b574fa741b90c3", "score": "0.61735696", "text": "function signUp(){\n window.location.href = \"userAddUpdate.html\";\n}", "title": "" }, { "docid": "756ef892ebf5f01887836329c3ea3048", "score": "0.61483204", "text": "function dash_board() {\n\twindow.location.href = \"../dashboard/profile.html\";\n}", "title": "" }, { "docid": "9ccd7b3e5d1b33fd5cd3a5e74042efaf", "score": "0.6147402", "text": "function goToProfile(objectId) {\n $state.go(\"profile\", {id: objectId});\n }", "title": "" }, { "docid": "1d41eb325a5fe4490d95beac457c9433", "score": "0.6131068", "text": "function dash_board() {\n window.location.href = \"../dashboard/profile.html\";\n}", "title": "" }, { "docid": "eb62b85610a6f4ea71b6b66a34686816", "score": "0.61146146", "text": "function editProfile() {\n $http.post(\"/api/account/editprofile\", service.editUser)\n .then(function (response) {\n editProfileForm.hide();\n $state.reload();\n growl.info(\"You have successfully edited your profile.\");\n }, function (error) {\n var modelState = error.data.ModelState;\n angular.forEach(modelState, function (errorMessages, attribute) {\n\n if (attribute != \"$id\") {\n angular.forEach(errorMessages, function (value, key) {\n growl.error(value, { ttl: 10000 }); //display errors sent from back end and display them on notifier\n });\n }\n });\n });\n }", "title": "" }, { "docid": "c36fe4015ab46bde3a150779e890c9a1", "score": "0.61086947", "text": "function edit_sch()\n{\n window.location = document.getElementById('cfg').className + '/local/placement/user/viewprincipal.php?view=editschool';\n}", "title": "" }, { "docid": "daf93a26b7cf66f0e4c4279c15340a74", "score": "0.60651267", "text": "function editPrivileges(noteID){\n window.location.href = \"/listPrivileges/\" + noteID;\n}", "title": "" }, { "docid": "bd8e6a9dbcfbe61d27bec51a330b35bc", "score": "0.6030009", "text": "async handle(req, res, next) {\n\n if (!req.user)\n return next();\n\n return res.redirect(helpers.route(\"profile\", {\n \":section\": \"library\"\n }));\n\n }", "title": "" }, { "docid": "baed0d204560b518245df8b3bedfec8a", "score": "0.6025168", "text": "function handleCharacterEdit() {\n var currentCharacter = $(this)\n .parent()\n .parent()\n .data(\"superHero\");\n window.location.href = \"/addCharacter?character_id=\" + currentCharacter.id;\n }", "title": "" }, { "docid": "07e7941616eaddecc9df94916897ba40", "score": "0.6018132", "text": "function editPasar(id){\n window.location.href = id;\n}", "title": "" }, { "docid": "4ab86dcb98dad54e858b65278480b447", "score": "0.60122204", "text": "function gotoaboutme(){\n\twindow.location = \"about-me.html\"\n}", "title": "" }, { "docid": "794a939b75083f6081e99011e2bbee2a", "score": "0.5992392", "text": "function editProfileInfo(e){\n e.preventDefault();\n //get the stuff to send to createProfile.addProfile\n console.log(\"updating profile\");\n\n var email = $('#newEmail').val();\n var phone = $('#newPhone').val();\n\n var userJson = {\n 'email': email,\n 'phone': phone\n };\n $.post('/editProfile/updateProfileInfo', userJson, function() {\n window.location.href = '/home'; // go to the homepage\n });\n}", "title": "" }, { "docid": "c03330216d99d51655cc9daa81d87403", "score": "0.5984946", "text": "function setupEditUserDetailFormErrorCase(id) { \n window.location.replace(\"/users/edit?id=\"+id+\"&msgDisplay=Error: Cannot get current data of user id \"+id+\"&msgType=fail\");\n}", "title": "" }, { "docid": "f9bfe02d1e79bc2984773f7ad2de74b4", "score": "0.59615713", "text": "goToSuccessPage() {\n window.location.href = '/myaccount/profile?password-reset=success';\n }", "title": "" }, { "docid": "6e1ca392e76374cab461100b92645b6b", "score": "0.5961495", "text": "function anotherQuiz() {\n window.location.href = \"/chooseQuizToEdit\";\n}", "title": "" }, { "docid": "a0ae7e33411bf993a4fbeb96ff4b6d18", "score": "0.5960604", "text": "function handleProfileSubmit(e) {\n e.preventDefault();\n\n editPopup.toggleButtonText();\n\n const {name, bio: about} = editPopup.getInputValues();\n api.updateUser({name, about})\n .then(() => {\n profileView.setUserInfo({name, about});\n editPopup.close();\n })\n .finally(editPopup.toggleButtonText)\n .catch(handleApiError);\n}", "title": "" }, { "docid": "eb22ae934ed6f4b0d680ee6efd7253bb", "score": "0.59441125", "text": "function displayUserDetails(id) {\n localStorage.setItem(\"idUs\", id);\n location.replace(\"display-user.html\");\n}", "title": "" }, { "docid": "bd1613cf0da4b7b4e5c241d3a0f4d97f", "score": "0.59427375", "text": "function toProfile() {\n activePage.hide();\n $(\"#bio-page\").show().removeClass(\"deactivated\").addClass(\"activated\"); //To Be Rplaced\n activePage = $(\"#bio-page\");\n console.log(\"reasigned\", activePage);\n }", "title": "" }, { "docid": "8221b753c5a275cd8b7e49c005365991", "score": "0.5939191", "text": "function profilePage(index){\n $scope.goToPlayerUsername = $scope.playsWith[index];\n $location.path('/profile/' + $scope.goToPlayerUsername);\n }", "title": "" }, { "docid": "5b035d8200a5c068e6c1aa4cec1d638b", "score": "0.59377223", "text": "function goToProfile() {\n\n var win = window.open('../profile', '_self');\n\n if (win) {\n //Browser has allowed it to be opened\n win.focus();\n } else {\n //Browser has blocked it\n console.log('Please allow popups for this website');\n }\n\n}", "title": "" }, { "docid": "5c13af9163102b0acf1bb3394804aca3", "score": "0.59375775", "text": "function update() {\n var newUser = {\n username: $scope.profileUsername,\n password: $scope.profilePassword,\n firstName: $scope.profileFirstName,\n lastName: $scope.profileLastName,\n email: $scope.profileEmail\n };\n\n UserService.updateUser(currentUser._id, newUser, function(found) {\n if (found) {\n $location.url(\"profile\");\n console.log(found);\n }\n });\n\n }", "title": "" }, { "docid": "1e5e2cfae6882d4c805eeace0b43fcbd", "score": "0.59343904", "text": "function onProfileClick(e) {\n\t\tvar item = e.section.getItemAt(e.itemIndex);\n\t\tif (e.bindId === \"profile_pic\" || e.bindId === \"profile_name\") {\n\t\t\tgo_to_friend_profile(SysEnum.WINDOWS_AND_STATES.PROFILE_BY_ID, item.properties.user_id);\n\t\t\tcloseWindow();\n\t\t}\n\t}", "title": "" }, { "docid": "77dbfc6f6486735fbc0bbc6ef9bd8ecf", "score": "0.5933079", "text": "showProfile() {\n router.push({\n name: \"user-profile\",\n });\n }", "title": "" }, { "docid": "5b45c9b12997e894760d35972aeab3ef", "score": "0.5928727", "text": "function post_edit(request, response) {\r\n\r\n\t// The session token.\r\n\tvar sessionToken = request.cookies[cookieName];\r\n\r\n\t// If there is a user signed in.\r\n\tif (sessions.validSession(sessionToken)) {\r\n\r\n\t\t// Extend the user\r\n\t\tsessions.extend(sessionToken, response);\r\n\r\n\t\tvar user = sessions.getDetails(sessionToken);\r\n\r\n\t\t// Iterate over the user's details\r\n\r\n\t\t// Change the profile picture\r\n\t\tvar newPicture = changePicure(request, user);\r\n\r\n\t\t// Updated the password if there is a new password\r\n\t\t// specified\r\n\t\tvar password = user.password;\r\n\t\tif (request.body.password !== \"\") {\r\n\t\t\tpassword = MD5.hash(request.body.password + user.salt);\r\n\t\t}\r\n\r\n\t\t// The updated user details\r\n\t\tvar newRow = {\r\n\t\t\t\"email\" : user.email,\r\n\t\t\t\"name\" : (user.name !== request.body.name) ? request.body.name : user.name,\r\n\t\t\t\"organiser\" : request.body.organiser ? 'true' : 'false',\r\n\t\t\t\"picture\" : (newPicture !== user.picture) ? newPicture : user.picture,\r\n\t\t\t\"password\" : password,\r\n\t\t\t\"salt\" : user.salt,\r\n\t\t\t\"dob\" : user.dob,\r\n\t\t\t\"telephone\" : (user.telephone !== request.body.telephone) ? request.body.telephone : user.telephone\r\n\t\t};\r\n\r\n\t\t// Update the user details in the database\r\n\t\tdb.run(\r\n\t\t\t\"UPDATE Users SET name = ?, organiser = ?, picture = ?, password = ?, telephone = ? WHERE email = ?;\", \r\n\t\t\t[newRow.name, newRow.organiser, newRow.picture, newRow.password, newRow.telephone, newRow.email ]\r\n\t\t);\r\n\t\t\r\n\t\t// Update the user's deatils that are stored in the session.\r\n\t\tsessions.updateUser(sessionToken, newRow)\r\n\r\n\t\tconsole.log(\"Profile Update [\" + user.email + \"]\");\r\n\r\n\t\tresponse.redirect('/profile?email=' + user.email);\r\n\r\n\t} else {\r\n\t\t// If the session was invalid\r\n\t\tresponse.redirect('/');\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "2145c2dc32e4ec20e2a09fb2add66188", "score": "0.59246194", "text": "function notificationProfile(profileid){\r\n\tlocalStorage.setItem(\"userprofileid\", profileid);\r\n\twindow.location = \"User_Profile.html\";\r\n}", "title": "" }, { "docid": "784e7b6365cdd72c017c6260da5b9e3f", "score": "0.5916971", "text": "function redirectionFromSignUP(){\n \n username = document.getElementById('user_name').value;\n password = document.getElementById('password').value;\n data= 'profile.html';\n x();\n}", "title": "" }, { "docid": "1dee6ec76545c2f4d9401cd2df7d55a9", "score": "0.59148693", "text": "renderPage() {\n const { from } = this.props.location.state || { from: { pathname: /profile/ } };\n // if correct authentication, redirect to from: page instead of signup screen\n if (this.state.redirectToReferer) {\n return <Redirect to={from}/>;\n }\n return (\n <Grid container centered>\n <Grid.Column>\n <Divider hidden/>\n <Header as=\"h2\" textAlign=\"center\">Edit Profile</Header>\n <AutoForm schema={ProfileSchema} onSubmit={data => this.submit(data)} model={this.props.doc}>\n <Segment inverted className='profileForm' very padded>\n <Header as='h3' textAlign='center'>Profile Information</Header>\n <Grid className='doubleLine'>\n <TextField name='name'/>\n <SelectField name='gender'/>\n </Grid>\n <TextField name='image' label='Image (URL)'/>\n <LongTextField className='descBox' name='description'/>\n <Header as='h3' textAlign='center'>Matching Information</Header>\n <MultiSelectField name='interests'/>\n <Grid className='doubleLine'>\n <SelectField className='dropDownFix' name='seeking'/>\n <SelectField className='dropDownFix' name='level'/>\n <NumField name='age'/>\n </Grid>\n <TextField name='goals'/>\n <SubmitField className='editProfileButton' value='Submit Changes'/>\n <ErrorsField/>\n <HiddenField name='owner'/>\n </Segment>\n </AutoForm>\n </Grid.Column>\n </Grid>\n );\n }", "title": "" }, { "docid": "0aa2e0309f7bb2e973cbd8623d977cca", "score": "0.59141827", "text": "editJob(id) {\n window.location = \"/EditJob/\" + id;\n }", "title": "" }, { "docid": "32a5a6a69f7f54427e4dcdb4cd244380", "score": "0.5903399", "text": "function redirectIfLoggedIn(nextState, replace) {\n\t\tif (Store.getState().user.loggedIn) {\n\t\t\treplace('/profile');\n\t\t}\n\t}", "title": "" }, { "docid": "a571b6a66277cef7ea3a0c7eb12e06a0", "score": "0.58814776", "text": "function newAccount() {\n window.location.href = 'createAccount.html';\n}", "title": "" }, { "docid": "11ec93c082e4a2f74498a99aa815407f", "score": "0.58717185", "text": "function onlineprofileclick(val) {\r\n\tlocalStorage.setItem(\"userprofileid\", val);\r\n\twindow.location = \"User_Profile.html\";\r\n}", "title": "" }, { "docid": "87afc8d22499c48ba03a1a942c27b308", "score": "0.58678454", "text": "function pEdit(req, res){\n let name = req.user.name\n User.findOne({name: name})\n .then(person=>{\n let port = person.portfolio.id(req.params.id)\n res.render('users/edit', {\n port,\n user: req.user,\n title: 'Portfolios'\n })\n })\n}", "title": "" }, { "docid": "8c3af040e1acec83006b2bf06f1b8998", "score": "0.5867791", "text": "function goToElon() {\n var usp = new URLSearchParams();\n usp.set(\"user\", \"user1\");\n var url = location.pathname;\n url = `${url}?${usp.toString()}`;\n location.href = url;\n}", "title": "" }, { "docid": "1b830c03697264bc042252bc3b6a9d73", "score": "0.5854384", "text": "function goToURL(param, url){\r\n\tvar user = url.substring(url.indexOf('=')+1);\r\n\tif (param=='view'){\r\n\t window.location ='http://localhost:3000/get?username='+user;\r\n\t}\r\n\tif (param=='post'){\r\n\t window.location ='http://localhost:3000/createDonation?username='+user;\r\n\t}\r\n\r\n\tif (param=='edit'){\r\n window.location ='http://localhost:3000/editProfile?username='+user;\r\n }\r\n}", "title": "" }, { "docid": "d1ce6fdd4bfa03754fc9b74bd1ea2c86", "score": "0.58525735", "text": "function gotomakeaccount(e){\n history.push(\"/register\");\n }", "title": "" }, { "docid": "300e6be6265a30536d5b80c030edf5c3", "score": "0.5849804", "text": "function addNewUserDetail() {\n $(location).attr(\"href\", \"/login/new/add\");\n}", "title": "" }, { "docid": "7d5d7dca4dcecc8a1161a03640cdd958", "score": "0.584968", "text": "function personBtnUp(evt){\n\t\tif(g.loginStatus){\n\t\t\tlocation.href = \"../personal-center/index.html\";\n\t\t}\n\t\telse{\n\t\t\tlocation.href = \"../login/login.html\";\n\t\t}\n\t}", "title": "" }, { "docid": "ead6a436bab17ab002148f34c76ba808", "score": "0.5842591", "text": "get editProfileLink() {\n return this.clone(Profiles, \"EditProfileLink\").get();\n }", "title": "" }, { "docid": "397cef7c818333e6aaf9792c3ccac1f9", "score": "0.5841215", "text": "function act_pres(idPresidente){\t\n\twindow.location.assign('/admin/presidente/'+idPresidente); //es el que existe en el servidor\n}", "title": "" }, { "docid": "a1c1739b5e3440f361fdb881f4ced865", "score": "0.58254176", "text": "function requestEditProfile(username) {\n\tvar queryString = $(\"#profile-\" + username).serialize();\n\t$.ajax(\n\t{\n\t\ttype: \"post\",\n\t\turl: \"/profiles/:\" + username,\n\t\tdata: queryString\n\t})\n\t.done(function(data)\n\t{\n\t\talert(\"Profile updated!\");\n\t\tlocation.reload();\n\t})\n\t.fail(function( jqXHR, textStatus )\n {\n alert( \"Failed to edit: \" + textStatus );\n });\n}", "title": "" }, { "docid": "665d68fa339da3b0a90061b1613b331a", "score": "0.5823749", "text": "function myFunc(arg) {\r\n\r\n\r\n res.redirect('/profile/profile');\r\n }", "title": "" }, { "docid": "ac1f6b55f170940a7059f5e9dff498ef", "score": "0.5802028", "text": "function goToEditPage(button) {\n // get the relevant item's id from the button.\n let id = button.id; // id is in this format: edit-item-IT123 where IT123 is the itemId.\n let itemId = id.includes('edit-item-') ? id.replace('edit-item-', '') : '';\n\n // navigate to edit page.\n // we embed the item id in the edit page's URL so that the script/function running on that page,\n // can identify which item needs to be edited.\n // url: <host>:<port>/suppliers/items/edit-supply-item.html#<item id>.\n // having something starting with a hash in the end of the url won't do any harm to url navigation.\n window.location.href = currentLocation.includes('view-supply-items') ? currentLocation.replace('view-supply-items', 'edit-supply-item') + '#' + itemId : currentLocation; // redirection.\n}", "title": "" }, { "docid": "7b42234a49271acdeaa2a70f8a3943d6", "score": "0.57973224", "text": "function signUp(){\n window.location.href = 'http://localhost/fitness.html' + '#signUp';\n \n}", "title": "" }, { "docid": "b3bb9225136657b8784409d26a66f5cf", "score": "0.57902807", "text": "editAppDeveloper() {\n I.scrollTo(this.editUserLocators.bio);\n I.fillField(this.editUserLocators.bio, 'I am Application Developer');\n I.click(this.editUserLocators.save);\n }", "title": "" }, { "docid": "e9c75651d0a4233415798af7da7dd924", "score": "0.5789823", "text": "function viewProfile(response, user, canEdit, navbar) {\r\n\r\n\tvar profile = builder.viewProfile(user, canEdit);\r\n\r\n\tvar head = builder.head(\"Profile\");\r\n\tvar body = builder.body(navbar, profile);\r\n\tvar page = builder.page(head, body);\r\n\r\n\tmisc.buildResponse(response, page);\r\n\r\n}", "title": "" }, { "docid": "da13532d9e57590f0e9bf2486e73084d", "score": "0.5788009", "text": "function newAccount() {\n window.location.href = \"../CreateAccountPage/createAccount.html\";\n}", "title": "" }, { "docid": "128cc670512e12502466ff93544d611a", "score": "0.57752013", "text": "function goToAboutUs(){\n window.location.href = \"../aboutus.html\";\n}", "title": "" }, { "docid": "c38fcef31737420e8474ce87bc166f8e", "score": "0.5766108", "text": "function profile(currentUser) {\n $http.get(`/users/${currentUser._id}`)\n .then(function(response){\n console.log('Profile route: ', response)\n $state.go('profile', {userId: currentUser._id});\n })\n }", "title": "" }, { "docid": "0f66292ae62890c3cc71b19a62183674", "score": "0.5763795", "text": "function editProfileModal() {\n service.editUser = service.user;\n editProfileForm.$promise.then(editProfileForm.show);\n }", "title": "" }, { "docid": "4c3449a4da9b6060aaa4731d4bbdbea0", "score": "0.5751036", "text": "function userRedirection(userType) {\n console.log(\"userRedirection Fired!\");\n console.log(userType);\n switch (userType) {\n case \"student\":\n console.log(userType);\n window.location.replace(`${sessionCurrentURLPrefix}/Client/student.html`); //Change url here as shown in your port number.\n break;\n case \"worker\":\n console.log(userType);\n window.location.replace(`${sessionCurrentURLPrefix}/Client/worker.html`); //Change url here as shown in your port number.\n break;\n default:\n console.log(userType);\n console.log(\"No such email in system.\");\n alert(\"No such user! Try Again...\");\n document.getElementById(\"email\").value = \"\";\n break;\n }\n ;\n}", "title": "" }, { "docid": "ebafefde0806e5adc8a342402ed8c349", "score": "0.5741862", "text": "function forwardUser(){\n window.location.href = \"../login/login.html\";\n}", "title": "" }, { "docid": "4c22d617c91208a0d19fff80260539c3", "score": "0.5739567", "text": "function get_edit(request, response) {\r\n\r\n\t// If the email has been specifed.\r\n\tif (request.query.email) {\r\n\r\n\t\tvar email = request.query.email;\r\n\r\n\t\tdb.each(\r\n\t\t\t\"SELECT * FROM Users WHERE email = ?\", \r\n\t\t\t[ email ], \r\n\t\t\tfunction(user) {\r\n\r\n\t\t\t\t// Check for the session cookie and wherther it is\r\n\t\t\t\t// active.\r\n\t\t\t\tvar sessionToken = request.cookies[cookieName];\r\n\t\r\n\t\t\t\tif (sessions.validSession(sessionToken)) {\r\n\t\t\t\t\tsessions.extend(sessionToken, response);\r\n\t\r\n\t\t\t\t\tvar sessionUser = sessions.getDetails(sessionToken);\r\n\t\r\n\t\t\t\t\tif (sessionUser.email === email) {\r\n\t\r\n\t\t\t\t\t\tvar home = builder.navbarLink(\"/\", \"Home\");\r\n\t\t\t\t\t\tvar logout = builder.navbarLink(\"/logout\", \"Logout\");\r\n\t\t\t\t\t\tvar newEvent = builder.navbarLink(\"/organise\", \"Orgainse Event\");\r\n\t\t\t\t\t\tvar search = builder.navbarLink(\"/search\", \"Search Events\");\r\n\t\t\t\t\t\tvar myEvents = builder.navbarLink(\"/events\", \"My Events\");\r\n\t\r\n\t\t\t\t\t\tvar navbar = builder.navbar((user.organiser === 'true') ? [ home, newEvent, myEvents, search,\r\n\t\t\t\t\t\t\t\tlogout ] : [ home, search, logout ]);\r\n\t\r\n\t\t\t\t\t\t// If the current user owns the profile\r\n\t\t\t\t\t\t// allow them to edit it.\r\n\t\t\t\t\t\teditProfile(response, user, navbar);\r\n\t\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tresponse.redirect('/profile?email=' + email);\r\n\t\t\t\t\t}\r\n\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresponse.redirect('/profile?email=' + email);\r\n\t\t\t\t}\r\n\r\n\t\t\t}, \r\n\t\t\tfunction(count) {\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * If there is no user with that email redirect to the landing page.\r\n\t\t\t\t */\r\n\t\t\t\tif (count == 0) {\r\n\t\t\t\t\tresponse.redirect('/');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\r\n\t} else {\r\n\t\t// No valid session redirect the user to the home screen.\r\n\t\tresponse.redirect('/');\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "b1da06eb258bcda8c6bc9449a9c20b1a", "score": "0.5731587", "text": "function onEditClick() {\n\tvar site = location.origin\n\tvar path = site + \"/srv/events/edit/\" + $(this).attr(\"eid\");\n\tlocation.assign(path);\n}", "title": "" }, { "docid": "98999d09d6ad71778d88313a480c7e52", "score": "0.57167834", "text": "function handleActivityEdit() {\n var currentActivity = $(this)\n .parent()\n .parent()\n .data(\"activity\");\n window.location.href = \"/cms?activity_id=\" + currentActivity.id;\n }", "title": "" }, { "docid": "1f445d54847a9f1f2549b57d45937c7e", "score": "0.57149094", "text": "onUpdateClick (e) {\n this.props.history.push('/profile-update');\n }", "title": "" }, { "docid": "c460ea87d2a3de08e9311e5f4a20cdef", "score": "0.57099456", "text": "_onViewProfile() {\n this.authenticate(this._secret, () => {\n this.authenticatorDialogs.setProfile(this._user);\n this.authenticatorDialogs.get('profile').open();\n });\n }", "title": "" }, { "docid": "f9c5867868bf3eb174ee25a652cc2d47", "score": "0.5705813", "text": "render() {\n let redirect = \"\";\n if (this.state.tempId === \"\") {\n redirect = <Redirect to=\"/signup\" />;\n }\n return (\n <div className=\"container\">\n {redirect}\n <h1 className=\"headerGreen\">Edit Profile</h1>\n <hr />\n <Form\n model=\"editprofie\"\n onSubmit={(values) => this.handlePatchedInfo(values)}\n >\n {\" \"}\n <Row className=\"form-group\">\n <Col xs={12} md={{ size: 6, offset: 3 }}>\n <Label>Name</Label>\n <Control.text\n className=\"form-control\"\n model=\".ID\"\n id=\"ID\"\n name=\"ID\"\n placeholder=\"New Username\"\n />\n </Col>\n </Row>\n <Row className=\"form-group\">\n <Col xs={12} md={{ size: 6, offset: 3 }}>\n <Label>Email</Label>\n <Control.text\n className=\"form-control\"\n model=\".email\"\n id=\"email\"\n name=\"email\"\n placeholder=\"New Email\"\n />\n </Col>\n </Row>\n \n <Row className=\"form-group\">\n <Col xs={12} md={{ size: 6, offset: 3 }}>\n <Label>Age</Label>\n <Control.text\n className=\"form-control\"\n model=\".age\"\n id=\"age\"\n name=\"age\"\n placeholder=\"New Age\"\n />\n </Col>\n </Row>\n\n <Row className=\"form-group\">\n <Col>\n <Button className=\"EditProfileCancelButton\">\n <Link className=\"EditProfileLinkInsideCancelButton\" to=\"/account/overview\">\n cancel\n </Link>\n </Button>\n </Col>\n <Col>\n <Button type=\"submit\" className=\"EditProfileSaveButton\">\n Save Changes\n </Button>\n </Col>\n </Row>\n </Form>\n </div>\n );\n }", "title": "" }, { "docid": "7b4d4b10551126b18d0752bc8767a509", "score": "0.5702829", "text": "function goToProfile(userId, goodreadsId) {\n\t\tconsole.log('doing gotorpofile');\n\t\t$scope.grDone = true;\t\t\n\t\t$timeout(function(){\n\t\t\t$location.path( \"/profile\" )\n\t\t //$location.path('#/profile').replace();\n\t //$scope.$apply();\n\t\t});\t\n\t}", "title": "" }, { "docid": "ffc683ba6f3028bada9ab5ee5c208d3b", "score": "0.56992257", "text": "function handleEntryEdit() {\n var currentEntry = $(this)\n .parent()\n .parent()\n .data(\"entry\");\n window.location.href = \"/entry/:entry_id=\" + currentEntry.entryId;\n }", "title": "" }, { "docid": "0df74ac988c11c911c3aa46cc2d1dd4e", "score": "0.5698632", "text": "function register(){\n window.location.href = window.location + '#signUp';\n \n}", "title": "" }, { "docid": "6fb236437aeeb77a6073b27c05f7501d", "score": "0.5690241", "text": "function gotopage(pageID) {\n\n\t// REDIRECT USER TO PAGE\n\tswitch(pageID) {\n\t\tcase \"dashpage\":\n\t\t\twindow.location.replace(\"dashpage.html\");\n\t\t\tbreak;\n\t\tcase \"favpage\":\n\t\t\twindow.location.replace(\"favpage.html\");\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "6fe6cb9d0fd1dfc088ff294827cd7ca9", "score": "0.56854236", "text": "function backUser(){\n location.href = \"UserPage.html\";\n}", "title": "" }, { "docid": "055b9455cb754c26f850182b58c30c92", "score": "0.568242", "text": "function redirectToPetDetail() {\n res.redirect(\"/project/#/shelter/\" + shelterId + \"/pet/\" + petId);\n }", "title": "" }, { "docid": "5c129c9be8f42a529e91786ff25c4368", "score": "0.5682128", "text": "function redirectUser(nextLink) {\n\tconsole.log(\"redirecting user...\");\n\twindow.location.replace(nextLink);\n}", "title": "" }, { "docid": "a6bee2f32d80cf754cde5de48df9bd2a", "score": "0.5681647", "text": "function newpages() {\n window.location.href = \"applicant-details.html\";\n}", "title": "" }, { "docid": "c6304e44b115d4214d523b2c7136b384", "score": "0.5681463", "text": "function editUser($userId) {\n $state.go('admin.users.edit', {userId : $userId});\n\n }", "title": "" }, { "docid": "ea336a744a1cd02d70ccdd0b517be50a", "score": "0.56699353", "text": "function updateAuthor(id){\r\n window.location = \"/authors?type=Update&_id=\"+id;\r\n}", "title": "" }, { "docid": "1c3d43ee6aedcfc3eb0efbd90cb68ccc", "score": "0.5666268", "text": "function Redirect() {\n window.location.replace(\"/post/\" + postId);\n }", "title": "" }, { "docid": "dda1afcfb34868b79af2e56dea447ae6", "score": "0.56467694", "text": "function courseInfoChange(){\n alert(\"The course information has been successfully editted.\");\n window.location = 'http://cs3319.gaul.csd.uwo.ca/vm071/a3joseph/indexpage.php';\n}", "title": "" }, { "docid": "ceda38e4564ed4f21347d74ea3647fb7", "score": "0.56463355", "text": "function redirectPage(){\n setCookie(\"tutorial\", \"true\");\n window.location.href = \"https://foodwheelapp.herokuapp.com/profile\";\n}", "title": "" }, { "docid": "9ca51bf95cda364ee12dd5a484ff3e5e", "score": "0.56461364", "text": "function add_teacher()\n{\n window.location = document.getElementById('cfg').className + '/local/placement/user/viewprincipal.php?view=add';\n}", "title": "" }, { "docid": "d8e1eb1e58494311767daba89be8aaab", "score": "0.5633231", "text": "function gotocontact(){\n\twindow.location = \"contact.html\"\n}", "title": "" }, { "docid": "c3492a7ccf1c8bd57fe263b29b6b6170", "score": "0.562621", "text": "function clickProfile(k) {\r\n\tvar id = useridlist[k].value1;\r\n\tlocalStorage.setItem(\"userprofileid\", id);\r\n\tlocalStorage.setItem(\"wantbudyrequest\", \"no\");\r\n\twindow.location = \"User_Profile.html\";\r\n}", "title": "" }, { "docid": "6e84f71b78117a0cbe462e35f936c5e7", "score": "0.56239426", "text": "async function EditProfile(e) {\n e.preventDefault();\n await updateRow(user.data.id, { nama: name, email: email }).then(\n handleClose\n );\n window.location.reload();\n }", "title": "" } ]
6b1dce8cde8b24e069020263745fbf26
Is stdout a TTY? Colored output is enabled when `true`.
[ { "docid": "637a3c942a626401fe3c5bc99f726b4e", "score": "0.69316745", "text": "function useColors() {\n var debugColors = (process.env.DEBUG_COLORS || '').trim().toLowerCase();\n if (0 === debugColors.length) {\n return tty.isatty(fd);\n } else {\n return '0' !== debugColors\n && 'no' !== debugColors\n && 'false' !== debugColors\n && 'disabled' !== debugColors;\n }\n}", "title": "" } ]
[ { "docid": "0e40e3456ca6a316c8fcd7d0d38c545f", "score": "0.7625948", "text": "function stdoutOK() {\n\treturn process.stdout._type === 'tty' || typeof config !== 'object' || config?.console?.output;\n} // stdoutOK()", "title": "" }, { "docid": "4985d83c67c8e9785aefbe56b8f83dfa", "score": "0.74181", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "4985d83c67c8e9785aefbe56b8f83dfa", "score": "0.74181", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "4985d83c67c8e9785aefbe56b8f83dfa", "score": "0.74181", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "4985d83c67c8e9785aefbe56b8f83dfa", "score": "0.74181", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "4985d83c67c8e9785aefbe56b8f83dfa", "score": "0.74181", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "4985d83c67c8e9785aefbe56b8f83dfa", "score": "0.74181", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "36ca6fc5fe19f6fe0bc41d3933785cb3", "score": "0.74055946", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n }", "title": "" }, { "docid": "bb8656a1fb840d97013f4b19c08560b8", "score": "0.73937875", "text": "function useColors() {\n return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "bb8656a1fb840d97013f4b19c08560b8", "score": "0.73937875", "text": "function useColors() {\n return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "bb8656a1fb840d97013f4b19c08560b8", "score": "0.73937875", "text": "function useColors() {\n return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "251c9b075376a234bd53d0a9e502e09d", "score": "0.73526853", "text": "function useColors() {\n return \"colors\" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);\n }", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "e6855d323c837f92fb1235aa2dcd2b3b", "score": "0.73336977", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}", "title": "" }, { "docid": "0cd8e71020ff2a4869c1c2833ccf0a52", "score": "0.72921425", "text": "function useColors() {\n \treturn 'colors' in exports.inspectOpts ?\n \t\tBoolean(exports.inspectOpts.colors) :\n \t\ttty.isatty(process.stderr.fd);\n }", "title": "" }, { "docid": "0cd8e71020ff2a4869c1c2833ccf0a52", "score": "0.72921425", "text": "function useColors() {\n \treturn 'colors' in exports.inspectOpts ?\n \t\tBoolean(exports.inspectOpts.colors) :\n \t\ttty.isatty(process.stderr.fd);\n }", "title": "" }, { "docid": "e62df80a0f8ee9c372f040e841b2a506", "score": "0.72740763", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty__default['default'].isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "067b9ebdb7323b9af040b5359c9df867", "score": "0.7270053", "text": "function useColors() {\n return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(fd);\n}", "title": "" }, { "docid": "067b9ebdb7323b9af040b5359c9df867", "score": "0.7270053", "text": "function useColors() {\n return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(fd);\n}", "title": "" }, { "docid": "34c0e7bdef5116e1348ca555dd79e1c7", "score": "0.7268683", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty$1.isatty(fd);\n}", "title": "" }, { "docid": "34c0e7bdef5116e1348ca555dd79e1c7", "score": "0.7268683", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty$1.isatty(fd);\n}", "title": "" }, { "docid": "34c0e7bdef5116e1348ca555dd79e1c7", "score": "0.7268683", "text": "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty$1.isatty(fd);\n}", "title": "" }, { "docid": "badda53e7f20069c4395cf77cbf3d699", "score": "0.72624487", "text": "function useColors() {\n return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(fd);\n }", "title": "" }, { "docid": "badda53e7f20069c4395cf77cbf3d699", "score": "0.72624487", "text": "function useColors() {\n return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(fd);\n }", "title": "" }, { "docid": "d193868ecdf3226b1ed1edf51f54b2e8", "score": "0.72593033", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "d193868ecdf3226b1ed1edf51f54b2e8", "score": "0.72593033", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "d193868ecdf3226b1ed1edf51f54b2e8", "score": "0.72593033", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "d193868ecdf3226b1ed1edf51f54b2e8", "score": "0.72593033", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "d193868ecdf3226b1ed1edf51f54b2e8", "score": "0.72593033", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "d193868ecdf3226b1ed1edf51f54b2e8", "score": "0.72593033", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "d193868ecdf3226b1ed1edf51f54b2e8", "score": "0.72593033", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "d193868ecdf3226b1ed1edf51f54b2e8", "score": "0.72593033", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "d193868ecdf3226b1ed1edf51f54b2e8", "score": "0.72593033", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "d193868ecdf3226b1ed1edf51f54b2e8", "score": "0.72593033", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "d193868ecdf3226b1ed1edf51f54b2e8", "score": "0.72593033", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "d193868ecdf3226b1ed1edf51f54b2e8", "score": "0.72593033", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "d193868ecdf3226b1ed1edf51f54b2e8", "score": "0.72593033", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "d193868ecdf3226b1ed1edf51f54b2e8", "score": "0.72593033", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "d193868ecdf3226b1ed1edf51f54b2e8", "score": "0.72593033", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "d193868ecdf3226b1ed1edf51f54b2e8", "score": "0.72593033", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "d193868ecdf3226b1ed1edf51f54b2e8", "score": "0.72593033", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "d193868ecdf3226b1ed1edf51f54b2e8", "score": "0.72593033", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "d193868ecdf3226b1ed1edf51f54b2e8", "score": "0.72593033", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "d193868ecdf3226b1ed1edf51f54b2e8", "score": "0.72593033", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "d193868ecdf3226b1ed1edf51f54b2e8", "score": "0.72593033", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "d193868ecdf3226b1ed1edf51f54b2e8", "score": "0.72593033", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "d193868ecdf3226b1ed1edf51f54b2e8", "score": "0.72593033", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "63a25bbc6a9e6487a2eaa59b4dc73bda", "score": "0.72201", "text": "function useColors() {\n return \"colors\" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : $3uB8d$tty.isatty(fd);\n}", "title": "" }, { "docid": "63a25bbc6a9e6487a2eaa59b4dc73bda", "score": "0.72201", "text": "function useColors() {\n return \"colors\" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : $3uB8d$tty.isatty(fd);\n}", "title": "" }, { "docid": "0358a41697735acfc4eb0523fdaff0df", "score": "0.7214083", "text": "function useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty__default[\"default\"].isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "ee3678c2fad5aa8b826d66a11192d2ac", "score": "0.71970433", "text": "function useColors() {\n\t\treturn 'colors' in exports.inspectOpts\n\t\t\t? Boolean(exports.inspectOpts.colors)\n\t\t\t: tty.isatty(process.stderr.fd);\n\t}", "title": "" }, { "docid": "ef9c6a387560f6a779b29a9e55c367e5", "score": "0.6978733", "text": "function useColors() {\n\t var debugColors = (process.env.DEBUG_COLORS || '').trim().toLowerCase();\n\t if (0 === debugColors.length) {\n\t return tty.isatty(fd);\n\t } else {\n\t return '0' !== debugColors\n\t && 'no' !== debugColors\n\t && 'false' !== debugColors\n\t && 'disabled' !== debugColors;\n\t }\n\t}", "title": "" }, { "docid": "ef9c6a387560f6a779b29a9e55c367e5", "score": "0.6978733", "text": "function useColors() {\n\t var debugColors = (process.env.DEBUG_COLORS || '').trim().toLowerCase();\n\t if (0 === debugColors.length) {\n\t return tty.isatty(fd);\n\t } else {\n\t return '0' !== debugColors\n\t && 'no' !== debugColors\n\t && 'false' !== debugColors\n\t && 'disabled' !== debugColors;\n\t }\n\t}", "title": "" }, { "docid": "682b9d4ba29e12a953cbb19c524531ed", "score": "0.69431925", "text": "function useColors() {\n var debugColors = (process.env.DEBUG_COLORS || '').trim().toLowerCase();\n if (0 === debugColors.length) {\n return tty.isatty(fd);\n } else {\n return '0' !== debugColors && 'no' !== debugColors && 'false' !== debugColors && 'disabled' !== debugColors;\n }\n}", "title": "" }, { "docid": "f08dbd09f607fa2caaf63d958e5d9635", "score": "0.6916647", "text": "function useColors() {\n var debugColors = (process.env.DEBUG_COLORS || '').trim().toLowerCase();\n if (0 === debugColors.length) {\n return tty.isatty(fd);\n } else {\n return '0' !== debugColors\n && 'no' !== debugColors\n && 'false' !== debugColors\n && 'disabled' !== debugColors;\n }\n }", "title": "" }, { "docid": "73504e42cf62b1b73a6e00c4029d257a", "score": "0.68504375", "text": "function $a221420965ec853c$var$useColors() {\n return \"colors\" in module.exports.inspectOpts ? Boolean(module.exports.inspectOpts.colors) : $3uB8d$tty.isatty(process.stderr.fd);\n}", "title": "" }, { "docid": "b682c57a39071f3c3a0b2a61d9316e37", "score": "0.6833869", "text": "function useColors() {\n var debugColors = (process.env.DEBUG_COLORS || '').trim().toLowerCase();\n if (0 === debugColors.length) {\n return tty.isatty(1);\n } else {\n return '0' !== debugColors\n && 'no' !== debugColors\n && 'false' !== debugColors\n && 'disabled' !== debugColors;\n }\n}", "title": "" }, { "docid": "e93a8000bd9de1505ae43dd1d3483d3e", "score": "0.6822965", "text": "function should_not_output() {\n\t// Err on the side of caution\n\tif (typeof config === 'undefined') return false;\n\tif (typeof config.console === 'undefined') return false;\n\tif (typeof config.console.output === 'undefined') return false;\n\n\t// If we're in a TTY, output to stdout\n\t// If we're not, only output if config.console.output is true\n\tlet active_tty = Boolean(process.stdout.isTTY) && Boolean(process.stdin.isTTY);\n\tswitch (active_tty) {\n\t\tcase true : return false;\n\t\tcase false : return !config.console.output;\n\t}\n}", "title": "" }, { "docid": "35a9053c594824028dfa14b14b57997d", "score": "0.6616449", "text": "function useColors() {\n\t var debugColors = (({\"NODE_ENV\":\"production\"}).DEBUG_COLORS || '').trim().toLowerCase();\n\t if (0 === debugColors.length) {\n\t return tty.isatty(fd);\n\t } else {\n\t return '0' !== debugColors\n\t && 'no' !== debugColors\n\t && 'false' !== debugColors\n\t && 'disabled' !== debugColors;\n\t }\n\t}", "title": "" }, { "docid": "cbc2e5a62b6a3d09896624e8dfe811f2", "score": "0.6390999", "text": "function isConsoleActive()\r\n\t{\r\n\t\tif (typeof console == 'undefined')\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn ('log' in console);\r\n\t}", "title": "" }, { "docid": "c6d215dbdcde92d4a97e38b6ff60a3a6", "score": "0.591949", "text": "function setIsTTY (isTTY) {\n Object.defineProperty(this, 'isTTY', {\n value: isTTY,\n enumerable: true,\n writable: true,\n configurable: true\n })\n}", "title": "" }, { "docid": "c6d215dbdcde92d4a97e38b6ff60a3a6", "score": "0.591949", "text": "function setIsTTY (isTTY) {\n Object.defineProperty(this, 'isTTY', {\n value: isTTY,\n enumerable: true,\n writable: true,\n configurable: true\n })\n}", "title": "" } ]
a40766ae734abb32e6155521f076e305
Close modal window and bg
[ { "docid": "af8546168a97cb0a51a50d3ec523674b", "score": "0.6966335", "text": "function closeModal(){\r\n\t\t$modal.fadeOut(200, function(){\r\n\t\t\t$(\".jqx-validator-error-label\").html(\"\");\r\n\t\t\t$(\"#joinUserId, #joinpassword, #passwordChk, #joinemail, #VerificationCode\").val(\"\");\r\n\t\t});\r\n\t\t$modal_bg.fadeOut(200, function(){\r\n\t\t\t$(\".jqx-validator-error-label\").html(\"\");\r\n\t\t\t$(\"#joinUserId, #joinpassword, #passwordChk, #joinemail, #VerificationCode\").val(\"\");\r\n\t\t});\r\n\t\t$('a[href^=\"#modal-\"].active').focus().removeClass('active');\r\n\t\t$(\"#user_id, #password\").val(\"\");\r\n\t}", "title": "" } ]
[ { "docid": "a99f87148fb915298b5ac756c0833f4c", "score": "0.7837651", "text": "function closeModal() {\n modalbg.style.display = \"none\";\n}", "title": "" }, { "docid": "66e83cf7ef711a18672ca45668a10231", "score": "0.7817357", "text": "function close_modal(){\n $('#modal_background').toggle();\n $('#modal_dialog').toggle()\n}", "title": "" }, { "docid": "443f75492776ddd99d96be835cd74584", "score": "0.7745006", "text": "function closeModal() {\n windows.close($('#modalContainer .window').attr('id'));\n }", "title": "" }, { "docid": "f3ec1f55b9683992759cddb111069281", "score": "0.7708287", "text": "function closeModal() {\n bodyId.removeAttribute(\"style\");\n modalId.removeAttribute(\"style\");\n memoryGameBoard();\n }", "title": "" }, { "docid": "cbcaf7cfc1ef1633ff7a674ac1b0a721", "score": "0.7701133", "text": "function closeModal2() {\n modBackground.style.display = \"none\";\n}", "title": "" }, { "docid": "8b8e8da85a0877a757ace9aa0c4fc739", "score": "0.7683922", "text": "function closePopup(){\n $('.overlay-bg, .modal').hide();\n }", "title": "" }, { "docid": "a130dd88868e755087b8f5ab69b2550c", "score": "0.76555836", "text": "function _modal_close() {\n\t\t\tvar _overlay = wpmUi._modal_overlay();\n\t\t\tif ( ! _wnd ) { return false; }\n\t\t\tif ( ! _overlay instanceof jQuery ) { return false; }\n\n\t\t\t_overlay.off( 'click', _modal_close );\n\t\t\t_me.hide();\n\t\t}", "title": "" }, { "docid": "70728c9b70a668bb184960d8768c4a74", "score": "0.7601219", "text": "function closePopup()\n\t\t{\t\t\t\t\n\t\t\tif (isLocalfileOrServer!=true) {\n\t\t\t\twindow.shell.checkhostReachable() \n\t\t\t\tif(onLineFlag==\"offline\"){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$('#modalwrapper').hide();\n\t\t\t$(\"#shellHeader\").show();\t\n\t\t\t$(\".btnclose\").off('click');\t\t\t\n\t\t\t$(ref.globalThumb).find('.svgIcon').show();\t\t\t\n\t\t\t$(ref.container).find('.modal-dialog').find('.modal-content').find('.modal-body').find('div').getNiceScroll().hide();\n\t\t\tenableNext(ref.modalID)\n\t\t}", "title": "" }, { "docid": "8379aff3c4d9accc11b11096bd2c0dcc", "score": "0.759455", "text": "function closeModal() {\n modalbg.style.display = \"none\";\n form.reset();\n removeInvalidStyling();\n removeConfirmation();\n}", "title": "" }, { "docid": "c92e0cf42e3f99845751ee4087d4c391", "score": "0.75569725", "text": "function closeModal(){\n c('.pizzaWindowArea').style.opacity = 0;\n setTimeout(()=>{\n c('.pizzaWindowArea').style.display = 'none'\n }, 500)\n}", "title": "" }, { "docid": "7b9dc59e334e98777e74ffc5716a6ea0", "score": "0.7468964", "text": "function close() {\n bulmaModal.destroy();\n }", "title": "" }, { "docid": "2f51758f04dd66b03ecd9c0d88fd73c6", "score": "0.74655753", "text": "function closeModal() {\n\t$('.modal-bg').fadeOut();\n\t$('.modal').fadeOut().removeClass('modal-on');\n}", "title": "" }, { "docid": "7bb9ecbd0a4b75c264e95eb633073a57", "score": "0.7443704", "text": "closeModal() {\n\t\tthis.modal.removeClass(\"modal--is-visible\");\n\t\treturn false; /* don't forget to add --is-visible rule in _modal.css */\n\t}", "title": "" }, { "docid": "df882a7a2828cbdef015fb0a0da3421f", "score": "0.7442379", "text": "function closePopUp() { modal.style.display = \"none\"; }", "title": "" }, { "docid": "a69168dfc21d1aafda2b1f290a82532f", "score": "0.7388993", "text": "closeModal() {\n this.args.close();\n }", "title": "" }, { "docid": "af8e2fd232eb55640614631fccf0cd6b", "score": "0.7388634", "text": "close() {\n this.stopSlideVideo(this.activeSlide)\n addClass(this.modal, 'glightbox-closing')\n animateElement(this.overlay, this.settings.cssEfects.fade.out)\n animateElement(this.activeSlide, this.settings.cssEfects.zoom.out, () => {\n this.activeSlide = null\n this.prevActiveSlideIndex = null\n this.prevActiveSlide = null\n\n if (this.events) {\n for (var key in this.events) {\n if (this.events.hasOwnProperty(key)) {\n this.events[key].destroy()\n }\n }\n }\n\n removeClass(body, 'glightbox-open')\n removeClass(html, 'glightbox-open')\n removeClass(body, 'touching')\n removeClass(body, 'gdesc-open')\n body.style.width = '';\n this.modal.parentNode.removeChild(this.modal)\n if (utils.isFunction(this.settings.onClose)) {\n this.settings.onClose();\n }\n });\n }", "title": "" }, { "docid": "bca1d6a86689947dd133026d7412ef9e", "score": "0.7360758", "text": "closeModal() {\n this.bShowModal = false;\n }", "title": "" }, { "docid": "bca1d6a86689947dd133026d7412ef9e", "score": "0.7360758", "text": "closeModal() {\n this.bShowModal = false;\n }", "title": "" }, { "docid": "0fc241d635a6f5a5ec585c3de3339f74", "score": "0.7335422", "text": "function closeModal() {\n\tmodalmegan.style.display = 'none';\n}", "title": "" }, { "docid": "80c0e94f931480a92af51422fd39b565", "score": "0.7333819", "text": "function close(){\n\t\tresizePopin();\n\t\toptions.hide(domElement);\n\t}", "title": "" }, { "docid": "2446d67836dfc736f2fbaced4520ea61", "score": "0.73219526", "text": "function closes3en() {\r\n document.getElementById(\"modal3en\").style.display=\"none\"; \r\n}", "title": "" }, { "docid": "3c8454dda1390cb09fe7149fa7b4543d", "score": "0.7314044", "text": "function modalClose() {\n\n modal.animate([{opacity: '1.0'}, {opacity: '0.0'}], \n {duration: 300, fill:'forwards'});\n\n modalOverlay.animate([{opacity: '1.0'}, {opacity: '0.0'}], \n {duration: 150, fill:'forwards'});\n\n body.style.overflow = \"\";\n\n setTimeout(() => { modalOverlay.style.display = \"none\"; modal.style.display = \"none\"; }, 400);\n\n }", "title": "" }, { "docid": "89fa016873090cc09580b06c632022d6", "score": "0.7297828", "text": "function closeModal(result) {\n close(null, 500);\n }", "title": "" }, { "docid": "179cea8435a23e01f7df9393b9e6b37d", "score": "0.72935534", "text": "async closeModal() {\r\n this.emitAnalyticsData(dxp.i18n.t('Modal:cancel'));\r\n const shadowRoot = this.element ? this.element : this.element;\r\n const demoButton = shadowRoot.querySelector('#demoButton');\r\n shadowRoot.querySelector('.dxp-modal').classList.remove('show');\r\n shadowRoot.querySelector('.dxp-comp-modal').classList.remove('visible');\r\n document.querySelector('body').style.overflow = 'auto';\r\n if (demoButton) {\r\n setTimeout(() => {\r\n this.focusElement(demoButton);\r\n });\r\n }\r\n this.modalClose.emit();\r\n }", "title": "" }, { "docid": "526cf098fb78c70319c9c6cce387abf7", "score": "0.728774", "text": "closeModal() {\n this.close();\n }", "title": "" }, { "docid": "526cf098fb78c70319c9c6cce387abf7", "score": "0.728774", "text": "closeModal() {\n this.close();\n }", "title": "" }, { "docid": "14041180539b4f11f3b38ba78d770468", "score": "0.72725326", "text": "function closeModal() {\n modalbg.style.display = \"none\";\n document.location.reload();\n}", "title": "" }, { "docid": "862e3dc0271dbe736a3aad228967c70d", "score": "0.72703034", "text": "function closes3decom() {\r\n document.getElementById(\"modal3decom\").style.display=\"none\"; \r\n}", "title": "" }, { "docid": "e0e14da166f6a953a06fdfbce044abeb", "score": "0.7262207", "text": "function closeNonModal(event){if(myNonModalLightbox)myNonModalLightbox.close();}", "title": "" }, { "docid": "068a1631537f2e2b1e7a746f79014a7d", "score": "0.7244844", "text": "function closeModal() {\n modal.style.display = \"none\";\n }", "title": "" }, { "docid": "6b486aafae83fc9c8762ed4937487b6d", "score": "0.7233731", "text": "function modalClose () {\n modal.style.display = 'none';\n}", "title": "" }, { "docid": "2e1583a37f1f447735d6d88b9f3ef05e", "score": "0.7229048", "text": "function closes3com() {\r\n document.getElementById(\"modal3com\").style.display=\"none\"; \r\n}", "title": "" }, { "docid": "7668d970948f1f1807430947aa5cba6a", "score": "0.72264946", "text": "function closeModal() {\n\t\t\tdocument.getElementById(\"winnerModal\").style.display = \"none\";\n\t\t}", "title": "" }, { "docid": "c1f4b4ef51d43c8a959931857cd50417", "score": "0.72081846", "text": "function closeModal() {\r\n clothModal.style.display = \"none\";\r\n}", "title": "" }, { "docid": "4c1ac9a22e5a3c1f901e05825fe2d5e0", "score": "0.72041744", "text": "exit() {\n if (this.view) {\n $('#modalShadow').hide();\n this.view.hide();\n this.view = null;\n }\n }", "title": "" }, { "docid": "9c54fcca85b4c8a488681a9e01f54c27", "score": "0.71827024", "text": "function close_modal() {\n $overlay.fadeOut(200);\n $modal.css({ 'display' : 'none' });\n\n $overlay.off('click', close_modal);\n $(o.closeButton).off('click', close_modal);\n $window.off('resize', resizeDebouncer);\n\n }", "title": "" }, { "docid": "c96c648963b3cd83e625edefb5871f44", "score": "0.7171839", "text": "function closeLeetCodeModal() {\n document.getElementById(\"leetCodeModal\").classList.remove(\"is-active\");\n document.documentElement.classList.remove(\"is-clipped\");\n}", "title": "" }, { "docid": "6ab393098a144563a72f9e23b353d65c", "score": "0.71428835", "text": "function closePopUp() {\n document.getElementById(\"modalForRemoteLogger\").setAttribute(\"show\", false);\n }", "title": "" }, { "docid": "7ccb28fe3a2741e82e3943cfd1bc7f90", "score": "0.71405077", "text": "function closeModal(){\n $(\".modal-mask\").removeClass(\"modal-active\");\n }", "title": "" }, { "docid": "4f9e314386d50a17ca6f5b5210f78fd0", "score": "0.71369416", "text": "function closeModal() {\r\n modal.style.display = \"none\";\r\n}", "title": "" }, { "docid": "74a929cd86092aaf36b1ca8b3c31bacc", "score": "0.7135547", "text": "function close(){\n modal.style.display = \"none\";\n init();\n}", "title": "" }, { "docid": "266eed5a046b6386c93215a04c2f17b3", "score": "0.71327823", "text": "function closeModal() {\n body.removeChild(modalContainer);\n}", "title": "" }, { "docid": "8a2dd87fbc499f8162b9f1b1e248c241", "score": "0.71285766", "text": "function closeLightbox(){\n modal.style.display = 'none';\n}", "title": "" }, { "docid": "f0c1ca264336d3afaf9229551735ce0b", "score": "0.712613", "text": "function closeModal()\r\n{\r\n modal.style.display = 'none';\r\n}", "title": "" }, { "docid": "a35c63b4751c5ea22d8c98f3a520f8af", "score": "0.7106692", "text": "function closeModal() {\n const closeIcon = document.querySelector(\".exit\");\n closeIcon.addEventListener(\"click\", function(){\n const popUp = document.getElementById(\"modal\");\n popUp.classList.remove(\"show\");\n document.querySelector(\"#canvas\").style.visibility=\"hidden\";\n //initGame();\n})\n}", "title": "" }, { "docid": "e693d0b5cd035fdd675f0582e8d2e191", "score": "0.7093997", "text": "function closegoModal(evt) {\n gameOver.style.display = \"none\";\n}", "title": "" }, { "docid": "e693d0b5cd035fdd675f0582e8d2e191", "score": "0.7093997", "text": "function closegoModal(evt) {\n gameOver.style.display = \"none\";\n}", "title": "" }, { "docid": "517062e7058fd3892d1dc49d4cc92b5a", "score": "0.7090302", "text": "function closeModal() {\n\tmodal.style.display = 'none';\n}", "title": "" }, { "docid": "2032beb010589b5d7854d7cef962d84b", "score": "0.7087029", "text": "function closeModal() {\n modal.style.display = \"none\";\n}", "title": "" }, { "docid": "2032beb010589b5d7854d7cef962d84b", "score": "0.7087029", "text": "function closeModal() {\n modal.style.display = \"none\";\n}", "title": "" }, { "docid": "4c4ab4384f5ecc5ec116da0249d50415", "score": "0.7077802", "text": "function modalClose() {\n\n // fade out container\n container.style.opacity = 1.0;\n\n // bring modal to front\n modal.style.display = \"none\";\n\n // set modal state\n modalState = \"closed\";\n}", "title": "" }, { "docid": "f903d6501f0093478a8d3c1cd5cbac40", "score": "0.70773345", "text": "function closeModal() {\r\n modal.style.display = \"none\";\r\n}", "title": "" }, { "docid": "a85822d7fd0670a5cdde970f3eacb16d", "score": "0.70718676", "text": "close() {\n if (!this.active_) {\n return;\n }\n\n if (this.keyboardHandler_) {\n document.body.removeEventListener('keydown', this.keyboardHandler_);\n this.keyboardHandler_ = null;\n }\n\n // Restore the original Y position before the modal was opened.\n window.scrollTo(0, this.scrollY_);\n\n // Move the modal body element back to its original container.\n const modalEl = this.getModalWrapper();\n modalEl.appendChild(this.modalDialog_.getModalBody());\n\n // Destroy the modal element.\n this.modalDialog_.destroy();\n this.modalDialog_ = null;\n\n if (this.enableHashHistory_) {\n window.history.pushState({\n 'modalId': null,\n }, '' /* title */, window.location.pathname);\n }\n\n this.active_ = false;\n\n if (this.onClose_) {\n this.onClose_();\n }\n }", "title": "" }, { "docid": "7c35f51389ef2ef508da67b73c7d29a0", "score": "0.70715946", "text": "function closeModal() {\r\n // Hide modal divs, hide modal from screen-readers and resset main content to scroll\r\n modal[0].setAttribute('hidden', 'hidden');\r\n modal[0].setAttribute('aria-hidden', 'true');\r\n overlay[0].setAttribute('hidden', 'hidden');\r\n document.body.style.overflow = '';\r\n\r\n // Remove event listeners for when modal is open\r\n closeButtons[0].removeEventListener('click', closeModal);\r\n closeButtons[1].removeEventListener('click', closeModal);\r\n document.body.removeEventListener('keydown', checkKeyPress);\r\n gameSetup(urlParams.game);\r\n}", "title": "" }, { "docid": "a635706aa6f4cbc8f29f0e458a63864e", "score": "0.707111", "text": "function closeModal() {\n modal.style.display = 'none';\n}", "title": "" }, { "docid": "a635706aa6f4cbc8f29f0e458a63864e", "score": "0.707111", "text": "function closeModal() {\n modal.style.display = 'none';\n}", "title": "" }, { "docid": "a635706aa6f4cbc8f29f0e458a63864e", "score": "0.707111", "text": "function closeModal() {\n modal.style.display = 'none';\n}", "title": "" }, { "docid": "4fc2c99ca6d2bcd2e7f18e66689a7906", "score": "0.70710105", "text": "function closeModal() {\n document.querySelector(\".mask\").classList.remove(\"active\");\n }", "title": "" }, { "docid": "ce4c148a13fa3d24bee9faf4308a549e", "score": "0.7060905", "text": "function closeModal(){\n \n modal.style.display=\"none\";\n \n }", "title": "" }, { "docid": "ce90fd2d0bef21dcd623356e5b8651a5", "score": "0.7057585", "text": "close(){\n isfull = false;\n myWindow.close();\n return \"bye\";\n }", "title": "" }, { "docid": "3e834e0e1189ad571ca1e51b5c9b8c12", "score": "0.7057301", "text": "function closeModalArtiste(){\n\tdocument.getElementById(\"fader\").style.display=\"none\";\n\tdocument.getElementById(\"popup_artiste\").innerHTML=\"\";\n}", "title": "" }, { "docid": "c7c70dcda234396667ec47dca6b724fe", "score": "0.7054391", "text": "function closeModal() {\n\t$(\"#welcome_modal\").modal(\"hide\");\n\twindow.showModal = false;\n}", "title": "" }, { "docid": "56976258ee2d44c612fff98f0f1f26fb", "score": "0.7054267", "text": "function closeModal() {\n modal.style.display = \"none\"; \n}", "title": "" }, { "docid": "485e706fd776fce0116097037391c1bf", "score": "0.7052939", "text": "function closeModal(){\n\tmodal.style.display = \"none\";\n init();\n}", "title": "" }, { "docid": "8d8b61f61b365865413326d8ca72b75d", "score": "0.70521045", "text": "function closeModal() {\n modal.style.display = \"none\";\n}", "title": "" }, { "docid": "708f29073f1da6a248853d5c878b76a8", "score": "0.70515335", "text": "function closeModal(e) {\n if(e.key === 'Escape') {\n Anim.Helpers.hidshowbody('auto')\n SetAppState.setImageModalState({ isOpen: false, current: 0, images: {} })\n }\n }", "title": "" }, { "docid": "b76af3eb5451b3bb72b38f2cf8ef28b0", "score": "0.7048322", "text": "function closeModalWindow() {\n //Fade out the greyed background\n $('.modal-bg').fadeOut();\n //Fade out the modal window\n $('.modal').fadeOut();\n // Clear input fields\n $('.inputField').val('');\n // Reset select value to default\n $('#subjectInput option').prop('selected', function() {\n return this.defaultSelected;\n });\n}", "title": "" }, { "docid": "c967fe95721765ae5f97a2eb87583e86", "score": "0.70471126", "text": "function closeModal(){\r\n closeicon.addEventListener(\"click\", function(e){\r\n modal.classList.remove(\"show\");\r\n window.close();\r\n });\r\n}", "title": "" }, { "docid": "67fe005963c193c012d04c8db8f70294", "score": "0.7042235", "text": "function closeModal() {\n modal.style.display = 'none';\n}", "title": "" }, { "docid": "67fe005963c193c012d04c8db8f70294", "score": "0.7042235", "text": "function closeModal() {\n modal.style.display = 'none';\n}", "title": "" }, { "docid": "2c1ea8c88c2c17a1c12333ad25d2b86b", "score": "0.7041773", "text": "function closeModalAtWindowClick(event){\n if (event.target.classList.contains('modal-container')){\n $modalContainer.classList.remove('show-modal');\n render();\n }\n}", "title": "" }, { "docid": "42769fcaaeb558e31e2b58e9548f1b6f", "score": "0.7041279", "text": "close() {\n\t\tthis._closeHandlers.forEach(fn => fn(this));\n\n\t\tthis.remove();\n\t\tdocument.body.style.overflowY = 'scroll';\n\t\tALBModal.currentModal = null;\n\t}", "title": "" }, { "docid": "2248a99c59223777e89d5e265027207a", "score": "0.7035261", "text": "function closePopup()\n {\n var win = document.querySelector(\".window--modal\");\n if (win) {\n var api = win.data_api;\n if(api) api.close();\n }\n }", "title": "" }, { "docid": "9dff939c5a29937c8a8f8b2a06a4cba9", "score": "0.70349747", "text": "function closeModal() {\n handleOpen(!modalOpen)\n }", "title": "" }, { "docid": "a59dff27a5e6471b57261d0fc614d281", "score": "0.70293593", "text": "function closeModal(){\n\tmodal.style.display = 'none';\n}", "title": "" }, { "docid": "37cba95e7e2d142fcf88eb2922d0e703", "score": "0.7024939", "text": "function closeClassicRulesModal() {\n classicRulesModal.style.display = 'none';\n }", "title": "" }, { "docid": "909729ae14de98a47c04d26ae70b9557", "score": "0.702359", "text": "function closeModal(){\n $('#div_modal').remove();\n $('.fade').css('opacity','1');\n $('#result p').text('');\n $('#div_loading4').removeClass('hide');\n $('#div_loading4').addClass('centreV');\n recalculate();\n\n }", "title": "" }, { "docid": "6ce0ed0b3455988a9df3ff0d0c37bfea", "score": "0.702165", "text": "handleModalClosing(){\n this.openModal = false;\n }", "title": "" }, { "docid": "616af40051af631d2020bd7af55fcdae", "score": "0.7017989", "text": "function closePopup(){\n $('.overlay-bg, .overlay-content').hide(); //hide the overlay\n }", "title": "" }, { "docid": "bfad92cb588dcb18ebaee435901831ee", "score": "0.701578", "text": "function closeWindow() {\n\toPopup.hide();\n}", "title": "" }, { "docid": "f77f334777fa44ad906c91873f488107", "score": "0.7009528", "text": "function closeModal(){\n // modal.style.display = 'none';\n // backdrop.style.display = 'none';\n\n //similarly other pages won't have modals, so in order to get js executed,\n //we need to check if the modal exists and only then remove or add classes\n if (modal) modal.classList.remove('open');\n \n backdrop.classList.remove('open');\n}", "title": "" }, { "docid": "238e6e417e6d172de515a6de615e2eeb", "score": "0.700529", "text": "function fn_ev_closeBTN () {\n \n modal._hide(function () {\n $this.removeClass('modal_blur');\n });\n }", "title": "" }, { "docid": "9ab977d2e8e67e66dfa730a62fb9ead5", "score": "0.6997922", "text": "function closeModal() {\n overlay.classList.remove('show-modal');\n startGame();\n}", "title": "" }, { "docid": "837cc793caa587837a51f9a9dab76469", "score": "0.6994996", "text": "function close(args)\n {\n args = args || {};\n \n var element = args.element || false;\n if (element) {\n $('#' + element).hide();\n } else {\n $('div.lightbox').hide();\n }\n \n // Only hide the modal if no other lightboxes exist\n // This is meant to prevent closing a lightbox on an lightbox from hiding both modals.\n // e.g., \"it was used on themes template within the toolkit lightbox\" - Kyle 12/15/10\n $.each($('.lightbox'), function()\n {\n if ($(this).css('display') !== 'none') {\n return false;\n } else {\n hideModal();\n }\n });\n \n // Currently this is only used for stopping playback of flowplayers in clickPic\n $('body').trigger('lightbox.closed');\n }", "title": "" }, { "docid": "9b217d3703dde632720bb4413f1026fb", "score": "0.6989021", "text": "function closeMmodal(){\n\t\tvar $this = $(this);\n\t\t$('.project_show', $body).removeClass('project_show');\n\t}", "title": "" }, { "docid": "eed35b73e1da70aee97964775762d5ca", "score": "0.69866276", "text": "function closeModal(){\n modal.style.display = 'none';\n}", "title": "" }, { "docid": "03e13fd656e6742ff7d436e499b871bc", "score": "0.69785076", "text": "function closeModal() {\n $(\".modal\").css(\"display\",\"none\");\n}", "title": "" }, { "docid": "95a02c1b96837ec97ad60140ca275994", "score": "0.6977545", "text": "function closeWindow () {\n event.preventDefault()\n overlayShowing.style.display = \"none\"\n modalShowing.style.display = \"none\"\n clearFields()\n}", "title": "" }, { "docid": "0df62b39a723f0cac9d71b05997f1829", "score": "0.6970575", "text": "function closeModal(){\n\tmodal.style.display='none';\n}", "title": "" }, { "docid": "4e8b3a1c39d761e0eda2f3b2c289290c", "score": "0.6964541", "text": "function closeModal(){\n modal.style.display = 'none';\n}", "title": "" }, { "docid": "4e8b3a1c39d761e0eda2f3b2c289290c", "score": "0.6964541", "text": "function closeModal(){\n modal.style.display = 'none';\n}", "title": "" }, { "docid": "4e8b3a1c39d761e0eda2f3b2c289290c", "score": "0.6964541", "text": "function closeModal(){\n modal.style.display = 'none';\n}", "title": "" }, { "docid": "4e8b3a1c39d761e0eda2f3b2c289290c", "score": "0.6964541", "text": "function closeModal(){\n modal.style.display = 'none';\n}", "title": "" }, { "docid": "1a8db7f8d44e81722a08984f8506aef4", "score": "0.6961207", "text": "function closeFunction() {\n modal.style.display = \"none\";\n modalImg.style.display = \"none\";//hhhh\n}", "title": "" }, { "docid": "a136292cacd3ad19baa4b5e8920668b3", "score": "0.6960013", "text": "function draugiemWindowClose() {\n\tdraugiemLoadUrl({'action': 'closeinfobox'});\n}", "title": "" }, { "docid": "7bfaf449bb423167aa10d99210bf064e", "score": "0.69580096", "text": "function closeModal(e){\r\n document.getElementById(\"uploadModal\").style.visibility = 'hidden';\r\n document.getElementById(\"uploadModalContent\").style.visibility = 'hidden';\r\n document.getElementById(\"fullmodal\").style.visibility = 'hidden';\r\n document.getElementById(\"uploadModal\").style.zIndex = '-1';\r\n document.getElementById(\"fullmodal\").style.zIndex = '-1';\r\n}", "title": "" }, { "docid": "36159ca36e8c9f4c673d881d9b4689ba", "score": "0.69575095", "text": "function closeModal(){\n\n\t\tvar modalXClicked = document.getElementsByClassName(\"modal\")[0];\n\t\tvar modalXClicked2 = document.getElementsByClassName(\"modal__content\")[0];\n\t\tmodalXClicked.style.display = \"none\";\n\t\tmodalXClicked2.style.display = \"none\";\n\t}", "title": "" }, { "docid": "d53ec8704349fead7a8014e4bbaa7210", "score": "0.6954834", "text": "function quitFromQuitModal(){\n document.getElementById(\"quit-modal\").style.display = 'none';\n returnToMenu();\n}", "title": "" }, { "docid": "8f361809f1a3a1895ed5aefecf90b912", "score": "0.6954308", "text": "function close() {\n // Unbind the events\n $(window).unbind('resize', modalContentResize);\n $('body').unbind( 'focus', modalEventHandler);\n $('body').unbind( 'keypress', modalEventHandler );\n $('.close').unbind('click', modalContentClose);\n $('body').unbind('keypress', modalEventEscapeCloseHandler);\n $(document).trigger('CToolsDetachBehaviors', $('#modalContent'));\n\n // Set our animation parameters and use them\n if ( animation == 'fadeIn' ) animation = 'fadeOut';\n if ( animation == 'slideDown' ) animation = 'slideUp';\n if ( animation == 'show' ) animation = 'hide';\n\n // Close the content\n modalContent.hide()[animation](speed);\n\n // Remove the content\n $('#modalContent').remove();\n $('#modalBackdrop').remove();\n }", "title": "" }, { "docid": "8f361809f1a3a1895ed5aefecf90b912", "score": "0.6954308", "text": "function close() {\n // Unbind the events\n $(window).unbind('resize', modalContentResize);\n $('body').unbind( 'focus', modalEventHandler);\n $('body').unbind( 'keypress', modalEventHandler );\n $('.close').unbind('click', modalContentClose);\n $('body').unbind('keypress', modalEventEscapeCloseHandler);\n $(document).trigger('CToolsDetachBehaviors', $('#modalContent'));\n\n // Set our animation parameters and use them\n if ( animation == 'fadeIn' ) animation = 'fadeOut';\n if ( animation == 'slideDown' ) animation = 'slideUp';\n if ( animation == 'show' ) animation = 'hide';\n\n // Close the content\n modalContent.hide()[animation](speed);\n\n // Remove the content\n $('#modalContent').remove();\n $('#modalBackdrop').remove();\n }", "title": "" } ]
464e0930f3c307bdabe192ade0db326e
creating child divs inside a div to make snow particles
[ { "docid": "442f4abc7f8f84e0e88b82dbdd5374aa", "score": "0.74549365", "text": "function createSnowChildDivs(element,snowDotArray){\n let snowDot;\n for(i=0;i<100;i++){\n snowDot = document.createElement(\"div\");\n element.appendChild(snowDot);\n snowDot.setAttribute(\"class\",\"snowDot\");\n randomSnowSizes(snowDot);\n snowDot.style.opacity=0;\n fuzzySnow(snowDot);\n startingPosition(snowDot);\n snowDotArray.push(snowDot);\n }\n}", "title": "" } ]
[ { "docid": "bae08515a8304528da296cc4ec8bea1a", "score": "0.7164519", "text": "function initSnow() {\n\n var container = document.createElement('div');\n\n container.style.position = 'absolute';\n container.style.top = '0';\n container.style.left = '0';\n\n document.body.appendChild(container);\n\n canvasScene = new THREE.Scene();\n\n canvasRenderer = new THREE.CanvasRenderer();\n canvasRenderer.setSize(window.innerWidth, window.innerHeight);\n\n particleImage.src = 'images/ParticleSmoke.png';\n var material = new THREE.ParticleBasicMaterial( { map: new THREE.Texture(particleImage) } );\n\n for (var i = 0; i < 100; i++) {\n\n particle = new Particle3D(material);\n particle.position.x = Math.random() * 2000 - 1000;\n particle.position.y = Math.random() * 2000 - 1000;\n particle.position.z = Math.random() * 2000 - 1000;\n particle.scale.x = particle.scale.y = 1;\n canvasScene.add( particle );\n\n particles.push(particle);\n }\n\n canvasRenderer.domElement.style.position = 'absolute';\n\n container.appendChild( canvasRenderer.domElement );\n\n}", "title": "" }, { "docid": "6334a6717988637ce374f3e5c70735c7", "score": "0.6911757", "text": "function renderParticles(posLeft, posTop, parAmount, parDistance) {\n var main = $('main');\n var particleFragment = document.createDocumentFragment();\n var particlesAmount = parAmount;\n \n function randomColor() {\n var colorsArray = [\n 'rgb(3,0,0) radial-gradient(circle, rgba(51,6,6,1) 5%, rgba(167,19,19,1) 74%, rgba(156,14,14,1) 100%)',\n ];\n // to get random colors from array: colorsArray[Math.floor(Math.random() * colorsArray.length)]\n return colorsArray[0];\n }\n\n var getColor = randomColor();\n\n for (var i = 0; i < particlesAmount; i++) {\n var particleElement = document.createElement('div');\n particleElement.classList.add('particle-' + clickCounter);\n particleElement.style.left = posLeft + 'px';\n particleElement.style.top = posTop + 'px';\n particleElement.style.background = getColor;\n // to get rainbow colors of particle just uncoment it\n // particleElement.style.background = randomColor();\n particleFragment.append(particleElement);\n }\n\n main.append(particleFragment);\n \n function randomPosition(left, top) {\n function runRandomize(pos) {\n if (Math.floor(Math.random() * 2)) {\n return pos - Math.random() * parDistance;\n } else {\n return pos + Math.random() * parDistance;\n }\n }\n \n return {\n left: runRandomize(left),\n top: runRandomize(top)\n }\n }\n\n $('.particle-' + clickCounter).each(function () {\n var left = randomPosition($(this).position().left, $(this).position().top).left;\n var top = randomPosition($(this).position().left, $(this).position().top).top;\n var $this = $(this);\n\n $(this).css({\n left: left,\n top: top,\n opacity: 0,\n width: 0,\n height: 0\n });\n setTimeout(function () {\n $this.remove();\n }, 600);\n });\n }", "title": "" }, { "docid": "248659200aaae760bce3c11d22a4c7fc", "score": "0.6908777", "text": "function createsnow() {\n let snowContainer = document.getElementById('snow_container');\n snowContainer.innerHTML = '';\n\n // Specify how much snow you want.\n // Based on CSS, only goes up to a max of 50.\n let numSnowFlakes = 50;\n for (; numSnowFlakes > 0; numSnowFlakes--) {\n let snowFlake = document.createElement(\"div\");\n snowFlake.className = 'snow';\n snowContainer.append(snowFlake);\n }\n}", "title": "" }, { "docid": "dc46d2d4675e4a8d84f60203cddbc69f", "score": "0.6904361", "text": "function particles() {\r\n var count = 1000;\r\n var container = document.querySelector(\".container\");\r\n var i = 0;\r\n while (i < count) {\r\n// creating an element i for every particle\r\n var singleParticle = document.createElement(\"i\");\r\n// giving random size to the particles\r\n var x = Math.floor(Math.random() * window.innerWidth);\r\n var y = Math.floor(Math.random() * window.innerHeight);\r\n var size = Math.random() * 10;\r\n// applying styles to the new element i\r\n singleParticle.style.left = x + \"px\";\r\n singleParticle.style.top = y + \"px\";\r\n singleParticle.style.width = 1 + size + \"px\";\r\n singleParticle.style.height = 1 + size + \"px\";\r\n singleParticle.style.animationDuration = 5 + size + \"s\";\r\n singleParticle.style.animationDelay = -size + \"s\";\r\n// appending the element i in the container div\r\n container.appendChild(singleParticle);\r\n i++;\r\n }\r\n}", "title": "" }, { "docid": "caa58d49f749fe42d9c087df9181fa1b", "score": "0.68236077", "text": "createParticle() {\r\n noStroke();\r\n this.color.setAlpha(this.alpha);\r\n fill(this.color);\r\n circle(this.x, this.y, this.r);\r\n if(sf > 1){\r\n //tint(255, this.alpha);\r\n image(this.cell, this.x, this.y, this.r, this.r);\r\n }\r\n }", "title": "" }, { "docid": "dd15a58828302bef5792e69092ccae6d", "score": "0.6755793", "text": "function bubbles() {\n $.each($(\".particletext.bubbles\"), function(){\n var bubblecount = ($(this).width()/50)*10;\n for(var i = 0; i <= bubblecount; i++) {\n var size = ($.rnd(40,80)/10);\n $(this).append('<span class=\"particle\" style=\"top:' + $.rnd(20,80) + '%; left:' + $.rnd(0,95) + '%;width:' + size + 'px; height:' + size + 'px;animation-delay: ' + ($.rnd(0,30)/10) + 's;\"></span>');\n }\n });\n }", "title": "" }, { "docid": "3ff6cba7f255f7cd4eba7b1c01ade71b", "score": "0.6649344", "text": "function createParticles(){\n\tscene.remove.apply(scene, scene.children);\n\tspheres = [];\n\tgeometry = new THREE.SphereGeometry(2,10,10);\n\tmaterial = new THREE.MeshBasicMaterial({color:0xffffff});\n\n\t//lineMaterial = new THREE.LineBasicMaterial( { color: 0xFFFFFF, transparent: true, opacity: 0.1 } );\n\t//ahora creamos cada particula\n\tfor(var p=0; p < particleCount; p++){\n\t\t//creamos una particula con posiciones aleatorias a partir del cero\n\t\t//el canvas mide 400,400 asi que el random sera entre -200 a 200\n\n\t\t//las particulas pueden salirse fuera del render\n\t\tvar pX = (Math.random() * params.tamOctree) - params.tamOctree;\n\t\tvar pY = (Math.random() * params.tamOctree) - params.tamOctree;\n\t\tvar pZ = (Math.random() * params.tamOctree) - params.tamOctree;\n\n\t\t\n\t\tparticle = new THREE.Mesh(geometry,material);\n\t\t//particle.material.transparent = true;\n\t\tparticle.position.set(pX,pY,pZ);\n\t\t//agregamos a la geometria de particulas\n\t\tspheres.push(particle);\n\t\tscene.add( particle );\n\t}\n}", "title": "" }, { "docid": "29482a405441a3ae3603d6c92411fdc1", "score": "0.6533131", "text": "function createMightyParticles(focalPoint){\n awesomeSound.play();\n var hue = random(20, 300);\n var pp;\n if(!focalPoint){\n pp = createVector(mouseX,mouseY);\n }else{\n pp = createVector(focalPoint.x, focalPoint.y);\n } \n var numberOfParticles = random(15, 35);\n for(var i=0; i<numberOfParticles; i++){\n var vv = createVector(0, 1);\n vv.rotate(random(0, TWO_PI));\n vv.mult(random(1, 3));\n \n var newBorn = new Particle(pp, vv, hue);\n particleSystem.push(newBorn); \n }\n \n /*var checkEdges = function(){\n if (pp.x > width){\n pp.x = width;\n vv.x *=-1;\n }else if (pp.x < 0){\n vv.x *=-1;\n pp.x = 0\n }\n \n if (pp.y > height){\n vv.y *=-1;\n pp.y = height;\n }\n }*/\n \n \n}", "title": "" }, { "docid": "60723b9c7dddc4fb1e8541c6e23841dc", "score": "0.65119386", "text": "function initParticles() {\n for (var i = 0; i < 2000; i++) {\n particles.push(new PaintParticle(width * 0.5, height * 0.5));\n }\n}", "title": "" }, { "docid": "39ecae1365f18cb98d0513652a1163ea", "score": "0.65087706", "text": "function setup() {\r\n createCanvas(800, 800);\r\n \r\n //inside setup\r\n\r\n for(let i = 0;i<width/10;i++){\r\n particlesBg.push(new ParticleBg());\r\n }\r\n}", "title": "" }, { "docid": "dc4e6dd1606a244a6c77541356bde729", "score": "0.6487803", "text": "function createParticles()\n {\n // Adds 10 particles to the array with random positions, colours, velocities and lifespans\n for(var i = 0; i < 10; i++)\n {\n particles.push(new create());\n }\n }", "title": "" }, { "docid": "e8266e8a50a23794982d218983d1fb49", "score": "0.6473716", "text": "function positionParticles() {\n columns = Math.round(canvas.width / distance);\n rows = Math.round(canvas.height / distance);\n\n for (i = 0; i < rows * columns; i++) {\n let x = (i % columns) * distance;\n let y = Math.floor(i / columns) * distance;\n particles.push(new Particle(x, y));\n }\n}", "title": "" }, { "docid": "6a8b6e9117ab7a4fb675c89452f3f86a", "score": "0.6469174", "text": "function createParticles(n){\n particles = [];\n for(var x = 0; x < n; x++){\n particles.push({\n x: x,\n w: 0,\n h: getY(mark_width * x)\n });\n }\n }", "title": "" }, { "docid": "cb46790485773319620e7216d6931a8a", "score": "0.6363177", "text": "createParticleSystem() {\n this._particleSystem = new BABYLON.ParticleSystem('particle', 3500, this._scene);\n this._particleSystem.particleTexture = new BABYLON.Texture(`${baseUrl}/images/driehoek.svg`, this._scene);\n\n // add particle system onto the mesh\n this._particleSystem.emitter = this._mesh;\n this._particleSystem.minEmitBox = new BABYLON.Vector3(-30, 0, 0);\n this._particleSystem.maxEmitBox = new BABYLON.Vector3(30, 0, 0);\n\n Object.assign(this._particleSystem, config.snow);\n\n // set emission rate\n this._particleSystem.emitRate = this._emitRate * physicsManager.speed;\n\n // init particle system\n this._particleSystem.start();\n }", "title": "" }, { "docid": "49c4ba4fb5afc34c64b4944c29ab60c8", "score": "0.63541603", "text": "function setup() {\n \n createCanvas( windowWidth, windowHeight );\n washImg = loadImage( 'wash.png' ); // wash picto\n \n for( let i=0; i<width/14; i++ ) {\n \n particles.push( new Particle() );\n }\n}", "title": "" }, { "docid": "b698ea349ec7fb002c4863a57ec5a3e1", "score": "0.6320724", "text": "function draw() {\n ctx.clearRect(0, 0, W, H);\n ctx.fillStyle = \"rgba(255, 255, 255, 0.8)\";\n ctx.beginPath();\n\n for (var _i2 = 0; _i2 < mp; _i2++) {\n var p = particles[_i2];\n ctx.moveTo(p.x, p.y);\n ctx.arc(p.x, p.y, p.r, 0, Math.PI * 2, true);\n }\n\n ctx.fill();\n update();\n } //Function to move the snowflakes", "title": "" }, { "docid": "8d3bc43abb9834b4fb8570cd3c9f38a5", "score": "0.63005906", "text": "function generateSnow() {\n for (i = 0; i < snowflakeCount; ++i) {\n amplitude[i] = Math.random() * ampMultiplier;\n posX[i] = Math.random() * (width - amplitude[i]);\n posY[i] = Math.random() * height;\n placeX[i] = Math.random() * flakeFluctSpeed; // Х displacement\n placeY[i] = Math.random() + flakeDownSpeed; // Y displacement\n deltaX[i] = 0;\n\n var elem = document.createElement('img');\n elem.id = \"snowflake\" + i;\n elem.style = \"position:absolute;\" + \"z-index: \" + i + \"; visibility:visible; top:-50px; left:-50px;\";\n elem.src = imgsrc;\n elem.border = 0;\n document.body.appendChild(elem);\n\n obj[i] = document.getElementById(\"snowflake\" + i);\n }\n}", "title": "" }, { "docid": "b19330b4eea60b85bfff036ecb527cc6", "score": "0.62871575", "text": "function draw() {\r\n background(0,5);\r\n // inside draw\r\n\r\nfor(let i = 0;i<particlesBg.length;i++) {\r\n \r\n particlesBg[i].createParticleBg();\r\n particlesBg[i].moveParticleBg();\r\n particlesBg[i].joinParticlesBg(particlesBg.slice(i));\r\n }\r\n}", "title": "" }, { "docid": "64d4a00f75df8c6a0b2a72261397facb", "score": "0.6267741", "text": "run(){\n \n //loop for making multiple particles\n for(var i = 0; i < this.particles.length; i++){\n var p = this.particles[i]; \n p.show(); //show the particles\n p.move(); //move the particles\n \n if(p.Dead()){\n this.particles.splice(i,1);\n }\n }\n }", "title": "" }, { "docid": "5f9639ec9fc76842fe9c1d0a838b7067", "score": "0.6263363", "text": "function PotionExperience(){\n giraffe.underPotionInfluence=1;\n world.SetGravity(new b2Vec2(0,1));\n var potionBackgroundProps={ \n color: \"black\",\n type: \"static\",\n desc: \"potionBackground\",\n x:visibleCanvasCenter.x,//for some reason, don't have to adjust these by gradient radius. Radians draw from center'\n y:visibleCanvasCenter.y,//for some reason, don't have to adjust these by gradient radius. Radians draw from center. Maybe due to the draw function we have?\n width:rightBoundPos-leftBoundPos,\n height:bottomBoundPos-topBoundPos,\n maskBits:0x0008\n }; \n potionBackground=createABody(potionBackgroundProps,this);\n \n particleIndex=0;//makes sure new ones appear behind\n for (var i=1;i<200;i++){\n \n new PotionParticle();\n }\n \n\n}", "title": "" }, { "docid": "9f07a3337a341b95e177d4be7948fd8c", "score": "0.62447053", "text": "function initParticles(){\n\t\t\tvar i = 0;\n\n\t\t\t//Draw ref image on ref canvas\n\t\t\tctxRef.drawImage(ref_image,(canvasRef.width-ref_image.width)/2,(canvasRef.height-ref_image.height)/2);\n\t\t\t//Get the pixels of the image\n\t\t\tvar pixels = ctxRef.getImageData(0,0,canvasRef.width,canvasRef.height);\n\n\t\t\t//Add text particles\n\t\t\tfor(i=0;i<200;i++){\n\t\t\t\tvar pX = Math.floor(Math.random()*canvasRef.width);\n\t\t\t\tvar pY = Math.floor(Math.random()*canvasRef.height);\n\n\t\t\t\tvar a = pixels.data[(pX+(canvasRef.width*pY))*4+3];\n\t\t\t\twhile(a==0){\n\t\t\t\t\tpX = Math.floor(Math.random()*canvasRef.width);\n\t\t\t\t\tpY = Math.floor(Math.random()*canvasRef.height);\n\t\t\t\t\ta = pixels.data[(pX+(canvasRef.width*pY))*4+3];\n\t\t\t\t}\n\n\t\t\t\t//Test to see if this particle is going to be an anchor\n\t\t\t\tvar anchor = false;\n\t\t\t\tif(Math.random()>0.85){\n\t\t\t\t\tanchor = true;\n\t\t\t\t}\n\n\t\t\t\tparticles.push({\n\t\t\t\t\ttouchID:0,\n\t\t\t\t\tdist:0,\n\t\t\t\t\tposX:pX,posY:pY,\n\t\t\t\t\torX:pX,orY:pY,\n\t\t\t\t\tisAffected:false,\n\t\t\t\t\tisOut:false,\n\t\t\t\t\toutDest:Math.random()*15,\n\t\t\t\t\toutCount:0,\n\t\t\t\t\tcharge:30,\n\t\t\t\t\tscale:0,\n\t\t\t\t\tscaleNoise:Math.random(),\n\t\t\t\t\tscaleNoiseSpeed:Math.random()*0.005,\n\t\t\t\t\toffX:Math.random(),offY:Math.random(),\n\t\t\t\t\tnoiseAmount:Math.random()*2,\n\t\t\t\t\trandSpeed:Math.random()*0.01,\n\t\t\t\t\tangle : 0,\n\t\t\t\t\thasRepulsion : false,\n\t\t\t\t\tisAnchor:anchor,\n\t\t\t\t\tisSprite : false,\n\t\t\t\t\tmag:Math.random()*40+160\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t//Run through all the pixel to create particles where there is text\n\t\t\tfor(i=0;i<canvasRef.width;i++){\n\t\t\t\tfor(var j=0;j<canvasRef.height;j++){\n\t\t\t\t\t//Get the alpha of that pixel\n\t\t\t\t\tvar a = pixels.data[(i+(canvasRef.width*j))*4+3];\n\t\t\t\t\t\n\t\t\t\t\t//If alpha is more than 0, create a particle at that position\n\t\t\t\t\tif(a>0 && Math.random()>0.996){\n\t\t\t\t\t\tvar repulsion = true;\n\t\t\t\t\t\tvar anchor = false;\n\t\t\t\t\t\tvar isS = false;\n\t\t\t\t\t\tvar c = 30;\n\t\t\t\t\t\tvar sFactor = 0.06;\n\n\t\t\t\t\t\t//Test to see if the particle will be an anchor\n\t\t\t\t\t\tif(Math.random()>0.85){\n\t\t\t\t\t\t\tanchor = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Test to see if the particle is gonna be a sprite\n\t\t\t\t\t\telse if(Math.random()>0.45 && repulsion){\n\t\t\t\t\t\t\tisS = true;\n\t\t\t\t\t\t\tc = Math.random()*5+25;\n\t\t\t\t\t\t\tif(Math.random()>0.4){\n\t\t\t\t\t\t\t\tsFactor = 0.03;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Add particle\n\t\t\t\t\t\tparticles.push({\n\t\t\t\t\t\t\ttouchID:0,\n\t\t\t\t\t\t\tdist:0,\n\t\t\t\t\t\t\tposX:i,posY:j,\n\t\t\t\t\t\t\torX:i,orY:j,\n\t\t\t\t\t\t\tisAffected:false,\n\t\t\t\t\t\t\tisOut:false,\n\t\t\t\t\t\t\toutDest:Math.random()*15,\n\t\t\t\t\t\t\toutCount:0,\n\t\t\t\t\t\t\tcharge:c,\n\t\t\t\t\t\t\tscale:0,\n\t\t\t\t\t\t\tscaleFactor:sFactor,\n\t\t\t\t\t\t\tscaleNoise:Math.random(),\n\t\t\t\t\t\t\tscaleNoiseSpeed:Math.random()*0.005,\n\t\t\t\t\t\t\toffX:Math.random(),offY:Math.random(),\n\t\t\t\t\t\t\tnoiseAmount:Math.random()*10,\n\t\t\t\t\t\t\trandSpeed:Math.random()*0.01,\n\t\t\t\t\t\t\tangle : 0,\n\t\t\t\t\t\t\thasRepulsion : repulsion,\n\t\t\t\t\t\t\tisAnchor:anchor,\n\t\t\t\t\t\t\tsprite:sprites[Math.floor(Math.random()*sprites.length)],\n\t\t\t\t\t\t\tisSprite : isS,\n\t\t\t\t\t\t\tmag:Math.random()*40+300\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//$(window).mousemove(onWindowMouseMove);\n\t\t\tanimate();\n\t\t}", "title": "" }, { "docid": "6ee65534a0b41f77682c01d6cae5962b", "score": "0.6227803", "text": "function getParticlesAnimation() {\n \n //var particlesTimeline = new TimelineLite();\n var particlesTimeline = new TimelineMax({ repeat: -1 });\n var i = 200;\n var radius = $( document ).width() * 0.5;\n var centerX= $( document ).width() * 0.5;\n var centerY = $( document ).height() * 0.5;\n var dots = [];\n var rawDots = [];\n\n while (--i > -1) {\n var angle = Math.random() * Math.PI * 2;\n var insertionTime = i * 0.015;\n\n dot = document.createElement('img');\n dot.src = '/assets/images/dot.png';\n dot.id = 'dot' + i;\n dotContainer.append(dot);\n dot.style.cssText = 'position:absolute; left:' + centerX + 'px; top:' + centerY + 'px; width:1px; height:1px;';\n \n \n particlesTimeline.from(dot, 0.05, {opacity:0, immediateRender:true}, insertionTime);\n \n particlesTimeline.to(dot, .7, {left:Math.cos(angle) * radius + centerX, \n top:Math.sin(angle) * radius + centerY, \n width:22, \n height:22,\n //repeat: -1,\n ease:Cubic.easeIn\n }, insertionTime);\n \n }\n return particlesTimeline;\n }", "title": "" }, { "docid": "3334f21d107ae5a405263bd25742e58b", "score": "0.6201238", "text": "createParticle() {\n stroke('black');\n \n push();\n translate(this.x-windowWidth/2,this.y-windowHeight/2);\n if (dist(mouseX, mouseY, this.x, this.y) < 50) {\n fill('black');\n stroke('white');\n rotateX(frameCount * 0.05);\n rotateY(frameCount * 0.05);\n box(this.r*2);\n } else {\n box(this.r);\n }\n pop();\n\n push();\n translate(this.x-windowWidth/2,this.y-windowHeight/2);\n if (dist(mouseX, mouseY, this.x, this.y) < 50) {\n textAlign(CENTER, CENTER);\n fill('black');\n textSize(14 + this.r/2);\n textFont(fontSans);\n text(this.word,0,12);\n }\n pop();\n }", "title": "" }, { "docid": "554c9e335793eb45e2be9a34ca651abc", "score": "0.6189754", "text": "function start_snowing(num_snowAmount, num_windSpeed, num_fallSpeed){\n\t//clear first (just incase)\n\tarr_snow_div = [];\n\tarr_snow_ids = [];\n\t//\n\tfor (var i = 0; i<num_snowAmount; ++i){\n\t\t//\n\t\tvar snow_flake = document.createElement(\"div\");\n\t\tsnow_flake.id = \"_snow_flake_\" + String(i);\n\t\tsnow_flake.className = \"snow\";\n\t\t//snow.appendChild(snow_flake);\n\t\t//images\n\t\tsnow_flake.innerHTML = '<img src=' + str_snow_imagePath + arr_snow_images[Math.ceil(Math.random()*arr_snow_images.length)-1] + '>';\n\t\tsnow_flake.style.position = 'absolute';\n\t\tsnow_place_randomly(snow_flake);\n\t\tsnow_flake.style.pointerEvents = \"none\";\n\t\t//\n\t\tdocument.getElementsByTagName(\"body\")[0].appendChild(snow_flake);\n\t\tarr_snow_div.push(snow_flake);\n\t\tinit_snow(snow_flake, i, num_windSpeed, num_fallSpeed);\n\t};\n\t//\n}", "title": "" }, { "docid": "6c87722251def645b50c4047600f6bf7", "score": "0.6183091", "text": "function makeParticles() {\n $.getJSON('data.json', function(data) {\n //WLF\n drawPoints(data.WLFX, data.WLFY, data.WLFZ, 'rgb(255,255,255,150)');\n\n //WRFX\n drawPoints(data.WRFX, data.WRFY, data.WRFZ, 'rgb(255,255,0)');\n\n //DAN waistLBack\n drawPoints(data.WLBX, data.WLBY, data.WLBZ, 'rgb(0,255,0)');\n\n //DAN waistRBack\n drawPoints(data.WRBX, data.WRBY, data.WRBZ, 'rgb(0,0,255)');\n\n //DAN BackTOP\n drawPoints(data.BTX, data.BTY, data.BTZ, 'rgb(0,255,255)');\n\n //DAN CHEST\n drawPoints(data.CX, data.CY, data.CZ, 'rgb(100,100,255)');\n\n //DAN BACK LEFT\n drawPoints(data.BLX, data.BLY, data.BLZ, 'rgb(255,100,100)');\n\n //DAN BACK RIGHT\n drawPoints(data.BRX, data.BRY, data.BRZ, 'rgb(155,100,0)');\n\n //DAN head top\n drawPoints(data.HTX, data.HTY, data.HTZ, 'rgb(200,80,190)');\n\n //DAN head FRONT\n drawPoints(data.HFX, data.HFY, data.HFZ, 'rgb(190,180,130)');\n\n //DAN LFET SHOULDER BACK\n drawPoints(data.LSBX, data.LSBY, data.LSBZ, 'rgb(200,185,195)');\n\n //DAN LFET SHOULDER TOP\n drawPoints(data.LSTX, data.LSTY, data.LSTZ, 'rgb(200,100,130)');\n\n //DAN Left Elbow Out\n drawPoints(data.LEOX, data.LEOY, data.LEOZ, 'rgb(10,190,255)');\n\n //Dan:LUArmHigh\n drawPoints(data.LUAHX, data.LUAHY, data.LUAHZ, 'rgb(10, 90, 55)');\n\n //Dan:RShoulderBack\n drawPoints(data.RSBX, data.RSBY, data.RSBZ, 'rgb(200, 130, 55)');\n\n //Dan:RShoulderTop\n\n drawPoints(data.RSTX, data.RSTY, data.RSTZ, 'rgb(35, 201, 186,150)');\n //Dan:RElbowOut\n\n drawPoints(data.REOX, data.REOY, data.REOZ, 'rgb(245, 55, 127,150)');\n //Dan:RUArmHigh\n drawPoints(data.RUAHX, data.RUAHY, data.RUAHZ, 'rgb(255, 131, 0,150)');\n });\n}", "title": "" }, { "docid": "d03f7343c7018673e1ff7bc9f2b8cf05", "score": "0.6177895", "text": "function drawDraggableParticles() {\n for (var i = 0; i < particles.length; i++) {\n var p = particles[i];\n drawParticle(p.x, p.y, p.radius, 2, p.fill, \"#000000\");\n }\n }", "title": "" }, { "docid": "0bee61c4320ecb5f5c9925bbabf4888e", "score": "0.6130625", "text": "function init() {\n particleArray = [];\n for (let i=0; i < 100; i++) { // change the amount of particles.\n let size = Math.random() * 20; // change this value to alter particle size.\n let x = Math.random() * (innerWidth - size * 2);\n let y = Math.random() * (innerHeight - size * 2);\n let directionX = (Math.random() * .4) - .2; // these values adjust the X direction\n let directionY = (Math.random() * .4) - .2; // these values adjust the Y direction\n let color = 'white'; // change this value to affect particle colour.\n\n particleArray.push(new Particle(x, y, directionX, directionY, size, color));\n }\n}", "title": "" }, { "docid": "2876107a6a6ac26de049aeb6a2af1352", "score": "0.61256367", "text": "createParticle() {\n noStroke();\n fill('darkorange');\n circle(this.x,this.y,this.d);\n }", "title": "" }, { "docid": "43fe0ecf9e481ab031bd97884713f011", "score": "0.6121046", "text": "createParticle() {\n noStroke();\n this.blue = random(0,155)\n circle(this.x,this.y,this.r);\n }", "title": "" }, { "docid": "6282dee375f774b58dd70c352b0e2328", "score": "0.6116509", "text": "createParticle() {\n noStroke();\n fill('rgba(200, 169, 169, 0.5)');\n circle(this.x, this.y, this.r);\n }", "title": "" }, { "docid": "4aedc6dd39f8a49dc30475cbc3564db0", "score": "0.60936356", "text": "function initFluidParticles() {\n var $particlsA = $(\"#particles\");\n if ($particlsA.length) {\n $particlsA.particleground({\n minSpeedX: 0.6,\n minSpeedY: 0.6,\n dotColor: '#ffffff',\n lineColor: '#ffffff',\n density: 6000,\n particleRadius: 2, // curvedLines: true,\n parallaxMultiplier: 5.2,\n proximity: 0\n });\n }\n }", "title": "" }, { "docid": "bff53e1b7770b90f743e1314589348e8", "score": "0.6092107", "text": "function pebbles()\n{\n\tvar j = 0;\n\n\tfor (var i = 0; i < 9; i++) {\n\t\tvar geo = new THREE.SphereGeometry(0.5); //width, height, depth,\n\t\tvar mat = new Physijs.createMaterial(new THREE.MeshBasicMaterial({ color: 'ffffff' }), .95, .95);\n\t\tvar msh = new Physijs.BoxMesh(geo, mat);\n\t\tvar msh2 = new Physijs.BoxMesh(geo, mat);\n\n\t\tmsh.position.x = i * 5; msh.position.y = -1; msh.position.z += j; \n\t\tmsh2.position.x = -i * 5; msh2.position.y = -1; msh2.position.z += -j;\n\n\t\tscene.add(msh);\n\t\tscene.add(msh2);\n\n\t\tj++;\n\t}\n}", "title": "" }, { "docid": "28d2ee14c14b60d3aadc2a2861b01ae9", "score": "0.60845125", "text": "seed() {\n const { height, width } = this;\n let count = 40;\n\n if (bowser.mobile) {\n count = 30;\n } else if (lowEnd) {\n count = 100;\n }\n\n for (let i = 0; i < count; i += 1) {\n this.addEntity(new Particle(width, height, lowEnd));\n }\n }", "title": "" }, { "docid": "4770ef35c22dc3687c9597362bcfdb5f", "score": "0.60837835", "text": "_blockBreakParticles(blok){\n\t\tvar bpos = new vec2(blok.col.position.x + blok.col.size.x / 2, blok.col.position.y + blok.col.size.y / 2);\n\t\tvar s = 6;\n\t\tfor(var i = 4; i > 0; i--){ //right\n\t\t\tvar p = new seekerParticle(bpos.x, bpos.y + Math.random() * tilesize - tilesize / 2, \"#333\", p1);\n\t\t\tp.vel = new vec2(Math.random() * s, 0);\n\t\t\tp.pos = p.pos.plus(p.vel.multiply(2));\n\t\t\tparticles.push(p);\n\t\t\tp.seekspeed = 2;\n\t\t}\n\t\tfor(var i = 4; i > 0; i--){ //left\n\t\t\tvar p = new seekerParticle(bpos.x, bpos.y + Math.random() * tilesize - tilesize / 2, \"#333\", p1);\n\t\t\tp.vel = new vec2(Math.random() * -s, 0);\n\t\t\tp.pos = p.pos.plus(p.vel.multiply(2));\n\t\t\tparticles.push(p);\n\t\t\tp.seekspeed = 2;\n\t\t}\n\t\tfor(var i = 4; i > 0; i--){ //down\n\t\t\tvar p = new seekerParticle(bpos.x + Math.random() * tilesize - tilesize / 2, bpos.y, \"#333\", p1);\n\t\t\tp.vel = new vec2(0, Math.random() * s);\n\t\t\tp.pos = p.pos.plus(p.vel.multiply(2));\n\t\t\tparticles.push(p);\n\t\t\tp.seekspeed = 2;\n\t\t}\n\t\tfor(var i = 4; i > 0; i--){ //up\n\t\t\tvar p = new seekerParticle(bpos.x + Math.random() * tilesize - tilesize / 2, bpos.y, \"#333\", p1);\n\t\t\tp.vel = new vec2(0, Math.random() * -s);\n\t\t\tp.pos = p.pos.plus(p.vel.multiply(2));\n\t\t\tparticles.push(p);\n\t\t\tp.seekspeed = 2;\n\t\t}\n\t}", "title": "" }, { "docid": "4f8288ab2b309e6361ec0ce3181f2ead", "score": "0.60467905", "text": "function setup() {\n noFill();\n\n // Defines the simulator's layout as well as \"canWidth\", \"canHeight\"\n makeLayout();\n\n var topLeft = new Point( 0, 0 );\n var topRight = new Point( canWidth, 0 );\n var botRight = new Point( canWidth, canHeight/2-thickness );\n var botLeft = new Point( 0, ( canHeight/2-thickness ) );\n\n //Relative to parent coordinate\n\n containers[\"outside\"] = new Container(topLeft, topRight, botRight, botLeft, containerProperties[\"outside\"][\"color\"],\"outside\");\n //containers[\"outside\"].draw();\n\n\n var topLeft = new Point( 0, 0 );\n var topRight = new Point( canWidth, 0 );\n var botRight = new Point( canWidth, canHeight/2 );\n var botLeft = new Point( 0, canHeight/2 );\n UIBoxs[0] = new UIBox( topLeft, topRight, botRight, botLeft );\n UIBoxs[0].draw();\n\n var topLeft = new Point( 0, canHeight/2+thickness );\n var topRight = new Point( canWidth, canHeight/2+thickness );\n var botRight = new Point( canWidth, canHeight );\n var botLeft = new Point( 0, canHeight );\n\n containers[\"inside\"] = new Container(topLeft, topRight, botRight, botLeft, containerProperties[\"inside\"][\"color\"],\"inside\");\n //containers[\"inside\"].draw();\n\n var topLeft = new Point( 0, canHeight/2 );\n var topRight = new Point( canWidth, canHeight/2 );\n var botRight = new Point( canWidth, canHeight );\n var botLeft = new Point( 0, canHeight );\n UIBoxs[1] = new UIBox( topLeft, topRight, botRight, botLeft );\n UIBoxs[1].draw();\n\n for (var location in particles) {\n for (var particle in particles[location]) {\n xRange = containers[location].tr.x - containers[location].tl.x - 100;\n yRange = containers[location].br.y - containers[location].tr.y - 100;\n var amount = particlesProperties[particle][location];\n for (var i=0; i<amount; i++) {\n velocities = velocityRange;\n var x_vel = Math.floor(Math.random() * (velocities.length-1)) + 0;\n var y_vel = Math.floor(Math.random() * (velocities.length-1)) + 0;\n var velocity = createVector(velocities[x_vel],velocities[y_vel]);\n // Get random location\n randomX = containers[location].tl.x + particlesProperties[particle][\"radius\"] + (Math.floor(Math.random() * xRange));\n randomY = containers[location].tl.y + particlesProperties[particle][\"radius\"] + (Math.floor(Math.random() * yRange));\n particles[location][particle].push(new factory[particle](randomX,randomY,particlesProperties[particle][\"radius\"],velocity, true));\n }\n }\n }\n makeUIs();\n GHKFormula()\n}", "title": "" }, { "docid": "506d8919ceaa96f8a4786ca5ae1937db", "score": "0.6042969", "text": "function setup() {\r\n createCanvas(canvasWidth, canvasHeight)\r\n background(black)\r\n\r\n // Repeat the following sets 10 times\r\n // - Create a new partile in the center of the screen\r\n // - Add it to the list\r\n for (let i = 0; i < 10; i = i + 1) {\r\n let newParticle = new Particle(centerX, centerY)\r\n particles.push(newParticle)\r\n }\r\n}", "title": "" }, { "docid": "031d56b3401d22c92e86e394c6a6cec2", "score": "0.6042398", "text": "function setup() {\n createCanvas(window.innerWidth, window.innerHeight);\n\n const count = Math.floor(window.innerWidth / 8);\n for (let i = 0; i < count; i++) {\n particles.push(new Particle());\n }\n}", "title": "" }, { "docid": "75fc3ff83ee6622f459df1581c84b0ce", "score": "0.6041845", "text": "function init(){\n particleArray = [];\n\n for(let y=0 , y2 = textCoordinates.height; y < y2; y++){\n for(let x = 0, x2 = textCoordinates.width; x< x2 ; x++){\n if(textCoordinates.data[(y * 4 * textCoordinates.width) + (x * 4) + 4] > 128){\n let positionX = x + adjustX;\n let positionY = y + adjustY;\n particleArray.push(new Particle(positionX * 2.2 ,positionY *2.2));\n }\n }\n }\n /*for(let i = 0; i < 500; i++){\n let x = Math.random() * canvas.width;\n let y = Math.random() * canvas.height;\n particleArray.push(new Particle(x , y));\n }\n //particleArray = [];\n //particleArray.push(new Particles(50, 50));*/\n}", "title": "" }, { "docid": "37c110ec269d23f26c427653a6042ddb", "score": "0.6028897", "text": "function createExplosion(x, y, color, text)\n\t{\n\t\tvar count = 8;\n\t\t\n\t\tfor (var i=0; i<count; i++)\n\t\t{\n var angle = i*360/count;\n\t\t\tvar particle = new Particle();\n\t\t\t\n\t\t\tparticle.x = x;\n\t\t\tparticle.y = y;\n\t\t\t\n // size of particle\n\t\t\tparticle.radius = 5;\n\t\t\t\n\t\t\tparticle.color = color;\n\t\t\t\n // life time, the higher the value the faster particle \n // will die\n\t\t\tparticle.scaleSpeed = 1.5;//randomFloat(0.3, 0.5);\n \n // use gravity\n particle.useGravity = false;\n\t\t\t\n\t\t\tvar speed = 100;\n\t\t\t\n\t\t\tparticle.velocityX = speed * Math.cos(angle * Math.PI / 180.0);\n\t\t\tparticle.velocityY = speed * Math.sin(angle * Math.PI / 180.0);\n\t\t\t\n\t\t\tparticles.push(particle);\n\t\t}\n\t\t// text 'particle'\n\t\t// because it was easier than creating a whole new system ;)\n \tvar ptext = new Particle();\n\t\tptext.x = x;\n\t\tptext.y = y;\n\t\tptext.color = color;\n\t\tptext.text = text;\n\t\tptext.velocityX = 0;\n\t\tptext.velocityY = -50;\n\t\tptext.scaleSpeed = 1.5;\n\t\tptext.useGravity = false;\n\t\tparticles.push(ptext);\n\t}", "title": "" }, { "docid": "150368fc5770b46d79268c431572d22b", "score": "0.60280496", "text": "constructor(direz,nPf,x,y,dim,rx1,ry1,rx2,ry2,dx,dy) {\n this.direz = direz || 1;\n \tthis.particles = [];\n \tthis.nPf = nPf || 2;\n this.x = x || width/2;\n this.y = y || height-100;\n this.dim = dim || 4;\n this.rx1 = rx1 || -5 * this.direz;\n this.rx2 = rx2 || -1 * this.direz;\n this.ry1 = ry1 || 0.2 * this.direz;\n this.ry2 = ry2 || -0.2 * this.direz;\n this.s = this.dim * 2 * this.direz;\n // this.dx = dx || this.dim / 5 * this.direz; // per creare prospettiva con diverse dim\n this.dx = dx || width / 60 * this.direz; // per creare prospettiva con diverse dim\n // this.dx = dx || random(1); // per sfalsare\n // this.dx = dx || 1; // tutti uguali\n // this.dx = dx || 0; // tutti fremi\n this.dy = dy || 0;\n this.sparabile = true;\n this.sparato = false;\n }", "title": "" }, { "docid": "d3a05452c405b632755fabec49ce22eb", "score": "0.60123444", "text": "function init() {\n particlesArray = [];\n\n //let the number of particles existing be dependent on the canvas dimensions. \n let numberOfParticles = (canvas.height * canvas.width) / 9000;\n\n //create the individual particles, randomly assign their properties, and push\n //them into the particles array.\n \n for (let i = 0; i < numberOfParticles; i++) {\n\n //VARIABLE ME FOR CLASS\n // let size = (Math.random() * 0.1) + 0.8;\n let size = 0;\n\n\n let x = (Math.random() * ((innerWidth - size * 2) - (size * 2)) + size * 2);\n let y = (Math.random() * ((innerHeight - size * 2) - (size * 2)) + size * 2);\n \n //VARIABLE ME (multipliers here dictate the velocity around the canvas)\n let directionX = (Math.random() * 0.25);\n let directionY = (Math.random() * 0.7);\n let color = '#ECFDFD';\n\n particlesArray.push(new Particle(x, y, directionX, directionY, size, color));\n }\n}", "title": "" }, { "docid": "9adf1e801f5beb9b13b9c9d19e0d8ea6", "score": "0.600142", "text": "function createSimultaneousParticles(disObj) {\r\n\t let dimensions = getVisibleDimensions(disObj.elem, disObj.container);\r\n\t let pos = dimensions.boundingRect;\r\n\t\r\n\t let screenshotData = getAllImageData(disObj);\r\n\t\r\n\t disObj.particleArr[0] = {\r\n\t \"startTime\": Date.now(),\r\n\t \"myParticles\": []\r\n\t };\r\n\t\r\n\t // Process the pixels\r\n\t if(screenshotData) {\r\n\t for(let i = 0; i < screenshotData.length; i += 4) {\r\n\t // Do it every once in a while\r\n\t if(disObj.count % disObj.particleReductionFactor === 0) {\r\n\t let worldX = pos.left + (i / 4) % dimensions.width;\r\n\t let worldY = pos.top + Math.floor((i / 4) / dimensions.width);\r\n\t\r\n\t let colorData;\r\n\t if(disObj.particleColor.length > 0) {\r\n\t colorData = disObj.particleColor;\r\n\t } else {\r\n\t colorData = screenshotData.slice(i, i + 4);\r\n\t }\r\n\t\r\n\t // Create a particle of the given pixel color at the given location\r\n\t createParticle(disObj, worldX - pos.left, worldY - pos.top, worldX, worldY, colorData, 0);\r\n\t }\r\n\t disObj.count++;\r\n\t }\r\n\t } \r\n\t}", "title": "" }, { "docid": "a12bf86cea562efd4494eb99f5010fdf", "score": "0.59919983", "text": "static function OnCreatePlaygroundParticles (playgroundParticles : PlaygroundParticles) {\n\t\tplaygroundParticles.playgroundCache = new PlaygroundCache();\n\t\tplaygroundParticles.paint = new PaintObject();\n\t\tplaygroundParticles.states = new List.<ParticleState>();\n\t\tplaygroundParticles.colliders = new List.<PlaygroundCollider>();\n\t\tplaygroundParticles.particleSystemId = Playground.particlesQuantity;\n\t\t\n\t\tplaygroundParticles.playgroundCache.size = new float[playgroundParticles.particleCount];\n\t\tplaygroundParticles.playgroundCache.size = Playground.RandomFloat(playgroundParticles.playgroundCache.size.Length, playgroundParticles.sizeMin, playgroundParticles.sizeMax);\n\t\t\n\t\tplaygroundParticles.previousParticleCount = playgroundParticles.particleCount;\n\t\tplaygroundParticles.lifetimeSize = new AnimationCurve(Keyframe(0,1), Keyframe(1,1));\n\t\t\n\t\tplaygroundParticles.shurikenParticleSystem.Emit(playgroundParticles.particleCount);\n\t\tplaygroundParticles.shurikenParticleSystem.GetParticles(playgroundParticles.particleCache.particles);\n\t\tfor (var p = 0; p<playgroundParticles.particleCache.particles.Length; p++) {\n\t\t\tplaygroundParticles.particleCache.particles[p].size = playgroundParticles.playgroundCache.size[p];\n\t\t}\n\t\t\n\t\tPlaygroundParticles.SetParticleCount(playgroundParticles, playgroundParticles.particleCount);\n\t\t\n\t\tif (Playground.reference!=null) {\n\t\t\tPlayground.particlesQuantity++;\n\t\t\tPlayground.reference.particleSystems.Add(playgroundParticles);\n\t\t\tplaygroundParticles.particleSystemId = Playground.particlesQuantity;\n\t\t}\n\t}", "title": "" }, { "docid": "088615c4f1293b9b7054b2835d6a6022", "score": "0.5973614", "text": "function init_snow(canvas, width, height)\n{\n\n\tsnow_buffer = document.createElement('canvas');\n\tsnow_buffer.width = width;\n\tsnow_buffer.height = height;\n\tctx = snow_buffer.getContext(\"2d\");\n\n\tfor (var i = 0; i < flakeCount; i++)\n\t{\n\t\tvar x = Math.floor(Math.random() * snow_buffer.width);\n\t\tvar y = Math.floor(Math.random() * snow_buffer.height);\n\t\tvar size = (Math.random() * 3) + 2;\n\t\tvar speed = (Math.random() * 1) + 0.5;\n\t\tvar opacity = (Math.random() * 0.5) + 0.3;\n\n\t\tflakes.push(\n\t\t{\n\t\t\tspeed : speed,\n\t\t\tvelY : speed,\n\t\t\tvelX : 0,\n\t\t\tx : x,\n\t\t\ty : y,\n\t\t\tsize : size,\n\t\t\tstepSize : (Math.random()) / 30,\n\t\t\tstep : 0,\n\t\t\tangle : 180,\n\t\t\topacity : opacity\n\t\t});\n\t}\n\n\tsnow();\n\n\tcanvas.addEventListener(\"mousemove\", function(e)\n\t{\n\t\tvar main_canvas = document.getElementById('the_canvas');\n\t\tvar rect = main_canvas.getBoundingClientRect();\n\n\t\tmX = e.clientX - rect.left;\n\t\tmY = e.clientY - rect.top;\n\t});\n\n}", "title": "" }, { "docid": "3cf55e3dc1a03995d6c74faa32ad1c2d", "score": "0.5971006", "text": "function snowAnimation(volume) {\n $(\"#snow\").empty();\n while (volume > 0) {\n let left = Math.floor(Math.random() * 9) * 10;\n let top = Math.floor(Math.random() * 3) * 10 - 20;\n let src =\n Math.floor(Math.random() * 2) == 1\n ? \"src/assets/snowFlake.png\"\n : \"src/assets/snowFlake2.png\";\n $(\"#snow\").append(\n $(\"<img>\", { src: src, width: \"5%\" })\n .css({ top: top + \"%\", left: left + \"%\", position: \"absolute\" })\n .animate(\n {\n top: \"100%\"\n },\n (100 / 9.8) * 1000\n )\n );\n volume--;\n }\n}", "title": "" }, { "docid": "8dd963cbafb89b50edfd89e83dd0a567", "score": "0.59643394", "text": "function globes() {\n for (i=0;i<20;i++) {\n particles[i] = new Particle(random(840),random(280,560), \n random(1,4));\n }\n}", "title": "" }, { "docid": "458c41fdb8a01d5bb9607a1844624d98", "score": "0.5962007", "text": "function drawParticles()\n {\n // Render each particle in the particle array\n for(var i = 0; i < particles.length; i++)\n {\n var particle = particles[i];\n canvasContext.beginPath();\n //applies the colour to the fillStyle\n canvasContext.fillStyle = particle.color;\n //creates the arc to be drawn as the particle to the screen\n canvasContext.arc(particle.x, particle.y, particle.radius, Math.PI*2, false);\n //draws the particle to the canvas\n canvasContext.fill();\n //resets the canvas fill style to stop the colour from applying to the text\n canvasContext.fillStyle = \"rgba(0,0,0,1)\";\n //applies physics to the particles\n f(particle);\n bounce(particle);\n speedCap(particle, 1);\n particle.x += particle.vx;\n particle.y += particle.vy;\n //counts down the death timer of each particle and removes it if it goes below 0\n particle.lifeSpan -= 10;\n if(particle.lifeSpan < 0)\n {\n particles.splice(i,1);\n }\n\n }\n }", "title": "" }, { "docid": "2feed256d35448ce387fdb41622f167d", "score": "0.5952231", "text": "function Animate() {\n\n var canvas;\n var context;\n\n var width;\n var height;\n\n var oX;\n var oY;\n\n var v = 2;\n var obj_max = 10;\n\n var max = 20;\n var amax = 0;\n\n var firstParticle;\n\n var interval;\n\n this.initialize = function() {\n canvas = document.getElementById(\"canvas\");\n context = canvas.getContext('2d');\n\n width = document.getElementById('contentBody').offsetWidth\n if(width<=480)\n height = 2154\n else{\n height = document.getElementById('content').offsetHeight\n }\n\n oX = width / 2;\n oY = 0;\n\n canvas.width = width;\n canvas.height = height;\n\n createParticles();\n\n window.addEventListener('resize', resizeWindow, false);\n\n //Set interval - Bad! - I know!\n var interval = setInterval(Update, 16);\n }\n\n var createParticles = function() {\n\n var sr = 200;\n var vr = 0.5;\n\n firstParticle = new Particle();\n var p = firstParticle;\n\n //Detect browser, get pixels for vertical radius of particle changes\n var browser;\n\n var browserDetect = function() {\n if (bowser.msie) {\n browser = 80\n } else if (bowser.msedge) {\n browser = 80\n } else if (bowser.android) {\n browser = 20\n } else if (bowser.ios) {\n browser = 20\n } else if (bowser.chrome) {\n browser = 60\n } else if (bowser.opera) {\n browser = 200\n } else if (bowser.safari) {\n browser = 100\n } else {\n browser = 40\n } \n }\n\n browserDetect();\n\n //Detect operating system, get pixels for starting radius of particles\n var userOS;\n\n var osDetect = function() {\n if (bowser.mac) {\n userOS = 20\n } else if (bowser.windows) {\n userOS = 60\n } else if (bowser.windowsphone) {\n userOS = 40\n } else if (bowser.linux) {\n userOS = 100\n } else if (bowser.chromeos) {\n userOS = 80\n } else if (bowser.android) {\n userOS = 50\n } else if (bowser.ios) {\n userOS = 30\n } else {\n userOS = 70\n } \n }\n\n osDetect();\n\n var i;\n for (i = 0; i < max; i++) {\n p.ang = i * max;\n p.vang = 1;\n p.r = userOS;\n //vr is vertical radius of particles\n p.vr = browser;\n p.x = oX;\n p.y = oY;\n\n if (i != max - 1) {\n p.next = new Particle();\n p = p.next;\n }\n }\n }\n\n //Point class.\n var Particle = function() {\n this.ang;\n this.vang;\n this.r;\n this.vr;\n this.x;\n this.y;\n this.next; //Child\n }\n\n var Update = function() {\n\n var count = 0;\n var p = firstParticle;\n\n while (p) {\n count++;\n\n if (p.r > 4000) {\n\n p = p.next;\n continue;\n\n }\n\n var ran = Math.random();\n\n if (ran < 0.2) {\n\n p.vang = 0;\n p.vr = v;\n\n } else if (ran < 0.4) {\n\n p.vang = -v;\n p.vr = 0;\n\n } else if (ran < 0.07) {\n\n p.vang = v;\n p.vr = 0;\n\n } else if (ran < 0.09 && amax < obj_max) {\n var newP = new Particle();\n newP.ang = p.ang;\n\n if (p.ang == 0) {\n newP.vang = 0;\n } else {\n newP.vang = (Math.random() < 50) ? -1 : 1;\n }\n\n newP.r = p.r;\n\n if (p.vang == 0) {\n\n newP.vr = 100;\n } else {\n\n newP.vr = 0;\n }\n\n newP.x = p.x;\n newP.y = p.y;\n\n newP.next = p.next;\n p.next = newP;\n\n }\n\n var r = p.ang + p.vang;\n p.r = p.r + p.vr;\n\n var ang = Math.PI / 120 * r;\n\n var ax = p.r * Math.cos(ang);\n //console.log(ax);\n var ay = p.r * Math.sin(ang);\n\n var rr = Math.sqrt(ax * ax + ay * ay);\n\n var anga = Math.PI / 120 * (r - (r - p.ang) / 2);\n\n var px = rr * Math.cos(anga);\n var py = rr * Math.sin(anga);\n\n\n //Get date, convert to 12hr, and bind to variable \"colour\", then initialize\n var d = new Date();\n var hour = d.getHours() / 2;\n var colour;\n\n var randomColour = function() {\n if (hour <2) {\n colour = \"224, 42, 55,\"\n } else if (hour <4) {\n colour = \"0, 32, 51,\"\n } else if (hour <6) {\n colour = \"212, 218, 224,\"\n } else if (hour <8) {\n colour = \"224, 42, 55,\"\n } else if (hour <10) {\n colour = \"0, 32, 51,\"\n } else {\n colour = \"212, 218, 224,\"\n } \n }\n randomColour();\n //Start drawing\n\n context.beginPath();\n context.strokeStyle = 'rgba(' + colour + '0.1)';\n context.moveTo(p.x, p.y);\n context.quadraticCurveTo(px + oX, py + oY, ax + oX, ay + oY);\n context.stroke();\n context.closePath();\n\n if (p.r > 20) {\n context.beginPath();\n context.fillStyle = 'rgba(' + colour + '0.5)';\n context.arc(px + oX, py + oY, 1, 0, 2*Math.PI, false);\n context.fill();\n context.closePath();\n }\n p.x = ax + oX;\n p.y = ay + oY;\n p.ang = r;\n p = p.next;\n\n }\n amax = count;\n\n }\n\n //Clear the screen on window resize \n var resizeWindow = function(e) {\n e.preventDefault();\n context.fillStyle = 'rgba(247, 251, 254, 1.0)';\n context.beginPath();\n context.rect(0, 0, width, height);\n context.closePath();\n context.fill(); \n width = document.getElementById('contentBody').offsetWidth\n if(width<=480)\n height = 2154\n else{\n height = document.getElementById('content').offsetHeight\n }\n canvas.width = width;\n canvas.height = height;\n\n oX = width / 2;\n oY = 0;\n //Restart!\n createParticles();\n }\n}", "title": "" }, { "docid": "5f23f4d2d01dafd995aff4af74a00bab", "score": "0.59503627", "text": "function initParticles() {\n var scene = threeLayer.getScene();\n var loader = new THREE.TextureLoader();\n\n particleGroup = new SPE.Group({\n type: SPE.distributions.SPHERE,\n texture: {\n value: loader.load('../textures/cloud.png')\n },\n blending: THREE.NormalBlending,\n maxParticleCount: 5000,\n scale: 200000,\n fog: false\n });\n\n emitter = new SPE.Emitter({\n particleCount: 100,\n maxAge: {\n value: 10,\n },\n position: {\n value: new THREE.Vector3(0, 0, 0),\n spread: new THREE.Vector3(1500, 0, 0),\n distribution: SPE.distributions.SPHERE,\n radiusScale: new THREE.Vector3(1, 1, 0),\n randomise: true\n },\n direction: -1,\n size: {\n value: 80\n },\n opacity: {\n value: [0, 0.5, 0.2]\n },\n color: {\n value: new THREE.Color(1, 1, 1),\n spread: new THREE.Color(0.1, 0.1, 0.1)\n }\n });\n\n particleGroup.addEmitter(emitter);\n\n particleGroup.mesh.position.set(-27589453.947005168, -16645787.262404276, 0);\n\n scene.add(particleGroup.mesh);\n}", "title": "" }, { "docid": "6f3a3c79fe4dd87dca1b80959b1177d2", "score": "0.5934297", "text": "_spawnParticles (x, y) {\n // const { colors } = this.props;\n const length = this._particles.length;\n const colors = this.props.wowMode\n ? values(this.props.colors).map(toHex)\n : [toHex(this.props.cursorColor)];\n const numParticles = PARTICLE_NUM_RANGE();\n for (let i = 0; i < numParticles; i++) {\n const colorCode = colors[i % colors.length];\n const r = parseInt(colorCode.slice(1, 3), 16);\n const g = parseInt(colorCode.slice(3, 5), 16);\n const b = parseInt(colorCode.slice(5, 7), 16);\n const color = [r, g, b];\n this._particles.push(this._createParticle(x, y, color));\n }\n if (length === 0) {\n window.requestAnimationFrame(this._drawFrame);\n }\n }", "title": "" }, { "docid": "9d74731d05fc8bf51f6252b182cc66e2", "score": "0.5932026", "text": "function generateConfetti() {\n const container = document.createElement('div');\n container.setAttribute('id', 'pinataConfettiContainer');\n container.style.position = 'absolute';\n container.style.top = \"0\";\n container.style.left = \"0\";\n for (let i = 0; i < 400; i++) {\n let t = 1 + .01*rand(0, 100);\n // Creating the confetti as the specified element type\n const element = document.createElement('div');\n\n element.setAttribute(\"class\", 'particle');\n element.style.transform = \"translate(\" + rand(0, 100) + \"vw, \" + rand(0, 100) + \"vh)\";\n element.style.background = \"hsl(\" + rand(0, 360) + \", 100%, 65%)\";\n element.style.animationDuration = t + \"s\";\n element.style.animationDelay = -0.1*rand(0, 100)*t + \"s\";\n // Inserts the confetti into the container\n container.appendChild(element);\n }\n\n document.getElementById(pinataModalBoxId).appendChild(container);\n}", "title": "" }, { "docid": "13083e2a1447c85bbda346119d8e4e5a", "score": "0.59289396", "text": "function Snow() {\n\t\tthis.canvas = document.createElement('canvas');\n\t\tthis.canvas.id = 'snow';\n\t\tthis.canvas.className = 'background';\n\t\tthis.canvas.style.background = defaultBgColor;\n\t\tdocument.body.insertBefore(this.canvas, document.body.firstElementChild);\n\n\t\tthis.flakes = [];\n\t\tthis.ctx = this.canvas.getContext('2d');\n\t\tthis.flakeCount = 300;\n\t\tthis.mX = -100,\n\t\tthis.mY = -100\n\n\t\tthis.width = this.canvas.width = window.innerWidth;\n\t\tthis.height = this.canvas.height = window.innerHeight;\n\n\t\tthis._init1();\n\t}", "title": "" }, { "docid": "c941e89f82c58d2f32a34c436ea0f9ae", "score": "0.5920191", "text": "initialize() {\n const pw = this.imageWidth || 30;\n const ph = this.imageHeight || 30;\n for (let i = 0; i < this.num; ++i) {\n this._particles.push(new FanfareParticle({\n /* Start anywhere along the bottom of the screen */\n xmin: 0,\n xmax: this._host.width - pw,\n ymin: this._host.height - ph - 60,\n ymax: this._host.height - ph,\n /* Ease through [0, 1, 0, -1, 0] over 80 ticks; using a random starting\n * location through the ease */\n dxFunc: function(t, dx) {\n return 4 * Math.sin((t % 80) / 80 * 2 * Math.PI + this.seed);\n },\n /* Particles gradually move upwards */\n dyrange: [-1, 1],\n dvyrange: [-0.15, 0],\n /* Random starting ease */\n seed: Math.random() * 2 * Math.PI,\n image: this._image,\n canvasWidth: this._host.width,\n canvasHeight: this._host.height,\n /* Particles last much longer than usual */\n lifeTick: 0.005,\n /* Ignore the borders */\n borderAction: FanfareParticle.BORDER_DEFAULT\n }));\n }\n }", "title": "" }, { "docid": "05ec8bb00b2b2155d4c380b6211233d9", "score": "0.59163713", "text": "createParticle() {\n p5.noStroke();\n p5.fill('rgba(200,169,169)');\n p5.circle(this.x, this.y, this.r);\n }", "title": "" }, { "docid": "05ec8bb00b2b2155d4c380b6211233d9", "score": "0.59163713", "text": "createParticle() {\n p5.noStroke();\n p5.fill('rgba(200,169,169)');\n p5.circle(this.x, this.y, this.r);\n }", "title": "" }, { "docid": "1715cf0260921d89f96159c93a441a2a", "score": "0.5903424", "text": "ParticleSystem(){\n }", "title": "" }, { "docid": "f979a8dc240f75cd6612524816c40788", "score": "0.59019494", "text": "_breakParticles(){\n\t\tfor(var i = 12; i > 0; i--){\n\t\t\tvar p = new particle(this.pos.x, this.pos.y, \"#00a\");\n\t\t\tp.vel = this.aimDir.multiply(Math.random() * 5 + 3);\n\t\t\tp.vel = p.vel.plus(new vec2((Math.random() - .5) * 3, 3 * (Math.random() - .5)));\n\t\t\t//p.vel = p.vel.plus(new vec2(this.vel.x, 0));\n\t\t\tp.pos = p.pos.plus(p.vel.multiply(3));\n\t\t\tparticles.push(p);\n\t\t}\n\t}", "title": "" }, { "docid": "bab29de0d6580e4c71833275e1452cd4", "score": "0.58972967", "text": "function playButtonClick() {\n breakSound.play();\n challengeCompleteSound.play();\n\n for (let i = 0; i < 6; i++) {\n let particle = new HexBreakParticleSystem(374 + (i - 2.5) * 80, 330, i, i, i);\n hexBreakParticles.push(particle);\n app.stage.addChild(particle);\n }\n}", "title": "" }, { "docid": "666f9150005d3f50e42753509a866686", "score": "0.5872684", "text": "createParticleBg() {\r\n noStroke();\r\n var r = random(255); // r is a random number between 0 - 255\r\n var g = random(100,200); // g is a random number betwen 100 - 200\r\n var b = random(100); // b is a random number between 0 - 100\r\n var a = random(200,255); // a is a random number between 200 - 255\r\n fill(r, g, b, a);\r\n //noFill();\r\n circle(this.x,this.y,this.r);\r\n }", "title": "" }, { "docid": "a831a104840c6599560a0ea2071e0486", "score": "0.58700997", "text": "addParticleSupershape (num, where) {\r\n const amnt = TWO_PI / num;\r\n const a = 1;\r\n const b = 1;\r\n const m = 5;\r\n const n1 = 0.14;\r\n const n2 = 1.7;\r\n const n3 = 1.7;\r\n\r\n for (let i = 0; i < TWO_PI; i+= amnt) {\r\n let force = p5.Vector.fromAngle(i);\r\n force.mult(this.supershape(i, a, b, m, n1, n2, n3));\r\n \r\n this.particleRandomly(where, force);\r\n }\r\n }", "title": "" }, { "docid": "8131bc79a94195d191c8effb201441fd", "score": "0.58642274", "text": "function draw() {\n ctx.clearRect(0, 0, W, H)\n\n ctx.fillStyle = 'rgba(221, 191, 218, 0.8)'\n ctx.beginPath()\n for (let i = 0; i < mp; i++) {\n const p = particles[i]\n ctx.moveTo(p.x, p.y)\n ctx.arc(p.x, p.y, p.r, 0, Math.PI * 2, true)\n }\n ctx.fill()\n update()\n }", "title": "" }, { "docid": "b1157573c163828799679643e1a22427", "score": "0.5860806", "text": "function draw() {\n\n // Go through all of the particles and draw them.\n particles.forEach(function(particle) {\n particle.draw();\n });\n}", "title": "" }, { "docid": "dc4cabab9fa41656147e4a5e2233b509", "score": "0.58554727", "text": "function createFirework() {\n createParticle();\n }", "title": "" }, { "docid": "f915abd934bac81520e39b0eca8e1a37", "score": "0.58487487", "text": "function snow(x,y){\n for(var i=1; i<= 5; i++){\n ellipse(mouseX+random(-5,5), mouseY+random(1,20),random(1,6));\n }\n}", "title": "" }, { "docid": "f6ab64469a84b2235b375092f186e870", "score": "0.5844784", "text": "function setup(){\n\tcreateCanvas(windowWidth, windowHeight); // Create canvas that fills screen\n\n\t// // Create a single ball using the particle object!\n\t// var redColor = random(0, 255);\n\t// var radius = random(50, 100);\n\t// var xCenter = random(radius, width - radius);\n\t// var yCenter = random(radius, height - radius);\n\t// var xVelocity = random(-10, 10);\n\t// var yVelocity = random(-10, 10);\n\t// ball = new Particle(xCenter, yCenter, radius, xVelocity, yVelocity, redColor);\n\n\t// // Fill an array with balls!\n\t// for (var i=0; i<20; i++){\n\t// \tvar redColor = random(0, 255);\n\t// \tvar radius = random(50, 100);\n\t// \tvar xCenter = random(radius, width - radius);\n\t// \tvar yCenter = random(radius, height - radius);\n\t// \tvar xVelocity = random(-10, 10);\n\t// \tvar yVelocity = random(-10, 10);\n\t// \tball = new Particle(xCenter, yCenter, radius, xVelocity, yVelocity, redColor);\n\n\t// \tballArray.push(ball);\n\t// }\n\n\t// Create a new particle group to hold the ball pit\n\tballPit = new ParticleGroup(20);\n}", "title": "" }, { "docid": "d9d4d77a299f3751f8967a3f16cb54c1", "score": "0.58382577", "text": "function drawParticles() {\n // Orb (ellipse) figures that trail, used a for loop to run the code frequently.\n for (var i = 0; i < orbs.length; i++) {\n// Incorporated methods such as move and display for the orbs to move at a constant while being displayed in various colors.\n orbs[i].move();\n orbs[i].display();\n }\n\n if (lvlsflicker) {\n strokeWeight(4);\n stroke(random(255), random(20), 100);\n fill(0);\n push();\n translate(random(width), random(height));\n sphere(random(100), 5, 5);\n pop();\n }\n\n}", "title": "" }, { "docid": "e412b267108b6e1ab1483d00fa1443d9", "score": "0.583562", "text": "function drawParticlesDetails() {\n ctx.fillStyle = \"#000000\";\n ctx.font = \"15px Arial\";\n var text = \"\";\n for (var i = 0; i < 5; i++) {\n if (i == 0) {\n text = \"Heavy: 1\";\n ctx.fillText(text, protonStartingX - 25 + i * particleStartingSeperation, protonStartingY + 45);\n text = \"Charge: +1\";\n ctx.fillText(text, protonStartingX - 25 + i * particleStartingSeperation, protonStartingY + 60);\n } else if (i == 1) {\n text = \"Heavy: 1\";\n ctx.fillText(text, protonStartingX - 25 + i * particleStartingSeperation, protonStartingY + 45);\n text = \"Charge: 0\";\n ctx.fillText(text, protonStartingX - 25 + i * particleStartingSeperation, protonStartingY + 60);\n } else if (i == 2) {\n text = \"Light: 1\";\n ctx.fillText(text, protonStartingX - 25 + i * particleStartingSeperation, protonStartingY + 45);\n text = \"Charge: -1\";\n ctx.fillText(text, protonStartingX - 25 + i * particleStartingSeperation, protonStartingY + 60);\n } else if (i == 3) {\n text = \"Light: 1\";\n ctx.fillText(text, protonStartingX - 25 + i * particleStartingSeperation, protonStartingY + 45);\n text = \"Charge: 0\";\n ctx.fillText(text, protonStartingX - 25 + i * particleStartingSeperation, protonStartingY + 60);\n } else {\n text = \"Light: -1\";\n ctx.fillText(text, protonStartingX - 25 + i * particleStartingSeperation, protonStartingY + 45);\n text = \"Charge: +1\";\n ctx.fillText(text, protonStartingX - 25 + i * particleStartingSeperation, protonStartingY + 60);\n }\n \n \n }\n }", "title": "" }, { "docid": "a54da115093b3660a48ffdd656c8f960", "score": "0.5809166", "text": "function getParticleSystem(){\n //geomerty to render points for particles\n var particleGeo = new t.Geometry();\n var particleMaterial = new t.PointsMaterial({\n color: 0xffffff, \n size: 2,\n map: new t.TextureLoader().load('./assets/particle.jpg'),\n transparent: true,\n blending: t.AdditiveBlending,\n depthWrite: false\n \n });\n \n for(let i =0; i< 2000; i++){\n let point = new t.Vector3(\n (Math.random() -.5) * 100,\n 0, \n (Math.random() -.5) * 100,\n );\n particleGeo.vertices.push(point);\n }\n \n return new t.Points(particleGeo, particleMaterial);\n}", "title": "" }, { "docid": "3c822964e3055a03a26db953aa210afc", "score": "0.58056223", "text": "function renderParticles() {\n context.clearRect(0, 0, width, height);\n for (let i = 0; i < particles.length; i++) {\n const waypoint = waypoints[i];\n const particle = particles[i];\n context.fillStyle = 'red';\n context.fillRect(waypoint[0], waypoint[1], 2, 2);\n context.fillStyle = 'white';\n context.fillRect(particle[0], particle[1], 2, 2);\n }\n}", "title": "" }, { "docid": "6213c2f8c5ef97121747a2bfdd060453", "score": "0.57891226", "text": "function loadParticles(scene){\n\tvar fountain = BABYLOn.Mesh.CreateBox('fountain',1.0,scene);\n\t\n\tvar particleSystem = new BABYLON.ParticleSystem('parts',200,scene);\n\t\n}", "title": "" }, { "docid": "05c25ecf362ca6e3c408d0e8da15d8cd", "score": "0.5776272", "text": "ParticleSystem(x, y){\n this.place.x = x;\n this.place.y = y;\n }", "title": "" }, { "docid": "fcd247059f7fa74df2f702de7112d989", "score": "0.5774511", "text": "function createParticles(x, y) {\n var particleCount = Math.round(random(options.particleMinCount, options.particleMaxCount));\n while(particleCount--) {\n particles.push(new Particle(x, y));\n }\n}", "title": "" }, { "docid": "de69a9c1b1b847bc60bc1c82df3c434a", "score": "0.5771445", "text": "function SkeletonKingParticleClass(){\n\tthis.x = 75;\n\tthis.y = 75;\n\tthis.velX = 5;\n\tthis.velY = -7;\n\tthis.amountOfSmoke = 100;\n\tthis.readyToRemove = false;\n\tthis.cyclesLeft = 300;\n\tthis.myColor;\n\n\tthis.move = function() {\n\t\tthis.cyclesLeft--;\n\n\t\tif(this.cyclesLeft < 0) {\n\t\t\tthis.readyToRemove = true;\n\t\t}\n\n\t\tthis.x += this.velX;\n\t\tthis.y += this.velY;\n\t}\n\n\tthis.draw = function() {\n\t\tcanvasContext.drawImage(greenParticlePic,this.x,this.y);\n\t}\n}", "title": "" }, { "docid": "70423196c48904c99ff2dc54aef8c66d", "score": "0.57677114", "text": "function particleDraw() {\n fill(255);\n ellipse(this.px, this.py, 9, 9);\n}", "title": "" }, { "docid": "a419189028358ac6d8c942deedc9fb6c", "score": "0.57626855", "text": "createParticle(p) {\r\n p.noStroke();\r\n // p.fill('rgba(200,169,169,1)');\r\n p.fill('rgba(0,0,0,1)');\r\n p.circle(this.x, this.y, this.r);\r\n }", "title": "" }, { "docid": "03661c49f1cde63eee5652625d39a818", "score": "0.5757868", "text": "createParticles(){\n const particleGeometry = new THREE.BufferGeometry;\n const particleCount = 5000;\n\n const positions = new Float32Array(particleCount * 3);\n\n for(let i = 0; i < particleCount * 3; i++){\n positions[i] = (Math.random() - 0.5) * 500;\n }\n\n particleGeometry.setAttribute('position', new THREE.BufferAttribute(positions, 3));\n\n const material = new THREE.PointsMaterial({\n size: 0.05\n })\n const particles = new THREE.Points(particleGeometry, material);\n particles.name = \"Stars\";\n this.scene.add(particles);\n }", "title": "" }, { "docid": "aacbcb722740a818516ceeb5621dbc38", "score": "0.5757828", "text": "function createParticles(x1, y1, lifeCycles, speedMult=1.0){\n\t\tif(lifeCycles === undefined){\n\t\t\tlifeCycles = MINCYCLE+Math.random()*CYCLEANCHOR;\n\t\t}\n\t\tfor(var i=0;i<PARTICLESNUM;i++){\n\t\t\tvar particlesClass = new ParticlesTwoClass(speedMult);\n\t\t\tparticlesClass.x=x1;\n\t\t\tparticlesClass.y=y1;\n\n\t\t\tparticlesClass.cyclesLeft=lifeCycles;\n\t\t\tparticleList.push(particlesClass);\n\n\t\t\tif(Math.random()<0.5){\n\t\t\t\tparticlesClass.myColor=\"#ED1313\";//red\n\t\t\t} else {\n\t\t\t\tparticlesClass.myColor=\"#E4E418 \";//yellow\n\t\t\t}\n\t\t\t/*particlesClass.random = Math.random();\n\t\t\tvar interval=particlesClass.random* (0.7 - 0.3) + 0.3;\n\n\t\t\t\tif(particlesClass.random<0.3){\n\t\t\t\t\tparticlesClass.myColor=\"#e8a3e4\";//burnt blue5C5D91\n\t\t\t\t} else if (interval>0.3 && interval<0.7){\n\t\t\t\t\tparticlesClass.myColor=\"#67eaf3\"//burnt redA0372D\n\t\t\t\t} else {\n\t\t\t\t\tparticlesClass.myColor=\"red\"//burnt yellowA0372D\n\t\t\t\t}*/\n\t\t}\n\t}", "title": "" }, { "docid": "68d4dbf46e616db229325f638ffb6402", "score": "0.57570684", "text": "render() {\n return (\n <section className=\"text-center\" id=\"jumbotron\">\n <div className=\"container\">\n <Particles\n className=\"jumbo-animation\"\n params={{\n particles: {\n number: {\n value: 90,\n\n density: {\n enable: false,\n value_area: 1000\n }\n },\n color: {\n value: [\"#1F7A8C\", \"#E3B505\", \"#BFDBF7\"]\n },\n shape: {\n type: [\"circle\", \"polygon\"],\n stroke: {\n width: 0,\n color: \"#ffffff\"\n },\n polygon: {\n nb_sides: 5\n },\n image: {\n src: \"https://ubisafe.org/images/bubble-transparent-6.png\",\n width: 100,\n height: 100\n }\n },\n opacity: {\n value: 0.5,\n random: false,\n anim: {\n enable: false,\n speed: 1,\n opacity_min: 0.1,\n sync: true\n }\n },\n size: {\n value: 10,\n random: false,\n anim: {\n enable: false,\n speed: 9.744926547616142,\n size_min: 0.1,\n sync: true\n }\n },\n line_linked: {\n enable: true,\n distance: 130,\n color: \"#ffffff\",\n opacity: 0.4,\n width: 1\n },\n move: {\n enable: true,\n speed: 6,\n direction: \"top-right\",\n random: false,\n straight: true,\n out_mode: \"out\",\n bounce: false,\n attract: {\n enable: false,\n rotateX: 600,\n rotateY: 1200\n }\n }\n },\n interactivity: {\n detect_on: \"canvas\",\n events: {\n onhover: {\n enable: true,\n mode: \"grab\"\n },\n onclick: {\n enable: true,\n mode: \"push\"\n },\n resize: true\n },\n modes: {\n grab: {\n distance: 400,\n line_linked: {\n opacity: 1\n }\n },\n bubble: {\n distance: 400,\n size: 40,\n duration: 2,\n opacity: 8,\n speed: 3\n },\n repulse: {\n distance: 200,\n duration: 0.4\n },\n push: {\n particles_nb: 4\n },\n remove: {\n particles_nb: 2\n }\n }\n },\n retina_detect: true\n }}\n />\n </div>\n <div className=\"jumbotron\" id=\"jumbo\">\n <div className=\"overlay container\">\n <div className=\"jumbo-heading\">\n <h1 className=\"\" id=\"jumbo-text \">\n Hi, I'm\n <strong className=\"jumbo-name\"> Cian O'Gralaigh</strong> <br />\n and I'm a full-stack web developer.\n </h1>\n </div>\n <div className=\"jumbo-btn-div\">\n <a href=\"#projects\">\n <button type=\"button\" className=\"btn \" id=\"jumbo-button\">\n See My Work {\" \"}\n <FontAwesomeIcon className=\"jumbo-arrow\" icon=\"arrow-right\" />\n </button>\n </a>\n </div>\n </div>\n </div>\n </section>\n );\n }", "title": "" }, { "docid": "4a4606c7d91c3ef586904bdb6216de41", "score": "0.5751363", "text": "_spawnParticles(){\n\t\tif(Math.random() > dt)\n\t\t\treturn;\n\t\tvar p = new seekerParticle(this.pos.x, this.pos.y, \"#c00\", this);\n\t\tp.setRandVel(Math.random() * 3 + 3);\n\t\tp.pos = p.pos.plus(p.vel.multiply(Math.random() + 1));\n\t\tparticles.push(p);\n\t}", "title": "" }, { "docid": "34e32ea8bb07ea51e42ba2da428091a7", "score": "0.57453", "text": "function init() {\n\n //In case it isn't empty for some reason\n particlesArray = [];\n\n //This is to make the number of particles scale up or down with size of the screen\n let numberOfParticles = canvas.width * canvas.height / 9000;\n\n //Will create i number of particles with randomized values and fill up particlesArray\n for (var i = 0; i < numberOfParticles; i++) {\n\n let radius = (Math.random() * 2) + 1;\n let x = (Math.random() * (canvas.width - radius * 4)) + radius * 4;\n let y = (Math.random() * (canvas.height - radius * 4)) + radius * 4;\n let directionX = randomizedSpeed();\n let directionY = randomizedSpeed();\n\n let color = particleColor;\n\n particlesArray.push(new Particle(x, y, directionX, directionY, radius, color));\n }\n\n}", "title": "" }, { "docid": "10ec73dfae3580055fc7abb456d145b1", "score": "0.57388276", "text": "function placeDiv() {\n\t\tfor (var i=1; i<=dots; i+=1) {\n\t\t\tvar isBlack = document.getElementById(i).innerHTML;\n\t\t\tif (isBlack!=='<div class=\"round black\"></div>') {\n\t\t\tdocument.getElementById(i).innerHTML = drawDiv();\n\t\t\t}\n\t\t\n}\t}", "title": "" }, { "docid": "8a5bc77ee775dd5b267dd6f33f06cc20", "score": "0.57337284", "text": "gridStage2() {\n for (let i = 0; i < this.psArray.length; i++) {\n /////////pick up the special ten dots////////////\n if (\n i == 0 ||\n i == 4 ||\n i == 8 ||\n i == 28 ||\n i == 40 ||\n i == 44 ||\n i == 60 ||\n i == 72 ||\n i == 76 ||\n i == 80\n ) {\n ////////save the special dots positions//////////\n this.specialDotsPos.push(this.psArray[i].particle.position);\n\n ////////fade out and delete the ten dots in the grid/////////////\n var targetVector = new Vector2(0, 0);\n this.psArray[i].updateScale(targetVector, 50, 0).onComplete(() => {\n this.scene.remove(targetVector);\n this.scene.remove(this.psArray[i]);\n });\n } else {\n ////////////from right to left column///////////////\n for (let k = 4; k >= -4; k--) {\n setTimeout(() => {\n if (this.psArray[i].pos.x == k * this.gap) {\n let delayTime = 0;\n if (k % 4 != 0) {\n delayTime = Math.abs(this.psArray[i].pos.y) * this.gap;\n } else {\n delayTime = (4 - Math.abs(this.psArray[i].pos.y)) * this.gap;\n }\n //make the particles fade out to 0 after scale up and dowm with random delay time\n var chainB = this.psArray[i].updateScale(\n new Vector2(0, 0),\n 200,\n 0\n );\n //particles start to scale up and down with random delay time\n let targetVector = new Vector2(2, 2);\n this.psArray[i]\n .updateScale(targetVector, 300, delayTime)\n .repeat(1)\n .yoyo(true)\n .chain(chainB)\n .onComplete(() => {\n this.scene.remove(targetVector);\n this.scene.remove(this.psArray[i]);\n });\n\n //update the pos\n var updatePos = new THREE.Vector3(4, 0, 0);\n updatePos.add(this.psArray[i].pos);\n this.psArray[i]\n .updatePos(updatePos, 850, 0)\n .easing(TWEEN.Easing.Sinusoidal.InOut)\n .onComplete(() => {\n this.scene.remove(updatePos);\n });\n }\n }, (4 - k) * 50);\n }\n }\n }\n }", "title": "" }, { "docid": "b0bc771d6c36d452b8d5486323543fec", "score": "0.57295674", "text": "function create_particle()\n{\n\t//Random position on the canvas\n\tthis.x = Math.random()*W;\n\tthis.y = Math.random()*H;\n\t\n\t//Random velocity to each particle\n\tthis.vx = Math.random()*10-5;\n\tthis.vy = Math.random()*10-5;\n\t\n\t//Random colors - kept as white, but found code to make the colors random\n\t// var r = Math.random()*255>>0;\n\t// var g = Math.random()*255>>0;\n\t// var b = Math.random()*255>>0;\n\tthis.color = \"rgba(255, 255, 255, 0.5)\";\n\t\n\t//Random size\n\tthis.radius = Math.random()*5;\n\n}", "title": "" }, { "docid": "9cd7806ba727b22e42eb84ac09e94bcb", "score": "0.5724009", "text": "ParticleSystem(p){\n this.place.x = p.x;\n this.place.y = p.y;\n }", "title": "" }, { "docid": "53ad222af460efc4bf964a6c02b64129", "score": "0.5712909", "text": "function Particle ()\n\t{\n\t\tthis.scale = 1.0;\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t\tthis.radius = 20;\n\t\tthis.color = \"#000\";\n\t\tthis.velocityX = 0;\n\t\tthis.velocityY = 0;\n\t\tthis.scaleSpeed = 0.5;\n\t\tthis.useGravity = false;\n\t\tthis.text = ''; // hello ugly hack!\n \n\t\tthis.update = function(ms)\n\t\t{\n\t\t\t// shrinking\n \n\t\t\tthis.scale -= this.scaleSpeed * ms / 1000.0;\n \n\t\t\tif (this.scale <= 0)\n\t\t\t{\n // particle is dead, remove it\n removeFromArray(particles, this);\n \n\t\t\t}\n\t\t\t\n\t\t\t// moving away from explosion center\n\t\t\tthis.x += this.velocityX * ms/1000.0;\n\t\t\tthis.y += this.velocityY * ms/1000.0;\n \n // and then later come downwards when our\n\t\t // gravity is added to it. We should add parameters \n // for the values that fake the gravity\n if(this.useGravity) {\n this.velocityY += Math.random()*4 +4;\n }\n\t\t};\n\t\t\n\t\tthis.draw = function(ctx)\n\t\t{\n\t\t\tif (this.scale <= 0)\n\t\t\t\treturn;\n\t\t\tif(this.text) {\n\t\t\t\tctx.save();\n\t\t\t\tctx.globalAlpha = this.scale;\n\t\t\t\tctx.font = '10pt Arial';\n\t\t\t\ttextWithShadow(ctx, this.text, this.x, this.y, 1.0, 'White', 'Black');\n\t\t\t\tctx.restore();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// from http://stackoverflow.com/questions/25837158/how-to-draw-a-star-by-using-canvas-html5\n\t\t\t\tvar spikes = 5;\n\t\t\t\tvar outerRadius = 4+4*this.scale;\n\t\t\t\tvar innerRadius = 2+2*this.scale;\n\t\t\t\tvar rot=Math.PI/2*3;\n\t\t\t\tvar cx = this.x;\n\t\t\t\tvar cy = this.y;\n\t\t\t\tvar px=cx;\n\t\t\t\tvar py=cy;\n\t\t\t\tvar step=Math.PI/spikes;\n\n\t\t\t\tctx.save();\n\t\t\t\tctx.globalAlpha = this.scale*2;\n\t\t\t\tctx.strokeStyle=this.color;\n\t\t\t\tctx.beginPath();\n\t\t\t\tctx.moveTo(cx,cy-outerRadius);\n\t\t\t\tfor(i=0;i<spikes;i++){\n\t\t\t\t px=cx+Math.cos(rot)*outerRadius;\n\t\t\t\t py=cy+Math.sin(rot)*outerRadius;\n\t\t\t\t ctx.lineTo(px,py);\n\t\t\t\t rot+=step;\n\n\t\t\t\t px=cx+Math.cos(rot)*innerRadius;\n\t\t\t\t py=cy+Math.sin(rot)*innerRadius;\n\t\t\t\t ctx.lineTo(px,py);\n\t\t\t\t rot+=step;\n\t\t\t\t}\n\t\t\t\tctx.lineTo(cx,cy-outerRadius);\n\t\t\t\tctx.stroke();\n\t\t\t\tctx.closePath();\n\t\t\t\tctx.restore();\n\t\t\t}\n\t\t};\n\t}", "title": "" }, { "docid": "9d4c9a69f3bbd349e7035ed49de45863", "score": "0.5707153", "text": "_jumpParticles(){\n\t\tvar c = this.getCol();\n\t\tfor(var i = 10; i > 0; i -= 1){\n\t\t\tvar p = new particle(c.position.x + Math.random() * c.size.x, c.bottom());\n\t\t\tp.setRandVel(Math.random() * 10, -Math.PI, 0);\n\t\t\tp.vel = p.vel.minus(this.vel);\n\t\t\tp.add();\n\t\t}\n\t}", "title": "" }, { "docid": "77be18399a6cdccf2f4f31e68bf335c3", "score": "0.5701661", "text": "function init() {\n for (let index = 0; index < numberOfParticles; index++) {\n particlesArray.push(new Particle());\n }\n }", "title": "" }, { "docid": "741d37b70f404e897dd8bd620a53dfe8", "score": "0.5699769", "text": "function thirdLevelSetup() {\n\n // climber class\n //\n // To put postion, the size, putting image and the speed\n // This is also to reset the position when the climber goes up\n climber = new Climber(width / 2, 500, 500, 500, 3.5, climbImg, UP_ARROW, DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW);\n\n //Array\n //\n // For the starting platform\n for (let s3 = 0; s3 < numbStartP; s3++) {\n // Starting platform\n //\n //this is a platform for the climber for the start of the game\n // in case all the the random platform doesn't spawn under\n startingPlatPlus = new Platform(width / 2, 700, 2000, 1000, platLongImg);\n\n // push\n //\n // To add the platform as an array\n startingPlat.push(startingPlatPlus);\n }\n\n // Clearing the amount of snow from the last level\n snowFall = [];\n\n // For loop for snow\n //\n // To make the number of snows that will fall\n for (let f3 = 0; f3 < snowNumb; f3++) {\n // random()\n //\n // Making the snow spawn on top of the screen\n let snowX = random(0, width);\n let snowY = random(0, height);\n\n\n // snowFallPlus\n //\n // New snow that will fall\n snowFallPlus = new Snow(snowX, snowY, color(230, 255, 255), 5);\n\n // push()\n //\n // to make array objects for snow\n snowFall.push(snowFallPlus);\n }\n\n // For loop for snow\n //\n // To make the number of snows that will fall\n for (let fT3 = 0; fT3 < snowNumb; fT3++) {\n // random()\n //\n // Making the snow spawn on top of the screen\n let snowX = random(0, width);\n let snowY = random(0, height);\n\n\n // snowFallPlus\n //\n // New snow that will fall\n snowFallPlus = new Snow(snowX, snowY, color(230, 255, 255), 2);\n\n // push()\n //\n // to make array objects for snow\n snowFall.push(snowFallPlus);\n }\n\n // Clearing the amount of avalanche from the previous level\n avalanche = [];\n\n // Avalanche\n //\n // This part will show a falling avalanche\n for (let a3 = 0; a3 < avaNumb; a3++) {\n // random()\n //\n // Making an avalanche spawn randomly at the top screen\n let avalX = random(0, width);\n let avalY = random(0, height);\n\n // avalanchePlus\n //\n // Making avalanche into array\n avalanchePlus = new Avalanche(avalX, avalY, 1000, 500, avalancheImg);\n\n // push()\n //\n // To make more array objects of avalanche\n avalanche.push(avalanchePlus);\n\n\n }\n // To clear the previous platform from the last level\n // and make new ones\n platformShort = [];\n platformLong = [];\n\n // For loop for the second level\n //\n // To make array objects for platform\n //\n // and the z is to differentiate the array from the previous level\n for (let w = 0; w < numbPlat; w++) {\n\n // random()\n //\n // adding position for the platforms\n\n // For the position the short platform\n let reShortXW = random(300, width - 300);\n let reShortYW = random(0, height);\n\n // For the position for long platform\n let reLongXW = random(300, width - 300);\n let reLongYW = random(0, height - 300);\n\n // Platform classes\n //\n // Platform that will be generated in the screen\n platformShortPlusW = new Platform(reShortXW, reShortYW, 500, 500, platShortImg);\n platformLongPlusW = new Platform(reLongXW, reLongYW, 1000, 500, platLongImg);\n\n // push()\n //\n // To add more platform in the screen as an array\n platformShort.push(platformShortPlusW);\n platformLong.push(platformLongPlusW);\n\n }\n}", "title": "" }, { "docid": "6d2bc7d10307308592ed26a8f8eb1617", "score": "0.5696343", "text": "render(props) {\n\n const num = props.num;\n const styleClass = props['style-class'] || '';\n const circles = [];\n\n for (let i = 0; i < num; i++) {\n circles.push({});\n }\n\n return (<div class={`${styleClass}`}>\n {circles.map((c, idx) => {\n\n const _size = (100 / num) * (idx + 1)\n const position = (100 - _size) / 2;\n\n return (<div class={`${styles.mut_sphere} ${styleClass}`} style={`width: ${_size}%; height:${_size}%; top: ${position}%; left: ${position}%; z-index: ${10 - idx }; animation-delay: ${idx * 200}ms;`}></div>);\n })}\n </div>)\n\n }", "title": "" }, { "docid": "d1a47eeb0f26db6778d3d4f8c348a388", "score": "0.56960106", "text": "function play() {\n // Move background sky to make infinitely scrolling background\n sky.tileX -= 1\n\n\n //Loop through all the blocks and check for a collision between\n //each block and the snowman.\n var snowmanVsBlock = iceBlocks.children.some(function(block) {\n let snowmanVsBlockCollisionType = g.rectangleCollision(snowman, block);\n if (snowmanVsBlockCollisionType === \"bottom\") {\n floorLevel = block.gy;\n if (block.type === \"finish\") {\n finish.gotoAndStop(1);\n g.wait(2000, function() {\n g.state = end;\n });\n }\n } else if ((snowmanVsBlockCollisionType === \"right\") && (iceBlocks.vx < 0)) {\n iceBlocks.vx = 0;\n } else if ((snowmanVsBlockCollisionType === \"left\") && (iceBlocks.vx > 0)) {\n iceBlocks.vx = 0;\n }\n });\n\n\n var snowmanVsSnowflake = snowflakes.children.some(function(snowflake) {\n let collisionBoolean = g.hitTestRectangle(snowman, snowflake, true);\n if (collisionBoolean === true) {\n if (snowflake.visible) {\n renderParticles = true;\n snowflake.visible = false;\n } else {\n renderParticles = false;\n }\n }\n });\n\n\n if (renderParticles) {\n if (snowballCount < 5) {\n snowballCount++;\n }\n //Create dust explosion\n g.createParticles(\n snowman.centerX, snowman.centerY, //x and y position\n () => g.sprite(dustFrames), //Particle sprite\n g.stage, //The container to add the particles to \n 40, //Number of particles\n 0.5, //Gravity\n false, //Random spacing\n 3.95, 5.49, //Min/max angle\n 5, 16, //Min/max size\n 1, 2 //Min/max speed\n );\n }\n\n\n // Render snowballs depending on snowman course\n if (snowmanDirection === \"left\") {\n targetX = snowman.x + 40;\n } else {\n targetX = snowman.x - 10;\n }\n targetY = snowman.y + 70;\n\n let index = 0;\n var snowballBounce = snowballs.children.some(function(snowball) {\n snowball.visible = false;\n index++;\n snowball.vx += (targetX - snowball.x) * spring;\n snowball.vy += (targetY - snowball.y) * spring;\n // snowball.vy += gravity * 5;\n snowball.vx *= friction;\n snowball.vy *= friction;\n snowball.x += snowball.vx;\n snowball.y += snowball.vy;\n\n // Update target for next ball running through loop \n if (snowmanDirection === \"left\") {\n targetX = snowball.x + 20;\n } else {\n targetX = snowball.x - 20;\n }\n targetY = snowball.y;\n\n if (index <= snowballCount) {\n snowball.visible = true;\n }\n });\n\n\n var penguinBounce = bouncingPenguins.children.some(function(bPenguin) {\n let penguinVSblock = iceBlocks.children.some(function(iBlock) {\n penguinCollisionType = g.rectangleCollision(bPenguin, iBlock, true);\n if (penguinCollisionType === \"bottom\") {\n bPenguin.floorL = iBlock.y;\n }\n });\n\n if (bPenguin.y < bPenguin.floorL - 150) {\n bPenguin.vy += gravity * 0.2;\n }\n bPenguin.vx = bPenguin.oVx + iceBlocks.vx;\n bPenguin.oX += bPenguin.oVx;\n var temp = numberOfPillars * 48;\n // Make bouncing penguins turn left when they've reached end of course\n if (bPenguin.oX > (numberOfPillars * 48)) {\n bPenguin.oVx = -bPenguin.oVx;\n bPenguin.playAnimation(bouncingLeft);\n }\n g.move(bPenguin);\n });\n\n var snowmanVsBouncePenguin = bouncingPenguins.children.some(function(bPenguin) {\n if (bPenguin.visible === true) {\n let snowmanPenguinCollisionType = g.rectangleCollision(snowman, bPenguin);\n if (snowmanPenguinCollisionType) {\n // Decrease snowball count\n if (snowballCount > 0) {\n snowballCount--;\n }\n // Render hurt snowman for 0.3 sec\n snowman.gotoAndStop(2);\n g.wait(300, function() {\n snowman.gotoAndStop(0);\n });\n }\n }\n\n });\n\n // Skating penguin motion\n skatingPenguin.oX += iceBlocks.vx;\n if (skatingPenguin.x > skatingPenguin.oX + 9 * 64) {\n skatingPenguin.vx = -skatingPenguin.vx;\n skatingPenguin.playAnimation(skatingLeft);\n skatingPenguin.x = skatingPenguin.oX + 9 * 64 - 30;\n } else if (skatingPenguin.x < skatingPenguin.oX) {\n skatingPenguin.vx = -skatingPenguin.vx;\n skatingPenguin.playAnimation(skatingRight);\n skatingPenguin.x = skatingPenguin.oX;\n }\n skatingPenguin.x += skatingPenguin.vx + iceBlocks.vx;\n\n let activePenguinIndex = 0;\n if (skatingPenguin.visible === true) {\n activePenguinIndex++;\n let snowmanVsSkatePenguin = g.rectangleCollision(snowman, skatingPenguin);\n if (snowmanVsSkatePenguin) {\n // Decrease snowball count\n if (snowballCount > 0) {\n snowballCount--;\n }\n // Render hurt snowman for 0.3 sec\n snowman.gotoAndStop(2);\n g.wait(300, function() {\n snowman.gotoAndStop(0);\n });\n }\n }\n\n // Set an upper limit for Y velocity\n // Even if user keeps pressing the up arrow, \n // Y velocity will stop incrementing\n if (snowman.vy > minVelocityY) {\n snowman.vy += snowman.ay;\n }\n\n // Apply gravity only if snowman above floor level\n if (snowman.y < floorLevel - snowman.height) {\n snowman.vy += gravity;\n }\n\n // Attack snowball physics\n if (attackSnowball.attack === false) {\n attackSnowball.x = snowman.centerX + Math.cos(attackSnowball.angle) * attackSnowball.radius;\n attackSnowball.y = snowman.centerY - snowman.halfHeight + Math.sin(attackSnowball.angle) * attackSnowball.radius;\n if (attackSnowball.angle >= 0.785) {\n attackSnowball.w = -attackSnowball.w;\n //attackSnowball.angle += attackSnowball.w;\n } else if (attackSnowball.angle <= -3.926) {\n attackSnowball.w = -attackSnowball.w;\n }\n attackSnowball.angle += attackSnowball.w;\n }\n\n if (attackSnowball.attack === true) {\n g.move(attackSnowball);\n }\n\n var snowballVsBouncePenguin = bouncingPenguins.children.some(function(bPenguin) {\n if (bPenguin.visible === true) {\n activePenguinIndex++;\n }\n // Only if the penguin is active and if snowball has been thrown\n if ((bPenguin.visible === true) && (attackSnowball.attack === true) && (snowballCount >= 0)) {\n let snowballPenguinCollisionType = g.rectangleCollision(attackSnowball, bPenguin);\n if (snowballPenguinCollisionType) {\n bPenguin.visible = false;\n g.createParticles(\n g.canvas.width - 130, 25, //x and y position\n () => g.sprite(dustFrames), //Particle sprite\n g.stage, //The container to add the particles to \n 40, //Number of particles\n 0.5, //Gravity\n false, //Random spacing\n 3.95, 5.49, //Min/max angle\n 5, 10, //Min/max size\n 1, 2 //Min/max speed\n );\n }\n }\n });\n\n let snowballVsSkatePenguin = g.rectangleCollision(attackSnowball, skatingPenguin);\n if (snowballVsSkatePenguin) {\n skatingPenguin.visible = false;\n g.createParticles(\n g.canvas.width - 130, 25, //x and y position\n () => g.sprite(dustFrames), //Particle sprite\n g.stage, //The container to add the particles to \n 40, //Number of particles\n 0.5, //Gravity\n false, //Random spacing\n 3.95, 5.49, //Min/max angle\n 5, 10, //Min/max size\n 1, 2 //Min/max speed\n );\n }\n\n // Update points \n let pIndex = 0;\n if (activePenguinIndex < totalPenguins) {\n pointCount = totalPenguins - activePenguinIndex;\n var updatePoints = points.children.some(function(p) {\n //p.visible = false;\n pIndex++;\n if (pIndex <= pointCount) {\n p.visible = true;\n }\n });\n }\n\n\n // Move snowman\n g.move(snowman);\n\n\n // If we have not reached the finish, move blocks to the \n // left each frame\n if ((finish.gx > 156)) {\n finish.vx = iceBlocks.vx;\n g.move(finish);\n snowflakes.vx = iceBlocks.vx;\n g.move(snowflakes);\n igloo.vx = iceBlocks.vx;\n g.move(igloo);\n g.move(iceBlocks);\n }\n\n // Keep player contained inside the stage area\n // Second argument here any JS object\n g.contain(snowman, {\n x: 32,\n y: 16,\n width: g.canvas.width * 3 / 4,\n height: g.canvas.height\n });\n\n\n\n}", "title": "" }, { "docid": "d9a196d4aa3ba2ce4f0d64433502c677", "score": "0.5695283", "text": "function ParticleFountain(params){\n this.init = function(){\n for(var i = 0; i < this.count; i++){\n this.particles.push(new Particle({'x': this.x, \n 'y': this.y, \n 'context': this.context,\n 'red': this.r+150,\n 'green': this.g+150/2,\n 'blue': this.b+150/2,\n 'direction': this.direction-40+randomInt(80),\n 'speed': (this.speed)+randomInt(3),\n 'ttl': this.ttl + randomInt(30)\n })\n );\n }\n }\n\n this.update = function(){\n for(var i = 0; i < this.count; i++){\n if(this.particles[i].update()){\n var color_mod = randomInt(150);\n this.particles.splice(i, 1);\n this.particles.push(new Particle({'x': this.x, \n 'y': this.y, \n 'context': this.context,\n 'red': this.r+color_mod,\n 'green': this.g+color_mod/2,\n 'blue': this.b+color_mod/2,\n 'direction': this.direction-40+randomInt(80),\n 'speed': (this.speed)+randomInt(3),\n 'ttl': this.ttl + randomInt(30)\n })\n );\n }\n else{\n this.particles[i].draw();\n }\n }\n }\n \n this.update_ex = function(params){\n var cust_dir = params.direction || this.direction;\n var cust_x = params.x || this.x;\n var cust_y = params.y || this.y;\n var cust_create = params.create;\n \n for(var i = 0; i < this.count; i++){\n \n if(this.particles[i].update()){\n this.particles.splice(i, 1);\n var color_mod = randomInt(150);\n this.particles.push(new Particle({'x': this.x, \n 'y': this.y, \n 'context': this.context,\n 'red': this.r+color_mod,\n 'green': this.g+color_mod/2,\n 'blue': this.b+color_mod/2,\n 'direction': this.direction-30+randomInt(60),\n 'speed': this.speed*randomInt(2)+1,\n 'ttl': this.ttl + randomInt(30)\n })\n );\n };\n }\n }\n \n this.ttl = params.ttl || 60;\n this.context = params.context;\n this.direction = params.direction; // degrees\n this.x = params.x;\n this.y = params.y;\n this.count = params.count;\n this.speed = params.speed; // this will be ~randomized\n this.r = params.red;\n this.g = params.green;\n this.b = params.blue;\n this.particles = [];\n this.init();\n}", "title": "" }, { "docid": "d290f96747e4766b6c480b388e28d428", "score": "0.56949264", "text": "function draw() {\n background(backgroundColor);\n particles.forEach((particle, index) => {\n particle.update();\n particle.draw();\n particle.check(particles.slice(index));\n });\n}", "title": "" }, { "docid": "346c2c2152a054082175a89463a83e02", "score": "0.5691519", "text": "_emitParticles() {\n const particleInterval = setInterval(async () => {\n if (!this.spinning) clearInterval(particleInterval);\n\n const particle = new Sprite.from('star');\n particle.name = 'particle';\n particle.anchor.set(0.5);\n \n this._particles.addChild(particle);\n \n gsap.to(particle, { y: window.innerHeight, ease: 'back.in(5)', duration: 2 });\n gsap.to(particle.scale, { x: 0, y: 0, duration: 2 });\n await gsap.to(particle, { \n x: (window.innerWidth * Math.random() + 500) * (Math.random() > 0.5 ? -1 : 1), \n rotation: Math.PI * Math.random() * 4,\n duration: 2\n });\n \n this._particles.removeChild(particle);\n }, 50);\n }", "title": "" }, { "docid": "789f7a45eea8d2e4dfea44af75a3cf1a", "score": "0.56903714", "text": "function create()\n {\n // sets the position of each particle to where the user has clicked\n this.x = clickX;\n this.y = clickY;\n // Add random velocity to each particle\n this.vx = Math.random()*5-2;\n this.vy = Math.random()*5-2;\n \n //Randomised the RGB values of the colours\n var red = Math.random()*255>>0;\n var green = Math.random()*255>>0;\n var blue = Math.random()*255>>0;\n this.color = \"rgba(\"+red+\", \"+green+\", \"+blue+\", 0.5)\";\n \n //applies a random size to the radius of the particle\n this.radius = Math.random()*7;\n \n // adds a lifetime value for the particle\n this.lifeSpan = Math.random()*200;\n\n }", "title": "" }, { "docid": "a77867939a7d2e98bc19ad57e5ca8ab4", "score": "0.56798255", "text": "function createPieces(num) {\r\n\tvar pieces = document.createElement('div');\r\n\tif (pieces.className.indexOf(\"each\") == -1)\r\n\t\tpieces.className += \" \" + \"each\";\r\n\tpieces.index = num;\r\n\tvar top = parseInt(num / 4) * 88;\r\n\tvar left = num % 4 * 88;\r\n\tpieces.style.top = top + 'px';\r\n\tpieces.style.left = left + 'px';\r\n\tpieces.style.backgroundPosition = left * -1 + 'px' + ' ' + top * -1 + 'px';\r\n\treturn pieces;\r\n}", "title": "" }, { "docid": "c7eceb0ab1be46743923e2f2ddbcaa1f", "score": "0.5679127", "text": "function initAllParticles(){\n\n for(var k=0;k<sentence.length;k++){\n var offset = k * 6* edgeSize;\n for(var j=0;j<7;j+=1){\n for(var i=0;i<5;i+=1){\n var particle = new Particle(ctx,Math.round(offsetX+i*edgeSize + offset),offsetY+j*edgeSize);\n memory.push(particle);\n }\n }\n }\n console.log(memory.length);\n}", "title": "" }, { "docid": "65b256a4fb8d80933cab307355d03dd5", "score": "0.56787026", "text": "function setup() {\n createCanvas(windowWidth, 500); \n \n \n for(var i = 0; i < nums; i++){\n\t\tparticles_a[i] = new Particle(random(0, width),random(0,height));\n\t\tparticles_b[i] = new Particle(random(0, width),random(0,height));\n\t\tparticles_c[i] = new Particle(random(0, width),random(0,height));\n particles_d[i] =new Particle (random (0, width),random(0,height));\n\t}\n \n //leaf + bud\n for(i=0;i<numWaterlilies;i++){\n // drawleaf(x,y,r,g,b)\n\t\tleaf1 = new drawleaf (random(width),random(height),random(35,98),random(30,50),random(17,97),1) ;// generate one leaf\n\t\twaterlilies.push(leaf1); //add it to the array.\n lilybuds [i] = new drawLily (random(0, width),random(0,height));\n \n\t}\n \n \n}//setup ends", "title": "" }, { "docid": "ddde5f64568530e66ecb362f56337064", "score": "0.5678595", "text": "draw() {\n for (let particle in this.particles) {\n this.particles[particle].draw();\n }\n }", "title": "" }, { "docid": "78ba407fb5e6e508695c760c205b74bf", "score": "0.56771797", "text": "addParticleSuperellipse (num, where) {\r\n const amnt = TWO_PI / num;\r\n const n = 0.5;\r\n const b = 1.5;\r\n const a = 1.5;\r\n\r\n for (let i = 0; i < TWO_PI; i+= amnt) {\r\n const na = 2 / n;\r\n const x = pow(abs(cos(i)), na) * a * this.sgn(cos(i));\r\n const y = pow(abs(sin(i)), na) * b * this.sgn(sin(i));\r\n\r\n const force = createVector(x, y);\r\n \r\n this.particleRandomly(where, force);\r\n }\r\n }", "title": "" }, { "docid": "fdbd8586e09199c80fb3eb00482030a8", "score": "0.56760085", "text": "function createParticles2() {\n //Materiale:\n\tlet material = new THREE.PointsMaterial({\n\t size: 1,\n\t\tvertexColors : true,\n\t\tcolor : 0xff500\n\t});\n\n //Geometri, legger til posisjon og farge per verteks:\n\tlet geom = new THREE.Geometry();\n\tfor (let x = -5; x < 5; x++) {\n\t\tfor (let y = -5; y < 5; y++) {\n\t\t\tlet particle = new THREE.Vector3(x * 10, y * 10, 0);\n\t\t\tgeom.vertices.push(particle);\n\t\t\tgeom.colors.push(new THREE.Color(Math.random() * 0x00ffff));\n\t\t}\n\t}\n\n\tlet points = new THREE.Points(geom, material);\n\tscene.add(points);\n}", "title": "" } ]
a1278ab0785c9c8aa90a1ad36e1f52a1
=========================================================================== Compress as much as possible from the input stream, return the current block state. This function does not perform lazy evaluation of matches and inserts new strings in the dictionary only for unmatched strings or for short matches. It is used only for the fast compression options.
[ { "docid": "a25e77007fcfed846c6e48e83551cc9a", "score": "0.0", "text": "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "title": "" } ]
[ { "docid": "f7270f04a4e803be9ef4735a42ab0d3f", "score": "0.6782075", "text": "function zip_deflate_fast() {\n while (zip_lookahead != 0 && zip_qhead == null) {\n var flush; // set if current block must be flushed\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n zip_INSERT_STRING();\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (zip_hash_head != zip_NIL &&\n zip_strstart - zip_hash_head <= zip_MAX_DIST) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n zip_match_length = zip_longest_match(zip_hash_head);\n /* longest_match() sets match_start */\n if (zip_match_length > zip_lookahead) { zip_match_length = zip_lookahead; }\n }\n if (zip_match_length >= zip_MIN_MATCH) {\n //\t check_match(strstart, match_start, match_length);\n\n flush = zip_ct_tally(zip_strstart - zip_match_start,\n zip_match_length - zip_MIN_MATCH);\n zip_lookahead -= zip_match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (zip_match_length <= zip_max_lazy_match) {\n zip_match_length--; // string at strstart already in hash table\n do {\n zip_strstart++;\n zip_INSERT_STRING();\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead. If lookahead < MIN_MATCH\n * these bytes are garbage, but it does not matter since\n * the next lookahead bytes will be emitted as literals.\n */\n } while (--zip_match_length != 0);\n zip_strstart++;\n } else {\n zip_strstart += zip_match_length;\n zip_match_length = 0;\n zip_ins_h = zip_window[zip_strstart] & 0xff;\n //\t\tUPDATE_HASH(ins_h, window[strstart + 1]);\n zip_ins_h = ((zip_ins_h << zip_H_SHIFT) ^ (zip_window[zip_strstart + 1] & 0xff)) & zip_HASH_MASK;\n\n //#if MIN_MATCH != 3\n //\t\tCall UPDATE_HASH() MIN_MATCH-3 more times\n //#endif\n\n }\n } else {\n /* No match, output a literal byte */\n flush = zip_ct_tally(0, zip_window[zip_strstart] & 0xff);\n zip_lookahead--;\n zip_strstart++;\n }\n if (flush) {\n zip_flush_block(0);\n zip_block_start = zip_strstart;\n }\n\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n while (zip_lookahead < zip_MIN_LOOKAHEAD && !zip_eofile) { zip_fill_window(); }\n }\n}", "title": "" }, { "docid": "26419d96139f531d77dcbd2cebb7a0c2", "score": "0.67528456", "text": "function deflate_fast() {\n \t\twhile (lookahead !== 0 && qhead === null) {\n \t\t\tvar flush; // set if current block must be flushed\n \n \t\t\t// Insert the string window[strstart .. strstart+2] in the\n \t\t\t// dictionary, and set hash_head to the head of the hash chain:\n \t\t\tINSERT_STRING();\n \n \t\t\t// Find the longest match, discarding those <= prev_length.\n \t\t\t// At this point we have always match_length < MIN_MATCH\n \t\t\tif (hash_head !== NIL && strstart - hash_head <= MAX_DIST) {\n \t\t\t\t// To simplify the code, we prevent matches with the string\n \t\t\t\t// of window index 0 (in particular we have to avoid a match\n \t\t\t\t// of the string with itself at the start of the input file).\n \t\t\t\tmatch_length = longest_match(hash_head);\n \t\t\t\t// longest_match() sets match_start */\n \t\t\t\tif (match_length > lookahead) {\n \t\t\t\t\tmatch_length = lookahead;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (match_length >= MIN_MATCH) {\n \t\t\t\t// check_match(strstart, match_start, match_length);\n \n \t\t\t\tflush = ct_tally(strstart - match_start, match_length - MIN_MATCH);\n \t\t\t\tlookahead -= match_length;\n \n \t\t\t\t// Insert new strings in the hash table only if the match length\n \t\t\t\t// is not too large. This saves time but degrades compression.\n \t\t\t\tif (match_length <= max_lazy_match) {\n \t\t\t\t\tmatch_length--; // string at strstart already in hash table\n \t\t\t\t\tdo {\n \t\t\t\t\t\tstrstart++;\n \t\t\t\t\t\tINSERT_STRING();\n \t\t\t\t\t\t// strstart never exceeds WSIZE-MAX_MATCH, so there are\n \t\t\t\t\t\t// always MIN_MATCH bytes ahead. If lookahead < MIN_MATCH\n \t\t\t\t\t\t// these bytes are garbage, but it does not matter since\n \t\t\t\t\t\t// the next lookahead bytes will be emitted as literals.\n \t\t\t\t\t} while (--match_length !== 0);\n \t\t\t\t\tstrstart++;\n \t\t\t\t} else {\n \t\t\t\t\tstrstart += match_length;\n \t\t\t\t\tmatch_length = 0;\n \t\t\t\t\tins_h = window[strstart] & 0xff;\n \t\t\t\t\t// UPDATE_HASH(ins_h, window[strstart + 1]);\n \t\t\t\t\tins_h = ((ins_h << H_SHIFT) ^ (window[strstart + 1] & 0xff)) & HASH_MASK;\n \n \t\t\t\t//#if MIN_MATCH !== 3\n \t\t\t\t//\t\tCall UPDATE_HASH() MIN_MATCH-3 more times\n \t\t\t\t//#endif\n \n \t\t\t\t}\n \t\t\t} else {\n \t\t\t\t// No match, output a literal byte */\n \t\t\t\tflush = ct_tally(0, window[strstart] & 0xff);\n \t\t\t\tlookahead--;\n \t\t\t\tstrstart++;\n \t\t\t}\n \t\t\tif (flush) {\n \t\t\t\tflush_block(0);\n \t\t\t\tblock_start = strstart;\n \t\t\t}\n \n \t\t\t// Make sure that we always have enough lookahead, except\n \t\t\t// at the end of the input file. We need MAX_MATCH bytes\n \t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n \t\t\t// string following the next match.\n \t\t\twhile (lookahead < MIN_LOOKAHEAD && !eofile) {\n \t\t\t\tfill_window();\n \t\t\t}\n \t\t}\n \t}", "title": "" }, { "docid": "089de3d5a95902ba60afd05f61545bfb", "score": "0.6682843", "text": "function deflate_fast() {\n\t\twhile (lookahead !== 0 && qhead === null) {\n\t\t\tvar flush; // set if current block must be flushed\n\n\t\t\t// Insert the string window[strstart .. strstart+2] in the\n\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n\t\t\tINSERT_STRING();\n\n\t\t\t// Find the longest match, discarding those <= prev_length.\n\t\t\t// At this point we have always match_length < MIN_MATCH\n\t\t\tif (hash_head !== NIL && strstart - hash_head <= MAX_DIST) {\n\t\t\t\t// To simplify the code, we prevent matches with the string\n\t\t\t\t// of window index 0 (in particular we have to avoid a match\n\t\t\t\t// of the string with itself at the start of the input file).\n\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t\t// longest_match() sets match_start */\n\t\t\t\tif (match_length > lookahead) {\n\t\t\t\t\tmatch_length = lookahead;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (match_length >= MIN_MATCH) {\n\t\t\t\t// check_match(strstart, match_start, match_length);\n\n\t\t\t\tflush = ct_tally(strstart - match_start, match_length - MIN_MATCH);\n\t\t\t\tlookahead -= match_length;\n\n\t\t\t\t// Insert new strings in the hash table only if the match length\n\t\t\t\t// is not too large. This saves time but degrades compression.\n\t\t\t\tif (match_length <= max_lazy_match) {\n\t\t\t\t\tmatch_length--; // string at strstart already in hash table\n\t\t\t\t\tdo {\n\t\t\t\t\t\tstrstart++;\n\t\t\t\t\t\tINSERT_STRING();\n\t\t\t\t\t\t// strstart never exceeds WSIZE-MAX_MATCH, so there are\n\t\t\t\t\t\t// always MIN_MATCH bytes ahead. If lookahead < MIN_MATCH\n\t\t\t\t\t\t// these bytes are garbage, but it does not matter since\n\t\t\t\t\t\t// the next lookahead bytes will be emitted as literals.\n\t\t\t\t\t} while (--match_length !== 0);\n\t\t\t\t\tstrstart++;\n\t\t\t\t} else {\n\t\t\t\t\tstrstart += match_length;\n\t\t\t\t\tmatch_length = 0;\n\t\t\t\t\tins_h = window[strstart] & 0xff;\n\t\t\t\t\t// UPDATE_HASH(ins_h, window[strstart + 1]);\n\t\t\t\t\tins_h = ((ins_h << H_SHIFT) ^ (window[strstart + 1] & 0xff)) & HASH_MASK;\n\n\t\t\t\t//#if MIN_MATCH !== 3\n\t\t\t\t//\t\tCall UPDATE_HASH() MIN_MATCH-3 more times\n\t\t\t\t//#endif\n\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// No match, output a literal byte */\n\t\t\t\tflush = ct_tally(0, window[strstart] & 0xff);\n\t\t\t\tlookahead--;\n\t\t\t\tstrstart++;\n\t\t\t}\n\t\t\tif (flush) {\n\t\t\t\tflush_block(0);\n\t\t\t\tblock_start = strstart;\n\t\t\t}\n\n\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t// string following the next match.\n\t\t\twhile (lookahead < MIN_LOOKAHEAD && !eofile) {\n\t\t\t\tfill_window();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "6e9de76f1bd9c8568dadc40116c7e688", "score": "0.6670824", "text": "function deflate_fast(s,flush){var hash_head; /* head of the hash chain */var bflush; /* set if current block must be flushed */for(;;){ /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */if(s.lookahead<MIN_LOOKAHEAD){fill_window(s);if(s.lookahead<MIN_LOOKAHEAD&&flush===Z_NO_FLUSH){return BS_NEED_MORE;}if(s.lookahead===0){break; /* flush the current block */}} /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */hash_head=0 /*NIL*/;if(s.lookahead>=MIN_MATCH){ /*** INSERT_STRING(s, s.strstart, hash_head); ***/s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask;hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h];s.head[s.ins_h]=s.strstart; /***/} /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */if(hash_head!==0 /*NIL*/&&s.strstart-hash_head<=s.w_size-MIN_LOOKAHEAD){ /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */s.match_length=longest_match(s,hash_head); /* longest_match() sets match_start */}if(s.match_length>=MIN_MATCH){ // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/bflush=trees._tr_tally(s,s.strstart-s.match_start,s.match_length-MIN_MATCH);s.lookahead-=s.match_length; /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */if(s.match_length<=s.max_lazy_match /*max_insert_length*/&&s.lookahead>=MIN_MATCH){s.match_length--; /* string at strstart already in table */do {s.strstart++; /*** INSERT_STRING(s, s.strstart, hash_head); ***/s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask;hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h];s.head[s.ins_h]=s.strstart; /***/ /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */}while(--s.match_length!==0);s.strstart++;}else {s.strstart+=s.match_length;s.match_length=0;s.ins_h=s.window[s.strstart]; /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+1])&s.hash_mask; //#if MIN_MATCH != 3\n // Call UPDATE_HASH() MIN_MATCH-3 more times\n //#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */}}else { /* No match, output a literal byte */ //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/bflush=trees._tr_tally(s,0,s.window[s.strstart]);s.lookahead--;s.strstart++;}if(bflush){ /*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;} /***/}}s.insert=s.strstart<MIN_MATCH-1?s.strstart:MIN_MATCH-1;if(flush===Z_FINISH){ /*** FLUSH_BLOCK(s, 1); ***/flush_block_only(s,true);if(s.strm.avail_out===0){return BS_FINISH_STARTED;} /***/return BS_FINISH_DONE;}if(s.last_lit){ /*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;} /***/}return BS_BLOCK_DONE;}", "title": "" }, { "docid": "78dfebb5d991ca33c5b59ded04097108", "score": "0.66418016", "text": "function deflate_slow(s,flush){var hash_head; /* head of hash chain */var bflush; /* set if current block must be flushed */var max_insert; /* Process the input block. */for(;;){ /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */if(s.lookahead<MIN_LOOKAHEAD){fill_window(s);if(s.lookahead<MIN_LOOKAHEAD&&flush===Z_NO_FLUSH){return BS_NEED_MORE;}if(s.lookahead===0){break;} /* flush the current block */} /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */hash_head=0 /*NIL*/;if(s.lookahead>=MIN_MATCH){ /*** INSERT_STRING(s, s.strstart, hash_head); ***/s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask;hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h];s.head[s.ins_h]=s.strstart; /***/} /* Find the longest match, discarding those <= prev_length.\n */s.prev_length=s.match_length;s.prev_match=s.match_start;s.match_length=MIN_MATCH-1;if(hash_head!==0 /*NIL*/&&s.prev_length<s.max_lazy_match&&s.strstart-hash_head<=s.w_size-MIN_LOOKAHEAD /*MAX_DIST(s)*/){ /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */s.match_length=longest_match(s,hash_head); /* longest_match() sets match_start */if(s.match_length<=5&&(s.strategy===Z_FILTERED||s.match_length===MIN_MATCH&&s.strstart-s.match_start>4096 /*TOO_FAR*/)){ /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */s.match_length=MIN_MATCH-1;}} /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */if(s.prev_length>=MIN_MATCH&&s.match_length<=s.prev_length){max_insert=s.strstart+s.lookahead-MIN_MATCH; /* Do not insert strings in hash table beyond this. */ //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/bflush=trees._tr_tally(s,s.strstart-1-s.prev_match,s.prev_length-MIN_MATCH); /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */s.lookahead-=s.prev_length-1;s.prev_length-=2;do {if(++s.strstart<=max_insert){ /*** INSERT_STRING(s, s.strstart, hash_head); ***/s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask;hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h];s.head[s.ins_h]=s.strstart; /***/}}while(--s.prev_length!==0);s.match_available=0;s.match_length=MIN_MATCH-1;s.strstart++;if(bflush){ /*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;} /***/}}else if(s.match_available){ /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */ //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/bflush=trees._tr_tally(s,0,s.window[s.strstart-1]);if(bflush){ /*** FLUSH_BLOCK_ONLY(s, 0) ***/flush_block_only(s,false); /***/}s.strstart++;s.lookahead--;if(s.strm.avail_out===0){return BS_NEED_MORE;}}else { /* There is no previous match to compare with, wait for\n * the next step to decide.\n */s.match_available=1;s.strstart++;s.lookahead--;}} //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if(s.match_available){ //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/bflush=trees._tr_tally(s,0,s.window[s.strstart-1]);s.match_available=0;}s.insert=s.strstart<MIN_MATCH-1?s.strstart:MIN_MATCH-1;if(flush===Z_FINISH){ /*** FLUSH_BLOCK(s, 1); ***/flush_block_only(s,true);if(s.strm.avail_out===0){return BS_FINISH_STARTED;} /***/return BS_FINISH_DONE;}if(s.last_lit){ /*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;} /***/}return BS_BLOCK_DONE;}", "title": "" }, { "docid": "5d7872db686268234b3b8de34ff6a183", "score": "0.6633814", "text": "function deflate_fast(s,flush){var hash_head;/* head of the hash chain */var bflush;/* set if current block must be flushed */for(;;){/* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */if(s.lookahead<MIN_LOOKAHEAD){fill_window(s);if(s.lookahead<MIN_LOOKAHEAD&&flush===Z_NO_FLUSH){return BS_NEED_MORE;}if(s.lookahead===0){break;/* flush the current block */}}/* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */hash_head=0/*NIL*/;if(s.lookahead>=MIN_MATCH){/*** INSERT_STRING(s, s.strstart, hash_head); ***/s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask;hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h];s.head[s.ins_h]=s.strstart;/***/}/* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */if(hash_head!==0/*NIL*/&&s.strstart-hash_head<=s.w_size-MIN_LOOKAHEAD){/* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */s.match_length=longest_match(s,hash_head);/* longest_match() sets match_start */}if(s.match_length>=MIN_MATCH){// check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n/*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/bflush=trees._tr_tally(s,s.strstart-s.match_start,s.match_length-MIN_MATCH);s.lookahead-=s.match_length;/* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */if(s.match_length<=s.max_lazy_match/*max_insert_length*/&&s.lookahead>=MIN_MATCH){s.match_length--;/* string at strstart already in table */do{s.strstart++;/*** INSERT_STRING(s, s.strstart, hash_head); ***/s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask;hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h];s.head[s.ins_h]=s.strstart;/***//* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */}while(--s.match_length!==0);s.strstart++;}else{s.strstart+=s.match_length;s.match_length=0;s.ins_h=s.window[s.strstart];/* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+1])&s.hash_mask;//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n/* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */}}else{/* No match, output a literal byte *///Tracevv((stderr,\"%c\", s.window[s.strstart]));\n/*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/bflush=trees._tr_tally(s,0,s.window[s.strstart]);s.lookahead--;s.strstart++;}if(bflush){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}}s.insert=s.strstart<MIN_MATCH-1?s.strstart:MIN_MATCH-1;if(flush===Z_FINISH){/*** FLUSH_BLOCK(s, 1); ***/flush_block_only(s,true);if(s.strm.avail_out===0){return BS_FINISH_STARTED;}/***/return BS_FINISH_DONE;}if(s.last_lit){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}return BS_BLOCK_DONE;}", "title": "" }, { "docid": "b5875fcc8f56e56edd745939c1280af6", "score": "0.66142404", "text": "function deflate_slow(s,flush){var hash_head;/* head of hash chain */var bflush;/* set if current block must be flushed */var max_insert;/* Process the input block. */for(;;){/* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */if(s.lookahead<MIN_LOOKAHEAD){fill_window(s);if(s.lookahead<MIN_LOOKAHEAD&&flush===Z_NO_FLUSH){return BS_NEED_MORE;}if(s.lookahead===0){break;}/* flush the current block */}/* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */hash_head=0/*NIL*/;if(s.lookahead>=MIN_MATCH){/*** INSERT_STRING(s, s.strstart, hash_head); ***/s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask;hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h];s.head[s.ins_h]=s.strstart;/***/}/* Find the longest match, discarding those <= prev_length.\n */s.prev_length=s.match_length;s.prev_match=s.match_start;s.match_length=MIN_MATCH-1;if(hash_head!==0/*NIL*/&&s.prev_length<s.max_lazy_match&&s.strstart-hash_head<=s.w_size-MIN_LOOKAHEAD/*MAX_DIST(s)*/){/* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */s.match_length=longest_match(s,hash_head);/* longest_match() sets match_start */if(s.match_length<=5&&(s.strategy===Z_FILTERED||s.match_length===MIN_MATCH&&s.strstart-s.match_start>4096/*TOO_FAR*/)){/* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */s.match_length=MIN_MATCH-1;}}/* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */if(s.prev_length>=MIN_MATCH&&s.match_length<=s.prev_length){max_insert=s.strstart+s.lookahead-MIN_MATCH;/* Do not insert strings in hash table beyond this. *///check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n/***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/bflush=trees._tr_tally(s,s.strstart-1-s.prev_match,s.prev_length-MIN_MATCH);/* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */s.lookahead-=s.prev_length-1;s.prev_length-=2;do{if(++s.strstart<=max_insert){/*** INSERT_STRING(s, s.strstart, hash_head); ***/s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask;hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h];s.head[s.ins_h]=s.strstart;/***/}}while(--s.prev_length!==0);s.match_available=0;s.match_length=MIN_MATCH-1;s.strstart++;if(bflush){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}}else if(s.match_available){/* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n *///Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n/*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/bflush=trees._tr_tally(s,0,s.window[s.strstart-1]);if(bflush){/*** FLUSH_BLOCK_ONLY(s, 0) ***/flush_block_only(s,false);/***/}s.strstart++;s.lookahead--;if(s.strm.avail_out===0){return BS_NEED_MORE;}}else{/* There is no previous match to compare with, wait for\n * the next step to decide.\n */s.match_available=1;s.strstart++;s.lookahead--;}}//Assert (flush != Z_NO_FLUSH, \"no flush?\");\nif(s.match_available){//Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n/*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/bflush=trees._tr_tally(s,0,s.window[s.strstart-1]);s.match_available=0;}s.insert=s.strstart<MIN_MATCH-1?s.strstart:MIN_MATCH-1;if(flush===Z_FINISH){/*** FLUSH_BLOCK(s, 1); ***/flush_block_only(s,true);if(s.strm.avail_out===0){return BS_FINISH_STARTED;}/***/return BS_FINISH_DONE;}if(s.last_lit){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}return BS_BLOCK_DONE;}", "title": "" }, { "docid": "8125726b1113cd09f1a3238db474c360", "score": "0.6500689", "text": "function compress_block(s,ltree,dtree)// deflate_state *s;\n// const ct_data *ltree; /* literal tree */\n// const ct_data *dtree; /* distance tree */\n{var dist;/* distance of matched string */var lc;/* match length or unmatched char (if dist == 0) */var lx=0;/* running index in l_buf */var code;/* the code to send */var extra;/* number of extra bits to send */if(s.last_lit!==0){do{dist=s.pending_buf[s.d_buf+lx*2]<<8|s.pending_buf[s.d_buf+lx*2+1];lc=s.pending_buf[s.l_buf+lx];lx++;if(dist===0){send_code(s,lc,ltree);/* send a literal byte *///Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n}else{/* Here, lc is the match length - MIN_MATCH */code=_length_code[lc];send_code(s,code+LITERALS+1,ltree);/* send the length code */extra=extra_lbits[code];if(extra!==0){lc-=base_length[code];send_bits(s,lc,extra);/* send the extra length bits */}dist--;/* dist is now the match distance - 1 */code=d_code(dist);//Assert (code < D_CODES, \"bad d_code\");\nsend_code(s,code,dtree);/* send the distance code */extra=extra_dbits[code];if(extra!==0){dist-=base_dist[code];send_bits(s,dist,extra);/* send the extra distance bits */}}/* literal or match pair ? *//* Check that the overlay between pending_buf and d_buf+l_buf is ok: *///Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,\n// \"pendingBuf overflow\");\n}while(lx<s.last_lit);}send_code(s,END_BLOCK,ltree);}", "title": "" }, { "docid": "02ad2097d8fda0bb3c61d9d9eae4fb02", "score": "0.6439615", "text": "function deflate_slow(flush) {\n// short hash_head = 0; // head of hash chain\nvar hash_head = 0; // head of hash chain\nvar bflush; // set if current block must be flushed\nvar max_insert;\n// Process the input block.\nwhile (true) {\n// Make sure that we always have enough lookahead, except\n// at the end of the input file. We need MAX_MATCH bytes\n// for the next match, plus MIN_MATCH bytes to insert the\n// string following the next match.\nif (lookahead < MIN_LOOKAHEAD) {\nfill_window();\nif (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\nreturn NeedMore;\n}\nif (lookahead === 0)\nbreak; // flush the current block\n}\n// Insert the string window[strstart .. strstart+2] in the\n// dictionary, and set hash_head to the head of the hash chain:\nif (lookahead >= MIN_MATCH) {\nins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n// prev[strstart&w_mask]=hash_head=head[ins_h];\nhash_head = (head[ins_h] & 0xffff);\nprev[strstart & w_mask] = head[ins_h];\nhead[ins_h] = strstart;\n}\n// Find the longest match, discarding those <= prev_length.\nprev_length = match_length;\nprev_match = match_start;\nmatch_length = MIN_MATCH - 1;\nif (hash_head !== 0 && prev_length < max_lazy_match && ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n// To simplify the code, we prevent matches with the string\n// of window index 0 (in particular we have to avoid a match\n// of the string with itself at the start of the input file).\nif (strategy != Z_HUFFMAN_ONLY) {\nmatch_length = longest_match(hash_head);\n}\n// longest_match() sets match_start\nif (match_length <= 5 && (strategy == Z_FILTERED || (match_length == MIN_MATCH && strstart - match_start > 4096))) {\n// If prev_match is also MIN_MATCH, match_start is garbage\n// but we will ignore the current match anyway.\nmatch_length = MIN_MATCH - 1;\n}\n}\n// If there was a match at the previous step and the current\n// match is not better, output the previous match:\nif (prev_length >= MIN_MATCH && match_length <= prev_length) {\nmax_insert = strstart + lookahead - MIN_MATCH;\n// Do not insert strings in hash table beyond this.\n// check_match(strstart-1, prev_match, prev_length);\nbflush = _tr_tally(strstart - 1 - prev_match, prev_length - MIN_MATCH);\n// Insert in hash table all strings up to the end of the match.\n// strstart-1 and strstart are already inserted. If there is not\n// enough lookahead, the last two strings are not inserted in\n// the hash table.\nlookahead -= prev_length - 1;\nprev_length -= 2;\ndo {\nif (++strstart <= max_insert) {\nins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n// prev[strstart&w_mask]=hash_head=head[ins_h];\nhash_head = (head[ins_h] & 0xffff);\nprev[strstart & w_mask] = head[ins_h];\nhead[ins_h] = strstart;\n}\n} while (--prev_length !== 0);\nmatch_available = 0;\nmatch_length = MIN_MATCH - 1;\nstrstart++;\nif (bflush) {\nflush_block_only(false);\nif (strm.avail_out === 0)\nreturn NeedMore;\n}\n} else if (match_available !== 0) {\n// If there was no match at the previous position, output a\n// single literal. If there was a match but the current match\n// is longer, truncate the previous match to a single literal.\nbflush = _tr_tally(0, window[strstart - 1] & 0xff);\nif (bflush) {\nflush_block_only(false);\n}\nstrstart++;\nlookahead--;\nif (strm.avail_out === 0)\nreturn NeedMore;\n} else {\n// There is no previous match to compare with, wait for\n// the next step to decide.\nmatch_available = 1;\nstrstart++;\nlookahead--;\n}\n}\nif (match_available !== 0) {\nbflush = _tr_tally(0, window[strstart - 1] & 0xff);\nmatch_available = 0;\n}\nflush_block_only(flush == Z_FINISH);\nif (strm.avail_out === 0) {\nif (flush == Z_FINISH)\nreturn FinishStarted;\nelse\nreturn NeedMore;\n}\nreturn flush == Z_FINISH ? FinishDone : BlockDone;\n}", "title": "" }, { "docid": "824d723e1c8f1cfe2e5878612d0e8085", "score": "0.6399828", "text": "function deflate_slow(s, flush) {\n\t var hash_head; /* head of hash chain */\n\t var bflush; /* set if current block must be flushed */\n\n\t var max_insert;\n\n\t /* Process the input block. */\n\t for (;;) {\n\t /* Make sure that we always have enough lookahead, except\n\t * at the end of the input file. We need MAX_MATCH bytes\n\t * for the next match, plus MIN_MATCH bytes to insert the\n\t * string following the next match.\n\t */\n\t if (s.lookahead < MIN_LOOKAHEAD) {\n\t fill_window(s);\n\t if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n\t return BS_NEED_MORE;\n\t }\n\t if (s.lookahead === 0) {\n\t break;\n\t } /* flush the current block */\n\t }\n\n\t /* Insert the string window[strstart .. strstart+2] in the\n\t * dictionary, and set hash_head to the head of the hash chain:\n\t */\n\t hash_head = 0 /*NIL*/;\n\t if (s.lookahead >= MIN_MATCH) {\n\t /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\t s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n\t hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n\t s.head[s.ins_h] = s.strstart;\n\t /***/\n\t }\n\n\t /* Find the longest match, discarding those <= prev_length.\n\t */\n\t s.prev_length = s.match_length;\n\t s.prev_match = s.match_start;\n\t s.match_length = MIN_MATCH - 1;\n\n\t if (hash_head !== 0 /*NIL*/ && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD /*MAX_DIST(s)*/) {\n\t /* To simplify the code, we prevent matches with the string\n\t * of window index 0 (in particular we have to avoid a match\n\t * of the string with itself at the start of the input file).\n\t */\n\t s.match_length = longest_match(s, hash_head);\n\t /* longest_match() sets match_start */\n\n\t if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096 /*TOO_FAR*/)) {\n\n\t /* If prev_match is also MIN_MATCH, match_start is garbage\n\t * but we will ignore the current match anyway.\n\t */\n\t s.match_length = MIN_MATCH - 1;\n\t }\n\t }\n\t /* If there was a match at the previous step and the current\n\t * match is not better, output the previous match:\n\t */\n\t if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n\t max_insert = s.strstart + s.lookahead - MIN_MATCH;\n\t /* Do not insert strings in hash table beyond this. */\n\n\t //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n\t /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n\t s.prev_length - MIN_MATCH, bflush);***/\n\t bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n\t /* Insert in hash table all strings up to the end of the match.\n\t * strstart-1 and strstart are already inserted. If there is not\n\t * enough lookahead, the last two strings are not inserted in\n\t * the hash table.\n\t */\n\t s.lookahead -= s.prev_length - 1;\n\t s.prev_length -= 2;\n\t do {\n\t if (++s.strstart <= max_insert) {\n\t /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\t s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n\t hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n\t s.head[s.ins_h] = s.strstart;\n\t /***/\n\t }\n\t } while (--s.prev_length !== 0);\n\t s.match_available = 0;\n\t s.match_length = MIN_MATCH - 1;\n\t s.strstart++;\n\n\t if (bflush) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t } else if (s.match_available) {\n\t /* If there was no match at the previous position, output a\n\t * single literal. If there was a match but the current match\n\t * is longer, truncate the previous match to a single literal.\n\t */\n\t //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\t /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n\t bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n\t if (bflush) {\n\t /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n\t flush_block_only(s, false);\n\t /***/\n\t }\n\t s.strstart++;\n\t s.lookahead--;\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t } else {\n\t /* There is no previous match to compare with, wait for\n\t * the next step to decide.\n\t */\n\t s.match_available = 1;\n\t s.strstart++;\n\t s.lookahead--;\n\t }\n\t }\n\t //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n\t if (s.match_available) {\n\t //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\t /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n\t bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n\t s.match_available = 0;\n\t }\n\t s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n\t if (flush === Z_FINISH) {\n\t /*** FLUSH_BLOCK(s, 1); ***/\n\t flush_block_only(s, true);\n\t if (s.strm.avail_out === 0) {\n\t return BS_FINISH_STARTED;\n\t }\n\t /***/\n\t return BS_FINISH_DONE;\n\t }\n\t if (s.last_lit) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\n\t return BS_BLOCK_DONE;\n\t }", "title": "" }, { "docid": "f104070965e8adc0fb83ca6b1a32878b", "score": "0.63928217", "text": "function deflate_fast(flush) {\n// short hash_head = 0; // head of the hash chain\nvar hash_head = 0; // head of the hash chain\nvar bflush; // set if current block must be flushed\nwhile (true) {\n// Make sure that we always have enough lookahead, except\n// at the end of the input file. We need MAX_MATCH bytes\n// for the next match, plus MIN_MATCH bytes to insert the\n// string following the next match.\nif (lookahead < MIN_LOOKAHEAD) {\nfill_window();\nif (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\nreturn NeedMore;\n}\nif (lookahead === 0)\nbreak; // flush the current block\n}\n// Insert the string window[strstart .. strstart+2] in the\n// dictionary, and set hash_head to the head of the hash chain:\nif (lookahead >= MIN_MATCH) {\nins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n// prev[strstart&w_mask]=hash_head=head[ins_h];\nhash_head = (head[ins_h] & 0xffff);\nprev[strstart & w_mask] = head[ins_h];\nhead[ins_h] = strstart;\n}\n// Find the longest match, discarding those <= prev_length.\n// At this point we have always match_length < MIN_MATCH\nif (hash_head !== 0 && ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n// To simplify the code, we prevent matches with the string\n// of window index 0 (in particular we have to avoid a match\n// of the string with itself at the start of the input file).\nif (strategy != Z_HUFFMAN_ONLY) {\nmatch_length = longest_match(hash_head);\n}\n// longest_match() sets match_start\n}\nif (match_length >= MIN_MATCH) {\n// check_match(strstart, match_start, match_length);\nbflush = _tr_tally(strstart - match_start, match_length - MIN_MATCH);\nlookahead -= match_length;\n// Insert new strings in the hash table only if the match length\n// is not too large. This saves time but degrades compression.\nif (match_length <= max_lazy_match && lookahead >= MIN_MATCH) {\nmatch_length--; // string at strstart already in hash table\ndo {\nstrstart++;\nins_h = ((ins_h << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n// prev[strstart&w_mask]=hash_head=head[ins_h];\nhash_head = (head[ins_h] & 0xffff);\nprev[strstart & w_mask] = head[ins_h];\nhead[ins_h] = strstart;\n// strstart never exceeds WSIZE-MAX_MATCH, so there are\n// always MIN_MATCH bytes ahead.\n} while (--match_length !== 0);\nstrstart++;\n} else {\nstrstart += match_length;\nmatch_length = 0;\nins_h = window[strstart] & 0xff;\nins_h = (((ins_h) << hash_shift) ^ (window[strstart + 1] & 0xff)) & hash_mask;\n// If lookahead < MIN_MATCH, ins_h is garbage, but it does\n// not\n// matter since it will be recomputed at next deflate call.\n}\n} else {\n// No match, output a literal byte\nbflush = _tr_tally(0, window[strstart] & 0xff);\nlookahead--;\nstrstart++;\n}\nif (bflush) {\nflush_block_only(false);\nif (strm.avail_out === 0)\nreturn NeedMore;\n}\n}\nflush_block_only(flush == Z_FINISH);\nif (strm.avail_out === 0) {\nif (flush == Z_FINISH)\nreturn FinishStarted;\nelse\nreturn NeedMore;\n}\nreturn flush == Z_FINISH ? FinishDone : BlockDone;\n}", "title": "" }, { "docid": "00c4b65a8a31f003603939c3ba135484", "score": "0.6382474", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break;\n } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0 /*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0 /*NIL*/ && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD /*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096 /*TOO_FAR*/)) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "262d13b90e64cf7b2022cded1d827cd0", "score": "0.63665056", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break;\n } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0;\n /*NIL*/if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0 /*NIL*/ && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD /*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096 /*TOO_FAR*/)) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "16452f6a746aec50b194579bcf75b70a", "score": "0.63631576", "text": "function deflate_slow(s, flush) {\n\t\t var hash_head; /* head of hash chain */\n\t\t var bflush; /* set if current block must be flushed */\n\n\t\t var max_insert;\n\n\t\t /* Process the input block. */\n\t\t for (;;) {\n\t\t /* Make sure that we always have enough lookahead, except\n\t\t * at the end of the input file. We need MAX_MATCH bytes\n\t\t * for the next match, plus MIN_MATCH bytes to insert the\n\t\t * string following the next match.\n\t\t */\n\t\t if (s.lookahead < MIN_LOOKAHEAD) {\n\t\t fill_window(s);\n\t\t if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n\t\t return BS_NEED_MORE;\n\t\t }\n\t\t if (s.lookahead === 0) { break; } /* flush the current block */\n\t\t }\n\n\t\t /* Insert the string window[strstart .. strstart+2] in the\n\t\t * dictionary, and set hash_head to the head of the hash chain:\n\t\t */\n\t\t hash_head = 0/*NIL*/;\n\t\t if (s.lookahead >= MIN_MATCH) {\n\t\t /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\t\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n\t\t hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n\t\t s.head[s.ins_h] = s.strstart;\n\t\t /***/\n\t\t }\n\n\t\t /* Find the longest match, discarding those <= prev_length.\n\t\t */\n\t\t s.prev_length = s.match_length;\n\t\t s.prev_match = s.match_start;\n\t\t s.match_length = MIN_MATCH - 1;\n\n\t\t if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n\t\t s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n\t\t /* To simplify the code, we prevent matches with the string\n\t\t * of window index 0 (in particular we have to avoid a match\n\t\t * of the string with itself at the start of the input file).\n\t\t */\n\t\t s.match_length = longest_match(s, hash_head);\n\t\t /* longest_match() sets match_start */\n\n\t\t if (s.match_length <= 5 &&\n\t\t (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n\t\t /* If prev_match is also MIN_MATCH, match_start is garbage\n\t\t * but we will ignore the current match anyway.\n\t\t */\n\t\t s.match_length = MIN_MATCH - 1;\n\t\t }\n\t\t }\n\t\t /* If there was a match at the previous step and the current\n\t\t * match is not better, output the previous match:\n\t\t */\n\t\t if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n\t\t max_insert = s.strstart + s.lookahead - MIN_MATCH;\n\t\t /* Do not insert strings in hash table beyond this. */\n\n\t\t //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n\t\t /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n\t\t s.prev_length - MIN_MATCH, bflush);***/\n\t\t bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n\t\t /* Insert in hash table all strings up to the end of the match.\n\t\t * strstart-1 and strstart are already inserted. If there is not\n\t\t * enough lookahead, the last two strings are not inserted in\n\t\t * the hash table.\n\t\t */\n\t\t s.lookahead -= s.prev_length - 1;\n\t\t s.prev_length -= 2;\n\t\t do {\n\t\t if (++s.strstart <= max_insert) {\n\t\t /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\t\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n\t\t hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n\t\t s.head[s.ins_h] = s.strstart;\n\t\t /***/\n\t\t }\n\t\t } while (--s.prev_length !== 0);\n\t\t s.match_available = 0;\n\t\t s.match_length = MIN_MATCH - 1;\n\t\t s.strstart++;\n\n\t\t if (bflush) {\n\t\t /*** FLUSH_BLOCK(s, 0); ***/\n\t\t flush_block_only(s, false);\n\t\t if (s.strm.avail_out === 0) {\n\t\t return BS_NEED_MORE;\n\t\t }\n\t\t /***/\n\t\t }\n\n\t\t } else if (s.match_available) {\n\t\t /* If there was no match at the previous position, output a\n\t\t * single literal. If there was a match but the current match\n\t\t * is longer, truncate the previous match to a single literal.\n\t\t */\n\t\t //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\t\t /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n\t\t bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n\t\t if (bflush) {\n\t\t /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n\t\t flush_block_only(s, false);\n\t\t /***/\n\t\t }\n\t\t s.strstart++;\n\t\t s.lookahead--;\n\t\t if (s.strm.avail_out === 0) {\n\t\t return BS_NEED_MORE;\n\t\t }\n\t\t } else {\n\t\t /* There is no previous match to compare with, wait for\n\t\t * the next step to decide.\n\t\t */\n\t\t s.match_available = 1;\n\t\t s.strstart++;\n\t\t s.lookahead--;\n\t\t }\n\t\t }\n\t\t //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n\t\t if (s.match_available) {\n\t\t //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\t\t /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n\t\t bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n\t\t s.match_available = 0;\n\t\t }\n\t\t s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n\t\t if (flush === Z_FINISH) {\n\t\t /*** FLUSH_BLOCK(s, 1); ***/\n\t\t flush_block_only(s, true);\n\t\t if (s.strm.avail_out === 0) {\n\t\t return BS_FINISH_STARTED;\n\t\t }\n\t\t /***/\n\t\t return BS_FINISH_DONE;\n\t\t }\n\t\t if (s.last_lit) {\n\t\t /*** FLUSH_BLOCK(s, 0); ***/\n\t\t flush_block_only(s, false);\n\t\t if (s.strm.avail_out === 0) {\n\t\t return BS_NEED_MORE;\n\t\t }\n\t\t /***/\n\t\t }\n\n\t\t return BS_BLOCK_DONE;\n\t\t}", "title": "" }, { "docid": "e89c6eb7fa181cff76630a939a0dfc1d", "score": "0.6344129", "text": "function deflate_fast(s, flush) {\n\t\t var hash_head; /* head of the hash chain */\n\t\t var bflush; /* set if current block must be flushed */\n\n\t\t for (;;) {\n\t\t /* Make sure that we always have enough lookahead, except\n\t\t * at the end of the input file. We need MAX_MATCH bytes\n\t\t * for the next match, plus MIN_MATCH bytes to insert the\n\t\t * string following the next match.\n\t\t */\n\t\t if (s.lookahead < MIN_LOOKAHEAD) {\n\t\t fill_window(s);\n\t\t if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n\t\t return BS_NEED_MORE;\n\t\t }\n\t\t if (s.lookahead === 0) {\n\t\t break; /* flush the current block */\n\t\t }\n\t\t }\n\n\t\t /* Insert the string window[strstart .. strstart+2] in the\n\t\t * dictionary, and set hash_head to the head of the hash chain:\n\t\t */\n\t\t hash_head = 0/*NIL*/;\n\t\t if (s.lookahead >= MIN_MATCH) {\n\t\t /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\t\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n\t\t hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n\t\t s.head[s.ins_h] = s.strstart;\n\t\t /***/\n\t\t }\n\n\t\t /* Find the longest match, discarding those <= prev_length.\n\t\t * At this point we have always match_length < MIN_MATCH\n\t\t */\n\t\t if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n\t\t /* To simplify the code, we prevent matches with the string\n\t\t * of window index 0 (in particular we have to avoid a match\n\t\t * of the string with itself at the start of the input file).\n\t\t */\n\t\t s.match_length = longest_match(s, hash_head);\n\t\t /* longest_match() sets match_start */\n\t\t }\n\t\t if (s.match_length >= MIN_MATCH) {\n\t\t // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n\t\t /*** _tr_tally_dist(s, s.strstart - s.match_start,\n\t\t s.match_length - MIN_MATCH, bflush); ***/\n\t\t bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n\t\t s.lookahead -= s.match_length;\n\n\t\t /* Insert new strings in the hash table only if the match length\n\t\t * is not too large. This saves time but degrades compression.\n\t\t */\n\t\t if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n\t\t s.match_length--; /* string at strstart already in table */\n\t\t do {\n\t\t s.strstart++;\n\t\t /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\t\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n\t\t hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n\t\t s.head[s.ins_h] = s.strstart;\n\t\t /***/\n\t\t /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n\t\t * always MIN_MATCH bytes ahead.\n\t\t */\n\t\t } while (--s.match_length !== 0);\n\t\t s.strstart++;\n\t\t } else\n\t\t {\n\t\t s.strstart += s.match_length;\n\t\t s.match_length = 0;\n\t\t s.ins_h = s.window[s.strstart];\n\t\t /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n\t\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n\t\t//#if MIN_MATCH != 3\n\t\t// Call UPDATE_HASH() MIN_MATCH-3 more times\n\t\t//#endif\n\t\t /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n\t\t * matter since it will be recomputed at next deflate call.\n\t\t */\n\t\t }\n\t\t } else {\n\t\t /* No match, output a literal byte */\n\t\t //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n\t\t /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n\t\t bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n\t\t s.lookahead--;\n\t\t s.strstart++;\n\t\t }\n\t\t if (bflush) {\n\t\t /*** FLUSH_BLOCK(s, 0); ***/\n\t\t flush_block_only(s, false);\n\t\t if (s.strm.avail_out === 0) {\n\t\t return BS_NEED_MORE;\n\t\t }\n\t\t /***/\n\t\t }\n\t\t }\n\t\t s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n\t\t if (flush === Z_FINISH) {\n\t\t /*** FLUSH_BLOCK(s, 1); ***/\n\t\t flush_block_only(s, true);\n\t\t if (s.strm.avail_out === 0) {\n\t\t return BS_FINISH_STARTED;\n\t\t }\n\t\t /***/\n\t\t return BS_FINISH_DONE;\n\t\t }\n\t\t if (s.last_lit) {\n\t\t /*** FLUSH_BLOCK(s, 0); ***/\n\t\t flush_block_only(s, false);\n\t\t if (s.strm.avail_out === 0) {\n\t\t return BS_NEED_MORE;\n\t\t }\n\t\t /***/\n\t\t }\n\t\t return BS_BLOCK_DONE;\n\t\t}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "9dbb01b7ec6bbf50aa40f009c8713dba", "score": "0.63382655", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "c7a79b6c8b430c2f1a9dd4a1a7b61be7", "score": "0.6337994", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "c7a79b6c8b430c2f1a9dd4a1a7b61be7", "score": "0.6337994", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "c7a79b6c8b430c2f1a9dd4a1a7b61be7", "score": "0.6337994", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "c7a79b6c8b430c2f1a9dd4a1a7b61be7", "score": "0.6337994", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "c7a79b6c8b430c2f1a9dd4a1a7b61be7", "score": "0.6337994", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "c7a79b6c8b430c2f1a9dd4a1a7b61be7", "score": "0.6337994", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "c7a79b6c8b430c2f1a9dd4a1a7b61be7", "score": "0.6337994", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "c7a79b6c8b430c2f1a9dd4a1a7b61be7", "score": "0.6337994", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "c7a79b6c8b430c2f1a9dd4a1a7b61be7", "score": "0.6337994", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "c7a79b6c8b430c2f1a9dd4a1a7b61be7", "score": "0.6337994", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "c7a79b6c8b430c2f1a9dd4a1a7b61be7", "score": "0.6337994", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "c7a79b6c8b430c2f1a9dd4a1a7b61be7", "score": "0.6337994", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "c7a79b6c8b430c2f1a9dd4a1a7b61be7", "score": "0.6337994", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "c7a79b6c8b430c2f1a9dd4a1a7b61be7", "score": "0.6337994", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "c7a79b6c8b430c2f1a9dd4a1a7b61be7", "score": "0.6337994", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "c7a79b6c8b430c2f1a9dd4a1a7b61be7", "score": "0.6337994", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "c7a79b6c8b430c2f1a9dd4a1a7b61be7", "score": "0.6337994", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "c7a79b6c8b430c2f1a9dd4a1a7b61be7", "score": "0.6337994", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "c7a79b6c8b430c2f1a9dd4a1a7b61be7", "score": "0.6337994", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "c7a79b6c8b430c2f1a9dd4a1a7b61be7", "score": "0.6337994", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "ec097776686cb5e94c81cb386fc378c1", "score": "0.6335972", "text": "function deflate_slow(flush) {\n\t\t\t// short hash_head = 0; // head of hash chain\n\t\t\tvar hash_head = 0; // head of hash chain\n\t\t\tvar bflush; // set if current block must be flushed\n\t\t\tvar max_insert;\n\n\t\t\t// Process the input block.\n\t\t\twhile (true) {\n\t\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t\t// string following the next match.\n\n\t\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n\t\t\t\t\tfill_window();\n\t\t\t\t\tif (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t\t}\n\t\t\t\t\tif (lookahead === 0)\n\t\t\t\t\t\tbreak; // flush the current block\n\t\t\t\t}\n\n\t\t\t\t// Insert the string window[strstart .. strstart+2] in the\n\t\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n\n\t\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\t\thead[ins_h] = strstart;\n\t\t\t\t}\n\n\t\t\t\t// Find the longest match, discarding those <= prev_length.\n\t\t\t\tprev_length = match_length;\n\t\t\t\tprev_match = match_start;\n\t\t\t\tmatch_length = MIN_MATCH - 1;\n\n\t\t\t\tif (hash_head !== 0 && prev_length < max_lazy_match && ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n\t\t\t\t\t// To simplify the code, we prevent matches with the string\n\t\t\t\t\t// of window index 0 (in particular we have to avoid a match\n\t\t\t\t\t// of the string with itself at the start of the input file).\n\n\t\t\t\t\tif (strategy != Z_HUFFMAN_ONLY) {\n\t\t\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t\t\t}\n\t\t\t\t\t// longest_match() sets match_start\n\n\t\t\t\t\tif (match_length <= 5 && (strategy == Z_FILTERED || (match_length == MIN_MATCH && strstart - match_start > 4096))) {\n\n\t\t\t\t\t\t// If prev_match is also MIN_MATCH, match_start is garbage\n\t\t\t\t\t\t// but we will ignore the current match anyway.\n\t\t\t\t\t\tmatch_length = MIN_MATCH - 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If there was a match at the previous step and the current\n\t\t\t\t// match is not better, output the previous match:\n\t\t\t\tif (prev_length >= MIN_MATCH && match_length <= prev_length) {\n\t\t\t\t\tmax_insert = strstart + lookahead - MIN_MATCH;\n\t\t\t\t\t// Do not insert strings in hash table beyond this.\n\n\t\t\t\t\t// check_match(strstart-1, prev_match, prev_length);\n\n\t\t\t\t\tbflush = _tr_tally(strstart - 1 - prev_match, prev_length - MIN_MATCH);\n\n\t\t\t\t\t// Insert in hash table all strings up to the end of the match.\n\t\t\t\t\t// strstart-1 and strstart are already inserted. If there is not\n\t\t\t\t\t// enough lookahead, the last two strings are not inserted in\n\t\t\t\t\t// the hash table.\n\t\t\t\t\tlookahead -= prev_length - 1;\n\t\t\t\t\tprev_length -= 2;\n\t\t\t\t\tdo {\n\t\t\t\t\t\tif (++strstart <= max_insert) {\n\t\t\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\t\t\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\t\t\t\thead[ins_h] = strstart;\n\t\t\t\t\t\t}\n\t\t\t\t\t} while (--prev_length !== 0);\n\t\t\t\t\tmatch_available = 0;\n\t\t\t\t\tmatch_length = MIN_MATCH - 1;\n\t\t\t\t\tstrstart++;\n\n\t\t\t\t\tif (bflush) {\n\t\t\t\t\t\tflush_block_only(false);\n\t\t\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t\t}\n\t\t\t\t} else if (match_available !== 0) {\n\n\t\t\t\t\t// If there was no match at the previous position, output a\n\t\t\t\t\t// single literal. If there was a match but the current match\n\t\t\t\t\t// is longer, truncate the previous match to a single literal.\n\n\t\t\t\t\tbflush = _tr_tally(0, window[strstart - 1] & 0xff);\n\n\t\t\t\t\tif (bflush) {\n\t\t\t\t\t\tflush_block_only(false);\n\t\t\t\t\t}\n\t\t\t\t\tstrstart++;\n\t\t\t\t\tlookahead--;\n\t\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t} else {\n\t\t\t\t\t// There is no previous match to compare with, wait for\n\t\t\t\t\t// the next step to decide.\n\n\t\t\t\t\tmatch_available = 1;\n\t\t\t\t\tstrstart++;\n\t\t\t\t\tlookahead--;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (match_available !== 0) {\n\t\t\t\tbflush = _tr_tally(0, window[strstart - 1] & 0xff);\n\t\t\t\tmatch_available = 0;\n\t\t\t}\n\t\t\tflush_block_only(flush == Z_FINISH);\n\n\t\t\tif (strm.avail_out === 0) {\n\t\t\t\tif (flush == Z_FINISH)\n\t\t\t\t\treturn FinishStarted;\n\t\t\t\telse\n\t\t\t\t\treturn NeedMore;\n\t\t\t}\n\n\t\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n\t\t}", "title": "" }, { "docid": "81f958b4900f67c6970f36348777661d", "score": "0.63294035", "text": "function deflate_slow(s, flush) {\r\n var hash_head; /* head of hash chain */\r\n var bflush; /* set if current block must be flushed */\r\n\r\n var max_insert;\r\n\r\n /* Process the input block. */\r\n for (;;) {\r\n /* Make sure that we always have enough lookahead, except\r\n * at the end of the input file. We need MAX_MATCH bytes\r\n * for the next match, plus MIN_MATCH bytes to insert the\r\n * string following the next match.\r\n */\r\n if (s.lookahead < MIN_LOOKAHEAD) {\r\n fill_window(s);\r\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\r\n return BS_NEED_MORE;\r\n }\r\n if (s.lookahead === 0) { break; } /* flush the current block */\r\n }\r\n\r\n /* Insert the string window[strstart .. strstart+2] in the\r\n * dictionary, and set hash_head to the head of the hash chain:\r\n */\r\n hash_head = 0/*NIL*/;\r\n if (s.lookahead >= MIN_MATCH) {\r\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\r\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\r\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\r\n s.head[s.ins_h] = s.strstart;\r\n /***/\r\n }\r\n\r\n /* Find the longest match, discarding those <= prev_length.\r\n */\r\n s.prev_length = s.match_length;\r\n s.prev_match = s.match_start;\r\n s.match_length = MIN_MATCH - 1;\r\n\r\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\r\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\r\n /* To simplify the code, we prevent matches with the string\r\n * of window index 0 (in particular we have to avoid a match\r\n * of the string with itself at the start of the input file).\r\n */\r\n s.match_length = longest_match(s, hash_head);\r\n /* longest_match() sets match_start */\r\n\r\n if (s.match_length <= 5 &&\r\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\r\n\r\n /* If prev_match is also MIN_MATCH, match_start is garbage\r\n * but we will ignore the current match anyway.\r\n */\r\n s.match_length = MIN_MATCH - 1;\r\n }\r\n }\r\n /* If there was a match at the previous step and the current\r\n * match is not better, output the previous match:\r\n */\r\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\r\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\r\n /* Do not insert strings in hash table beyond this. */\r\n\r\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\r\n\r\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\r\n s.prev_length - MIN_MATCH, bflush);***/\r\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\r\n /* Insert in hash table all strings up to the end of the match.\r\n * strstart-1 and strstart are already inserted. If there is not\r\n * enough lookahead, the last two strings are not inserted in\r\n * the hash table.\r\n */\r\n s.lookahead -= s.prev_length - 1;\r\n s.prev_length -= 2;\r\n do {\r\n if (++s.strstart <= max_insert) {\r\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\r\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\r\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\r\n s.head[s.ins_h] = s.strstart;\r\n /***/\r\n }\r\n } while (--s.prev_length !== 0);\r\n s.match_available = 0;\r\n s.match_length = MIN_MATCH - 1;\r\n s.strstart++;\r\n\r\n if (bflush) {\r\n /*** FLUSH_BLOCK(s, 0); ***/\r\n flush_block_only(s, false);\r\n if (s.strm.avail_out === 0) {\r\n return BS_NEED_MORE;\r\n }\r\n /***/\r\n }\r\n\r\n } else if (s.match_available) {\r\n /* If there was no match at the previous position, output a\r\n * single literal. If there was a match but the current match\r\n * is longer, truncate the previous match to a single literal.\r\n */\r\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\r\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\r\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\r\n\r\n if (bflush) {\r\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\r\n flush_block_only(s, false);\r\n /***/\r\n }\r\n s.strstart++;\r\n s.lookahead--;\r\n if (s.strm.avail_out === 0) {\r\n return BS_NEED_MORE;\r\n }\r\n } else {\r\n /* There is no previous match to compare with, wait for\r\n * the next step to decide.\r\n */\r\n s.match_available = 1;\r\n s.strstart++;\r\n s.lookahead--;\r\n }\r\n }\r\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\r\n if (s.match_available) {\r\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\r\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\r\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\r\n\r\n s.match_available = 0;\r\n }\r\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\r\n if (flush === Z_FINISH) {\r\n /*** FLUSH_BLOCK(s, 1); ***/\r\n flush_block_only(s, true);\r\n if (s.strm.avail_out === 0) {\r\n return BS_FINISH_STARTED;\r\n }\r\n /***/\r\n return BS_FINISH_DONE;\r\n }\r\n if (s.last_lit) {\r\n /*** FLUSH_BLOCK(s, 0); ***/\r\n flush_block_only(s, false);\r\n if (s.strm.avail_out === 0) {\r\n return BS_NEED_MORE;\r\n }\r\n /***/\r\n }\r\n\r\n return BS_BLOCK_DONE;\r\n}", "title": "" }, { "docid": "81f958b4900f67c6970f36348777661d", "score": "0.63294035", "text": "function deflate_slow(s, flush) {\r\n var hash_head; /* head of hash chain */\r\n var bflush; /* set if current block must be flushed */\r\n\r\n var max_insert;\r\n\r\n /* Process the input block. */\r\n for (;;) {\r\n /* Make sure that we always have enough lookahead, except\r\n * at the end of the input file. We need MAX_MATCH bytes\r\n * for the next match, plus MIN_MATCH bytes to insert the\r\n * string following the next match.\r\n */\r\n if (s.lookahead < MIN_LOOKAHEAD) {\r\n fill_window(s);\r\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\r\n return BS_NEED_MORE;\r\n }\r\n if (s.lookahead === 0) { break; } /* flush the current block */\r\n }\r\n\r\n /* Insert the string window[strstart .. strstart+2] in the\r\n * dictionary, and set hash_head to the head of the hash chain:\r\n */\r\n hash_head = 0/*NIL*/;\r\n if (s.lookahead >= MIN_MATCH) {\r\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\r\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\r\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\r\n s.head[s.ins_h] = s.strstart;\r\n /***/\r\n }\r\n\r\n /* Find the longest match, discarding those <= prev_length.\r\n */\r\n s.prev_length = s.match_length;\r\n s.prev_match = s.match_start;\r\n s.match_length = MIN_MATCH - 1;\r\n\r\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\r\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\r\n /* To simplify the code, we prevent matches with the string\r\n * of window index 0 (in particular we have to avoid a match\r\n * of the string with itself at the start of the input file).\r\n */\r\n s.match_length = longest_match(s, hash_head);\r\n /* longest_match() sets match_start */\r\n\r\n if (s.match_length <= 5 &&\r\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\r\n\r\n /* If prev_match is also MIN_MATCH, match_start is garbage\r\n * but we will ignore the current match anyway.\r\n */\r\n s.match_length = MIN_MATCH - 1;\r\n }\r\n }\r\n /* If there was a match at the previous step and the current\r\n * match is not better, output the previous match:\r\n */\r\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\r\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\r\n /* Do not insert strings in hash table beyond this. */\r\n\r\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\r\n\r\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\r\n s.prev_length - MIN_MATCH, bflush);***/\r\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\r\n /* Insert in hash table all strings up to the end of the match.\r\n * strstart-1 and strstart are already inserted. If there is not\r\n * enough lookahead, the last two strings are not inserted in\r\n * the hash table.\r\n */\r\n s.lookahead -= s.prev_length - 1;\r\n s.prev_length -= 2;\r\n do {\r\n if (++s.strstart <= max_insert) {\r\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\r\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\r\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\r\n s.head[s.ins_h] = s.strstart;\r\n /***/\r\n }\r\n } while (--s.prev_length !== 0);\r\n s.match_available = 0;\r\n s.match_length = MIN_MATCH - 1;\r\n s.strstart++;\r\n\r\n if (bflush) {\r\n /*** FLUSH_BLOCK(s, 0); ***/\r\n flush_block_only(s, false);\r\n if (s.strm.avail_out === 0) {\r\n return BS_NEED_MORE;\r\n }\r\n /***/\r\n }\r\n\r\n } else if (s.match_available) {\r\n /* If there was no match at the previous position, output a\r\n * single literal. If there was a match but the current match\r\n * is longer, truncate the previous match to a single literal.\r\n */\r\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\r\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\r\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\r\n\r\n if (bflush) {\r\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\r\n flush_block_only(s, false);\r\n /***/\r\n }\r\n s.strstart++;\r\n s.lookahead--;\r\n if (s.strm.avail_out === 0) {\r\n return BS_NEED_MORE;\r\n }\r\n } else {\r\n /* There is no previous match to compare with, wait for\r\n * the next step to decide.\r\n */\r\n s.match_available = 1;\r\n s.strstart++;\r\n s.lookahead--;\r\n }\r\n }\r\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\r\n if (s.match_available) {\r\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\r\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\r\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\r\n\r\n s.match_available = 0;\r\n }\r\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\r\n if (flush === Z_FINISH) {\r\n /*** FLUSH_BLOCK(s, 1); ***/\r\n flush_block_only(s, true);\r\n if (s.strm.avail_out === 0) {\r\n return BS_FINISH_STARTED;\r\n }\r\n /***/\r\n return BS_FINISH_DONE;\r\n }\r\n if (s.last_lit) {\r\n /*** FLUSH_BLOCK(s, 0); ***/\r\n flush_block_only(s, false);\r\n if (s.strm.avail_out === 0) {\r\n return BS_NEED_MORE;\r\n }\r\n /***/\r\n }\r\n\r\n return BS_BLOCK_DONE;\r\n}", "title": "" }, { "docid": "55ea0bda49ce789b47f12f6c122f1cef", "score": "0.6320948", "text": "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$1) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH$2) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "cc25e8accda80aec5d2da86ceb181ae4", "score": "0.63184196", "text": "function deflate_fast(s, flush) {\n\t var hash_head; /* head of the hash chain */\n\t var bflush; /* set if current block must be flushed */\n\n\t for (;;) {\n\t /* Make sure that we always have enough lookahead, except\n\t * at the end of the input file. We need MAX_MATCH bytes\n\t * for the next match, plus MIN_MATCH bytes to insert the\n\t * string following the next match.\n\t */\n\t if (s.lookahead < MIN_LOOKAHEAD) {\n\t fill_window(s);\n\t if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n\t return BS_NEED_MORE;\n\t }\n\t if (s.lookahead === 0) {\n\t break; /* flush the current block */\n\t }\n\t }\n\n\t /* Insert the string window[strstart .. strstart+2] in the\n\t * dictionary, and set hash_head to the head of the hash chain:\n\t */\n\t hash_head = 0 /*NIL*/;\n\t if (s.lookahead >= MIN_MATCH) {\n\t /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\t s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n\t hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n\t s.head[s.ins_h] = s.strstart;\n\t /***/\n\t }\n\n\t /* Find the longest match, discarding those <= prev_length.\n\t * At this point we have always match_length < MIN_MATCH\n\t */\n\t if (hash_head !== 0 /*NIL*/ && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n\t /* To simplify the code, we prevent matches with the string\n\t * of window index 0 (in particular we have to avoid a match\n\t * of the string with itself at the start of the input file).\n\t */\n\t s.match_length = longest_match(s, hash_head);\n\t /* longest_match() sets match_start */\n\t }\n\t if (s.match_length >= MIN_MATCH) {\n\t // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n\t /*** _tr_tally_dist(s, s.strstart - s.match_start,\n\t s.match_length - MIN_MATCH, bflush); ***/\n\t bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n\t s.lookahead -= s.match_length;\n\n\t /* Insert new strings in the hash table only if the match length\n\t * is not too large. This saves time but degrades compression.\n\t */\n\t if (s.match_length <= s.max_lazy_match /*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n\t s.match_length--; /* string at strstart already in table */\n\t do {\n\t s.strstart++;\n\t /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\t s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n\t hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n\t s.head[s.ins_h] = s.strstart;\n\t /***/\n\t /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n\t * always MIN_MATCH bytes ahead.\n\t */\n\t } while (--s.match_length !== 0);\n\t s.strstart++;\n\t } else {\n\t s.strstart += s.match_length;\n\t s.match_length = 0;\n\t s.ins_h = s.window[s.strstart];\n\t /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n\t s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n\t //#if MIN_MATCH != 3\n\t // Call UPDATE_HASH() MIN_MATCH-3 more times\n\t //#endif\n\t /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n\t * matter since it will be recomputed at next deflate call.\n\t */\n\t }\n\t } else {\n\t /* No match, output a literal byte */\n\t //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n\t /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n\t bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n\t s.lookahead--;\n\t s.strstart++;\n\t }\n\t if (bflush) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t }\n\t s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n\t if (flush === Z_FINISH) {\n\t /*** FLUSH_BLOCK(s, 1); ***/\n\t flush_block_only(s, true);\n\t if (s.strm.avail_out === 0) {\n\t return BS_FINISH_STARTED;\n\t }\n\t /***/\n\t return BS_FINISH_DONE;\n\t }\n\t if (s.last_lit) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t return BS_BLOCK_DONE;\n\t }", "title": "" }, { "docid": "6437fc7decc81947736637e9566d36f0", "score": "0.63000244", "text": "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0 /*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0 /*NIL*/ && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match /*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n //#if MIN_MATCH != 3\n // Call UPDATE_HASH() MIN_MATCH-3 more times\n //#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "68c2db5c656aff886897f63838a6ed2e", "score": "0.6284709", "text": "function compress_block(s,ltree,dtree) // deflate_state *s;\n // const ct_data *ltree; /* literal tree */\n // const ct_data *dtree; /* distance tree */\n {var dist; /* distance of matched string */var lc; /* match length or unmatched char (if dist == 0) */var lx=0; /* running index in l_buf */var code; /* the code to send */var extra; /* number of extra bits to send */if(s.last_lit!==0){do {dist=s.pending_buf[s.d_buf+lx*2]<<8|s.pending_buf[s.d_buf+lx*2+1];lc=s.pending_buf[s.l_buf+lx];lx++;if(dist===0){send_code(s,lc,ltree); /* send a literal byte */ //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n }else { /* Here, lc is the match length - MIN_MATCH */code=_length_code[lc];send_code(s,code+LITERALS+1,ltree); /* send the length code */extra=extra_lbits[code];if(extra!==0){lc-=base_length[code];send_bits(s,lc,extra); /* send the extra length bits */}dist--; /* dist is now the match distance - 1 */code=d_code(dist); //Assert (code < D_CODES, \"bad d_code\");\n send_code(s,code,dtree); /* send the distance code */extra=extra_dbits[code];if(extra!==0){dist-=base_dist[code];send_bits(s,dist,extra); /* send the extra distance bits */}} /* literal or match pair ? */ /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,\n // \"pendingBuf overflow\");\n }while(lx<s.last_lit);}send_code(s,END_BLOCK,ltree);}", "title": "" }, { "docid": "4e0844e35e428fc6b394c85e2789d870", "score": "0.6281818", "text": "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0;\n /*NIL*/if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0 /*NIL*/ && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match /*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n //#if MIN_MATCH != 3\n // Call UPDATE_HASH() MIN_MATCH-3 more times\n //#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "title": "" }, { "docid": "fa7b8343b442ab0f71b927c8121c01d7", "score": "0.6278382", "text": "function deflate_slow(s, flush) {\n\t var hash_head; /* head of hash chain */\n\t var bflush; /* set if current block must be flushed */\n\t\n\t var max_insert;\n\t\n\t /* Process the input block. */\n\t for (;;) {\n\t /* Make sure that we always have enough lookahead, except\n\t * at the end of the input file. We need MAX_MATCH bytes\n\t * for the next match, plus MIN_MATCH bytes to insert the\n\t * string following the next match.\n\t */\n\t if (s.lookahead < MIN_LOOKAHEAD) {\n\t fill_window(s);\n\t if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n\t return BS_NEED_MORE;\n\t }\n\t if (s.lookahead === 0) { break; } /* flush the current block */\n\t }\n\t\n\t /* Insert the string window[strstart .. strstart+2] in the\n\t * dictionary, and set hash_head to the head of the hash chain:\n\t */\n\t hash_head = 0/*NIL*/;\n\t if (s.lookahead >= MIN_MATCH) {\n\t /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n\t hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n\t s.head[s.ins_h] = s.strstart;\n\t /***/\n\t }\n\t\n\t /* Find the longest match, discarding those <= prev_length.\n\t */\n\t s.prev_length = s.match_length;\n\t s.prev_match = s.match_start;\n\t s.match_length = MIN_MATCH - 1;\n\t\n\t if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n\t s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n\t /* To simplify the code, we prevent matches with the string\n\t * of window index 0 (in particular we have to avoid a match\n\t * of the string with itself at the start of the input file).\n\t */\n\t s.match_length = longest_match(s, hash_head);\n\t /* longest_match() sets match_start */\n\t\n\t if (s.match_length <= 5 &&\n\t (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\t\n\t /* If prev_match is also MIN_MATCH, match_start is garbage\n\t * but we will ignore the current match anyway.\n\t */\n\t s.match_length = MIN_MATCH - 1;\n\t }\n\t }\n\t /* If there was a match at the previous step and the current\n\t * match is not better, output the previous match:\n\t */\n\t if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n\t max_insert = s.strstart + s.lookahead - MIN_MATCH;\n\t /* Do not insert strings in hash table beyond this. */\n\t\n\t //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\t\n\t /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n\t s.prev_length - MIN_MATCH, bflush);***/\n\t bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n\t /* Insert in hash table all strings up to the end of the match.\n\t * strstart-1 and strstart are already inserted. If there is not\n\t * enough lookahead, the last two strings are not inserted in\n\t * the hash table.\n\t */\n\t s.lookahead -= s.prev_length - 1;\n\t s.prev_length -= 2;\n\t do {\n\t if (++s.strstart <= max_insert) {\n\t /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n\t hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n\t s.head[s.ins_h] = s.strstart;\n\t /***/\n\t }\n\t } while (--s.prev_length !== 0);\n\t s.match_available = 0;\n\t s.match_length = MIN_MATCH - 1;\n\t s.strstart++;\n\t\n\t if (bflush) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t\n\t } else if (s.match_available) {\n\t /* If there was no match at the previous position, output a\n\t * single literal. If there was a match but the current match\n\t * is longer, truncate the previous match to a single literal.\n\t */\n\t //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\t /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n\t bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\t\n\t if (bflush) {\n\t /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n\t flush_block_only(s, false);\n\t /***/\n\t }\n\t s.strstart++;\n\t s.lookahead--;\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t } else {\n\t /* There is no previous match to compare with, wait for\n\t * the next step to decide.\n\t */\n\t s.match_available = 1;\n\t s.strstart++;\n\t s.lookahead--;\n\t }\n\t }\n\t //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n\t if (s.match_available) {\n\t //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\t /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n\t bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\t\n\t s.match_available = 0;\n\t }\n\t s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n\t if (flush === Z_FINISH) {\n\t /*** FLUSH_BLOCK(s, 1); ***/\n\t flush_block_only(s, true);\n\t if (s.strm.avail_out === 0) {\n\t return BS_FINISH_STARTED;\n\t }\n\t /***/\n\t return BS_FINISH_DONE;\n\t }\n\t if (s.last_lit) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t\n\t return BS_BLOCK_DONE;\n\t}", "title": "" }, { "docid": "fa7b8343b442ab0f71b927c8121c01d7", "score": "0.6278382", "text": "function deflate_slow(s, flush) {\n\t var hash_head; /* head of hash chain */\n\t var bflush; /* set if current block must be flushed */\n\t\n\t var max_insert;\n\t\n\t /* Process the input block. */\n\t for (;;) {\n\t /* Make sure that we always have enough lookahead, except\n\t * at the end of the input file. We need MAX_MATCH bytes\n\t * for the next match, plus MIN_MATCH bytes to insert the\n\t * string following the next match.\n\t */\n\t if (s.lookahead < MIN_LOOKAHEAD) {\n\t fill_window(s);\n\t if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n\t return BS_NEED_MORE;\n\t }\n\t if (s.lookahead === 0) { break; } /* flush the current block */\n\t }\n\t\n\t /* Insert the string window[strstart .. strstart+2] in the\n\t * dictionary, and set hash_head to the head of the hash chain:\n\t */\n\t hash_head = 0/*NIL*/;\n\t if (s.lookahead >= MIN_MATCH) {\n\t /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n\t hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n\t s.head[s.ins_h] = s.strstart;\n\t /***/\n\t }\n\t\n\t /* Find the longest match, discarding those <= prev_length.\n\t */\n\t s.prev_length = s.match_length;\n\t s.prev_match = s.match_start;\n\t s.match_length = MIN_MATCH - 1;\n\t\n\t if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n\t s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n\t /* To simplify the code, we prevent matches with the string\n\t * of window index 0 (in particular we have to avoid a match\n\t * of the string with itself at the start of the input file).\n\t */\n\t s.match_length = longest_match(s, hash_head);\n\t /* longest_match() sets match_start */\n\t\n\t if (s.match_length <= 5 &&\n\t (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\t\n\t /* If prev_match is also MIN_MATCH, match_start is garbage\n\t * but we will ignore the current match anyway.\n\t */\n\t s.match_length = MIN_MATCH - 1;\n\t }\n\t }\n\t /* If there was a match at the previous step and the current\n\t * match is not better, output the previous match:\n\t */\n\t if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n\t max_insert = s.strstart + s.lookahead - MIN_MATCH;\n\t /* Do not insert strings in hash table beyond this. */\n\t\n\t //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\t\n\t /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n\t s.prev_length - MIN_MATCH, bflush);***/\n\t bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n\t /* Insert in hash table all strings up to the end of the match.\n\t * strstart-1 and strstart are already inserted. If there is not\n\t * enough lookahead, the last two strings are not inserted in\n\t * the hash table.\n\t */\n\t s.lookahead -= s.prev_length - 1;\n\t s.prev_length -= 2;\n\t do {\n\t if (++s.strstart <= max_insert) {\n\t /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n\t hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n\t s.head[s.ins_h] = s.strstart;\n\t /***/\n\t }\n\t } while (--s.prev_length !== 0);\n\t s.match_available = 0;\n\t s.match_length = MIN_MATCH - 1;\n\t s.strstart++;\n\t\n\t if (bflush) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t\n\t } else if (s.match_available) {\n\t /* If there was no match at the previous position, output a\n\t * single literal. If there was a match but the current match\n\t * is longer, truncate the previous match to a single literal.\n\t */\n\t //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\t /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n\t bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\t\n\t if (bflush) {\n\t /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n\t flush_block_only(s, false);\n\t /***/\n\t }\n\t s.strstart++;\n\t s.lookahead--;\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t } else {\n\t /* There is no previous match to compare with, wait for\n\t * the next step to decide.\n\t */\n\t s.match_available = 1;\n\t s.strstart++;\n\t s.lookahead--;\n\t }\n\t }\n\t //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n\t if (s.match_available) {\n\t //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\t /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n\t bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\t\n\t s.match_available = 0;\n\t }\n\t s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n\t if (flush === Z_FINISH) {\n\t /*** FLUSH_BLOCK(s, 1); ***/\n\t flush_block_only(s, true);\n\t if (s.strm.avail_out === 0) {\n\t return BS_FINISH_STARTED;\n\t }\n\t /***/\n\t return BS_FINISH_DONE;\n\t }\n\t if (s.last_lit) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t\n\t return BS_BLOCK_DONE;\n\t}", "title": "" }, { "docid": "69a9e1c7ef1533b219207985abb5c293", "score": "0.6278211", "text": "function deflate_fast(flush) { // 7544\n\t\t\t// short hash_head = 0; // head of the hash chain // 7545\n\t\t\tvar hash_head = 0; // head of the hash chain // 7546\n\t\t\tvar bflush; // set if current block must be flushed // 7547\n // 7548\n\t\t\twhile (true) { // 7549\n\t\t\t\t// Make sure that we always have enough lookahead, except // 7550\n\t\t\t\t// at the end of the input file. We need MAX_MATCH bytes // 7551\n\t\t\t\t// for the next match, plus MIN_MATCH bytes to insert the // 7552\n\t\t\t\t// string following the next match. // 7553\n\t\t\t\tif (lookahead < MIN_LOOKAHEAD) { // 7554\n\t\t\t\t\tfill_window(); // 7555\n\t\t\t\t\tif (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { // 7556\n\t\t\t\t\t\treturn NeedMore; // 7557\n\t\t\t\t\t} // 7558\n\t\t\t\t\tif (lookahead === 0) // 7559\n\t\t\t\t\t\tbreak; // flush the current block // 7560\n\t\t\t\t} // 7561\n // 7562\n\t\t\t\t// Insert the string window[strstart .. strstart+2] in the // 7563\n\t\t\t\t// dictionary, and set hash_head to the head of the hash chain: // 7564\n\t\t\t\tif (lookahead >= MIN_MATCH) { // 7565\n\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask; // 7566\n // 7567\n\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h]; // 7568\n\t\t\t\t\thash_head = (head[ins_h] & 0xffff); // 7569\n\t\t\t\t\tprev[strstart & w_mask] = head[ins_h]; // 7570\n\t\t\t\t\thead[ins_h] = strstart; // 7571\n\t\t\t\t} // 7572\n // 7573\n\t\t\t\t// Find the longest match, discarding those <= prev_length. // 7574\n\t\t\t\t// At this point we have always match_length < MIN_MATCH // 7575\n // 7576\n\t\t\t\tif (hash_head !== 0 && ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) { // 7577\n\t\t\t\t\t// To simplify the code, we prevent matches with the string // 7578\n\t\t\t\t\t// of window index 0 (in particular we have to avoid a match // 7579\n\t\t\t\t\t// of the string with itself at the start of the input file). // 7580\n\t\t\t\t\tif (strategy != Z_HUFFMAN_ONLY) { // 7581\n\t\t\t\t\t\tmatch_length = longest_match(hash_head); // 7582\n\t\t\t\t\t} // 7583\n\t\t\t\t\t// longest_match() sets match_start // 7584\n\t\t\t\t} // 7585\n\t\t\t\tif (match_length >= MIN_MATCH) { // 7586\n\t\t\t\t\t// check_match(strstart, match_start, match_length); // 7587\n // 7588\n\t\t\t\t\tbflush = _tr_tally(strstart - match_start, match_length - MIN_MATCH); // 7589\n // 7590\n\t\t\t\t\tlookahead -= match_length; // 7591\n // 7592\n\t\t\t\t\t// Insert new strings in the hash table only if the match length // 7593\n\t\t\t\t\t// is not too large. This saves time but degrades compression. // 7594\n\t\t\t\t\tif (match_length <= max_lazy_match && lookahead >= MIN_MATCH) { // 7595\n\t\t\t\t\t\tmatch_length--; // string at strstart already in hash table // 7596\n\t\t\t\t\t\tdo { // 7597\n\t\t\t\t\t\t\tstrstart++; // 7598\n // 7599\n\t\t\t\t\t\t\tins_h = ((ins_h << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask; // 7600\n\t\t\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h]; // 7601\n\t\t\t\t\t\t\thash_head = (head[ins_h] & 0xffff); // 7602\n\t\t\t\t\t\t\tprev[strstart & w_mask] = head[ins_h]; // 7603\n\t\t\t\t\t\t\thead[ins_h] = strstart; // 7604\n // 7605\n\t\t\t\t\t\t\t// strstart never exceeds WSIZE-MAX_MATCH, so there are // 7606\n\t\t\t\t\t\t\t// always MIN_MATCH bytes ahead. // 7607\n\t\t\t\t\t\t} while (--match_length !== 0); // 7608\n\t\t\t\t\t\tstrstart++; // 7609\n\t\t\t\t\t} else { // 7610\n\t\t\t\t\t\tstrstart += match_length; // 7611\n\t\t\t\t\t\tmatch_length = 0; // 7612\n\t\t\t\t\t\tins_h = window[strstart] & 0xff; // 7613\n // 7614\n\t\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[strstart + 1] & 0xff)) & hash_mask; // 7615\n\t\t\t\t\t\t// If lookahead < MIN_MATCH, ins_h is garbage, but it does // 7616\n\t\t\t\t\t\t// not // 7617\n\t\t\t\t\t\t// matter since it will be recomputed at next deflate call. // 7618\n\t\t\t\t\t} // 7619\n\t\t\t\t} else { // 7620\n\t\t\t\t\t// No match, output a literal byte // 7621\n // 7622\n\t\t\t\t\tbflush = _tr_tally(0, window[strstart] & 0xff); // 7623\n\t\t\t\t\tlookahead--; // 7624\n\t\t\t\t\tstrstart++; // 7625\n\t\t\t\t} // 7626\n\t\t\t\tif (bflush) { // 7627\n // 7628\n\t\t\t\t\tflush_block_only(false); // 7629\n\t\t\t\t\tif (strm.avail_out === 0) // 7630\n\t\t\t\t\t\treturn NeedMore; // 7631\n\t\t\t\t} // 7632\n\t\t\t} // 7633\n // 7634\n\t\t\tflush_block_only(flush == Z_FINISH); // 7635\n\t\t\tif (strm.avail_out === 0) { // 7636\n\t\t\t\tif (flush == Z_FINISH) // 7637\n\t\t\t\t\treturn FinishStarted; // 7638\n\t\t\t\telse // 7639\n\t\t\t\t\treturn NeedMore; // 7640\n\t\t\t} // 7641\n\t\t\treturn flush == Z_FINISH ? FinishDone : BlockDone; // 7642\n\t\t} // 7643", "title": "" } ]
b5736285a325c47809495c7cab28b5ed
Catch all exit posix codes and stop server gracefully. Also bind q key to exit.
[ { "docid": "6591d1e3cd8108a1c54118c9a8f33616", "score": "0.7369915", "text": "function exit(signal) {\n socket.close(() => {\n cli.log('Stopped server.');\n process.exit(signal === 'ERR' ? 1 : 0);\n });\n}", "title": "" } ]
[ { "docid": "9dfba6eda724418230543aabba059abc", "score": "0.6939805", "text": "function initTerminateHandlers() {\n var readLine;\n\n if (process.platform === \"win32\"){\n readLine = require(\"readline\");\n\n readLine.createInterface ({\n input: process.stdin,\n output: process.stdout\n }).on(\"SIGINT\", function () {\n process.emit(\"SIGINT\");\n });\n }\n\n // handle INTERRUPT (CTRL+C) and TERM/KILL signals\n process.on('exit', function () {\n if (server) {\n console.log(chalk.blue('*'), 'Shutting down server');\n server.stop();\n }\n console.log(); // extra blank line\n });\n process.on('SIGINT', function () {\n console.log(chalk.blue.bold('!'), chalk.yellow.bold('SIGINT'), 'detected');\n process.exit();\n });\n process.on('SIGTERM', function () {\n console.log(chalk.blue.bold('!'), chalk.yellow.bold('SIGTERM'), 'detected');\n process.exit(0);\n });\n}", "title": "" }, { "docid": "561c66c7aae0df9407d3bdd820bd954d", "score": "0.6772231", "text": "function exitHandler(options, err) {\n\texec('sudo /etc/init.d/lirc stop', function(error, stdout, stderr) {\n\t\tconsole.log('stdout: ' + stdout);\n\t\tconsole.log('stderr: ' + stderr);\n\t\tif (error) {\n\t\t\tthrow(error);\n\t\t}\n\t\t\n\t});\n}", "title": "" }, { "docid": "b9b66f92ab5f85e33cbcb75afdf0074c", "score": "0.6726274", "text": "function fnExit(signal) { //exit handler\n\tconsole.log(\"\\n--------------------\");\n\tconsole.log(\"> Received [\" + signal + \"].\");\n\tconsole.log(\"--------------------\");\n\n\tdao.close();\n\tsession.close();\n\tserver.close();\n\tsecsrv.close();\n\n\tconsole.log(\"> Http server closed.\");\n\tconsole.log(\"> \" + (new Date()));\n\tconsole.log(\"--------------------\\n\");\n\tprocess.exit(0);\n}", "title": "" }, { "docid": "8bbadd74ebaea251f6ff96b11bb9d5a3", "score": "0.6685012", "text": "_bind_exit_handler() {\n let reference = this;\n ['exit', 'SIGINT', 'SIGUSR1', 'SIGUSR2', 'SIGTERM'].forEach((type) =>\n process.once(type, () => reference.close())\n );\n }", "title": "" }, { "docid": "42617d175574f3a04a1189b324b4ce64", "score": "0.66818327", "text": "function shutdown() {\n console.log('\\nGot a stop signal, shutting down...');\n process.exit(1);\n}", "title": "" }, { "docid": "d3eab76c4576730955cf6485e26aad87", "score": "0.6667114", "text": "async function exitHandler(options = {}) {\n await server\n .close()\n .then(() => {\n console.info('Server has been shut down successfuly')\n })\n .catch(e => {\n console.warn('An error ocurred while shutting down the server', e.stack)\n })\n if (options.exit) process.exit()\n }", "title": "" }, { "docid": "300a6eb1b7b59c057827d8804c8dd320", "score": "0.66499865", "text": "function handleClose() {\n console.log('server closed!');\n process.exit();\n}", "title": "" }, { "docid": "42e834229a5e254304f1d928b2a5a610", "score": "0.6629558", "text": "function terminationHandler (options, err) {\n\tif (err) {\n \t\tconsole.log (\"\\ntermination err: \" + err); //this is a custom error object, not a standard one\n \t}\n\n\tif (options.cleanup) {\n\t\tconsole.log ('Exiting...');\n\t\t//periodic.shutdown ();\n\t\tscreen.shutdown ();\n\t\tprocess.exit();\n\t}\n\n\tif (options.exit) {\n\t\tconsole.log (`\\n(Ctrl-C) server terminating.\\n`);\n\t\tperiodic.shutdown ();\n\t\t//screen.shutdown ();\n\t\tprocess.exit();\n\t}\n}", "title": "" }, { "docid": "91e0acbeb6481fea5df22fd1fabc29a7", "score": "0.66275823", "text": "function exitHandler(options, exitCode) {\n for (const handler of exitHandlers) {\n handler();\n }\n if (exitCode || exitCode === 0) {\n if (typeof exitCode !== 'number') {\n /** not a 'clean' exit log to console */\n console.log(exitCode);\n }\n }\n // TODO: kill the server here. (but only if started from scully, not when started from another process)\n if (options.exit) {\n if (browser) {\n browser.close().then(() => process.exit(exitCode));\n }\n else {\n process.exit(exitCode);\n }\n }\n }", "title": "" }, { "docid": "c646d43f0bb5bc0ee4f8b997ac4761d7", "score": "0.65105885", "text": "function exitHandler(options, exitCode) {\n client.say(channel,'GITSbot1000 signing off. Thanks for watching. GG everyone!');\n \n if (options.cleanup) console.log('clean');\n if (exitCode || exitCode === 0) console.log(exitCode);\n if (options.exit) process.exit();\n}", "title": "" }, { "docid": "15e35b00cb5b9f0355fbff06ff4c4c8a", "score": "0.65023774", "text": "function processTerminator(sig) {\n if (typeof sig === 'string') {\n process.exit(1);\n }\n console.log('%s: Node server stopped.', Date(Date.now()));\n}", "title": "" }, { "docid": "0501288a92472889b3f40f887d6e0570", "score": "0.6489653", "text": "function exitHandler(options, err) {\n var sshKeys = Object.keys(sshPortMap);\n var vncKeys = Object.keys(vncPortMap);\n \n _.each(sshKeys, function (item, index) {\n destroyTunnle(sshPortMap[item]);\n });\n\n _.each(vncKeys, function (item, index) {\n destroyTunnle(sshPortMap[item]);\n });\n\n process.exit();\n}", "title": "" }, { "docid": "bed52460a329aed0905e410f24875611", "score": "0.6488019", "text": "function processTerminator(sig) {\n if (typeof sig === 'string') {\n process.exit(1);\n }\n console.log('%s: Node server stopped.', Date(Date.now()));\n}", "title": "" }, { "docid": "6e36000a15b16e1351d2ab7011a122d0", "score": "0.64670557", "text": "function exitHandler(options, exitCode){\n if(options.cleanup){\n cmd.run('kill ' + rProc.pid);\n }\n\n if(exitCode || exitCode == 0){\n console.log(exitCode);\n }\n if(options.exit){\n process.exit();\n }\n}", "title": "" }, { "docid": "4e24f7995ad08bfaac7b376f266cc412", "score": "0.6385194", "text": "function handle(signal) {\n console.log(`received ${signal}`);\n server.close(() => {\n console.log('server closed');\n process.exit(0);\n });\n}", "title": "" }, { "docid": "83f44ecb18cff5f39dbe4e1eb8b51a63", "score": "0.63848585", "text": "async function exitHandler(options, exitCode) {\n if (browser) {\n if (typeof wsDebuggerHash == 'string' && wsDebuggerHash) {\n // pass\n } else {\n await browser.close();\n browser = null;\n }\n }\n\n if (options.cleanup) {\n console.log('clean up');\n }\n if (exitCode || exitCode === 0) {\n console.log(exitCode);\n }\n if (options.exit) {\n process.exit();\n }\n}", "title": "" }, { "docid": "708d2f9455b2b8e41cad3a7f7ea51642", "score": "0.6366643", "text": "function exit() {\n send('exit');\n }", "title": "" }, { "docid": "d88afb7427f030f3b119343ff8b65854", "score": "0.63385904", "text": "function setupCloseOnExit(server) {\n async function exitHandler(options = {}) {\n await server\n .close()\n .then(() => {\n console.info(`Server successfully closed at ${currentTime}`);\n })\n .catch((e) => {\n console.warn(`Something went wrong closing the server at ${currentTime}`, e.stack);\n });\n\n if (options.exit) {\n if (options.exit) {\n // process.exit();\n throw new Error(`Exit process.exit Node JS at ${currentTime}`);\n }\n }\n }\n\n // do something when app is closing\n process.on(\"exit\", exitHandler);\n // catches ctrl+c event\n process.on(\"SIGINT\", exitHandler.bind(null, { exit: true }));\n // catches \"kill pid\" (for example: nodemon restart)\n process.on(\"SIGUSR1\", exitHandler.bind(null, { exit: true }));\n process.on(\"SIGUSR2\", exitHandler.bind(null, { exit: true }));\n // catches uncaught exceptions\n process.on(\"uncaughtException\", (err) => {\n console.error(\"Caught exception: \", err);\n });\n}", "title": "" }, { "docid": "87a6f154963e6fd7bc7282caa68accf6", "score": "0.6321331", "text": "function handle(signal) {\n console.log('Received exit signal. Bye!');\n process.exit(-1)\n }", "title": "" }, { "docid": "87a6f154963e6fd7bc7282caa68accf6", "score": "0.6321331", "text": "function handle(signal) {\n console.log('Received exit signal. Bye!');\n process.exit(-1)\n }", "title": "" }, { "docid": "52975db27960657ef9c50e3c2afb8e2f", "score": "0.63128626", "text": "function gracefulShutdown(){\n console.log('About to exit, closing servers.');\n\n servers.forEach(function(server, index){\n server.close();\n });\n\n process.exit();\n}", "title": "" }, { "docid": "755f5fc112d32792476f85fe1a153616", "score": "0.63077253", "text": "function exitHandler(options, err) {\n\tstopBot( ).then( ( r ) => {\n\tif (options.cleanup) console.log('clean');\n\tif (err) console.log(err.stack);\n\tif (options.exit) process.exit();\n\t} );\n}", "title": "" }, { "docid": "fe4e2c42b7e4f227af2794cf9c6f722d", "score": "0.6290391", "text": "function sigterm() {\n return stop('SIGTERM');\n}", "title": "" }, { "docid": "836518df7cbc74a6fb9c1abad0b5abbb", "score": "0.6288717", "text": "async function exitHandler(options, exitCode) {\n console.log(options, exitCode);\n //Burada botun aktif olmadığına dair ana gruba mesaj atabiliriz\n //Yada botun durumunu, açıklamasını veya başka bir özelliğini değiştirerek çalışır olmadığını gösterebiliriz\n await cb();\n\n // if (options.cleanup) console.log('clean');\n // if (exitCode || exitCode === 0) console.log(exitCode);\n if (options.exit) process.exit();\n\n }", "title": "" }, { "docid": "00a5d8bf6e7c1c267fb4c58ed5f73e90", "score": "0.62526876", "text": "function shutdown(exitCode) {\n logger.info('Server stopping...')\n\n server.close(() => {\n logger.info('Server stopped')\n process.exitCode = exitCode\n })\n\n // Forcibly shutdown after 10 seconds\n setTimeout(() => {\n throw new Error('Forcibly shutting down')\n }, 10000).unref()\n}", "title": "" }, { "docid": "48bc9f83622f165eb63aceaaef468f24", "score": "0.621217", "text": "function setupCloseOnExit(server) {\n // thank you stack overflow\n // https://stackoverflow.com/a/14032965/971592\n async function exitHandler(options = {}) {\n await server\n .close()\n .then(() => {\n console.info('Server has been shut down successfuly')\n })\n .catch(e => {\n console.warn('An error ocurred while shutting down the server', e.stack)\n })\n if (options.exit) process.exit()\n }\n\n // do something when app is closing\n process.on('exit', exitHandler)\n\n // catches ctrl+c event\n process.on('SIGINT', exitHandler.bind(null, { exit: true }))\n\n // catches \"kill pid\" (for example: nodemon restart)\n process.on('SIGUSR1', exitHandler.bind(null, { exit: true }))\n process.on('SIGUSR2', exitHandler.bind(null, { exit: true }))\n\n // catches uncaught exceptions\n process.on('uncaughtException', exitHandler.bind(null, { exit: true }))\n}", "title": "" }, { "docid": "4bce80f211ec22d2f43ab33e95ad92fc", "score": "0.6202486", "text": "function exitHandler(options, err){\n\tif(options.cleanup){\n\t\tglobal.reportNotify('WSAPP', 'EXITING APP', 0);\n\t\t//close mysql connections\n\t\t//Connection.terminateAll();\n\t}\n\tif(err){\n\t\tconsole.log(err.stack);\n\t}\n\tif(options.exit){\n\t\tprocess.exit();\n\t}\n}", "title": "" }, { "docid": "fbb03c3822b2462f95ce83cd44569e31", "score": "0.61925614", "text": "function cleanExit() {\n serviceHelper.log(\n 'warn',\n 'Service stopping',\n );\n serviceHelper.log(\n 'trace',\n 'Close rest server',\n );\n server.close(() => {\n serviceHelper.log(\n 'info',\n 'Exit the app',\n );\n process.exit(1); // Exit app\n });\n }", "title": "" }, { "docid": "be1af8e03b1b8a97fa0c5ada56a37e30", "score": "0.6183949", "text": "function exitHandler(options, exitCode) {\n endCalls();\n if (options.cleanup) console.log('clean');\n if (exitCode || exitCode === 0) console.log(exitCode);\n if (options.exit) process.exit();\n}", "title": "" }, { "docid": "96318b19f94390fa19642748450d9090", "score": "0.61807674", "text": "function finish() {\n console.log(\"closing ports...\");\n for(var i = 0; i < 127; ++i)\n output.sendMessage([NOTEOFF,i,127]);\n output.closePort();\n process.exit(0);\n}", "title": "" }, { "docid": "dec6e5a332ae9e5b4e8c1857f0d64289", "score": "0.61710995", "text": "function handleExit(options, err) {\n if (options.cleanup) {\n const actions = [server.close, db.destroy];\n actions.forEach((close, i) => {\n try {\n close(() => {\n if (i === actions.length - 1) process.exit();\n });\n } catch (err) {\n if (i === actions.length - 1) process.exit();\n }\n });\n }\n if (err) console.error(err);\n if (options.exit) process.exit();\n}", "title": "" }, { "docid": "6a67681d6e58d404338b6840734364d0", "score": "0.6168537", "text": "function exitOnSignal(signal) {\n process.on(signal, function () {\n logger.warn(i18n.__('app.serverShutdown', signal));\n process.exit(1);\n });\n}", "title": "" }, { "docid": "0483521aa50e3dbcf353666dbe8545ae", "score": "0.6139169", "text": "function shutdown() {\r\n\tprocess.exit();\r\n}", "title": "" }, { "docid": "ffb22bcae02329c9b24f79ce02f41297", "score": "0.61281496", "text": "function exitHandler(cleanUpFn) {\n process.stdin.resume() // so the program will not close instantly\n const exit = () => {\n cleanUpFn()\n process.exit()\n }\n process.on('exit', exit)\n //catches ctrl+c event\n process.on('SIGINT', exit)\n // catches \"kill pid\" (for example: nodemon restart)\n process.on('SIGUSR1', exit)\n process.on('SIGUSR2', exit)\n //catches uncaught exceptions\n process.on('uncaughtException', exit)\n}", "title": "" }, { "docid": "d53e200980977207bcbdf4d6bbfc13a1", "score": "0.60999006", "text": "function endClient() {\n\tconsole.log('Connection closed');\n\tprocess.exit(0);\n}", "title": "" }, { "docid": "fd4e15c77199e937c5790055342c9d35", "score": "0.60960764", "text": "function exitApp() {\n console.log('\\nCleaning up GPIO...')\n io.close();\n console.log('Websocket Closed');\n http.close(() => {\n console.log('Server terminated')\n console.log('\\x1b[31m%s\\x1b[0m','EXIT');\n process.exit(0); //exit completely\n });\n}", "title": "" }, { "docid": "3262ef30e2c80636827cf72585bfa394", "score": "0.60906535", "text": "async function exitHandler(options, exitCode) {\n await Stats.saveStats();\n if (options.cleanup) {\n await Listener.unsubAll();\n await Sync.unsubSync();\n await fs.writeFileSync(`./${ipfs.host}/hostedFiles.json`, JSON.stringify(ipfsearch.hostedFiles), (e) => {soLog(e);});\n log('Clean exit. Goodbye.')\n process.exit();\n }\n if (exitCode || exitCode === 0) {\n log(`Received exitcode: ${exitCode}`);\n }\n if (options.exit) {\n log('Exit.');\n process.exit();\n }\n}", "title": "" }, { "docid": "c683aad3186859bda4c3d8f2d67d8d06", "score": "0.6074944", "text": "function exitHandler(options, err) {\n //console.log(\"SRVR:EXITING \"+id);\n //if (options.cleanup) { cleanup(); }\n if (err) console.log(err.stack);\n if (options.exit) process.exit();\n}", "title": "" }, { "docid": "8729a644012f2c6fff8d3925c419c599", "score": "0.603623", "text": "function processExit() {\n process.removeListener('message', processMessageListener);\n\n process.send({ type: 'result', data: result });\n\n process.exit(0);\n}", "title": "" }, { "docid": "892f66b3fb85731944684c3bb50a0cce", "score": "0.6034791", "text": "function gracefulShutdown() {\n console.log();\n console.log('Starting Shutdown ...');\n\n // Close all chat boxes to the server\n Object.keys(io.sockets.sockets).forEach(function(s) { \n io.sockets.sockets[s].disconnect(true);\n });\n\n // Once the server closes, exit\n server.close(function() {\n console.log('Shutdown complete');\n process.exit(0);\n });\n }", "title": "" }, { "docid": "3414fa414ece7490e21d7dbd3e5687bd", "score": "0.6033928", "text": "function exitHandler(options, err) {\n motor.close(function (err) {\n if (err) {\n console.log(err);\n }\n console.log('motor port closed');\n process.exit();\n });\n if (err) {\n console.log(err.stack);\n process.exit();\n }\n }", "title": "" }, { "docid": "abeed4c73914ad7414058713bcf4bb85", "score": "0.60124195", "text": "function exit(code) {\n /* istanbul ignore next */\n if (process.platform === 'win32' && process.stdout.bufferSize) {\n process.stdout.once('drain', function() {\n process.exit(code);\n });\n return;\n }\n process.exit(code);\n}", "title": "" }, { "docid": "b89f164bd81faf94782ef78ddb39ed5e", "score": "0.5982358", "text": "function handleAppExit(options, err) {\n if (err) {\n console.log(err.stack)\n }\n\n if (options.cleanup) {\n client.publish('JANDI/connected', 'false');\n }\n\n if (options.exit) {\n process.exit()\n }\n}", "title": "" }, { "docid": "a1ac7e1e1991c8a647d22ff46410e323", "score": "0.5979099", "text": "function exitHandler(options, err) {\n //lcdDisplay.clear();\n if (options.cleanup) console.log('clean');\n if (err) console.log(err.stack);\n if (options.exit) process.exit();\n}", "title": "" }, { "docid": "140090dfd0ab882d25838bf9c6c62a55", "score": "0.5964395", "text": "async function exitHandler() {\n\tconsole.log('Exit detected, closing wallet');\n await httpDel('/wallet')\n\n\tconsole.log('Wallet closed, stopping process');\n\tprocess.exit();\n}", "title": "" }, { "docid": "9185c4b01eaf2ea4f435803772337455", "score": "0.59593713", "text": "function sigint() {\n return stop('SIGINT');\n}", "title": "" }, { "docid": "b95b1bfd44b15e496ebf6918ec673bbe", "score": "0.5958556", "text": "function killServers () {\n ui.log();\n\n // Hitting Ctrl-C more than once?\n // Take the hint.\n if (dying) ui.exit(\"Forced termination.\");\n dying = true;\n\n ui.log(\"Telling browsers to disconnect...\");\n ui.log(\"(Hit Ctrl-C again to force quit.)\");\n\n var ports = server.getPorts();\n ct = ports.length;\n ports.forEach(function (port) {\n var tests = server.getEmitterForPort(port);\n if (tests.listeners(\"shutdown\").length) {\n tests.emit(\"shutdown\", KILLCB);\n } else KILLCB();\n });\n}", "title": "" }, { "docid": "a1dac635dc583aaefac6b79b6b8c33f0", "score": "0.5957133", "text": "function quit() {\n process.exit(true === hasErrors ? 2 : 0);\n}", "title": "" }, { "docid": "0bd97e38e9b9358773a91d73e582bdd0", "score": "0.59532946", "text": "function exitHandler(options, exitCode) {\n gameSimDatabaseConnector.flushToDB( (err)=>{\n if (options.cleanup) console.log('clean');\n if (exitCode || exitCode === 0) console.log(exitCode);\n if (options.exit) process.exit();\n })\n}", "title": "" }, { "docid": "431522075ab253fbb924b9841512d826", "score": "0.5952484", "text": "function exitApplication() {\n\tconsole.log(\"Good bye!\");\n\tconnection.end();\n\treturn;\n}", "title": "" }, { "docid": "93e0b598802962b5f403a6e2a4f0f4f4", "score": "0.59120905", "text": "function interrupt() {\n if (interruptHandlers.length === 0) {\n return process.exit(0);\n }\n if (interrupted) {\n console.log('\\nKilling process with extreme prejudice');\n return process.exit(1);\n }\n else {\n interrupted = true;\n }\n close(function () { return process.exit(0); });\n console.log('\\nShutting down. Press ctrl-c again to kill immediately.');\n}", "title": "" }, { "docid": "1751ac405796779e5af571da835ddbe7", "score": "0.58893985", "text": "function onExit(){\n app.emit(\"sandbox::shovel::stopped\")\n var err = Error(\"Sandbox process was shutdown\")\n err.refinedStack = \"Sandbox was shutdown, probably because you have reached a sandbox limit (memory, CPU) with your code\"\n app.emit(\"sandbox::return\", err)\n }", "title": "" }, { "docid": "c3f1dbcf38e45550195df7803a0c7949", "score": "0.58803064", "text": "exit() {\n\t\tconsole.clear();\n\t\tconsole.warn('Shutting down the server');\n\t\ttry {\n\t\t\tSessionStorage.Instance.save();\n\t\t} catch(e) {\n\t\t\tconsole.error(e);\n\t\t}\n\n\t\tconsole.warn('------------------------');\n\t\tprocess.exit(1);\n\t}", "title": "" }, { "docid": "d661dec168d5bad3312e4cdaed3304eb", "score": "0.5862524", "text": "async term() {\n\t\tlog.lib('Terminating');\n\n\t\tthis.terminating = true;\n\n\t\tfor (const intf in config.intf) {\n\t\t\tif (config.intf[intf].enabled !== true) continue;\n\t\t\tlog.lib(`Ending '${intf}' socket`);\n\n\t\t\tawait this.intf[intf].end();\n\t\t\tawait this.intf[intf]._socket.destroy();\n\n\t\t\tupdate.status(`server.sockets.${intf}.connected`, false, false);\n\t\t\tupdate.status(`server.sockets.${intf}.connecting`, false, false);\n\t\t\tupdate.status(`server.sockets.${intf}.reconnecting`, false, false);\n\t\t} // for (let intf in config.intf)\n\n\t\tlog.lib('Terminated');\n\t}", "title": "" }, { "docid": "0cc629c2a6ce61af421c3a5f8f708b09", "score": "0.5850836", "text": "function handleAppExit(options, err){\n if (err){\n console.log(err.stack)\n }\n if (options.cleanup){\n client.publish('garage/connected','false')\n }\n if (option.exit){\n process.exit()\n }\n}", "title": "" }, { "docid": "2ea3d1998616f413b05dfae71fa7a8bc", "score": "0.58301145", "text": "function exit(exitCode) {\n if (process.stdout._pendingWriteReqs || process.stderr._pendingWriteReqs) {\n process.nextTick(function() {\n exit(exitCode);\n });\n } else {\n process.exit(exitCode);\n }\n}", "title": "" }, { "docid": "a8547b54b08b81492a6a0e218e86129f", "score": "0.5825946", "text": "function cleanup() {\n logger.info(\"Closing server;\");\n server.close();\n process.exit(0);\n }", "title": "" }, { "docid": "fcd0b641dea3d8f1f284945e69634c74", "score": "0.58223516", "text": "function shutdown(sig) {\n\n return new Promise((resolve, reject) => {\n\n function cleanupHttp() {\n return new Promise((resolve, reject) => {\n destroyAllConnections();\n\n // normal shutdown / do not allow new connections\n server.close((err) => {\n if (err) { return reject(err); }\n resolve();\n });\n });\n }\n\n debug('shutdown signal - ' + sig);\n\n // Don't bother with graceful shutdown on development to speed up round trip\n if (options.development) {\n debug('DEV-Mode - imediate forceful shutdown');\n return process.exit(0);\n }\n\n const finalHandler = () => {\n if (!finalRun) {\n finalRun = true;\n if (options.finally && isFunction(options.finally)) {\n options.finally();\n }\n process.nextTick(() => {\n if (fnIntervall) {\n fnIntervall.unref();\n }\n if (options.forceExit) {\n process.exit(failed ? 1 : 0);\n }\n resolve();\n });\n }\n };\n\n const exitHandler = promise => promise\n .catch((err) => {\n const errString = (typeof err === 'string') ? err : JSON.stringify(err);\n debug(errString);\n failed = true;\n reject(errString);\n });\n\n if (!isShuttingDown) {\n isShuttingDown = true;\n debug('shutting down');\n\n const pollIterations = options.timeout ? Math.round(options.timeout / 250) : 0;\n // forcefull shutdown after timeout\n if (options.timeout) {\n let interation = 0;\n fnIntervall = setInterval(function () {\n interation++;\n\n // test all connections closed already?\n if (Object.keys(connections).length === 0 && Object.keys(secureConnections).length === 0) {\n if (options.onShutdown && isFunction(options.onShutdown && !shutdownRun)) {\n shutdownRun = true;\n exitHandler(options.onShutdown(sig)).then(() => {\n finalHandler();\n\n process.nextTick(() => {\n resolve();\n if (options.forceExit) {\n process.exit(1);\n }\n });\n });\n } else if (!shutdownRun) {\n // no onShutdown function\n finalHandler();\n\n process.nextTick(() => {\n resolve();\n if (options.forceExit) {\n process.exit(1);\n }\n });\n }\n }\n if (interation === pollIterations) {\n // timeout time reached! Now forcefully close all connections\n debug('Could not close connections in time (' + options.timeout + 'ms), forcefully shutting down');\n\n // destroy rest of connections\n destroyAllConnections(true);\n\n // call finally function (if provided in options)\n finalHandler();\n\n process.nextTick(() => {\n resolve();\n if (options.forceExit) {\n process.exit(1);\n }\n });\n }\n }, 250);\n }\n\n exitHandler(cleanupHttp()).then(() => {\n if (options.onShutdown && isFunction(options.onShutdown) && !shutdownRun) {\n\n shutdownRun = true;\n return exitHandler(options.onShutdown(sig));\n } else {\n return;\n }\n }).then(finalHandler);\n }\n });\n }", "title": "" }, { "docid": "102e7462724a554d7cdcbe80a2f3521b", "score": "0.5815354", "text": "onStop (err, cb, code, signal) {\n console.log(`App has exited with code ${code}`)\n }", "title": "" }, { "docid": "0beaae3070fbc08cd8ca6c8ec67ba542", "score": "0.5813997", "text": "function handleShutdown (handlerFn) {\n const signals = ['SIGHUP', 'SIGINT', 'SIGQUIT', 'SIGABRT', 'SIGTERM']\n signals.forEach(signal => process.on(signal, (signal) => {\n log.info(`Received ${signal}, shutting down...`)\n handlerFn()\n }))\n}", "title": "" }, { "docid": "3bd11611b655c64a014915de48c4be71", "score": "0.5811293", "text": "async function stopServer() {\n eel.close_process('epic.exe')\n await sleep(1000)\n changeBtnFunc($('#serverButton'), 'start')\n changeBtn($('#serverButton'), 'start')\n changeIcon($('#serverIcon'), 'error')\n changeStatus($('#serverStatus'), 'Stopped')\n send_console('')\n}", "title": "" }, { "docid": "3ca852294e147206578564b6ec8fde4e", "score": "0.5802899", "text": "function exitHandler() {\n console.log(\"Program exiting...\");\n\n if ( isRecording ) {\n stop_record();\n }\n\n process.exit();\n}", "title": "" }, { "docid": "74beaa7846a0202435963aa8997502d5", "score": "0.58007604", "text": "function exitProcess(errCode) {\n\n\t// HACK: can't flush std, the correct approach is to not have\n\t// to process exit, but let node automatically exit when the event\n\t// loop becomes empty, but because of the logger issue we can't do that\n\n\treturn Q.delay(5000)\n\t\t.then(function() {\n\t\t\tprocess.exit(errCode);\n\t\t});\n}", "title": "" }, { "docid": "223427905351ddbaf4fd47ecde5aa895", "score": "0.57939476", "text": "function gracefulShutdown() {\n logger.info('Closing application server ...');\n\n server.close(() => {\n logger.info('Application server closed');\n process.exit(0);\n });\n\n // Force close server after 5secs\n setTimeout((e) => {\n logger.info('Application server closed', e);\n process.exit(1);\n }, 5000);\n}", "title": "" }, { "docid": "ee445c21bfb98172f08ac88f7a2eea49", "score": "0.5790551", "text": "function exitHandler(options, err) {\n if (options.cleanup) console.log('exit');\n if (err) console.log(err.stack);\n if (options.exit) process.exit();\n}", "title": "" }, { "docid": "902c6411d6df17691fe8a9a77219c3b7", "score": "0.5778841", "text": "function terminator(sig) {\n if (typeof sig === \"string\") {\n console.log('%s: Received %s - terminating Node server ...',\n Date(Date.now()), sig);\n process.exit(1);\n }\n console.log('%s: Node server stopped.', Date(Date.now()) );\n}", "title": "" }, { "docid": "902c6411d6df17691fe8a9a77219c3b7", "score": "0.5778841", "text": "function terminator(sig) {\n if (typeof sig === \"string\") {\n console.log('%s: Received %s - terminating Node server ...',\n Date(Date.now()), sig);\n process.exit(1);\n }\n console.log('%s: Node server stopped.', Date(Date.now()) );\n}", "title": "" }, { "docid": "7921eb3fcfec0f0d65dc766529ab528f", "score": "0.5765992", "text": "function exitHandler(options, err) {\n if (options.cleanup) cleanUp();\n if (err && err.stack) console.log(err.stack);\n if (options.exit) process.exit();\n}", "title": "" }, { "docid": "c02af6f4183da24082debdb49cffbb06", "score": "0.5749573", "text": "function exitHandler(options, err) {\n\n if (options.cleanup) {\n logger.debug('Closing logfiles...');\n uavConnectionManager.stopLogging();\n }\n\n if (err) {\n logger.error(util.inspect(err));\n }\n\n if (options.exit) process.exit();\n\n // For restarting with Nodemon\n if (options.killProcess) {\n process.kill(process.pid, 'SIGUSR2');\n }\n}", "title": "" }, { "docid": "5a4137a77e925628c498f334fc3bf70d", "score": "0.5738386", "text": "function sigHandler(signal) {\n log(`Caught signal: ${signal}.`);\n if (signal == 'SIGINT' || signal == 'SIGTERM') {\n process.exit(0);\n }\n}", "title": "" }, { "docid": "8d68475c2d995990b9815c4e943d1b43", "score": "0.57271063", "text": "function sigterm() {\n log.info('SIGTERM received...shutting down');\n killAllWorkers('SIGTERM');\n\n if (root) {\n fs.unlink(pidLocation, function(err) {\n if (err) {\n log.error(err);\n }\n });\n }\n}", "title": "" }, { "docid": "51fe8746999763e049befbc0add0c075", "score": "0.57226276", "text": "function exit (){\n throw new Error('Exit requested by script')\n}", "title": "" }, { "docid": "247250843c3c18e3fa8d11925ec412d0", "score": "0.5714146", "text": "function exitHandler() {\n // cursor restore\n if (cursor) {\n process.stdout.write(`\\x1b[${cursor.col};${cursor.row}H\\x1b[0m`);\n }\n // SGR restore\n process.stdout.write('\\x1b[0m');\n // termios restore\n initial.writeTo(0);\n console.log();\n}", "title": "" }, { "docid": "3bae5e8a494f1c22c9769d611ce2f677", "score": "0.57132465", "text": "function exitHandler() {\n console.log('cleaning up...');\n clearInterval(blinkInterval);\n msleep(500);\n console.log(\"closing AMQP client...\")\n // client.close(\n // function(err, result){\n // if(err){\n // console.log(err);\n // }else{\n // console.log(result);\n // console.log(\"client disconnected!\");\n // }\n // }\n // );\n msleep(500);\n console.log(\"deallocating red...\")\n clearLED(red);\n msleep(500);\n console.log(\"deallocating yellow...\")\n clearLED(yellow);\n msleep(500);\n console.log(\"deallocating green...\")\n clearLED(green) \n msleep(500);\n console.log(\"I'M OUT! SEE YA!\");\n}", "title": "" }, { "docid": "90a436ec5bd9ea52fce1fc6991aba577", "score": "0.5711005", "text": "function end () {\n if (childProc) {\n childProc.kill('SIGKILL');\n childProc = null;\n } \n console.log('\\b\\b ');\n console.log('emi-cli ended...'.bold.yellow);\n}", "title": "" }, { "docid": "2d7479cb60a8ddcffcc08c1f6c8bcee5", "score": "0.5692394", "text": "function exit(code) {\n\n function done() {\n if (!(draining--)) _exit(code)\n }\n\n var draining = 0\n var streams = [process.stdout, process.stderr]\n\n exit.exited = true\n\n streams.forEach(function (stream) {\n // submit empty write request and wait for completion\n draining += 1\n stream.write('', done)\n })\n\n done()\n}", "title": "" }, { "docid": "c8a27080d387c79c09e850cf485f0ce9", "score": "0.5689293", "text": "function sig_handle() {\n if (child) {\n child.kill('SIGINT');\n }\n}", "title": "" }, { "docid": "e9885f1f88c85183d9ad1409fc89326d", "score": "0.5688968", "text": "async function quit() {\n process.exit();\n}", "title": "" }, { "docid": "f893afac46e1a9a20f4178afc6c53cc2", "score": "0.5688954", "text": "function handleExit(message, error) {\n console.log(`\\n${message}\\n`);\n const exitCode = error ? 1 : 0;\n process.exit(exitCode);\n}", "title": "" }, { "docid": "91b1678c5debb54418bbe114be8fbe12", "score": "0.56814265", "text": "function exitHandler(options, err) {\n//close connection to mongodb\n db.close();\n if (options.cleanup) console.log('clean exit');\n if (err) console.log(err.stack);\n if (options.exit) process.exit();\n}", "title": "" }, { "docid": "746f633ac9b778128877f779cf35105e", "score": "0.56748766", "text": "exit() {}", "title": "" }, { "docid": "b9eaf059afbcec159490943a896ea5ed", "score": "0.5664019", "text": "function exit() {\n connection.end();\n}", "title": "" }, { "docid": "ad0cf137f27e7fc87e34f7da66cc8563", "score": "0.56621754", "text": "async processExit(exitCode) {\n await utils.sleep(1)\n debug('The ring-mqtt process is shutting down...')\n await ring.go2rtcShutdown()\n if (ring.devices.length > 0) {\n debug('Setting all devices offline...')\n await utils.sleep(1)\n ring.devices.forEach(ringDevice => {\n if (ringDevice.availabilityState === 'online') {\n ringDevice.shutdown = true\n ringDevice.offline()\n }\n })\n }\n await utils.sleep(2)\n if (exitCode || exitCode === 0) debug(`Exit code: ${exitCode}`);\n process.exit()\n }", "title": "" }, { "docid": "4afeb455164a7a38d24b37afce48092d", "score": "0.5657592", "text": "function shutdown(error) {\n error ? console.error(error) : console.log('shutting down')\n try {\n if (server) server.close()\n } catch (err) {\n // noop who cares\n }\n process.exit(error ? 1 : 0)\n}", "title": "" }, { "docid": "1d2f36a5f7ab296ae4de552cc54775ee", "score": "0.565289", "text": "function exit() {\n process.exit();\n}", "title": "" }, { "docid": "30a59dc0a09348f15285cae054ae82d9", "score": "0.5651382", "text": "function exit(code) {\n function done() { if (!(draining--)) _exit(code); }\n\n var draining = 0;\n var streams = [process.stdout, process.stderr];\n\n exit.exited = true;\n\n streams.forEach(function(stream){\n // submit empty write request and wait for completion\n draining += 1;\n stream.write('', done);\n });\n\n done();\n}", "title": "" }, { "docid": "112759753b352db5a8b8c29f7e8100df", "score": "0.5649205", "text": "function cleanup() {\n if (!SHUTDOWN) {\n SHUTDOWN = true;\n console.log(\"\\n\", \"IPC: Terminating.\", \"\\n\");\n connections.forEach(t => {\n console.log(\"IPC: Disconnecting\", t.timestamp);\n t.stream.write(composeFrame(JSON.stringify({ id: 1, method: \"disconnect\" })));\n t.stream.end();\n });\n server.close();\n process.exit(0);\n }\n }", "title": "" }, { "docid": "928df189e0a3c04ba8ffb2b268af1302", "score": "0.56392294", "text": "function exit()\n{\n\txrxSessionExitApplication( \"http://127.0.0.1\", callbackFailure );\n}", "title": "" }, { "docid": "928df189e0a3c04ba8ffb2b268af1302", "score": "0.56392294", "text": "function exit()\n{\n\txrxSessionExitApplication( \"http://127.0.0.1\", callbackFailure );\n}", "title": "" }, { "docid": "1245ef4e253af21a8838c0e97d4f961a", "score": "0.5627069", "text": "function exit(code) {\n function done() {\n if (!(draining--)) _exit(code)\n }\n\n var draining = 0\n var streams = [process.stdout, process.stderr]\n\n exit.exited = true\n\n streams.forEach(function (stream) {\n // submit empty write request and wait for completion\n draining += 1\n stream.write('', done)\n })\n\n done()\n}", "title": "" }, { "docid": "6584fd59f9d2877ade451e8d4a9ed361", "score": "0.5617725", "text": "function cleanup(){\n if(!SHUTDOWN){ SHUTDOWN = true;\n console.log('\\n',\"Terminating.\",'\\n');\n if(Object.keys(connections).length){\n let clients = Object.keys(connections);\n while(clients.length){\n let client = clients.pop();\n connections[client].write('__disconnect');\n connections[client].end(); \n }\n }\n server.close();\n process.exit(0);\n }\n }", "title": "" }, { "docid": "a13c8a6dda6fe07fdc370289023e9d19", "score": "0.55954874", "text": "function initProcessExitHandlers() {\n process.stdin.resume();\n\n /**\n * @param {Error} error\n */\n function exitHandler(error) {\n if (error) {\n logger.err(`Process error: ${error.message}`);\n logger.err(error.stack);\n }\n }\n\n process.on(\"exit\", exitHandler);\n process.on(\"uncaughtException\", exitHandler);\n}", "title": "" }, { "docid": "b8715e002174417e75f7a531f445a136", "score": "0.55910295", "text": "function exitHandler(deRegisterChoice) {\n if (this.deRegisterChoice) {\n client.stop();\n console.log('Client De-registered');\n }\n process.exit();\n}", "title": "" }, { "docid": "2cc3f5d062f4a7d7c35e6aa63e75d5be", "score": "0.55890083", "text": "function exit(code) {\n if (code != null) process.exit(code)\n}", "title": "" }, { "docid": "023077786d8bee5f424c53d4fecd0cd9", "score": "0.5581767", "text": "function earlyExitHandler(code) {\n process.exit(code);\n }", "title": "" }, { "docid": "2f8fc6689c7027f11da58f1fb05d9ba6", "score": "0.5574282", "text": "function exitHandler() {\n\tconsole.log(\"]\");\n\tconsole.error(`Processed Lines: ${state.outLines}`);\n\tprocess.exit();\n}", "title": "" }, { "docid": "48e1f9f8be5e4a6ead39d64d1888b873", "score": "0.5560298", "text": "async function main() {\n // Spawn a child task that will error. Since we don't handle the child error,\n // it will propagate as an unhandled, rejected promise and kill this task as\n // well.\n print(\"parent: spawning simple-exit-1.js\");\n spawn(\"./simple-exit-1.js\");\n\n // Wait for the error to propagate.\n while (true) {\n await timeout(9999);\n }\n}", "title": "" }, { "docid": "c4b745d4893ad9cf9f567fb5d424e6e4", "score": "0.5560056", "text": "async function shutdown(e) {\n\n let err = e\n console.log('Finalizando aplicação...')\n\n try {\n\n console.log('Encerrando módulo: Servidor Web...')\n await webServer.close()\n\n } catch (e) {\n\n console.log('Erro ao encerrar Servidor Web', e)\n err = err || e\n }\n\n try {\n\n console.log('Encerrando módulo: Banco de dados...')\n await database.close()\n\n } catch (e) {\n\n console.log('Erro encontrado', e)\n err = err || e\n }\n\n console.log('Saindo do processo')\n\n if (err) {\n process.exit(1)\n } else {\n process.exit(0)\n }\n}", "title": "" }, { "docid": "18d508c87454a06f162ddd8ac121ffe7", "score": "0.5559835", "text": "function handlePrematureExit(code, signal) {\n if (options.monitor) {\n return reject(new Error(name + ' exited prematurely.'));\n }\n\n // In case of error, we've really got an error\n if (code > 0) {\n return reject(new Error(name + ' exited with error code ' + code));\n }\n }", "title": "" }, { "docid": "2a24aced1e42a65b6ed993b777660917", "score": "0.5559229", "text": "function quit() {\n console.log(\"bye!\");\n console.log(\"Have a nice Day!\");\n process.exit();\n}", "title": "" } ]
1f006d25f488dab4d66b50184c5402dd
MSG: rename in place
[ { "docid": "0b72352d2b1a06e75ffc04cb1ae5bdf5", "score": "0.0", "text": "function renameInPlace_4l(msger, logger) {\n return () => {\n msger.log(`${addTab()}... renamed files in place.`);\n };\n}", "title": "" } ]
[ { "docid": "4578810a4b67560ab5f5e7ee21f66996", "score": "0.7102932", "text": "rename(oldName, newName) {\n files.rename(files.pathJoin(this.cwd, oldName),\n files.pathJoin(this.cwd, newName));\n }", "title": "" }, { "docid": "520abd173032cc53ce85a51b4bb5fea0", "score": "0.70787907", "text": "function rename(fso_name, is_file) {\r\n\t\t\tvar fso_key = is_file ? target_files[fso_name]\r\n\t\t\t\t\t: target_directories[fso_name];\r\n\t\t\tif (!fso_key || fso_name.includes(name)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tCeL.info(fso_name + '→' + name);\r\n\t\t\tvar error = CeL.fs_move(target_directory + fso_name,\r\n\t\t\t\t\ttarget_directory + CeL.to_file_name(name) + '.' + fso_name);\r\n\t\t\tif (error) {\r\n\t\t\t\tCeL.error(error);\r\n\t\t\t} else if (is_file) {\r\n\t\t\t\tdelete target_files[fso_name];\r\n\t\t\t} else {\r\n\t\t\t\tdelete target_directories[fso_name];\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "c10385755e16b854a48832c674d60415", "score": "0.70648766", "text": "function caml_sys_rename(o,n){\n var path = caml_make_path(o);\n var content = caml_fs_content(path);\n if(caml_sys_file_exists(n)){\n if(caml_sys_is_directory(n)) caml_raise_sys_error(n.toString() + \" : is a directory\");\n caml_sys_remove(n);\n }\n caml_fs_register(n, content);\n caml_sys_remove(o);\n return 0;\n}", "title": "" }, { "docid": "bd3772a089e634138808903e8892ee96", "score": "0.70324636", "text": "function rename(old, newish, callback) {\n fs.rename(old.osFullPath, newish.osFullPath, function (err) {\n if (err) {\n callback(errors(err));\n } else {\n callback({\n \"Old Path\": old.uiPath,\n \"Old Name\": old.filename,\n \"New Path\": newish.uiPath,\n \"New Name\": newish.filename,\n \"Error\": \"\",\n \"Code\": 0\n });//callback\n }//if\n }); //fs.rename\n }//rename", "title": "" }, { "docid": "c016cd758eca23503db1b712adf4cf4e", "score": "0.70011467", "text": "function rename(cwd, src, newName) {\n cwd.getFile(src, {}, function(fileEntry) {\n\tconsole.log(\"Renaming from \" + fileEntry.name + \" to \" + newName );\n fileEntry.moveTo(cwd, newName);\n }, errorHandler);\n}", "title": "" }, { "docid": "f5429d23c1d56fbb8cfc7c75d4dcb130", "score": "0.6935209", "text": "function rename(record) {\n record.updateWith(function () {\n if (record.name === oldFull) record.name = newFull;\n if (record.PTRDName === oldFull) record.PTRDName = newFull;\n });\n }", "title": "" }, { "docid": "a47fa1bdb5ea7fcce8224fcdb530152f", "score": "0.662031", "text": "function atualizaDia() {\n\n // Gerando carimbo de data e versão\n var nomeAntigo = SpreadsheetApp.getActiveSpreadsheet().getName();\n var nomeSemData = nomeAntigo.slice(11); // Fim da data é na posição 10\n var novoNome = \"[\" + hojeDia + \"] \" + nomeSemData;\n\n SpreadsheetApp.getActiveSpreadsheet().rename(novoNome);\n\n}", "title": "" }, { "docid": "8f3b0c1c2810c52cb083962d1b296bae", "score": "0.66114676", "text": "changeChildsName(name, newName) {\n if (this.hasOwnProperty(name)) {\n this.newName = this.name;\n delete this.name;\n }\n }", "title": "" }, { "docid": "a537ea4890e18033f93241e7c55274aa", "score": "0.65974444", "text": "function rename_file() {\n if (state.show_file_input_rename == false) {\n state.show_file_input_rename = true;\n render();\n } else {\n var file;\n var newname;\n \n if (state.mode == \"template\") {\n file = getSelectedTreeNode().id;\n newname = $('.add_input').val();\n }\n if (state.mode == \"logic\") {\n file = state.current_file;\n newname = $('.add_input').val();\n }\n \n // rename\n show_layer('rename_file');\n $.ajax({\n url: 'php/rename.php',\n type: 'post',\n dataType: 'json',\n data: {\n file: file,\n newname: newname\n },\n success: function(json) {\n state.show_file_input = false;\n state.show_file_input_rename = false;\n hide_layer('rename_file');\n if (state.mode == \"logic\")\n loadCurrentDir();\n if (state.mode == \"template\")\n $('#jstree_container').jstree().refresh();\n } \n });\n }\n}", "title": "" }, { "docid": "6433b86cc0504af28ea0e5cea2879c69", "score": "0.6586284", "text": "function rename(obj) {\n\t\t myDiagram.startTransaction(\"rename\");\n\t\t var newName = prompt(\"Rename \" + obj.part.data.item + \" to:\");\n\t\t myDiagram.model.setDataProperty(obj.part.data, \"item\", newName);\n\t\t myDiagram.commitTransaction(\"rename\");\n\t\t}", "title": "" }, { "docid": "c6820915d7f2c91a4cbca33f0c887403", "score": "0.65593386", "text": "function renameDotfile(files, metalsmith, done) {\n Object.keys(files)\n .filter((filename) => path.basename(filename).startsWith('_'))\n .forEach((filename) => {\n // eslint-disable-next-line\n files[`.${filename.substr(1)}`]= files[filename]\n // eslint-disable-next-line\n delete files[filename]\n })\n done()\n}", "title": "" }, { "docid": "2908881c59b7448b21fe4f5ed085ee23", "score": "0.65361583", "text": "rename(oldPath, newPath, cb = nopCb) {\n const newCb = wrapCb(cb, 1);\n try {\n assertRoot(this.root).rename(normalizePath(oldPath), normalizePath(newPath), newCb);\n }\n catch (e) {\n newCb(e);\n }\n }", "title": "" }, { "docid": "649216fd3d4eb88931542e96fca7f3ed", "score": "0.65058625", "text": "function OnRename( name ) {\n //Check up name.\n if( !isValidFileName( name ) ) {\n alert( \"Name contains invalid characters!\" );\n app.ShowTextDialog( \"Rename Program\", curFile, OnRename );\n return;\n };\n \n //Check if already exists.\n var newfile = APP_PATH + \"/\" + name;\n if( app.FileExists( newfile ) ) {\n app.Alert( \"File already exists!\" );\n } else {\n //Rename the .rs data file.\n var oldfile = APP_PATH + \"/\" + curFile;\n if( app.FileExists( oldfile ) ) app.RenameFile( oldfile, newfile );\n ShowFiles();\n };\n}", "title": "" }, { "docid": "d9e8126e0c6486ed8ece2c1ac799b1b5", "score": "0.64256346", "text": "changeName(newName)\n {\n this.movieName_p= (newName);\n }", "title": "" }, { "docid": "ea89ddb7e3ad47e0bd9f7b1bed30f49a", "score": "0.6423163", "text": "function rename(target, pattern, replc, counter, ph) {\n var min = counter * 1,\n max = target.length + min - 1;\n\n for (var i = 0, len = target.length; i < len; i++) {\n var newName = '',\n item = target[i];\n\n newName = pattern.replaceAll(ph.name, item.name);\n newName = newName.replaceAll(ph.numUp, fillZero(min + i, max.toString().length));\n newName = newName.replaceAll(ph.numDown, fillZero(max - i, max.toString().length));\n\n if (!isEmpty(replc)) {\n item.name = item.name.replaceAll(replc, newName);\n } else {\n item.name = newName;\n }\n }\n}", "title": "" }, { "docid": "df6bc262fde862638629525438cba25b", "score": "0.64220655", "text": "function _rename(){\n self._visitingAlter = true;\n var table = self._queryNode.table;\n var result = ['EXEC sp_rename '+self.visit(table.toNode())+', '+self.visit(alter.nodes[0].nodes[0])];\n self._visitingAlter = false;\n return result;\n }", "title": "" }, { "docid": "52d05158b0670fcc33c5fbea11e2fc22", "score": "0.6390915", "text": "setName (newName, cb) {\n\t\tif (tools.notType(newName, 'string')) {\n\t\t\treturn;\n\t\t}\n\t\tvar d = this.directory;\n\t\tvar newPath = d === '' ? newName : `${d}/${newName}`;\n\t\tthis.setPath(newPath, cb);\n\t}", "title": "" }, { "docid": "5e61c2457037a41c440efb056b11d981", "score": "0.63420784", "text": "function rename (fullPathname, filename, prefix) {\n\n // get path without filename\n let pathWithoutFile = fullPathname.replace(filename,'')\n console.log('path without filename: ',pathWithoutFile)\n\n // rename file and save it\n fs.rename(`${fullPathname}`,`${pathWithoutFile}${prefix} - ${filename}`, function(err) {\n if ( err ) console.log('ERROR: ' + err);\n })\n\n}", "title": "" }, { "docid": "7b051155f3ac40f7be8b290afab25320", "score": "0.63261753", "text": "rename() {\n return this._listing.rename();\n }", "title": "" }, { "docid": "28f8877931c952692086ba86e8b1c3fa", "score": "0.632556", "text": "setName(newName) {\n\t\tthis.name = newName\n\t}", "title": "" }, { "docid": "f047c67d1e20cbc8d700bfa86c7830d0", "score": "0.62924975", "text": "function renameFiles(files)\n{\n files.forEach(function (file)\n {\n debug('renameFiles', 'processing', file);\n var originalName = path.basename(file);\n var newFileName = originalName.toLowerCase();\n var directory = path.dirname(file);\n if (originalName != newFileName)\n {\n fs.renameSync(file, directory + \"/\" + newFileName); //, function(err)\n debug('renameFiles', 'renamed', originalName, '-->', newFileName);\n\n originalFiles.push(originalName);\n renamedFiles.push(newFileName);\n }\n });\n}", "title": "" }, { "docid": "d627f6b80b1d4803ee7fc9e2f07d9542", "score": "0.62733024", "text": "function getNewName() \n{ \n var ext, docName, newName, saveInFile, docName; \n docName = sourceDoc.name; \n ext = '.ai'; // new extension for AI file \n newName = \"\"; \n \n for ( var i = 0 ; docName[i] != \".\" ; i++ ) \n { \n newName += docName[i]; \n } \n newName += ext; // full AI name of the file \n \n // Create a file object to save the ai file \n saveInFile = new File( destFolder + '/' + newName ); \n \n \n return saveInFile; \n}", "title": "" }, { "docid": "73038d6c0592c50c4fc156bffd56e3fe", "score": "0.62532413", "text": "function renameFile(fileId, newTitle,callback) {\n\tvar successMessage = \"Rename complete.\";\n\tvar failMessage = \"Sorry, rename incomplete.\";\n\tvar body = {'title': newTitle};\n\tvar request = gapi.client.drive.files.patch({\n\t\t'fileId': fileId,\n\t\t'resource': body\n\t});\n\trequest.execute(function(resp) {\n\t\tif (!resp.error){\n\t\t\tconsole.log(\"Rename fileId:{0} to {1}\".f(fileId,newTitle));\n\t\t\tcallback && callback(successMessage,true);\n\t\t}else{\n\t\t\tcallback && callback(failMessage,false);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "9ba7e76a81922996ccc7aa9bb8acb73f", "score": "0.6248389", "text": "async rename(fromFile, toFile, retryCount = 0) {\n try {\n await opfs.rename(fromFile, toFile);\n } catch (err) {\n if (err.code !== \"EPERM\" || retryCount >= 5) {\n throw err;\n }\n await xaa.delay(50);\n await this.rename(fromFile, toFile, retryCount + 1);\n }\n }", "title": "" }, { "docid": "9f6419d283a949b16a0f907e99f7591a", "score": "0.6230031", "text": "function renameBlurred(self) {\n\tif (removed) return; // because removing a node fires this again\n\tremoved = true;\n\tvar new_name = self.value;\n\tvar dv = document.createElement(\"div\");\n\tdv.innerHTML = new_name;\n\tself.parentNode.replaceChild(dv, self);\n\tdv.addEventListener(\"click\", function() {\n\t handleLocationClick(this, new_name);\n\t}); \n\tnavPub.publish(new ROSLIB.Message({\n\t\t\tcommand: \"name-location\",\n\t\t\tparam: new_name\n\t}));\n }", "title": "" }, { "docid": "8c91dcdadb83c892baf08c8185e92e36", "score": "0.62100357", "text": "visitRename_object(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "978c46fde16897ea322bf5d380611b4b", "score": "0.6201645", "text": "editName(newName) {\n // Don't do anything if name didn't actually change\n if (newName !== this.state.folder.name) {\n this.setState({ loading: true });\n\n this.linksRef.update({\n name: newName\n })\n .catch((error) => {\n console.log(error);\n this.setState({ error: error.message });\n })\n .then(() => {\n this.setState({ loading: false });\n });\n }\n }", "title": "" }, { "docid": "6a81d4a5e678eebeda4201e22e07119a", "score": "0.6173433", "text": "function getNewName() \n{ \n var ext, docName, newName, saveInFile, docName; \n docName = sourceDoc.name; \n ext = '.png'; // new extension for PNG \n newName = \"\"; \n \n for ( var i = 0 ; docName[i] != \".\" ; i++ ) \n { \n newName += docName[i]; \n } \n newName += ext; // full name of the new file including the png extension \n \n // create the new file with the corrected extension \n saveInFile = new File( destFolder + '/' + newName ); \n \n return saveInFile; \n}", "title": "" }, { "docid": "019cac62f3f4721e53e0b4e9771e1ae4", "score": "0.61710244", "text": "function renameElement() {\n var id = $(this).parent().attr(\"data-id\");\n var item = fileSystem.findElementById(id);\n var editedItemName = prompt(\"Please enter the new name\", item.name);\n if (editedItemName == undefined) {\n return;\n }\n try {\n fileSystem.renameElement(id, editedItemName);\n } catch (err) {\n alert(err.message);\n }\n updateUI();\n }", "title": "" }, { "docid": "b864fe90fef9c97d1d61e661becf0595", "score": "0.6167889", "text": "function renameIndividualFile(loopInfo, files, pp, callback, $index) {\n if (loopInfo.error === false) {\n var oldfilename = paths.join(__appRoot, files[$index].path),\n // new files comes with a directory, replaced files with a filename. I think there is a better way to handle this\n // but this works as a starting point\n newfilename = paths.join(\n pp.osFullDirectory,\n pp.isDirectory ? pp.relativePath : \"\",\n pp.isDirectory ? files[$index].originalname : pp.filename\n ); //not sure if this is the best way to handle this or not\n\n fs.rename(oldfilename, newfilename, function (err) {\n if (err) {\n loopInfo.error = true;\n console.log(\"savefiles error -> \", err);\n callback(errors(err));\n } else if ($index + 1 >= loopInfo.total) {\n callback({\n \"Path\": pp.relativePath,\n \"Name\": pp.filename,\n \"Error\": \"\",\n \"Code\": 0\n });//callback\n }//if\n });//fs.rename\n }//if not loop error\n }//renameIndividualFile", "title": "" }, { "docid": "83481116242ba35ea040bef6ba7c3939", "score": "0.616185", "text": "switchName() {\n\t\tif (this[_nextName] !== undefined) {\n\t\t\tthis[_name] = this[_nextName];\n\t\t\tdelete this[_nextName];\n\t\t}\n\t}", "title": "" }, { "docid": "25d55cc0cfa59f73cc70f5cd72d65126", "score": "0.6126403", "text": "function moveImage(from, to, callback) {\n fs.rename(from, to, function(error) {\n \tif(error) {\n \t\tconsole.log('Error while moving image');\n \t}\n \tcallback(null);\n }); \n}", "title": "" }, { "docid": "822085a361bf83cf4d7611604d0f7178", "score": "0.6124616", "text": "function stopRenaming() {\n\t\t\tvar new_value = $.trim(textbox.getValue()),\n\t\t\t\told_value = $caption.text();\n\n\t\t\tcancelRenaming();\n\n\t\t\tif (new_value !== old_value) {\n\t\t\t\t//Set new value\n\t\t\t\tsetValue(new_value);\n\n\t\t\t\t$el.trigger('rn:rename:stop', [_self, new_value, old_value]);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "093ec09db54df308790fdb7ea72a7fd4", "score": "0.6116899", "text": "function renameFile(files) {\n files.forEach(file => {\n file.name = file.name.replace(/^_/, '.').replace(/\\.ejs$/, '');\n });\n}", "title": "" }, { "docid": "093ec09db54df308790fdb7ea72a7fd4", "score": "0.6116899", "text": "function renameFile(files) {\n files.forEach(file => {\n file.name = file.name.replace(/^_/, '.').replace(/\\.ejs$/, '');\n });\n}", "title": "" }, { "docid": "2ee004e76f97795b46a2b425048eec50", "score": "0.6107928", "text": "addUpdatedProjectName(workspaceId, projectName, newProjectName) {\n this.httpBackend.when('POST', '/api/ext/project/' + workspaceId + '/rename/' + projectName + '?name=' + newProjectName).respond(newProjectName);\n }", "title": "" }, { "docid": "9971838716d9321db8bfea5b80b9fb4d", "score": "0.6072208", "text": "function getNewName()\n{\n\tvar ext, docName, newName, saveInFile, docName;\n\tdocName = sourceDoc.name;\n\text = '.ai'; // new extension for pdf file\n\tnewName = \"\";\n\t\t\n\tfor ( var i = 0 ; docName[i] != \".\" ; i++ )\n\t{\n\t\tnewName += docName[i];\n\t}\n\tnewName += ext; // full pdf name of the file\n\t\n\t// Create a file object to save the pdf\n\tsaveInFile = new File( destFolder + '/' + newName );\n\t\n\n\treturn saveInFile;\n}", "title": "" }, { "docid": "4fc650861fea33a99d5058abb3802973", "score": "0.6065935", "text": "renamePlayer(oldName, newName)\n\t{\n\t\tlet card = this._cards.find( (card) => card.name == oldName);\n\t\tif (card)\n\t\t{\n\t\t\tcard.name = newName;\n\t\t}\n\t}", "title": "" }, { "docid": "11f41083f99aa64389a51c11a9432427", "score": "0.60617375", "text": "_renameChunk(x, y, x1, y1) {\n const key = `${x},${y}.dat`;\n const newKey = `${x1},${y1}.dat`;\n\n const chunkPath = path.resolve(this.dataPath, key);\n const newChunkPath = path.resolve(this.dataPath, newKey);\n\n if (fs.existsSync(chunkPath)) {\n fs.renameSync(chunkPath, newChunkPath);\n }\n }", "title": "" }, { "docid": "7bffc3bf0e2ee5be2ba4dc1506a18af8", "score": "0.6050948", "text": "function __generateOriginalName(name) {\n\t return 'original:' + name;\n\t}", "title": "" }, { "docid": "3827cb2fbe6f40d1e872e445780fd287", "score": "0.60435426", "text": "function renameFile(manager, oldPath, newPath) {\n return manager.rename(oldPath, newPath).catch(function (error) {\n if (error.message.indexOf('409') === -1) {\n throw error;\n }\n return shouldOverwrite(newPath).then(function (value) {\n if (value) {\n return manager.overwrite(oldPath, newPath);\n }\n return Promise.reject('File not renamed');\n });\n });\n}", "title": "" }, { "docid": "0a28f0a3bc7c23727e426e4c81c989d9", "score": "0.60377324", "text": "function jchtml5_rename_title(argument0){\n\tdocument.title = argument0;\n}", "title": "" }, { "docid": "0a28f0a3bc7c23727e426e4c81c989d9", "score": "0.60377324", "text": "function jchtml5_rename_title(argument0){\n\tdocument.title = argument0;\n}", "title": "" }, { "docid": "b051bb18c78f2e49841aa66ed1a1f4c9", "score": "0.60355496", "text": "function renameTabConfirm(p_tab, p_name) {\n\n\tp_tab.tag.tab_title_span.innerHTML=p_name;\n\n}", "title": "" }, { "docid": "51408ef5a8960adaad922f3c187a938f", "score": "0.6034114", "text": "function rename(obj) {\n return rename_(function(parsedPath) {\n return {\n extname: obj.extname || parsedPath.extname,\n dirname: (obj.dirnamePrefix || '') + parsedPath.dirname,\n basename: parsedPath.basename\n };\n });\n}", "title": "" }, { "docid": "04beee51e680cedeefcb701359a8309c", "score": "0.6033415", "text": "renameTempUpload(pkfp, tempName, name){\n return new Promise((resolve, reject)=>{\n let self = this;\n let fPath = this.getPath(pkfp, \"files\");\n let oldName = path.join(fPath , tempName);\n let newName = path.join(fPath , name);\n let maxAttempts = 4;\n let timeout = 1000;\n let attempted = 0;\n\n function renameAttempt(){\n Logger.debug(`File exists. Renaming. Attempt: ${attempted}`, {cat: \"files\"});\n fs.rename(oldName, newName, (err)=>{\n if (err){\n if ((/BSY/i.test(err.code) || /BUSY/i.test(err.code)) && attempted < maxAttempts){\n Logger.warn(`Error renameing file: file is busy. Attempt: ${attempted}`, {cat: \"files\"})\n attempted++;\n setTimeout(renameAttempt, timeout);\n }else {\n Logger.error(\"Error renaming file: \" + err, {cat: \"files\"})\n console.log(\"ERROR renaming file: \" + err);\n reject(new Error(\"renameTempUpload error: \" + err));\n }\n } else {\n //success\n console.log(\"Renamed. Resolving...\")\n resolve();\n }\n\n });\n }\n renameAttempt();\n })\n }", "title": "" }, { "docid": "b19a062f018df240251363d5c12d2426", "score": "0.6029428", "text": "function FileManagerRename(node)\r\n{\r\n var parent = $(node).parents(\"li:eq(0)\").get(0);\r\n var parentpath = $(parent).attr('fsdata');\r\n var title = $(node).children(\"a:visible\").text();\r\n \r\n $.post('/Admin/FileManager/CreateFolder', {name: title, path: parentpath}, function(folderPath){\r\n $(node).attr('fsdata', folderPath);\r\n $(node).attr('id', folderPath);\r\n var arr = folderPath.split('/');\r\n $(node).children(\"a:visible\").html(arr[arr.length-1]);\r\n });\r\n}", "title": "" }, { "docid": "5d4d1f35f4caec38785b349034457088", "score": "0.60146534", "text": "renameItem(data, callback) {\n return this.db.run(\n `UPDATE tree SET name = ? WHERE name = ? AND parent = ?`,\n data, \n err => {\n callback(err);\n })\n }", "title": "" }, { "docid": "144c9691abf2e0e609a2e7f5c0ad023b", "score": "0.6003658", "text": "function renameFileEventFn(type, oldFilename, newFilename, callback) {\n return function(err) {\n if(!err) {\n self.trigger(type, [oldFilename, newFilename]);\n }\n callback(err);\n };\n }", "title": "" }, { "docid": "58ff911acc2b7ec78c4dcbea3f3572c9", "score": "0.599823", "text": "function mvFileKeepTimeStamp(from,to)\n{\n\tvar date = fs.statSync(from).mtime\n\tfs.renameSync(from, to);\n\tfs.open(to, (err,fd)=>{\n\t\tfs.futimesSync(fd, date, date);\n\t})\n\t\n}", "title": "" }, { "docid": "3596180f1e8f2631b7fded3255fb8cf0", "score": "0.5990751", "text": "function main(file, dir2) {\n //gets file name and adds it to dir2\n var f = path.basename(file);\n var dest = path.resolve(dir2, f);\n\n fs.renameSync(file, dest);\n}", "title": "" }, { "docid": "319c7748f17637d509ef4c8a151c9877", "score": "0.5989605", "text": "function rename_animation(animation,name)\n{\n /*fixes the name in the animation menu entry*/\n for(child of animation.target.animation_selection_menu.children)\n {\n if(child.animationtselect == animation) child.innerHTML = \"<a>\" + name + \"</a>\";\n }\n /*Setting new name of the animation*/\n animation.name = name;\n}", "title": "" }, { "docid": "3424f7579f16f8f3c142a1b5ba51ebce", "score": "0.5981969", "text": "async renameItem(id) {\n try {\n const res = await this.endPoint.put(`/item/rename/${id}`)\n return res.data\n } catch (err) {\n throw new Error(err)\n }\n }", "title": "" }, { "docid": "1c963b4a0366e16d6db7900dd090ec9b", "score": "0.5979677", "text": "function handleChange(newName) {\n setName(newName);\n }", "title": "" }, { "docid": "b25c58881f9a0512658df1a1f1273226", "score": "0.59724563", "text": "function causeRenameHandler(data) {\n var oldNode = fd.graph.getNode(data.causeId);\n oldNode.title = data.newName;\n var node = $('#' + data.causeId);\n var children = node.children();\n // Here .html is used instead of .text, as CauseRenameEvent escapes HTML\n node.html(data.newName);\n node.append(children);\n}", "title": "" }, { "docid": "cf3a1a70b682fc57209a7fbd125077a7", "score": "0.59700704", "text": "function rename(oldPath, newPath) {\n return fs.promises.rename(oldPath, newPath);\n}", "title": "" }, { "docid": "f2001bcc93e2175abf8df189feaffc79", "score": "0.59680504", "text": "function renameFolder(folder, newName) {\n var current = [], future = [], modify = false;\n var title = $('.upper-title');\n title.empty();\n // Check the new name\n if (newName.length == 0 || g_folders[newName] != undefined) {\n title.append(folder.name);\n showFolderError('The folder <b>' + newName + '</b> already exists!');\n } else {\n title.append(newName);\n delete g_folders[folder.name];\n g_folders[newName] = folder;\n if (folder.name == g_homeFolderName) {\n // Remember the new home name\n Windows.Storage.ApplicationData.current.localSettings.values['home'] = newName;\n folder.name = newName;\n } else {\n // Modify the path of files\n folder.name = newName;\n current.push(folder);\n while (current.length > 0) {\n current.forEach(function (c) {\n future = future.concat(c.folders);\n c.files.forEach(function (f) {\n modify = true;\n setPath(c, f);\n });\n });\n current = future.slice(0);\n future = [];\n }\n }\n }\n if (modify) {\n uploadMetadata();\n }\n}", "title": "" }, { "docid": "d2082e6a240bad9505011feb2a4f0d59", "score": "0.5967815", "text": "function rename(obj, newNames) {\n return _.reduce(\n newNames,\n (o, newKey, oldKey) => {\n if (_.has(obj, oldKey)) {\n o[newKey] = obj[oldKey]; // eslint-disable-line\n } else {\n o[newKey] = null; // eslint-disable-line\n }\n return o;\n },\n _.omit.apply(null, construct(obj, _.keys(newNames)))\n );\n}", "title": "" }, { "docid": "d25fa3288fd19228d11d1699f5cda8ec", "score": "0.59675545", "text": "function actionRenameTag(e) {\n handleEventCancel(e, 'actionRenameTag');\n if (canTakeAction('actionRenameTag()') === false) {\n return;\n }\n genericModal($dlg.renameTag);\n }", "title": "" }, { "docid": "bccb5f4f60672c752a3f2f071bf76437", "score": "0.5960196", "text": "changeName(newName) {\n this.name = newName;\n updateTeam(this._id, \"name\", this.name);\n }", "title": "" }, { "docid": "f3391a0eb26e1ef9dbe68dcf44c2ce10", "score": "0.5942692", "text": "function changeIosBundleName(projectDir, projectName,options){\n if(!options.ios){\n return\n }\n var oldPacakgeName = 'org.reactjs.native.example.'\n var replacements = {}\n replacements[oldPacakgeName] = options.ios + '.'\n util.copyProjectTemplateAndReplace(projectDir+'/ios', projectDir+'/ios1', replacements )\n util.deleteDir(projectDir+'/ios')\n fs.renameSync(projectDir+'/ios1',projectDir+'/ios')\n }", "title": "" }, { "docid": "3b5cdd43326f0873e20ed68047d74eee", "score": "0.59242576", "text": "function changeName(username) {\n return username = \"semper-ry\"\n}", "title": "" }, { "docid": "1dad2a5febb2ef42ff0f72c8da1d04e3", "score": "0.59083545", "text": "onRename(user, oldUserid, isJoining, isForceRenamed) {\n\t\tif (!this.allowRenames || (!user.named && !isForceRenamed)) {\n\t\t\tif (!(user.userid in this.players)) {\n\t\t\t\tuser.games.delete(this.id);\n\t\t\t\tuser.updateSearch();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (!(oldUserid in this.players)) return;\n\t\tthis.renamePlayer(user, oldUserid);\n\t\tif (this.childGame && this.childGame.onRename) this.childGame.onRename(user, oldUserid, isJoining, isForceRenamed);\n\t}", "title": "" }, { "docid": "0981f74666ab73272a2f84e276df12a1", "score": "0.5904401", "text": "static renameTask(e) {\n if (e.key !== 'Enter') return\n\n const projectName = document.getElementById('project-name').textContent\n const taskName = this.previousElementSibling.textContent\n const newTaskName = this.value\n\n if (newTaskName === '') {\n alert(\"Task name can't be empty\")\n return\n }\n\n if (Storage.getTodoList().getProject(projectName).contains(newTaskName)) {\n this.value = ''\n alert('Task names must be different')\n return\n }\n\n if (projectName === 'Today' || projectName === 'This week') {\n const mainProjectName = taskName.split('(')[1].split(')')[0]\n const mainTaskName = taskName.split(' ')[0]\n Storage.renameTask(\n projectName,\n taskName,\n `${newTaskName} (${mainProjectName})`\n )\n Storage.renameTask(mainProjectName, mainTaskName, newTaskName)\n } else {\n Storage.renameTask(projectName, taskName, newTaskName)\n }\n UI.clearTasks()\n UI.loadTasks(projectName)\n UI.closeRenameInput(this.parentNode.parentNode)\n }", "title": "" }, { "docid": "832af32d2b6b4363f0c666c64f356af7", "score": "0.5898459", "text": "function update_file_name(name) {\r\n\tparent.document.file.identifier.value = document.blosxom.plugin_blosxom_pwd.value + name;\r\n\tdocument.blosxom.entry.value = name;\r\n\tparent.document.file.filename.value = name;\r\n}", "title": "" }, { "docid": "7884419498233fcb55dbbe001dc678ea", "score": "0.58860093", "text": "function renameNextFolder() {\n const oldPath = `./out/${oldName}`;\n const newPath = `./out/${newName}`;\n\n fs.rename(oldPath, newPath, function (error) {\n if (error) {\n console.error(error);\n } else {\n console.log(`'${oldName}' folder successfully renamed to '${newName}'`);\n }\n });\n}", "title": "" }, { "docid": "81d8dd64e71b7346a34f202af5097916", "score": "0.5885106", "text": "function UpdateFileName(id, sNewFileName) {\n\tvar aPath = sNewFileName.split('\\\\')\n\tvar sNewFileName = aPath[aPath.length - 1]\n\n\t$('#' + id).val(sNewFileName)\n\t$('#' + id).trigger('validate')\n\t$('#name_' + id).text(sNewFileName)\n\treturn true\n}", "title": "" }, { "docid": "bdd15b524eb1281cb4d150de45937c45", "score": "0.5885023", "text": "function getNewName()\r{\r\tvar ext, docName, newName, saveInFile, docName;\r\tdocName = sourceDoc.name;\r\text = '_AB_nobleed_HR.pdf'; // new extension for pdf file\r\tnewName = \"\";\r\t\t\r\tfor ( var i = 0 ; docName[i] != \".\" ; i++ )\r\t{\r\t\tnewName += docName[i];\r\t}\r\tnewName += ext; // full pdf name of the file\r\t\r\t// Create a file object to save the pdf\r\tsaveInFile = new File( folderPDF + '/' + newName );\r\t\r\r\treturn saveInFile;\r}", "title": "" }, { "docid": "f81522c06968764e46a63298db923164", "score": "0.58847314", "text": "newFilename() {\n if (this.prevFilename !== this.currentFilename) {\n // Only do that after new file created\n this.prevFilename = this.currentFilename\n this.deleteOldFiles()\n }\n return super.newFilename()\n }", "title": "" }, { "docid": "f5b92da6d4b7a81f538226b70a15c38a", "score": "0.58809453", "text": "async renameFile(options){\n // Options can be either of these:\n // 1. old path & new path.\n // 2. name, ext, folder & new path.\n // 3. name, ext, folder & new name.\n\n // Options not allowed: old path & new name.\n\n const self = this;\n const fsn = await this.getFileSchemaNameFromFH();\n const validateConfig = await ObjectValidator.validate({ object: options, against: \"Func_RenameFile\", });\n if(validateConfig.success){\n let pathToFile = validateConfig.object.path ? validateConfig.object.path : (\n validateConfig.object.name && validateConfig.object.ext && validateConfig.object.folder !== null ? `${validateConfig.object.folder}${validateConfig.object.folder === \"\" ? \"\" : \"/\"}${validateConfig.object.name}.${validateConfig.object.ext}` : null\n );\n\n let newPath = validateConfig.object.newPath ? validateConfig.object.newPath : (\n validateConfig.object.newName && validateConfig.object.ext && validateConfig.object.folder !== null ? `${validateConfig.object.folder}${validateConfig.object.folder === \"\" ? \"\" : \"/\"}${validateConfig.object.newName}.${validateConfig.object.ext}` : null\n );\n\n if(pathToFile == null || newPath == null){\n return false;\n }\n\n pathToFile = await this.beautifyPath(pathToFile, true);\n newPath = await this.beautifyPath(newPath, true);\n\n let response = await this.renameS3File(pathToFile, newPath);\n if(response){ Logger.log(`${fsn} renamed`); return true; }\n\n Logger.log(`${fsn} renaming failed`);\n }else{ Logger.log(`${fsn} renaming failed`); }\n\n return false;\n }", "title": "" }, { "docid": "93701bf1857c7fff2e2d38e57eed5556", "score": "0.58745474", "text": "function cancelRenaming() {\n\t\t\tif (textbox) {\n\t\t\t\ttextbox.destroy();\n\t\t\t\ttextbox.remove();\n\t\t\t}\n\n\t\t\t$caption.show();\n\n\t\t\tdestroyCloseListLayer();\n\n\t\t\t$el.trigger('rn:rename:cancel', [_self]);\n\t\t}", "title": "" }, { "docid": "6fd3c5317ddbd4bca108d583db7807bd", "score": "0.5867363", "text": "updateName(name) {\n\t\tthis[_nextName] = name;\n\t}", "title": "" }, { "docid": "2e441907eb9e8808f70fc15762caf613", "score": "0.5859029", "text": "set name(newName){\n if(newName.length < 3){\n this._name = 'Name Error: Length must be at least 3 characters';\n } else {\n this._name = newName;\n }\n }", "title": "" }, { "docid": "f89a31391ec397cbd76667ba2f2540da", "score": "0.5858593", "text": "function Rename(id, name, ctx) {\n return {\n id: id,\n name: name,\n context: ctx\n };\n }", "title": "" }, { "docid": "9bd18c4d63dde197a9d441de713be3c2", "score": "0.58584386", "text": "function renameOld({name, type, culture: cultureId}) {\n if (type !== \"Folk\") return name;\n\n const haveOrganized =\n namedReligions.some(\n ({type, culture, expansion}) => culture === cultureId && type === \"Organized\" && expansion === \"culture\"\n ) ||\n lockedReligions.some(\n ({type, culture, expansion}) => culture === cultureId && type === \"Organized\" && expansion === \"culture\"\n );\n if (haveOrganized && name.slice(0, 3) !== \"Old\") return `Old ${name}`;\n return name;\n }", "title": "" }, { "docid": "45f793a91dd909f335be70b487d03abd", "score": "0.585084", "text": "static async renameWorkspace(trace, newName, oldName) {\n log(trace, `Renaming workspace \"${oldName}\" to \"${newName}\"`);\n // Renaming to the same name should be a noop.\n if (newName === oldName)\n return Promise.resolve(newName);\n const aws = await WorkspaceManager.getActiveWorkspace(trace);\n const targetingActiveWorkspace = oldName === aws.name;\n const ws = await WorkspaceManager.getWorkspace(trace, oldName);\n const finalName = await WorkspaceManager.addWorkspace(trace, Object.assign({}, ws, { name: newName }));\n log(trace, `Final name of rename: ${finalName}`);\n const states = await WorkspaceManager._WS.getManyCompleteStates(ws.windows, oldName);\n log(trace, \"Window states\", states);\n await WorkspaceManager._WS.setManyCompleteStates(states, finalName);\n if (targetingActiveWorkspace) {\n const aStates = await WorkspaceManager._WS.getManyCompleteStates(aws.windows);\n await WorkspaceManager.setActiveWorkspace(trace, finalName);\n await WorkspaceManager._WS.setManyCompleteStates(aStates);\n await WorkspaceManager.updateActiveWorkspace(trace, aws => {\n return Object.assign({}, aws, { name: finalName });\n });\n }\n await WorkspaceManager.removeWorkspace(trace, oldName);\n return finalName;\n }", "title": "" }, { "docid": "a09292d04813a50e46a97c8d626fbd72", "score": "0.5842135", "text": "function rename(d){\n if (d.key){\n d['name']=d.key;\n delete d.key;\n } else {\n lastchild = d[lastchild_I];\n for(var key in d){delete d[key];}; //remove all object properties\n //needed for proper rendering of data for d3 layouts\n d['name']=lastchild;\n };\n if (d.values){\n d['children'] = d.values;\n d['children'].forEach(rename);\n delete d.values;\n };\n }", "title": "" }, { "docid": "d80fbbae8cac89a6ba0f14b57a3ccf55", "score": "0.58348936", "text": "function add_new_name ( obj, name ) {\n if ( obj.canonical_name !== undefined ) {\n if ( obj.canonical_name > name ) {\n add_secondary_name ( obj, obj.canonical_name );\n obj.canonical_name = name;\n }\n else {\n add_secondary_name ( obj, name );\n }\n }\n else {\n obj.canonical_name = name;\n }\n }", "title": "" }, { "docid": "efdd5a71bc83f447f4195508512a74c6", "score": "0.58277303", "text": "renameTable(tableName, to) {\n this.pushQuery(`rename table ${this.formatter.wrap(tableName)} to ${this.formatter.wrap(to)}`);\n }", "title": "" }, { "docid": "dc1b21a711ab560e686533a28553f5e6", "score": "0.5826938", "text": "function rename(res){\n fs.rename(saveDir + '.zip', saveDir + 'screenshots.zip', function (err) {\n if (err){\n console.log('Error renaming blank zip folder:');\n console.log(err);\n throw err;\n } \n console.log('Saved as ' + saveDir + 'screenshots.zip');\n // Send the response (zip file) back\n res.download(saveDir + 'screenshots.zip');\n setTimeout(function(){ removeFolder(); }, 30 * 1000);\n });\n }", "title": "" }, { "docid": "f941f066b72901a8f60d727f9ba22ebb", "score": "0.581719", "text": "renameTable(from, to) {\n this.pushQuery(\n `alter table ${this.formatter.wrap(from)} rename to ${this.formatter.wrap(\n to\n )}`\n );\n }", "title": "" }, { "docid": "fbe018716937792fde74cfb16fb3da93", "score": "0.5814857", "text": "function emitRenameReq(){\n var id = \"#cmInputRename\";\n action = \"rename\";\n\n if (!isDriver || cmActionLocks[action] || !cmNameValidation(id)) return;\n\n cmActionLocks[action] = true; // lock the action\n socket.emit('context_menu_clicked',\n {\n key: action,\n relPath: cmRelPath,\n user: username,\n room: roomname,\n name: $(id).val(),\n text: editor.getSession().getValue(),\n activePath: getActiveFolderPath()\n });\n}", "title": "" }, { "docid": "cd64650459e94bc6191630978859de17", "score": "0.5808675", "text": "function updateExportNames() {\n $(\"modelValuesTable\").select('.modelName').each(\n function(ctrl) {\n var modelId = ctrl.readAttribute('model_id');\n var modelOrder = ctrl.readAttribute('model_order');\n }\n );\n\n if (!this.editor) { return; }\n var oldName = this.editor.undoText;\n var newName = this.editor.originalText;\n\n $A($(\"export_model_select\").options).each(function(option) {\n if (option.innerHTML == oldName) { option.innerHTML = newName; }\n }); \n}", "title": "" }, { "docid": "7d7f486b37f02f26b6f4692cca9f6eee", "score": "0.579444", "text": "function tryRename(p1, p2) {\n try {\n fs.linkSync(p1, p2);\n } catch(e) {\n if (e.code === \"EEXIST\") {\n return false;\n } else {\n throw e;\n }\n }\n fs.unlinkSync(p1);\n return true;\n }", "title": "" }, { "docid": "179650f00fc640f747684dadf4e5ed71", "score": "0.5784263", "text": "renameChat(dialogId, newName) {\n\t return babelHelpers.classPrivateFieldLooseBase(this, _renameService)[_renameService].renameChat(dialogId, newName);\n\t }", "title": "" }, { "docid": "6f2b3ebc4b79480b5870a98f14f423a3", "score": "0.5776471", "text": "function move({ oldPath, newPath }, callback) {\n fs.rename(oldPath, newPath, function (err) {\n if (err) {\n if (err.code === 'EXDEV') {\n copy();\n } else {\n callback(err);\n }\n return;\n }\n callback();\n });\n\n function copy() {\n var readStream = fs.createReadStream(oldPath);\n var writeStream = fs.createWriteStream(newPath);\n\n readStream.on('error', callback);\n writeStream.on('error', callback);\n\n readStream.on('close', function () {\n fs.unlink(oldPath, callback);\n });\n\n readStream.pipe(writeStream);\n }\n}", "title": "" }, { "docid": "158fc4fd107a7a05ab21595e4828cfa5", "score": "0.5771346", "text": "function dlRenameStart(){\n\t\n\trunning_action = 'dlRename'; // @todo unify\n\trename_dir_running = true;\n\t\n\t$li = $('#dirlist li.active');\n\t\t\n\tvar old_name = $li.attr('id').idToPath().filename();\n\n\t$li\n\t\t.addClass('in-action')\n\t\t.addClass('in-action-rename')\n\t\t.data('old_name', old_name)\n\t\t.find('> span').hide().end()\n\t\t.prepend('<input type=\"text\" class=\"new_name\" value=\"'+ old_name +'\" />')\n\t\t.find('input.new_name').select();\n\n}", "title": "" }, { "docid": "9475fb3e5c1378227d5d58da8f223b19", "score": "0.5756462", "text": "function updateDbEntryAndMove(sFileNameOld, sFileNameNew, fCallback) {\n\t// update database entry\n\tvar sSql = esc(\"UPDATE datasets SET file_name = %Q WHERE file_name = %Q;\",\n\tsFileNameNew, sFileNameOld);\n\t\t\n\tpostgres.query(sSql, function(oErr, oResult) {\n\t\tif(oErr) {fCallback(oErr);}\n\t\t\t\n\t\t// move old file to the archive\n\t\tfs.rename(\n\t\t\tpath.join(config.app.dataset_root_path, sFileNameOld),\n\t\t\tpath.join(config.app.dataset_root_path, \"A\", sFileNameOld),\n\t\tfunction(oErr) {\n\t\t\tif(oErr) {fCalllback(oErr);}\n\t\t\tfCallback();\n\t\t});\n\t});\n}", "title": "" }, { "docid": "316cd0ca881732450200def7f26ceac7", "score": "0.57448095", "text": "async changeName(route, newName, oldName) {\n const result = await axios.post(getRoute(\"changename\"), {\n route: route,\n oldName: oldName,\n newName: newName,\n });\n return result.data;\n }", "title": "" }, { "docid": "6957b046e2c200febb8bd0ec46b7a956", "score": "0.57290727", "text": "function startRenaming() {\n\t\t\tvar offset = $el.offset(),\n\t\t\t\twidth = $el.width();\n\t\t\tvar special_class_name = $caption.data('js_rename_class') || '';\n\n\n\t\t\tcreateCloseListLayer();\n\n\t\t\ttextbox = $('<input type=\"text\" class=\"rename_component_input ' + special_class_name + '\" />').appendTo('body');\n\t\t\ttextbox.textbox({\n\t\t\t\ttype : 'text', value : 0, min : 3, max : 20, template : 'internal', live : true\n\t\t\t}).focus()\n\t\t\t.on('txt:key:enter', function() {\n\t\t\t\tstopRenaming();\n\t\t\t}).on('txt:key:esc', function() {\n\t\t\t\tcancelRenaming();\n\t\t\t});\n\n\t\t\ttextbox.css({left : offset.left, top : offset.top, width : width}).val(settings.text);\n\n\t\t\t$caption.hide();\n\n\t\t\t$el.addClass('renaming_started');\n\n\t\t\t$el.trigger('rn:rename:start', [_self]);\n\t\t}", "title": "" }, { "docid": "f2ff5bde1cd1884af158765c1f8a22f3", "score": "0.5719862", "text": "function renameTable(tblData, tblName, newTblName, db, overwrite) {\n if (overwrite) {\n dropTable(tblData, newTblName, db);\n }\n tblData[newTblName] = tblData[tblName];\n delete tblData[tblName];\n executeSimpleSQL(db, \"ALTER TABLE \" + tblName +\n \" RENAME TO \" + newTblName);\n}", "title": "" }, { "docid": "6b6709a8ada99b4baab0115ab69c2a6e", "score": "0.56842726", "text": "function handleNameChange(newName, position){\n setPlayers((oldPlayers) => oldPlayers.map(player => player.Id === position ? {...player, Name: newName} : {...player}));\n }", "title": "" }, { "docid": "fdfa2b94bdebdec30b1f6fc165a42d6f", "score": "0.56789297", "text": "function defaultFilenameModifier (fileInfo, version) {\n if (fileInfo.dest.endsWith('index.um')) {\n return fileInfo.clone({\n dest: fileInfo.dest.replace('index.um', version) + '/' + 'index.um'\n })\n } else {\n return fileInfo.clone({\n dest: fileInfo.dest.replace('.um', '') + '/' + version + '.um'\n })\n }\n}", "title": "" }, { "docid": "b8741191b52a92128b5cbde12c9899d2", "score": "0.56684804", "text": "function renameSprites() {\n return gulp.src([assets.components + '/*.css'])\n .pipe(plumber())\n .pipe(rename({\n basename: '_sprites',\n extname: '.scss'\n }))\n .pipe(gulp.dest(assets.components))\n}", "title": "" }, { "docid": "f51457885ed1d059adb3394c5ba9ae9a", "score": "0.56667155", "text": "function fixPageName(){\n\tvar newPageTitle = getElementsByClassName(document, 'span', 'changePageTitle')[0]; // Find the span with the new title\n\tif(newPageTitle == null) return; // If not found exit\n\tvar oldPageTitle = getElementsByClassName(document, 'header', 'WikiaPageHeader')[0].getElementsByTagName( \"h1\" )[0]; //Find the page's title\n\tif(oldPageTitle == null) return; // If not found exit\n\toldPageTitle.innerHTML = newPageTitle.innerHTML; // Set the title\n}", "title": "" }, { "docid": "447a34919d95269e66b0b40be50fdd74", "score": "0.5656533", "text": "_renameStream(streamName) {\n if (streamName.indexOf('/default/') !== -1) {\n return streamName\n } else {\n let tokens = streamName.split('/')\n return [tokens[0], 'default', tokens[2]].join('/')\n }\n }", "title": "" }, { "docid": "d14a2b9070fc723213164182540dd578", "score": "0.5655735", "text": "function renameComponent(content) {\n return content.replace(/\\/\\*COMPONENT_NAME\\*\\//g, argv.name);\n}", "title": "" }, { "docid": "3c95152df4c214aac85917742fb59374", "score": "0.56539506", "text": "async function rename_user(id, new_name) {\n const number = /^[0-9]*$/g\n const users = await db.read('./database/users.json')\n const user = await users.find(user => user.id == id)\n if(!id || !new_name) return console.log(`Inform the dm_id and username`)\n if(!id.match(number) || id.length != 18) return console.log(`DM_ID is incorret`)\n if(!user) return console.log(`User not found`)\n\n db.update('./database/users.json', id, new_name)\n console.log(`${user.name}, renamed to ${new_name}`)\n}", "title": "" }, { "docid": "13dc70e721b8b452472efdb30f2b9f05", "score": "0.56291616", "text": "changeName() {\n\t\tif (this.lives < 2) {\n\t\t\tthis.imgName = 'player';\n\t\t} else if (this.lives == 2) {\n\t\t\tthis.imgName = 'playerUp';\n\t\t} else {\n\t\t\tthis.imgName = 'playerUltimate';\n\t\t}\n\t}", "title": "" }, { "docid": "65b953bda1053b0ac406ee9cfb75da49", "score": "0.5626902", "text": "function dlRenameSend(from, to_name){\n\t\n\t$.ajax({\n\t\turl: '?do=ajax/renameDir',\n\t\ttype: 'post',\n\t\tdata: ({from:from, to_name:to_name}),\n\t\tdataType: 'json',\n\t\ttimeout: 5000,\n\t\tbeforeSend: function() {\n\t\t\tcontentWorkingStatusOn();\n\t\t},\n\t\terror: function(){\n\t\t\trenderError('Attempt to rename directory failed. Please, try again, maybe later.');\n\t\t\tcontentWorkingStatusOff();\n\t\t},\n\t\tsuccess: function(data) {\n\n\t\t\tcontentWorkingStatusOff();\n\t\t\t\n\t\t\tif (data['status'] == 'error')\n\t\t\t\trenderError(data['data']);\n\t\t\telse {\n\t\t\t\t\n\t\t\t\tvar new_name = data['data'];\n\t\t\t\tvar $li = $('#dirlist li.in-action-rename');\n\t\t\t\tvar new_id = ($li.attr('id').idToPath().dirname() + new_name).pathToId('dl');\n\n\t\t\t\t// hide input\n\t\t\t\t$li\n\t\t\t\t\t.attr('id', new_id)\n\t\t\t\t\t.find('> input')\n\t\t\t\t\t\t.remove().end()\n\t\t\t\t\t.find('> span')\n\t\t\t\t\t\t.text(new_name).show().end()\n\t\t\t\t\t.removeClass('in-action')\n\t\t\t\t\t.removeClass('in-action-rename')\n\t\t\t\t\t.removeData('old_name');\t\t\t\t\t\n\t\t\t\t\n\t\t\t\tif ($li.find('li').length) \n\t\t\t\t\tdlRebuild(new_id.idToPath()); // need to re-generate childrens' ids\n\t\t\t\telse\n\t\t\t\t\tdirActivate(new_id.idToPath());\n\t\t\t\t\n\n\t\t\t\tdlRenameFinally();\n\t\t\t}\n\t\t\t\n\t\t} // /success\n\t});\n\t\n}", "title": "" }, { "docid": "d68029dfcfa80f38c9e82bd34f7f89ba", "score": "0.5618406", "text": "renameFile(file, cb) {\n let reader = new FileReader();\n\n reader.onloadend = function (event) {\n let dataset = dicomParser.parseDicom(new Uint8Array(event.target.result));\n let index = parseInt(dataset.string('x00200013'));\n let offset = (file.name.indexOf('.dcm') > -1) ? 4 : 0;\n let newName = file.name.substring(0, file.name.length - offset) + '_' + index + '.dcm';\n cb(newName);\n }\n\n reader.readAsArrayBuffer(file);\n }", "title": "" } ]
01ec85c4f909f8ceee2a72e78a412c3a
parseKerning parses a string representing the additional X advance between two characters. The input string consists of one line per pair of characters. Each line starts with the two characters to adjust the spacing for. Those are followed by whitespace and a number. This is parsed into a javascript map (associative array) associating two character strings (the character pairs) with a numeric spacing.
[ { "docid": "d38b552dd929e5eaab15a18c4815e2a3", "score": "0.7181909", "text": "function parseKerning(kerning) {\n var k = {};\n var re = /([-a-zA-Z0-9!@#$%^&*()_+={}|<>,./]{2}) +([0-9]+(.[0-9]*)?)/;\n var lines = kerning.split('\\n');\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i];\n var m = line.match(re);\n if (m) {\n k[m[1]] = Number(m[2]);\n }\n }\n return k;\n}", "title": "" } ]
[ { "docid": "5a3c493ccdb38366780bc881e319a712", "score": "0.56152", "text": "function parseKernTable(data, start) {\n var pairs = {};\n var p = new parse.Parser(data, start);\n var tableVersion = p.parseUShort();\n check.argument(tableVersion === 0, 'Unsupported kern table version.');\n // Skip nTables.\n p.skip('uShort', 1);\n var subTableVersion = p.parseUShort();\n check.argument(subTableVersion === 0, 'Unsupported kern sub-table version.');\n // Skip subTableLength, subTableCoverage\n p.skip('uShort', 2);\n var nPairs = p.parseUShort();\n // Skip searchRange, entrySelector, rangeShift.\n p.skip('uShort', 3);\n for (var i = 0; i < nPairs; i += 1) {\n var leftIndex = p.parseUShort();\n var rightIndex = p.parseUShort();\n var value = p.parseShort();\n pairs[leftIndex + ',' + rightIndex] = value;\n }\n\n return pairs;\n}", "title": "" }, { "docid": "5a3c493ccdb38366780bc881e319a712", "score": "0.56152", "text": "function parseKernTable(data, start) {\n var pairs = {};\n var p = new parse.Parser(data, start);\n var tableVersion = p.parseUShort();\n check.argument(tableVersion === 0, 'Unsupported kern table version.');\n // Skip nTables.\n p.skip('uShort', 1);\n var subTableVersion = p.parseUShort();\n check.argument(subTableVersion === 0, 'Unsupported kern sub-table version.');\n // Skip subTableLength, subTableCoverage\n p.skip('uShort', 2);\n var nPairs = p.parseUShort();\n // Skip searchRange, entrySelector, rangeShift.\n p.skip('uShort', 3);\n for (var i = 0; i < nPairs; i += 1) {\n var leftIndex = p.parseUShort();\n var rightIndex = p.parseUShort();\n var value = p.parseShort();\n pairs[leftIndex + ',' + rightIndex] = value;\n }\n\n return pairs;\n}", "title": "" }, { "docid": "89152d29d23139e7de6e94bd55fd1372", "score": "0.54074496", "text": "function step2() {\n const tmp = new Map();\n // iterate through all pairs, and then split. Create 2 new pairs and store in a map.\n // eg: if CB has 3 instances, then we increment CH and HB by 3\n for (let [pair, char] of rules.entries()) {\n let numOfPair = tracker.get(pair) || 0;\n\n let pairArr = pair.split(\"\");\n tmp.set(\n pairArr[0] + char,\n (tmp.get(pairArr[0] + char) || 0) + numOfPair\n );\n tmp.set(\n char + pairArr[1],\n (tmp.get(char + pairArr[1]) || 0) + numOfPair\n );\n }\n // set the tracker to our current iteration\n tracker = tmp;\n}", "title": "" }, { "docid": "4f020a7638662a74d985b91f76ba57dc", "score": "0.50971746", "text": "function parseKernTable(data, start) {\n var p = new parse.Parser(data, start);\n var tableVersion = p.parseUShort();\n if (tableVersion === 0) {\n return parseWindowsKernTable(p);\n } else if (tableVersion === 1) {\n return parseMacKernTable(p);\n } else {\n throw new Error('Unsupported kern table version (' + tableVersion + ').');\n }\n}", "title": "" }, { "docid": "4f020a7638662a74d985b91f76ba57dc", "score": "0.50971746", "text": "function parseKernTable(data, start) {\n var p = new parse.Parser(data, start);\n var tableVersion = p.parseUShort();\n if (tableVersion === 0) {\n return parseWindowsKernTable(p);\n } else if (tableVersion === 1) {\n return parseMacKernTable(p);\n } else {\n throw new Error('Unsupported kern table version (' + tableVersion + ').');\n }\n}", "title": "" }, { "docid": "c496c1506dcce0141fcbc049a34fe559", "score": "0.5077134", "text": "function parseKernTable(data, start) {\n\t var p = new parse.Parser(data, start);\n\t var tableVersion = p.parseUShort();\n\t if (tableVersion === 0) {\n\t return parseWindowsKernTable(p);\n\t } else if (tableVersion === 1) {\n\t return parseMacKernTable(p);\n\t } else {\n\t throw new Error('Unsupported kern table version (' + tableVersion + ').');\n\t }\n\t}", "title": "" }, { "docid": "04990018ddb86b65195b75cbce0c9424", "score": "0.50674695", "text": "function parseIntake(str){\n\n\t\t//var obj = new Object();\n\t\tvar intA, intB, intC, intD, intE, intF, ret;\n\n\t\t//declaring the object this way controls the order that the keys display in\n\t\tvar obj = {\n\t\t\tind: \"\",\n\t\t\talg: \"\",\n\t\t\tws: \"\",\n\t\t\tsub: \"\",\n\t\t\tqty: \"\",\n\t\t\tlen: 0,\n\t\t};\n\n\t\t//index\n\t\t//locate \"#\"\n\t\tintA = str.indexOf(\"#\") + 1;\n\t\t//if it exists, get all characters before and including it\n\t\tif(intA > 0){\n\t\t\tobj[\"ind\"] = str.substring(0, intA) + \" \";\n\t\t} else {\n\t\t\tobj[\"ind\"] = \"99# \";\n\t\t}\n\n\t\t//allergens\n\t\t//locate \"*\"\n\t\tintB = str.indexOf(\"*\");\n\t\t//if it exists, get string between it and the next \"*\"\n\t\tif(intB >= 0){\n\t\t\tintC = str.indexOf(\"*\", intB + 1) + 1;\n\t\t\tobj[\"alg\"] = str.substring(intB, intC) + \" \";\n\t\t}\n\n\t\t//whiteSpace \n\t\t//if there is an allergen, start from there\n\t\tif(intC >= 0){\n\t\t\t//strip beginning of string away from the alg\n\t\t\tstr = str.substring(intC);\n\t\t//otherwise use the index as the start of the string\n\t\t} else if(intA > 0){\n\t\t\tstr = str.substring(intA);\n\t\t}\n\t\t//with a stripped string, we can now search for the next non whitespace character\n\t\tintD = str.search(/\\S/);\n\t\tobj[\"ws\"] = str.substring(0, intD);\n\n\t\t//substance\n\t\tintE = str.indexOf(\":\") + 1;\n\t\tobj[\"sub\"] = str.substring(intD, intE) + \" \";\n\n\t\t//quantity\n\t\t//the replace() in this is equivalent to string.trim();\n\t\t//replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '')\n\t\tstr = str.substring(intE).trim(); \n\t\tif(str != \"\"){\n\t\t\tobj[\"qty\"] = str;\n\t\t}\n\n\t\tobj[\"len\"] = \tobj.ind.length + \n\t\t\t\t\t\tobj.alg.length + \n\t\t\t\t\t\tobj.sub.length;\n\n\t\treturn obj;\n\t\t}//parseIntake", "title": "" }, { "docid": "e42d693c8149571d7d30856acc9e431e", "score": "0.50226396", "text": "function parserReal(str) {\n var out = {};\n var first = 0, second = 0, type = '';\n console.log(str.charAt(0));\n for (var i = 0; i < str.length; i ++) {\n if (!nums.includes(str.charAt(i))) {\n first = str.slice(0, i);\n second = str.slice(i + 1);\n type = str.charAt(i);\n //extra test for pro mode:\n if (first.length === 0) {\n first = beautify($('#result3').text());\n }\n }\n }\n out.x = first;\n out.y = second;\n out.type = type;\n return out;\n}", "title": "" }, { "docid": "a0ea517c9456967b1c22af7bb423f607", "score": "0.5002155", "text": "function nsvg__parseNumber(/* const char */ s) {\n var it = \"\";\n var s_idx = 0;\n\n if (s[s_idx] === '-' || s[s_idx] === '+') {\n it += s[s_idx];\n s_idx++;\n }\n\n while (s[s_idx] && nsvg__isdigit(s[s_idx])) {\n it += s[s_idx];\n s_idx++;\n }\n\n if (s[s_idx] === '.') {\n it += s[s_idx];\n\n s_idx++;\n while (s[s_idx] && nsvg__isdigit(s[s_idx])) {\n it += s[s_idx];\n\n s_idx++;\n }\n }\n\n if (((s[s_idx]) === 'e') || ((s[s_idx]) === 'E')) {\n it += s[s_idx];\n\n s_idx++;\n if (((s[s_idx]) === '-') || ((s[s_idx]) === '+')) {\n it += s[s_idx];\n\n s_idx++;\n }\n\n while ((s[s_idx]) && nsvg__isdigit(s[s_idx])) {\n it += s[s_idx];\n\n s_idx++;\n }\n }\n\n return {s_idx : s_idx, it : it};\n}", "title": "" }, { "docid": "6513e72a0af32aa12510782035ff4610", "score": "0.497081", "text": "function parseTiles(input) {\n return _.map(_.padEnd(input, 7, '.'), (tile) => {\n if (tile === '.') return 0;\n if (tile === '_') return 100;\n return tile.charCodeAt(0) - 'A'.charCodeAt(0) + 1;\n });\n}", "title": "" }, { "docid": "02806a86b4606819018134dcf39d055a", "score": "0.49621361", "text": "function decoder(k, idx, string) {\r\n let tempString = ''\r\n let i = idx\r\n for (; i < string.length; i++) {\r\n const char = string[i]\r\n if (char === ']') {\r\n break\r\n } else if (char.charCodeAt() >= 48 && char.charCodeAt() <= 57) {\r\n let digit = char\r\n let j = i + 1\r\n while (string[j] !== '[') {\r\n digit += string[j]\r\n j++\r\n }\r\n digit = parseInt(digit)\r\n const recursion = decoder(digit, j + 1, string)\r\n i = recursion[0]\r\n tempString += recursion[1]\r\n } else {\r\n tempString += char\r\n }\r\n }\r\n const singleString = tempString\r\n while (k-- > 1) {\r\n tempString += singleString\r\n }\r\n return [i, tempString]\r\n}", "title": "" }, { "docid": "b0dd33c6feb1e8615d2cad2f844a6b92", "score": "0.48901242", "text": "function parseWindowsKernTable(p) {\n\t var pairs = {};\n\t // Skip nTables.\n\t p.skip('uShort');\n\t var subtableVersion = p.parseUShort();\n\t check.argument(subtableVersion === 0, 'Unsupported kern sub-table version.');\n\t // Skip subtableLength, subtableCoverage\n\t p.skip('uShort', 2);\n\t var nPairs = p.parseUShort();\n\t // Skip searchRange, entrySelector, rangeShift.\n\t p.skip('uShort', 3);\n\t for (var i = 0; i < nPairs; i += 1) {\n\t var leftIndex = p.parseUShort();\n\t var rightIndex = p.parseUShort();\n\t var value = p.parseShort();\n\t pairs[leftIndex + ',' + rightIndex] = value;\n\t }\n\t return pairs;\n\t}", "title": "" }, { "docid": "dac36a48377e647b96da7dca01575297", "score": "0.48785636", "text": "function spacingFromString(string) {\n if (!string || string == '')\n return null\n\n var spacing = {}\n\n var values = string.split(' ')\n\n // Check if first value is 'spacing'\n var spacingLayout = values[0]\n\n var layout = spacingLayout.slice(-1)\n if (layout == 'v' || layout == 'h') {\n // Spacing exists\n var space = spacingLayout.substring(0, spacingLayout.length - 1)\n\n log(1, 'Layout', layout)\n log(1, 'Spacing', space)\n\n if (parseFloat(space).toString() != space) {\n log(2, 'Spacing is invalid', string)\n return null\n }\n\n spacing.layout = layout\n spacing.space = space\n\n values.shift() // Remove the first element\n }\n\n var alignments = []\n var invalidAlignment = false\n values.forEach(function(value) {\n var alignment = simplifyAlignment(value)\n if (alignment) {\n alignments.push(alignment)\n } else if (value) {\n invalidAlignment = true\n return\n }\n })\n\n if (invalidAlignment) {\n log(2, 'Alignments is invalid', string)\n return null\n }\n\n if (alignments.length > 0) {\n spacing.align = alignments\n }\n\n return spacing\n}", "title": "" }, { "docid": "4103d4c2695755c20062a26bd1c3d930", "score": "0.4859974", "text": "function parseWindowsKernTable(p) {\n var pairs = {};\n // Skip nTables.\n p.skip('uShort');\n var subtableVersion = p.parseUShort();\n check.argument(subtableVersion === 0, 'Unsupported kern sub-table version.');\n // Skip subtableLength, subtableCoverage\n p.skip('uShort', 2);\n var nPairs = p.parseUShort();\n // Skip searchRange, entrySelector, rangeShift.\n p.skip('uShort', 3);\n for (var i = 0; i < nPairs; i += 1) {\n var leftIndex = p.parseUShort();\n var rightIndex = p.parseUShort();\n var value = p.parseShort();\n pairs[leftIndex + ',' + rightIndex] = value;\n }\n return pairs;\n}", "title": "" }, { "docid": "4103d4c2695755c20062a26bd1c3d930", "score": "0.4859974", "text": "function parseWindowsKernTable(p) {\n var pairs = {};\n // Skip nTables.\n p.skip('uShort');\n var subtableVersion = p.parseUShort();\n check.argument(subtableVersion === 0, 'Unsupported kern sub-table version.');\n // Skip subtableLength, subtableCoverage\n p.skip('uShort', 2);\n var nPairs = p.parseUShort();\n // Skip searchRange, entrySelector, rangeShift.\n p.skip('uShort', 3);\n for (var i = 0; i < nPairs; i += 1) {\n var leftIndex = p.parseUShort();\n var rightIndex = p.parseUShort();\n var value = p.parseShort();\n pairs[leftIndex + ',' + rightIndex] = value;\n }\n return pairs;\n}", "title": "" }, { "docid": "7cfc3cdcdf1df632b10286fd79770776", "score": "0.48318788", "text": "function parseKVPs(data)\n{\n var result = {};\n while(true)\n {\n var kvp = data.match(/(\\w+):\\s*(\\d+)?/);\n if (!kvp)\n break;\n\n result[kvp[1].toUpperCase()] = parse(kvp[2]);\n data = data.replace(kvp[0], '');\n }\n return result;\n}", "title": "" }, { "docid": "f019f1fb6b66627bde808650fb614a6f", "score": "0.48287967", "text": "drawLetterSpacing(text, x2, y2, isStroke = !1) {\n const letterSpacing = this._style.letterSpacing;\n let useExperimentalLetterSpacing = !1;\n if (TextMetrics.experimentalLetterSpacingSupported && (TextMetrics.experimentalLetterSpacing ? (this.context.letterSpacing = `${letterSpacing}px`, this.context.textLetterSpacing = `${letterSpacing}px`, useExperimentalLetterSpacing = !0) : (this.context.letterSpacing = \"0px\", this.context.textLetterSpacing = \"0px\")), letterSpacing === 0 || useExperimentalLetterSpacing) {\n isStroke ? this.context.strokeText(text, x2, y2) : this.context.fillText(text, x2, y2);\n return;\n }\n let currentPosition = x2;\n const stringArray = TextMetrics.graphemeSegmenter(text);\n let previousWidth = this.context.measureText(text).width, currentWidth = 0;\n for (let i2 = 0; i2 < stringArray.length; ++i2) {\n const currentChar = stringArray[i2];\n isStroke ? this.context.strokeText(currentChar, currentPosition, y2) : this.context.fillText(currentChar, currentPosition, y2);\n let textStr = \"\";\n for (let j2 = i2 + 1; j2 < stringArray.length; ++j2)\n textStr += stringArray[j2];\n currentWidth = this.context.measureText(textStr).width, currentPosition += previousWidth - currentWidth + letterSpacing, previousWidth = currentWidth;\n }\n }", "title": "" }, { "docid": "4c5a942029d2e80e4160f758a0352262", "score": "0.4773084", "text": "function pre_spacing(letter,char){\n\t\tlet special = [];\t/// Marx [ 'p', 'g', 'y', 'f'];\t\tspace /= 4;\n\t\tlet space = spacingProp *letter.bounds.width/2;\n\n\t\t// if(special.includes(char))\t\t\tspace /= 4;\n\t\t\n\t\treturn space + spacingFixed;\n\t}", "title": "" }, { "docid": "adf885b654a4bc9077488f8c9b88997c", "score": "0.47728786", "text": "characterNumberSymbol2(s) {\r\n let r = ''\r\n if (typeof s == 'string') {\r\n for (let i = 0; i < s.length; i++) {\r\n const e = s[i].toLowerCase()\r\n if (\r\n e == '0' ||\r\n e == '1' ||\r\n e == '2' ||\r\n e == '3' ||\r\n e == '4' ||\r\n e == '5' ||\r\n e == '6' ||\r\n e == '7' ||\r\n e == '8' ||\r\n e == '9' ||\r\n e == 'a' ||\r\n e == 'b' ||\r\n e == 'c' ||\r\n e == 'd' ||\r\n e == 'e' ||\r\n e == 'f' ||\r\n e == 'g' ||\r\n e == 'h' ||\r\n e == 'i' ||\r\n e == 'j' ||\r\n e == 'k' ||\r\n e == 'l' ||\r\n e == 'm' ||\r\n e == 'n' ||\r\n e == 'o' ||\r\n e == 'p' ||\r\n e == 'q' ||\r\n e == 'r' ||\r\n e == 's' ||\r\n e == 't' ||\r\n e == 'u' ||\r\n e == 'v' ||\r\n e == 'w' ||\r\n e == 'x' ||\r\n e == 'y' ||\r\n e == 'z' ||\r\n e == 'à' ||\r\n e == 'á' ||\r\n e == 'â' ||\r\n e == 'ã' ||\r\n e == 'è' ||\r\n e == 'é' ||\r\n e == 'ê' ||\r\n e == 'ì' ||\r\n e == 'í' ||\r\n e == 'î' ||\r\n e == 'ò' ||\r\n e == 'ó' ||\r\n e == 'ô' ||\r\n e == 'õ' ||\r\n e == 'ù' ||\r\n e == 'ú' ||\r\n e == 'û' ||\r\n e == 'ç' ||\r\n e == '!' ||\r\n e == '?' ||\r\n e == ',' ||\r\n e == '.' ||\r\n e == ':' ||\r\n e == ';' ||\r\n e == '@' ||\r\n e == '#' ||\r\n e == '$' ||\r\n e == '%' ||\r\n e == '&' ||\r\n e == '(' ||\r\n e == ')' ||\r\n e == '*' ||\r\n e == '-' ||\r\n e == '+' ||\r\n e == '/' ||\r\n e == '=' ||\r\n e == 'ª' ||\r\n e == 'º' ||\r\n e == '°' ||\r\n e == '¹' ||\r\n e == '²' ||\r\n e == '³' ||\r\n e == ' ' ||\r\n e == ' '\r\n ) {\r\n r += s[i]\r\n }\r\n }\r\n }\r\n return r.trim()\r\n }", "title": "" }, { "docid": "44a7983572bf57142d0b1b0c6ab9bda5", "score": "0.47478688", "text": "function parseKalamineLayout(keyMap) {\n let rv = {};\n for (let xkb in keyMap) {\n rv[KEYNAMES[xkb]] = keyMap[xkb];\n }\n rv.IntlBackslash = rv.IntlBackslash || rv.Backslash;\n rv.IntlYen = rv.IntlYen || rv.Backslash;\n return rv;\n}", "title": "" }, { "docid": "ae3c8afa9cc318f8f86b4d162d0fdd60", "score": "0.47477174", "text": "function parsePublicKeyComponents(text) {\n var textComponents = text.split('\\n');\n var keyComponents = {};\n // The component is the text after the identifier\n keyComponents.e = textComponents[textComponents.indexOf(\"e:\") + 1];\n keyComponents.n = textComponents[textComponents.indexOf(\"n:\") + 1];\n\n $('#rsa-decryption-key-e').val(keyComponents.e);\n $('#rsa-decryption-key-n').val(keyComponents.n);\n}", "title": "" }, { "docid": "90c674733bd345c8125534db37041f9d", "score": "0.47322538", "text": "function getKerning(fntData, left, right) {\n\t var match = get$4(buildKerningHashMapKey(left, right), fntData[/* kerningMap */5]);\n\t if (match !== undefined) {\n\t return match;\n\t } else {\n\t return 0;\n\t }\n\t}", "title": "" }, { "docid": "046f54691b0bb8290f0474a8edc9a477", "score": "0.47133386", "text": "function parsePublicKeyComponents(text) {\n var textComponents = text.split('\\n');\n var keyComponents = {};\n // The component is the text after the identifier\n keyComponents.e = textComponents[textComponents.indexOf(\"e:\") + 1];\n keyComponents.n = textComponents[textComponents.indexOf(\"n:\") + 1];\n\n $('#rsa-encryption-key-e').val(keyComponents.e);\n $('#rsa-encryption-key-n').val(keyComponents.n);\n}", "title": "" }, { "docid": "70e96a19d1b80230e3c60623ba51ed81", "score": "0.46978554", "text": "function parse(text){\n text=text.replace(/\\uFFFC/g,'');// delete strange unicode chars //TODO would this cause a total typed char to be higher than total char?\n totalCharCount = count(text);\n totalWordCount = text.match(/\\S*/g).length/2; //TODO why need to divid by two?\n\n\n\n\n window.labels=0;\n\n // delete the regular text pragraphs but keep the example code\n text=text.replace(/\\`\\`\\r/g,'``marc');\n \n if( text.includes(\"``\")){\n\n try{\n text = text.match(/(``)([^`]+)(``)/g).join(' '); // deletes the text that is not in the actual exmaple\n text = \"``\"+text.replace(/\\`\\`/g,'')+\"``\"; // turns all examples into just one example\n }catch(e){};\n\n\n\n }else{\n \n text = '<div>'+text+'</div>';\n\n }\n\n\n\n \n original=text;\n return text;\n}", "title": "" }, { "docid": "62b1864776467b67c0b6d1a41c59ecae", "score": "0.46477008", "text": "function _parseNumbers ( label )\n{\n if ( !label ) return []\n\n const nums = (\n label.split( /\\s+/ )\n .filter( function ( w ) { return w.match( /\\d/ ) } )\n .map( function ( l ) { return l.toLowerCase() } )\n )\n\n const results = []\n\n nums.forEach( function ( n ) {\n const m = n.match( /[-]?\\d+(\\.\\d+)?/ )\n if ( m && m[ 0 ] ) {} else { return }\n let num = Number( m[ 0 ] )\n\n const THOUSAND = 1000\n const MILLION = THOUSAND * THOUSAND\n\n if ( n.indexOf( 'm' ) >= 0 ) num = MILLION * num\n if ( n.indexOf( 'k' ) >= 0 ) num = THOUSAND * num\n\n results.push(num)\n } )\n\n return results\n}", "title": "" }, { "docid": "be7c3c7441a691658ac9fe79c49d9e48", "score": "0.4645228", "text": "function parsePrivateKeyComponents(text) {\n var textComponents = text.split('\\n');\n var keyComponents = {};\n // The component is the text after the identifier\n keyComponents.p = textComponents[textComponents.indexOf(\"p:\") + 1];\n keyComponents.q = textComponents[textComponents.indexOf(\"q:\") + 1];\n keyComponents.d = textComponents[textComponents.indexOf(\"d:\") + 1];\n\n $('#rsa-encryption-key-p').val(keyComponents.p);\n $('#rsa-encryption-key-q').val(keyComponents.q);\n $('#rsa-encryption-key-d').val(keyComponents.d);\n}", "title": "" }, { "docid": "0d13e93e165c07cb7166c195e7da925b", "score": "0.4636611", "text": "function HKern (oa) {\n\t\tthis.objtype = 'hkern';\n\n\t\tthis.leftgroup = oa.leftgroup || [];\n\t\tthis.rightgroup = oa.rightgroup || [];\n\n\t\t// Positive values reduce space between chars\n\t\tthis.value = oa.value || 0;\n\t}", "title": "" }, { "docid": "897e6f004ce8a740796a26addc5e4db6", "score": "0.46319956", "text": "function pairElement(str) {\n var letters = str.split(\"\");\n var pairsArray = [];\n var pairs = {\n \"A\": \"T\",\n \"T\": \"A\",\n \"C\": \"G\",\n \"G\": \"C\"\n }\n\n for (var key of letters) {\n pairsArray.push([key, pairs[key]]);\n }\n return pairsArray;\n}", "title": "" }, { "docid": "a2b02d3bd1a2c97f54b6bcd95524cefb", "score": "0.46217036", "text": "scanKings(fen) {\n this.kingPos = { w: [-1, -1], b: [-1, -1] };\n const rows = V.ParseFen(fen).position.split(\"/\");\n for (let i = 0; i < rows.length; i++) {\n let k = 0; //column index on board\n for (let j = 0; j < rows[i].length; j++) {\n const piece = rows[i].charAt(j);\n if (['j','k','l'].includes(piece.toLowerCase())) {\n const color = (piece.charCodeAt(0) <= 90 ? 'w' : 'b');\n this.kingPos[color] = [i, k];\n }\n else {\n const num = parseInt(rows[i].charAt(j), 10);\n if (!isNaN(num)) k += num - 1;\n }\n k++;\n }\n }\n }", "title": "" }, { "docid": "fe7c3be062ed3e96441a90590c48881d", "score": "0.46145907", "text": "function KthSymmbolInGrammar(N, K) {\n let row = generateRow(N);\n let kthSymbol = row.charAt(K-1);\n console.log(parseInt(kthSymbol));\n return parseInt(kthSymbol);\n}", "title": "" }, { "docid": "4398607c56d65f4188a89585cba8f070", "score": "0.46121004", "text": "function stringToKeyValue(it) {\n var _a = it.split(\":\"), key = _a[0], val = _a[1];\n return val ? new NgStyleKeyValue(key, val) : null;\n}", "title": "" }, { "docid": "57d4029202cb08937645580ad6301010", "score": "0.45973182", "text": "function convertTxt($txt) {\n//need a loop to check surrounding characters to see what the symbol will be.\n$wordPairs = []; //list of words in the sentance\n$charPairs = []; // final product of broken char pairs\n\n$consonants = [\n\"s\",\"d\",\n\"f\",\"g\",\n\"h\",\"j\",\n\"k\",\"l\",\n\"m\",\"n\",\n\"b\",\"v\",\n\"c\",\"x\",\n\"z\",\"q\",\n\"w\",\"r\",\n\"t\",\"y\",\n\"p\"];\n\n$vowels = [\n'a',\n'i',\n'u'];\n\n$numbers = [\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"0\"];\n$numberSubmit = 0;\n$txt = $txt.toLowerCase();\n$txt = $txt.split(\" \");\n//first [] finds the word second [] is a character.\n// use for loops to then pair the chars and append them to the loop.\n//return $txt[0][0]; //loop through this split. word by word and char by char\n\n for($i = 0; $i < $txt.length;$i++){\n $wordPairs.push($txt[$i]);\n for($j = 0; $j < $wordPairs[$i].length;$j++){\n\n//if $numbers\n if ($numbers.includes($wordPairs[$i][$j])) {\n $x = $j;\n //find how many chars are numbers in this instance\n while ($numbers.includes($wordPairs[$i][$x])) {\n $x++;\n }\n //console.log($x);\n for ($h = 0; $h < $x; $h++) {\n $numberSubmit += $wordPairs[$i][$j+$h];\n }\n //!!!!!!!!!!!!!must break this found number into its smaller components !!!!!!!!!!!!!!!!!!!!!!!\n console.log(Number($numberSubmit));\n if ($numberSubmit == 0) { // if 0 return 0\n $charPairs.push(\"0\");\n } else {\n $numberSubmit = Math.round($numberSubmit);\n for ($selectNum = 624; $selectNum >= 1; $selectNum -=156) {\n if ($numberSubmit >= $selectNum) {\n $times = $numberSubmit / $selectNum; //number of times this number can fit inside the select num\n while ($times >= 1) {\n $charPairs.push(String($selectNum));\n $times --\n }\n $numberSubmit = $times * $selectNum; //whatever is left over is magnified and moved on to the next smallest number\n if ($numberSubmit >= 0.9999999999999991 && $numberSubmit < 1) { //catch stupid calculation error\n $numberSubmit = 1;\n }\n console.log(\"Large round check: \"+$numberSubmit);\n }\n }\n\n\n //groups of 144\n // no idea what the picture will be yet\n\n //groups of 12\n // numbers 12 - 144. This is because there are 3 pillars so 48*3 |||\n $numberSubmit = Math.round($numberSubmit);\n for ($selectNum = 48; $selectNum >= 1; $selectNum -=12) {\n if ($numberSubmit >= $selectNum) {\n $times = $numberSubmit / $selectNum; //number of times this number can fit inside the select num\n while ($times >= 1) {\n $charPairs.push(String($selectNum));\n $times --\n }\n $numberSubmit = $times * $selectNum; //whatever is left over is magnified and moved on to the next smallest number\n if ($numberSubmit >= 0.9 && $numberSubmit < 1) { //catch stupid calculation error\n $numberSubmit = 1;\n }\n console.log(\"Med round check: \"+ $numberSubmit);\n }\n }\n\n //individual numbers 1-11\n $numberSubmit = Math.round($numberSubmit);\n for ($selectNum = 11; $selectNum >= 1; $selectNum --) {\n if ($numberSubmit >= $selectNum) {\n $times = $numberSubmit / $selectNum; //number of times this number can fit inside the select num\n while ($times >= 1) {\n $charPairs.push(String($selectNum));\n $times --\n }\n $numberSubmit = $times * $selectNum; //whatever is left over is magnified and moved on to the next smallest number\n console.log(\"Small round check: \"+ Math.ceil($numberSubmit));\n }\n }\n }\n\n //$charPairs.push($numberSubmit);\n $j+=$x-1 //once found all numbers for this set go to the last char of this set so the loop can start at the next set\n //console.log($charPairs); //check that logs the number to convert\n }\n//find out if eth is cv or c. no need for th find or t and h yet as e is never used except for this instance.\n else if ($wordPairs[$i][$j] == \"e\" && $wordPairs[$i][$j+1] == \"t\" && $wordPairs[$i][$j+2] == \"h\"){\n if (($consonants.includes($wordPairs[$i][$j-1]) && $vowels.includes($wordPairs[$i][$j+3])) || ($wordPairs[$i][$j-1] == null && $vowels.includes($wordPairs[$i][$j+3]))) { //consonant befor or null it is cv\n $charPairs.push($wordPairs[$i][$j] + $wordPairs[$i][$j+1] + $wordPairs[$i][$j+2] + $wordPairs[$i][$j+3]);\n $j+=3;\n } else { //it is just a normal c\n $charPairs.push($wordPairs[$i][$j] + $wordPairs[$i][$j+1] + $wordPairs[$i][$j+2]);\n $j+=2;\n }\n }\n\n // ny pairs\n else if ($wordPairs[$i][$j] == \"n\" && $wordPairs[$i][$j+1] == \"y\"){ // must find out if the s could be a sh\n //if vowel before, then consonant after (anyta), write th\n if (($vowels.includes($wordPairs[$i][$j-1]) && $vowels.includes($wordPairs[$i][$j+3])) || ($consonants.includes($wordPairs[$i][$j+2])) || $wordPairs[$i][$j+2] == null ) {\n $charPairs.push($wordPairs[$i][$j] + $wordPairs[$i][$j+1]);\n $j++;\n }\n // if vowel after th and consonant before write tha\n else if (($vowels.includes($wordPairs[$i][$j+2]) && $consonants.includes($wordPairs[$i][$j-1])) || ($vowels.includes($wordPairs[$i][$j+2]) && $wordPairs[$i][$j-1] == null) ){\n $charPairs.push($wordPairs[$i][$j] + $wordPairs[$i][$j+1] + $wordPairs[$i][$j+2]);\n $j+=2;\n } else {\n $charPairs.push($wordPairs[$i][$j]);\n }\n\n }\n\n // ly pairs\n else if ($wordPairs[$i][$j] == \"l\" && $wordPairs[$i][$j+1] == \"y\"){ // must find out if the s could be a sh\n //if vowel before, then consonant after (ashta), write th\n if (($vowels.includes($wordPairs[$i][$j-1]) && $vowels.includes($wordPairs[$i][$j+3])) || ($consonants.includes($wordPairs[$i][$j+2])) || $wordPairs[$i][$j+2] == null ) {\n $charPairs.push($wordPairs[$i][$j] + $wordPairs[$i][$j+1]);\n $j++;\n\n }\n // if vowel after th and consonant before write tha\n else if (($vowels.includes($wordPairs[$i][$j+2]) && $consonants.includes($wordPairs[$i][$j-1])) || ($vowels.includes($wordPairs[$i][$j+2]) && $wordPairs[$i][$j-1] == null) ){\n $charPairs.push($wordPairs[$i][$j] + $wordPairs[$i][$j+1] + $wordPairs[$i][$j+2]);\n $j+=2;\n } else {\n $charPairs.push($wordPairs[$i][$j]);\n }\n\n }\n\n// find th pairs\n else if ($wordPairs[$i][$j] == \"t\" && $wordPairs[$i][$j+1] == \"h\"){ // must find out if the s could be a sh\n //if vowel before, then consonant after (ashta), write th\n if (($vowels.includes($wordPairs[$i][$j-1]) && $vowels.includes($wordPairs[$i][$j+3])) || ($consonants.includes($wordPairs[$i][$j+2])) || $wordPairs[$i][$j+2] == null ) {\n $charPairs.push($wordPairs[$i][$j] + $wordPairs[$i][$j+1]);\n $j++;\n\n }\n // if vowel after th and consonant before write tha\n else if (($vowels.includes($wordPairs[$i][$j+2]) && $consonants.includes($wordPairs[$i][$j-1])) || ($vowels.includes($wordPairs[$i][$j+2]) && $wordPairs[$i][$j-1] == null) ){\n $charPairs.push($wordPairs[$i][$j] + $wordPairs[$i][$j+1] + $wordPairs[$i][$j+2]);\n $j+=2;\n } else {\n $charPairs.push($wordPairs[$i][$j]);\n }\n\n }\n\n else if ($wordPairs[$i][$j] == \"s\" && $wordPairs[$i][$j+1] == \"h\"){ // must find out if the s could be a sh\n//if vowel before, then consonant after (ashta), write sh\n if (($vowels.includes($wordPairs[$i][$j-1]) && $vowels.includes($wordPairs[$i][$j+3])) || ($consonants.includes($wordPairs[$i][$j+2])) || $wordPairs[$i][$j+2] == null ) {\n $charPairs.push($wordPairs[$i][$j] + $wordPairs[$i][$j+1]);\n $j++;\n\n }\n// if vowel after sh and consonant before write sha\n else if (($vowels.includes($wordPairs[$i][$j+2]) && $consonants.includes($wordPairs[$i][$j-1])) || ($vowels.includes($wordPairs[$i][$j+2]) && $wordPairs[$i][$j-1] == null) ){\n $charPairs.push($wordPairs[$i][$j] + $wordPairs[$i][$j+1] + $wordPairs[$i][$j+2]);\n $j+=2;\n } else {\n $charPairs.push($wordPairs[$i][$j]);\n }\n\n }\n// if normal cv pair and dosn't mach above statements push it\n else if ($consonants.includes($wordPairs[$i][$j]) && $vowels.includes($wordPairs[$i][$j+1])){\n $charPairs.push($wordPairs[$i][$j] + $wordPairs[$i][$j+1]);\n $j+=1;\n\n// if do not match anything else it must be a singal char cv \"(c)\" cv\n } else {\n $charPairs.push($wordPairs[$i][$j]);\n }\n }\n//when a word is finished push a space\n $charPairs.push(\" \");\n }\n\n//return an array with the final pairs in order of their final sets \"shasfi\" = [sha, s, fi]\n//console.log($charPairs);\ntranslateTxt($charPairs);\n}", "title": "" }, { "docid": "563de1d982953cf16c752c9fa85d9cdc", "score": "0.4590856", "text": "function entryTime(s, keypad) {\n let keys = keypad.toString().split('');\n s = s.toString();\n let map = {};\n map[keys[0]] = [0,0]\n map[keys[1]] = [0,1]\n map[keys[2]] = [0,2]\n map[keys[3]] = [1,0]\n map[keys[4]] = [1,1]\n map[keys[5]] = [1,2]\n map[keys[6]] = [2,0]\n map[keys[7]] = [2,1]\n map[keys[8]] = [2,2]\n\n\n let result = 0;\n let position = map[s[0]];\n\n for (let i = 1, len = s.toString().length; i < len; i++){\n let num = s[i]\n let newPos = map[num];\n let posXChange = Math.abs(position[0]-newPos[0]);\n let posYChange = Math.abs(position[1]-newPos[1]);\n if (posXChange === 1 && posYChange === 1) {\n result += 1;\n } else if (posXChange >= 1 && posYChange >= 1) {\n result += 2;\n }else {\n result += posXChange + posYChange;\n }\n\n position = newPos;\n }\n\n return result;\n}", "title": "" }, { "docid": "77e970d8635b7247cdcf4ad4d9a45fe8", "score": "0.45790222", "text": "function processInput(str) {\n const normalized = str.normalize('NFKC');\n return separator + normalized.replace(/ /g, separator);\n} // The first tokens are reserved for unk, control symbols, and user-defined", "title": "" }, { "docid": "5d05e29c9684ab1f3b27dfa59a1cf244", "score": "0.4576289", "text": "function parsePrivateKeyComponents(text) {\n var textComponents = text.split('\\n');\n var keyComponents = {};\n // The component is the text after the identifier\n keyComponents.p = textComponents[textComponents.indexOf(\"p:\") + 1];\n keyComponents.q = textComponents[textComponents.indexOf(\"q:\") + 1];\n keyComponents.d = textComponents[textComponents.indexOf(\"d:\") + 1];\n\n $('#rsa-decryption-key-p').val(keyComponents.p);\n $('#rsa-decryption-key-q').val(keyComponents.q);\n $('#rsa-decryption-key-d').val(keyComponents.d);\n}", "title": "" }, { "docid": "d4d1726eccc390a6b1facbef353ea399", "score": "0.45721382", "text": "function charAtNum(str) {\n const obj = {};\n const lowerStr = str.toLowerCase().replace(/ /g, \"\");\n //console.log(lowerStr)\n for (const key of lowerStr) {\n console.log(obj[key])\n obj[key] = (obj[key])+ 1 || 1;\n // obj[key] = obj[key] >0 ? obj[key]+1: 1;\n console.log(obj[key] + \"end\")\n }\n return obj;\n}", "title": "" }, { "docid": "d6c55d853b9a3446c9e1411cbd8d3ecb", "score": "0.45553306", "text": "function normalize_position(string,position){if(position===0){return position;}string=$.terminal.strip(string);var result=$.terminal.split_characters(string).reduce(function(acc,chr){if(typeof acc==='number'){return acc;}var length=acc.length+char_len(chr);if(length>=position){return acc.position+1;}return{position:acc.position+1,length:length};},{position:0,length:0});if(typeof result==='number'){return result;}else{return result.position;}}// -------------------------------------------------------------------------", "title": "" }, { "docid": "113e895931de7d503b15facae2d9cc08", "score": "0.45546922", "text": "function parseKeyString(str) {\n var idx = 0;\n var keys = [];\n while (idx < str.length) {\n if (str.charAt(idx) != '<') {\n keys.push(str.charAt(idx));\n idx++;\n continue;\n }\n // Vim key notation here means desktop Vim key-notation.\n // See :help key-notation in desktop Vim.\n var vimKeyNotationStart = ++idx;\n while (str.charAt(idx++) != '>') {}\n var vimKeyNotation = str.substring(vimKeyNotationStart, idx - 1);\n var mod='';\n var match = (/^C-(.+)$/).exec(vimKeyNotation);\n if (match) {\n mod='Ctrl-';\n vimKeyNotation=match[1];\n }\n var key;\n switch (vimKeyNotation) {\n case 'BS':\n key = 'Backspace';\n break;\n case 'CR':\n key = 'Enter';\n break;\n case 'Del':\n key = 'Delete';\n break;\n default:\n key = vimKeyNotation;\n break;\n }\n keys.push(mod + key);\n }\n return keys;\n }", "title": "" }, { "docid": "463d400d53e49abc5461ec3674a15e3a", "score": "0.45489246", "text": "function sol(s) {\n let odds = 0;\n let map = {};\n const res = [];\n for (let c of s) {\n map[c] = map[c] + 1 || 1;\n if (map[c] % 2 !== 0) {\n odds++;\n } else {\n odds--;\n }\n }\n\n if (odds > 1) return res;\n let temp = \"\";\n // place odd numbered char in center\n for (let c in map) {\n if (map[c] % 2 !== 0) {\n temp += c;\n map[c]--;\n break;\n }\n }\n\n helper(temp);\n return res;\n\n function helper(cur) {\n if (cur.length === s.length) {\n res.push(cur);\n return;\n }\n\n for (let c in map) {\n if (map[c] >= 2) {\n let temp = cur;\n cur = c + cur + c;\n map[c] -= 2;\n helper(cur);\n map[c] += 2;\n cur = temp;\n } else if (map[c] === 1) {\n let a = cur.substring(0, Math.floor(cur.length));\n let b = cur.substring(Math.floor(cur.length) + 1);\n map[c]--;\n helper(a + c + b);\n }\n }\n }\n\n // function helper(cur = \"\") {\n // if (cur.length === s.length) {\n // res.push(cur);\n // return;\n // }\n\n // for (let c in map) {\n // if (map[c] >= 2) {\n // let temp = cur;\n // cur = c + cur + c;\n // map[c] -= 2;\n // helper(cur);\n // map[c] += 2;\n // cur = temp;\n // } else if (map[c] === 1) {\n // let a = cur.substring(0, Math.floor(cur.length / 2));\n // let b = cur.substring(Math.floor(cur.length / 2) + 1);\n // map[c]--;\n // helper(a + c + b);\n // }\n // }\n // }\n}", "title": "" }, { "docid": "81bea44fea1fb4ffae2a16bc41698edd", "score": "0.4532225", "text": "function numericals(s){\n let obj = {};\n return s.split('').map(char => obj[char] = ++obj[char] || 1).join('');\n}", "title": "" }, { "docid": "9890dae0f4f682601b5b06e4af81c895", "score": "0.4518334", "text": "static CtoK(c) {\n return c + 273\n }", "title": "" }, { "docid": "6f7c0713ac6865c0aea1aba34293d422", "score": "0.44859764", "text": "function pairElement(str) {\n let pairs = {\n A: 'T',\n T: 'A',\n G: 'C',\n C: 'G',\n }\n\n\n let letters = str.split('');\n console.log(letters);\n\n let result = letters.map(letter => {\n let pair = [letter, pairs[letter]];\n\n\n return pair;\n })\n\n\n return result;\n}", "title": "" }, { "docid": "e9b34ac492e03daef8b9df6ad8f542e6", "score": "0.44851574", "text": "function indentation(value) {\n var index = 0;\n var indent = 0;\n var character = value.charAt(index);\n var stops = {};\n var size;\n\n while (character in characters) {\n size = characters[character];\n\n indent += size;\n\n if (size > 1) {\n indent = Math.floor(indent / size) * size;\n }\n\n stops[indent] = index;\n\n character = value.charAt(++index);\n }\n\n return {indent: indent, stops: stops};\n}", "title": "" }, { "docid": "e9b34ac492e03daef8b9df6ad8f542e6", "score": "0.44851574", "text": "function indentation(value) {\n var index = 0;\n var indent = 0;\n var character = value.charAt(index);\n var stops = {};\n var size;\n\n while (character in characters) {\n size = characters[character];\n\n indent += size;\n\n if (size > 1) {\n indent = Math.floor(indent / size) * size;\n }\n\n stops[indent] = index;\n\n character = value.charAt(++index);\n }\n\n return {indent: indent, stops: stops};\n}", "title": "" }, { "docid": "e9b34ac492e03daef8b9df6ad8f542e6", "score": "0.44851574", "text": "function indentation(value) {\n var index = 0;\n var indent = 0;\n var character = value.charAt(index);\n var stops = {};\n var size;\n\n while (character in characters) {\n size = characters[character];\n\n indent += size;\n\n if (size > 1) {\n indent = Math.floor(indent / size) * size;\n }\n\n stops[indent] = index;\n\n character = value.charAt(++index);\n }\n\n return {indent: indent, stops: stops};\n}", "title": "" }, { "docid": "e9b34ac492e03daef8b9df6ad8f542e6", "score": "0.44851574", "text": "function indentation(value) {\n var index = 0;\n var indent = 0;\n var character = value.charAt(index);\n var stops = {};\n var size;\n\n while (character in characters) {\n size = characters[character];\n\n indent += size;\n\n if (size > 1) {\n indent = Math.floor(indent / size) * size;\n }\n\n stops[indent] = index;\n\n character = value.charAt(++index);\n }\n\n return {indent: indent, stops: stops};\n}", "title": "" }, { "docid": "e9b34ac492e03daef8b9df6ad8f542e6", "score": "0.44851574", "text": "function indentation(value) {\n var index = 0;\n var indent = 0;\n var character = value.charAt(index);\n var stops = {};\n var size;\n\n while (character in characters) {\n size = characters[character];\n\n indent += size;\n\n if (size > 1) {\n indent = Math.floor(indent / size) * size;\n }\n\n stops[indent] = index;\n\n character = value.charAt(++index);\n }\n\n return {indent: indent, stops: stops};\n}", "title": "" }, { "docid": "33b976a44e358e020f95a4771906662b", "score": "0.44777694", "text": "function k(t){var i,o,s,f=_,k=b;if(\"c\"===y)k=w(t)+k,t=\"\";else{\n// Perform the initial formatting.\nvar M=(t=+t)<0;\n// Break the formatted value into the integer “value” part that can be\n// grouped, and fractional or exponential “suffix” part that is not.\nif(t=isNaN(t)?l:w(Math.abs(t),m),\n// Trim insignificant zeros.\nv&&(t=\n// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nfunction(t){t:for(var n,e=t.length,r=1,i=-1;r<e;++r)switch(t[r]){case\".\":i=n=r;break;case\"0\":0===i&&(i=r),n=r;break;default:if(i>0){if(!+t[r])break t;i=0}}return i>0?t.slice(0,i)+t.slice(n+1):t}(t)),\n// If a negative value rounds to zero during formatting, treat as positive.\nM&&0==+t&&(M=!1),\n// Compute the prefix and suffix.\nf=(M?\"(\"===h?h:c:\"-\"===h||\"(\"===h?\"\":h)+f,k=(\"s\"===y?we[8+le/3]:\"\")+k+(M&&\"(\"===h?\")\":\"\"),x)for(i=-1,o=t.length;++i<o;)if(48>(s=t.charCodeAt(i))||s>57){k=(46===s?a+t.slice(i+1):t.slice(i))+k,t=t.slice(0,i);break}}\n// If the fill character is not \"0\", grouping is applied before padding.\ng&&!p&&(t=r(t,1/0));\n// Compute the padding.\nvar A=f.length+t.length+k.length,z=A<d?new Array(d-A+1).join(n):\"\";\n// If the fill character is \"0\", grouping is applied after padding.\n// Reconstruct the final output based on the desired alignment.\nswitch(g&&p&&(t=r(z+t,z.length?d-k.length:1/0),z=\"\"),e){case\"<\":t=f+t+k+z;break;case\"=\":t=f+z+t+k;break;case\"^\":t=z.slice(0,A=z.length>>1)+f+t+k+z.slice(A);break;default:t=z+f+t+k}return u(t)}", "title": "" }, { "docid": "480bf17f842bb0ca929242325fef0b5a", "score": "0.44726843", "text": "function extractMKSCDG(s) {\n\n var regex = /^(\\w*\\s\\s)([-+]?[0-9]*\\.*[0-9]*[eE]*[-+]*[0-9]*)/;\n return x.strToNum(regex.exec(s), 2);\n}", "title": "" }, { "docid": "4595a6547060fb37bf83bf03e8b07fb9", "score": "0.44718084", "text": "function indentation(value) {\n\t var index = 0;\n\t var indent = 0;\n\t var character = value.charAt(index);\n\t var stops = {};\n\t var size;\n\t\n\t while (character in characters) {\n\t size = characters[character];\n\t\n\t indent += size;\n\t\n\t if (size > 1) {\n\t indent = Math.floor(indent / size) * size;\n\t }\n\t\n\t stops[indent] = index;\n\t\n\t character = value.charAt(++index);\n\t }\n\t\n\t return {indent: indent, stops: stops};\n\t}", "title": "" }, { "docid": "e433fd582e97955342ca8078f39a83dc", "score": "0.44603226", "text": "characterNumberSymbol(s) {\r\n let r = ''\r\n if (typeof s == 'string') {\r\n for (let i = 0; i < s.length; i++) {\r\n const e = s[i].toLowerCase()\r\n if (\r\n e == '0' ||\r\n e == '1' ||\r\n e == '2' ||\r\n e == '3' ||\r\n e == '4' ||\r\n e == '5' ||\r\n e == '6' ||\r\n e == '7' ||\r\n e == '8' ||\r\n e == '9' ||\r\n e == 'a' ||\r\n e == 'b' ||\r\n e == 'c' ||\r\n e == 'd' ||\r\n e == 'e' ||\r\n e == 'f' ||\r\n e == 'g' ||\r\n e == 'h' ||\r\n e == 'i' ||\r\n e == 'j' ||\r\n e == 'k' ||\r\n e == 'l' ||\r\n e == 'm' ||\r\n e == 'n' ||\r\n e == 'o' ||\r\n e == 'p' ||\r\n e == 'q' ||\r\n e == 'r' ||\r\n e == 's' ||\r\n e == 't' ||\r\n e == 'u' ||\r\n e == 'v' ||\r\n e == 'w' ||\r\n e == 'x' ||\r\n e == 'y' ||\r\n e == 'z' ||\r\n e == 'à' ||\r\n e == 'á' ||\r\n e == 'â' ||\r\n e == 'ã' ||\r\n e == 'è' ||\r\n e == 'é' ||\r\n e == 'ê' ||\r\n e == 'ì' ||\r\n e == 'í' ||\r\n e == 'î' ||\r\n e == 'ò' ||\r\n e == 'ó' ||\r\n e == 'ô' ||\r\n e == 'õ' ||\r\n e == 'ù' ||\r\n e == 'ú' ||\r\n e == 'û' ||\r\n e == 'ç' ||\r\n e == '!' ||\r\n e == '?' ||\r\n e == ',' ||\r\n e == '.' ||\r\n e == ':' ||\r\n e == ';' ||\r\n e == '@' ||\r\n e == '#' ||\r\n e == '$' ||\r\n e == '%' ||\r\n e == '&' ||\r\n e == '(' ||\r\n e == ')' ||\r\n e == '{' ||\r\n e == '}' ||\r\n e == '[' ||\r\n e == ']' ||\r\n e == '*' ||\r\n e == '-' ||\r\n e == '+' ||\r\n e == '/' ||\r\n e == '=' ||\r\n e == '_' ||\r\n e == 'ª' ||\r\n e == 'º' ||\r\n e == '°' ||\r\n e == '¹' ||\r\n e == '²' ||\r\n e == '³' ||\r\n e == '\"' ||\r\n e == \"'\" ||\r\n e == '|' ||\r\n e == ' ' ||\r\n e == ' '\r\n ) {\r\n r += s[i]\r\n }\r\n }\r\n }\r\n return r.trim()\r\n }", "title": "" }, { "docid": "8316b00c332b1347a943cbd75bb3dd4c", "score": "0.44531065", "text": "function lineParser(linedata)\n{\n var outline = '';\n \n var gcode = '';\n linedata = linedata.trim();\n if (linedata != '')\n {\n var codeLetter = linedata.substr(0,1);\n \n switch (codeLetter)\n {\n case '%':\n inHeader = false; //Exit Header\n break;\n case 'M':\n var mcode = parseInt(parseCodeValue(linedata));\n \n switch (mcode)\n {\n case (30):\n outline = '\\n( --------- PROGRAM END --------- )\\n';\n outline += lnum() + 'M5 (Spindle Stop)\\n';\n outline += lnum() + 'M9 (Coolant Off)\\n';\n outline += lnum() + 'G30 (Go Home)\\n';\n outline += lnum() + 'M30 (END)\\n';\n break;\n case (48):\n inHeader = true; //\"in header mode\"\n outline = '( --------------------------------------------------------)\\n';\n outline += '( -- EXCELLON TO GCODE CONVERTER - kdupreez@hotmail.com --)\\n';\n outline += '( --------------------------------------------------------)\\n';\n outline += lnum() + 'G90 G54 G64 G50 G17 G40 G80 G94 G91.1 G49\\n';\n outline += lnum() + 'G30\\n';\n \n console.log('\\tGenerating GCode Header...');\n\n break;\n case (71): //M71 = METRIC \n outline = lnum() + 'G21 (METRIC)\\n\\n';\n console.log('\\tSetting units to Metric (mm)...');\n break;\n case (72): //M72 = INCHES\n outline = lnum() + 'G20 (INCHES)\\n\\n';\n console.log('\\tSetting units to Inches...');\n break;\n default:\n outline = '(-- Unknown MCode: ' + linedata + ')\\n';\n }\n break;\n case 'T':\n if (!inHeader)\n {\n toolNumber = parseInt(parseCodeValue(linedata));\n outline = '\\n( --------- DRILL T' + toolNumber + ' --------- )\\n';\n outline += lnum() + 'M5 (Spindle Stop)\\n';\n outline += lnum() + 'M9 (Coolant Off)\\n';\n outline += lnum() + 'G30 (Go Home)\\n';\n outline += lnum() + 'T' + toolNumber + ' G43 H' + toolNumber + ' M6 (Tool Change)\\n'; // tool change with offset\n outline += lnum() + 'S' + spindleSpeed +' M3 (Spindle Start)\\n'; //Set Splinde Speed - Forward Rotation\n outline += lnum() + 'G54\\n'; //Work Coordinate System\n \n newDrillCycle = true;\n \n console.log('\\tConverting drill cycle for Tool ' + toolNumber);\n\n }\n else\n {\n var strTool = parseCodeValue(linedata);\n var strDiameter = parseCodeValue(linedata.substr(strTool.length+1));\n outline = '(T:' + strTool +' Diameter: ' + strDiameter + ' )\\n';\n console.log('\\tFound Tool: ' + strTool +' with diameter: ' + strDiameter);\n\n }\n break;\n case 'X':\n case 'Y':\n if (!inHeader)\n {\n var strX = parseCodeValue(linedata);\n var strY = parseCodeValue(linedata.substr(strX.length+1));\n var fX = parseInt(strX) / 100000.0;\n var fY = parseInt(strY) / 100000.0;\n \n if (newDrillCycle)\n {\n outline = lnum() + 'G0 X' + fX + ' Y' + fY + '\\n';\n outline += lnum() + 'G0 Z' + zSafeHeight +'\\n'; // Feed Height..\n outline += lnum() + 'G0 Z' + zFeedHeight +'\\n'; // Feed Height..\n //G98: Return to Initial Z plane after canned cycle\n //G81: Simple drilling cycle\n //F3.: Feed Rate\n //Canned cycle retract = 0.2\n //Canned cycle will retract to R-Plane = 0.2\n //Hole Bottom: X Y Z = Hole depth\n outline += lnum() + 'G98 G81 X' + fX + ' Y' + fY + ' Z' + zHoleBottom + ' R' + zFeedHeight + ' F' + feedRate + '.\\n'; \n newDrillCycle = false;\n }\n else\n {\n outline = lnum() + 'X' + fX + ' Y' + fY + '\\n';\n }\n }\n break;\n default:\n outline = '; Unknown Code: ' + linedata;\n break;\n }\n }\n\n return outline;\n}", "title": "" }, { "docid": "5c8fa533cd78e0ebd1609bc7fa0e3573", "score": "0.44345838", "text": "function code_point_from_surrogate_pair (s) {\n var high_offset = s.charCodeAt(0) - HIGH_SURROGATE_START\n var low_offset = s.charCodeAt(1) - LOW_SURROGATE_START\n\n return (high_offset << 10) + low_offset + 0x10000\n}", "title": "" }, { "docid": "17b60a62dcbe3770ccd33c14490558e1", "score": "0.4421636", "text": "function scale(strng, k, n) {\n let l;\n return (l = strng\n .split(\"\\n\")\n .map(w => w\n .split(\"\")\n .map(v => v.repeat(k))\n .join(\"\")\n )\n .map(r => r ? (r+\"\\n\").repeat(n) : \"\")\n .join(\"\")\n ).substr(0,l.length-1)\n}", "title": "" }, { "docid": "7bd39fb9b3acd48737d18bf783911715", "score": "0.44142887", "text": "function parseInput(inputText) {\n let line = -1;\n return inputText\n .trim()\n .split(\"\\n\")\n .map((instruc) => {\n const obj = instruc.split(\" \");\n line += 1;\n return {\n operation: obj[0],\n argument: parseInt(obj[1].substring(1)),\n sign: obj[1].substring(0, 1),\n full: instruc,\n executed: false,\n line: line,\n };\n });\n}", "title": "" }, { "docid": "de8feebdcfb88061574f729f1685965f", "score": "0.44140798", "text": "function parseInput(inputText) {\n return inputText\n .trim()\n .split('\\n')\n .map(line => {\n const [instruction, valueText] = line.split(' ');\n return {\n instruction,\n value: parseInt(valueText),\n };\n });\n}", "title": "" }, { "docid": "68a0d559f452630bbbba2bc8313a0d95", "score": "0.43995088", "text": "function Init_Digit_Map() {\n\n var DigitMap = {};\n var DigitWords = [\"Zero\", \"One\", \"Two\", \n \"Three\", \"Four\", \"Five\",\n \"Six\", \"Seven\", \"Eight\", \"Nine\"]\n\n for (i = 0; i <= 9; i++) {\n DigitMap[i] = DigitWords[i]\n }\n\n return DigitMap\n}", "title": "" }, { "docid": "2fa19ec3ad10525aa1d1ce5560523182", "score": "0.4398803", "text": "function decode(s) {\n var n = s.length;\n if (n === 0 || s[0] === '0') return 0;\n var dp = new Array(n + 1);\n dp[0] = 1;\n dp[1] = 1;\n\n for (var i = 2; i < n + 1; i++) {\n var currCode = s[i - 2] + '' + s[i - 1];\n\n var twoStepsBehind = currCode <= 26 && currCode >= 10 ? dp[i - 2] : 0;\n var oneStepBehind = s[i - 1] != 0 ? dp[i - 1] : 0;\n\n dp[i] = twoStepsBehind + oneStepBehind;\n }\n\n return dp[n];\n\n // decode 11 first\n // var count = 0;\n // for (var i = 1; i < n; i++) {\n // var firstStr = s[i - 1];\n // var secondStr = s[i - 1] + '' + s[i];\n // // if () count++;\n // // if (s[i - 1] + '' + s[i] <= 26) count++;\n // }\n}", "title": "" }, { "docid": "222dad77fad59023f9c8b706b714bbd2", "score": "0.43973818", "text": "function part2(input) {\n input = input.split(\"\");\n var size = 25*6;\n var layers = [];\n for(var i = 0; i < input.length / size; i++) {\n layers.push(input.slice(size * i, size * (i +1)));\n }\n var out = '';\n for (var i = 0; i < 6; i++) {\n outer: for (var j = 0; j < 25; j++) {\n for(var k = 0; k < 100; k++) {\n switch(layers[k][i*25 + j]) {\n case \"0\": out += ' '; continue outer;\n case \"1\": out += 'x'; continue outer;\n }\n }\n out += \" \";\n }\n out += \"\\n\";\n }\n console.log(out);\n}", "title": "" }, { "docid": "d8e3724869f82184126569c034668bb9", "score": "0.43954253", "text": "function pairElement(str) {\n\tlet arrayOfChars = str.split(\"\");\n\tconsole.log(arrayOfChars);\n\treturn arrayOfChars.map(function(char) {\n\t\tswitch(char) {\n\t\t\tcase \"A\":\n\t\t\treturn ['A', 'T'];\n\t\t\tbreak;\n\t\t\tcase \"T\":\n\t\t\treturn ['T', 'A'];\n\t\t\tbreak;\n\t\t\tcase \"C\":\n\t\t\treturn ['C', 'G'];\n\t\t\tbreak;\n\t\t\tcase \"G\":\n\t\t\treturn ['G','C'];\n\t\t\tbreak;\n\t\t}\n\t});\n}", "title": "" }, { "docid": "5be4b5ab69f520abd34d7041aa017871", "score": "0.43841788", "text": "function readFontDictData(aString, aMap) {\n var fontDictDataTokens = [];\n\n var count = aString.length;\n for (var i = 0; i < count; i) {\n var value = aString[i++] | 0;\n var token = null;\n\n if (value === 12) {\n token = aMap[value][aString[i++]];\n } else if (value === 28) {\n token = aString[i++] << 8 | aString[i++];\n } else if (value === 29) {\n token = aString[i++] << 24 |\n aString[i++] << 16 |\n aString[i++] << 8 |\n aString[i++];\n } else if (value === 30) {\n token = '';\n var parsed = false;\n while (!parsed) {\n var octet = aString[i++];\n\n var nibbles = [parseInt(octet / 16, 10), parseInt(octet % 16, 10)];\n for (var j = 0; j < nibbles.length; j++) {\n var nibble = nibbles[j];\n switch (nibble) {\n case 0xA:\n token += '.';\n break;\n case 0xB:\n token += 'E';\n break;\n case 0xC:\n token += 'E-';\n break;\n case 0xD:\n break;\n case 0xE:\n token += '-';\n break;\n case 0xF:\n parsed = true;\n break;\n default:\n token += nibble;\n break;\n }\n }\n }\n token = parseFloat(token);\n } else if (value <= 31) {\n token = aMap[value];\n } else if (value <= 246) {\n token = parseInt(value, 10) - 139;\n } else if (value <= 250) {\n token = (value - 247) * 256 + aString[i++] + 108;\n } else if (value <= 254) {\n token = -(value - 251) * 256 - aString[i++] - 108;\n } else if (value === 255) {\n throw new FormatError('255 is not a valid DICT command');\n }\n\n fontDictDataTokens.push(token);\n }\n\n return fontDictDataTokens;\n}", "title": "" }, { "docid": "810cbfe4de5197cf3017e35c13999f21", "score": "0.43829083", "text": "function parseKeyValue(data) {\n const ret = {};\n\n each(data.split('\\n'), line => {\n line = trim(line);\n if (line) {\n line = line.split(' ');\n ret[line[0]] = line[1];\n }\n });\n\n return ret;\n}", "title": "" }, { "docid": "9b15833519e10afc4a8315c8fa5df866", "score": "0.43820193", "text": "function AxAin(text) {\n\n\tlet regex = new RegExp('[\\(]?(([0-9]+(\\.[0-9]+)?)[-− \\u00A0]?[x\\*×][-− \\u00A0]?([0-9]+(\\.[0-9]+)?)[-− \\u00A0]?in(ch|ches|\\.)?)' + unitSuffix, 'ig');\n\n\tif (text.search(regex) !== -1) {\n\t\tlet matches;\n\n\t\twhile ((matches = regex.exec(text)) !== null) {\n\t\t\ttry {\n\n\t\t\t\tconst fullMatch = matches[1];\n\t\t\t\tif (/[0-9][Xx\\*×][ \\u00A0][0-9]/.test(fullMatch))\n\t\t\t\t\tcontinue; //it is 2x 2in something so no conversion \n\t\t\t\tif (BracketsCheck(matches[0])) continue;\n\n\t\t\t\tlet scale = 2.54;\n\t\t\t\tlet unit = spc + \"cm\";\n\t\t\t\tif (useMM === true) {\n\t\t\t\t\tscale = 25.4;\n\t\t\t\t\tunit = spc + \"mm\"\n\t\t\t\t}\n\t\t\t\tlet cm1 = replaceWithComma(roundNicely(matches[2] * scale));\n\t\t\t\tlet cm2 = replaceWithComma(roundNicely(matches[4] * scale));\n\n\t\t\t\tconst insertIndex = GetIndexPos(matches.index, fullMatch);\t\t\t\t\t\n\t\t\t\tconst metStr = prepareForOutput(cm1 + spc + \"x\" + spc + cm2, spc + unit, true); //+ behind bracket\n\n\t\t\t\t//text = text.replace(matches[0], metStr);\n text = CleanReplace(text, matches[0], metStr);\n\t\t\t} catch (err) {\n\t\t\t\t//console.log(err.message);\n\t\t\t}\n\t\t}\n\t}\n\treturn text;\n}", "title": "" }, { "docid": "ddd57204447ed30da7c88e755c52ef39", "score": "0.43759993", "text": "function digitChunks(displayStr) {\n let chunkArr = [\"\"];\n let v = 0;\n for (let i = 0; i < displayStr.length; i++) {\n if (!isOperator(displayStr[i])) {\n chunkArr[v] = chunkArr[v]+displayStr[i];\n } else {\n v++;\n chunkArr[v] = \"\";\n };\n };\n chunkArr = chunkArr.filter(e => e != \"\");\n return chunkArr;\n}", "title": "" }, { "docid": "5eef1b3bbc5c10914ac6c747aa08aab6", "score": "0.43720254", "text": "function monospace(text, start, end, width) {\n var glyphs = Math.min(width, end-start)\n return {\n start: start,\n end: start+glyphs\n }\n}", "title": "" }, { "docid": "9952112f76acb07f258ee23843edc699", "score": "0.43708363", "text": "function parseWord(word,riklang){\n parts = word.split(\"-\"); \n //log(parts);\n var tents = [];\n var m = parts[0];\n var m_t = riklang.morphemes[m].glyph;\n for (let t in m_t){\n\t tents.push(m_t[t]);\n } \n var a = parts[1];\n var a_t = riklang.aspects[a].glyph;\n tents.push(a_t[0]);\n var r = parts[2];\n var r_t = riklang.relations[r].glyph;\n tents.push(r_t[0]);\n var c = parts[3];\n var p = '';\n if (c.length == 2){\n p = c.charAt(1);\n c = c.charAt(0);\n }\n var c_t0 = Object.assign({}, riklang.collectors[c].glyph[0]);\n if (p == 'P'){\n c_t0.y += 20;\n c_t0.y2 += 20;\n }\n if (p == 'O'){\n c_t0.y += 40;\n c_t0.y2 += 40;\n }\n tents.push(c_t0);\n\n //create splines \n var splines = [];\n for (let t in tents){\n\t var points = getPointsForTentacle(tents[t]);\n if (isRelativeAngles()){\n splines.push(splineToTentacle(points));\n } else {\n\t splines.push(points);\n }\n }\n return splines;\n \n}", "title": "" }, { "docid": "59007ebc939e78ab72a11184790cb9ac", "score": "0.4369193", "text": "function playfair(str, type, key) {\r\n\tlet keyTemp = new Set(key.replace(/j/g, 'i') + alphabet.replace(/j/g, 'i'));\r\n\tkey = '';\r\n\tkeyTemp.forEach((a) => key += a);\r\n\t//key = key.replace(/j/, 'i');\r\n\tlet keyArr = [];\r\n\tlet keyObj = {};\r\n\tfor (let i = 0; i < 5; i++) {\r\n\t\tkeyArr.push([]);\r\n\t\tfor (let j = 0; j < 5; j++) {\r\n\t\t\tkeyArr[i].push(key[i * 5 + j]);\r\n\t\t\tkeyObj[key[i * 5 + j]] = [i, j];\r\n\t\t}\r\n\t}\r\n\r\n\tstr = removePunc(str.replace(/j/g, '')).split('');\r\n\tif (str[str.length - 1] === 'x') {\r\n\t\tstr = str.slice(0, -1);\r\n\t}\r\n\tlet strArr = [];\r\n\r\n\r\n\t//Inserts x's where necessary\r\n\tfor (let i = 0; i < str.length; i += 2) {\r\n\t\tif (type === 'encrypt') {\r\n\t\t\tif (!str[i + 1] && str.length % 2) {\r\n\t\t\t\tstr.push('x')\r\n\t\t\t}\r\n\t\t\tif (str[i] === str[i + 1]) {\r\n\t\t\t\tstr.splice(i + 1, 0, 'x');\r\n\t\t\t}\r\n\t\t}\r\n\t\tstrArr.push(str[i] + str[i + 1]);\r\n\t}\r\n\r\n\tlet output = '';\r\n\r\n\tif (type === 'encrypt') {\r\n\t\tfor (let i = 0; i < strArr.length; i++) {\r\n\t\t\t//Set a & b to coords of 1st & 2nd letter in plaintext pair respectively. a[0] = row num, a[1] = col num.\r\n\t\t\tlet a = keyObj[strArr[i][0]];\r\n\t\t\tlet b = keyObj[strArr[i][1]];\r\n\r\n\t\t\tif (a[0] === b[0]) output += (keyArr[a[0]][(a[1] + 1) % 5] + keyArr[b[0]][(b[1] + 1) % 5]);\r\n\t\t\telse if (a[1] === b[1]) output += (keyArr[(a[0] + 1) % 5][a[1]] + keyArr[(b[0] + 1) % 5][b[1]]);\r\n\t\t\telse output += (keyArr[a[0]][b[1]] + keyArr[b[0]][a[1]]);\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tfor (let i = 0; i < strArr.length; i++) {\r\n\t\t\t//Set a & b to coords of 1st & 2nd letter in plaintext pair respectively. a[0] = row num, a[1] = col num.\r\n\t\t\tlet a = keyObj[strArr[i][0]];\r\n\t\t\tlet b = keyObj[strArr[i][1]];\r\n\r\n\t\t\tif (a[0] === b[0]) output += (keyArr[a[0]][(a[1] + 4) % 5] + keyArr[b[0]][(b[1] + 4) % 5]);\r\n\t\t\telse if (a[1] === b[1]) output += (keyArr[(a[0] + 4) % 5][a[1]] + keyArr[(b[0] + 4) % 5][b[1]]);\r\n\t\t\telse output += (keyArr[a[0]][b[1]] + keyArr[b[0]][a[1]]);\r\n\t\t}\r\n\t}\r\n\treturn output;\r\n}", "title": "" }, { "docid": "578d12f4d7499d07e09af8c4e7dcd403", "score": "0.43685898", "text": "function parseCFFCharstring(font, glyph, code) {\n var c1x;\n var c1y;\n var c2x;\n var c2y;\n var p = new Path();\n var stack = [];\n var nStems = 0;\n var haveWidth = false;\n var open = false;\n var x = 0;\n var y = 0;\n var subrs;\n var subrsBias;\n var defaultWidthX;\n var nominalWidthX;\n if (font.isCIDFont) {\n var fdIndex = font.tables.cff.topDict._fdSelect[glyph.index];\n var fdDict = font.tables.cff.topDict._fdArray[fdIndex];\n subrs = fdDict._subrs;\n subrsBias = fdDict._subrsBias;\n defaultWidthX = fdDict._defaultWidthX;\n nominalWidthX = fdDict._nominalWidthX;\n } else {\n subrs = font.tables.cff.topDict._subrs;\n subrsBias = font.tables.cff.topDict._subrsBias;\n defaultWidthX = font.tables.cff.topDict._defaultWidthX;\n nominalWidthX = font.tables.cff.topDict._nominalWidthX;\n }\n var width = defaultWidthX;\n\n function newContour(x, y) {\n if (open) {\n p.closePath();\n }\n\n p.moveTo(x, y);\n open = true;\n }\n\n function parseStems() {\n var hasWidthArg;\n\n // The number of stem operators on the stack is always even.\n // If the value is uneven, that means a width is specified.\n hasWidthArg = stack.length % 2 !== 0;\n if (hasWidthArg && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n }\n\n nStems += stack.length >> 1;\n stack.length = 0;\n haveWidth = true;\n }\n\n function parse$$1(code) {\n var b1;\n var b2;\n var b3;\n var b4;\n var codeIndex;\n var subrCode;\n var jpx;\n var jpy;\n var c3x;\n var c3y;\n var c4x;\n var c4y;\n\n var i = 0;\n while (i < code.length) {\n var v = code[i];\n i += 1;\n switch (v) {\n case 1: // hstem\n parseStems();\n break;\n case 3: // vstem\n parseStems();\n break;\n case 4: // vmoveto\n if (stack.length > 1 && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n haveWidth = true;\n }\n\n y += stack.pop();\n newContour(x, y);\n break;\n case 5: // rlineto\n while (stack.length > 0) {\n x += stack.shift();\n y += stack.shift();\n p.lineTo(x, y);\n }\n\n break;\n case 6: // hlineto\n while (stack.length > 0) {\n x += stack.shift();\n p.lineTo(x, y);\n if (stack.length === 0) {\n break;\n }\n\n y += stack.shift();\n p.lineTo(x, y);\n }\n\n break;\n case 7: // vlineto\n while (stack.length > 0) {\n y += stack.shift();\n p.lineTo(x, y);\n if (stack.length === 0) {\n break;\n }\n\n x += stack.shift();\n p.lineTo(x, y);\n }\n\n break;\n case 8: // rrcurveto\n while (stack.length > 0) {\n c1x = x + stack.shift();\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 10: // callsubr\n codeIndex = stack.pop() + subrsBias;\n subrCode = subrs[codeIndex];\n if (subrCode) {\n parse$$1(subrCode);\n }\n\n break;\n case 11: // return\n return;\n case 12: // flex operators\n v = code[i];\n i += 1;\n switch (v) {\n case 35: // flex\n // |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 dx6 dy6 fd flex (12 35) |-\n c1x = x + stack.shift(); // dx1\n c1y = y + stack.shift(); // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y + stack.shift(); // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = jpy + stack.shift(); // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = c3y + stack.shift(); // dy5\n x = c4x + stack.shift(); // dx6\n y = c4y + stack.shift(); // dy6\n stack.shift(); // flex depth\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n case 34: // hflex\n // |- dx1 dx2 dy2 dx3 dx4 dx5 dx6 hflex (12 34) |-\n c1x = x + stack.shift(); // dx1\n c1y = y; // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y; // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = c2y; // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = y; // dy5\n x = c4x + stack.shift(); // dx6\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n case 36: // hflex1\n // |- dx1 dy1 dx2 dy2 dx3 dx4 dx5 dy5 dx6 hflex1 (12 36) |-\n c1x = x + stack.shift(); // dx1\n c1y = y + stack.shift(); // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y; // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = c2y; // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = c3y + stack.shift(); // dy5\n x = c4x + stack.shift(); // dx6\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n case 37: // flex1\n // |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 d6 flex1 (12 37) |-\n c1x = x + stack.shift(); // dx1\n c1y = y + stack.shift(); // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y + stack.shift(); // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = jpy + stack.shift(); // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = c3y + stack.shift(); // dy5\n if (Math.abs(c4x - x) > Math.abs(c4y - y)) {\n x = c4x + stack.shift();\n } else {\n y = c4y + stack.shift();\n }\n\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n default:\n console.log('Glyph ' + glyph.index + ': unknown operator ' + 1200 + v);\n stack.length = 0;\n }\n break;\n case 14: // endchar\n if (stack.length > 0 && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n haveWidth = true;\n }\n\n if (open) {\n p.closePath();\n open = false;\n }\n\n break;\n case 18: // hstemhm\n parseStems();\n break;\n case 19: // hintmask\n case 20: // cntrmask\n parseStems();\n i += (nStems + 7) >> 3;\n break;\n case 21: // rmoveto\n if (stack.length > 2 && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n haveWidth = true;\n }\n\n y += stack.pop();\n x += stack.pop();\n newContour(x, y);\n break;\n case 22: // hmoveto\n if (stack.length > 1 && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n haveWidth = true;\n }\n\n x += stack.pop();\n newContour(x, y);\n break;\n case 23: // vstemhm\n parseStems();\n break;\n case 24: // rcurveline\n while (stack.length > 2) {\n c1x = x + stack.shift();\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n x += stack.shift();\n y += stack.shift();\n p.lineTo(x, y);\n break;\n case 25: // rlinecurve\n while (stack.length > 6) {\n x += stack.shift();\n y += stack.shift();\n p.lineTo(x, y);\n }\n\n c1x = x + stack.shift();\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n break;\n case 26: // vvcurveto\n if (stack.length % 2) {\n x += stack.shift();\n }\n\n while (stack.length > 0) {\n c1x = x;\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x;\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 27: // hhcurveto\n if (stack.length % 2) {\n y += stack.shift();\n }\n\n while (stack.length > 0) {\n c1x = x + stack.shift();\n c1y = y;\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y;\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 28: // shortint\n b1 = code[i];\n b2 = code[i + 1];\n stack.push(((b1 << 24) | (b2 << 16)) >> 16);\n i += 2;\n break;\n case 29: // callgsubr\n codeIndex = stack.pop() + font.gsubrsBias;\n subrCode = font.gsubrs[codeIndex];\n if (subrCode) {\n parse$$1(subrCode);\n }\n\n break;\n case 30: // vhcurveto\n while (stack.length > 0) {\n c1x = x;\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n if (stack.length === 0) {\n break;\n }\n\n c1x = x + stack.shift();\n c1y = y;\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n y = c2y + stack.shift();\n x = c2x + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 31: // hvcurveto\n while (stack.length > 0) {\n c1x = x + stack.shift();\n c1y = y;\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n y = c2y + stack.shift();\n x = c2x + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n if (stack.length === 0) {\n break;\n }\n\n c1x = x;\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n default:\n if (v < 32) {\n console.log('Glyph ' + glyph.index + ': unknown operator ' + v);\n } else if (v < 247) {\n stack.push(v - 139);\n } else if (v < 251) {\n b1 = code[i];\n i += 1;\n stack.push((v - 247) * 256 + b1 + 108);\n } else if (v < 255) {\n b1 = code[i];\n i += 1;\n stack.push(-(v - 251) * 256 - b1 - 108);\n } else {\n b1 = code[i];\n b2 = code[i + 1];\n b3 = code[i + 2];\n b4 = code[i + 3];\n i += 4;\n stack.push(((b1 << 24) | (b2 << 16) | (b3 << 8) | b4) / 65536);\n }\n }\n }\n }\n\n parse$$1(code);\n\n glyph.advanceWidth = width;\n return p;\n}", "title": "" }, { "docid": "0427bd269491cc7fa3b4d992d2517efb", "score": "0.4365029", "text": "function pspc_strfobj(str) {\n var pieces = str.split(':');\n var obj = {};\n pspc_labels.forEach(function(label, i) {\n obj[label] = pieces[i]\n });\n return obj;\n}", "title": "" }, { "docid": "87f9304ac4365d00effeb441fd1b0059", "score": "0.43606052", "text": "function mapChar(ch)\r\n\t{\r\n\t\tvar out = 0;\r\n\t\tch = ch.toUpperCase();\r\n\t\t\r\n\t\tswitch(ch)\r\n\t\t{\r\n\t\t\tcase \"A\":\r\n\t\t\t\tout = 1;\r\n\t\t\tbreak;\r\n\t\t\tcase \"B\":\r\n\t\t\t\tout = 2;\r\n\t\t\tbreak;\r\n\t\t\tcase \"C\":\r\n\t\t\t\tout = 3;\r\n\t\t\tbreak;\r\n\t\t\tcase \"D\":\r\n\t\t\t\tout = 4;\r\n\t\t\tbreak;\r\n\t\t\tcase \"E\":\r\n\t\t\t\tout = 5;\r\n\t\t\tbreak;\r\n\t\t\tcase \"F\":\r\n\t\t\t\tout = 6;\r\n\t\t\tbreak;\r\n\t\t\tcase \"G\":\r\n\t\t\t\tout = 7;\r\n\t\t\tbreak;\r\n\t\t\tcase \"H\":\r\n\t\t\t\tout = 8;\r\n\t\t\tbreak;\r\n\t\t\tcase \"I\":\r\n\t\t\t\tout = 9;\r\n\t\t\tbreak;\r\n\t\t\tcase \"J\":\r\n\t\t\t\tout = 10;\r\n\t\t\tbreak;\r\n\t\t\tcase \"K\":\r\n\t\t\t\tout = 11;\r\n\t\t\tbreak;\r\n\t\t\tcase \"L\":\r\n\t\t\t\tout = 12;\r\n\t\t\tbreak;\r\n\t\t\tcase \"M\":\r\n\t\t\t\tout = 13;\r\n\t\t\tbreak;\r\n\t\t\tcase \"N\":\r\n\t\t\t\tout = 14;\r\n\t\t\tbreak;\r\n\t\t\tcase \"O\":\r\n\t\t\t\tout = 15;\r\n\t\t\tbreak;\r\n\t\t\tcase \"P\":\r\n\t\t\t\tout = 16;\r\n\t\t\tbreak;\r\n\t\t\tcase \"Q\":\r\n\t\t\t\tout = 17;\r\n\t\t\tbreak;\r\n\t\t\tcase \"R\":\r\n\t\t\t\tout = 18;\r\n\t\t\tbreak;\r\n\t\t\tcase \"S\":\r\n\t\t\t\tout = 19;\r\n\t\t\tbreak;\r\n\t\t\tcase \"T\":\r\n\t\t\t\tout = 20;\r\n\t\t\tbreak;\r\n\t\t\tcase \"U\":\r\n\t\t\t\tout = 21;\r\n\t\t\tbreak;\r\n\t\t\tcase \"V\":\r\n\t\t\t\tout = 22;\r\n\t\t\tbreak;\r\n\t\t\tcase \"W\":\r\n\t\t\t\tout = 23;\r\n\t\t\tbreak;\r\n\t\t\tcase \"X\":\r\n\t\t\t\tout = 24;\r\n\t\t\tbreak;\r\n\t\t\tcase \"Y\":\r\n\t\t\t\tout = 25;\r\n\t\t\tbreak;\r\n\t\t\tcase \"Z\":\r\n\t\t\t\tout = 26;\r\n\t\t\tbreak;\r\n\t\t\tcase \" \":\r\n\t\t\t\tout = 27;\r\n\t\t\tbreak;\r\n\t\t\tcase \".\":\r\n\t\t\t\tout = 28;\r\n\t\t\tbreak;\r\n\t\t\tcase \",\":\r\n\t\t\t\tout = 29;\r\n\t\t\tbreak;\r\n\t\t\tcase \"!\":\r\n\t\t\t\tout = 30;\r\n\t\t\tbreak;\r\n\t\t\tcase \"?\":\r\n\t\t\t\tout = 31;\r\n\t\t\tbreak;\r\n\t\t\tcase \"'\":\r\n\t\t\t\tout = 32;\r\n\t\t\tbreak;\r\n\t}\r\n\t\t\r\n\t\treturn out;\r\n\t}", "title": "" }, { "docid": "6ecd6c170caf084b288ecff1aa6eeb05", "score": "0.43587753", "text": "function pairElement(str) {\n // convert loca var to array\n str = str.split('');\n // for each letter in teh array\n str = str.map( x => {\n // store it in a subarray\n x = [x];\n // find its matching pair and assign it to a second var\n let y;\n\n switch(x[0]){\n case 'A':\n y = 'T';\n break;\n case 'T':\n y = 'A';\n break;\n case 'G':\n y = 'C'\n break;\n case 'C':\n y = 'G';\n break;\n }\n // push the pair into the sub array\n x.push(y);\n\n return x;\n\n });\n // return the new 2d array with pairs added\n return str;\n}", "title": "" }, { "docid": "cb892cbb8cbd73b0a5f1238e64d0ee83", "score": "0.43560347", "text": "function lboz2kg(text) {\n\tlet regex = new RegExp('(([0-9]{0,3}).?(lbs?).?([0-9]+(\\.[0-9]+)?).?oz)', 'g');\n\tif (text.search(regex) !== -1) {\n\t\tlet matches;\n\n\t\twhile ((matches = regex.exec(text)) !== null) {\n\t\t\ttry {\n\t\t\t\tconst original = matches[0];\n\t\t\t\tlet lb = matches[2];\n\t\t\t\tlb = parseFloat(lb);\n\t\t\t\tlet oz = matches[4];\n\t\t\t\toz = parseFloat(oz);\n\n\t\t\t\tlet total = 0;\n\n\t\t\t\ttotal = lb * 16 + oz;\n\n\t\t\t\tlet kg = prepareForOutput(roundNicely(total * 0.0283495), spc + 'kg', true);\n\t\t\t\t//text = text.replace(matches[0], kg);\n text = CleanReplace(text, matches[0], kg);\n\t\t\t} catch (err) {\n\t\t\t\t// console.log(err.message);\n\t\t\t}\n\t\t}\n\t}\n\treturn text;\n}", "title": "" }, { "docid": "414d8e7029f20915affd40c83031c600", "score": "0.4349218", "text": "function indentation(value) {\n var index = 0\n var indent = 0\n var character = value.charAt(index)\n var stops = {}\n var size\n var lastIndent = 0\n\n while (character === tab || character === space) {\n size = character === tab ? tabSize : spaceSize\n\n indent += size\n\n if (size > 1) {\n indent = Math.floor(indent / size) * size\n }\n\n while (lastIndent < indent) {\n stops[++lastIndent] = index\n }\n\n character = value.charAt(++index)\n }\n\n return {indent: indent, stops: stops}\n}", "title": "" }, { "docid": "414d8e7029f20915affd40c83031c600", "score": "0.4349218", "text": "function indentation(value) {\n var index = 0\n var indent = 0\n var character = value.charAt(index)\n var stops = {}\n var size\n var lastIndent = 0\n\n while (character === tab || character === space) {\n size = character === tab ? tabSize : spaceSize\n\n indent += size\n\n if (size > 1) {\n indent = Math.floor(indent / size) * size\n }\n\n while (lastIndent < indent) {\n stops[++lastIndent] = index\n }\n\n character = value.charAt(++index)\n }\n\n return {indent: indent, stops: stops}\n}", "title": "" }, { "docid": "c33a64fbacfed6b160155178ff60a5f0", "score": "0.4346995", "text": "function readPawnString(Pawnstring) {\n //obj to store all the weights in,default everything to zero in the case a character doesnt use a certain stat\n //eg Dps wont care about leech,chances are they wont be in the pawn string\n var returnObj = {\n \"PrimWeight\": 0,\n \"HasteWeight\": 0,\n \"CritWeight\": 0,\n \"ArmorWeight\": 0,\n \"LeechWeight\": 0,\n \"MasteryWeight\": 0,\n \"StaminaWeight\": 0,\n \"VersatilityWeight\": 0,\n \"WepDpsWeight\": 0\n };\n\n try {\n while (Pawnstring.includes(\":\")) {\n Pawnstring = Pawnstring.substring(Pawnstring.indexOf(\":\") + 1);\n }\n\n //now,spilt up the array on commas\n var PawnArray = Pawnstring.split(\",\");\n //check for the equal\n var PrimWeight = PawnArray.filter(s => s.includes('Strength') || s.includes('Intellect') || s.includes('Agility')); //allows me to treat all these are the same value\n if (PrimWeight && PrimWeight.length) { //make sure that there is stuff in the array\n returnObj.PrimWeight = PrimWeight[0].split(\"=\")[1]; //get the decimal value out\n }\n var CritRating = PawnArray.filter(s => s.includes('Crit'));\n if (CritRating && CritRating.length) {\n returnObj.CritWeight = CritRating[0].split(\"=\")[1];\n }\n var HasteWeight = PawnArray.filter(s => s.includes('Haste'));\n if (HasteWeight && HasteWeight.length) {\n returnObj.HasteWeight = HasteWeight[0].split(\"=\")[1];\n }\n var LeechWeight = PawnArray.filter(s => s.includes('Leech'));\n if (LeechWeight && LeechWeight.length) {\n returnObj.LeechWeight = LeechWeight[0].split(\"=\")[1];\n }\n var MasteryWeight = PawnArray.filter(s => s.includes('Mast'));\n if (MasteryWeight && MasteryWeight.length) {\n returnObj.MasteryWeight = MasteryWeight[0].split(\"=\")[1];\n }\n var StaminaWeight = PawnArray.filter(s => s.includes('Stam'));\n if (StaminaWeight && StaminaWeight.length) {\n returnObj.StaminaWeight = StaminaWeight[0].split(\"=\")[1];\n }\n var ArmorWeight = PawnArray.filter(s => s.includes('Armor'));\n if (ArmorWeight && ArmorWeight.length) {\n returnObj.ArmorWeight = ArmorWeight[0].split(\"=\")[1];\n }\n var VersatilityWeight = PawnArray.filter(s => s.includes('Vers'));\n if (VersatilityWeight && VersatilityWeight.length) {\n returnObj.VersatilityWeight = VersatilityWeight[0].split(\"=\")[1];\n }\n var WepDpsWeight = PawnArray.filter(s => s.includes('Dps'));\n if (WepDpsWeight && WepDpsWeight.length) {\n returnObj.WepDpsWeight = WepDpsWeight[0].split(\"=\")[1];\n }\n\n } catch (error) {\n console.log(error.message)\n return error;\n }\n return returnObj; //finally return the object\n}", "title": "" }, { "docid": "f697a6aa46f3bf7c28a650b4e266eab8", "score": "0.4343305", "text": "function indentation(value) {\n var index = 0\n var indent = 0\n var character = value.charAt(index)\n var stops = {}\n var size\n\n while (character === tab || character === space) {\n size = character === tab ? tabSize : spaceSize\n\n indent += size\n\n if (size > 1) {\n indent = Math.floor(indent / size) * size\n }\n\n stops[indent] = index\n character = value.charAt(++index)\n }\n\n return {indent: indent, stops: stops}\n}", "title": "" }, { "docid": "58b59efe4f607fc444c08b40e6dce201", "score": "0.43410438", "text": "function initializeDictionary(d){ \n data = {}\n for(var letter=97;letter<123;letter++)\n {\n var _char = String.fromCharCode(letter);\n data[_char] = []\n }\n for(var i = 0; i < d.length; i++){\n var chunkItem = d[i].split(\"\\t\");\n //console.log(chunkItem)\n let key = chunkItem[1].charAt(0).toLowerCase();\n if(!(key in data)){\n data[key] = [{\"index\": chunkItem[0], \"value\": chunkItem[1], \"occurrences\":chunkItem[3]}];\n }else{\n data[key].push({\"index\": chunkItem[0], \"value\": chunkItem[1], \"occurrences\":chunkItem[3]});\n }\n }\n}", "title": "" }, { "docid": "267563966635a5e20d7441c3831c5d14", "score": "0.4335851", "text": "function encryption(string, mapping) {\n let arrayOfMapping = mapping.split(',');\n let dictionary = {};\n let ans = '';\n for (i = 0; i < arrayOfMapping.length; i++) {\n let tempArray = arrayOfMapping[i].split(':');\n dictionary[tempArray[0]] = tempArray[1];\n }\n for (i = 0; i < string.length; i++) {\n curCharacter = string[i];\n if (dictionary[curCharacter]) {\n ans += dictionary[curCharacter];\n } else ans += curCharacter;\n }\n return ans;\n}", "title": "" }, { "docid": "ead668d833944f945295b0f3e0c820df", "score": "0.43307334", "text": "function parseUserInput(letter) {\n let indices = hangmanHash[letter];\n indices.forEach(idx => hangmanOutput[idx] = letter);\n}", "title": "" }, { "docid": "f0d647a8c60d1e4dbbb4134bfb66cb56", "score": "0.4323827", "text": "function processInput( callback ){\n\tvar i = 3, input = [], helper;\n\n\tcallback = callback || function(){};\n\n\treadInput(function( data ){\n\t\thelper = data.split(' ');\n\t\tif ( i == 3 ){\n\t\t\tinput.push({\n\t\t\t\tN: parseInt( helper[0], 10),\n\t\t\t\tK: parseInt( helper[1], 10),\n\t\t\t\tQ: parseInt( helper[2], 10)\n\t\t\t});\n\t\t}\n\n\t\telse if ( i == 2 ){\n\t\t\tinput.push({\n\t\t\t\ta: parseInt( helper[0], 10),\n\t\t\t\tb: parseInt( helper[1], 10),\n\t\t\t\tc: parseInt( helper[2], 10),\n\t\t\t\td: parseInt( helper[3], 10),\n\t\t\t\te: parseInt( helper[4], 10),\n\t\t\t\tf: parseInt( helper[5], 10),\n\t\t\t\tr: parseInt( helper[6], 10),\n\t\t\t\ts: parseInt( helper[7], 10),\n\t\t\t\tt: parseInt( helper[8], 10),\n\t\t\t\tm: parseInt( helper[9], 10),\n\t\t\t\tA: parseInt( helper[10], 10)\n\t\t\t});\n\t\t}\n\n\t\telse if ( i == 1 ){\n\t\t\tinput.push({\n\t\t\t\tL1: parseInt( helper[0], 10),\n\t\t\t\tLa: parseInt( helper[1], 10),\n\t\t\t\tLc: parseInt( helper[2], 10),\n\t\t\t\tLm: parseInt( helper[3], 10),\n\t\t\t\tD1: parseInt( helper[4], 10),\n\t\t\t\tDa: parseInt( helper[5], 10),\n\t\t\t\tDc: parseInt( helper[6], 10),\n\t\t\t\tDm: parseInt( helper[7], 10)\n\t\t\t});\n\t\t}\n\t\ti--;\n\n\t\tif ( i == 0 ){\n\t\t\tcallback( input );\n\t\t}\n\t});\t\n}", "title": "" }, { "docid": "88d05a294b65cb025a7d5af1ac41c859", "score": "0.43201917", "text": "function monospace(text, start, end, width) {\n const glyphs = Math.min(width, end - start);\n return {\n start,\n end: start + glyphs,\n };\n}", "title": "" }, { "docid": "c5e6b57bd279575d213cec0f7792539d", "score": "0.43164945", "text": "function parse_RkNumber(data) {\n\t\t\tvar b = data.slice(data.l, data.l + 4);\n\t\t\tvar fX100 = b[0] & 1,\n\t\t\t fInt = b[0] & 2;\n\t\t\tdata.l += 4;\n\t\t\tb[0] &= 0xFC; // b[0] &= ~3;\n\t\t\tvar RK = fInt === 0 ? __double([0, 0, 0, 0, b[0], b[1], b[2], b[3]], 0) : __readInt32LE(b, 0) >> 2;\n\t\t\treturn fX100 ? RK / 100 : RK;\n\t\t}", "title": "" }, { "docid": "b455b1732c7e7f4749a437a358ec949c", "score": "0.43148813", "text": "function pair(str) {\n //define a map object with all pair possibilities \n var map = {T:'A', A:'T', G:'C', C:'G'};\n //split str into a a char Array\n strArr = str.split('');\n //replace each Array item with a 2d Array using map\n for (var i=0;i<strArr.length;i++){\n strArr[i]=[strArr[i], map[strArr[i]]];\n }\n return strArr;\n}", "title": "" }, { "docid": "7d3176cb597453fcf12078d7698d2cb8", "score": "0.4308658", "text": "function parse_RkNumber(data) {\n\tvar b = data.slice(data.l, data.l + 4);\n\tvar fX100 = (b[0] & 1), fInt = (b[0] & 2);\n\tdata.l += 4;\n\tb[0] &= 0xFC; // b[0] &= ~3;\n\tvar RK = fInt === 0 ? __double([0, 0, 0, 0, b[0], b[1], b[2], b[3]], 0) : __readInt32LE(b, 0) >> 2;\n\treturn fX100 ? (RK / 100) : RK;\n}", "title": "" }, { "docid": "047f42f9a319f67e2e5083fe56bdb23a", "score": "0.43086547", "text": "static outerPair(string) {\n let openingBracket = string.indexOf('[');\n if (openingBracket === -1) {\n return false;\n }\n let i = openingBracket + 1;\n const chars = string.split('');\n let open = 1;\n while (open > 0) {\n if (chars[i] === '[') {\n ++open;\n }\n if (chars[i] === ']') {\n --open;\n }\n ++i;\n }\n return [openingBracket, i - 1];\n }", "title": "" }, { "docid": "4ebdb99fe2056720608da2f852f8aa9f", "score": "0.43058807", "text": "function readPawnString(Pawnstring) {\n //obj to store all the weights in,default everything to zero in the case a character doesnt use a certain stat\n //eg Dps wont care about leech,chances are they wont be in the pawn string\n var returnObj = {\n \"PrimWeight\": 0,\n \"HasteWeight\": 0,\n \"CritWeight\": 0,\n \"ArmorWeight\": 0,\n \"LeechWeight\": 0,\n \"MasteryWeight\": 0,\n \"StaminaWeight\": 0,\n \"VersatilityWeight\": 0,\n \"WepDpsWeight\": 0\n };\n Pawnstring = Pawnstring.replace(')', '');\n try {\n while (Pawnstring.includes(\":\")) {\n Pawnstring = Pawnstring.substring(Pawnstring.indexOf(\":\") + 1);\n }\n\n //now,spilt up the array on commas\n var PawnArray = Pawnstring.split(\",\");\n //check for the equal\n var PrimWeight = PawnArray.filter(s => s.includes('Strength') || s.includes('Intellect') || s.includes('Agility')); //allows me to treat all these are the same value\n if (PrimWeight && PrimWeight.length) { //make sure that there is stuff in the array\n returnObj.PrimWeight = Number(PrimWeight[0].split(\"=\")[1]); //get the decimal value out\n }\n var CritRating = PawnArray.filter(s => s.includes('Crit'));\n if (CritRating && CritRating.length) {\n returnObj.CritWeight = Number(CritRating[0].split(\"=\")[1]);\n }\n var HasteWeight = PawnArray.filter(s => s.includes('Haste'));\n if (HasteWeight && HasteWeight.length) {\n returnObj.HasteWeight = Number(HasteWeight[0].split(\"=\")[1]);\n }\n var LeechWeight = PawnArray.filter(s => s.includes('Leech'));\n if (LeechWeight && LeechWeight.length) {\n returnObj.LeechWeight = Number(LeechWeight[0].split(\"=\")[1]);\n }\n var MasteryWeight = PawnArray.filter(s => s.includes('Mast'));\n if (MasteryWeight && MasteryWeight.length) {\n returnObj.MasteryWeight = Number(MasteryWeight[0].split(\"=\")[1]);\n }\n var StaminaWeight = PawnArray.filter(s => s.includes('Stam'));\n if (StaminaWeight && StaminaWeight.length) {\n returnObj.StaminaWeight = Number(StaminaWeight[0].split(\"=\")[1]);\n }\n var ArmorWeight = PawnArray.filter(s => s.includes('Armor'));\n if (ArmorWeight && ArmorWeight.length) {\n returnObj.ArmorWeight = Number(ArmorWeight[0].split(\"=\")[1]);\n }\n var VersatilityWeight = PawnArray.filter(s => s.includes('Vers'));\n if (VersatilityWeight && VersatilityWeight.length) {\n returnObj.VersatilityWeight = Number(VersatilityWeight[0].split(\"=\")[1]);\n }\n var WepDpsWeight = PawnArray.filter(s => s.includes('Dps'));\n if (WepDpsWeight && WepDpsWeight.length) {\n returnObj.WepDpsWeight = Number(WepDpsWeight[0].split(\"=\")[1]);\n }\n\n } catch (error) {\n console.log(error.message)\n }\n return returnObj; //finally return the object\n}", "title": "" }, { "docid": "ac695b54150a5154675da18e226828fe", "score": "0.43008116", "text": "function kFormatter(num, digits) {\n var si = [\n { value: 1, symbol: \"\" },\n { value: 1e3, symbol: \"k\" },\n { value: 1e6, symbol: \"M\" },\n { value: 1e9, symbol: \"G\" },\n { value: 1e12, symbol: \"T\" },\n { value: 1e15, symbol: \"P\" },\n { value: 1e18, symbol: \"E\" },\n ];\n var rx = /\\.0+$|(\\.[0-9]*[1-9])0+$/;\n var i;\n for (i = si.length - 1; i > 0; i--) {\n if (num >= si[i].value) {\n break;\n }\n }\n return (num / si[i].value).toFixed(digits).replace(rx, \"$1\") + si[i].symbol;\n}", "title": "" }, { "docid": "a13be66a174b3b275f1edc5078769bcb", "score": "0.42941195", "text": "function knightjumps(str) {\n const knight = [parseInt(str[1]), parseInt(str[3])] //get number values for knight's position\n //create a nested array of possible moves ([x, y])\n const moves = [\n [-1, 2], [1, 2],\n [-2, 1], [2, 1],\n [-2, -1], [2, -1],\n [-1, -2], [1, -2]\n ]\n //reduce moves, checking if they are valid given the knight's position\n const result = (moves.reduce((totalMoves, currMove) => {\n if (knight[0]+currMove[0] > 0 && knight[0]+currMove[0] <= 8 && knight[1]+currMove[1] > 0 && knight[1]+currMove[1] <= 8) ++totalMoves\n return totalMoves\n }, 0))\n //return the number of possible moves\n return result\n}", "title": "" }, { "docid": "86d70e099e3f88d7ea8ec1f362051c2d", "score": "0.429006", "text": "function parseCFFCharstring(font, glyph, code) {\n var c1x;\n var c1y;\n var c2x;\n var c2y;\n var p = new path.Path();\n var stack = [];\n var nStems = 0;\n var haveWidth = false;\n var width = font.defaultWidthX;\n var open = false;\n var x = 0;\n var y = 0;\n\n function newContour(x, y) {\n if (open) {\n p.closePath();\n }\n\n p.moveTo(x, y);\n open = true;\n }\n\n function parseStems() {\n var hasWidthArg;\n\n // The number of stem operators on the stack is always even.\n // If the value is uneven, that means a width is specified.\n hasWidthArg = stack.length % 2 !== 0;\n if (hasWidthArg && !haveWidth) {\n width = stack.shift() + font.nominalWidthX;\n }\n\n nStems += stack.length >> 1;\n stack.length = 0;\n haveWidth = true;\n }\n\n function parse(code) {\n var b1;\n var b2;\n var b3;\n var b4;\n var codeIndex;\n var subrCode;\n var jpx;\n var jpy;\n var c3x;\n var c3y;\n var c4x;\n var c4y;\n\n var i = 0;\n while (i < code.length) {\n var v = code[i];\n i += 1;\n switch (v) {\n case 1: // hstem\n parseStems();\n break;\n case 3: // vstem\n parseStems();\n break;\n case 4: // vmoveto\n if (stack.length > 1 && !haveWidth) {\n width = stack.shift() + font.nominalWidthX;\n haveWidth = true;\n }\n\n y += stack.pop();\n newContour(x, y);\n break;\n case 5: // rlineto\n while (stack.length > 0) {\n x += stack.shift();\n y += stack.shift();\n p.lineTo(x, y);\n }\n\n break;\n case 6: // hlineto\n while (stack.length > 0) {\n x += stack.shift();\n p.lineTo(x, y);\n if (stack.length === 0) {\n break;\n }\n\n y += stack.shift();\n p.lineTo(x, y);\n }\n\n break;\n case 7: // vlineto\n while (stack.length > 0) {\n y += stack.shift();\n p.lineTo(x, y);\n if (stack.length === 0) {\n break;\n }\n\n x += stack.shift();\n p.lineTo(x, y);\n }\n\n break;\n case 8: // rrcurveto\n while (stack.length > 0) {\n c1x = x + stack.shift();\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 10: // callsubr\n codeIndex = stack.pop() + font.subrsBias;\n subrCode = font.subrs[codeIndex];\n if (subrCode) {\n parse(subrCode);\n }\n\n break;\n case 11: // return\n return;\n case 12: // flex operators\n v = code[i];\n i += 1;\n switch (v) {\n case 35: // flex\n // |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 dx6 dy6 fd flex (12 35) |-\n c1x = x + stack.shift(); // dx1\n c1y = y + stack.shift(); // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y + stack.shift(); // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = jpy + stack.shift(); // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = c3y + stack.shift(); // dy5\n x = c4x + stack.shift(); // dx6\n y = c4y + stack.shift(); // dy6\n stack.shift(); // flex depth\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n case 34: // hflex\n // |- dx1 dx2 dy2 dx3 dx4 dx5 dx6 hflex (12 34) |-\n c1x = x + stack.shift(); // dx1\n c1y = y; // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y; // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = c2y; // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = y; // dy5\n x = c4x + stack.shift(); // dx6\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n case 36: // hflex1\n // |- dx1 dy1 dx2 dy2 dx3 dx4 dx5 dy5 dx6 hflex1 (12 36) |-\n c1x = x + stack.shift(); // dx1\n c1y = y + stack.shift(); // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y; // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = c2y; // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = c3y + stack.shift(); // dy5\n x = c4x + stack.shift(); // dx6\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n case 37: // flex1\n // |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 d6 flex1 (12 37) |-\n c1x = x + stack.shift(); // dx1\n c1y = y + stack.shift(); // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y + stack.shift(); // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = jpy + stack.shift(); // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = c3y + stack.shift(); // dy5\n if (Math.abs(c4x - x) > Math.abs(c4y - y)) {\n x = c4x + stack.shift();\n } else {\n y = c4y + stack.shift();\n }\n\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n default:\n console.log('Glyph ' + glyph.index + ': unknown operator ' + 1200 + v);\n stack.length = 0;\n }\n break;\n case 14: // endchar\n if (stack.length > 0 && !haveWidth) {\n width = stack.shift() + font.nominalWidthX;\n haveWidth = true;\n }\n\n if (open) {\n p.closePath();\n open = false;\n }\n\n break;\n case 18: // hstemhm\n parseStems();\n break;\n case 19: // hintmask\n case 20: // cntrmask\n parseStems();\n i += (nStems + 7) >> 3;\n break;\n case 21: // rmoveto\n if (stack.length > 2 && !haveWidth) {\n width = stack.shift() + font.nominalWidthX;\n haveWidth = true;\n }\n\n y += stack.pop();\n x += stack.pop();\n newContour(x, y);\n break;\n case 22: // hmoveto\n if (stack.length > 1 && !haveWidth) {\n width = stack.shift() + font.nominalWidthX;\n haveWidth = true;\n }\n\n x += stack.pop();\n newContour(x, y);\n break;\n case 23: // vstemhm\n parseStems();\n break;\n case 24: // rcurveline\n while (stack.length > 2) {\n c1x = x + stack.shift();\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n x += stack.shift();\n y += stack.shift();\n p.lineTo(x, y);\n break;\n case 25: // rlinecurve\n while (stack.length > 6) {\n x += stack.shift();\n y += stack.shift();\n p.lineTo(x, y);\n }\n\n c1x = x + stack.shift();\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n break;\n case 26: // vvcurveto\n if (stack.length % 2) {\n x += stack.shift();\n }\n\n while (stack.length > 0) {\n c1x = x;\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x;\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 27: // hhcurveto\n if (stack.length % 2) {\n y += stack.shift();\n }\n\n while (stack.length > 0) {\n c1x = x + stack.shift();\n c1y = y;\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y;\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 28: // shortint\n b1 = code[i];\n b2 = code[i + 1];\n stack.push(((b1 << 24) | (b2 << 16)) >> 16);\n i += 2;\n break;\n case 29: // callgsubr\n codeIndex = stack.pop() + font.gsubrsBias;\n subrCode = font.gsubrs[codeIndex];\n if (subrCode) {\n parse(subrCode);\n }\n\n break;\n case 30: // vhcurveto\n while (stack.length > 0) {\n c1x = x;\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n if (stack.length === 0) {\n break;\n }\n\n c1x = x + stack.shift();\n c1y = y;\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n y = c2y + stack.shift();\n x = c2x + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 31: // hvcurveto\n while (stack.length > 0) {\n c1x = x + stack.shift();\n c1y = y;\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n y = c2y + stack.shift();\n x = c2x + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n if (stack.length === 0) {\n break;\n }\n\n c1x = x;\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n default:\n if (v < 32) {\n console.log('Glyph ' + glyph.index + ': unknown operator ' + v);\n } else if (v < 247) {\n stack.push(v - 139);\n } else if (v < 251) {\n b1 = code[i];\n i += 1;\n stack.push((v - 247) * 256 + b1 + 108);\n } else if (v < 255) {\n b1 = code[i];\n i += 1;\n stack.push(-(v - 251) * 256 - b1 - 108);\n } else {\n b1 = code[i];\n b2 = code[i + 1];\n b3 = code[i + 2];\n b4 = code[i + 3];\n i += 4;\n stack.push(((b1 << 24) | (b2 << 16) | (b3 << 8) | b4) / 65536);\n }\n }\n }\n }\n\n parse(code);\n\n glyph.advanceWidth = width;\n return p;\n}", "title": "" }, { "docid": "86d70e099e3f88d7ea8ec1f362051c2d", "score": "0.429006", "text": "function parseCFFCharstring(font, glyph, code) {\n var c1x;\n var c1y;\n var c2x;\n var c2y;\n var p = new path.Path();\n var stack = [];\n var nStems = 0;\n var haveWidth = false;\n var width = font.defaultWidthX;\n var open = false;\n var x = 0;\n var y = 0;\n\n function newContour(x, y) {\n if (open) {\n p.closePath();\n }\n\n p.moveTo(x, y);\n open = true;\n }\n\n function parseStems() {\n var hasWidthArg;\n\n // The number of stem operators on the stack is always even.\n // If the value is uneven, that means a width is specified.\n hasWidthArg = stack.length % 2 !== 0;\n if (hasWidthArg && !haveWidth) {\n width = stack.shift() + font.nominalWidthX;\n }\n\n nStems += stack.length >> 1;\n stack.length = 0;\n haveWidth = true;\n }\n\n function parse(code) {\n var b1;\n var b2;\n var b3;\n var b4;\n var codeIndex;\n var subrCode;\n var jpx;\n var jpy;\n var c3x;\n var c3y;\n var c4x;\n var c4y;\n\n var i = 0;\n while (i < code.length) {\n var v = code[i];\n i += 1;\n switch (v) {\n case 1: // hstem\n parseStems();\n break;\n case 3: // vstem\n parseStems();\n break;\n case 4: // vmoveto\n if (stack.length > 1 && !haveWidth) {\n width = stack.shift() + font.nominalWidthX;\n haveWidth = true;\n }\n\n y += stack.pop();\n newContour(x, y);\n break;\n case 5: // rlineto\n while (stack.length > 0) {\n x += stack.shift();\n y += stack.shift();\n p.lineTo(x, y);\n }\n\n break;\n case 6: // hlineto\n while (stack.length > 0) {\n x += stack.shift();\n p.lineTo(x, y);\n if (stack.length === 0) {\n break;\n }\n\n y += stack.shift();\n p.lineTo(x, y);\n }\n\n break;\n case 7: // vlineto\n while (stack.length > 0) {\n y += stack.shift();\n p.lineTo(x, y);\n if (stack.length === 0) {\n break;\n }\n\n x += stack.shift();\n p.lineTo(x, y);\n }\n\n break;\n case 8: // rrcurveto\n while (stack.length > 0) {\n c1x = x + stack.shift();\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 10: // callsubr\n codeIndex = stack.pop() + font.subrsBias;\n subrCode = font.subrs[codeIndex];\n if (subrCode) {\n parse(subrCode);\n }\n\n break;\n case 11: // return\n return;\n case 12: // flex operators\n v = code[i];\n i += 1;\n switch (v) {\n case 35: // flex\n // |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 dx6 dy6 fd flex (12 35) |-\n c1x = x + stack.shift(); // dx1\n c1y = y + stack.shift(); // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y + stack.shift(); // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = jpy + stack.shift(); // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = c3y + stack.shift(); // dy5\n x = c4x + stack.shift(); // dx6\n y = c4y + stack.shift(); // dy6\n stack.shift(); // flex depth\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n case 34: // hflex\n // |- dx1 dx2 dy2 dx3 dx4 dx5 dx6 hflex (12 34) |-\n c1x = x + stack.shift(); // dx1\n c1y = y; // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y; // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = c2y; // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = y; // dy5\n x = c4x + stack.shift(); // dx6\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n case 36: // hflex1\n // |- dx1 dy1 dx2 dy2 dx3 dx4 dx5 dy5 dx6 hflex1 (12 36) |-\n c1x = x + stack.shift(); // dx1\n c1y = y + stack.shift(); // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y; // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = c2y; // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = c3y + stack.shift(); // dy5\n x = c4x + stack.shift(); // dx6\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n case 37: // flex1\n // |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 d6 flex1 (12 37) |-\n c1x = x + stack.shift(); // dx1\n c1y = y + stack.shift(); // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y + stack.shift(); // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = jpy + stack.shift(); // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = c3y + stack.shift(); // dy5\n if (Math.abs(c4x - x) > Math.abs(c4y - y)) {\n x = c4x + stack.shift();\n } else {\n y = c4y + stack.shift();\n }\n\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n default:\n console.log('Glyph ' + glyph.index + ': unknown operator ' + 1200 + v);\n stack.length = 0;\n }\n break;\n case 14: // endchar\n if (stack.length > 0 && !haveWidth) {\n width = stack.shift() + font.nominalWidthX;\n haveWidth = true;\n }\n\n if (open) {\n p.closePath();\n open = false;\n }\n\n break;\n case 18: // hstemhm\n parseStems();\n break;\n case 19: // hintmask\n case 20: // cntrmask\n parseStems();\n i += (nStems + 7) >> 3;\n break;\n case 21: // rmoveto\n if (stack.length > 2 && !haveWidth) {\n width = stack.shift() + font.nominalWidthX;\n haveWidth = true;\n }\n\n y += stack.pop();\n x += stack.pop();\n newContour(x, y);\n break;\n case 22: // hmoveto\n if (stack.length > 1 && !haveWidth) {\n width = stack.shift() + font.nominalWidthX;\n haveWidth = true;\n }\n\n x += stack.pop();\n newContour(x, y);\n break;\n case 23: // vstemhm\n parseStems();\n break;\n case 24: // rcurveline\n while (stack.length > 2) {\n c1x = x + stack.shift();\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n x += stack.shift();\n y += stack.shift();\n p.lineTo(x, y);\n break;\n case 25: // rlinecurve\n while (stack.length > 6) {\n x += stack.shift();\n y += stack.shift();\n p.lineTo(x, y);\n }\n\n c1x = x + stack.shift();\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n break;\n case 26: // vvcurveto\n if (stack.length % 2) {\n x += stack.shift();\n }\n\n while (stack.length > 0) {\n c1x = x;\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x;\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 27: // hhcurveto\n if (stack.length % 2) {\n y += stack.shift();\n }\n\n while (stack.length > 0) {\n c1x = x + stack.shift();\n c1y = y;\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y;\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 28: // shortint\n b1 = code[i];\n b2 = code[i + 1];\n stack.push(((b1 << 24) | (b2 << 16)) >> 16);\n i += 2;\n break;\n case 29: // callgsubr\n codeIndex = stack.pop() + font.gsubrsBias;\n subrCode = font.gsubrs[codeIndex];\n if (subrCode) {\n parse(subrCode);\n }\n\n break;\n case 30: // vhcurveto\n while (stack.length > 0) {\n c1x = x;\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n if (stack.length === 0) {\n break;\n }\n\n c1x = x + stack.shift();\n c1y = y;\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n y = c2y + stack.shift();\n x = c2x + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 31: // hvcurveto\n while (stack.length > 0) {\n c1x = x + stack.shift();\n c1y = y;\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n y = c2y + stack.shift();\n x = c2x + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n if (stack.length === 0) {\n break;\n }\n\n c1x = x;\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n default:\n if (v < 32) {\n console.log('Glyph ' + glyph.index + ': unknown operator ' + v);\n } else if (v < 247) {\n stack.push(v - 139);\n } else if (v < 251) {\n b1 = code[i];\n i += 1;\n stack.push((v - 247) * 256 + b1 + 108);\n } else if (v < 255) {\n b1 = code[i];\n i += 1;\n stack.push(-(v - 251) * 256 - b1 - 108);\n } else {\n b1 = code[i];\n b2 = code[i + 1];\n b3 = code[i + 2];\n b4 = code[i + 3];\n i += 4;\n stack.push(((b1 << 24) | (b2 << 16) | (b3 << 8) | b4) / 65536);\n }\n }\n }\n }\n\n parse(code);\n\n glyph.advanceWidth = width;\n return p;\n}", "title": "" }, { "docid": "4fa2db7c4e2ce4dabf7f89a7389d14a4", "score": "0.42895845", "text": "function rewrite(strN) {\n var n = Number(strN);\n\n /* Starting with the highest-valued glyph:\n take as many bites as we can with it\n (decrementing residual value with each bite,\n and appending a corresponding glyph copy to the string)\n before moving down to the next most expensive glyph */\n\n // return Object.keys(dctGlyphs).reduce(\n // OR:\n return 'M CM D CD C XC L XL X IX V IV I'.split(' ').reduce(\n function (s, k) {\n var v = dctGlyphs[k];\n return n >= v ? (n -= v, s + k) : s;\n }, ''\n )\n\n }", "title": "" }, { "docid": "683bd4b7e7cd7581387534e4e89782ee", "score": "0.42889175", "text": "setOtherVariables(fen) {\n this.kingPos = { w: [-1, -1], b: [-1, -1] };\n const fenParts = fen.split(\" \");\n const position = fenParts[0].split(\"/\");\n for (let i = 0; i < position.length; i++) {\n let k = 0;\n for (let j = 0; j < position[i].length; j++) {\n switch (position[i].charAt(j)) {\n case \"k\":\n this.kingPos[\"b\"] = [i, k];\n break;\n case \"K\":\n this.kingPos[\"w\"] = [i, k];\n break;\n default: {\n const num = parseInt(position[i].charAt(j), 10);\n if (!isNaN(num)) k += num - 1;\n }\n }\n k++;\n }\n }\n }", "title": "" }, { "docid": "f2c7a8f38a8679a75e0c14cd4496675c", "score": "0.4287234", "text": "function pairElement(str) {\n let dna = [];\n let codons = str.match(/[A-Z]/g);\n codons.forEach(element => dna.push([element]));\n dna.forEach(element => {\n if (element[0] == 'C') {\n element.push('G');\n }\n if (element[0] == 'G') {\n element.push('C');\n }\n if (element[0] == 'T') {\n element.push('A');\n }\n if (element[0] == 'A') {\n element.push('T');\n }\n });\n str = dna;\n return str;\n}", "title": "" }, { "docid": "dfb1b7863f281f7624669d245c904b35", "score": "0.42835", "text": "function mnemonicStrToArray(mnemonicStr) {\n const mnemonicArray = mnemonicStr.split(\" \");\n return mnemonicArray.map((word, idx) => ({index: idx + 1, word}))\n}", "title": "" }, { "docid": "843535b68abc1d7bbf69bf62bc3a31e2", "score": "0.4270495", "text": "function indentation(value) {\n var index = 0;\n var indent = 0;\n var character = value.charAt(index);\n var stops = {};\n var size;\n var lastIndent = 0;\n\n while (character === tab || character === space) {\n size = character === tab ? tabSize : spaceSize;\n\n indent += size;\n\n if (size > 1) {\n indent = Math.floor(indent / size) * size;\n }\n\n while (lastIndent < indent) {\n stops[++lastIndent] = index;\n }\n\n character = value.charAt(++index);\n }\n\n return { indent: indent, stops: stops };\n}", "title": "" }, { "docid": "c1db965cacccd10adc7bf4cd4cae4cba", "score": "0.426854", "text": "function parseCFFCharstring(font, glyph, code) {\n var c1x;\n var c1y;\n var c2x;\n var c2y;\n var p = new Path();\n var stack = [];\n var nStems = 0;\n var haveWidth = false;\n var open = false;\n var x = 0;\n var y = 0;\n var subrs;\n var subrsBias;\n var defaultWidthX;\n var nominalWidthX;\n if (font.isCIDFont) {\n var fdIndex = font.tables.cff.topDict._fdSelect[glyph.index];\n var fdDict = font.tables.cff.topDict._fdArray[fdIndex];\n subrs = fdDict._subrs;\n subrsBias = fdDict._subrsBias;\n defaultWidthX = fdDict._defaultWidthX;\n nominalWidthX = fdDict._nominalWidthX;\n } else {\n subrs = font.tables.cff.topDict._subrs;\n subrsBias = font.tables.cff.topDict._subrsBias;\n defaultWidthX = font.tables.cff.topDict._defaultWidthX;\n nominalWidthX = font.tables.cff.topDict._nominalWidthX;\n }\n var width = defaultWidthX;\n\n function newContour(x, y) {\n if (open) {\n p.closePath();\n }\n\n p.moveTo(x, y);\n open = true;\n }\n\n function parseStems() {\n var hasWidthArg;\n\n // The number of stem operators on the stack is always even.\n // If the value is uneven, that means a width is specified.\n hasWidthArg = stack.length % 2 !== 0;\n if (hasWidthArg && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n }\n\n nStems += stack.length >> 1;\n stack.length = 0;\n haveWidth = true;\n }\n\n function parse(code) {\n var b1;\n var b2;\n var b3;\n var b4;\n var codeIndex;\n var subrCode;\n var jpx;\n var jpy;\n var c3x;\n var c3y;\n var c4x;\n var c4y;\n\n var i = 0;\n while (i < code.length) {\n var v = code[i];\n i += 1;\n switch (v) {\n case 1: // hstem\n parseStems();\n break;\n case 3: // vstem\n parseStems();\n break;\n case 4: // vmoveto\n if (stack.length > 1 && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n haveWidth = true;\n }\n\n y += stack.pop();\n newContour(x, y);\n break;\n case 5: // rlineto\n while (stack.length > 0) {\n x += stack.shift();\n y += stack.shift();\n p.lineTo(x, y);\n }\n\n break;\n case 6: // hlineto\n while (stack.length > 0) {\n x += stack.shift();\n p.lineTo(x, y);\n if (stack.length === 0) {\n break;\n }\n\n y += stack.shift();\n p.lineTo(x, y);\n }\n\n break;\n case 7: // vlineto\n while (stack.length > 0) {\n y += stack.shift();\n p.lineTo(x, y);\n if (stack.length === 0) {\n break;\n }\n\n x += stack.shift();\n p.lineTo(x, y);\n }\n\n break;\n case 8: // rrcurveto\n while (stack.length > 0) {\n c1x = x + stack.shift();\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 10: // callsubr\n codeIndex = stack.pop() + subrsBias;\n subrCode = subrs[codeIndex];\n if (subrCode) {\n parse(subrCode);\n }\n\n break;\n case 11: // return\n return;\n case 12: // flex operators\n v = code[i];\n i += 1;\n switch (v) {\n case 35: // flex\n // |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 dx6 dy6 fd flex (12 35) |-\n c1x = x + stack.shift(); // dx1\n c1y = y + stack.shift(); // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y + stack.shift(); // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = jpy + stack.shift(); // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = c3y + stack.shift(); // dy5\n x = c4x + stack.shift(); // dx6\n y = c4y + stack.shift(); // dy6\n stack.shift(); // flex depth\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n case 34: // hflex\n // |- dx1 dx2 dy2 dx3 dx4 dx5 dx6 hflex (12 34) |-\n c1x = x + stack.shift(); // dx1\n c1y = y; // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y; // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = c2y; // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = y; // dy5\n x = c4x + stack.shift(); // dx6\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n case 36: // hflex1\n // |- dx1 dy1 dx2 dy2 dx3 dx4 dx5 dy5 dx6 hflex1 (12 36) |-\n c1x = x + stack.shift(); // dx1\n c1y = y + stack.shift(); // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y; // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = c2y; // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = c3y + stack.shift(); // dy5\n x = c4x + stack.shift(); // dx6\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n case 37: // flex1\n // |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 d6 flex1 (12 37) |-\n c1x = x + stack.shift(); // dx1\n c1y = y + stack.shift(); // dy1\n c2x = c1x + stack.shift(); // dx2\n c2y = c1y + stack.shift(); // dy2\n jpx = c2x + stack.shift(); // dx3\n jpy = c2y + stack.shift(); // dy3\n c3x = jpx + stack.shift(); // dx4\n c3y = jpy + stack.shift(); // dy4\n c4x = c3x + stack.shift(); // dx5\n c4y = c3y + stack.shift(); // dy5\n if (Math.abs(c4x - x) > Math.abs(c4y - y)) {\n x = c4x + stack.shift();\n } else {\n y = c4y + stack.shift();\n }\n\n p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);\n p.curveTo(c3x, c3y, c4x, c4y, x, y);\n break;\n default:\n console.log('Glyph ' + glyph.index + ': unknown operator ' + 1200 + v);\n stack.length = 0;\n }\n break;\n case 14: // endchar\n if (stack.length > 0 && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n haveWidth = true;\n }\n\n if (open) {\n p.closePath();\n open = false;\n }\n\n break;\n case 18: // hstemhm\n parseStems();\n break;\n case 19: // hintmask\n case 20: // cntrmask\n parseStems();\n i += (nStems + 7) >> 3;\n break;\n case 21: // rmoveto\n if (stack.length > 2 && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n haveWidth = true;\n }\n\n y += stack.pop();\n x += stack.pop();\n newContour(x, y);\n break;\n case 22: // hmoveto\n if (stack.length > 1 && !haveWidth) {\n width = stack.shift() + nominalWidthX;\n haveWidth = true;\n }\n\n x += stack.pop();\n newContour(x, y);\n break;\n case 23: // vstemhm\n parseStems();\n break;\n case 24: // rcurveline\n while (stack.length > 2) {\n c1x = x + stack.shift();\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n x += stack.shift();\n y += stack.shift();\n p.lineTo(x, y);\n break;\n case 25: // rlinecurve\n while (stack.length > 6) {\n x += stack.shift();\n y += stack.shift();\n p.lineTo(x, y);\n }\n\n c1x = x + stack.shift();\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n break;\n case 26: // vvcurveto\n if (stack.length % 2) {\n x += stack.shift();\n }\n\n while (stack.length > 0) {\n c1x = x;\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x;\n y = c2y + stack.shift();\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 27: // hhcurveto\n if (stack.length % 2) {\n y += stack.shift();\n }\n\n while (stack.length > 0) {\n c1x = x + stack.shift();\n c1y = y;\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y;\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 28: // shortint\n b1 = code[i];\n b2 = code[i + 1];\n stack.push(((b1 << 24) | (b2 << 16)) >> 16);\n i += 2;\n break;\n case 29: // callgsubr\n codeIndex = stack.pop() + font.gsubrsBias;\n subrCode = font.gsubrs[codeIndex];\n if (subrCode) {\n parse(subrCode);\n }\n\n break;\n case 30: // vhcurveto\n while (stack.length > 0) {\n c1x = x;\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n if (stack.length === 0) {\n break;\n }\n\n c1x = x + stack.shift();\n c1y = y;\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n y = c2y + stack.shift();\n x = c2x + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n case 31: // hvcurveto\n while (stack.length > 0) {\n c1x = x + stack.shift();\n c1y = y;\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n y = c2y + stack.shift();\n x = c2x + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n if (stack.length === 0) {\n break;\n }\n\n c1x = x;\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + (stack.length === 1 ? stack.shift() : 0);\n p.curveTo(c1x, c1y, c2x, c2y, x, y);\n }\n\n break;\n default:\n if (v < 32) {\n console.log('Glyph ' + glyph.index + ': unknown operator ' + v);\n } else if (v < 247) {\n stack.push(v - 139);\n } else if (v < 251) {\n b1 = code[i];\n i += 1;\n stack.push((v - 247) * 256 + b1 + 108);\n } else if (v < 255) {\n b1 = code[i];\n i += 1;\n stack.push(-(v - 251) * 256 - b1 - 108);\n } else {\n b1 = code[i];\n b2 = code[i + 1];\n b3 = code[i + 2];\n b4 = code[i + 3];\n i += 4;\n stack.push(((b1 << 24) | (b2 << 16) | (b3 << 8) | b4) / 65536);\n }\n }\n }\n }\n\n parse(code);\n\n glyph.advanceWidth = width;\n return p;\n}", "title": "" }, { "docid": "a8a54ec8548629f90b3b720a92ed74e4", "score": "0.42648628", "text": "cfg2kv (cfg) {\n\n /* helper function for character class checking */\n const isAlpha = (ch) => {\n let cc = ch.charCodeAt(0)\n return (\n (\"A\".charCodeAt(0) <= cc && cc <= \"Z\".charCodeAt(0))\n || (\"a\".charCodeAt(0) <= cc && cc <= \"z\".charCodeAt(0))\n )\n }\n const isDigit = (ch) => {\n let cc = ch.charCodeAt(0)\n return (\"0\".charCodeAt(0) <= cc && cc <= \"9\".charCodeAt(0))\n }\n\n /* helper function for consuming and looking at next characters */\n const consume = (cfg, num) => {\n if (num > 0)\n cfg = cfg.substr(num)\n return cfg\n }\n const lookahead = (cfg) => {\n let ch = cfg.substr(0, 1)\n let la = cfg.substr(1, 1)\n return { ch, la }\n }\n\n /* iterate over the configuration file content */\n let kv = \"\"\n let ns = []\n let id = \"\"\n let expect = \"key\"\n while (cfg !== \"\") {\n /* extract first and second (look-ahead) character */\n let { ch, la } = lookahead(cfg)\n\n /* white-space */\n if (ch === \" \" || ch === \"\\t\" || ch === \"\\n\")\n cfg = consume(cfg, 1)\n\n /* end-of-line comment */\n else if (ch === \"/\" && la === \"/\") {\n while (cfg !== \"\" && ch !== \"\\n\") {\n cfg = consume(cfg, 1)\n ch = lookahead(cfg).ch\n }\n }\n\n /* section start end end */\n else if (ch === \"{\") {\n ns.push(id)\n cfg = consume(cfg, 1)\n expect = \"key\"\n }\n else if (ch === \"}\") {\n ns.pop()\n cfg = consume(cfg, 1)\n }\n\n /* key */\n else if (expect === \"key\" && isAlpha(ch)) {\n id = \"\"\n while (isAlpha(ch)) {\n id += ch\n cfg = consume(cfg, 1)\n ch = lookahead(cfg).ch\n }\n expect = \"val\"\n }\n\n /* key to value punctuation operator */\n else if (ch === \"=\") {\n cfg = consume(cfg, 1)\n }\n\n /* number value */\n else if (expect === \"val\" && isDigit(ch)) {\n let num = \"\"\n while (isDigit(ch)) {\n num += ch\n cfg = consume(cfg, 1)\n ch = lookahead(cfg).ch\n }\n kv += `${[ ...ns, id].join(\".\")} ${parseInt(num, 10)}\\n`\n expect = \"key\"\n }\n\n /* string value */\n else if (expect === \"val\" && ch === \"\\\"\") {\n let str = \"\"\n let escaped = false\n cfg = consume(cfg, 1)\n ch = lookahead(cfg).ch\n while (ch !== \"\\\"\" || escaped) {\n if (ch === \"\\\\\")\n escaped = true\n else {\n escaped = false\n str += ch\n }\n cfg = consume(cfg, 1)\n ch = lookahead(cfg).ch\n }\n cfg = consume(cfg, 1)\n ch = lookahead(cfg).ch\n kv += `${[ ...ns, id ].join(\".\")} ${str}\\n`\n expect = \"key\"\n }\n\n /* everything else leads to a parsing error */\n else {\n throw new Error(\"unexpected character: \\\"\" + ch + \"\\\" (at \\\"\" + cfg + \"\\\")\")\n }\n }\n return kv\n }", "title": "" }, { "docid": "4fd7492a519c79194e37c4b6c49733a7", "score": "0.42614576", "text": "translateStalks(str) {\n\treturn str.replace(/[89]/g, '2').replace(/[45]/g, '3').match(/[23]{1,3}/g).map((x) => {\n\t switch(x) {\n\t case '222': return '6';\n\t case '322': case '232': case '223': return '7';\n\t case '233': case '323': case '332': return '8';\n\t case '333': return '9';\n\t default: return '';\n\t }\n\t}).join('');\n }", "title": "" }, { "docid": "1c57bed85d8f1484b50e1229becee4c8", "score": "0.4258944", "text": "intervalFromKey(k) {\n\t\tif (k == ' ' || k == 'j') {\n\t\t\tk = this.lastKey;\n\t\t} else {\n\t\t\tthis.lastKey = k;\n\t\t}\n\t\tlet interval = null;\n\t\tswitch (k) {\n\t\t\tcase 'n':\n\t\t\t\tinterval = 1;\n\t\t\t\tbreak;\n\t\t\tcase 'h':\n\t\t\t\tinterval = -1;\n\t\t\t\tbreak;\n\t\t\tcase \"'\":\n\t\t\t\tinterval = 0;\n\t\t\t\tbreak;\n\t\t\tcase 's':\n\t\t\t\tinterval = 2;\n\t\t\t\tbreak;\n\t\t\tcase 'r':\n\t\t\t\tinterval = -3;\n\t\t\t\tbreak;\n\t\t\tcase 'i':\n\t\t\t\tinterval = 3;\n\t\t\t\tbreak;\n\t\t\tcase 'k':\n\t\t\t\tinterval = -2;\n\t\t\t\tbreak;\n\t\t\tcase 'c':\n\t\t\t\tinterval = -7;\n\t\t\t\tbreak;\n\t\t\tcase 'x':\n\t\t\t\tinterval = -14;\n\t\t\t\tbreak;\n\t\t\tcase ',':\n\t\t\t\tinterval = 7;\n\t\t\t\tbreak;\n\t\t\tcase '.':\n\t\t\t\tinterval = 14;\n\t\t\t\tbreak;\n\t\t\tcase 'p':\n\t\t\t\tinterval = -4;\n\t\t\t\tbreak;\n\t\t\tcase 'e':\n\t\t\t\tinterval = 4;\n\t\t\t\tbreak;\n\t\t\tcase 'w':\n\t\t\t\tinterval = 5;\n\t\t\t\tbreak;\n\t\t\tcase 'v':\n\t\t\t\tinterval = -6;\n\t\t\t\tbreak;\n\t\t\tcase 'm':\n\t\t\t\tinterval = 6;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tinterval = null;\n\t\t}\n\t\treturn interval;\n\t}", "title": "" }, { "docid": "137236b29c5bb8f61e087b6ce49bb465", "score": "0.42544", "text": "function pairElement(str) {\n str = str.toUpperCase();\n const pairs = {\n \"A\": \"T\",\n \"T\": \"A\",\n \"C\": \"G\",\n \"G\": \"C\"\n }\n let arr = str.split(\"\");\n return arr.map(x => [x, pairs[x]]);\n}", "title": "" } ]
2bdb3980bcab3c031f24d4e9b685fa86
Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers in a localedependent way, using a comma instead of a dot. If comma is not replaced with a dot, the input will be rounded down (i.e. acting as a floor function) causing unexpected behaviors
[ { "docid": "1b013ee53f896cd3a04fd7de1975605a", "score": "0.0", "text": "function toMs (s) {\n return Number(s.slice(0, -1).replace(',', '.')) * 1000\n}", "title": "" } ]
[ { "docid": "7cd0487307e1ea18a14162b76c663248", "score": "0.67688954", "text": "function commaOnly(value) {\n var num = parseFloat(value);\n if ((vp.utils.isNumber(num)) && (!isNaN(num)) && (value.toString().indexOf(\"e+\") == -1)) {\n //---- add commas, as needed ----\n var parts = value.toString().split('.'); // DON'T use 'num' here: we want to preserve any trailing 0's in the mantissa of 'value' [as potentially added by comma()]\n var left = parts[0];\n var right = (parts.length > 1) ? \".\" + parts[1] : \"\";\n var len = left.length;\n if (len > 3) {\n var startLen = (len % 3) == 0 ? 3 : len % 3;\n var newLeft = left.substring(0, startLen);\n for (var i = startLen; i < len; i += 3) {\n newLeft += THOUSAND_SEPARATOR + left.substring(i, i + 3);\n }\n value = newLeft + right;\n //---- avoid \"-,\" problem ----\n if (value.startsWith(\"-,\")) {\n value = \"-\" + value.substr(2);\n }\n }\n }\n return (value.toString());\n }", "title": "" }, { "docid": "4221fd12f668497b4fdc67753a9300f1", "score": "0.6549909", "text": "function number_format(number, decimals, decPoint, thousandsSep) {\n number = (number + \"\").replace(/[^0-9+\\-Ee.]/g, \"\");\n var n = !isFinite(+number) ? 0 : +number;\n var prec = !isFinite(+decimals) ? 0 : Math.abs(decimals);\n var sep = typeof thousandsSep === \"undefined\" ? \",\" : thousandsSep;\n var dec = typeof decPoint === \"undefined\" ? \".\" : decPoint;\n var s = \"\";\n\n var toFixedFix = function(n, prec) {\n var k = Math.pow(10, prec);\n return \"\" + (Math.round(n * k) / k).toFixed(prec);\n };\n\n // @todo: for IE parseFloat(0.55).toFixed(0) = 0;\n s = (prec ? toFixedFix(n, prec) : \"\" + Math.round(n)).split(\".\");\n if (s[0].length > 3) {\n s[0] = s[0].replace(/\\B(?=(?:\\d{3})+(?!\\d))/g, sep);\n }\n if ((s[1] || \"\").length < prec) {\n s[1] = s[1] || \"\";\n s[1] += new Array(prec - s[1].length + 1).join(\"0\");\n }\n\n return s.join(dec);\n}", "title": "" }, { "docid": "06d32515e4acb17e2f106e2073f36807", "score": "0.6539572", "text": "function formatWithCommas(value) {\n\tvar parts = value.toString().split(\".\");\n\tparts[0] = parts[0].replace(/,/gi, \"\"); // remove existing commas\n\tparts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n\n\treturn parts.join(\".\");\n}", "title": "" }, { "docid": "ee3a7cb755eaf7a9a231e3380bb0bdcd", "score": "0.64501745", "text": "function number_format(number, decimals, dec_point, thousands_sep) {\r\n\tnumber = (number + '').replace(/[^0-9+\\-Ee.]/g, '');\r\n\tvar n = !isFinite(+number) ? 0 : +number,\r\n\t\tprec = !isFinite(+decimals) ? 0 : Math.abs(decimals),\r\n\t\tsep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,\r\n\t\tdec = (typeof dec_point === 'undefined') ? '.' : dec_point,\r\n\t\ts = '',\r\n\t\ttoFixedFix = function (n, prec) {\r\n\t\t\tvar k = Math.pow(10, prec);\r\n\t\t\treturn '' + (Math.round(n * k) / k)\r\n\t\t\t\t.toFixed(prec);\r\n\t\t};\r\n\t// Fix for IE parseFloat(0.55).toFixed(0) = 0;\r\n\ts = (prec ? toFixedFix(n, prec) : '' + Math.round(n))\r\n\t\t.split('.');\r\n\tif (s[0].length > 3) {\r\n\t\ts[0] = s[0].replace(/\\B(?=(?:\\d{3})+(?!\\d))/g, sep);\r\n\t}\r\n\tif ((s[1] || '')\r\n\t\t.length < prec) {\r\n\t\ts[1] = s[1] || '';\r\n\t\ts[1] += new Array(prec - s[1].length + 1)\r\n\t\t\t.join('0');\r\n\t}\r\n\treturn s.join(dec);\r\n}", "title": "" }, { "docid": "7a608aefe6b336ee11402b3b2c98fd15", "score": "0.64480454", "text": "function util_insertComma(value) {\r\n\tif (value == '') return value;\r\n\r\n\tvalue = parseFloat(value, 10).toString()\r\n\twhile (true) {\r\n\t\r\n\t\tif (value.indexOf(',') != -1)\r\n\t\t\tidx = value.search(/[^,\\.\\-]([0-9]{3})+\\,/);\r\n\t\telse\r\n\t\t\tidx = value.search(/[^,\\.\\-]([0-9]{3})+$/);\r\n\t\tif (idx == -1) break;\r\n\t\t\tvalue = value.substring(0, idx+1) + '.' + value.substring(idx+1, value.length);\r\n\t}\r\n\treturn value;\r\n}", "title": "" }, { "docid": "d5edc8cf44a93103be33c181bc51607b", "score": "0.64430237", "text": "function commafy(num) {\n\tvar str = num.toString().split('.');\n\tif (str[0].length > 3) {\n\t\tstr[0] = str[0].replace(/(\\d)(?=(\\d{3})+$)/g, '$1,');\n\t}\n\tif (str[1] && str[1].length > 3) {\n\t\tstr[1] = str[1].replace(/(\\d{3})/g, '$1,');\n\t\tif (str[1].endsWith(\",\")) str[1] = str.slice(0, -1);\n\t}\n\treturn str.join('.');\n}", "title": "" }, { "docid": "66ac6c2e1fbf67ce2fc05267af4c61d4", "score": "0.6398246", "text": "function fmt_num(str) {\r\nvar value=0.0;\r\nvar x= str.lastIndexOf(\".\");\r\nvar y= str.lastIndexOf(\",\");\r\n \r\n if ( !isNum(str) )\r\n return(value);\r\n\r\n\r\n if ( x == -1 && y == -1 ){\r\n value = parseInt(str);\r\n return(value);\r\n }\r\n\r\n if ( x < y )\r\n x=y;\r\n\r\n txt1=str.substring(0,x);\r\n if (txt1 == '') txt1 = '0';\r\n txt1=replace(txt1,',',''); \r\n txt1=replace(txt1,'.',''); \r\n txt1=replace(txt1,' ',''); \r\n \r\n txt=txt1+'.'+str.substring(x+1);\r\n value = (parseInt(txt1) + parseFloat('.'+str.substring(x+1)));\r\n\r\nreturn(value);\r\n}", "title": "" }, { "docid": "44d048819ad52701d6ca17f7280139ce", "score": "0.63726974", "text": "function transformaMoedaRealParaFloat(num) {\n// console.log('1>> ');\n// console.log(num);\n \n if(num.indexOf(',')) {\n num = num.replace('.', '');\n num = num.replace(',', '.');\n\n num = parseFloat(num);\n }\n \n// console.log('2>> ');\n// console.log(num);\n \n if(num % 1 === 0) {\n num = num + ',00';\n }\n \n// console.log('3>> ');\n// console.log(num);\n\n return num;\n}", "title": "" }, { "docid": "6fb7d0c45bfd51e7bb20d9bedec59007", "score": "0.6353352", "text": "function formatter(val)\n\t\t\t\t{\n\t\t\t\tval = val.replace(/[^\\d,.]*([\\d,|.]*)/g,'$1');\n\t\t\t\treturn val;\n\t\t\t\t}", "title": "" }, { "docid": "fb22f5e8f7832dbe65605a4c1afc5f0c", "score": "0.62841463", "text": "function numberWithCommas(x)\n{\n var parts = x.toString().split(\".\");\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n return parts.join(\".\");\n}", "title": "" }, { "docid": "87a129ad9b746d8d550dfc2d7d4c20f1", "score": "0.6278547", "text": "function numberWithCommas(x) {\n var parts = x.toString().split(\".\");\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n return parts.join(\".\");\n }", "title": "" }, { "docid": "8d7aad2b423ef128d972067efcc49815", "score": "0.62725496", "text": "function FormatNumericWithSeparate(field)\n{\n\tvar DecimalNumber = 1;\n\tvar DecimalChar = \".\";\n\tvar SeperateChar = \",\";\n\tvar ValueString = parseFloat(field.value.replace(/,/g,'')).toString();\n\t//var ValueString = field.value;\n\tvar ValueStringAfterDecimal = \"\";\n\tvar ValueStringNew = \"\";\t\n\t//if (field.value < 0)\n\tif (ValueString < 0)\n\t{\n\t\tValueString = ValueString.substring(1, ValueString.length); //Bo dau tru\t\t\t\t\n\t}\t\t\n\tif (ValueString.indexOf(DecimalChar) != -1)\n\t{\n\t\tValueStringAfterDecimal = ValueString.substring(ValueString.indexOf(DecimalChar), ValueString.indexOf(DecimalChar) + 2 + DecimalNumber) // Tinh luon dau cham\n\t\t//alert(ValueStringAfterDecimal);\n\t\tValueString = ValueString.substring(0, ValueString.indexOf(DecimalChar))\n\t}\n\n\tif (ValueStringAfterDecimal.indexOf(SeperateChar) != -1)\n\t{\n\t\tGetAlertError(iTotal,DSAlert,\"0035\");\n\t\tfield.value = \"\";\n\t\tfield.focus();\t\t\n\t\treturn;\n\t}\t\n\tValueString = ValueString.replace(/,/g,'');\n\tValueStringNew = \"\";\n\twhile (ValueString.length >3)\n\t{\n\t\tValueStringNew = SeperateChar + ValueString.substring(ValueString.length - 3, ValueString.length) + ValueStringNew;\n\t\tValueString = ValueString.substring(0, ValueString.length - 3);\n\t}\n\tif (DecimalNumber != 0)\n\t\tValueStringNew = ValueString + ValueStringNew + ValueStringAfterDecimal;\n\telse\n\t\tValueStringNew = ValueString + ValueStringNew;\t\n\t//if (field.value < 0) \n\tif (parseFloat(field.value.replace(/,/g,'')) < 0) \t\n\t\tValueStringNew = \"-\" + ValueStringNew;\n\t\n\tfield.value = ValueStringNew;\n}", "title": "" }, { "docid": "f89412344a6853e9a1c690c3dac0cad7", "score": "0.62639844", "text": "function numberWithCommas(value) {\n if (formatting) {\n var parts = value.toString().split(decimalSeparator);\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, groupSeparator);\n return parts.join(decimalSeparator);\n }\n else {\n return value;\n }\n }", "title": "" }, { "docid": "609aa9516416f2c392e0b3b5a90f61f8", "score": "0.626219", "text": "function numberWithCommas(x) {\n var parts = x.toFixed(2).toString().split(\".\");\n \n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n \n return parts.join(\".\");\n }", "title": "" }, { "docid": "a791ec7302ae7f980affdf1d03992d2d", "score": "0.62604284", "text": "function format(n){\r\n return n.toFixed(1).replace(/(\\d)(?=(\\d{3})+\\.)/g, \"$1,\");\r\n}", "title": "" }, { "docid": "21d10cfa3fe7afadbe32d238f76a0645", "score": "0.62476677", "text": "function number_format (number, decimals, dec_point, thousands_sep) {\n // Strip all characters but numerical ones.\n number = (number + '').replace(/[^0-9+\\-Ee.]/g, '');\n var n = !isFinite(+number) ? 0 : +number,\n prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),\n sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,\n dec = (typeof dec_point === 'undefined') ? '.' : dec_point,\n s = '',\n toFixedFix = function (n, prec) {\n var k = Math.pow(10, prec);\n return '' + Math.round(n * k) / k;\n };\n // Fix for IE parseFloat(0.55).toFixed(0) = 0;\n s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');\n if (s[0].length > 3) {\n s[0] = s[0].replace(/\\B(?=(?:\\d{3})+(?!\\d))/g, sep);\n }\n if ((s[1] || '').length < prec) {\n s[1] = s[1] || '';\n s[1] += new Array(prec - s[1].length + 1).join('0');\n }\n return s.join(dec);\n}", "title": "" }, { "docid": "21d10cfa3fe7afadbe32d238f76a0645", "score": "0.62476677", "text": "function number_format (number, decimals, dec_point, thousands_sep) {\n // Strip all characters but numerical ones.\n number = (number + '').replace(/[^0-9+\\-Ee.]/g, '');\n var n = !isFinite(+number) ? 0 : +number,\n prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),\n sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,\n dec = (typeof dec_point === 'undefined') ? '.' : dec_point,\n s = '',\n toFixedFix = function (n, prec) {\n var k = Math.pow(10, prec);\n return '' + Math.round(n * k) / k;\n };\n // Fix for IE parseFloat(0.55).toFixed(0) = 0;\n s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');\n if (s[0].length > 3) {\n s[0] = s[0].replace(/\\B(?=(?:\\d{3})+(?!\\d))/g, sep);\n }\n if ((s[1] || '').length < prec) {\n s[1] = s[1] || '';\n s[1] += new Array(prec - s[1].length + 1).join('0');\n }\n return s.join(dec);\n}", "title": "" }, { "docid": "2d7c04ac4449f2b669b035cdedfbb121", "score": "0.62447894", "text": "function numberWithCommas(x) {\n var parts = x.toString().split(\".\");\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n return parts.join(\".\");\n}", "title": "" }, { "docid": "83cd05641a725365fc1ade3a15244797", "score": "0.6244642", "text": "numberWithCommas(x) {\n // Async edge case so page will not break in case of large data loads\n if (!x) {\n return 'Loading...';\n }\n\n return x.toString().replace(/\\B(?<!\\.\\d*)(?=(\\d{3})+(?!\\d))/g, ',');\n }", "title": "" }, { "docid": "2c51f96ff3e78cb9f01ad5d9e20d29d5", "score": "0.6239393", "text": "function formatNumber(x) {\n var parts = x.toString().split(\".\");\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n return parts.join(\".\");\n}", "title": "" }, { "docid": "2c51f96ff3e78cb9f01ad5d9e20d29d5", "score": "0.6239393", "text": "function formatNumber(x) {\n var parts = x.toString().split(\".\");\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n return parts.join(\".\");\n}", "title": "" }, { "docid": "46f00961f5e10bf4405a3c9564d0c77e", "score": "0.62284285", "text": "function numberWithCommas(x) {\n let parts = x.toString().split(\".\");\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n return parts.join(\".\");\n }", "title": "" }, { "docid": "d0a6d9783c15b0ac107dc7e257751587", "score": "0.6213095", "text": "function numberWithCommas(x) {\n var parts = x.toString().split(\".\");\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n return parts.join(\".\");\n }", "title": "" }, { "docid": "1fe4198230a8cb083d59129efe449724", "score": "0.62070143", "text": "function number_format(val, decimals){\n //Parse the value as a float value\n val = parseFloat(val);\n //Format the value w/ the specified number\n //of decimal places and return it.\n return val.toFixed(decimals);\n}", "title": "" }, { "docid": "ff4fccaa8020212c1f5f80f7340eb777", "score": "0.61779356", "text": "function decimalDeprecated() {\n return fluent_lib_1.pipe(functional_lib_1.or(functional_lib_1.string(), functional_lib_1.finiteNumber(), functional_lib_1.bigInt()), function (_name, mixed) {\n return mixed.toString();\n }, functional_lib_1.floatingPointFormatString());\n}", "title": "" }, { "docid": "ff4fccaa8020212c1f5f80f7340eb777", "score": "0.61779356", "text": "function decimalDeprecated() {\n return fluent_lib_1.pipe(functional_lib_1.or(functional_lib_1.string(), functional_lib_1.finiteNumber(), functional_lib_1.bigInt()), function (_name, mixed) {\n return mixed.toString();\n }, functional_lib_1.floatingPointFormatString());\n}", "title": "" }, { "docid": "92e90e11f7db4353033232bd34ea7f64", "score": "0.6162317", "text": "numberWithCommas(x) {\n if (!x) {\n return \"$0\";\n }\n x = parseFloat(x.toFixed(2));\n return \"$\" + x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n }", "title": "" }, { "docid": "27da8dca3a230e98fe36ba2622133b84", "score": "0.61612964", "text": "function formatNumber(num) {\r\n if (!num || num == 'NaN') return '-';\r\n if (num == 'Infinity') return '&#x221e;';\r\n num = num.toString().replace(/\\$|\\,/g, '');\r\n if (isNaN(num))\r\n num = \"0\";\r\n sign = (num == (num = Math.abs(num)));\r\n num = Math.floor(num * 100 + 0.50000000001);\r\n cents = num % 100;\r\n num = Math.floor(num / 100).toString();\r\n if (cents < 10)\r\n cents = \"0\" + cents;\r\n for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++)\r\n num = num.substring(0, num.length - (4 * i + 3)) + '.' + num.substring(num.length - (4 * i + 3));\r\n return (((sign) ? '' : '-') + num + ',' + cents);\r\n}", "title": "" }, { "docid": "dd1d84ad32458803a2abb443cdca0bd6", "score": "0.615806", "text": "function formatDecimal(x) {\n return Math.abs(x = Math.round(x)) >= 1e21 ? x.toLocaleString(\"en\").replace(/,/g, \"\") : x.toString(10);\n}", "title": "" }, { "docid": "9d5388c98c5a6e453b812663d26669db", "score": "0.6141273", "text": "function formatNumber(number, decimals, dec_point, thousands_sep) {\n number = (number + '').replace(/[^0-9+\\-Ee.]/g, '');\n var n = !isFinite(+number) ? 0 : +number,\n prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),\n sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,\n dec = (typeof dec_point === 'undefined') ? '.' : dec_point,\n s = '',\n toFixedFix = function (n, prec) {\n var k = Math.pow(10, prec);\n return '' + Math.round(n * k) / k;\n };\n // Fix for IE parseFloat(0.55).toFixed(0) = 0;\n s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');\n if (s[0].length > 3) {\n s[0] = s[0].replace(/\\B(?=(?:\\d{3})+(?!\\d))/g, sep);\n }\n if ((s[1] || '').length < prec) {\n s[1] = s[1] || '';\n s[1] += new Array(prec - s[1].length + 1).join('0');\n }\n return s.join(dec);\n}", "title": "" }, { "docid": "807d471dacf04460a9ac657924d1fa7a", "score": "0.61218566", "text": "function pointToComma(row) {\n var patternPoint = /^[0-9]+([.][0-9]+)?%?$/;\n var newRow = [];\n for (var j = 0, lgj = row.length; j < lgj; j++) {\n if (row[j] === \"0.0\" || row[j] === \"0\" || row[j] === \"\" || row[j] === \" \" || row[j] === 0) {\n row[j] = \"\";\n } else if (patternPoint.test(row[j])) {\n row[j] = parseFloat(row[j]).toLocaleString(); // row[j].replace(/\\,/, \".\");\n } else {\n row[j] = row[j];\n }\n newRow.push(row[j]);\n }\n return newRow;\n}", "title": "" }, { "docid": "c62f4a89083bd49b533a59b365c39488", "score": "0.612076", "text": "function number_format(number, decimals, decPoint, thousandsSep)\r\n{\r\n decimals = decimals || 0;\r\n number = parseFloat(number);\r\n\r\n if(!decPoint || !thousandsSep)\r\n {\r\n decPoint = \".\";\r\n thousandsSep = \",\";\r\n }\r\n\r\n var roundedNumber = Math.round( Math.abs( number ) * (\"1e\" + decimals) ) + \"\";\r\n // add zeros to decimalString if number of decimals indicates it\r\n roundedNumber = (1 > number && -1 < number && roundedNumber.length <= decimals)\r\n ? Array(decimals - roundedNumber.length + 1).join(\"0\") + roundedNumber : roundedNumber;\r\n var numbersString = decimals ? roundedNumber.slice(0, decimals * -1) : roundedNumber.slice(0);\r\n var checknull = parseInt(numbersString) || 0;\r\n\r\n // check if the value is less than one to prepend a 0\r\n numbersString = (checknull == 0) ? \"0\": numbersString;\r\n var decimalsString = decimals ? roundedNumber.slice(decimals * -1) : '';\r\n \r\n var formattedNumber = \"\";\r\n while(numbersString.length > 3)\r\n {\r\n formattedNumber = thousandsSep + numbersString.slice(-3) + formattedNumber;\r\n numbersString = numbersString.slice(0,-3);\r\n }\r\n\r\n return (number < 0 ? \"-\" : \"\") + numbersString + formattedNumber + (decimalsString ? (decPoint + decimalsString) : \"\");\r\n}", "title": "" }, { "docid": "aed3df142b60b46e529a977e78006a6d", "score": "0.6118212", "text": "function formatNumber(num, precision, decpoint, thousandSep) {\n\tif (decpoint === undefined) decpoint = ',';\n\tif (thousandSep === undefined) thousandSep = '.';\n\tif (num==0) return \"0\";\n\tvar parts = num.toFixed(precision).split('.');\n\tvar s0 = parts[0];\n\tvar s = '';\n\twhile (s0.length > 3) {\n\t\ts = thousandSep + s0.substr(s0.length-3) + s;\n\t\ts0 = s0.substr(0, s0.length-3);\n\t}\n\ts = s0 + s;\n\tif (parts.length > 1) s += decpoint + parts[1];\n\treturn s;\n} // formatNumber", "title": "" }, { "docid": "d57f55dd227bb639984b4b3ce0d412a4", "score": "0.6113443", "text": "function formatDecimal(x) {\n return Math.abs(x = Math.round(x)) >= 1e21\n ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n : x.toString(10);\n}", "title": "" }, { "docid": "d57f55dd227bb639984b4b3ce0d412a4", "score": "0.6113443", "text": "function formatDecimal(x) {\n return Math.abs(x = Math.round(x)) >= 1e21\n ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n : x.toString(10);\n}", "title": "" }, { "docid": "d57f55dd227bb639984b4b3ce0d412a4", "score": "0.6113443", "text": "function formatDecimal(x) {\n return Math.abs(x = Math.round(x)) >= 1e21\n ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n : x.toString(10);\n}", "title": "" }, { "docid": "204b5862f2945116aec84f106c4f5ad9", "score": "0.61046433", "text": "function numberWithCommas(x) {\n return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n // return x.toFixed(2);\n }", "title": "" }, { "docid": "8020172b01af4431ab895272f7911b75", "score": "0.6085071", "text": "function numberWithCommas(x) {\n return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \".\");\n}", "title": "" }, { "docid": "8020172b01af4431ab895272f7911b75", "score": "0.6085071", "text": "function numberWithCommas(x) {\n return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \".\");\n}", "title": "" }, { "docid": "c5879b881f38c0f4a3c7d9a44d97fd58", "score": "0.60817933", "text": "function commafy(num) {\r\n n = num.toString();\r\n var arr = n.split(\".\");\r\n if (arr[0].length < 4) {\r\n arr[0] = arr[0];\r\n } else if (arr[0].length % 3 === 0) {\r\n var x = arr[0].match(/.{1,3}/g);\r\n arr[0] = x.join(\",\");\r\n } else if (arr[0].length %3 === 1) {\r\n var str = arr[0].substring(0, 1);\r\n var x = arr[0].replace(str, \"\").match(/.{1,3}/g);\r\n x.unshift(str);\r\n arr[0] = x.join(\",\");\r\n } else if (arr[0].length % 3 === 2) {\r\n var str = arr[0].substring(0, 2);\r\n var x = arr[0].replace(str, \"\").match(/.{1,3}/g);\r\n x.unshift(str);\r\n arr[0] = x.join(\",\");\r\n }\r\n return arr.join(\".\");\r\n}", "title": "" }, { "docid": "540b5844f1d7f3e1963ea398bee65471", "score": "0.6053397", "text": "function localizeNumberFilterDecimalSeparator() {\n var stringToFloat = function (value) {\n var filterText = value || null;\n if (filterText && filterText.trim() === '') {\n filterText = null;\n }\n var newFilter;\n if (filterText !== null && filterText !== undefined) {\n filterText = filterText.replace(',', '.');\n newFilter = parseFloat(filterText);\n }\n else {\n newFilter = null;\n }\n return newFilter;\n };\n // tslint:disable-next-line:no-string-literal\n ag_grid_community_1.NumberFilter.prototype['stringToFloat'] = stringToFloat;\n}", "title": "" }, { "docid": "b99425d1fb995bb2a7ba580cfd9d462d", "score": "0.60492975", "text": "function ffloat(n) {\n n = n + '';\n if (n.indexOf('.') !== -1) return n;\n if (n.indexOf('e') !== -1) return n;\n if (n.indexOf('E') !== -1) return n;\n return n + '.0';\n}", "title": "" }, { "docid": "e23be4a11e9c0c5b787895d2baf7b999", "score": "0.6041542", "text": "function number_format( number, decimals, dec_point, thousands_sep ) {\n var n = number, prec = decimals;\n n = !isFinite(+n) ? 0 : +n;\n prec = !isFinite(+prec) ? 0 : Math.abs(prec);\n var sep = (typeof thousands_sep == \"undefined\") ? ',' : thousands_sep;\n var dec = (typeof dec_point == \"undefined\") ? '.' : dec_point;\n\n var s = (prec > 0) ? n.toFixed(prec) : Math.round(n).toFixed(prec); //fix for IE parseFloat(0.55).toFixed(0) = 0;\n\n var abs = Math.abs(n).toFixed(prec);\n var _, i;\n\n if (abs >= 1000) {\n _ = abs.split(/\\D/);\n i = _[0].length % 3 || 3;\n\n _[0] = s.slice(0,i + (n < 0)) +\n _[0].slice(i).replace(/(\\d{3})/g, sep+'$1');\n\n s = _.join(dec);\n } else {\n s = s.replace('.', dec);\n }\n\n return s;\n}", "title": "" }, { "docid": "87813f6fd331d9d9447cc3832afb5163", "score": "0.60400426", "text": "function floatingPointFormatString() {\n return operator_1.pipe(string_1.toTrimmed(), string_1.match(FloatingPointUtil.floatingPointRegex, function (name) {\n return {\n message: name + \" must be valid floating point format string\",\n expected: \"valid floating point format string\",\n };\n }));\n}", "title": "" }, { "docid": "a96f9de3d254ddb58264e6b9c6b6561e", "score": "0.6034051", "text": "function numberWithComma(number){\r\n var parts = number.toString().split(\".\");\r\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\r\n return parts.join(\".\");\r\n}", "title": "" }, { "docid": "f7186317061dc3bfe5a2ecf3f8925679", "score": "0.60313267", "text": "function qd_number_format(b,c,d,e){b=(b+\"\").replace(/[^0-9+\\-Ee.]/g,\"\");b=isFinite(+b)?+b:0;c=isFinite(+c)?Math.abs(c):0;e=\"undefined\"===typeof e?\",\":e;d=\"undefined\"===typeof d?\".\":d;var a=\"\",a=function(a,b){var c=Math.pow(10,b);return\"\"+(Math.round(a*c)/c).toFixed(b)},a=(c?a(b,c):\"\"+Math.round(b)).split(\".\");3<a[0].length&&(a[0]=a[0].replace(/\\B(?=(?:\\d{3})+(?!\\d))/g,e));(a[1]||\"\").length<c&&(a[1]=a[1]||\"\",a[1]+=Array(c-a[1].length+1).join(\"0\"));return a.join(d)}", "title": "" }, { "docid": "f7186317061dc3bfe5a2ecf3f8925679", "score": "0.60313267", "text": "function qd_number_format(b,c,d,e){b=(b+\"\").replace(/[^0-9+\\-Ee.]/g,\"\");b=isFinite(+b)?+b:0;c=isFinite(+c)?Math.abs(c):0;e=\"undefined\"===typeof e?\",\":e;d=\"undefined\"===typeof d?\".\":d;var a=\"\",a=function(a,b){var c=Math.pow(10,b);return\"\"+(Math.round(a*c)/c).toFixed(b)},a=(c?a(b,c):\"\"+Math.round(b)).split(\".\");3<a[0].length&&(a[0]=a[0].replace(/\\B(?=(?:\\d{3})+(?!\\d))/g,e));(a[1]||\"\").length<c&&(a[1]=a[1]||\"\",a[1]+=Array(c-a[1].length+1).join(\"0\"));return a.join(d)}", "title": "" }, { "docid": "f7186317061dc3bfe5a2ecf3f8925679", "score": "0.60313267", "text": "function qd_number_format(b,c,d,e){b=(b+\"\").replace(/[^0-9+\\-Ee.]/g,\"\");b=isFinite(+b)?+b:0;c=isFinite(+c)?Math.abs(c):0;e=\"undefined\"===typeof e?\",\":e;d=\"undefined\"===typeof d?\".\":d;var a=\"\",a=function(a,b){var c=Math.pow(10,b);return\"\"+(Math.round(a*c)/c).toFixed(b)},a=(c?a(b,c):\"\"+Math.round(b)).split(\".\");3<a[0].length&&(a[0]=a[0].replace(/\\B(?=(?:\\d{3})+(?!\\d))/g,e));(a[1]||\"\").length<c&&(a[1]=a[1]||\"\",a[1]+=Array(c-a[1].length+1).join(\"0\"));return a.join(d)}", "title": "" }, { "docid": "f7186317061dc3bfe5a2ecf3f8925679", "score": "0.60313267", "text": "function qd_number_format(b,c,d,e){b=(b+\"\").replace(/[^0-9+\\-Ee.]/g,\"\");b=isFinite(+b)?+b:0;c=isFinite(+c)?Math.abs(c):0;e=\"undefined\"===typeof e?\",\":e;d=\"undefined\"===typeof d?\".\":d;var a=\"\",a=function(a,b){var c=Math.pow(10,b);return\"\"+(Math.round(a*c)/c).toFixed(b)},a=(c?a(b,c):\"\"+Math.round(b)).split(\".\");3<a[0].length&&(a[0]=a[0].replace(/\\B(?=(?:\\d{3})+(?!\\d))/g,e));(a[1]||\"\").length<c&&(a[1]=a[1]||\"\",a[1]+=Array(c-a[1].length+1).join(\"0\"));return a.join(d)}", "title": "" }, { "docid": "c10690a9adf0738e4f0f6c0c156d38c0", "score": "0.6013625", "text": "function formatNumber (num) {\n \t\t\t\t\t\treturn num.toString().replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, \"$1,\");\n\t\t\t\t\t\t}", "title": "" }, { "docid": "06a0ae7c6490852fa47efdb19b008775", "score": "0.60107464", "text": "function numberWithCommas(x) {//thanks Elias Zamaria from SO\n return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/, \",\");\n}", "title": "" }, { "docid": "50a591570a722e9a73f561dc4dd3723f", "score": "0.6003555", "text": "function formatNum(x) {\n x=parseFloat(x);\n x = x.toFixed(2);\n return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n }", "title": "" }, { "docid": "67ecbe1fd87ac5fa29bc2756c46557e5", "score": "0.6001698", "text": "function formatNumber(n) {\n // only attempt conversion if n is numberic\n if (n != \"\" && !isNaN(Number(n))){\n var t = Math.abs(parseFloat(n));\n if (t == 0)\n return n;\n else if (t < 0.01)\n return t.toExponential();\n else {\n // treat pre and post differently\n var n= (Math.round(t * 100) / 100).toString().split(\".\");\n // add comma to decimal positions only\n n[0] = n[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n //Combine both sections again\n return n.join(\".\");\n }\n } else\n return n;\n}", "title": "" }, { "docid": "6b3da03c0d65a04321d4264bf65fc2c3", "score": "0.59958076", "text": "stripFloat(currency) {\n let partcurr = '';\n if (currency.length >= 9) partcurr = currency.split('\\n')[0];\n else partcurr = currency;\n partcurr = partcurr.substring(1, partcurr.length);\n partcurr = partcurr.replace(',', '');\n console.log(`>${parseFloat(partcurr)}`);\n return parseFloat(partcurr);\n }", "title": "" }, { "docid": "a21e7446ff9b31174f7e7b08b1c7d8ac", "score": "0.5985976", "text": "function numberWithCommas (x) {\n\t return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n\t}", "title": "" }, { "docid": "20d74cd9196670872a546901fc591ebc", "score": "0.5981189", "text": "function commaIt(number, options) {\n //Set up default seperators\n addPrecision = (options && options['addPrecision'] || false);\n thousandSeperator = (options && options['thousandSeperator'] || ' ');\n decimalSeperator = (options && options['decimalSeperator'] || ',');\n var replacmentRegex = '$1' + thousandSeperator;\n\n //Conversion to string and default return managment\n number = number.toString();\n if(number.length === 0) return '0' + decimalSeperator + '00';\n\n //Actual parsing of two side of the number\n var amount = number.split(decimalSeperator)[0];\n var floats = addPrecision ? (decimalSeperator + ((number.split(decimalSeperator)[1] || '') + '00').substr(0, 2)) : '';\n var numberified = amount.split('').reverse().join('').replace(/(\\d{3}(?!$))/g, replacmentRegex).split('').reverse().join('');\n\n return numberified + floats;\n}", "title": "" }, { "docid": "b0724962177da587873039db7c198d91", "score": "0.5970678", "text": "function numberWithCommas(x) {\n x = Math.round(x)\n return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n}", "title": "" }, { "docid": "80e0d81135052fe1b332af69d01f4acf", "score": "0.5959134", "text": "function formatNumber(number) {\n var num_parts = number.toString().split(\".\");\n num_parts[0] = num_parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n return num_parts.join(\".\");\n}", "title": "" }, { "docid": "4f807e054bae72212dd2c87b8cb7c7ca", "score": "0.59509605", "text": "function numberWithCommas(number) {\n var parts = number.toString().split(\".\");\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n return parts.join(\".\");\n }", "title": "" }, { "docid": "8c112a67f4d24222614281c556cc07e9", "score": "0.59491926", "text": "function addCommas(nStr) {\r\n // nStr += '';\r\n // var x = nStr.split('.');\r\n // var x1 = x[0];\r\n // var x2 = x.length > 1 ? '.' + x[1] : '';\r\n // var rgx = /(\\d+)(\\d{3})/;\r\n // while (rgx.test(x1)) {\r\n // x1 = x1.replace(rgx, \"$1\" + ',' + \"$2\");\r\n // }\r\n // return parseFloat(x1 + x2).toFixed(2);\r\n\r\n var formatted = parseFloat(nStr).toFixed(2).replace(/./g, function(c, i, a) {\r\n return i && c !== \".\" && ((a.length - i) % 3 === 0) ? ',' + c : c;\r\n });\r\n var splitval = formatted.split('.');\r\n return parseInt(splitval[1]) > 0 ? formatted : splitval[0];\r\n}", "title": "" }, { "docid": "79cda81a5fcbbdaf0964d9079f468bc4", "score": "0.59484506", "text": "function formatNum(x) {\n x = x.toFixed(2);\n return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n }", "title": "" }, { "docid": "051e576da3f5497db983a8cd3a2749ea", "score": "0.5944434", "text": "function numberWithCommas(number) {\n var parts = number.toString().split(\".\");\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n return parts.join(\".\");\n }", "title": "" }, { "docid": "e4a866f44275a1033835827e72d9574f", "score": "0.5943546", "text": "function numberWithCommas(x) {\n return x\n .toFixed(2)\n .toString()\n .replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n}", "title": "" }, { "docid": "ed91d3a60e0344589bc770d311cec546", "score": "0.59418243", "text": "function formatValue0(v){\n var a = v.toLocaleString(\"pt\", {maximumFractionDigits: 2});//this thing here do all the trick for us\n if(a == \"70.000\" || a == \"6.000\"){\n return a+\",00\";\n }else{\n var array = a.split(\",\");\n if(array[1].length < 2)\n return a+\"0\";\n else \n return a;\n }\n}", "title": "" }, { "docid": "d1f0c12fcd48c7b219e0834d7bf232a2", "score": "0.59363014", "text": "function comma_formatter(value) {\n\tvar nf = new Intl.NumberFormat();\n\treturn nf.format(value);\n}", "title": "" }, { "docid": "3974028ed92b928515c16868a06ec012", "score": "0.5924648", "text": "function commafy(n) {\n var n = n || 0;\n n = ('' + n).split('.').map(function(s, i) {\n return i ? s : s.replace(/(\\d)(?=(?:\\d{3})+$)/g, '$1,')\n }).join('.');\n return n;\n}", "title": "" }, { "docid": "989ca890ecd2c4732a13a40fc115996f", "score": "0.59225285", "text": "function formatWithCommas(num) {\n return num.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n }", "title": "" }, { "docid": "ddd76bc5b23ecdb8e3bd12c7e985a3ea", "score": "0.5911666", "text": "function util_insertComma(value) {\r\n\t\r\n\t\r\n\tif (value == '') return value;\r\n\r\n\tvalue = parseFloat(value, 10).toString()\r\n\twhile (true) {\r\n\r\n\t\tif (value.indexOf(caliberPoint) != -1)\r\n\t\t\tidx = value.search(new RegExp(\"[^,\\.\\-]([0-9]{3})+\" + caliberPoint));\r\n\t\telse\r\n\t\t\tidx = value.search(new RegExp(\"[^,\\.\\-]([0-9]{3})+$\"));\r\n\t\tif (idx == -1) break;\r\n\t\t\tvalue = value.substring(0, idx+1) + caliberSeparater + value.substring(idx+1, value.length);\r\n\t}\r\n\t\r\n\treturn value;\r\n}", "title": "" }, { "docid": "4aa3d7ea402d40232ac846e43543a148", "score": "0.5901412", "text": "function fFormatMoney(dValue, ShowComma) {\r\n var ReturnValue = \"\";\r\n var TempValue = \"\";\r\n var j = 0;\r\n var AddComma = 0;\r\n\r\n if (dValue > 0) {\r\n var iRemainder = dValue - Math.floor(dValue);\r\n\r\n /* FORMAT decimals */\r\n if (iRemainder == 0)\r\n { dValue = dValue + '.00'; }\r\n else {\r\n iRemainder = (dValue * 10) - Math.floor(dValue * 10);\r\n if (iRemainder == 0)\r\n { dValue = dValue + '0'; }\r\n }\r\n\r\n /* FORMAT WITH COMMA SEPERATOR*/\r\n if (ShowComma == 1) {\r\n TempValue = dValue + '';\r\n for (var i = TempValue.length; i >= 0; i--) {\r\n if (TempValue.charAt(i) == \".\") {\r\n AddComma = 1;\r\n j = -1;\r\n }\r\n\r\n if ((j == 3) && (AddComma == 1)) {\r\n ReturnValue = \",\" + ReturnValue;\r\n j = 0;\r\n }\r\n\r\n ReturnValue = TempValue.charAt(i) + ReturnValue;\r\n j = j + 1;\r\n }\r\n }\r\n else\r\n { ReturnValue = dValue; }\r\n\r\n return ReturnValue;\r\n }\r\n else\r\n { return \"0.00\"; }\r\n}", "title": "" }, { "docid": "dd1e776007e4bc6f5f5fdd90353eb392", "score": "0.5893513", "text": "function makeFloat(n) {\n n += (n.toString().indexOf('.') == -1) ? \".0\" : \"\";\n return n;\n }", "title": "" }, { "docid": "0a2df1119beca8147142a6e2f837dd09", "score": "0.58923215", "text": "function formatComma(param) {\r\n var sysData = numeral(param).format(\"0,0\");\r\n return sysData;\r\n}", "title": "" }, { "docid": "81cefaac2b20b0e0d4645fe0c06811de", "score": "0.58871675", "text": "function AjustaDecimal(valor) {\n return valor.replace(\",\",\".\")\n}", "title": "" }, { "docid": "fe47229b1dfaf87e6e5ccfff2b0ec3ae", "score": "0.5886468", "text": "function numberWithCommas(x) {\n return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n }", "title": "" }, { "docid": "8aa00f881277197622bc932711e1324f", "score": "0.58856684", "text": "function round2comma(calc) {\n\t\taftercom = 2;\n\t\tif (aftercom < 1 || aftercom > 14) return false;\n\t\tvar e = Math.pow(10, aftercom);\n\t\tvar k = (Math.round(calc * e) / e).toString();\n\t\tif (k.indexOf('.') == -1) k += '.';\n\t\tk += e.toString().substring(1);\n\t\treturn k.substring(0, k.indexOf('.') + aftercom + 1);\n\t}", "title": "" }, { "docid": "20639531101687e44b1e53232bd5f798", "score": "0.58824086", "text": "function formatWithCommas(value) {\n const pattern = /(-?\\d+)(\\d{3})/;\n\n while (pattern.test(value)) {\n value = value.replace(pattern, '$1,$2');\n }\n\n return value;\n }", "title": "" }, { "docid": "edd9f0f6681da90dd50802c7e47be62c", "score": "0.58798987", "text": "formatNumber(str) {\n var string = str.toString();\n while (string.search(\",\") >= 0) {\n string = (string + \"\").replace(\",\", \"\");\n }\n return parseFloat(string);\n }", "title": "" }, { "docid": "85eaac5973b63363d3f8a7dd570c0ff9", "score": "0.5879011", "text": "function numberWithCommas(x){\r\n return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\r\n}", "title": "" }, { "docid": "35b7e7ac444d5dc8e3761b1ead034944", "score": "0.586843", "text": "function numberWithCommas(n) {\r\n var parts = n.toString().split(\".\");\r\n return parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\") + (parts[1] ? \".\" + parts[1] : \"\");\r\n }", "title": "" }, { "docid": "c26d47db555e148d6501294b43e5e4f5", "score": "0.5863981", "text": "function formatWithCommas(value) {\n const pattern = /(-?\\d+)(\\d{3})/;\n while (pattern.test(value)) {\n value = value.replace(pattern, '$1,$2');\n }\n return value;\n}", "title": "" }, { "docid": "dff5a941f40a2915df7fc84372b0556f", "score": "0.5861316", "text": "function number_format(number, decimal_places, dec_seperator, thou_seperator) {\n // Init defaults.\n if (typeof decimal_places === 'undefined') decimal_places = 0;\n if (typeof dec_seperator === 'undefined') dec_seperator = '.';\n if (typeof thou_seperator === 'undefined') thou_seperator = ',';\n\n number = Math.round(number * Math.pow(10, decimal_places)) / Math.pow(10, decimal_places);\n let e = number + '';\n let f = e.split('.');\n if (!f[0]) {\n f[0] = '0';\n }\n if (!f[1]) {\n f[1] = '';\n }\n if (f[1].length < decimal_places) {\n let g = f[1];\n for (let i = f[1].length + 1; i <= decimal_places; i++) {\n g += '0';\n }\n f[1] = g;\n }\n if (thou_seperator != '' && f[0].length > 3) {\n let h = f[0];\n f[0] = '';\n for (let j = 3; j < h.length; j += 3) {\n let i = h.slice(h.length - j, h.length - j + 3);\n f[0] = thou_seperator + i + f[0] + '';\n }\n let j = h.substr(0, (h.length % 3 == 0) ? 3 : (h.length % 3));\n f[0] = j + f[0];\n }\n dec_seperator = (decimal_places <= 0) ? '' : dec_seperator;\n return f[0] + dec_seperator + f[1];\n}", "title": "" }, { "docid": "64b2160c02c753c15dd661bba40872eb", "score": "0.5860591", "text": "function number_format(number, decimal_places, dec_seperator, thou_seperator) {\n // Init defaults.\n if (typeof decimal_places === 'undefined') decimal_places = 0;\n if (typeof dec_seperator === 'undefined') dec_seperator = '.';\n if (typeof thou_seperator === 'undefined') thou_seperator = ',';\n\n number = Math.round(number * Math.pow(10, decimal_places)) / Math.pow(10, decimal_places);\n let e = number + '';\n let f = e.split('.');\n if (!f[0]) {\n f[0] = '0';\n }\n if (!f[1]) {\n f[1] = '';\n }\n if (f[1].length < decimal_places) {\n let g = f[1];\n for (let i=f[1].length + 1; i <= decimal_places; i++) {\n g += '0';\n }\n f[1] = g;\n }\n if(thou_seperator != '' && f[0].length > 3) {\n let h = f[0];\n f[0] = '';\n for(let j = 3; j < h.length; j+=3) {\n let i = h.slice(h.length - j, h.length - j + 3);\n f[0] = thou_seperator + i + f[0] + '';\n }\n let j = h.substr(0, (h.length % 3 == 0) ? 3 : (h.length % 3));\n f[0] = j + f[0];\n }\n dec_seperator = (decimal_places <= 0) ? '' : dec_seperator;\n return f[0] + dec_seperator + f[1];\n}", "title": "" }, { "docid": "e8c573289cadbc1bd7f2b566e8ced16f", "score": "0.58592945", "text": "function formatDec(val,sig) {\r\n var r = \"\";\r\n var pointIndex = (val+\"\").indexOf(\".\");\r\n if(pointIndex >0) {\r\n if(sig==null) {\r\n sig = 0;\r\n }\r\n r = (val+\"\").substring(0,(pointIndex-(-sig-1)));\r\n } else {\r\n r = val;\r\n }\r\n return r;\r\n}", "title": "" }, { "docid": "9a9d1f7d45868eeb96dff3631c00dfad", "score": "0.5858865", "text": "function numberWithCommas(x) {\n return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n }", "title": "" }, { "docid": "9a9d1f7d45868eeb96dff3631c00dfad", "score": "0.5858865", "text": "function numberWithCommas(x) {\n return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n }", "title": "" }, { "docid": "9a9d1f7d45868eeb96dff3631c00dfad", "score": "0.5858865", "text": "function numberWithCommas(x) {\n return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n }", "title": "" }, { "docid": "87f91f3ca0b880ac95637fb7936caf30", "score": "0.58569723", "text": "function numberWithCommas(x) {\r\n return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\r\n }", "title": "" }, { "docid": "ef620632b55908fced52a67275c72acd", "score": "0.5854867", "text": "function numberWithCommas(x)\n{\n return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n}", "title": "" }, { "docid": "774c700fcd26cbe9849c65a0aa96602f", "score": "0.5850966", "text": "function number_format( numero, decimal, decimal_separador, milhar_separador ){\t\n numero = (numero + '').replace(/[^0-9+\\-Ee.]/g, '');\n var n = !isFinite(+numero) ? 0 : +numero,\n prec = !isFinite(+decimal) ? 0 : Math.abs(decimal),\n sep = (typeof milhar_separador === 'undefined') ? ',' : milhar_separador,\n dec = (typeof decimal_separador === 'undefined') ? '.' : decimal_separador,\n s = '',\n toFixedFix = function (n, prec) {\n var k = Math.pow(10, prec);\n return '' + Math.round(n * k) / k;\n };\n // Fix para IE: parseFloat(0.55).toFixed(0) = 0;\n s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');\n if (s[0].length > 3) {\n s[0] = s[0].replace(/\\B(?=(?:\\d{3})+(?!\\d))/g, sep);\n }\n if ((s[1] || '').length < prec) {\n s[1] = s[1] || '';\n s[1] += new Array(prec - s[1].length + 1).join('0');\n }\n\n return s.join(dec);\n}", "title": "" }, { "docid": "774c700fcd26cbe9849c65a0aa96602f", "score": "0.5850966", "text": "function number_format( numero, decimal, decimal_separador, milhar_separador ){\t\n numero = (numero + '').replace(/[^0-9+\\-Ee.]/g, '');\n var n = !isFinite(+numero) ? 0 : +numero,\n prec = !isFinite(+decimal) ? 0 : Math.abs(decimal),\n sep = (typeof milhar_separador === 'undefined') ? ',' : milhar_separador,\n dec = (typeof decimal_separador === 'undefined') ? '.' : decimal_separador,\n s = '',\n toFixedFix = function (n, prec) {\n var k = Math.pow(10, prec);\n return '' + Math.round(n * k) / k;\n };\n // Fix para IE: parseFloat(0.55).toFixed(0) = 0;\n s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');\n if (s[0].length > 3) {\n s[0] = s[0].replace(/\\B(?=(?:\\d{3})+(?!\\d))/g, sep);\n }\n if ((s[1] || '').length < prec) {\n s[1] = s[1] || '';\n s[1] += new Array(prec - s[1].length + 1).join('0');\n }\n\n return s.join(dec);\n}", "title": "" }, { "docid": "c0cd719affda1aa509676abd2b83c916", "score": "0.58465874", "text": "function converteFloatMoeda(valor) {\n var inteiro = null, decimal = null, c = null, j = null;\n var aux = new Array();\n valor = \"\" + valor;\n c = valor.indexOf(\".\", 0);\n //encontrou o ponto na string\n if (c > 0) {\n //separa as partes em inteiro e decimal\n inteiro = valor.substring(0, c);\n decimal = valor.substring(c + 1, valor.length);\n } else {\n inteiro = valor;\n }\n\n //pega a parte inteiro de 3 em 3 partes\n for (j = inteiro.length, c = 0; j > 0; j -= 3, c++) {\n aux[c] = inteiro.substring(j - 3, j);\n }\n\n //percorre a string acrescentando os pontos\n inteiro = \"\";\n for (c = aux.length - 1; c >= 0; c--) {\n inteiro += aux[c] + '.';\n }\n //retirando o ultimo ponto e finalizando a parte inteiro\n\n inteiro = inteiro.substring(0, inteiro.length - 1);\n\n decimal = parseInt(decimal);\n if (isNaN(decimal)) {\n decimal = \"00\";\n } else {\n decimal = \"\" + decimal;\n if (decimal.length === 1) {\n decimal = decimal + \"0\";\n }\n }\n\n\n valor = inteiro + \",\" + decimal;\n\n\n return valor;\n\n}", "title": "" }, { "docid": "27172293144ec1b743bbf57fd321a133", "score": "0.58431214", "text": "function numberWithCommas(x) {\n\t\t\t return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n\t\t\t}", "title": "" }, { "docid": "27172293144ec1b743bbf57fd321a133", "score": "0.58431214", "text": "function numberWithCommas(x) {\n\t\t\t return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n\t\t\t}", "title": "" }, { "docid": "1551f88efce10e95b8b0171f8ca8e694", "score": "0.5842524", "text": "function addCommas(val) {\n return val.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n }", "title": "" }, { "docid": "286997b52a8d0c2fe9d379de7120bb68", "score": "0.5836481", "text": "function formatNumber(value){ //data.cases adding format the number correctly\n return value.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\"); //Adding Commas to number\n}", "title": "" }, { "docid": "e9b794e6ebca08aacf1b0e5ebb8280d3", "score": "0.58342063", "text": "function formatDecimale(value, event) {\r\n\t// Compatibilit\\u00E9 IE / Firefox\r\n\tif (!event && window.event) {\r\n\t\tevent = window.event;\r\n\t}\r\n\r\n\t// alert(event.keyCode);\r\n\r\n\tif (event.keyCode == 44) {\r\n\t\tevent.keyCode = 46;\r\n\t}\r\n\r\n\tif (event.which == 44) {\r\n\t\tevent.which = 46;\r\n\t}\r\n\r\n\t// Pour ne pas saisir le point deux fois\r\n\t// IE\r\n\tif (event.keyCode == 46) {\r\n\t\tif (value.indexOf(\".\", 0) != -1 || value.length == 0) {\r\n\t\t\tevent.returnValue = false;\r\n\t\t\tevent.cancelBubble = true;\r\n\t\t}\r\n\t} else {\r\n\r\n\t\tif ((event.keyCode < 48 || event.keyCode > 57)) {\r\n\t\t\tevent.returnValue = false;\r\n\t\t\tevent.cancelBubble = true;\r\n\t\t}\r\n\t}\r\n\r\n\t// DOM\r\n\tif (event.which == 46) {\r\n\t\tif (value.indexOf(\".\", 0) != -1 || value.length == 0) {\r\n\t\t\tevent.preventDefault();\r\n\t\t\tevent.stopPropagation();\r\n\t\t}\r\n\t} else {\r\n\t\tif ((event.which < 48 || event.which > 57)) {\r\n\t\t\tevent.preventDefault();\r\n\t\t\tevent.stopPropagation();\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "c9fdd89b718073660ff0d3dadee69606", "score": "0.5827677", "text": "function numberWithCommas(x) {\r\n\treturn x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\r\n}", "title": "" }, { "docid": "a5346282c3af90e41ec7bb51dc830f5b", "score": "0.58132726", "text": "function removeCommas(nStr) {\n nStr = nStr.replace(/\\,/g,'');\n console.log(nStr);\n return parseFloat(nStr);\n}", "title": "" }, { "docid": "c0a04d11ba22d5ebf53ac888f1e5b2ed", "score": "0.58132136", "text": "function formatValue1(v){\n if(v[0] < 10000)\n return v[0][0]+'.'+v[0].substr(1,v[0].length)+\",\"+v[1];\n else if(v[0] < 100000)\n return v[0][0]+v[0][1]+'.'+v[0].substr(2, v[0].length)+\",\"+v[1]; \n}", "title": "" }, { "docid": "0df344730677ea6c79e012f39fd205e7", "score": "0.5810782", "text": "function numberWithCommas(x)\n\t\t\t{\n\t\t\t\treturn x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n\t\t\t}", "title": "" }, { "docid": "7690fdda027e8edae78ed9e98f9e3d04", "score": "0.5809214", "text": "function FormatNumber(arg)\n{\n\tvar retval = \"\";\n\tvar front = true;\n\tvar n = 0;\n\targ += '';\n\tfor (var i=0; i<arg.length; i++)\n\t{\n\t\tif ((arg.charAt(i)>='0' && arg.charAt(i)<='9') || arg.charAt(i)=='.')\n\t\t{\n\t\t\tif (front)\n\t\t\t{\n\t\t\t\tif (arg.charAt(i) == '0')\n\t\t\t\t\tcontinue;\n\t\t\t\telse\n\t\t\t\t\tfront = false;\n\t\t\t}\t\n\t\t\tretval += arg.charAt(i);\n\t\t}\n\t}\n\tretval = formatComma(roundToDecimal(retval,2)+'');\t\n\treturn retval;\n}", "title": "" }, { "docid": "cc089b24920eb763208132ed856715ad", "score": "0.5808715", "text": "function numberWithCommas(x) {\r\n\t\treturn x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\r\n\t}", "title": "" } ]
3d7fa02684abb84b2918625fa8e8510c
PASO 4: Reemplaza ModalTypes
[ { "docid": "8ace6fa4eb22c736d8d39487b1d8ee9b", "score": "0.0", "text": "function compararValoresyReemplaza() {\n for(var i=0; i < infoSkus.length; i++) {\n for(var j=0 ;j < dataSkus.length; j++) {\n if (infoSkus[i][0] == dataSkus[j][0]) {\n infoFinal.push([dataSkus[j], infoSkus[i][1]]);\n //console.log('el arr infoFinal es ' + infoFinal);\n putModalType(infoSkus[i][0], dataSkus[j], infoSkus[i][1], i);\n }\n }\n }\n}", "title": "" } ]
[ { "docid": "1c573b9bf8f4eb05ce53a042f59b6b70", "score": "0.66466486", "text": "renderTypeAModal() {\n return (\n <Modal\n isOpen={this.state.showTypeAModal}\n onRequestClose={this.handleCloseTypeAModal}\n style={customStyles}\n >\n <h2>Type A</h2>\n {/* TODO: */}\n </Modal>\n )\n }", "title": "" }, { "docid": "a070fdec1cab0463a44ca62ef5204612", "score": "0.64522815", "text": "renderTypeCModal() {\n return (\n <Modal\n isOpen={this.state.showTypeCModal}\n onRequestClose={this.handleCloseTypeCModal}\n style={customStyles}\n >\n <h2>Type C</h2>\n {/* TODO: */}\n </Modal>\n )\n }", "title": "" }, { "docid": "2d368b1be954a065070eb122a4484ac2", "score": "0.6363318", "text": "function ShowAddMaintenanceTypeModal(type, indexPos) {\n jQuery.AddEquipmentNamespace.SelectedMasterDataType = type;\n BindMasterDataInfo();\n ClearMaintenanceTypeInfo(false);\n var btnAddMaintType = jQuery.AddEquipmentNamespace.MaintTypePagerData.LoadControlID.replace(\"divModelInfo\", \"btnAddMaintType\");\n jQuery(\"#\" + btnAddMaintType).text(languageResource.resMsg_Add);\n if (jQuery(\"#iconViewintTypes\").hasClass(\"fa fa-minus-circle\")) {\n jQuery(\"#iconViewintTypes\").removeClass(\"fa fa-minus-circle\");\n jQuery(\"#iconViewintTypes\").addClass(\"fa fa-plus-circle\");\n }\n var btnShowAll = \"btnShowAll\";\n jQuery(\"#\" + btnShowAll).addClass('hide');\n jQuery(\"#iconViewMaintTypes\").removeClass(\"fa fa-minus-circle\");\n jQuery(\"#iconViewMaintTypes\").addClass(\"fa fa-plus-circle\");\n jQuery(\"#divMaintTypes\").addClass(\"hide\");\n jQuery(\"#divAddMaintenanceMasterDataModal\").modal(\"show\");\n //modal focus\n var modalDivId = jQuery(\"#divAddMaintenanceMasterDataModal\")\n modalVisible(modalDivId);\n}", "title": "" }, { "docid": "530468023fbdab9570e89e5f19704ba2", "score": "0.6360183", "text": "openRepoTypeModal() {\n this.$repoTypeScope = this.$scope.$new();\n this.$repoTypeScope.packageTypes = this.getPackageType();\n this.$repoTypeScope.closeModal = () => this.closeModalPackageType();\n this.$repoTypeScope.modalClose = ()=> this.modalClose();\n this.$repoTypeScope.selectRepoType = (type)=>this.selectRepoType(type);\n this.isTypeModalOpen = true;\n\n this.repoTypeModal = this.modal.launchModal('repository_type_modal', this.$repoTypeScope)\n this.repoTypeModal.result.finally(() => this.isTypeModalOpen = false);\n }", "title": "" }, { "docid": "22d96f459bd392a457ef1d91c33e0cdc", "score": "0.6234978", "text": "getValuesOf(modalType) {\n const options = {\n add: {\n description: Form.descriptionField.value,\n amount: Form.amountField.value,\n date: Form.dateField.value,\n },\n edit: {\n id: Form.indexEditField.value,\n description: Form.descriptionEditField.value,\n amount: Form.amountEditField.value,\n date: Form.dateEditField.value,\n },\n filter: {\n initialDate: Form.initialDateFilter.value,\n finalDate: Form.finalDateFilter.value,\n transactionTypeFilter: Form.transactionTypeFilter.value,\n },\n };\n\n return options[modalType];\n }", "title": "" }, { "docid": "84d8a6f337108a98ed89dc36dbf55320", "score": "0.6206984", "text": "function isModalTypeOf(testedType)\n{\n\tvar margeAerationPackHauteurMenuBtn = tbInfAbtCtBx['widthHeightMenuBtn'] + tbInfAbtCtBx['margnTopBotMenuBtn'] * 2;\n\tvar margeAerationPackLargeurMenuBtn = tbInfAbtCtBx['widthHeightMenuBtn'] + tbInfAbtCtBx['margnLftRgtMenuBtn'] * 2;\n\n\tvar smallHoriSuppMarge = tbInfAbtCtBx['screenWidth'] * 1.03 - tbInfAbtCtBx['screenWidth']; if(smallHoriSuppMarge > 10){smallHoriSuppMarge = 10;}\n\tvar bigHoriSuppMarge = tbInfAbtCtBx['screenWidth'] * 1.05 - tbInfAbtCtBx['screenWidth']; if(bigHoriSuppMarge > 20){bigHoriSuppMarge = 20;}\n\n\tvar margeAeration10px = 10;\n\n\tvar hauteurColInfosAbtCity, largeurColInfosAbtCity, hauteurDispo, hauteurDispoAcBtnMenu, largeurDisponible, largeurDisponibleAcBtnMenu ;\n\n\n\n\tif(testedType == \"completeLandscapeCnttBased\")\n\t{\n\t\t// si la box du lien \"Bordeaux\" n'est pas extensible en largeur, ou que le lien Bdx a dû passer sur une 2e ligne par manque de place en largeur\n\t\tif(!isBdxLinkExtensible(false) || parseInt($(\".bordeauxLink\").offset().top) > (parseInt($(\".statusFrontDev\").offset().top)+10) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar neededYSpceByMenuBtn = tbInfAbtCtBx['widthHeightMenuBtn'] + tbInfAbtCtBx['margnTopBotMenuBtn'] * 2;\n\n\t\t\tvar tempDisplayProp = $(\".wrapperBoxCityMeteoInfo\").css(\"display\");\n\t\t\tvar tempOpacProp = $(\".wrapperBoxCityMeteoInfo\").css(\"opacity\");\n\t\t\t$(\".wrapperBoxCityMeteoInfo\").css({\"display\": \"block\", \"opacity\":0});\n\t\t\tvar bdxCityBoxOffsetTop = parseInt($(\".wrapperBoxCityMeteoInfo\").offset().top);\n\t\t\tvar navBdxCityBoxOffsetTop = parseInt($(\".btnNavAboutCityBox\").offset().top);\n\t\t\t$(\".wrapperBoxCityMeteoInfo\").css({\"display\": tempDisplayProp, \"opacity\": tempOpacProp});\n\n\t\t\t// S'il n'y a pas suffisament de place au-dessus des box About City pour le btn Menu, il doit y avoir assez de place sur la droite !\n\t\t\tif(bdxCityBoxOffsetTop < neededYSpceByMenuBtn)\n\t\t\t{\n\t\t\t\t// S'il n'y a pas assez de place pour le btn Menu sur la droite...\n\t\t\t\tif(!isBdxLinkExtensible(true) || navBdxCityBoxOffsetTop < 30)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//console.log(\"|||||||FORMAT||||||| => completeLandscapeCnttBased\");\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//console.log(\"|||||||FORMAT||||||| => completeLandscapeCnttBased\");\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\telse if(testedType == \"completeLandscapeVwptBased\")\n\t{\n\t\t/*\n\n\t\ttbInfAbtCtBx['screenWidth'] = $(window).width();\n\ttbInfAbtCtBx['screenHeight'] = $(window).height();\n\n\ttbInfAbtCtBx['widthHeightMenuBtn'] = $(\".menuBtn\").width();\n\ttbInfAbtCtBx['margnLftRgtMenuBtn'] = parseInt($(\".menuBtn\").css(\"right\"));\n\ttbInfAbtCtBx['margnTopBotMenuBtn'] = parseInt($(\".menuBtn\").css(\"top\"));\n\n\n\n\tvar tempDisplayProp = $(\".wrapperBoxCityMeteoInfo\").css(\"display\");\n\tvar tempOpacProp = $(\".wrapperBoxCityMeteoInfo\").css(\"opacity\");\n\t$(\".wrapperBoxCityMeteoInfo\").css({\"display\": \"block\", \"opacity\":0});\n\n\ttbInfAbtCtBx['widthWrapBxCitMetInfPartSup'] = parseInt(widthCityTextBox);\n\ttbInfAbtCtBx['heightWrapBxCitMetInfPartSup'] = parseInt($(\".wrapperBoxCityMeteoInfo\").outerHeight()) + parseInt($(\".btnNavAboutCityBox\").outerHeight()) + parseInt($(\".cityTagsList\").outerHeight());\n\n\ttbInfAbtCtBx['widthWrapBxCitMetInfPartInf'] = parseInt($(\".todayCityBox\").outerWidth());\n\ttbInfAbtCtBx['heightWrapBxCitMetInfPartInf'] = parseInt($(\".bdxByTitle\").outerHeight()) + parseInt($(\".bdxByTitle\").css(\"margin-bottom\")) + ( (parseInt($(\".aboutBdxWebsite\").eq(0).outerHeight()) + parseInt($(\".aboutBdxWebsite\").eq(0).css(\"margin-bottom\"))) * 4 ) + 20; // il y a 4 liens / avec 20, une marge non récupérable défini via une propriété bottom:-xpx en CSS...\n\n\n\t\t\t*/\n\n\t\thauteurColInfosAbtCity = tbInfAbtCtBx['heightWrapBxCitMetInfPartSup'] + tbInfAbtCtBx['heightWrapBxCitMetInfPartInf'];\n\t\tlargeurColInfosAbtCity = tbInfAbtCtBx['widthWrapBxCitMetInfPartSup'];\n\t\thauteurDispo = tbInfAbtCtBx['screenHeight'] - hauteurColInfosAbtCity - margeAeration10px * 2;\n\t\thauteurDispoAcBtnMenu = tbInfAbtCtBx['screenHeight'] - hauteurColInfosAbtCity - margeAerationPackHauteurMenuBtn - margeAerationPackHauteurMenuBtn / 2;\n\t\tlargeurDisponible = tbInfAbtCtBx['screenWidth'] - largeurColInfosAbtCity * 2 - bigHoriSuppMarge * 2 - smallHoriSuppMarge;\n\t\tlargeurDisponibleAcBtnMenu = tbInfAbtCtBx['screenWidth'] - largeurColInfosAbtCity * 2 - margeAerationPackLargeurMenuBtn * 2 - smallHoriSuppMarge;\n\t\t/*\n\t\tconsole.log(\" /- hauteurColInfosAbtCity : \"+hauteurColInfosAbtCity);\n\t\tconsole.log(\" /- largeurColInfosAbtCity : \"+largeurColInfosAbtCity);\n\t\tconsole.log(\" /- hauteurDispo : \"+hauteurDispo);\n\t\tconsole.log(\" /- hauteurDispoAcBtnMenu : \"+hauteurDispoAcBtnMenu);\n\t\tconsole.log(\" /- largeurDisponible : \"+largeurDisponible);\n\t\tconsole.log(\" /- largeurDisponibleAcBtnMenu : \"+largeurDisponibleAcBtnMenu);*/\n\n\n\t\tif( hauteurDispo < 0 || largeurDisponible < 0 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse if( hauteurDispoAcBtnMenu < 0 && largeurDisponibleAcBtnMenu < 0 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//console.log(\"|||||||FORMAT||||||| => completeLandscapeVwptBased\");\n\t\t\treturn true;\n\t\t}\n\t}\n\telse if(testedType == \"square\")\n\t{\n\t\thauteurColInfosAbtCity = tbInfAbtCtBx['heightWrapBxCitMetInfPartSup'];\n\t\tlargeurColInfosAbtCity = tbInfAbtCtBx['widthWrapBxCitMetInfPartSup'] + tbInfAbtCtBx['widthWrapBxCitMetInfPartInf'] + smallHoriSuppMarge;\n\t\thauteurDispo = tbInfAbtCtBx['screenHeight'] - hauteurColInfosAbtCity * 2 - margeAeration10px * 2 - smallHoriSuppMarge;\n\t\thauteurDispoAcBtnMenu = tbInfAbtCtBx['screenHeight'] - hauteurColInfosAbtCity * 2 - margeAeration10px * 2 - smallHoriSuppMarge - margeAerationPackHauteurMenuBtn - margeAerationPackHauteurMenuBtn / 2;\n\t\tlargeurDisponible = tbInfAbtCtBx['screenWidth'] - largeurColInfosAbtCity - bigHoriSuppMarge * 2;\n\t\tlargeurDisponibleAcBtnMenu = tbInfAbtCtBx['screenWidth'] - largeurColInfosAbtCity - bigHoriSuppMarge * 2 - margeAerationPackLargeurMenuBtn * 2;\n\n\t\tif( hauteurDispo < 0 || largeurDisponible < 0 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse if( hauteurDispoAcBtnMenu < 0 && largeurDisponibleAcBtnMenu < 0 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//console.log(\"|||||||FORMAT||||||| => square\");\n\t\t\treturn true;\n\t\t}\n\t}\n\telse if(testedType == \"partialLandscape\")\n\t{\n\t\thauteurColInfosAbtCity = tbInfAbtCtBx['heightWrapBxCitMetInfPartSup'];\n\t\tlargeurColInfosAbtCity = tbInfAbtCtBx['widthWrapBxCitMetInfPartSup'];\n\t\thauteurDispo = tbInfAbtCtBx['screenHeight'] - hauteurColInfosAbtCity - margeAeration10px * 2;\n\t\thauteurDispoAcBtnMenu = tbInfAbtCtBx['screenHeight'] - hauteurColInfosAbtCity - margeAerationPackHauteurMenuBtn - margeAerationPackHauteurMenuBtn / 2;\n\t\tlargeurDisponible = tbInfAbtCtBx['screenWidth'] - largeurColInfosAbtCity * 2 - bigHoriSuppMarge * 2 - smallHoriSuppMarge;\n\t\tlargeurDisponibleAcBtnMenu = tbInfAbtCtBx['screenWidth'] - largeurColInfosAbtCity * 2 - margeAerationPackLargeurMenuBtn * 2;\n\n\t\tif( hauteurDispo < 0 || largeurDisponible < 0 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse if( hauteurDispoAcBtnMenu < 0 && largeurDisponibleAcBtnMenu < 0 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//console.log(\"|||||||FORMAT||||||| => partialLandscape\");\n\t\t\treturn true;\n\t\t}\n\t}\n\t/*else if(testedType == \"completePortrait\")\n\t{\n\t}*/\n\telse if(testedType == \"partialPortrait\")\n\t{\n\t\thauteurColInfosAbtCity = tbInfAbtCtBx['heightWrapBxCitMetInfPartSup'];\n\t\tlargeurColInfosAbtCity = tbInfAbtCtBx['widthWrapBxCitMetInfPartSup'];\n\t\thauteurDispo = tbInfAbtCtBx['screenHeight'] - hauteurColInfosAbtCity * 2 - margeAeration10px * 2 - smallHoriSuppMarge;\n\t\thauteurDispoAcBtnMenu = tbInfAbtCtBx['screenHeight'] - hauteurColInfosAbtCity * 2 - margeAeration10px * 2 - smallHoriSuppMarge - margeAerationPackHauteurMenuBtn - margeAerationPackHauteurMenuBtn / 2;\n\t\tlargeurDisponible = tbInfAbtCtBx['screenWidth'] - largeurColInfosAbtCity - bigHoriSuppMarge * 2;\n\t\tlargeurDisponibleAcBtnMenu = tbInfAbtCtBx['screenWidth'] - largeurColInfosAbtCity - margeAerationPackLargeurMenuBtn * 2;\n\n\n\n\n\t\tif( (tbInfAbtCtBx['screenWidth'] - largeurColInfosAbtCity) < 0 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse if( (tbInfAbtCtBx['screenHeight'] - hauteurColInfosAbtCity*2 ) < 0 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//console.log(\"|||||||FORMAT||||||| => partialPortrait\");\n\t\t\treturn true;\n\t\t}\n\t}\n\telse\n\t{\n\t\t//console.log(\"|||||||FORMAT||||||| => aucun / bloquage du lien / fermeture de la modal si ouverte\");\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "6564c32f84f10cc792f0ef200e104685", "score": "0.61743915", "text": "renderTypeDModal() {\n return (\n <Modal\n isOpen={this.state.showTypeDModal}\n onRequestClose={this.handleCloseTypeDModal}\n style={customStyles}\n >\n <h2>Type D</h2>\n {/* TODO: */}\n </Modal>\n )\n }", "title": "" }, { "docid": "af8bdef78e4e0ab3be68e31d4dfa5f02", "score": "0.61217654", "text": "renderTypeBModal() {\n return (\n <Modal\n isOpen={this.state.showTypeBModal}\n onRequestClose={this.handleCloseTypeBModal}\n style={customStyles}\n >\n <h2>Type B</h2>\n {/* TODO: */}\n </Modal>\n )\n }", "title": "" }, { "docid": "8c64e67e4cebdec75ba83ac4dcb19e71", "score": "0.60337996", "text": "function ShowAddMaintenanceTypeModal(type, indexPos) {\n jQuery.TaskGroupInfoNameSpace.SelectedMasterDataType = type;\n BindMasterDataInfo();\n ClearMaintenanceTypeInfo();\n var btnAddMaintType = jQuery.TaskGroupInfoNameSpace.MaintTypePagerData.LoadControlID;\n jQuery(\"#\" + btnAddMaintType).text(languageResource.resMsg_Add);\n if (jQuery(\"#iconViewintTypes\").hasClass(\"fa fa-minus-circle\")) {\n jQuery(\"#iconViewintTypes\").removeClass(\"fa fa-minus-circle\");\n jQuery(\"#iconViewintTypes\").addClass(\"fa fa-plus-circle\");\n }\n var btnShowAll = \"btnShowAll\";\n jQuery(\"#\" + btnShowAll).addClass('hide');\n jQuery(\"#iconViewMaintTypes\").removeClass(\"fa fa-minus-circle\");\n jQuery(\"#iconViewMaintTypes\").addClass(\"fa fa-plus-circle\");\n jQuery(\"#divMaintTypes\").addClass(\"hide\");\n jQuery(\"#divAddMaintenanceMasterDataModal\").modal(\"show\");\n}", "title": "" }, { "docid": "b58b0872c5fc75cdc08793a50e959aa1", "score": "0.6003562", "text": "function Modal(modalType, vars)\n{\n // reference\n\tthis.body,\n this.header,\n this.footer,\n this.type = modalType,\n this.vars; if(vars!=null){this.vars = JSON.parse(vars);}\n\n // templates\n this.simplicity_template = ['alert', 'alert-anonymousPrivacy', 'alert-followBadge', 'alert-goldBadge', 'alert-responseBadge', 'delete-comment', 'delete-post'],\n this.structure_template = ['{\"name\": \"alert\", \"footer\": \"<button type=\\'button\\' class=\\'btn btn-default\\' data-dismiss=\\'modal\\'>Close</button>\"}',\n '{\"name\": \"alert-anonymousPrivacy\", \"header\": \"User Privacy\", \"body\": \"This user has chosen to remain anonymous; we cannot share their profile information.\", \"footer\": \"<button type=\\'button\\' class=\\'btn btn-default\\' data-dismiss=\\'modal\\'>Close</button>\"}',\n '{\"name\": \"alert-followBadge\", \"header\": \"Badge Info\", \"body\": \"You are following this post.\", \"footer\": \"<button type=\\'button\\' class=\\'btn btn-default\\' data-dismiss=\\'modal\\'>Close</button>\"}',\n '{\"name\": \"alert-goldBadge\", \"header\": \"Badge Info\", \"body\": \"This post has been nominated for administration response.\", \"footer\": \"<button type=\\'button\\' class=\\'btn btn-default\\' data-dismiss=\\'modal\\'>Close</button>\"}',\n '{\"name\": \"alert-responseBadge\", \"header\": \"Badge Info\", \"body\": \"There has been an administration response to this post.\", \"footer\": \"<button type=\\'button\\' class=\\'btn btn-default\\' data-dismiss=\\'modal\\'>Close</button>\"}',\n '{\"name\": \"department-badge\", \"footer\": \"<button type=\\'button\\' class=\\'btn btn-default\\' data-dismiss=\\'modal\\'>Close</button>\"}',\n '{\"name\": \"delete-comment\", \"header\": \"Confirm\", \"body\": \"Are you sure you want to delete this comment?\"}',\n '{\"name\": \"delete-post\", \"header\": \"Confirm\", \"body\": \"Are you sure you want to delete this post?\"}',\n '{\"name\": \"photo-popup\", \"footer\": \"<button type=\\'button\\' class=\\'btn btn-default\\' data-dismiss=\\'modal\\'>Close</button>\"}',\n '{\"name\": \"share-popup\", \"header\": \"Share <span style=\\'0px 9px\\'>|</span> LionsMatter\", \"subheader\": \"Where would you like to share this post?\", \"footer\": \"<button type=\\'button\\' class=\\'btn btn-default\\' data-dismiss=\\'modal\\'>Close</button>\"}',\n '{\"name\": \"terms-of-service\", \"header\": \"Terms of Service <span style=\\'0px 9px\\'>|</span> LionsMatter\", \"subheader\": \"Rules for using LionsMatter\", \"footer\": \"<button type=\\'button\\' class=\\'btn btn-default\\' data-dismiss=\\'modal\\'>Close</button>\"}',\n '{\"name\": \"timeline-update\", \"header\": \"Update Timeline\"}',\n '{\"name\": \"vine-popup_display\", \"footer\": \"<button type=\\'button\\' class=\\'btn btn-default\\' data-dismiss=\\'modal\\'>Close</button>\"}',\n '{\"name\": \"vine-popup_input\", \"header\": \"Vine <span style=\\'0px 9px\\'>|</span> LionsMatter\", \"subheader\": \"Submit a Vine link with your post.\", \"body\": \"<div style=\\'text-align: center\\'><div class=\\'form-group\\' style=\\'margin-top: 10px\\'><label class=\\'control-label\\' style=\\'display: none; margin-bottom: 15px\\'>Error: Please provide a link to a valid Vine.</label><input id=\\'vineModalINPUT\\' type=\\'text\\' class=\\'form-control\\' style=\\'display: inline-block; width: 75%\\' placeholder=\\'Vine link\\'/></div><p style=\\'display: inline-block; font-size: 85%; text-align: left; width: 75%\\'><strong>Note:</strong> If you intend to post anonymously, you should know that Vine posts will display your account information by default. LionsMatter will not discriminate, however, against throwaway Vine accounts (which are anonymous).</p></div>\"}'];\n\n \n\t// settings\n this.simplicity = function(){if($.inArray(this.type, this.simplicity_template) == -1){return 'complex';} else{return 'simple';}}\n\tthis.isDisplayed = false;\n\n\t// HTML elements\n\tthis.HTML_shell = $(\"<div class='modal fade' id='modalCustom' tabindex='-1' aria-hidden='true'><div class='modal-dialog'><div class='modal-content'></div></div></div>\"),\n this.HTML_trigger = \"<a href='#modalCustom' id='modalCustomButton' data-toggle='modal'></a>\",\n this.HTML_content = function(modalTitle, modalBody, modalFooter){return \"<div class='modal-header'><button type='button' class='close' data-dismiss='modal' aria-hidden='true'>&times;</button>\"+ modalTitle +\"</div><div class='modal-body'>\"+ modalBody +\" </div><div class='modal-footer'>\"+ modalFooter +\"</div>\";},\n this.HTML_header = function(modalHeader){return \"<h4 class='modal-title'>\"+ modalHeader +\"</h4>\";},\n this.HTML_subheader = function(modalSubheader){return \"<h5 class='text-muted' style='margin-top: 0px; margin-bottom: 0px'>\"+ modalSubheader +\"</h5>\"};\n\n // simple functions\n this.construct = function()\n {\n var template = this.findTemplate();\n\n if(this.simplicity()=='complex'){$(this.HTML_shell).addClass('lionsmatter');}\n if(template.subheader != null){this.header = this.HTML_header(template.header) + ' ' + this.HTML_subheader(template.subheader);}else if(template.header != null){this.header = this.HTML_header(template.header);}else{this.customHeader();}\n if(template.body != null){this.body = template.body;}else{this.customBody();}\n if(template.footer != null){this.footer = template.footer;}else{this.customFooter();}\n\n $(this.HTML_shell).find('.modal-content').html(this.HTML_content(this.header, this.body, this.footer)).append(this.HTML_trigger);\n $(this.HTML_shell).on('hidden.bs.modal', function()\n {\n this.remove();\n modal.isDisplayed = false;\n\n if(modal.hasOwnProperty('redirect')&& modal.vars['redirect']!=null){window.location = modal.vars['redirect'];}\n });\n }\n this.findTemplate = function()\n {\n for(x = 0; x < this.structure_template.length; x++){if(JSON.parse(this.structure_template[x]).name==this.type){return JSON.parse(this.structure_template[x]);}}return 'failure';\n }\n}// modal methods", "title": "" }, { "docid": "5ae52f5fa55531ebdbc75c1de5f12291", "score": "0.5980192", "text": "function LauchModal(tModal){\n switch (tModal) {\n case \"registro\":\n modal.style.display = \"block\";\n break;\n \n case \"ig\":\n moig.style.display = \"block\";\n break;\n\n default:\n break;\n }\n}", "title": "" }, { "docid": "0a17437829d88b6f53b21c72e1e45a2e", "score": "0.59617615", "text": "handleOpenTypeCModal() {\n this.setState({ showTypeCModal: !this.state.showTypeCModal });\n }", "title": "" }, { "docid": "5b776cd721342439661e82e557ddb234", "score": "0.5906419", "text": "function viewAdvancedModal(modalType) {\n if (modalType == \"warning-modal\") {\n $('#advanced-modal').removeClass(\"success-modal\");\n $('#advanced-modal').removeClass(\"danger-modal\");\n $('#advanced-modal').addClass(\"warning-modal\");\n\n $(\"#advanced-modal .modal-icon span\").removeAttr(\"class\");\n $(\"#advanced-modal .modal-icon span\").addClass(\"fa fa-exclamation\");\n\n }\n else if (modalType == \"danger-modal\") {\n $('#advanced-modal').removeClass(\"success-modal\");\n $('#advanced-modal').removeClass(\"warning-modal\");\n $('#advanced-modal').addClass(\"danger-modal\");\n\n $(\"#advanced-modal .modal-icon span\").removeAttr(\"class\");\n $(\"#advanced-modal .modal-icon span\").addClass(\"fa fa-times\");\n }\n else if (modalType == \"success-modal\") {\n $('#advanced-modal').removeClass(\"danger-modal\");\n $('#advanced-modal').removeClass(\"warning-modal\");\n $('#advanced-modal').addClass(\"success-modal\");\n\n $(\"#advanced-modal .modal-icon span\").removeAttr(\"class\");\n $(\"#advanced-modal .modal-icon span\").addClass(\"fa fa-check\"); \n }\n\n $('#advanced-modal').modal({\n show: true,\n keyboard: false,\n backdrop: 'static'\n });\n }", "title": "" }, { "docid": "f36ab3e99dfc7df8889a4c8b0beedcdb", "score": "0.5892532", "text": "function modalMessages(title, body, type)\n {\n \tif (type !== undefined){\n \t\t$(\".modal\").removeClass(\"modal-success\").addClass('modal-'+type);\n \t} \n \t\n $(\".modal-title\").html(title);\n $(\".modal-body\").html(body);\n }", "title": "" }, { "docid": "1a765081b4220aa9f3793a71474fe007", "score": "0.57874775", "text": "function viewModal(modalType,modalSize) {\n if (modalType == \"add-modal\") {\n $('#form-modal').removeClass(\"warning-modal\");\n $('#form-modal').removeClass(\"danger-modal\");\n $('#form-modal').addClass(\"success-modal\");\n }\n else if (modalType == \"edit-modal\") {\n $('#form-modal').removeClass(\"success-modal\");\n $('#form-modal').removeClass(\"danger-modal\");\n $('#form-modal').addClass(\"warning-modal\");\n }\n else if (modalType == \"delete-modal\") {\n $('#form-modal').removeClass(\"success-modal\");\n $('#form-modal').removeClass(\"warning-modal\");\n $('#form-modal').addClass(\"danger-modal\");\n }\n else if (modalType == \"details-modal\") {\n $('#form-modal').removeClass(\"success-modal\");\n $('#form-modal').removeClass(\"warning-modal\");\n $('#form-modal').removeClass(\"danger-modal\");\n }\n else {\n alert(\"modal Type Undefined !!\");\n }\n\n if(modalSize ==\"xl\"){\n $('#form-modal').children(\".modal-dialog\").removeClass(\"modal-lg\");\n $('#form-modal').children(\".modal-dialog\").removeClass(\"modal-sm\");\n $('#form-modal').children(\".modal-dialog\").addClass(\"modal-xl\");\n }\n if(modalSize ==\"lg\"){\n $('#form-modal').children(\".modal-dialog\").removeClass(\"modal-xl\");\n $('#form-modal').children(\".modal-dialog\").removeClass(\"modal-sm\");\n $('#form-modal').children(\".modal-dialog\").addClass(\"modal-lg\");\n }\n if(modalSize ==\"md\"){\n $('#form-modal').children(\".modal-dialog\").removeClass(\"modal-xl\");\n $('#form-modal').children(\".modal-dialog\").removeClass(\"modal-lg\");\n $('#form-modal').children(\".modal-dialog\").removeClass(\"modal-sm\");\n }\n if(modalSize ==\"sm\"){\n $('#form-modal').children(\".modal-dialog\").removeClass(\"modal-xl\");\n $('#form-modal').children(\".modal-dialog\").removeClass(\"modal-lg\");\n $('#form-modal').children(\".modal-dialog\").addClass(\"modal-sm\");\n }\n\n $('#form-modal').modal({\n show: true,\n keyboard: false,\n backdrop: 'static'\n });\n }", "title": "" }, { "docid": "1c1bd7e11e4d7d4ffcb5b9ee0632dd56", "score": "0.5762506", "text": "resetModalInputs_() {\n super.resetModalInputs_();\n this.firstTypeInput_.selected = true;\n }", "title": "" }, { "docid": "c38e7b8fb4eab1c2b41d5a304628ec35", "score": "0.5754257", "text": "function modalReducer(state = initialModal, { type, payload }) {\n switch (type) {\n case SELECT_POKEMON:\n return {\n mode: payload.mode,\n isOpen: payload.isOpen,\n activePokemon: payload.activePokemon\n };\n default:\n return state;\n }\n}", "title": "" }, { "docid": "36fa0973d19412e81f2f059360a5e4c3", "score": "0.57212174", "text": "handleOpenTypeDModal() {\n this.setState({ showTypeDModal: !this.state.showTypeDModal });\n }", "title": "" }, { "docid": "0de01f81ec68f06a109cc98950e4e8b7", "score": "0.56534976", "text": "function openModal(modalType){\r\n\tif (modalType == null){\r\n\t modalError(); //need to write a full function\r\n\t}\r\n\telse {\r\n\t //console.log('the modal opened');\r\n\t $(\"#blanket\").addClass(\"live-blanket\");\r\n\t $(\"#modal\").show().addClass(\"live-modal\");\r\n\t $(\"#modal-content\").addClass(\"live-modal-content\");\r\n\t $(\"#modal-left-pane\").html(modalCloseButton);\r\n\t modalType();\r\n\t}\r\n }", "title": "" }, { "docid": "d695f1ff107894832a857de3a598fd1a", "score": "0.56129766", "text": "handleCloseTypeCModal() {\n this.setState({ showTypeCModal: !this.state.showTypeCModal });\n }", "title": "" }, { "docid": "9d90f0ae143ddae4c5e08bcca0f5a44a", "score": "0.5578669", "text": "function cleanItemModal(type) {\n\t\t$('form')[0].reset();\n\t\t$('.alert').css('display', 'none');\n\t\t$('div.form-group').removeClass('has-error');\n\t\t$('#type').val(type);\n\n\t\tif(type == 'bed') {\n\t\t\tvar wards = '';\n\t\t\tfor (var i = 0; i < php.wards.length; i++) {\n\t\t\t\tif(Number(php.wards[i].capacity) > php.wards[i].beds.length)\n\t\t\t\t\twards += '<option value=\"' +php.wards[i].id+ '\">'+ php.wards[i].identification+ '</option>';\n\t\t\t};\n\t\t\t$('#ward_id').html('<option val=\"\">None</option>' + wards);\t\t\t\n\t\t}\n\n\t\tif(type == 'ward' && $('#wardField').css('display') == 'none') {\n\t\t\t$('#wardField').css('display', 'block').find('input').prop('disabled', false);\n\t\t\t$('#bedField').css('display', 'none').find('select').prop('disabled', true);\n\t\t} else if(type == 'bed' && $('#bedField').css('display') == 'none') {\n\t\t\t$('#bedField').css('display', 'block').find('select').prop('disabled', false);\n\t\t\t$('#wardField').css('display', 'none').find('input').prop('disabled', true);\t\t\t\n\t\t}\n\t}", "title": "" }, { "docid": "b8c97132f7b46a806936ea18baa833b0", "score": "0.55732274", "text": "handleOpenTypeBModal() {\n this.setState({ showTypeBModal: !this.state.showTypeBModal });\n }", "title": "" }, { "docid": "6cdd688562b6bf02cb349fa706ad80bb", "score": "0.55468035", "text": "function ModalCerrarCondicion() {\n if (modalA === 1) {\n $('#contratoDetallesmodalE').modal('show');\n } else {\n if (modalA === 2) {\n $('#contratoDetallesmodalEN').modal('show');\n } else {\n $('#NuevoContratoDetallesmodalE').modal('show');\n }\n }\n}", "title": "" }, { "docid": "194f27c2b9297fcc835cfabef625b1f7", "score": "0.5536226", "text": "render (props) {\n let title = this.props.title;\n let type = this.props.type;\n let modalClass = this.state.modalClass + (type.indexOf('delete') >= 0 ? ' delete-modal' : (type.indexOf('memberInfo') >= 0 ? ' mem-info-modal' : ''));\n let modalBackClass = this.state.modalBackClass;\n let left = this.state.left;\n let typeId = this.state.typeId;\n return(\n <div>\n <div className={modalClass} style={{left:left}}>\n <div className=\"modal-head\">\n <span className=\"modal-title\"><b>{title}</b></span><i className=\"modal-close jstfont\" onClick={this.closeModal}></i>\n </div>\n {type == 'password' && <PasswordModal ref=\"changePassword\" dataChange={this.dataChange}/>}\n {type == '/employees' && <EmployeeModal ref=\"newModal\" typeId={typeId} type={type} dataChange={this.dataChange}/>}\n {type.indexOf('delete') > 0 && <DeleteModal ref=\"newModal\" typeId={typeId} type={type} dataChange={this.dataChange}/>}\n {type == '/members' && <MemberModal ref=\"newModal\" typeId={typeId} type={type} dataChange={this.dataChange}/>}\n {type == '/products' && <ProductModal ref=\"newModal\" typeId={typeId} type={type} dataChange={this.dataChange}/>}\n {type == '/orders' && <OrderModal dataChange={this.dataChange}/>}\n {type == '/charge' && <RechargeModal typeId={typeId} dataChange={this.dataChange}/>}\n {type == '/export' && <ExportModal typeId={typeId} dataChange={this.dataChange}/>}\n {type == 'memberInfo' && <MemberInfoModal typeId={typeId}/>}\n <div className=\"modal-footer\">\n <input type=\"button\" className=\"btn cancel\" value=\"取消\" onClick={this.closeModal}/>\n {(type != 'memberInfo' && type.indexOf('delete')<0) && <input type=\"button\" className=\"btn\" value={type =='/export'?'导出':'保存'} onClick={this.handleClick}/>}\n {type.indexOf('delete') > 0 && <input type=\"button\" className=\"btn\" value=\"确定\" onClick={this.handleClick}/>}\n </div>\n </div>\n <div className={modalBackClass}></div>\n </div>\n );\n }", "title": "" }, { "docid": "780acea7aa4101149ae29e53b6c3e20b", "score": "0.54911774", "text": "modal (name, data = {}) {\n switch (name) {\n default:\n return undefined\n }\n }", "title": "" }, { "docid": "a5d0f926f4229e8a1798fe3cac6ae427", "score": "0.5469759", "text": "addModal (p) {\n p.type = MODAL\n const config = this.buildConfig(p)\n return this.buildDialog(config)\n }", "title": "" }, { "docid": "43dabed9c12f092be68fe0c8835d21c4", "score": "0.5451498", "text": "function mostrarModal(tipo, mensaje) {\n let alert=$('#modal .alert');\n alert.removeClass(\"alert-primary alert-secondary alert-success alert-danger alert-warning alert-info alert-light alert-dark\");\n switch(tipo) {\n case \"secondary\":\n alert.addClass(\"alert-secondary\");\n break;\n case \"success\":\n alert.addClass(\"alert-success\");\n break;\n case \"danger\":\n alert.addClass(\"alert-danger\");\n break;\n case \"warning\":\n alert.addClass(\"alert-warning\");\n break;\n case \"info\":\n alert.addClass(\"alert-info\");\n break;\n case \"light\":\n alert.addClass(\"alert-light\");\n break;\n case \"dark\":\n alert.addClass(\"alert-dark\");\n break;\n default:\n alert.addClass(\"alert-primary\");\n }\n alert.empty();\n alert.append(mensaje);\n $('#modal').modal('show');\n}", "title": "" }, { "docid": "68b8e90579321637e7ab8c8931b0ab50", "score": "0.5451242", "text": "handleCloseTypeDModal() {\n this.setState({ showTypeDModal: !this.state.showTypeDModal });\n }", "title": "" }, { "docid": "0900e54d25e6250771651ace84f84f5f", "score": "0.5446287", "text": "getTypeDialogue(){\n\t\tvar type = this.eventPage.page[this.eventPage.id].type;\n\t\tvar idType = this.eventPage.page[this.eventPage.id].idType -1;\n\t\t\n\t\tif(type == \"dialogue\"){\n\t\t\t// do dialogue things ...\n\t\t\tvar typeDialogue = this.scene.sys.cache.json.get('NPCdial_'+type)[idType];\n\t\t\tthis.eventPage.id ++;\n\t\t\tthis.eventPage.dialogue = true;\n\t\t\ttypeDialogue.type = type;\n\t\t\treturn typeDialogue ;\n\t\t}else if(type ==\"choice\"){\n\t\t\tvar typeDialogue = this.scene.sys.cache.json.get('NPCdial_'+type)[idType];\n\t\t\tthis.eventPage.id ++;\n\t\t\tthis.eventPage.choice = true;\n\t\t\ttypeDialogue.type = type;\n\t\t\treturn typeDialogue ;\n\t\t\t// do choice things ...\n\t\t}else if(type ==\"shop\"){\n\t\t\tvar typeDialogue = this.scene.sys.cache.json.get('NPCdial_'+type)[idType];\n\t\t\tthis.eventPage.id ++;\n\t\t\tthis.eventPage.shop = true;\n\t\t\ttypeDialogue.type = type;\n\t\t\treturn typeDialogue ;\n\t\t\t// do shop things...\n\t\t\t\n\t\t}else if(type==\"goto\"){\n\t\t\tthis.eventPage.id = idType;\n\t\t\t//var typeDialogue = this.scene.sys.cache.json.get('NPCdial_'+type)[idType];\n\t\t\t//this.eventPage.id = typeDialogue.idType;\n\t\t\treturn this.getTypeDialogue();\n\t\t\t// do goto things..\n\t\t}else if(type==\"end\"){\n\n\t\t\tvar i = this.eventPage.id;\n\t\t\tthis.eventPage.id = 0;\n\t\t\treturn this.eventPage.page[i];\n\t\t\t//do end things...\n\t\t}else{\n\t\t\treturn;\n\t\t}\n\t\t\n\n\t}", "title": "" }, { "docid": "9eedc724ca6fbf987fc7a7de201f11e6", "score": "0.544345", "text": "function ModalAbiertoCondicion() {\n if ($('#contratoDetallesmodalE').is(':visible')) {\n $('#contratoDetallesmodalE').modal('hide');\n modalA = 1;\n } else {\n if ($('#contratoDetallesmodalEN').is(':visible')) {\n $('#contratoDetallesmodalEN').modal('hide');\n modalA = 2;\n } else {\n $('#NuevoContratoDetallesmodalE').modal('hide');\n modalA = 3;\n }\n }\n\n}", "title": "" }, { "docid": "f79276afece59febe26421b41c493dde", "score": "0.54180837", "text": "openRepoTypeModal() {\n let addTextBelowIcon = ['Bower', 'Chef', 'CocoaPods', 'Conan', 'Pypi', 'Puppet', 'Opkg', 'Composer', 'SBT', 'Gradle', 'Gems', 'NuGet', 'GitLfs','Generic','P2','VCS','CRAN'];\n this.$repoTypeScope = this.$scope.$new();\n this.$repoTypeScope.packageTypes = this.getPackageType();\n this.$repoTypeScope.highlightCheck = (typeFilter,type) => {\n if (typeFilter) {\n let string = type.text.toLowerCase(),\n searchstring = typeFilter.toLowerCase().replace(/ /g,'');\n\n\n if (string.substr(0, searchstring.length) == searchstring) {\n type.highlighted = true;\n return true;\n } else {\n type.highlighted = false;\n return false;\n };\n }\n };\n this.$repoTypeScope.checkNoResults = (typeFilter) => {\n if (typeFilter && typeFilter.length > 0 && _.filter(this.packageType,(type)=>type.highlighted).length == 0) {\n return true;\n }\n };\n this.$repoTypeScope.isSelected = () => {\n let HighlightedListItems = _.filter(this.packageType,(type)=>type.highlighted);\n if (HighlightedListItems.length == 1) {\n return true;\n }\n };\n this.$repoTypeScope.selectPackage = () => {\n let selectedItem = _.filter(this.packageType,(type)=>type.highlighted);\n if (selectedItem.length == 1) {\n this.selectRepoType(selectedItem[0])\n }\n };\n\n _.map(this.$repoTypeScope.packageTypes,(type)=>{\n if (_.includes(addTextBelowIcon, type.serverEnumName)) type.helpText = true;\n });\n\n if (this.features.isNonCommercial()) {\n _.forEach(this.$repoTypeScope.packageTypes, item => {\n if (!this.features.isEnabled(item.value)) item.disabled = true;\n });\n\n let activeItems = [];\n if (this.features.isConanCE()) {\n activeItems = _.remove(this.$repoTypeScope.packageTypes, item => item.serverEnumName === \"Conan\" || item.serverEnumName === \"Generic\");\n }\n else if (this.features.isJCR()) {\n activeItems = _.remove(this.$repoTypeScope.packageTypes, item => item.serverEnumName === \"Docker\" || item.serverEnumName === \"Helm\" || item.serverEnumName === \"Generic\");\n }\n\n this.$repoTypeScope.packageTypes = [...activeItems, ...this.$repoTypeScope.packageTypes];\n }\n this.$repoTypeScope.closeModal = () => this.closeModalPackageType();\n this.$repoTypeScope.modalClose = ()=> this.modalClose();\n this.$repoTypeScope.selectRepoType = (type)=>this.selectRepoType(type);\n this.isTypeModalOpen = true;\n\n this.repoTypeModal = this.modal.launchModal('repository_type_modal', this.$repoTypeScope, 1000);\n this.repoTypeModal.result.finally(() => {\n this.repositoriesForm.repoKey.$validate();\n this.isTypeModalOpen = false;\n if (this.repoInfo.isType('debian')) {\n this.onFormatSelectionChange();\n }\n\n });\n }", "title": "" }, { "docid": "55ec34e9860385b5fe3df79087372a13", "score": "0.5417084", "text": "handleClickGamesModal(e) {\n const { modalShow } = this.state;\n if (modalShow === false) {\n this.setState({\n type: e.target.innerText,\n modalShow: true\n })\n } else {\n this.setState({\n modalShow: false\n })\n }\n }", "title": "" }, { "docid": "0266d69621b9938c9cec410f9d114964", "score": "0.5400444", "text": "function recaudadorModal(e, limpiar){\r\n\r\n var defaultOption = e.parents('.account_group').find('.cpl_modal .modal_recaudador .custom_select ul li.default').html();\r\n var select_recaudador = e.parents('.account_group').find('.cpl_modal .modal_recaudador');\r\n\r\n// limpio el campo del fondo recaudador \r\nvar campoFondoRecaudador = e.parents('.account_group').find('.cpl_modal .modal_recaudador .inputSelect');\r\nif (limpiar == true){\r\ncampoFondoRecaudador.val('');\r\nselect_recaudador.find('.selected').html(defaultOption);\r\n}\r\n fondosSeleccionados = FondosSeleccionadosModal(e);\r\n// alert('fondos en el modal: '+fondosSeleccionados);\r\n console.log(fondosSeleccionados);\r\n if(fondosSeleccionados.length == 2){\r\n select_recaudador.show(200);\r\n }else{\r\n select_recaudador.hide();\r\n }\r\n\r\n console.log('fondos seleccionados en el modal'+ fondosSeleccionados);\r\n}", "title": "" }, { "docid": "c06db1d1a5cbd9438374d5b3fa8d4db3", "score": "0.5399589", "text": "function openModal(params) {\n if (!params || !params.type) {\n throw new Error('Missing modal type');\n }\n var modalInstance = $modal.open({\n templateUrl: 'modal/templates/modalcontainer.html',\n controller: 'ModalController',\n scope: $scope,\n size: params.size,\n resolve: {\n // The return value is passed to ModalController as 'locals'\n locals: function () {\n return {\n type: params.type,\n wallet: $rootScope.wallets.current,\n userAction: BG_DEV.MODAL_USER_ACTIONS.sendFunds\n };\n }\n }\n });\n return modalInstance.result;\n }", "title": "" }, { "docid": "c8f062acc1d8cc361382d53fd040e696", "score": "0.53938", "text": "onOpenModalDelete(payload){\n if(payload.type == 'img')\n {\n this.idItemImgDelete = payload.id;\n this.typeItemDelete = 'img';\n }\n else if(payload.type==\"video\"){\n this.idItemVideoDelete = payload.id;\n this.typeItemDelete = 'video';\n }\n this.modalIsOpenDelete = true;\n }", "title": "" }, { "docid": "245edf12bfe285acb3d9ed7858d67a92", "score": "0.5384235", "text": "modalPackage(state){\n return state.setToModal\n }", "title": "" }, { "docid": "b20a8f177abbcf02c8bf02ae31c0eff8", "score": "0.53747857", "text": "function closeModal(tModal) {\n switch (tModal) {\n case \"registro\":\n modal.style.display = \"none\";\n break;\n \n case \"ig\":\n moig.style.display = \"none\";\n break;\n\n default:\n break;\n }\n \n}", "title": "" }, { "docid": "c6c0690abc4922f18199532556983a9e", "score": "0.5374741", "text": "showAssignModal(type, id) {\n console.log(type);\n assignModal.id = id;\n $('#assign-modal').modal('show');\n }", "title": "" }, { "docid": "bf2a6792b4905cb01c86e9cd6cd8ed43", "score": "0.53740275", "text": "handleCloseTypeBModal() {\n this.setState({ showTypeBModal: !this.state.showTypeBModal });\n }", "title": "" }, { "docid": "3b9093571079c32a9a5d5da728317d28", "score": "0.5372368", "text": "function getModalidad() {\n console.log(\"Ya seleccione\");\n console.log(vm.selectedModalidad);\n vm.Modalidad=vm.selectedModalidad\n }", "title": "" }, { "docid": "93fd85acba5e8d8d37b2a9133498c5c5", "score": "0.5366218", "text": "showModal(selectedUser) {\n \t//switch based on \"type\" sent into component\n \t//this is a temporary work around as we transition into non-team supplier contacts\n \tvar type = this.props.type;\n \tif(type==\"team\"||(selectedUser&&selectedUser.collectionName==\"Team\")) {\n\t Modal.show({\n\t content:<TeamCard \n\t \titem={selectedUser} \n\t \tteam={this.data.team}\n\t \trole={this.data.role}\n\t \tgroup={this.data.group}/>\n\t })\n \t}\n \telse {\n\t Modal.show({\n\t content:<UserCard \n\t \titem={selectedUser} \n\t \tteam={this.data.team}\n\t \trole={this.data.role}\n\t \tgroup={this.data.group}/>\n\t })\n\t }\n }", "title": "" }, { "docid": "686871639dfb9a6e33d181a75ab7d390", "score": "0.5359939", "text": "function cambiaHeadModal(titulo,opc1){\r\n alert ('hola');\r\n debugger;\r\n switch(opc1)\r\n {\r\n case '1':\r\n $(\"#TituloModal\").removeClass('alert-success').removeClass('alert-danger').html(titulo);\r\n break;\r\n case '2':\r\n $(\"#TituloModal2\").removeClass('alert-success').removeClass('alert-danger').html(titulo);\r\n break;\r\n }\r\n debugger; \r\n\r\n }", "title": "" }, { "docid": "af996931b2648af27026cf32724dedf1", "score": "0.53595763", "text": "static get types() {\n return {\n 'treble': {\n code: 'gClef',\n line: 3,\n },\n 'bass': {\n code: 'fClef',\n line: 1,\n },\n 'alto': {\n code: 'cClef',\n line: 2,\n },\n 'tenor': {\n code: 'cClef',\n line: 1,\n },\n 'percussion': {\n code: 'restMaxima',\n line: 2,\n },\n 'soprano': {\n code: 'cClef',\n line: 4,\n },\n 'mezzo-soprano': {\n code: 'cClef',\n line: 3,\n },\n 'baritone-c': {\n code: 'cClef',\n line: 0,\n },\n 'baritone-f': {\n code: 'fClef',\n line: 2,\n },\n 'subbass': {\n code: 'fClef',\n line: 0,\n },\n 'french': {\n code: 'gClef',\n line: 4,\n },\n 'tab': {\n code: '6stringTabClef',\n },\n };\n }", "title": "" }, { "docid": "cc20245c237960ce1b0a0c12427da0c7", "score": "0.535138", "text": "function edit_open_modal(ip_value, typeoftable) {\n console.log(typeoftable);\n modal.style.display = \"block\";\n document.querySelector(\"#edit_id\").value = document.getElementById('id_rows' + ip_value).innerHTML;\n document.querySelector(\"#edit_id\").disabled = true\n document.querySelector(\"#edit_ip\").value = document.getElementById('ip_rows' + ip_value).innerHTML;\n document.querySelector(\"#edit_all_brand\").value = document.getElementById('brand_rows' + ip_value).innerHTML;\n document.querySelector(\"#edit_model\").value = document.getElementById('model_rows' + ip_value).innerHTML;\n document.querySelector(\"#edit_camera_name\").value = document.getElementById('camera_name_rows' + ip_value).innerHTML;\n document.querySelector(\"#edit_user\").value = document.getElementById('user_rows' + ip_value).innerHTML;\n document.querySelector(\"#edit_password\").value = document.getElementById('password_rows' + ip_value).innerHTML;\n document.querySelector(\"#edit_all_Auth_type\").select = document.getElementById('auth_type_rows' + ip_value).innerHTML;\n document.querySelector(\"#edit_stream_url\").value = document.getElementById('stream_url_rows' + ip_value).innerHTML;\n document.querySelector(\"#edit_location_name\").value = document.getElementById('location_name_rows' + ip_value).innerHTML;\n document.querySelector(\"#edit_latitude\").value = document.getElementById('latitude_rows' + ip_value).innerHTML;\n document.querySelector(\"#edit_longitude\").value = document.getElementById('longitude_rows' + ip_value).innerHTML;\n document.querySelector(\"#edit_all_organization\").value = document.getElementById('organization_rows' + ip_value).innerHTML;\n document.querySelector(\"#edit_cam_type\").value = document.getElementById('cam_type_rows' + ip_value).innerHTML;\n}", "title": "" }, { "docid": "b3ddfb7db2e601f9b313f22bdd5bc527", "score": "0.5346572", "text": "render() {\n return (\n <div className=\"container\">\n <Button\n bsStyle=\"primary\"\n bsSize=\"small\"\n onClick={this.open}\n className=\"float-right-margin\"\n >\n Add {this.props.type === 'StudentAtCampus' ? 'Student': this.props.type}\n </Button>\n <Modal show={this.state.showModal} onHide={this.close}>\n <Modal.Header closeButton>\n <Modal.Title>Add {this.props.type}</Modal.Title>\n </Modal.Header>\n <Modal.Body>\n {this.renderTypeForm()}\n </Modal.Body>\n <Modal.Footer>\n <Button onClick={this.close}>Close</Button>\n </Modal.Footer>\n </Modal>\n </div>\n );\n }", "title": "" }, { "docid": "0c5baac018c1774924e49d7cf50ae4c2", "score": "0.53448564", "text": "function ModalAbiertoCondicionReg() {\n if ($('#contratoDetallesmodal').is(':visible')) {\n $('#contratoDetallesmodal').modal('hide');\n modalReg = 1;\n } else {\n $('#detallesContratomodal').modal('hide');\n modalReg = 2;\n }\n\n}", "title": "" }, { "docid": "2079a8830c397a395fcdb9d648a39506", "score": "0.53278744", "text": "changeWalletType(type) {\n // Set wallet typeModalOpen\n this._selectedType = this.walletTypes[type - 1];\n }", "title": "" }, { "docid": "9feab82f035ddab5105fe23d8d053d75", "score": "0.53081703", "text": "function setAmenityType(row){\n\tvar selectedRows = View.panels.get('abRplmAddEditClausesAmntType').getSelectedRows();\n\tpanel = rplmClauseController.formClause;\n\tfor (i = 0; i<selectedRows.length; i++){\n\t\t\n\t\tvar comments = (selectedRows[i]['bl_amenity.comments'])?\" - Comments: \"+selectedRows[i]['bl_amenity.comments']:\"\";\n\t\t\n\t\tpanel.setFieldValue('ls_resp.description' , panel.getFieldValue('ls_resp.description')+ \" Amenity Type: \"+ selectedRows[i]['bl_amenity.amenity_type']+comments +\". \");\t\n\t}\n\tView.panels.get('abRplmAddEditClausesAmntType').closeWindow();\n}", "title": "" }, { "docid": "0e19e0232559661b15d1cd8ee45b7648", "score": "0.5303632", "text": "function showTypeTransaction() {\n var tmpArray1 = (gUserInfo.lang == 'EN') ? CONST_ACCOUNT_QUERY_TYPE_TRANSACTION_EN :\n CONST_ACCOUNT_QUERY_TYPE_TRANSACTION_VN;\n var tmpArray2 = CONST_ACCOUNT_QUERY_TYPE_TRANSACTION_VAL;\n\n var handleInputTypeTransaction = function(e) {\n document.removeEventListener(\"evtSelectionDialog\", handleInputTypeTransaction, false);\n var acctype = document.getElementById('idTypeTransaction');\n if ((e.selectedValue1 != undefined) && (e.selectedValue1 != null)) {\n if (acctype.nodeName == \"INPUT\") {\n acctype.value = e.selectedValue1;\n transaction = getValueTransaction(e);\n }\n\n } else {\n acctype.innerHTML = e.selectedValue1;\n transaction = getValueTransaction(e);\n }\n\n if ((e.selectedValue2 != undefined) && (e.selectedValue2 != null)) {\n typeTransaction = e.selectedValue2;\n }\n }\n\n var handleInputTypeTransactionClose = function() {\n document.removeEventListener(\"evtSelectionDialogClose\", handleInputTypeTransactionClose, false);\n document.removeEventListener(\"evtSelectionDialog\", handleInputTypeTransaction, false);\n }\n\n document.addEventListener(\"evtSelectionDialog\", handleInputTypeTransaction, false);\n document.addEventListener(\"evtSelectionDialogClose\", handleInputTypeTransactionClose, false);\n showDialogList(CONST_STR.get(\"COM_CHOOSEN_TYPE_TRANS\"), tmpArray1, tmpArray2, false);\n}", "title": "" }, { "docid": "f05b54b68dbfb270d118c08a4dadc87f", "score": "0.5302202", "text": "function showAddServiceModal(type, objectList, category) {\n if(type == 1) {\n $('#title-icon').hide();\n $('#title-name').html('Category');\n $('#title-category').html('');\n } else {\n $('#title-icon').show();\n $('#title-name').html('Service');\n $('#title-category').html(category);\n }\n if(objectList.constructor === Array) {\n var html = '';\n objectList.forEach(function(element) {\n html += '<li class=\"nn-item\">' +\n '<span class=\"nn-num\">'+ element.id +'</span>' +\n '<span class=\"nn-name\">'+ element.name +'</span>' +\n '<span class=\"nn-price font-weight-bold\">'+ element.price +'</span>' +\n '<span class=\"nn-tick icon wb-check d-none\"></span>' +\n '</li>'\n });\n\n $('#list-order').html(html);\n }\n\n if(!($(\"#addServiceModal\").data('bs.modal') || {isShown: false}).isShown) $('#addServiceModal').modal('show');\n}", "title": "" }, { "docid": "6a10c63eed5b99776d6a6b84fe5f7c3e", "score": "0.5292278", "text": "handleOpenTypeAModal() {\n this.setState({ showTypeAModal: !this.state.showTypeAModal });\n }", "title": "" }, { "docid": "a5f32c212e87d289bcf2ce06431bcdd5", "score": "0.529095", "text": "function close_modal(type)\n{\n var menu = document.getElementById(type);\n menu.style.display = \"none\";\n}", "title": "" }, { "docid": "53f6ea7975f7ae5d4290f4244e6835f1", "score": "0.5280262", "text": "function showModalCreatePaciente() {\n $('#modalCreatePrimerApellido').val($('#PrimerApellido').val());\n $('#modalCreatePrimerNombre').val($('#PrimerNombre').val());\n $('#modalCreateSexoId').val($('#Sexo').val());\n $('#modalCreateSexoNombre').val($('#Sexo option:selected').text());\n $('#modalCreateTipoDocumentoId').val($('#TipoDocumentoId').val());\n $('#modalCreateTipoDocumentoNombre').val($(\"#TipoDocumentoId option:selected\").text());\n $('#modalCreateNroDocumento').val($('#NroDocumento').val());\n $('#modalCreateFechaNacimiento').val($('#FechaNacimiento').val());\n $('#modalCreateEmail').val('');\n\n $('#modalCreatePaciente').modal('show');\n}", "title": "" }, { "docid": "1473642cbb7a8683297078e026965b09", "score": "0.5277371", "text": "getModalFromAction() {\n switch(this.state.actionId) {\n case 2:\n return (<IngestTelemetryModalForm parent={ this }/>);\n\n case 3:\n return (<TransferResponsibilityModalForm parent={ this }/>);\n\n default:\n break;\n }\n return(<h1>Modal</h1>)\n }", "title": "" }, { "docid": "e6caabc12cf6d53f358d6947e528e8f2", "score": "0.52767384", "text": "function showTrainingType(){\n $scope.trainingTypeModalTitle = '选择培训类别';\n $scope.trainingTypeModal = $modal({scope: $scope, templateUrl: 'partials/hr/training/modal.trainingType.html', show: true });\n //$scope.modalTrainingypes = angular.copy($scope.trainingTypes);\n }", "title": "" }, { "docid": "1ce0af627ea8f70d048c27bcc4fd6a58", "score": "0.5274318", "text": "function apriModaleSoggetto() {\n $(\"#codiceSoggetto_modale\").val($(\"#codiceSoggettoSoggetto\").val());\n $(\"#modaleGuidaSoggetto\").modal(\"show\");\n }", "title": "" }, { "docid": "01b77f78b74affe00fa498bd9593791f", "score": "0.5266534", "text": "setType () {\n}", "title": "" }, { "docid": "aae03214fc35a5360ad66168a921af50", "score": "0.52660805", "text": "MODAL_OPEN({ commit }, data) {\t\t\n\t\tcommit(\"SET_MODAL_OPEN\", data);\n\t}", "title": "" }, { "docid": "d8b8698d5f10ef3f349ee302c56a444a", "score": "0.52648365", "text": "modalFilled (modal) {\n let cr = document.getElementById('create-room')\n if(!cr) document.querySelector('.tingle-modal-box__footer').style.display='flex';\n let type = modal.__type;\n setTimeout(function(){ modal.checkOverflow() }, 300);\n var letsgo = document.querySelectorAll('.letsgo');\n if(!letsgo.length){\n\n modal.addFooterBtn(\"Let's Go ! <i class='fas fa-chevron-right'></i>\", 'tingle-btn tingle-btn--primary letsgo tingle-btn--pull-right', function(e){\n try { med.mutedStream = med.h.getMutedStream(); } catch(err){ console.warn(\"error in getting mutedstream\",err); }\n self.handleOk({type,modal,e});\n\n });\n }\n }", "title": "" }, { "docid": "0d73d6a2e973f9382159a42a6542afab", "score": "0.5261974", "text": "function showStatusALERT(id) {\r\n $(\"#trasanoModalHeader\").empty();\r\n $(\"#trasanoModalBody\").empty();\r\n $(\"#trasanoModalFooter\").empty();\r\n $(\"#trasanoModalHeader\").append(\"<h4>Estado del servicio...</h4>\");\r\n\r\n $(\"#trasanoModalBody\").append(\r\n \"<div class='form-group'>\" + \r\n \"<label for='message-text' class='control-label'>Seleccione el estado:</label>\" + \r\n \"<select class='form-control' id='statusSelected'>\" + \r\n \"<option value='2' selected>Recogido</option>\" +\r\n \"<option value='3'>Entregado</option>\" + \r\n \"</select>\" +\r\n '</div>');\r\n\r\n\r\n $(\"#trasanoModalFooter\").append(\r\n \"<button type='button' class='btn btn-default' data-dismiss='modal'>CANCELAR</button>\" + \r\n \"<a class='btn btn btn-primary' href='javascript:executeStatus(\" + id + \");' role='button'>ACEPTAR</a>\");\r\n $('#trasanoMODAL').modal('show'); \r\n}", "title": "" }, { "docid": "5d40ec6ccf4e5f3557eba4d2fc6ea417", "score": "0.5257272", "text": "function abrir_modal(el){\n for (let i = 0; i < diapo.length; i++) {\n if(diapo[i].tema == el){\n sw = true;\n dia_tema = diapo[i];\n diapos = dia_tema.diapositivas;\n break;\n }\n }\n if(!sw){\n abrir_modal_error('Importante...!!!', 'Las diapositivas aun no estan listas para este tema, por favor espera a que se habiliten.<br><br> Muchas gracias :)')\n }else{\n modal.style.display = 'grid';\n validar_contenido(diapos[j]);\n }\n}", "title": "" }, { "docid": "ed121c3a38ab4d0a9f28d6f8ced7d046", "score": "0.5257223", "text": "function setObjectiveModalContent(id, title, text, date, status, type){\n if (type == 2){\n $('#proposedTo').html(proposedToHTML());\n \t//Get email list and initialise tags input\n tags(\"proposed-obj-to\", emails);\n keypress('objective-modal');\n }else{\n $('#proposedTo').html(\"\");\n }\n\t$('#obj-modal-title-type').text(modalStatusList[type]);\n\t$(\"#objective-id\").val(id);\n\t$(\"#objective-title\").val(title);\n\t$(\"#objective-text\").val(text);\n\t$(\"#objective-date\").val(date);\n\t$(\"#objective-status\").val(status);\n\t$('#submit-obj').prop(\"disabled\", enableSubmit(type));\n}", "title": "" }, { "docid": "bc9f093e44b430288dd474d4e555160f", "score": "0.52565295", "text": "createVariableTypeContainer_(types) {\n const selectDiv = document.createElement('select');\n for (let i = 0; i < types.length; i++) {\n const type = types[i];\n const displayName = type[0];\n const typeName = type[1];\n const option = document.createElement('option');\n option.classList.add('input-modal-type');\n option.value = typeName;\n option.innerText = displayName;\n selectDiv.appendChild(option);\n }\n this.firstTypeInput_ = selectDiv.querySelector('.input-modal-type');\n return selectDiv;\n }", "title": "" }, { "docid": "a0708c2afbaa053e9f2510d33d96e00e", "score": "0.52534235", "text": "function montaModal_listaAtividade(){\n\t$('.modal-trigger').leanModal();\n}", "title": "" }, { "docid": "3b45bcb6a6c183db9444309ac476f062", "score": "0.5242974", "text": "function showModalDelete() {\n if (registros.status == '1') {\n var status = '0';\n $(\"#Modal-eliminaRegistro-Titulo\").text('Eliminar registro');\n $(\"#Modal-eliminaRegistro-Color\").removeClass(\"w3-blue\").addClass(\"w3-red\");\n } else {\n $(\"#Modal-eliminaRegistro-Color\").removeClass(\"w3-red\").addClass(\"w3-green\");\n $(\"#Modal-eliminaRegistro-Titulo\").text('Activar registro');\n var status = '1';\n }\n $(\"#eliminaID\").val(registros.id);\n $(\"#eliminaStatus\").val(status);\n $(\"#eliminaRegistro\").attr('action', idTablaLista.toLowerCase() + '/elimina');\n $(\"#Modal-eliminaRegistro-Contenido\").text('Clave = ' + registros.id + ' Nombre = ' + registros.nombre);\n $(\"#Modal-eliminaRegistro\").modal(\"show\");\n }", "title": "" }, { "docid": "13ec3106a469c525bd2b20b9a9072726", "score": "0.5242618", "text": "function modalPoem() {\n // first, we grab the poem and place it in the modal\n getPoem(true, false);\n}", "title": "" }, { "docid": "78c4bde7b4f3fe0cf4dd9e128a7dfd38", "score": "0.52400917", "text": "function setResponseType() {\r\n let $activeItem = $(\".active\").text()\r\n $activeItem = $activeItem.toLowerCase();\r\n let array = responseTypes[$activeItem];\r\n return array;\r\n}", "title": "" }, { "docid": "1a3ef0a25345732831ca94196cf87a95", "score": "0.5235743", "text": "function ModalCerrarCondicionReg() {\n if (modalReg === 1) {\n $('#contratoDetallesmodal').modal('show');\n } else {\n $('#detallesContratomodal').modal('show');\n }\n}", "title": "" }, { "docid": "301b3e16b9cb23ffda4c55a3ae1099b7", "score": "0.5234133", "text": "function makePopUp(type, name) {\n\t$('#add-or-edit-container').html('');\n\t$('.obscure').fadeIn(300);\n\t$('.obscure').css('display', 'block');\n\tif (type == 'manageFilters') {\n\t\tmanageFilters();\n\t} else if (type == 'help') {\n\t\tdisplayHelp();\n\t} else if (type == 'reset') {\n\t\tresetData();\n\t} else if (type == 'add') {\n\t\taddingItem(name);\n\t} else {\n\t\taddNewMenu(type);\n\t}\n}", "title": "" }, { "docid": "f08f2c550697424a8b0cf64e9850036c", "score": "0.5215823", "text": "function abrir_modal_apuestapuestocompra(id) {\n var metodo = \"modal_clientes_apuestapuestocompra\";\n var montoval = DN($('#idmontolista').val());\n var mtoval = parseFloat(montoval);\n $('#botonera').html(\"\");\n if (mtoval == '' || mtoval == ',') {\n $(\"#botonera\").html(\"<div id='botcan' class='modalb' onclick='ocultarmodal(\" + \"&#39;\" + metodo + \"&#39;);'>Cancelar</div>\");\n $(\"#mycontenido\").html('El monto es requerido!!11');\n $('#modal_clientes_apuestapuestocompra').show();\n return false;\n }\n\n if ((mtoval <= 0) || ($('#idmontolista').val() == \"\")) {\n $(\"#botonera\").html(\"<div id='botcan' class='modalb' onclick='ocultarmodal(\" + \"&#39;\" + metodo + \"&#39;);'>Cancelar</div>\");\n $(\"#mycontenido\").html('El monto es requerido!!');\n $('#modal_clientes_apuestapuestocompra').show();\n return false;\n }\n\n if ((mtoval <= 0)) {\n $(\"#botonera\").html(\"<div id='botcan' class='modalb' onclick='ocultarmodal(\" + \"&#39;\" + metodo + \"&#39;);'>Cancelar</div>\");\n $(\"#mycontenido\").html('El monto debe ser mayor que 0!!');\n $('#modal_clientes_apuestapuestocompra').show();\n return false;\n }\n\n if (solounacoma($('#idmontolista').val()) > 1 || $('#idmontolista').val() == \"'\") {\n $(\"#botonera\").html(\"<div id='botcan' class='modalb' onclick='ocultarmodal(\" + \"&#39;\" + metodo + \"&#39;);'>Cancelar</div>\");\n $(\"#mycontenido\").html('El formato del monto es inavlido!!');\n $('#modal_clientes_apuestapuestocompra').show();\n return false;\n }\n // alert($('#idafavor').val());\n var base = $('#idproporcionapuesta').val();\n var myArray = base.split('#');\n var pagopan = myArray[1];\n var ganopan = myArray[2];\n if ($('#idafavor').val() == 'C') {\n pagopan = myArray[2];\n ganopan = myArray[1];\n }\n var megan0 = (mtoval * ganopan) / pagopan;\n var comi = (megan0 * $('#idcomision').val()) / 100;\n megan0 = megan0 - (megan0 * $('#idcomision').val()) / 100;\n $(\"#mycontenido\").html('Apuesto BS: ' + $('#idmontolista').val() + ' Para Ganar BS: ' + FN(megan0));\n $(\"#botonera\").html(`\n <div style=\"float: right;\">\n <div id='botok' class='modalb' onclick='comprar_puestolista(` + $('#idevento0').val() + `);'>Confirmar Apuesta</div>\n <div id='botcan' class='modalb' onclick='ocultarmodal(` + `&#39;` + metodo + `&#39;);'>Cancelar</div>\n </div>`);\n\n try {\n bonsal = $('#idsaldobono1 span').html().replace('.', \"\");\n bonsal = bonsal.replace(',', \".\");\n if (bonsal > 0) {\n $(\"#botonera\").prepend(`\n <div style=\"float: left; padding: 3px;\">\n <input type=\"checkbox\" value='false' id=\"cbox2\" style=\"cursor: initial; display: inline-block;\"><label for=\"cbox2\">Utilizar Bono</label>\n </div>\n `);\n }\n } catch (error) { console.log('e') }\n\n $('#modal_clientes_apuestapuestocompra').show();\n}", "title": "" }, { "docid": "8ab58173bd2f4c029587de8c69362394", "score": "0.52128595", "text": "function dialogSelect(e) {\n var value1 = e.selectedValue1;\n var value2 = e.selectedValue2;\n switch (gTrans.authorize.selectionType) {\n case 1: // Loai giao dich\n var element = document.getElementById(\"id.trans-type\");\n element.value = value1;\n gTrans.authorize.transType = value2;\n break;\n case 2: // Nguoi lap\n var element = document.getElementById(\"id.maker\");\n element.value = value1;\n gTrans.authorize.makerId = value1;\n break;\n case 3: // Trang thai\n var element = document.getElementById(\"id.status\");\n element.value = value1;\n gTrans.authorize.transStatus = value2;\n break;\n default:\n break;\n }\n}", "title": "" }, { "docid": "245cc752eb876215c7c72907ec0d6716", "score": "0.5210999", "text": "get modalClass() {\n return `slds-modal ${this.isModalOpen ? \"slds-fade-in-open\" : \"\"}`;\n }", "title": "" }, { "docid": "e5518c53cc4bf316656d33fd4a76b1dc", "score": "0.52100825", "text": "saveModal()\n {\n this.columns=this.selectedFields;\n this.values=this.defaultValues;\n this.isModalOpen=false;\n }", "title": "" }, { "docid": "9be2b0928bbc44ad8ca9202fb792caa8", "score": "0.52092606", "text": "function modalChangeElement(modalVar, buttonVar, spanVar, pVar) { //funzione che prende in pasto 4 variabili:\n //modalVar= id del modal che si dovrà aprire\n //buttonVar= id del pulsante che aprirà il modal\n //spanVar= classe dello span contenente la X per la chiusura del modal\n //pVar= la classe del p da selezionare\n buttonVar.onclick = function() { // Quando l'utente clicca sul pulsante\n modalVar.style.display = \"block\"; // si apre il modal\n }\n spanVar.onclick = function() { // Quando l'utente clicca sulla X\n modalVar.style.display = \"none\"; // si chiude il modal\n }\n window.onclick = function(event) { //OPZIONALE: Quando l'utente clicca su qualsiasi punto al di fuori del modal\n if (event.target == modalVar) { //Il modal si chiude\n modalVar.style.display = \"none\";\n }\n }\n $(pVar).on('click', function(){ //Quando l'utente clicca su un p all'interno del modal\n var current = $(this).text(); //prendo il contenuto del p cliccato\n $(buttonVar).text(current); // lo vado a sostituire nella navbar\n modalVar.style.display = \"none\"; // si chiude il modal\n });\n}", "title": "" }, { "docid": "1af7acf12dce7567101521ce31282818", "score": "0.5179819", "text": "static getItemTypes() {\n\n if (_itemTypes == null) {\n _itemTypes = {\n\n // Action types.\n Shortcut: actions.Shortcut.action,\n InsertText: actions.InsertText.action,\n Command: actions.Command.action,\n Uri: actions.Uri.action,\n File: actions.File.action,\n DBusSignal: actions.DBusSignal.action,\n\n // Menu types.\n CustomMenu: menus.CustomMenu.menu,\n Devices: menus.Devices.menu,\n Bookmarks: menus.Bookmarks.menu,\n System: menus.System.menu,\n Favorites: menus.Favorites.menu,\n FrequentlyUsed: menus.FrequentlyUsed.menu,\n RecentFiles: menus.RecentFiles.menu,\n RunningApps: menus.RunningApps.menu,\n };\n\n // This is only possible if the GMenu typelib is installed on the system.\n if (GMenu) {\n _itemTypes.MainMenu = menus.MainMenu.menu;\n }\n }\n\n return _itemTypes;\n }", "title": "" }, { "docid": "670d439889a6bdabd7197858c0002aaf", "score": "0.51734054", "text": "function viewMsgModal(modalType,Msg,confirm,cancel,functionName) {\n\n if (modalType == \"warning-modal\") {\n $('#msg-modal').removeClass(\"success-modal\");\n $('#msg-modal').removeClass(\"danger-modal\");\n $('#msg-modal').addClass(\"warning-modal\");\n\n $(\"#msg-modal .modal-icon span\").removeAttr(\"class\");\n $(\"#msg-modal .modal-icon span\").addClass(\"fa fa-exclamation\");\n\n }\n else if (modalType == \"danger-modal\") {\n $('#msg-modal').removeClass(\"success-modal\");\n $('#msg-modal').removeClass(\"warning-modal\");\n $('#msg-modal').addClass(\"danger-modal\");\n\n $(\"#msg-modal .modal-icon span\").removeAttr(\"class\");\n $(\"#msg-modal .modal-icon span\").addClass(\"fa fa-times\");\n }\n else if (modalType == \"success-modal\") {\n $('#msg-modal').removeClass(\"danger-modal\");\n $('#msg-modal').removeClass(\"warning-modal\");\n $('#msg-modal').addClass(\"success-modal\");\n\n $(\"#msg-modal .modal-icon span\").removeAttr(\"class\");\n $(\"#msg-modal .modal-icon span\").addClass(\"fa fa-check\"); \n }\n\n $(\"#msg-modal .msg h5\").empty();\n $(\"#msg-modal .msg h5\").html(Msg);\n\n if (confirm == 'true') {\n $(\"#ConfirmationBtn\").css(\"display\", \"block\");\n }\n if (cancel == 'true') {\n $(\"#CancelBtn\").css(\"display\", \"block\");\n }\n $(\"#msg-modal .closeBtn\").attr(\"onclick\", functionName);\n $('#msg-modal').modal({\n show: true,\n keyboard: false,\n backdrop: 'static'\n });\n }", "title": "" }, { "docid": "bd06d19eeb3d0b3bfffd9bcde0fb07f1", "score": "0.51640826", "text": "function exibir(tipo, dados) {\n switch (tipo) {\n case 'cliente':\n $('#input-nome-modal').val(dados.razao_social).toUpperCase();\n $('#input-sigla-modal').val(dados.sigla).toUpperCase();\n dados.status === 's' ? $('#input-active-modal').click() : $('#input-inactive-modal').click();\n break;\n\n case 'tema':\n $('#input-tema-modal').val(dados.tema);\n dados.status === 's' ? $('#input-active-modal').click() : $('#input-inactive-modal').click();\n break;\n\n case 'planta':\n $('#input-planta-modal').val(dados.planta);\n dados.status === 's' ? $('#input-active-modal').click() : $('#input-inactive-modal').click();\n break; \n\n case 'email':\n $('#input-server').val(dados.servidor);\n $('#input-port').val(dados.porta);\n dados.ssl == 's' ? $('#input-ssl').attr('checked', true) : $('#input-ssl').attr('checked', false);\n $('#input-user-smtp').val(dados.usuario_smpp);\n break;\n\n case 'departamento':\n $('#departamento-nome').val(dados.nome);\n dados.status === 's' ? $('#input-active-modal').click() : $('#input-inactive-modal').click();\n dados.pergunta_aprovacao === 's' ? $('#pergunta-aprovacao').attr('checked', true) : $('#pergunta-aprovacao').attr('checked', false);\n break;\n\n case 'usuario':\n listarMenu(dados);\n listarDepartamentos();\n listarAcesso();\n break;\n default:\n break;\n }\n}", "title": "" }, { "docid": "cc0d25569a56661a1e3ef9e4564c003c", "score": "0.5162959", "text": "function chooseTransType() {\n gTrans.authorize.selectionType = 1;\n var typeValues = (gUserInfo.lang == 'EN') ? CONST_TRANS_BATCH_TRANS_TYPE_EN :\n CONST_TRANS_BATCH_TRANS_TYPE_VN;\n var typeKeys = CONST_TRANS_BATCH_TRANS_TYPE;\n dialogInit();\n showDialogList(CONST_STR.get('COM_CHOOSEN_TYPE_TRANS'), typeValues, typeKeys, false);\n}", "title": "" }, { "docid": "5551f2163dc93c519ac4b6d113b9ad5d", "score": "0.51542616", "text": "function promptMSG(type, messages, title, btn_type, set_delay, addClassOpen, callBackYes) {\n var prompt_delay = (set_delay === true ? true : false);\n var addClassModalOpen = ((addClassOpen === true || addClassOpen === null) ? true : false);\n var msg, titleh = '';\n var modal_type = \"mif-modal-warning\";\n var result;\n var button_type = function (btn_type) {\n if (btn_type == 'yn') {\n return '<button type=\"button\" class=\"btn btn-sm btn-danger btn-yes\" >Yes</button> <button type=\"button\" class=\"btn btn-sm btn-primary\" data-dismiss=\"modal\">No</button>';\n } else {\n return '<button type=\"button\" class=\"btn btn-xs btn-danger\" data-dismiss=\"modal\">Close</button>';\n }\n };\n\n if (type == \"warning\") {\n msg = \"<strong>Warning!</strong> \" + messages;\n titleh = \"<i class='fa fa-warning'></i>\";\n }\n if (type == \"danger\") {\n msg = \"<strong>Authentication failed!</strong></br>Please Reload or Relogin your account.\";\n titleh = \"<i class='glyphicon glyphicon-fire'></i>\";\n modal_type = \"mif-modal-danger\";\n }\n if (type == \"success-add\") {\n msg = messages + \" Has Been Successfuly Added.\";\n titleh = \"<i class='glyphicon glyphicon-check'></i>\";\n modal_type = \"mif-modal-success\";\n }\n if (type == \"success-retrieve\") {\n msg = messages + \" Has Been Successfully Moved to </br><strong>Current page</strong>.\";\n titleh = \"<i class='glyphicon glyphicon-check'></i>\";\n modal_type = \"mif-modal-success\";\n }\n if (type == \"success-update\") {\n msg = messages + \" Has Been Successfuly Updated.\";\n titleh = \"<i class='glyphicon glyphicon-check'></i>\";\n modal_type = \"mif-modal-success\";\n }\n if (type == \"remove\") {\n msg = messages + \" Has Been Moved to <strong>Archive page</strong>.\";\n titleh = \"<i class='glyphicon glyphicon-fire'></i>\";\n modal_type = \"mif-modal-danger\";\n }\n if (type == \"success-custom\") {\n msg = messages;\n titleh = \"<i class='glyphicon glyphicon-check'></i>\";\n modal_type = \"mif-modal-success\";\n }\n if (type == \"custom\") {\n msg = messages;\n titleh = title;\n }\n\n var template = '<div class=\"modal fade mif-modalPromptMSG ' + modal_type + '\" id=\"modalPromptMSG\" data-backdrop=\"static\" data-keyboard=\"true\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"modaPromptMSG\">' +\n '<div class=\"modal-dialog\" role=\"document\"> ' +\n '<div class=\"modal-content\">' +\n '<div class=\"modal-header\">' +\n '<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>' +\n '<div class=\"modal-title\" id=\"modaPromptMSG\">' + titleh + '</div>' +\n '</div>' +\n '<div class=\"modal-body text-center\">' + msg +\n '</div>' +\n '<div class=\"modal-footer text-center\">' + button_type(btn_type) +\n '</div>' +\n '</div>' +\n '</div>' +\n '</div>';\n\n $(\".displayPromptMSG\").html(template);\n\n var delayPrompt = (function () {\n var timer = 0;\n return function () {\n window.clearTimeout(timer);\n timer = window.setTimeout(function () { $(\"#modalPromptMSG\").modal('hide'); }, 5000);\n };\n })();\n\n if ($(\".displayPromptMSG\").children() != '') {\n $(\"#modalPromptMSG\").modal('show');\n\n if (prompt_delay === true) {\n delayPrompt();\n }\n if (addClassModalOpen === true) {\n $(\"#modalPromptMSG\").on('hidden.bs.modal', function () { // For tuning, must check if the last modal active.\n $(\"body\").addClass('modal-open');\n });\n }\n\n }\n //Callback function if Yes button is clicked.\n if (btn_type == 'yn' && btn_type != undefined && btn_type != null && btn_type != '') {\n $(\".btn-yes\").click(function (e) {\n e.preventDefault();\n callBackYes();\n });\n }\n\n return $(template);\n}", "title": "" }, { "docid": "d743d3b00728368c81728500203be775", "score": "0.5147503", "text": "function getipo(tipo){\n\t//console.log(tipo);\n\treloadtable(tipo);//reload na tabela com as mensagens da nova linguagem pedida\n}", "title": "" }, { "docid": "ba19c6f440e1b7922b074d0089a317f6", "score": "0.51473045", "text": "function abrir_modal_apuestaproposimple(idevento, idelementoa, idelementob, vidclase, comision, descriplugar) {\n\n var metodo = \"modal_comprarpropuesta_simple\";\n\n if ($('#iddoy').val() == '') {\n // $(\"#botonera\").html(\"<div id='botcan' class='modalb' onclick='ocultarmodal(\" + \"&#39;\" + metodo + \"&#39;);'>Cancelar</div>\");\n // $(\"#mycontenido\").html('Debe asignar la cantidad de puntos que da!!');\n // $('#modal_comprarpropuesta_simple').show();\n // return false;\n $('#iddoy').val(0);\n }\n\n if ($('#iddoy').val() == ',' || $('#iddoy').val() == \"'\") {\n $(\"#botonera\").html(\"<div id='botcan' class='modalb' onclick='ocultarmodal(\" + \"&#39;\" + metodo + \"&#39;);'>Cancelar</div>\");\n $(\"#mycontenido\").html('La formato de los puntos dados es inavlido!!');\n $('#modal_comprarpropuesta_simple').show();\n return false;\n }\n\n if ($('#idmonto').val() == '' || $('#idmonto').val() == ',') {\n $(\"#botonera\").html(\"<div id='botcan' class='modalb' onclick='ocultarmodal(\" + \"&#39;\" + metodo + \"&#39;);'>Cancelar</div>\");\n $(\"#mycontenido\").html('El monto es requerido!!');\n $('#modal_comprarpropuesta_simple').show();\n return false;\n }\n\n if (solounacoma($('#idmonto').val()) > 1 || $('#idmonto').val() == \"'\") {\n $(\"#botonera\").html(\"<div id='botcan' class='modalb' onclick='ocultarmodal(\" + \"&#39;\" + metodo + \"&#39;);'>Cancelar</div>\");\n $(\"#mycontenido\").html('El formato del monto es inavlido!!');\n $('#modal_comprarpropuesta_simple').show();\n return false;\n }\n\n if (DN($(\"#idmonto\").val()) == 0) {\n $(\"#botonera\").html(\"<div id='botcan' class='modalb' onclick='ocultarmodal(\" + \"&#39;\" + metodo + \"&#39;);'>Cancelar</div>\");\n $(\"#mycontenido\").html('El monto Apostar es requerido!!');\n $('#modal_comprarpropuesta_simple').show();\n return false;\n }\n\n var x = DN($(\"#idmonto\").val());\n // var vganar = DN($(\"#idmonto\").val()) - ((DN($(\"#idmonto\").val()) * comision) / 100);\n //----------------\n var base = $('#proporcion').val();\n var myArray = base.split('#');\n var pagopan = myArray[0];\n var ganopan = myArray[1];\n var megan0 = (DN($(\"#idmonto\").val()) * ganopan) / pagopan;\n\n var comi = (megan0 * comision) / 100;\n megan0 = megan0 - (megan0 * comision) / 100;\n //------------\n var vganar = megan0;\n $('#botonera').html(\"\");\n $(\"#botonera\").html(\"<div id='botok' class='modalb' onclick='ir_compraproposicionsimple(\" + idevento + \",\" + idelementoa + \",\" + idelementob + \",\" + vidclase + \");'>Confirmar Apuesta</div><div id='botcan' class='modalb' onclick='ocultarmodal(\" + \"&#39;\" + metodo + \"&#39;);'>Cancelar</div>\");\n\n try {\n bonsal = $('#idsaldobono1 span').html().replace('.', \"\");\n bonsal = bonsal.replace(',', \".\");\n if (bonsal > 0) {\n $(\"#botonera\").prepend(`\n <div style=\"float: left; padding: 3px;\">\n <input type=\"checkbox\" value='false' id=\"cbox2\" style=\"cursor: initial; display: inline-block;\"><label for=\"cbox2\">Utilizar Bono</label>\n </div>\n `);\n }\n } catch (error) { console.log('e') }\n\n $(\"#mycontenido\").html('<p>Su apuesta es de Bs: ' + $(\"#idmonto\").val() + \" Para Ganar Bs: \" + FN(vganar) + '<p>');\n $('#modal_comprarpropuesta_simple').show();\n}", "title": "" }, { "docid": "b12edf63595d072b33300639626ca741", "score": "0.5129792", "text": "function openModal() {\n\t//inicializar el modal que sea nuevo rol\n\tdocument.querySelector('#idRol').value = '';//limpiar el value del input hiden del modal\n\tdocument.querySelector('#titleModal').innerHTML = 'Nuevo Rol';\n\tdocument.querySelector('.modal-header').classList.replace('headerUpdate', 'headerRegistrer');\n\tdocument.querySelector('#btnActionForm').classList.replace('btn-info', 'btn-primary');\n\tdocument.querySelector('#btnText').innerHTML = 'Guardar';\n\tdocument.querySelector('#formRol').reset();\n\t$(\"#modalRol\").modal(\"show\");\n}", "title": "" }, { "docid": "78f38a44728174716a7d526709fa320e", "score": "0.5124426", "text": "function OpenModal() {\n\n limpiar();\n cambiar_color_obtener();\n $(\".modal-title\").text(\"Registrar Categoria\");\n $('#modal-categoria').modal('show');\n}", "title": "" }, { "docid": "f713e8d82a954d5924a5352fa6866099", "score": "0.5124421", "text": "onConfirmModal(registro) {\n if (!registro) {\n return;\n }\n this.onChange({\n target: {\n value: registro[this.props.chave],\n },\n });\n }", "title": "" }, { "docid": "92c19f434f9885d16b8d874fe79ad267", "score": "0.512287", "text": "presentProfSearchModal(select) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () {\n const modal = yield this.modalController.create({\n component: src_app_pages_components_search_modal_search_modal_component__WEBPACK_IMPORTED_MODULE_6__[\"SearchModalComponent\"],\n componentProps: {\n options: this.getProfs().map((prof) => {\n return {\n label: prof.label,\n value: prof.valore\n };\n }),\n title: 'Seleziona'\n },\n cssClass: 'app-modal'\n });\n modal.onWillDismiss().then((modal) => {\n if (modal.data) {\n const value = modal.data;\n const index = this.getProfs().findIndex((prof) => prof.valore === value);\n select.value = {\n index: index,\n value: value\n };\n }\n });\n yield modal.present();\n });\n }", "title": "" }, { "docid": "070ceebc9bd012a9e239cb1dfb915fbc", "score": "0.51167715", "text": "changeStatus () {\n Actions.selectStatus()\n this.toggleModal()\n }", "title": "" }, { "docid": "bce60ffe29872a4e1f30cb35a237e0e9", "score": "0.5115488", "text": "function click(d) {\n\n if (curModal == \"echo\") {\n var modal = document.getElementById(\"myModalECHO\");\n modal.style.display = \"block\"; //change display to block so that it appears\n\n var span = document.getElementById(\"closeECHO\");\n span.onclick = function() {\n var modal = document.getElementById(\"myModalECHO\");\n modal.style.display = \"none\"; //change display to none when X is clicked\n }\n }\n\n if (curModal == \"bulb\") {\n var modal = document.getElementById(\"myModalBULB\");\n modal.style.display = \"block\"; //change display to block so that it appears\n\n var span = document.getElementById(\"closeBULB\");\n span.onclick = function() {\n var modal = document.getElementById(\"myModalBULB\");\n modal.style.display = \"none\"; //change display to none when X is clicked\n }\n }\n\n if (curModal == \"roomba\") {\n var modal = document.getElementById(\"myModalROOMBA\");\n modal.style.display = \"block\"; //change display to block so that it appears\n\n var span = document.getElementById(\"closeROOMBA\");\n span.onclick = function() {\n var modal = document.getElementById(\"myModalROOMBA\");\n modal.style.display = \"none\"; //change display to none when X is clicked\n }\n }\n\n if (curModal == \"nest\") {\n var modal = document.getElementById(\"myModalNEST\");\n modal.style.display = \"block\"; //change display to block so that it appears\n\n var span = document.getElementById(\"closeNEST\");\n span.onclick = function() {\n var modal = document.getElementById(\"myModalNEST\");\n modal.style.display = \"none\"; //change display to none when X is clicked\n }\n }\n\n if (curModal == \"security\") {\n var modal = document.getElementById(\"myModalSECURITY\");\n modal.style.display = \"block\"; //change display to block so that it appears\n\n var span = document.getElementById(\"closeSECURITY\");\n span.onclick = function() {\n var modal = document.getElementById(\"myModalSECURITY\");\n modal.style.display = \"none\"; //change display to none when X is clicked\n }\n }\n}", "title": "" }, { "docid": "f83288113b042bf7d71897b5e57f9ad0", "score": "0.51129085", "text": "tipoMapa(){\n\t\treturn(\n\t\t\t<View style={CreatePlanStyle.tipoPlan}>\n\t\t\t\t<TouchableOpacity onPress={() => this.setState({tipoPlan:false, publico:true})} style={CreatePlanStyle.btnModal}> \n\t \t\t\t<Text style={CreatePlanStyle.textModal}>CREAR PLAN PÚBLICO</Text>\n\t\t\t\t</TouchableOpacity>\t\n\t\t\t\t<TouchableOpacity onPress={() => this.setState({tipoPlan:false, publico:false})} style={CreatePlanStyle.btnModal}> \n\t \t\t\t<Text style={CreatePlanStyle.textModal}>CREAR PLAN PRIVADO</Text>\n\t\t\t\t</TouchableOpacity>\t\n\t\t\t</View>\n\t\t)\n\t}", "title": "" }, { "docid": "e29ca9241783b7aff911583004a835e2", "score": "0.51097465", "text": "function SetMovmentType(type : int)\n{\n\tmovmentType = type;\n}", "title": "" }, { "docid": "8405d38cc5aef5822a84913174de7c1a", "score": "0.509172", "text": "static get CONT_TYPES() {\n return {\n JSON : \"application/json\",\n FORM_DATA : \"multipart/form-data\",\n OCT_STREAM : \"application/octet-stream\"\n }\n }", "title": "" }, { "docid": "a34eb0acaea084785146f96fbdd5302f", "score": "0.5089995", "text": "closeModal()\n {\n this.edit=false;\n this.isModalOpen=false;\n this.isMore=false;\n this.newRecord=false;\n }", "title": "" }, { "docid": "8acdd39c694670cf794f8791c4324df1", "score": "0.50889885", "text": "function hideLyricsOrVideoModal(type) {\n if (type === 'lyrics') {\n var className = 'lyrics';\n } else {\n var className = 'player';\n }\n\n document.querySelector('.'+className+'-container .modal-inner-container').classList.remove('out');\n\n setTimeout(function() {\n document.querySelector('.'+className+'-container').classList.add('hidden');\n }, 150);\n }", "title": "" }, { "docid": "457c9bafaae7fed57b7ed864d7fba226", "score": "0.5078138", "text": "function MasInformacionProveedor(idconsecutivo,posicion) {\n\n document.getElementById('DetalleModalProveedortitle').innerHTML = 'Contacto de la Orden ' + datosordenproveedor[posicion].Codigo_Solicitud_Ciklos + ' - ' + idconsecutivo;\n\n document.getElementById('lblpacientePro').innerHTML = datosordenproveedor[posicion].Id_Afiliado;\n document.getElementById('lblpacientenombre').innerHTML = datosordenproveedor[posicion].NombreCompleto;\n document.getElementById('lblcontacto').innerHTML = datosordenproveedor[posicion].Contacto;\n document.getElementById('lblestado').innerHTML = datosordenproveedor[posicion].EstadoProveedor;\n document.getElementById('lblobgene').innerHTML = datosordenproveedor[posicion].ObservacionesGen;\n document.getElementById('lblfechaciklos').innerHTML = datosordenproveedor[posicion].Fecha_Registro_Solicitud\n document.getElementById('lblprofesionalsol').innerHTML = datosordenproveedor[posicion].ProfesionalSolicita;\n document.getElementById('lbldetalleciklos').innerHTML = datosordenproveedor[posicion].Descripcion;\n //document.getElementById('lblobaud').innerHTML = datosordenproveedor[posicion].ObservacionesAud; \n\n $(\"#DetalleModalProveedor\").modal();\n }", "title": "" }, { "docid": "316113f21ad55326a66e263c3b511d7f", "score": "0.507803", "text": "selectIcon(type){\n const inputs = this.state.inputs;\n this.setState({ inputs: { ...inputs, icon: type } });\n this.closeModal();\n }", "title": "" }, { "docid": "0c49fcad2eef8ce1895b71b46e523050", "score": "0.5076032", "text": "function levantaPopup(){\n\n\tvar option = { \n\t\t\t\t\ttitle:\"Comprobación de Aprobación\",\n\t\t\t\t\tallowMaximize:false,\n\t\t\t\t\tshowMaximized:false,\n\t\t\t\t\tshowClose:false,\n\t\t\t\t\t//autoSize:true,\n\t\t\t\t\t//width:515,\n\t\t\t\t\twidth:500,\n\t\t\t\t\theight:160,\n\t\t\t\t\tscroll:0,\n\t\t\t\t\targs: {\t\n\t\t\t\t\t\t\testado:'VI'\t\n\t\t\t\t\t\t },\n\n\t\t\t\t\t//center:1,resizable:1,scroll:0,status:0,maximize:1,minimize:1,\n\t\t\t\t\tdialogReturnValueCallback: callbackMethod,\n\t\t\t\t\turl:urlPantallaComprobacion+'?ID='+iniciativaID\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tSP.UI.ModalDialog.showModalDialog(option);\n}", "title": "" }, { "docid": "83a90e4c42631c4f6de471f35f573418", "score": "0.5074421", "text": "function goUpdateFindTypeMenuItems() {\n goUpdateCommand(\"cmd_findTypeText\");\n goUpdateCommand(\"cmd_findTypeLinks\");\n}", "title": "" }, { "docid": "2c4698a671f2baa0b74d38c74ca0dbf4", "score": "0.5072567", "text": "function afterClickReturnSelectBox(){\r\n var typeName = document.getElementById(\"returnType\").value;\r\n if(typeName==\"void\" || typeName==\"Double\" || typeName==\"Byte\" || typeName==\"Float\" || typeName==\"Boolean\" || typeName==\"Character\" || typeName==\"Integer\" || typeName==\"Short\" || typeName==\"Long\" || typeName==\"String\" || typeName==\"double\" || typeName==\"byte\" || typeName==\"float\" || typeName==\"boolean\" || typeName==\"char\" || typeName==\"int\" || typeName==\"short\" || typeName==\"long\"){\r\n return;\r\n }else if(typeName==\"list\"){ \r\n showWin();\r\n }else if(typeName==\"map\"){\r\n showWinMAP();\r\n }else if(typeName==\"stack\"){\r\n showWinStack();\r\n }else if(typeName==\"array\"){\r\n showWinArray();\r\n }\r\n}", "title": "" }, { "docid": "d9605689b30fbc9fcd514304313b7740", "score": "0.5072523", "text": "openCloseModal() {\n if (this.carrello.length < 1 && !this.toggleModal) {\n alert('Attenzione! Carrello vuoto!')\n\n } else {\n this.toggleModal = !this.toggleModal\n }\n\n }", "title": "" }, { "docid": "638298edacd8b054325e3daeb36d18f0", "score": "0.5072007", "text": "function open_asset(type)\n{\n hide_assets_menu();\n show('assets_modal_back');\n var asset_input = document.getElementsByClassName(type);\n for (var i = 0; i < asset_input.length; i++)\n {\n asset_input[i].style.display = \"block\";\n }\n return;\n}", "title": "" }, { "docid": "ee5a27c0c3a0b70a3e9df6f04b7c84aa", "score": "0.5071376", "text": "function sendMails( type )\n\t\t{\n\t\t\tvar modalInstance = $uibModal.open( {\n\t\t\t\ttemplateUrl: '/modules/auction/client/views/mail.client.modal.html'\n\t\t\t\t,controller: 'SendEmailsClientController'\n\t\t\t\t,controllerAs: 'vm'\n\t\t\t\t,resolve: {\n\t\t\t\t\tmailObj: function(){\n\t\t\t\t\t\tvar obj = {\n\t\t\t\t\t\t\tproject_id: vm.auction.project_id\n\t\t\t\t\t\t\t,message: ''\n\t\t\t\t\t\t\t,subject: ''\n\t\t\t\t\t\t\t,dialogTitle: 'Send emails'\n\t\t\t\t\t\t};\n\t\t\t\t\t\tswitch( type ){\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tobj.dialogTitle = 'Pause of Auction Emails';\n\t\t\t\t\t\t\t\tobj.subject = 'Pausing auction';\n\t\t\t\t\t\t\t\tobj.message = 'Auction of ' + vm.auction.project.project_name + ' was paused';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\tobj.dialogTitle = 'Resume of Auction Emails';\n\t\t\t\t\t\t\t\tobj.subject = 'Resuming auction';\n\t\t\t\t\t\t\t\tobj.message = 'Auction of ' + vm.auction.project.project_name + ' was resumed';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\tobj.dialogTitle = 'Auction Cancel Emails';\n\t\t\t\t\t\t\t\tobj.subject = 'Cancelling auction';\n\t\t\t\t\t\t\t\tobj.message = 'Auction of ' + vm.auction.project.project_name + ' was cancelled!';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn obj;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t}", "title": "" }, { "docid": "3e379bdfeae6668a239ce6b2f4861aa8", "score": "0.5069784", "text": "function generateSuccessModal(modalId, footerType, modalButtonId, modalMessage, modalButtonNoId) {\n $('.modal_success_template').attr('id', modalId);\n $('.modal_success_template .modal-content .modal-body p').html(modalMessage);\n\n if (footerType === 1) {\n $('.modal_success_template .modal-content .modal-footer').html('<button type=\"button\" id=\"' + modalButtonId + '\" class=\"btn btn-outline pull-right\" data-dismiss=\"modal\">Yes</button><button type=\"button\" id=\"' + modalButtonNoId + '\" class=\"btn btn-outline pull-right\" data-dismiss=\"modal\"> No</button>');\n $('#' + modalId).modal();\n\n } else if (footerType === 2) {\n $('.modal_success_template .modal-content .modal-footer').html('<button type=\"button\" id=\"\" class=\"btn btn-outline pull-right\" data-dismiss=\"modal\">Ok</button>');\n $('#' + modalId).modal();\n\n }\n}", "title": "" } ]
e648e577c4f5dcfb9b76e91c18e53098
override to do stuff right before we fetch
[ { "docid": "6af8e2fc8bb5a39f1999d239baefb4a3", "score": "0.70543426", "text": "async preFetchHook () {\n\t}", "title": "" } ]
[ { "docid": "33cb2aca61a6c44fda9d829b9eac6fea", "score": "0.6104147", "text": "function potentiallyCORSEnabledFetch(urlObj) {\n // TO BE IMPLEMENTED\n establishTheConnection();\n }", "title": "" }, { "docid": "a2c4bc696750a483a43e06a886a5902b", "score": "0.60896736", "text": "function fetchDataIfNeeded() {\n if (needed) {\n typeaheadData.get(scope.url, scope.parserName, function(items) {\n scope.items = items;\n needed = false;\n });\n }\n }", "title": "" }, { "docid": "1a758fd44d328bb1909d813e84a54d0a", "score": "0.60774547", "text": "async postFetchHook () {\n\t}", "title": "" }, { "docid": "9cabb13f34c680b3677af4ac4244d37d", "score": "0.606378", "text": "function fetch(){\n engine.common.tell('fetching',log);\n build();\n}", "title": "" }, { "docid": "5bb4c74b509824d75eb9f7740a99fbac", "score": "0.6038766", "text": "loadInitialData() {\n dispatch(me())\n dispatch(fetchCategories())\n dispatch(fetchProducts())\n dispatch(fetchCart())\n dispatch(fetchOrders())\n dispatch(fetchReviews())\n }", "title": "" }, { "docid": "556e6da7717154a167149a9b35f5ae6f", "score": "0.6004092", "text": "fetch(callback) {\n var storageKey = '/backend/alignments';\n var maybeCachedResponse = JSON.parse(localStorage.getItem(storageKey));\n\n // cached data available, use\n if (maybeCachedResponse) {\n this.attributes = maybeCachedResponse;\n callback(null, maybeCachedResponse);\n // not in cache, fetch and set for next time\n } else {\n super.fetch((err, resp) => {\n callback(err, resp);\n localStorage.setItem(storageKey, JSON.stringify(resp));\n });\n }\n }", "title": "" }, { "docid": "e65f4f41723b115d727f56ddb1d09488", "score": "0.5987267", "text": "preExecute() {\n\t\t// Overwrite this...\n\t}", "title": "" }, { "docid": "5ae8a0f740e07032717dccd45d35f75c", "score": "0.5942823", "text": "fetchData() {\n this.makeRequest(this.endpoint, this.credentials).then(this.processData);\n }", "title": "" }, { "docid": "bf33011e285f1deb4db285837c6f5f60", "score": "0.59405506", "text": "shouldFetch(/* state, args */) { return true; }", "title": "" }, { "docid": "49b30f3d582a1bc12dea44e5ec2f94d0", "score": "0.5933542", "text": "_wrapFetch() {\n if (!utils.supportsNativeFetch()) {\n return;\n }\n\n utils.addInstrumentationHandler('fetch', (handlerData) => {\n const { response, args } = handlerData;\n const [requestInfo, requestInit] = args ;\n\n if (!response) {\n return;\n }\n\n this._fetchResponseHandler(requestInfo, response, requestInit);\n });\n }", "title": "" }, { "docid": "eea2afd031bc5d8cb6fbcaa76f28de9a", "score": "0.59234715", "text": "init() {\n\t\tthis.replaceData(\n\t\t\tthis.manager.get(\"noReq\"),\n\t\t\tthis.endpoints.get,\n\t\t\tthis.data.get\n\t\t);\n\t}", "title": "" }, { "docid": "41e486b665b5ecf162c540ef5d5b1949", "score": "0.586008", "text": "shouldFetch(state) {\n return true\n }", "title": "" }, { "docid": "1af8f26d0989b9b97e4ed94e8daf5ca2", "score": "0.5812639", "text": "beforeHandling() {\n\t\t//\n\t}", "title": "" }, { "docid": "f90ce6e503164669d5db2f74fd2877a7", "score": "0.58025205", "text": "preFetch() {\n this.busy = true;\n this.refresh_btn_text = 'Refreshing';\n }", "title": "" }, { "docid": "062f9442f02e979f8a1b4d5596e5d551", "score": "0.579772", "text": "UNSAFE_componentWillMount() {\n this.doFetching(this.props);\n }", "title": "" }, { "docid": "b5ee922455fff2a71e91bae50cf2b0d0", "score": "0.57655114", "text": "before (callback) {\n\t\tBoundAsync.series(this, [\n\t\t\tsuper.before,\t// do the usual test prep\n\t\t\tthis.updateStream,\t// perform the actual join\n\t\t\tthis.setFetchPath\n\t\t], callback);\n\t}", "title": "" }, { "docid": "81e318233f53f45951c83b3dfb57508f", "score": "0.5721051", "text": "doFetch() {\n const cache = this.atlasOptions.cache;\n\n // if state is crystalline then first request\n if (!this.state.data && !this.state.error && !this.state.loading) {\n this.setState({ loading: true });\n return new Promise(resolve => {\n const unsubscribe = this.fetchHandler.subscribe(atlasResponse => {\n if (atlasResponse.ok) {\n this.setState({ data: atlasResponse.data });\n } else {\n this.setState({ error: atlasResponse.error });\n }\n unsubscribe();\n resolve(atlasResponse);\n });\n });\n }\n\n // batching\n if (this.state.loading) {\n return new Promise(resolve => this.fetchHandler.subscribe(resolve));\n }\n\n // caching\n if (cache) {\n return Promise.resolve(this.fetchHandler.lastResponse);\n }\n\n // no caching\n return this.refetch();\n }", "title": "" }, { "docid": "2d24f3be85f3031275dece389ee293b4", "score": "0.5718629", "text": "petFetch(){\t\n\t\tlet self = this\n\t\t// get the data from the services\n\t\tpetService.fetch()\n\t\t.then( (response)=> {\n\t\t\t// send data to be manipulated before store in the state\n\t\t\tself.handleData(response)\n\t\t})\n\t\t.catch(function(error) {\n\t\t\t// the services have some issues in the moment to retrive data\n\t\t\t// if this happens the sistem will call the service again \n\t\t\tself.componentWillMount()\n\t\t\tconsole.log('Looks like there was a problem: \\n', error);\n\t\t})\n\t}", "title": "" }, { "docid": "1e1baa2e65836c1d0ca7fcb3fbeaa8d8", "score": "0.5711178", "text": "function maybeFetch() {\n\t\t\tif ( context.data.$textbox.val() !== context.data.prevText ) {\n\t\t\t\tcontext.data.prevText = context.data.$textbox.val();\n\t\t\t\tif ( typeof context.config.fetch == 'function' ) {\n\t\t\t\t\tcontext.config.fetch.call( context.data.$textbox, context.data.$textbox.val() );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "2a855fd9427094a79a0ba4b5be4f54e2", "score": "0.56440806", "text": "checkParamsAndFetch() {\n // Fetch param values if present\n let id = this.getURLParamsByName('id', window.location.href);\n let url = this.getURLParamsByName('url', window.location.href);\n\n // Do not fetch a random song if an id was already provided\n if (id) // id takes takes precedence\n this.streamSong(id);\n else if (url)\n this.curPlayer.load(url); // Load the song by url (Widget API takes care of the rest)\n else\n this.fetchNext();\n }", "title": "" }, { "docid": "36ecaead9f75cd2f5b06ab0e5295a9cb", "score": "0.5607061", "text": "fill() {\n\t\tthis.lazyInit();\n\t\twhile (this.fetch(1000) === 1000) {\n\t\t\tcontinue;\n\t\t}\n\t}", "title": "" }, { "docid": "dea2cb2ca375f795d69c1f74e91421ed", "score": "0.55793244", "text": "componentDidMount() {\n // if loaded flag is already true we don't need to query the API again\n if (!this.props.loaded) {\n this.props.handleLoad();\n }\n }", "title": "" }, { "docid": "33f0868a29be4576bc8fb57d41d91a81", "score": "0.55770785", "text": "beforeLazyload () {}", "title": "" }, { "docid": "9a0082e0111c0a44d7ed1e3af2a994dc", "score": "0.55691063", "text": "async fetch () {\n\t\tconst { func, query, queryOptions, fetchNothing } = this.queryAndOptions;\n\t\tif (fetchNothing) {\n\t\t\t// the derived class might \"know\" that we're not going to fetch anything, so\n\t\t\t// don't bother running a query\n\t\t\tthis.models = [];\n\t\t\treturn;\n\t\t}\n\t\t// run the query and get our models\n\t\tthis.models = await this.data[this.module.collectionName][func](query, queryOptions);\n\t}", "title": "" }, { "docid": "879484f136339ab4cd0404901ece9b7f", "score": "0.5557063", "text": "async preQueryHook () {\t\t\n\t}", "title": "" }, { "docid": "0799aa9a61361c7e64545ac0fc7f2514", "score": "0.55556136", "text": "prepareBaseData() { super.prepareBaseData(); }", "title": "" }, { "docid": "07046364572d06f5e6ad7917a5ad8b6b", "score": "0.5551321", "text": "markFetched(follow) {\n if (follow.response) {\n this.fetched[follow.id] = Object.assign(follow.response,\n {at: new Date(), delay: 0.5 + (Math.random() * 0.5)})\n this.localSet('fraidycat', {fetched: this.fetched})\n delete follow.response\n }\n }", "title": "" }, { "docid": "06167f5f8ca06442860f5ab559fa36b5", "score": "0.55498314", "text": "shouldFetch(state) {\n return true\n }", "title": "" }, { "docid": "784f2de3d982217a3c4216a2c48daea6", "score": "0.5535287", "text": "function fetch_and_update() {\n fetch_items()\n .then(process_items)\n .then(update_display);\n }", "title": "" }, { "docid": "bd7827d2f92b42a3c632b56db4e725f5", "score": "0.5512985", "text": "componentDidMount() {\r\n this.fetchData(null)\r\n }", "title": "" }, { "docid": "e28ee2110e5f324ad6797592686d4955", "score": "0.5511311", "text": "function itShouldConditionalFetch() {\n console.log('> itShouldConditionalFetch');\n conditionalFetch();\n}", "title": "" }, { "docid": "db287d9f8779f9a8a5f17ffd75304515", "score": "0.5505485", "text": "function _triggerFetchData() {\n if ($scope.currentPage === 1) {\n _fetchData();\n } else {\n $scope.currentPage = 1;\n }\n }", "title": "" }, { "docid": "74198cafa834759a0b383270a4372c23", "score": "0.5489967", "text": "canFetch() {\n \treturn this.fetchUrl && !this.disabled && !this.has_fetched;\n }", "title": "" }, { "docid": "82f04ed2006ee0c59271b664165b6d47", "score": "0.5473279", "text": "loadIfNotAlready()\n\t{\n\n\t\tif((this.state.isLoaded === false || this.state.paging === true) && this.state.isError === false)\n\t\t{\n\n if(this.loadData === undefined)\n {\n\n throw new Error(\"Load data must be defined by child component\")\n\n }\n\n\t\t\tthis.sendRequest();\n\n\t\t}\n\n\n\t}", "title": "" }, { "docid": "5604429e5f6021e385e01ebeed9eb45b", "score": "0.54730123", "text": "reInitDataFetch() {\n this._objectid = (this.modeladapter.value ? this.modeladapter.value[this.modeladapter.STORE_ITEM_INDEX_PROP] : null);\n if (this._objectid)\n this.setAttribute(\"objectid\", this._objectid)\n else\n this.removeAttribute(\"objectid\");\n if (store.connected) this.connected(); else this.disconnected();\n }", "title": "" }, { "docid": "bb6a9d153b83e5af61ec7aed4bc61da4", "score": "0.54540366", "text": "async fetch_data_src() {\n if (this.data_src === null) {\n console.error(\"data_src is not set\");\n return;\n }\n if (this.data !== null) {\n // i.e. we should assume it has been already fetched\n return;\n }\n let data = await this.data_src;\n this.data = data;\n return;\n }", "title": "" }, { "docid": "f827e4ec6732eaacbcf555314df0a50e", "score": "0.54380316", "text": "function __setFetch(fetch) {\n nodeFetch = fetch;\n}", "title": "" }, { "docid": "cef5e2b23e80873b68eee453ba6bbcdc", "score": "0.5427756", "text": "async fetch() {\n }", "title": "" }, { "docid": "29e6195ecec42437e3c1e52403aec11b", "score": "0.54258335", "text": "function controlFetch() {\n fetch(`https://api.openweathermap.org/data/2.5/weather?q=${location}&units=imperial&appid=59001e1f469d421690b543e76dbf29d3`\n )\n .then((response)=>{\n // console.log(response.json());\n return response.json();\n })\n .then((json) =>{\n setFahrenheit(json.main.temp)\n setCoordLat(json.coord.lat)\n setCoordLong(json.coord.lon)\n \n // setCelsius((fahrenheit - 32) * .5556)\n \n })\n\n // fetch(tmUrl)\n // .then((response) => {\n // return response.json();\n // })\n // .then((json) => {\n // return cityEvents = json._embedded.events;\n // // cityEvents.forEach(vents => setEvents(<p>{vents.name}</p>));\n // // cityEvents.map((vents) => {\n // // setEvents(<p>{vents.name}</p>)\n // // })\n // })\n }", "title": "" }, { "docid": "44f20d6f9639d926c0ead5468c69ca2f", "score": "0.5418391", "text": "function fetchItem(self) {\n self.initializing = true;\n axios.get(URL_BASE + \"/catalogo/item/\", {\n params: {\n id: window.itemInfo.id,\n type: window.itemInfo.type,\n version: window.itemInfo.version\n }\n })\n .then(function (res) {\n self.initializing = false;\n var images = JSON.parse(res.data.images);\n var item = JSON.parse(res.data.item);\n if (item.length === 0) {\n return\n }\n\n\n var data = item[0];\n self.disableApproval = data.fields.author === self.userId;\n self.item.name = data.fields.name;\n self.item.description = data.fields.description;\n self.item.thumbnail = data.fields.thumbnail;\n self.item.author = data.fields.author;\n\n self.item.images = images.map(function (img) {\n img.src = utils.getImageUrl(window.CLOUDINARY_NAME, img.remoteId);\n return img;\n });\n\n\n cargarInfo(self, res, data);\n\n })\n\n\n}", "title": "" }, { "docid": "6d8e1ce6cb6d67c4ccfe61c93b6a43c0", "score": "0.54008", "text": "@autobind\n fetchEssentialData(firstFetch = false) {\n this.props\n .fetchMarket()\n .then(() => {\n if (this.props.defaultAccount) {\n this.props.fetchMarketTrades(this.props.market)\n this.props.fetchMarketShares(this.props.defaultAccount)\n }\n if (firstFetch) {\n const availableView = this.getAvailableView()\n if (availableView) {\n this.props.changeUrl(`/markets/${this.props.params.id}/${availableView}`)\n }\n }\n })\n .catch((err) => {\n console.error(e)\n this.setState({\n marketFetchError: err,\n })\n })\n\n if (this.props.hasWallet) {\n this.props.requestGasCost(GAS_COST.BUY_SHARES)\n this.props.requestGasCost(GAS_COST.SELL_SHARES)\n }\n\n if (this.props.defaultAccount && this.props.params.id) {\n this.props.fetchMarketParticipantTrades(this.props.params.id, this.props.defaultAccount)\n }\n }", "title": "" }, { "docid": "43e669ee5f4df7397e7716e590659f00", "score": "0.5400027", "text": "componentWillMount () {\n this._fetchData()\n }", "title": "" }, { "docid": "89f4885c0d6adc47285c1ff5b01e2196", "score": "0.5398872", "text": "loadData(){\n \n fetch(\"http://localhost:8088/people\")\n .then(r => r.json())\n .then(people => {\n this.setState({\n people: people\n })\n \n return fetch(\"http://localhost:8088/vehicles\")\n })\n .then(r => r.json())\n .then(vehicles => {\n this.setState({\n vehicles: vehicles\n })\n \n return fetch(\"http://localhost:8088/pets\")\n })\n .then(r => r.json())\n .then(pets => {\n this.setState({\n pets: pets\n })\n \n //view all collections in state\n console.log(this.state)\n })\n \n }", "title": "" }, { "docid": "1748d01bc7ac8d61775b7600843b76c4", "score": "0.53987783", "text": "insertStoredContent() {\n this.fetch();\n }", "title": "" }, { "docid": "359d9a890b16e0cee2113c44c60b0c20", "score": "0.5385426", "text": "static async fetch() {\n try {\n await this.git(['fetch', '--unshallow']);\n } catch (error) {\n core.warning(`Fetch --unshallow caught: ${error}`);\n await this.git(['fetch']);\n }\n }", "title": "" }, { "docid": "31515f2fec4243fd12cb547aa960cba3", "score": "0.5371918", "text": "componentWillMount() { this.fetchDefaultData(this.props); }", "title": "" }, { "docid": "1cd894d5e99ac5ed11a67e2874101ccd", "score": "0.5369963", "text": "function handleFetch(){\n // const handleFetch = async() = {\n //const res = await fetch(`https://api.nasa.gov/mars-photos/api/v1/rovers/curiosity/photos?sol=${sol}&api_key=NWH7j4t1TW48KAGZChs8NMz7OrkWHIIUdfmBhFFk`)\n //const nextData = await res.json()\n //setData(nextData)\n }", "title": "" }, { "docid": "c9425cd052b9e65ad1ad1843d1dc05e9", "score": "0.5368988", "text": "init () {\n this.replaceData(this.manager.get(\"hostReq\"), this.endpoints.get, this.data.get);\n }", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.5367302", "text": "prepare() {}", "title": "" }, { "docid": "135d281504f4d16774b704bdd76244a6", "score": "0.5365857", "text": "async init() {\n\t\tconsole.log(\"processor init\")\n\n\n\n\n\t\ttry {\n\n\t\t\tconsole.log(\"database:\" + this.store.state.database);\n\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\tvar obj = this;\n\t\t\txhr.onload =\n\t\t\t\tawait\n\n\t\t\tfunction () {\n\t\t\t\tconsole.log(xhr.responseText);\n\t\t\t\tobj.fce = new Function('data', 'tf', xhr.responseText);\n\t\t\t}\n\t\t\txhr.open(\"GET\", this.url);\n\t\t\txhr.send();\n\t\t} catch (error) {\n\t\t\tconsole.log(error)\n\t\t}\n\t}", "title": "" }, { "docid": "794e3e1d8675f8d61a10f15d5a7987ae", "score": "0.53611976", "text": "async function fetchData () {\n model.remoteData = \"Fetching remote data now...\"\n return continueFetchData\n}", "title": "" }, { "docid": "7984ee5b6af48cbc97b44acce5ad52d0", "score": "0.53147465", "text": "_innerFetch(...params) {\n\t\treturn fetch(...params)\n\t}", "title": "" }, { "docid": "574ae2fad9fa178f4cc50c55dccab74b", "score": "0.5310971", "text": "checkData() {\n const { needLoadData, setNeedLoadData, importData } = this.props;\n if (needLoadData) {\n setNeedLoadData(false);\n fetch(\"/nba.csv\")\n .then(response => {\n return response.ok ? response.text() : Promise.reject(response);\n })\n .then(rawData => {\n importData(rawData);\n })\n .catch(response => {\n console.error(response);\n });\n }\n }", "title": "" }, { "docid": "2e848e91409529d8bc485aa46f775457", "score": "0.5310706", "text": "async componentDidMount() {\n /* Using try lots of thing can go wrong here. */\n try {\n /* Set loading true, and fetch error null */\n this.setState({isLoading: true, fetchError: null});\n\n\n const response = await fetch(this.props.api);\n if (!response.ok) {\n throw new Error(\"This did not work, following message was given to you: \" + response.status.toString())\n }\n\n /* Load JSON */\n const data = await response.json();\n\n /* Analysing the data */\n console.log(data);\n if (data === null) {\n throw new Error(\"Well, this can happen. It seems that there are now forms in the archive. \");\n }\n\n /* Clean up Loading done */\n this.setState({isLoading: false, data: data});\n\n } catch (error) {\n this.setState({fetchError: error.toString(), isLoading: false});\n }\n }", "title": "" }, { "docid": "cd3f82a96351abc6f5309f05c3f4b078", "score": "0.53067625", "text": "fetchInitialData() {\n request.get('get-initial-data/')\n .end((err, data) => {\n AppDispatcher.dispatch({\n actionType: ProductConstants.SET_INITIAL_DATA,\n data: JSON.parse(data.text),\n });\n });\n }", "title": "" }, { "docid": "65019be114fe8586718482e9a328c38d", "score": "0.53058505", "text": "componentDidMount() {\n //only fetches if there is an warehouseId, otherwise use the items passed through param\n if(this.props.warehouseId){\n fetch(`${serverURL}${warehousesEP}${this.props.warehouseId}`)\n .then(res=>{ \n if(res.status===200){\n this.setState({fetched:true});\n }else{\n this.setState({fetched:false});\n }\n return res.json()}) // javascript ternary operator '<question> ? <item1>:<item2>' that sets state to empty array in 404 response\n .then(data=> this.setState({warehouseInv:(data.items? data.items:[])}))\n //ternary that sets state.address.street to unknown if data.address comes back undefined(in a 404 response for example),address:(data.address? data.address:{street:'Unknown Warehouse', city:\"\"}),name:(data.name? data.name:\"\")}))\n .catch(err=>console.log(err))\n }\n }", "title": "" }, { "docid": "cd83ab189c3f7dbe7a2be5bf56646d76", "score": "0.5298928", "text": "function _init() {\n\t\t\t// do the pre-work in here\n\t\t\t\n\t\t}", "title": "" }, { "docid": "04a6a0a3572896ab611b76ebaacf35c4", "score": "0.5294756", "text": "loadData(){\n const queryString = \"https://fakerestapi.azurewebsites.net/api/Books\";\n if (queryString === this.lastQuery) {\n this.setState({ loading: false });\n return;\n }\n\n fetch(queryString)\n .then(response => response.json())\n .then(data => this.setState({\n books: data\n }))\n .catch(() => this.setState({ loading: false }));\n this.lastQuery = queryString;\n }", "title": "" }, { "docid": "ca38d5bda7a6841198968f1a37984771", "score": "0.529411", "text": "async function initLoadIlliterateDonut() {\n let jsonData = new Object();\n jsonData.affectedUsers = \"Illiterate\";\n let jsonResponse = await loadDataByFetchApi(url, jsonData);\n setIlliterateDonut(jsonResponse.Total, jsonResponse.Affected);\n}", "title": "" }, { "docid": "7457b1b43a9f405a5d4086cf0af5a58f", "score": "0.5291592", "text": "async function fetchPresets() {\n let res = await fetch(url);\n const data = await res.json();\n setPresetData(data.data);\n }", "title": "" }, { "docid": "d7943d288f50838e97f69970ccbf41c4", "score": "0.5286124", "text": "async componentDidMount(){\n //must use try/catch for async calls\n try{\n //await the response (aka resolve) from checkFetch\n await this.context.checkFetch();\n //Finally can pass the context to the function\n let newSetup = logic.setupAlgo(this.context.employeeData, this.context.positionData, this.context.dayData);\n this.setState({\n setup: newSetup\n });\n } catch (err){\n // Error Occurred\n }\n }", "title": "" }, { "docid": "7ee8d6714e89b50899df1b1f9db55886", "score": "0.5285267", "text": "async function initLoadDeafDonut() {\n let jsonData = new Object();\n jsonData.affectedUsers = \"Deaf\";\n let jsonResponse = await loadDataByFetchApi(url, jsonData);\n // console.log(jsonResponse);\n setDeafDonut(jsonResponse.Total, jsonResponse.Affected);\n}", "title": "" }, { "docid": "d1f8995c068bdf780edc324ec30b7fbe", "score": "0.5281335", "text": "prefetch() {\n if (!this.p || true) return; // Prefetch the JSON page if asked (only in the client)\n\n var href = this.getHref();\n\n _router.default.prefetch(href);\n\n prefetched[href] = true;\n }", "title": "" }, { "docid": "8acff6015228e2a0695c5c371a64a42a", "score": "0.52797824", "text": "function makeFetch() {\r\n if (offset == 1) {\r\n fetch(url + `?offset=${offset}&limit=${limit}`)\r\n .then(res => {\r\n if (res.ok) {\r\n return res.json();\r\n }\r\n })\r\n .then(data => {\r\n restCards.innerHTML = \"\"; //delete preloaders\r\n for (let i = 0; i < data.items.length; i++) {\r\n restInfo.push(data.items[i]);\r\n }\r\n offset += data.items.length;\r\n limit += data.items.length;\r\n total = data.total;\r\n if (offset >= data.total) {\r\n btnLoadCards.remove();\r\n }\r\n addRestCards();\r\n })\r\n .catch(err => console.log(err));\r\n } else {\r\n //create preloaders\r\n for (let i = 0; i < total - offset; i++) {\r\n restCards.insertAdjacentHTML(\"beforeend\", getPreloader());\r\n }\r\n fetch(url + `?offset=${offset}&limit=${limit}`)\r\n .then(res => {\r\n if (res.ok) {\r\n return res.json();\r\n }\r\n })\r\n .then(data => {\r\n let loadImgages = document.querySelectorAll(\".loaderImg\");\r\n loadImgages.forEach(img => {\r\n img.remove();\r\n });\r\n for (let i = 0; i < data.items.length; i++) {\r\n restInfo.push(data.items[i]);\r\n }\r\n offset += data.items.length;\r\n limit += data.items.length;\r\n if (offset >= data.total) {\r\n btnLoadCards.remove();\r\n }\r\n addRestCards();\r\n })\r\n .catch(err => console.log(err));\r\n }\r\n} //end function makeFetch", "title": "" }, { "docid": "c1985d3d4b13e3eecdabf09b5b5ea098", "score": "0.5279046", "text": "constructor(fetch) {\n this.fetch = fetch;\n }", "title": "" }, { "docid": "4f68531ba3f2217cc39419f913ab7729", "score": "0.527635", "text": "function initLoader() {\r\n loadPopular = loadPopular();\r\n loadNew = loadNew();\r\n query = query();\r\n suggestion = suggestion();\r\n}", "title": "" }, { "docid": "b78ec5719d6f2351651d9e15bce7a26a", "score": "0.52746075", "text": "fetch({dispatch, state}) {\n if(state.fetcher.fetched) {\n return;\n }\n\n dispatch('more');\n }", "title": "" }, { "docid": "cc322164dfcbaebefc84aede8bf0e8ea", "score": "0.5272341", "text": "function firstXHR_startReqRenderAndProceed(url_f){\n //console.log('dom_targetIds_arr: ', dom_targetIds_arr);\n //console.log('finalHTMLContent_arr inside firstXHR: ', finalHTMLContent_arr);\n if(useRawXHR === true){\n console.log('running useRawXHR.get');\n nonPromiseXHR.get(url_f, XHR_useFirstData);\n }\n\n if(usejQuery === true){\n //console.log('define nonPromise xhr method');\n console.log('running jQuery_Ajax');\n jQuery_Ajax.get(url_f, XHR_useFirstData);\n }\n\n if(usePromises=== true){\n promiseXHRfirst_start(url);\n }\n }", "title": "" }, { "docid": "53339e0c54dcff933e4584a11963c3da", "score": "0.5271339", "text": "before(callback) {\n\t\tsuper.before(error => {\n\t\t\tif (error) { return callback(error); }\n\t\t\tthis.data.userId = ObjectId(); // substitute an ID for a non-existent user\n\t\t\tcallback();\n\t\t});\n\t}", "title": "" }, { "docid": "e490586f308a599192a5661ba082ad9d", "score": "0.5267576", "text": "handlegetRequests() {\n getRequests({\n recordId: this.recordId\n })\n .then((results) => {\n this.requests = results;\n this.requestCount = results.length;\n this.isLoaded = true;\n this.rowsChecks = false;\n this.errors = undefined;\n })\n .catch((error) => {\n console.error('error handlegetRequests > ' + JSON.stringify(error));\n this.errors = JSON.stringify(error);\n });\n }", "title": "" }, { "docid": "eb7037532f955366401630f136970ef7", "score": "0.5266683", "text": "loadingData() {}", "title": "" }, { "docid": "eb7037532f955366401630f136970ef7", "score": "0.5266683", "text": "loadingData() {}", "title": "" }, { "docid": "a0140a20c3b4926c7e49aa64f3679f72", "score": "0.52635497", "text": "getCommits() {\n this.setState({loading:true});\n let commit_url = this.props.commit_url;\n\n //Cut unnecessary part from URL\n commit_url = commit_url.substring(0, commit_url.length - 6)\n\n fetch(commit_url)\n .then(this.checkStatus)\n .then(this.parseJSON)\n \n //Successful fetch\n .then(function(data) {\n this.setState({\n commitResults: data,\n error: \"\",\n loading:false\n })\n }.bind(this))\n\n //Error handling\n .catch(function(error) {\n //console.log('request failed', error)\n this.setState({error: \"Not found\"})\n this.setState({commitResults: [] })\n }.bind(this))\n \n }", "title": "" }, { "docid": "de750c7fb58bb3c5ec4024ffd654effd", "score": "0.5256811", "text": "@action fetch(options = {}) {\n // Merge in the any options with the default\n options = Object.assign({ \n url: this.url(),\n params: {},\n add: true, \n merge: true, \n remove: true \n }, options );\n\n this.setRequestLabel('fetching', true);\n\n return new Promise((resolve, reject) => {\n // Optionally the request above could also be done as\n request.get(options.url, {\n params: options.params\n })\n .then((response) => {\n this.set(response.data, { add: options.add, merge: options.merge, remove: options.remove });\n this.setRequestLabel('fetching', false);\n resolve(this, response);\n })\n .catch((error) => {\n this.setRequestLabel('fetching', false);\n reject(error);\n });\n });\n }", "title": "" }, { "docid": "f1771e140ad8ee575a5c3ad9709ad507", "score": "0.525156", "text": "async firstUpdated() {\n const res = await api.get(endPoints.ARTICLES_ROUTE);\n\n this.isLoading = false;\n this.articles = res.data.articles;\n }", "title": "" }, { "docid": "cb30540c1e60fba2b4b2420f7fc27dc9", "score": "0.5246571", "text": "_executeRequest(request){/**\n * dispatches fatal-error\n * @param detail\n */let fatal=detail=>{this.dispatchEvent(new CustomEvent(\"fatal-error\",{detail:detail,bubbles:!0,composed:!0}))};/**\n * Default API fetch\n * https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API\n */this.isLoading=!0;this.dispatchEvent(new CustomEvent(\"request-started\",{detail:request,bubbles:!0,composed:!0}));fetch(request).then(response=>{this._reworkRequest(response)}).catch(err=>{if(\"AbortError\"===err.name){this.dispatchEvent(new CustomEvent(\"request-aborted\",{detail:request,bubbles:!0,composed:!0}));console.error(\"RequestService fetch aborted: \",err)}fatal(request)})}", "title": "" }, { "docid": "a270bdb14300605f01f05a232fdc17b7", "score": "0.52427554", "text": "fetchData() {\n // gets data using predefined url above -> converts to json -> updates the state\n fetch(URL)\n .then( res => res.json())\n .then( data => {\n console.log(data);\n this.setState({\n dataSource: this.state.dataSource.cloneWithRows(data.movies),\n loaded: true,\n })\n })\n .done()\n }", "title": "" }, { "docid": "f7a5387df0bb4c280f369831e2c3012b", "score": "0.52425206", "text": "async fetchData() {\n try {\n this.setState({\n responseLoaded: false\n })\n const response = await Axios.get(poloniexUrl)\n const data = response.data\n this.setState({poloniexResponse: data, responseLoaded: true})\n this.updateResults()\n } catch (error) {\n alert(\"Error in retrieving Poloniex data: \" + error)\n }\n }", "title": "" }, { "docid": "26054ffbedd6a5ef694d6d4a89493fd8", "score": "0.52385", "text": "async fetchData(pathname, id, withKeys) {\n let options = {};\n if(withKeys) {\n options = {\n\n };\n }\n\n // Set loading flag\n this.loading = true;\n\n // Make a fetch request\n let { data } = await request.get(`${pathname}`, options);\n\n // data contains a results array\n try{\n data = data.results;\n } catch(err){\n console.log(err);\n }\n\n try{\n if(data){\n data.results && data.results.length > 0\n ? this.setData(data)\n : this.setSingle(data);\n }\n } catch(err){\n console.log(err);\n }\n\n // Switch loading flag\n this.loading = false;\n }", "title": "" }, { "docid": "58c8484637c4eebdbb5a6a1854b728be", "score": "0.5237585", "text": "componentDidMount() { \n var self = this; \n // check if pk checked and populate update details \n if(pk){\n if(this.props.student.first_name === undefined){\n // FETCH from api \n api.retrieve(updateUrl)\n .then(data => self.props.saveStudent(data))\n .then(()=>self.fetchStudent())\n \n api.retrieve(updateUrl)\n .then(data => self.props.fetchParents(data)) \n .catch(function (error) {\n return error \n }); \n }else{self.fetchStudent()}\n }else{\n self.fetchStudent()\n }\n \n }", "title": "" }, { "docid": "a9f517147f32259c7fe0e7e21c2872ba", "score": "0.52323747", "text": "_fetch(url, data) {\n if (data === undefined) {\n data = {};\n }\n\n if (!data.hasOwnProperty('headers')) {\n data.headers = {};\n }\n\n data.headers['X-API-Key'] = this.apiKey;\n\n return fetch(url, data);\n }", "title": "" }, { "docid": "5bc75da803304da0b4ce52685b05a394", "score": "0.52292013", "text": "function preloadDataFetchingRecord(map, key, fetcher) {\n let record = map.get(key);\n if (!record) {\n const thenable = fetcher();\n record = createRecordFromThenable(thenable);\n map.set(key, record);\n }\n return record;\n}", "title": "" }, { "docid": "40e29f9d3ae377a21761dfb5f518cedf", "score": "0.52285737", "text": "fetchData(state, { url, success, reject, silent, raise404 }) {\n if (!silent) {\n state.isRequesting = true;\n }\n\n return fetch(url)\n .then(response => {\n if (!response.ok) {\n state.notFound = true;\n\n if (raise404) {\n raise404();\n }\n return false;\n } else {\n return response.json();\n }\n })\n .then(data => {\n if (data) {\n state.notFound = false;\n\n success(data.consultant);\n\n if (!silent) {\n state.isRequesting = false;\n }\n }\n })\n .catch(error => {\n if (reject) reject(error);\n else console.log(\"error\", error);\n });\n }", "title": "" }, { "docid": "bd896dc88453b8882f6e03d2c43d2efb", "score": "0.5224186", "text": "load_base_data() {\n if (this._data.ds !== null) {\n this._load_base_data(this._data.l_object);\n } else {\n this._data.object.then(this._load_base_data);\n }\n }", "title": "" }, { "docid": "01af755bc3bd78bad6016d88fef1ddc6", "score": "0.52231395", "text": "componentWillMount(){\n\n //Perform API request, obtaining \"events\"\n this.retrieveData();\n\n }", "title": "" }, { "docid": "717f9c9525fd694679c8396588a0c1fb", "score": "0.5215315", "text": "async function fetchData() {\n loadArtByCreation();\n loadArtBySell();\n // if (!cancel) {\n // console.log('Home data');\n // }\n }", "title": "" }, { "docid": "2e771eb9ba8f2682b2a01b1e64d47c0e", "score": "0.52128124", "text": "componentDidUpdate() {\n // if loaded flag is already true we don't need to query the API again\n if (!this.props.loaded) {\n this.props.handleLoad();\n }\n }", "title": "" }, { "docid": "37dae3913642194d28b4ca14cb2aa04c", "score": "0.52077353", "text": "function dummyLoad() {\n var deferred = $.Deferred();\n deferred.resolve();\n return deferred.promise();\n }", "title": "" }, { "docid": "fa43311d7e78fb64a47684d35036a078", "score": "0.520096", "text": "fetchData () {\n return fetch('<URL HERE>' + this.state.itemName.toLowerCase() + '/' + this.state.pageNum)\n .then( (response) => response.json() )\n .then ( (responseJson) => {\n if(responseJson.status != \"failure\") {\n this.setState({\n isLoading: false,\n dataSource: responseJson.items\n })\n } else {\n this.setState({\n isLoading: false,\n visible: true,\n message: \"Can't find item\"\n })\n }\n })\n\n .catch((error)=> {\n console.log(error);\n });\n\n\n }", "title": "" }, { "docid": "e453a963e18a0b6ed54f455764f7bd97", "score": "0.51980245", "text": "fetchData() {\n const { filter, fetchTodos } = this.props\n fetchTodos(filter).then(() => console.log('Yeah these are loaded!')) // eslint-disable-line no-console\n }", "title": "" }, { "docid": "9eb30e724b603171f7ddbed90e6c8078", "score": "0.5197588", "text": "getData(source, name) {\n if(source===\"\") {this.mapData([], name);}\n fetch(source)\n .then(response => response.json())\n .then(function(json) {\n var arr = [];\n json.forEach(item => {\n arr.push(item);\n });\n this.mapData(arr, name);\n }.bind(this))\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "3246340b97899d7b4d8747ba961c0bd5", "score": "0.5196799", "text": "componentWillMount() {\n this.fetchDataFromAPI(); \n }", "title": "" }, { "docid": "01890e05c04df7edd0c0c101d2e3b6b0", "score": "0.51963276", "text": "function fetchData() {\n\tvar req = xhttpRequest();\n\tif (''+window.location.hostname == '') xhttpRequestFetch(req, 'xml/buddies.xml', parseData);\n\telse xhttpRequestFetch(req, 'animedb.pl?show=xml&t=buddies', parseData);\n}", "title": "" }, { "docid": "858329bbb563e75ba41ad1648d9e7339", "score": "0.5195552", "text": "setStart() {\n request\n .get(`article/get/${this.state.id}`, {\n headers: {\n \"auth-token\": localStorage.getItem(\"accessToken\"),\n },\n })\n .then((response) => response.data)\n .then((data) => {\n console.log(data)\n if (data.success) {\n this.editorComponent &&\n this.editorComponent.setContent(data.returnValuesForArticle.content)\n this.updateContent(data.returnValuesForArticle.content)\n this.setState({\n loaded: true,\n title: data.returnValuesForArticle.title,\n })\n if (data.returnValuesForArticle.is_pending) {\n this.setState({\n hasPending: true,\n buttonText: \"Pending article exists\",\n })\n }\n console.log(data)\n return data\n }\n this.editorComponent && this.editorComponent.setContent(\"\")\n this.updateContent(\"\")\n this.setState({ loaded: true })\n })\n .catch((err) => {\n this.setState({ loaded: true })\n console.log(err)\n })\n }", "title": "" }, { "docid": "97bafb290602ba163e7e693d59f17296", "score": "0.5194944", "text": "getData() {\n fetch(this.api)\n .then((response) => {\n let data = response.json();\n return data;\n })\n .then((data) => {\n // console.log(data)\n this.data = data;\n this.states = data.statewise.slice();\n\n // remove loader\n var preloader = document.getElementById(\"loader\");\n preloader.style.display = \"none\";\n\n // set to default sort\n this.sortRow(this.sortField, true);\n });\n }", "title": "" }, { "docid": "80854da8f3a941f959d117bd59a115fe", "score": "0.5194554", "text": "getData() {\n if (this.url)\n {\n let url = `${this.url}?relativePath=${this.state.relativePath}&skipCount=${this.state.skipCount}&maxItems=${this.state.maxItems}${this.state.orderBy ? `&orderBy=${this.state.orderBy} ${this.state.orderDirection} ` : \"\"}${this.include}${this.relations}${this.includeSource}`;\n xhr.get(url)\n .then(response => {\n this.setState({\n list: response.data.list,\n relations: response.data.relations || {}\n });\n });\n }\n }", "title": "" }, { "docid": "4b476dbf08739f939478b89930d3a480", "score": "0.5193665", "text": "async implementFetch (request) {\n throw (new Error('implementFetch not implemented, store is not functional'))\n }", "title": "" }, { "docid": "c691b6dfc4f81bb468c0d2fa54852e46", "score": "0.5192371", "text": "function fetchPokemonData() {\r\n let name = this.id;\r\n let url = \r\n URL + \"pokedex.php?pokemon=\" + \r\n name;\r\n fetch(url, {mode: \"cors\"})\r\n .then(checkStatus)\r\n .then(JSON.parse)\r\n .then(pokemonInformation)\r\n .catch(console.log);\r\n }", "title": "" }, { "docid": "96d2bb300d478b319027502229b1ea8d", "score": "0.5190288", "text": "componentWillMount() {\n\t\tthis.fetchRequestedItems()\n\t}", "title": "" }, { "docid": "c5f551333774717a7ca77a2735f6a80b", "score": "0.51846856", "text": "async GetInitialLoadTransactionData() {\n const response = await fetch('Home/GetInitialLoadTransactionData');\n const data = await response.json();\n this.setState({ TransactionData: data, loading: false });\n }", "title": "" } ]
253f1369fefa79254de01a870ad18d7e
Sets or gets the language. Used in conjunction with the property messages. Property type: boolean
[ { "docid": "d151f6715b11feaf888aebdf8404c29c", "score": "0.0", "text": "get keyboardNavigation() {\n\t\treturn this.nativeElement ? this.nativeElement.keyboardNavigation : undefined;\n\t}", "title": "" } ]
[ { "docid": "93e76965300e68e7a5fedb37f5b09110", "score": "0.6746043", "text": "get language () {\r\n\t\treturn this._language;\r\n\t}", "title": "" }, { "docid": "2cf89c464e4f1893ee19c5074956fce1", "score": "0.6512211", "text": "get language() {\n\t\treturn this.__language;\n\t}", "title": "" }, { "docid": "2cf89c464e4f1893ee19c5074956fce1", "score": "0.6512211", "text": "get language() {\n\t\treturn this.__language;\n\t}", "title": "" }, { "docid": "568a68457a8cb8527f6564cd1f7e9ac3", "score": "0.639221", "text": "get language() {\n return this._data.language;\n }", "title": "" }, { "docid": "0902bb0de7b35d166f1880fccdd85c95", "score": "0.63437986", "text": "setLanguage(language) {\n //Check if exists a translation for the current language or if the default\n //should be used\n var bestLanguage = this._getBestMatchingLanguage(language, this._props);\n var defaultLanguage = Object.keys(this._props)[0];\n this._language = bestLanguage;\n //Associate the language object to the this object\n if (this._props[bestLanguage]) {\n //delete default propery values to identify missing translations\n for (key of this._defaultLanguageFirstLevelKeys){\n delete this[key];\n }\n var localizedStrings = Object.assign({}, this._props[this._language]);\n for (var key in localizedStrings) {\n if (localizedStrings.hasOwnProperty(key)) {\n this[key] = localizedStrings[key];\n }\n }\n //Now add any string missing from the translation but existing in the default language\n if (defaultLanguage !== this._language) {\n localizedStrings = this._props[defaultLanguage];\n this._fallbackValues(localizedStrings, this);\n }\n }\n }", "title": "" }, { "docid": "4b0fccfcc2f9d7ac93a0884a4280b5ae", "score": "0.6326306", "text": "static setLanguage(name) {\n novelData.novel.settings.language = name;\n return UI.updateUILanguage();\n }", "title": "" }, { "docid": "4b0fccfcc2f9d7ac93a0884a4280b5ae", "score": "0.6326306", "text": "static setLanguage(name) {\n novelData.novel.settings.language = name;\n return UI.updateUILanguage();\n }", "title": "" }, { "docid": "d36d491aef67e48ed5f777495f83bdac", "score": "0.62979853", "text": "set language(lang) {\n // If lang matches current language, return\n if (lang === this.lang) return\n\n lang = this.getLanguageKey(lang)\n this.lang = lang\n window.localStorage.setItem(Translator.LOCAL_STORAGE_KEY, lang)\n this.translations = this.languages[lang]\n this.locale = this.translations.locale\n\n this.setDocumentLanguage()\n this.translate()\n }", "title": "" }, { "docid": "d4a95f111e1525820e45c83fde852814", "score": "0.6192467", "text": "get lang() {\n return this._lang;\n }", "title": "" }, { "docid": "948798c5f65311ac7d19c24d3541b2a8", "score": "0.61483705", "text": "function setCanAddLanguage()\n{\n var langs = getLangLocsInEntry();\n\n if (langs.length == g_termbaseLanguages.length)\n {\n g_canAddLanguage = false;\n }\n else\n {\n g_canAddLanguage = true;\n }\n}", "title": "" }, { "docid": "67d3d2a0773a8720efcf9bb13437b433", "score": "0.61354566", "text": "detectLanguage() {\n let lang\n\n // if language is defined in querystring, use that one\n const qs = window.location.search.substring(1)\n const m = /lang=([A-z]+)/i.exec(qs)\n if (m && m.length > 1) {\n lang = m[1]\n\n // otherwise, check local storage\n } else {\n lang = window.localStorage.getItem(Translator.LOCAL_STORAGE_KEY)\n }\n\n // If the language is not set as a query parameter\n // and\n // language is not set in localStore\n // prompt for choice\n if (!lang) this.prompt = true\n\n // this will validate the language in the setter before saving\n this.language = lang\n }", "title": "" }, { "docid": "4e9cf3e7c6b20397455b2359ee0fd047", "score": "0.60581994", "text": "get language() {\n return this._data.broadcaster_language;\n }", "title": "" }, { "docid": "56b10b56eb22cad0306c76ed8a994dbe", "score": "0.60372955", "text": "setLanguages(languages) {\n // to be overloaded by subclasses\n }", "title": "" }, { "docid": "bf3965c938befab823928aca9cb4e204", "score": "0.59776616", "text": "isSavedLang () {\n return this.$config.storage().has('locale')\n ? JSON.parse(JSON.stringify(this.$config.storage().get('locale')))\n : false\n }", "title": "" }, { "docid": "d8b9b8b1948efc389489dafbc86f2605", "score": "0.5975117", "text": "function setLanguage(newLang){\r\n\tswitch (newLang) {\r\n\t\t// German - DE - by Stevieoo\r\n\t\tcase \"de\": \taLang = [\"Aktivieren\", \"Angriffs-Email\", \"Angriffs-Alarm\", \"Spionage-Alarm\", \"Nachrichten-Alarm\", \"Auto-Login\", \"Du musst Deine eMail Adresse am Anfang des Codes einfügen, wenn Du eine eMail bekommen möchtest, wenn Du angegriffen wirst.\", \"Es muss eine funktionierende Email Adresse definiert werden, damit Du bei einem Angriff benachrichtigt wirst.\", \"Angriff in \", \"Unbekannte Angriffs-Zeit\", \"Du wirst angegriffen, aber die Flottendetails nicht nicht verfügbar.\", \"Ankunfts-Zeit\", \"Schiffe\", \"Von\", \"Nach\", \"Angriff\", \"OGame Angriff\", \"Autologin kann in Chrome nicht abgeschaltet werden. Bitte deaktiviere das Addon zum ausschalten des Autologin.\", \"OGame@Alarme.Queijo\", \"Das ist eine Testmail\", \"Das ist ein OGame@Alarm.Cheese Test\", \"OGame Alarm w/ Cheese\", \"Email für eingehene Alarme\", \"Test\", \"Ogame Alarm with Cheese - Optionen\", \"Minimale Reload-Zeit\", \"Maximale Reload-Zeit\", \"Prüfe auf alarme alle\", \"Speichern & Schließen\", \"Reload Typ Auswahl\", \"Sekunden\", \"Sprache\", \"Spenden!\", \"[OGAwC] Löschen aller cookies\", \"Bist Du sicher das Du alle OGAWC Cookies löschen möchtest? Hiermit werden deine Logindaten gelöscht und alle Einstellungen auf standard zurück gesetzt.\", \"Reset alles\", \"AutoLogin Konten\", \"Server\", \"Spieler\", \"Passwort\", \"AutoLogin\", \"Es gibts keine AutoLogin informationen. Bitte ausloggen und neu einloggen zum speichern der informationen.\", \"Ungültige Email! Beispiel: someone@somewhere.abc\", \"Eine Test Email wurde versendet! Wenn Sie kein Firefox verwenden könnte es nicht funktionieren. Denken Sie daran, das Sie etwas Spenden!\", \"Ungültige Einstellungen! Das minimum darf nicht kleiner als 100 Sekunden sein. Das Maximum darf nicht kleiner als 200 sein. Prüfen auf Angriffe darf nicht kleiner als 60 sein. Die Email Adresse muss ein @ und einen . und keine Leerzeichen enthalten.\\n'Alarm repeat' must be less than 'Check for Alarms'.\", \"Übersicht\", \"Löschen\", \"Repeat last audio alarm\", \"After\", \"(Less than 10 = OFF)\"];\r\n\t\t\t\t\taLangIndex = 1;\r\n\t\t\t\t\tbreak;\r\n\t\t// Danish - DK - by Kin0x\r\n\t\tcase \"dk\": \taLang = [\"Aktiver\", \"Angrebs email\", \"Angrebs Alarm\", \"Spionage Alarm\", \"Besked Alarm\", \"Auto Login\", \"Mangler emailURL!\", \"Du skal have en email indtastet i bunden for at kunne modtage beskeder omkring flåde angreb pr. mail.\", \"Indkommende angreb om \", \"Ukendt angrebs tid\", \"Du er under angreb, men der er ingen flåde detajler\", \"Ankommer kl.\", \"Skibe\", \"Fra\", \"Til\", \"Angreb\", \"OGame indkommende angreb\", \"AutoLogin kan ikke blive slået fra i Chrome!\", \"OGame@Alarm.Ost\", \"Dette er en test email!\", \"En test email så du kan se dit script virker!\", \"OGame Alarm med Ost\", \"Email for at modtage mails med angreb\", \"Send en test\", \"OGame Alarm Indstillinger\", \"Minimum opdateringstid (sek)\", \"Maksimum opdateringstid (sek)\", \"Check for alarms every\", \"Gem Indstillinger\", \"Select Reload Type\", \"sekund\", \"Sprog\", \"Donate!\", \"[OGAwC] Delete all cookies\", \"Are you sure you want to delete all OGAwC cookies?\\n\\nThis will delete your email and autologin information as well as reset all options to default.\", \"Reset All\", \"AutoLogin Accounts\", \"Server\", \"Player\", \"Password\", \"AutoLogin\", \"No AutoLogin account information. Please log out and log back in to save account information for AutoLogin.\", \"Improper Email. Please use the form: someone@somewhere.abc\", \"Test Email sent!\\n\\nThis may not work in non-FireFox browsers.\\n\\Remember this is not free, you should donate!\", \"Improper settings!\\n\\nMinimum cannot be set lower than 100 seconds.\\nMaximum cannot be set lower than 200 seconds.\\nCheck for Attacks cannot be set lower than 60.\\nThe email address must contain @ and . and no spaces.\\n'Alarm repeat' must be less than 'Check for Alarms'.\", \"Overview\", \"Delete\", \"Repeat last audio alarm\", \"After\", \"(Less than 10 = OFF)\"];\r\n\t\t\t\t\taLangIndex = 2;\r\n \t\t\t\t\tbreak;\r\n\t\t// Portuguese - PL - by GL_notmypresident\r\n\t\tcase \"pt\": \taLang = [\"Recarregar\", \"Email de ataque\", \"Alarme de ataque\", \"Alarme de espião\", \"Alarme mensagem\", \"Login automático\", \"Tens que preencher a variável EmailURL no topo do código. Para usar a opção de Email de ataque.\", \"Tens que inserir o teu email no fim da página do OGame para usar a opção de Email de ataque.\", \"Ataque em \", \"Tempo para o ataque desconhecido\", \"Estás a ser atacado, mas os detalhes da frota atacante são desconhecidos.\", \"Tempo de chegada\", \"Naves\", \"De\", \"Para\", \"Ataque\", \"Ataque no OGame\", \"Não é possível desactivar o Login Automático no Chrome. Tens que ir à página das extensões e desactivar o script para desactivar o Login automático.\", \"OGame@Alarme.Queijo\", \"Email de teste\", \"Um teste com queijo\", \"Alarme do OGame com queijo\", \"Email para receberes notificações de ataque\", \"Teste\", \"Ogame Alarm with Cheese Options\", \"Minimum reload time\", \"Maximum reload time\", \"Check for alarms every\", \"Salvar e Saída\", \"Select Reload Type\", \"segundo\", \"Linguagem\", \"Donate!\", \"[OGAwC] Delete all cookies\", \"Are you sure you want to delete all OGAwC cookies?\\n\\nThis will delete your email and autologin information as well as reset all options to default.\", \"Reset All\", \"AutoLogin Accounts\", \"Server\", \"Player\", \"Password\", \"AutoLogin\", \"No AutoLogin account information. Please log out and log back in to save account information for AutoLogin.\", \"Improper Email. Please use the form: someone@somewhere.abc\", \"Test Email sent!\\n\\nThis may not work in non-FireFox browsers.\\n\\Remember this is not free, you should donate!\", \"Improper settings!\\n\\nMinimum cannot be set lower than 100 seconds.\\nMaximum cannot be set lower than 200 seconds.\\nCheck for Attacks cannot be set lower than 60.\\nThe email address must contain @ and . and no spaces.\\n'Alarm repeat' must be less than 'Check for Alarms'.\", \"Overview\", \"Delete\", \"Repeat last audio alarm\", \"After\", \"(Less than 10 = OFF)\"];\r\n\t\t\t\t\taLangIndex = 3;\r\n \t\t\t\t\tbreak;\r\n\t\t// Spanish - ES - by mohace\r\n\t\tcase \"es\":\taLang = [\"Activar\", \"Ataque Emailer\", \"Ataque Alarm\", \"Espionaje Alarm\", \"Mensaje Alarm\", \"Auto Login\", \"Es necesario configurar la EmailURL en la parte superior del script para usar la alrarma de ataque entrante.\", \"Es necesario configurar la una direccion de email en la pantalla de opciones para las alertas de ataques entrantes.\", \"Ataque entrante en \", \"Hora de ataque desconocida\", \"Hay un ataque entrante, pero los detalles de la flota se desconocen\", \"Hora de llegada\", \"Naves\", \"Desde\", \"a\", \"Ataque\", \"OGame Ataque entrante\", \"No se puede desactivar AutoLogin en Chrome. Debe desactivar el script para deshabilitar el AutoLogin.\", \"OGame@Alarm.Queso\", \"Email de prueba\", \"Una prueba de este sabroso queso\", \"OGame Alarm c/ Queso\", \"Direccion Email para enviar alertas de ataque\", \"Prueba\", \"Opciones de Ogame Alarm con Queso\", \"Tiempo minimo de recarga\", \"Tiempo maximo de recarga\", \"Chequear alarmas cada\", \"Salvar & Cerrar\", \"Seleccionar el tipo de recarga\", \"segundos\", \"Lenguaje\", \"Donate!\", \"[OGAwC] Borrar todas las cookies\", \"Esta seguro de que quiere borrar todas las cookies de OGAwC?\\n\\nEsto borrará su configuracion de email (y la informacion de autologin en GreaseMonkey). Todas las opciones seran las predeterminadas.\", \"Resetear todo\", \"AutoLogin cuentas\", \"Servidor\", \"Jugador\", \"Password\", \"AutoLogin\", \"No hay informacion de AutoLogin. Por favor salga de ogame y vuelva a loguear para guardar la informacion para AutoLogin.\", \"Email incorrecto. Use el modelo: someone@somewhere.abc\", \"Email de prueba enviado!\\n\\nEsto puede no funcionar en navegadores diferentes a FireFox.\\n\\Recuerde que esto no es gratis. Haga una donacion!\", \"Configuracion incorrecta!\\n\\nEl minimo no puede ser menor a 120 seconds.\\nEl maximo no puede ser menor que 240 seconds.\\nEl tiempo de control por ataques no puede ser menor a 90 segundos..\\nLa direccion email debe contener @ and . y sin espacios.\\n'Alarm repeat' must be less than 'Check for Alarms'.\", \"Vision general\", \"Borrar\", \"Repeat last audio alarm\", \"After\", \"(Less than 10 = OFF)\"];\r\n\t\t\t\t\taLangIndex = 4;\r\n\t\t\t\t\tbreak;\r\n\t\t// Dutch - NL - by Timmy M.\r\n\t\tcase \"nl\":\taLang = [\"Activeer\", \"Val Emailer aan\", \"Aanval Alarm\", \"Spionage Alarm\", \"Berichtalarm\", \"Auto Login\", \"U moet de EmailURL bovenaan de code plaatsen om het Inkomend Aanval Email Alarm te gebruiken.\", \"U moet een geldig email adres gebruiken in het Opties scherm voor Inkomende Aanval Alarmeringen.\", \"Inkomende Aanval in \", \"Ongekende Aanvalstijd\", \"U wordt aangevallen maar de vloot details zijn niet beschikbaar.\", \"Aankomsttijd\", \"Schepen\", \"Van\", \"Naar\", \"Aanvallen\", \"OGame Inkomende Aanval\", \"Kan AutoLogin niet uitschakelen in Chrome. U zal het AutoLogin script moeten uitschakelen in je extensies.\", \"OGame@Alarm.Cheese\", \"Dit is een test email\", \"Een Kazige Test\", \"OGame Alarm met Kaas\" , \"Email adres om Aanvalsalarmen naar te sturen\", \"Test\", \"OGame Alarm met Kaas Opties\" , \"Minimum herlaadtijd\", \"Maximum herlaadtijd\", \"Alarm controleren iedere\", \"Opslaan & Afsluiten\", \"Selecteer Herlaad Type\", \"seconden\", \"Taal\", \"Doneren!\", \"[OGAmK] Alle cookies verwijderen\", \"Ben je zeker dat je alle OGAmK cookies wil verwijderen?\\n\\nDit zal je mail (en autologin informatie in GreaseMonkey) alsook alle instellingen en opties naar hun standaard terugstellen.\", \"Alles Resetten\", \"AutoLogin Profielen\", \"Server\", \"Speler\", \"Paswoord\", \"AutoLogin\", \"Geen AutoLogin profiel informatie. Gelieve uit - en terug in te loggen om profiel informatie voor AutoLogin te bewaren.\", \"Ongeldig Email Adres. Gelieve dit formaat te gebruiken: iemand@ergens.abc\", \"Test Email verzonden!\\n\\nDit kan mogelijk niet werken in niet-FireFox browsers.\\nWees indachtig dat dit niet gratis is, gelieve te doneren!\", \"Ongeldige Instellingen!\\n\\nMinimum kan niet lager dan 120 seconden zijn.\\nMaximum kan niet lager dan 240 seconden zijn.\\nAanvallen Controleren kan niet lager dan 90 zijn.\\nHet email adres moet @ en . bevatten maar geen spaties.\", \"Overzicht\", \"Verwijderen\", \"Repeat last audio alarm\", \"After\", \"(Less than 10 = OFF)\"];\r\n\t\t\t\t\taLangIndex = 5;\r\n\t\t\t\t\tbreak;\r\n\t\t// English (Default) - ORG - by Pimp Trizkit\r\n\t\tcase \"org\": // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49\r\n\t\tdefault:\taLang = [\"Activate\", \"Attack Emailer\", \"Attack Alarm\", \"Espionage Alarm\", \"Message Alarm\", \"Auto Login\", \"You need to set the EmailURL at the top of the code. To use the Incoming Attack Email Alarm.\", \"You need to set a proper email address in the options screen for the Incoming Attack alerts.\", \"Incoming Attack in \", \"Unknown Attack Time\", \"You have an Incoming attack, but the fleet details are not available\", \"Arrival Time\", \"Ships\", \"From\", \"To\", \"Attack\", \"OGame Incoming Attack\", \"Can not turn off AutoLogin in Chrome. You will have to goto your extensions and disable the script to disable AutoLogin.\", \"OGame@Alarm.Cheese\", \"This is a test email\", \"One Cheesy Test\", \"OGame Alarm w/ Cheese\", \"Email address to send Incoming Attack alerts\", \"Test\", \"Ogame Alarm with Cheese Options\", \"Minimum reload time\", \"Maximum reload time\", \"Check for alarms every\", \"Save & Close\", \"Select Reload Type\", \"seconds\", \"Language\", \"Donate!\", \"[OGAwC] Delete all cookies\", \"Are you sure you want to delete all OGAwC cookies?\\n\\nThis will delete your email (and autologin information in GreaseMonkey) as well as reset all settings and options to default.\", \"Reset All\", \"AutoLogin Accounts\", \"Server\", \"Player\", \"Password\", \"AutoLogin\", \"No AutoLogin account information. Please log out and log back in to save account information for AutoLogin.\", \"Improper Email. Please use the form: someone@somewhere.abc\", \"Test Email sent!\\n\\nThis may not work in non-FireFox browsers.\\n\\Remember this is not free, you should donate!\", \"Improper settings!\\n\\nMinimum cannot be set lower than 100 seconds.\\nMaximum cannot be set lower than 200 seconds.\\nCheck for Attacks cannot be set lower than 60.\\nThe email address must contain @ and . and no spaces.\\n'Alarm repeat' must be less than 'Check for Alarms'.\", \"Overview\", \"Delete\", \"Repeat last audio alarm\", \"After\", \"(Less than 10 = OFF)\"];\r\n\t\t\t\t\taLangIndex = 0;\r\n\t\t\t\t\tbreak;\r\n\t}\r\n}", "title": "" }, { "docid": "05c577b3b43a262ccfed0214a8a6f50d", "score": "0.5967764", "text": "toggleLanguage(){\n\t\tconst langs = this.app.getService(\"locale\"); //get Local service\n\t\t\n\t\t/*\n\t\t Use this.getRoot() to get to the top Webix widget inside a JetView\n\t\t Here it is Toolbar\n\t\t*/\n\t\tconst value = this.getRoot().queryView(\"segmented\").getValue(); //get Segmented value\n\t\tlangs.setLang(value); //set Local value\n\t}", "title": "" }, { "docid": "d0410a280799243eeaad3967d29e256e", "score": "0.59435046", "text": "get language() {\n return {\n // get|set the document language (ISO-639-1)\n get code() { return gLanguage; },\n set code(lang) { loadLocale(lang, translateFragment); },\n\n // get the direction (ltr|rtl) of the current language\n get direction() {\n // http://www.w3.org/International/questions/qa-scripts\n // Arabic, Hebrew, Farsi, Pashto, Urdu\n var rtlList = ['ar', 'he', 'fa', 'ps', 'ur'];\n return (rtlList.indexOf(gLanguage) >= 0) ? 'rtl' : 'ltr';\n }\n };\n }", "title": "" }, { "docid": "d0410a280799243eeaad3967d29e256e", "score": "0.59435046", "text": "get language() {\n return {\n // get|set the document language (ISO-639-1)\n get code() { return gLanguage; },\n set code(lang) { loadLocale(lang, translateFragment); },\n\n // get the direction (ltr|rtl) of the current language\n get direction() {\n // http://www.w3.org/International/questions/qa-scripts\n // Arabic, Hebrew, Farsi, Pashto, Urdu\n var rtlList = ['ar', 'he', 'fa', 'ps', 'ur'];\n return (rtlList.indexOf(gLanguage) >= 0) ? 'rtl' : 'ltr';\n }\n };\n }", "title": "" }, { "docid": "92e226b3272ae807208ca02a8c6a54e2", "score": "0.5874252", "text": "function SetLanguage(checkbox)\n{\n // toggle the check state of the checkbox that was clicked\n devlangsMenu.ToggleCheckState(checkbox.id);\n \n // update the label of the dropdown menu\n SetDropdownMenuLabel(devlangsMenu, devlangsDropdown);\n\t\n // update the display of the document's items that are dependent on the devlang setting\n\tcodeBlockHandler();\n\tstyleSheetHandler(\"\");\n}", "title": "" }, { "docid": "3dabb95d7248bd47f2207ae776c996c9", "score": "0.58683884", "text": "function set_lang_value(lang_)\n\t\t\t{\n\t\t\t\tLangValue = lang_;\n\t\t\t\tconsole.log('set lang:'+lang_);\n\t\t\t}", "title": "" }, { "docid": "1fae86968add60470cc200c999969b93", "score": "0.5865645", "text": "language(languageFile){\n this._BotParameters.languageFile = languageFile;\n }", "title": "" }, { "docid": "e0a8d9f89fb22ecf7f886f188e5505c1", "score": "0.5860658", "text": "function SetLanguage(checkbox)\n{\n // toggle the check state of the checkbox that was clicked\n devlangsMenu.ToggleCheckState(checkbox.id);\n \n // update the label of the dropdown menu\n SetDropdownMenuLabel(devlangsMenu, devlangsDropdown);\n\t\n // update the display of the document's items that are dependent on the devlang setting\n\tcodeBlockHandler();\n\tstyleSheetHandler(\"\");\n\t\n}", "title": "" }, { "docid": "83187cdb2902ab18dce27b840ca70f12", "score": "0.5846678", "text": "setLanguage(languageCode) {\n const flags = {};\n switch (languageCode) {\n case \"apex\":\n case \"javascript\":\n case \"typescript\":\n flags.delimter = \"//\";\n flags.blockCommentStart = this.escapeRegExp(\"/*\");\n flags.blockCommentEnd = this.escapeRegExp(\"*/\");\n flags.highlightJSDoc = true;\n break;\n case \"c\":\n case \"cpp\":\n case \"csharp\":\n case \"go\":\n case \"java\":\n case \"less\":\n case \"php\":\n case \"rust\":\n case \"scala\":\n case \"scss\":\n case \"vue\":\n flags.delimter = \"//\";\n flags.blockCommentStart = this.escapeRegExp(\"/*\");\n flags.blockCommentEnd = this.escapeRegExp(\"*/\");\n break;\n case \"sql\":\n flags.delimter = \"--\";\n break;\n case \"coffeescript\":\n case \"dockerfile\":\n case \"r\":\n case \"ruby\":\n case \"shellscript\":\n case \"yaml\":\n case \"python\":\n flags.delimter = \"#\";\n break;\n default:\n flags.supportedLanguage = false;\n break;\n }\n Object.assign(this.languageFlags, flags);\n }", "title": "" }, { "docid": "6825950f347a4b9e3094f038be9893ca", "score": "0.58306074", "text": "get audioLanguage() {\n return this._audioLanguage;\n }", "title": "" }, { "docid": "b2646da31e9a7106538713de1d15748b", "score": "0.5828526", "text": "set_language(){\n /* the data coming from the post change the source of the dashboard at the index of this specific widget*/\n if (this.parentSource) {\n this.post(\n this.root + 'actions/define_path_lang', {\n id_option: this.source.id,\n language: this.source.language,\n id_project: this.id_project\n }, (d) => {\n if ( d.success ){\n delete d.success;\n delete d.time;\n this.$nextTick( () => {\n this.source.data_widget = d.data_widget;\n this.remake_cache();\n appui.success(bbn._('Source language set'));\n this.$forceUpdate();\n });\n }\n }\n );\n }\n }", "title": "" }, { "docid": "e58c8abe1f6393e340b05f05c44ce815", "score": "0.5809924", "text": "function setLanguage() {\n try {\n var grailsLocale = GLOBAL_LOCALE_CONF.locale;\n var language = localStorage.getItem('language');\n\n // In case this is the first time setting system wide lang\n if(!language) {\n language = grailsLocale;\n }\n\n // If language on url then we do nothing\n // Using .indexOf() instead of .includes() because we need to support IE11\n if(window.location.search.indexOf('lang=') === -1) {\n // If local storage lang is the same as session then all is well in the world\n if(language !== grailsLocale) {\n window.location.search += '&lang=' + language; // Reload the page\n }\n } else {\n localStorage.setItem('language', grailsLocale);\n }\n } catch(e) {\n // localStorage not available\n }\n}", "title": "" }, { "docid": "8bf5359006572985946238aaf4822ea0", "score": "0.5797543", "text": "function changeLanguage() {\n $i18next.options.lng = $scope.user.language;\n }", "title": "" }, { "docid": "659338154b848229176c96441d6cb6f1", "score": "0.5772976", "text": "async function setLanguage() {\n language = $(\"select.language-picker\").val();\n localStorage.language = language;\n editor.session.setMode(\"ace/mode/\" + languages[language].aceName);\n if (localStorage[language + \"-\" + thisProblem] == undefined) {\n localStorage[language + \"-\" + thisProblem] = await getLanguageDefault(language);\n editor.setValue(localStorage[language + \"-\" + thisProblem]);\n } else {\n editor.setValue(localStorage[language + \"-\" + thisProblem]);\n }\n }", "title": "" }, { "docid": "cac77a321fa2c707e9a6f7d19107fd47", "score": "0.5769764", "text": "function setLanguage(language, avoidPersisting) {\n if (avoidPersisting === void 0) { avoidPersisting = false; }\n var doc = Object(__WEBPACK_IMPORTED_MODULE_0__dom_getDocument__[\"a\" /* getDocument */])();\n if (doc) {\n doc.documentElement.setAttribute('lang', language);\n }\n if (!avoidPersisting) {\n Object(__WEBPACK_IMPORTED_MODULE_1__localStorage__[\"b\" /* setItem */])('language', language);\n }\n _language = language;\n}", "title": "" }, { "docid": "cac77a321fa2c707e9a6f7d19107fd47", "score": "0.5769764", "text": "function setLanguage(language, avoidPersisting) {\n if (avoidPersisting === void 0) { avoidPersisting = false; }\n var doc = Object(__WEBPACK_IMPORTED_MODULE_0__dom_getDocument__[\"a\" /* getDocument */])();\n if (doc) {\n doc.documentElement.setAttribute('lang', language);\n }\n if (!avoidPersisting) {\n Object(__WEBPACK_IMPORTED_MODULE_1__localStorage__[\"b\" /* setItem */])('language', language);\n }\n _language = language;\n}", "title": "" }, { "docid": "2e04280911da6af2c60a8da66f3d6953", "score": "0.5762271", "text": "function changeLanguage() {\n\tif (L10N.getLanguageDisplayName() == \"English\") {\n\t\t// Change language\n\t\tL10N.setPreferredLanguage(\"mn\");\n\t\t\n\t\t// Show dialog\n Ti.UI.createAlertDialog({\n title:\"New Language Selected\",\n message:\"Mongolian is now the selected language. Please restart the app to complete the change.\"\n }).show();\t\t\n\t} else {\n\t\t// Change language\n\t\tL10N.setPreferredLanguage(\"en\");\n\t\t\n\t\t// Show dialog\n Ti.UI.createAlertDialog({\n title:\"New Language Selected\",\n message:\"English is now the selected language. Please restart the app to complete the change.\"\n }).show();\t\t\n\t}\n}", "title": "" }, { "docid": "10851bc27650b692ccf259cbee36e931", "score": "0.5761928", "text": "function changeLang(language) {\n\n if(langExists(language)){\t\n\n pageLang = language;\n\n setSessionLang(pageLang);\n\n $.each($(\".translatable\"),function(index,field) {\n\t\t\n changeFieldText(field , pageLang);\n\n \t});\n\n }else{\n console.warn(\"Trying to go to unexisting language [\" + language + \"]\");\n } \n\t\n}", "title": "" }, { "docid": "5d2306c4e44cc34f52d12b50d94c9caf", "score": "0.5721908", "text": "function Language () {\n this._languages = {};\n this._name = '';\n this._cache = false;\n this._undefinedTextMessage = '';\n this._domAttributeName = 'data-langTextName';\n this._domAttributeTarget = 'data-langTextTarget';\n this._cookieName = 'language';\n this._saveCookie = false;\n this._cookieLifeTime = 3600 * 24 * 365 * 1000;\n \n this.onLoadComplete = null;\n this.onLoadError = null;\n}", "title": "" }, { "docid": "07046b555e7c724e1ebc5bafbbcf0390", "score": "0.5710792", "text": "function setLanguage(language, avoidPersisting) {\r\n if (avoidPersisting === void 0) { avoidPersisting = false; }\r\n var doc = dom_1.getDocument();\r\n if (doc) {\r\n doc.documentElement.setAttribute('lang', language);\r\n }\r\n if (!avoidPersisting) {\r\n localStorage_1.setItem('language', language);\r\n }\r\n _language = language;\r\n}", "title": "" }, { "docid": "b0f712ec62ca58ddb574923898faf9fe", "score": "0.5702015", "text": "setPageLanguage() {\n document.documentElement.lang = getLanguage();\n }", "title": "" }, { "docid": "b82eeb560670720661be9b561ad87ee4", "score": "0.56976074", "text": "function setLanguage(language, avoidPersisting) {\n if (avoidPersisting === void 0) { avoidPersisting = false; }\n var doc = dom_1.getDocument();\n if (doc) {\n doc.documentElement.setAttribute('lang', language);\n }\n if (!avoidPersisting) {\n localStorage_1.setItem('language', language);\n }\n _language = language;\n}", "title": "" }, { "docid": "b82eeb560670720661be9b561ad87ee4", "score": "0.56976074", "text": "function setLanguage(language, avoidPersisting) {\n if (avoidPersisting === void 0) { avoidPersisting = false; }\n var doc = dom_1.getDocument();\n if (doc) {\n doc.documentElement.setAttribute('lang', language);\n }\n if (!avoidPersisting) {\n localStorage_1.setItem('language', language);\n }\n _language = language;\n}", "title": "" }, { "docid": "b82eeb560670720661be9b561ad87ee4", "score": "0.56976074", "text": "function setLanguage(language, avoidPersisting) {\n if (avoidPersisting === void 0) { avoidPersisting = false; }\n var doc = dom_1.getDocument();\n if (doc) {\n doc.documentElement.setAttribute('lang', language);\n }\n if (!avoidPersisting) {\n localStorage_1.setItem('language', language);\n }\n _language = language;\n}", "title": "" }, { "docid": "9d9443b2debdd5353a20c28c58dee75e", "score": "0.5684075", "text": "getLanguage() {\n return this._language;\n }", "title": "" }, { "docid": "44422fe0b8f78e93485809fc8b4c8306", "score": "0.56649977", "text": "function setLang(lang) {\n console.log(\"Setting active language to \" + lang);\n\n // set a cookie\n document.cookie = \"lang=\" + lang;\n\n i18nTexts.forEach(function(i18nText) {\n i18nText.reRender(lang);\n });\n}", "title": "" }, { "docid": "e3fe1f2dda13bfdea8b23273ea3516fe", "score": "0.5656847", "text": "function validateLocaleAndSetLanguage(locale, sys, errors) {\n var matchResult = /^([a-z]+)([_\\-]([a-z]+))?$/.exec(locale.toLowerCase());\n if (!matchResult) {\n if (errors) {\n errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1, \"en\", \"ja-jp\"));\n }\n return;\n }\n var language = matchResult[1];\n var territory = matchResult[3];\n // First try the entire locale, then fall back to just language if that's all we have.\n // Either ways do not fail, and fallback to the English diagnostic strings.\n if (!trySetLanguageAndTerritory(language, territory, errors)) {\n trySetLanguageAndTerritory(language, /*territory*/undefined, errors);\n }\n // Set the UI locale for string collation\n ts.setUILocale(locale);\n function trySetLanguageAndTerritory(language, territory, errors) {\n var compilerFilePath = ts.normalizePath(sys.getExecutingFilePath());\n var containingDirectoryPath = ts.getDirectoryPath(compilerFilePath);\n var filePath = ts.combinePaths(containingDirectoryPath, language);\n if (territory) {\n filePath = filePath + \"-\" + territory;\n }\n filePath = sys.resolvePath(ts.combinePaths(filePath, \"diagnosticMessages.generated.json\"));\n if (!sys.fileExists(filePath)) {\n return false;\n }\n // TODO: Add codePage support for readFile?\n var fileContents = \"\";\n try {\n fileContents = sys.readFile(filePath);\n } catch (e) {\n if (errors) {\n errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unable_to_open_file_0, filePath));\n }\n return false;\n }\n try {\n ts.localizedDiagnosticMessages = JSON.parse(fileContents);\n } catch (e) {\n if (errors) {\n errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Corrupted_locale_file_0, filePath));\n }\n return false;\n }\n return true;\n }\n }", "title": "" }, { "docid": "73b0a7918d93cdf0aed2e0680a3d4769", "score": "0.56447124", "text": "function validateLocaleAndSetLanguage(locale, sys, errors) {\n var matchResult = /^([a-z]+)([_\\-]([a-z]+))?$/.exec(locale.toLowerCase());\n if (!matchResult) {\n if (errors) {\n errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1, \"en\", \"ja-jp\"));\n }\n return;\n }\n var language = matchResult[1];\n var territory = matchResult[3];\n // First try the entire locale, then fall back to just language if that's all we have.\n // Either ways do not fail, and fallback to the English diagnostic strings.\n if (!trySetLanguageAndTerritory(language, territory, errors)) {\n trySetLanguageAndTerritory(language, /*territory*/ undefined, errors);\n }\n // Set the UI locale for string collation\n ts.setUILocale(locale);\n function trySetLanguageAndTerritory(language, territory, errors) {\n var compilerFilePath = ts.normalizePath(sys.getExecutingFilePath());\n var containingDirectoryPath = ts.getDirectoryPath(compilerFilePath);\n var filePath = ts.combinePaths(containingDirectoryPath, language);\n if (territory) {\n filePath = filePath + \"-\" + territory;\n }\n filePath = sys.resolvePath(ts.combinePaths(filePath, \"diagnosticMessages.generated.json\"));\n if (!sys.fileExists(filePath)) {\n return false;\n }\n // TODO: Add codePage support for readFile?\n var fileContents = \"\";\n try {\n fileContents = sys.readFile(filePath);\n }\n catch (e) {\n if (errors) {\n errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unable_to_open_file_0, filePath));\n }\n return false;\n }\n try {\n ts.localizedDiagnosticMessages = JSON.parse(fileContents);\n }\n catch (e) {\n if (errors) {\n errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Corrupted_locale_file_0, filePath));\n }\n return false;\n }\n return true;\n }\n }", "title": "" }, { "docid": "673c21a11606f314785f602ed779ea2c", "score": "0.5642612", "text": "function setLanguage(language) {\r\n\t\tif (mui && language && mui.language === language)\r\n\t\t\treturn;\r\n\r\n\t\tmui = new TeraToolboxMUI(language);\r\n\t\t$(\"*\").each(function () {\r\n\t\t\tconst str = $(this).attr(\"mui\");\r\n\t\t\tif (str) {\r\n\t\t\t\t$(this).text(mui.get(str));\r\n\t\t\t} else {\r\n\t\t\t\tconst str_html = $(this).attr(\"mui-html\");\r\n\t\t\t\tif (str_html)\r\n\t\t\t\t\t$(this).html(mui.get(str_html));\r\n\t\t\t}\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "beabb354ff16865afbe0dcdab3b3d0e8", "score": "0.56196475", "text": "get contentLanguage() {\n return this.getStringAttribute('content_language');\n }", "title": "" }, { "docid": "eae81c305eb9ba01f8df5a275bee50c2", "score": "0.56182826", "text": "function validateLocaleAndSetLanguage(locale, sys, errors) {\n var matchResult = /^([a-z]+)([_\\-]([a-z]+))?$/.exec(locale.toLowerCase());\n if (!matchResult) {\n if (errors) {\n errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1, \"en\", \"ja-jp\"));\n }\n return;\n }\n var language = matchResult[1];\n var territory = matchResult[3];\n // First try the entire locale, then fall back to just language if that's all we have.\n // Either ways do not fail, and fallback to the English diagnostic strings.\n if (!trySetLanguageAndTerritory(language, territory, errors)) {\n trySetLanguageAndTerritory(language, /*territory*/undefined, errors);\n }\n function trySetLanguageAndTerritory(language, territory, errors) {\n var compilerFilePath = ts.normalizePath(sys.getExecutingFilePath());\n var containingDirectoryPath = ts.getDirectoryPath(compilerFilePath);\n var filePath = ts.combinePaths(containingDirectoryPath, language);\n if (territory) {\n filePath = filePath + \"-\" + territory;\n }\n filePath = sys.resolvePath(ts.combinePaths(filePath, \"diagnosticMessages.generated.json\"));\n if (!sys.fileExists(filePath)) {\n return false;\n }\n // TODO: Add codePage support for readFile?\n var fileContents = \"\";\n try {\n fileContents = sys.readFile(filePath);\n } catch (e) {\n if (errors) {\n errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unable_to_open_file_0, filePath));\n }\n return false;\n }\n try {\n ts.localizedDiagnosticMessages = JSON.parse(fileContents);\n } catch (e) {\n if (errors) {\n errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Corrupted_locale_file_0, filePath));\n }\n return false;\n }\n return true;\n }\n }", "title": "" }, { "docid": "11f5256a4b611f2b662bdabd621019a4", "score": "0.56101966", "text": "function getLanguage() {\n\t return 'en-us';\n\t}", "title": "" }, { "docid": "11f5256a4b611f2b662bdabd621019a4", "score": "0.56101966", "text": "function getLanguage() {\n\t return 'en-us';\n\t}", "title": "" }, { "docid": "6da05fa6de9f400e61012250f8f6c7bc", "score": "0.5607824", "text": "setDocumentLanguage() {\n document.documentElement.lang = this.locale\n gtag('event', 'language_change', {\n 'event_category': 'language',\n 'event_label': this.language\n })\n }", "title": "" }, { "docid": "fc058d61584f0a8c71e4ffe925aebcc6", "score": "0.5602593", "text": "function setLocalization(locale) {\r\n\r\n if(locale != \"en\")\r\n locale = \"cn\";\r\n\r\n try {\r\n jQuery.i18n.properties( {\r\n name:'Messages',\r\n path:'properties/',\r\n mode:'map',\r\n language:locale,\r\n callback: function() {\r\n }\r\n });\r\n } catch(err) {\r\n var fileref=document.createElement('script');\r\n fileref.setAttribute(\"type\",\"text/javascript\");\r\n fileref.setAttribute(\"src\", 'js/jquery/jquery.i18n.properties-1.0.4.js');\r\n document.getElementsByTagName(\"head\")[0].appendChild(fileref);\r\n setLocalization(locale);\r\n }\r\n}", "title": "" }, { "docid": "31e830bbb47a3273a18015e4253f5b8d", "score": "0.5596705", "text": "useLanguage(lg) {\n let cityValue = this.cityForm.controls[\"dropdownCity\"].value; // obtain de select Value\n this.translate.use(lg); // Change the language\n if (lg == 'es') {\n this.spanish = true;\n }\n else {\n this.spanish = false;\n }\n if (cityValue != \"\" && cityValue != undefined && cityValue != null) {\n this.fillWeather(cityValue, lg);\n }\n }", "title": "" }, { "docid": "85c31dc17798af7f0ac69aa1ec8258b2", "score": "0.55913544", "text": "setLanguage(language) {\n this.keywords = this.rules.getKeywords();\n if (!this.keywords) {\n throw new Error(\"Language not supported yet: \" + language || \"\");\n }\n this.keywordEntries = Object.entries(this.keywords);\n this.$rules = this.getRules();\n this.normalizeRules();\n // this.embedRules(DocCommentHighlightRules, \"doc-\", [ DocCommentHighlightRules.getEndRule(\"start\") ]);\n }", "title": "" }, { "docid": "820de3ed71f93a91b41d8f85fed406b6", "score": "0.555966", "text": "_embelishI18n(message) {\r\n if (this.layer.config.i18n && this.layer.config.i18n.enabled === true) {\r\n message.language = this.layer.config.i18n.language;\r\n message.locale = this.layer.config.i18n.locale;\r\n }\r\n }", "title": "" }, { "docid": "63d1aa0e84d513108f27064da1ee5502", "score": "0.55547494", "text": "function setLanguage (lang) {\n\ti18n.global.locale.value = lang;\n\tdocument.querySelector('html').setAttribute('lang', lang);\n\tlocalStorage.setItem('VueAppLanguage', lang);\n\treturn lang;\n}", "title": "" }, { "docid": "3e7f555358b0bbbfd9d1ed877746c7c5", "score": "0.55451983", "text": "get code() { return gLanguage; }", "title": "" }, { "docid": "3e7f555358b0bbbfd9d1ed877746c7c5", "score": "0.55451983", "text": "get code() { return gLanguage; }", "title": "" }, { "docid": "92007475fe23825850e4676ab8411fda", "score": "0.5545031", "text": "set languagesList(value) {\n this._languagesList = value;\n }", "title": "" }, { "docid": "345f16856ffb22da9f6d83fac120023e", "score": "0.55402017", "text": "get isSupportedLanguage() {\n return this.SUPPORTED_LANGUAGES.indexOf(this.translateService.currentLang) > -1;\n }", "title": "" }, { "docid": "e07cf191092ceed43cb628156b1eec45", "score": "0.5529569", "text": "function setupLanguage() {\n\t\t\tfunction validateLanguage( sl ) {\n\t\t\t\treturn sl == undefined || _language.supportedLanguages.indexOf( sl ) == -1;\n\t\t\t}\n\t\t\tvar selectedLanguage = Tools.getURLParams( 'lang' );\n\t\t\tif ( validateLanguage( selectedLanguage ) ) selectedLanguage = _cookies.readCookie( 'language' );\n\t\t\tif ( validateLanguage( selectedLanguage ) ) selectedLanguage = _language.selectedLanguage;\n\t\t\t_language.set( \"selectedLanguage\", selectedLanguage );\n\n\t\t\t_cookies.createCookie( 'language', _language.selectedLanguage );\n\t\t}", "title": "" }, { "docid": "b52a83f8fbd555f73c6948eb64841c0d", "score": "0.5518118", "text": "function onChangeLanguage(e) {\n $('#languageBtn').html(_helper.toggleLanguage());\n }", "title": "" }, { "docid": "c2b67ed106cff88a7957a2f7631f6c00", "score": "0.55118823", "text": "changeLanguage({ commit }, language) {\n commit('SET_LANGUAGE', language);\n localStorage.save('locale', language, true);\n }", "title": "" }, { "docid": "e7963a2423e8618ceb00f2c3bedaa9e5", "score": "0.55079484", "text": "updateLanguage(newLanguage){\n this.webRtc.sendToAll('switchLanguage',\n {\n 'language': newLanguage\n })\n this.setState({'currentLanguage': newLanguage});\n }", "title": "" }, { "docid": "d8844ef3f8bb21071da8169d1963fdbd", "score": "0.55040264", "text": "function setDocumentLanguage() {\n // set document language\n document.documentElement.setAttribute('lang', window.blog.language);\n}", "title": "" }, { "docid": "42a63f7f55cfe4d1340e5f55d6704863", "score": "0.54831517", "text": "setLanguage (event) {\n\t\t this.setState({language: event.target.value});\n\t}", "title": "" }, { "docid": "24a0bd7b49f53bc4b0e2eb084c39b694", "score": "0.5479585", "text": "function setFormLanguage() {\n \t$(\"#languageID\").val(formLanguage);\t\n\tconsole.log(\"lang:\" + $(\"#languageID\").val());\n}", "title": "" }, { "docid": "c1d842c31af0885cddd53645d647e7b6", "score": "0.5468689", "text": "function translate()\n{\n switch (language)\n {\n case 'de':\n setTranslationVars('Verlauf des Risikos', 'jmd. zu Bashen', 'Risiko jmd. zu Bashen', 'Angriff', 'Angriffe');\n break;\n case 'en':\n setTranslationVars('Way of risk', 'to bash', 'Risk to bash', 'attack', 'attacks');\n confirmResetData = 'You are really sure to reset all the data?';\n settingsDialogCaption = 'Settings';\n break;\n case 'fr':\n setTranslationVars('Pas de risque', 'de bash', 'Risque de bash', 'attaque', 'attaques');\n break;\n default:\n setTranslationVars('Way of risk', 'to bash', 'Risk to bash', 'attack', 'attacks');\n break;\n }\n}", "title": "" }, { "docid": "f8ea03c36bdc479683d0ee0ae7b302c4", "score": "0.5461879", "text": "function setLang(lang) {\n window.localStorage.setItem(key, lang);\n}", "title": "" }, { "docid": "42a439d62170d0ee16fa1c3475eca37e", "score": "0.5459523", "text": "localStorageLang() {\n return window.localStorage.getItem(TranslateService_1.SAVE_LANGUAGE_KEY);\n }", "title": "" }, { "docid": "551322cc696fce1e06d24a96469759a6", "score": "0.544803", "text": "function langSwitch(lang){\n\t\tlanguage = lang;\n\t\t\n\t\tif(lang==\"en\"){\n\t\t\tdocument.getElementById(\"en\").setAttribute(\"disabled\", true);\n\t\t\tdocument.getElementById(\"fr\").removeAttribute(\"disabled\");\n\t\t}else{\n\t\t\tdocument.getElementById(\"fr\").setAttribute(\"disabled\", true);\n\t\t\tdocument.getElementById(\"en\").removeAttribute(\"disabled\");\n\t\t}\n\t\tchangeTextMenu(lang);\n\t\tchangeText() ;\n\t}", "title": "" }, { "docid": "081aa78271190776a79af66e6d36cf29", "score": "0.54364496", "text": "function getFormLanguage() {\n \treturn formLanguage;\t\n}", "title": "" }, { "docid": "af18d3e485ebaca7d522335f3fd80d4d", "score": "0.54288447", "text": "function setI18nLanguage (lang) {\n i18n.locale = lang;\n sessionStorage.setItem('lang', lang);\n document.querySelector('html').setAttribute('lang', lang);\n return lang;\n}", "title": "" }, { "docid": "3b65e81c4a0ea8286b79d6ae69322a36", "score": "0.5411171", "text": "get languages() {\n return this[internalDefinition].languages || {}\n }", "title": "" }, { "docid": "600ee32f0b98d33d4addc0f0662160a5", "score": "0.5383336", "text": "static set locale(value) { _locale = value; }", "title": "" }, { "docid": "b67cb8631af617a45df2176c75116b58", "score": "0.5369444", "text": "function updateLanguage() {\n recognition.lang = languageSelector.selectedOptions[0].value;\n recognition.stop();\n console.log('>> BaBL: Language changed to', languageSelector.selectedOptions[0].text);\n for (var user in dataChannels) {\n if (dataChannels[user].isLocalUserRequestingTranslatedSubtitles) {\n socket.emit('subtitles request', 'start', user, languageSelector.selectedOptions[0].value);\n }\n }\n}", "title": "" }, { "docid": "6e1e8637dbc5e86515d43970f6c1a7ca", "score": "0.5362371", "text": "changeLanguageStrings () {\r\n\t\tthis.sendMessageModalMarkup = \t\tthis.sendMessageModalMarkup.replace(\"REPLACE_modal_header_text\", this.labels.modal_header_text);\r\n\t\tthis.sendMessageModalMarkup = \t\tthis.sendMessageModalMarkup.replace(\"REPLACE_btn_cancel_text\", this.labels.btn_cancel_text);\r\n\t\tthis.sendMessageModalMarkup = \t\tthis.sendMessageModalMarkup.replace(\"REPLACE_btn_send_text\", this.labels.btn_send_text);\r\n\t\t\r\n\t\tBDfunctionsDevilBro.translateMessage(this.getName());\r\n\t}", "title": "" }, { "docid": "f9fb091ec1d2cb83fa2935ce937c7845", "score": "0.5360584", "text": "_setLocale () {\n let now_locale = '';\n switch (formatMessage.setup().locale){\n case 'en':\n now_locale='en';\n break;\n case 'zh-tw':\n now_locale= 'zh-tw';\n break;\n default:\n now_locale='en';\n break;\n }\n return now_locale;\n }", "title": "" }, { "docid": "d5d1fad6dffc3ec2e231497ba9b821f6", "score": "0.53585804", "text": "__initGlobalLanguageVariables() {\n const defaultLanguage = UdeS.Language.defaultLanguage;\n const supportedLanguages = UdeS.Language.supportedLanguages;\n\n // Retrieve the navigator language\n // @see http://gu.illau.me/posts/the-problem-of-user-language-lists-in-javascript/\n // @see https://developer.mozilla.org/en-US/docs/Web/API/NavigatorLanguage/language\n const navigatorLanguage = navigator.language ||\n navigator.userLanguage ||\n navigator.browserLanguage ||\n navigator.systemLanguage ||\n defaultLanguage;\n\n // Retrieve the navigator languages\n // (with a fallback if the navigator.languages is not defined)\n // @see https://developer.mozilla.org/fr/docs/Web/API/NavigatorLanguage/languages\n let navigatorLanguages = [navigatorLanguage];\n if (navigator.languages && navigator.languages.length) {\n navigatorLanguages = navigator.languages;\n }\n\n // Compute the global variables\n const globalLanguages = this.__computeGlobalLanguageVariables(\n defaultLanguage, supportedLanguages,\n navigatorLanguage, navigatorLanguages\n );\n\n // Update the global variables\n UdeS.Language.lang = UdeS.Language.lang || globalLanguages.language;\n UdeS.Language.navigatorLanguage = globalLanguages.navigatorLanguage;\n UdeS.Language.navigatorLanguages = globalLanguages.navigatorLanguages;\n\n // Set or update the lang attribute of the html element\n this._updateLangAttributeOfHtml(UdeS.Language.lang);\n }", "title": "" }, { "docid": "8db7470ac612ecdfad3a82926dffdae3", "score": "0.5350331", "text": "function checkLang() {\n var user_language;\n user_language = user_language || locale.language\n \n console.log(user_language.slice(0, 2))\n var lang = user_language.slice(0, 2)\n console.log(lang)\n switch(lang) {\n case \"en\":\n message = \"To continue using K·pay test product please visit kzl.io/code and enter this code: \";\n inPurchase = \"Please complete the purchase process on kzl.io/code to unlock K·pay test product \";\n popUp = \"This is a paid app. After a 1 hour free trial, it requires a one-time payment of $1.00 to keep using it. \"; \n alreadyPaid = \"When the app asks for payment again, use the 'Already purchased' button at the bottom of purchase page to unlock for free.\"\n alreadyPaidButton = \"Already Paid\"\n break;\n case 'de':\n message = \"Um das K · pay-Testprodukt weiterhin zu verwenden, besuchen Sie kzl.io/code und geben Sie diesen Code ein: \";\n inPurchase = \"Bitte schließen Sie den Kaufvorgang auf kzl.io/code ab, um das K · pay-Testprodukt freizuschalten\";\n popUp = \"Dies ist eine kostenpflichtige App. Nach einer 1-stündigen kostenlosen Testversion ist eine einmalige Zahlung von 1,00 US-Dollar erforderlich, um sie weiterhin verwenden zu können.\"\n alreadyPaid = \"Wenn die App erneut zur Zahlung auffordert, können Sie sie über die Schaltfläche Bereits gekauft am unteren Rand der Kaufseite kostenlos entsperren.\"\n alreadyPaidButton = \"Bereits bezahlt\"\n console.log(\"German\")\n case 'fr':\n inPurchase = \"Veuillez compléter le processus d'achat sur kzl.io/code pour déverrouiller le produit de test K · pay\";\n message = \"Pour continuer à utiliser le produit de test K · pay, visitez le site kzl.io/code et entrez le code suivant: \";\n popUp = \"Ceci est une application payante. Après une heure d'essai gratuite, un paiement unique de 1,00 USD est nécessaire pour continuer à l'utiliser.\";\n alreadyPaid = \"Lorsque l'application demande à nouveau de payer, utilisez le bouton Déjà acheté en bas de la page d'achat pour le déverrouiller gratuitement.\"\n alreadyPaidButton = \"Déjà payé\"\n break;\n case 'es':\n message = \"Para continuar usando el producto de prueba K · pay, visite kzl.io/code e ingrese este código:\";\n inPurchase = \"Complete el proceso de compra en kzl.io/code para desbloquear el producto de prueba K · pay\";\n popUp = \"Esta es una aplicación de pago. Después de una prueba gratuita de 1 hora, se requiere un pago único de $ 1.00 para seguir usándolo.\";\n alreadyPaid = \"Cuando la aplicación solicite el pago nuevamente, use el botón Ya comprado en la parte inferior de la página de compra para desbloquear de forma gratuita.\"\n alreadyPaidButton = \"Ya Pagado\"\n break;\n case 'it':\n message = \"Per continuare a utilizzare il prodotto K · pay test, visitare kzl.io/code e inserire questo codice: \";\n inPurchase = \"Si prega di completare il processo di acquisto su kzl.io/code per sbloccare il prodotto di prova di pagamento K · Pay \";\n popUp = \"Questa è un'app a pagamento. Dopo 1 ora di prova gratuita, è necessario un pagamento una tantum di $ 1,00 per continuare a utilizzarlo.\";\n alreadyPaid = \"Quando l'app richiede nuovamente il pagamento, utilizza il pulsante Già acquistato nella parte inferiore della pagina di acquisto per sbloccarlo gratuitamente.\"\n alreadyPaidButton = \"Già pagato\"\n break;\n case 'ja':\n message = \"K・ペイテスト製品を引き続き使用するには、kzl.io/codeにアクセスして以下のコードを入力してください:\";\n inPurchase = \"K・ペイテスト製品のロックを解除するには、kzl.io/codeの購入手続きを完了してください\";\n popUp = \"これは有料アプリです。 1時間の無料試用期間を経た後も、それを使用し続けるには1回限りの$ 1.00の支払いが必要です。\"\n alreadyPaid = \"アプリがもう一度支払いを要求すると、購入ページの下部にある[購入済]ボタンを使用して無料でロックを解除します。\"\n alreadyPaidButton = \"既に支払いました\" \n break;\n default:\n message = \"To continue using K·pay test product please visit kzl.io/code and enter this code: \";\n inPurchase = \"Please complete the purchase process on kzl.io/code to unlock K·pay test product \";\n popUp = \"This is a paid app. After a 1 hour free trial, it requires a one-time payment of $1.00 to keep using it.\"; \n alreadyPaid = \"When the app asks for payment again, use the 'Already purchased' button at the bottom of purchase page to unlock for free.\"\n alreadyPaidButton = \"Already Paid\"\n break;\n }\n}", "title": "" }, { "docid": "b43a7387fd9e72c88a7b5ccaecdfc973", "score": "0.53395987", "text": "function set_language(language) {\n\n\tif ( GLOBALS.AvailableLiterals.hasOwnProperty(language.value) )\t \n\t\t\t{ console.log('DEBUG : setting language: ' + language.value + '\\n');\t }\n\telse \t{\n\t \t\tconsole.log('DEBUG : LANGUAGE NOT FOUND IN DICTIONARY: ' + language.value +' \\n');\t \t\n\t \t\tconsole.log('DEBUG : USING DEFAULT LANGUAGE AS ENGLISH\\n');\n\t \t\tlanguage.value = \"English\" ;\n\t }\n\t\t\n\tGLOBALS.Literals = GLOBALS.AvailableLiterals[language.value].value;\n\t\t \n\tdocument.getElementById('step1_label_1').innerHTML=GLOBALS.Literals.step1_label_1;\n\tdocument.getElementById('step1_label_3').innerHTML=GLOBALS.Literals.step1_label_3;\n\tdocument.getElementById('step1_label_4').innerHTML=GLOBALS.Literals.step1_label_4;\n\tdocument.getElementById('step1_label_5').innerHTML=GLOBALS.Literals.step1_label_5;\n\tdocument.getElementById('step1_label_6').innerHTML=GLOBALS.Literals.step1_label_6;\n\tdocument.getElementById('step1_label_8').innerHTML=GLOBALS.Literals.step1_label_8;\n\tdocument.getElementById('step1_label_9').innerHTML=GLOBALS.Literals.step1_label_9;\n\tdocument.getElementById('step1_label_10').innerHTML=GLOBALS.Literals.step1_label_10;\t\n\t$('#label_choose_size').html(GLOBALS.Literals.label_choose_size);\n\t$('#label_sculpture_material').html(GLOBALS.Literals.label_sculpture_material);\n\t$('#sculpture_material_1').html(GLOBALS.Literals.sculpture_material_1);\n\t$('#sculpture_material_2').html(GLOBALS.Literals.sculpture_material_2);\n\t$('#sculpture_material_3').html(GLOBALS.Literals.sculpture_material_3);\n\t$('#price_label').html(GLOBALS.Literals.price_label);\n\t$('#label_number_copies').html(GLOBALS.Literals.label_number_copies);\n\t$('#label_Resume_Options').html(GLOBALS.Literals.label_Resume_Options);\n\t$('#label_About_Make_it').html(GLOBALS.Literals.label_About_Make_it);\n\t$('#label_Close_application').html(GLOBALS.Literals.label_Close_application);\n\t$('#menu_about').html(GLOBALS.Literals.menu_about);\n\t$('#menu_sculpture_settings').html( GLOBALS.Literals.menu_sculpture_settings);\n\t$('#menu_gallery').html(GLOBALS.Literals.menu_gallery);\t\n\t$('#label_change_language').html(GLOBALS.Literals.label_change_language);\n\t$('#menu_change_language').html(GLOBALS.Literals.label_change_language);\t\n\t$('#label_choose_Settings').html(GLOBALS.Literals.label_choose_Settings);\n\t$('#label_Sculpture_Settings').html(GLOBALS.Literals.label_Sculpture_Settings); \t\n\t$('#boton_paypal').attr(\"src\", GLOBALS.Literals.paypal_button);\t\n\t$('#label_accept_terms').html(GLOBALS.Literals.label_accept_terms); \t\t\n\t$('#now_conecting_Paypal').html(GLOBALS.Literals.now_conecting_Paypal);\n\t$('#now_file_uploading').html(GLOBALS.Literals.now_file_uploading);\t\n\t$('#now_file_uploaded').html(GLOBALS.Literals.now_file_uploaded);\n\t$('#now_file_uploaded_thank_text').html(GLOBALS.Literals.now_file_uploaded_thank_text );\t\n\t$('#label_noArtistAvailable').html(GLOBALS.Literals.label_noArtistAvailable);\t\n \t$('#label_your_artist').html(GLOBALS.Literals.label_your_artist);\n\t$('#label_your_artist').html(GLOBALS.Literals.label_your_artist); \n\t$('#website').html(GLOBALS.Literals.artist_website);\t\n\tdocument.getElementById('tutorial_1').innerHTML=GLOBALS.Literals.tutorial_1;\n\tdocument.getElementById('tutorial_2').innerHTML=GLOBALS.Literals.tutorial_2;\n\tdocument.getElementById('tutorial_3').innerHTML=GLOBALS.Literals.tutorial_3;\n\tdocument.getElementById('tutorial_4').innerHTML=GLOBALS.Literals.tutorial_4;\n\tdocument.getElementById('tutorial_5').innerHTML=GLOBALS.Literals.tutorial_5;\n\tdocument.getElementById('tutorial_6').innerHTML=GLOBALS.Literals.tutorial_6;\n\tdocument.getElementById('tutorial_7').innerHTML=GLOBALS.Literals.tutorial_7;\t\n\tdocument.getElementById('label_number_figures').innerHTML=GLOBALS.Literals.label_number_figures;\n\tdocument.getElementById('label_option_number_figures_1_or_2').innerHTML=GLOBALS.Literals.label_option_number_figures_1_or_2;\n\tdocument.getElementById('label_option_number_figures_group').innerHTML=GLOBALS.Literals.label_option_number_figures_group;\t\n\t\n}", "title": "" }, { "docid": "051fceb31e9a627e6033111aa9a20745", "score": "0.53385735", "text": "constructor() {\n super();\n this.language = '';\n }", "title": "" }, { "docid": "bf31c0378ea48f5df160a119a453b5ac", "score": "0.5332507", "text": "wait_for_language_known() {\n\t\treturn this.language_known;\n\t}", "title": "" }, { "docid": "f54319f5fd1f6a9a8bac0af06d660153", "score": "0.5328609", "text": "get currentLang() {\n return this.latestLang;\n }", "title": "" }, { "docid": "d005583cea2b4ba426e45e620bf2c2a9", "score": "0.5317119", "text": "function setTopLanguage(langName){\n progLang.innerText = langName\n }", "title": "" }, { "docid": "908620c4e5a57eb573f6ba15e4f540e7", "score": "0.53119516", "text": "function change_lang(val)\n{\n\tlang \t\t = val;\n\tchange_lang_ = true;\n\tdisplay();\n\tchange_lang_ = false;\n}", "title": "" }, { "docid": "8c16ebdf4c38fca67f4b2ec8fd015527", "score": "0.53087085", "text": "function choixLangue() {\nif (boutonlangue.selection.index == 0)\n{\nDutranslator.setLanguage('en');\napp.settings.saveSetting('duik','lang','en');\n}\nfor (var i = 0 ; i < Dutranslator.languages.length ; i++)\n{\nif (Dutranslator.languages[i][1] == boutonlangue.selection.text)\n{\nDutranslator.setLanguage(Dutranslator.languages[i][0]);\napp.settings.saveSetting('duik','lang',Dutranslator.languages[i][0]);\nbreak;\n}\n}\n}", "title": "" }, { "docid": "8b80cfe7f312d5dec2039540b70bda3e", "score": "0.5274639", "text": "function UpdateLanguage(event) {\n update_language(event.target.value);\n i18n.changeLanguage(event.target.value);\n //Locale is retrieved from the i18n translations therefore dispatch the update after changing the language\n update_locale(t(`common:locale`));\n update_region(t(`common:region`));\n }", "title": "" }, { "docid": "c42c99beb56e07af14516261830b634e", "score": "0.526506", "text": "set locale(_locale) {\n let message = null;\n try {\n if (!Object.keys(this[localeList]).includes(_locale)) {\n throw new Error(ERROR.NO_LOCALE);\n }\n this[locale] = _locale;\n this[set](_locale);\n message = 'OK';\n } catch (e) {\n ({ message } = e);\n }\n return message;\n }", "title": "" }, { "docid": "576f7d9e93a6b087be1bc0c8fb6a69ce", "score": "0.5263912", "text": "function setLanguages() {\n\n switch (setLanguage) {\n case Languages.ENGLISH:\n daytime_night = en_daytime_night;\n daytime_morning = en_daytime_morning;\n daytime_noon = en_daytime_noon;\n daytime_afternoon = en_daytime_afternoon;\n daytime_evening = en_daytime_evening;\n\n greeting_night = en_greeting_night;\n greeting_morning = en_greeting_morning;\n greeting_noon = en_greeting_noon;\n greeting_afternoon = en_greeting_afternoon;\n greeting_evening = en_greeting_evening;\n\n sunday = en_sunday;\n monday = en_monday;\n tuesday = en_tuesday;\n wednesday = en_wednesday;\n thursday = en_thursday;\n friday = en_friday;\n saturday = en_saturday;\n\n abbreviation_sunday = en_abbreviation_sunday;\n abbreviation_monday = en_abbreviation_monday;\n abbreviation_tuesday = en_abbreviation_tuesday;\n abbreviation_wednesday = en_abbreviation_wednesday;\n abbreviation_thursday = en_abbreviation_thursday;\n abbreviation_friday = en_abbreviation_friday;\n abbreviation_saturday = en_abbreviation_saturday;\n\n january = en_january;\n february = en_february;\n march = en_march;\n apil = en_april;\n may = en_may;\n june = en_june;\n july = en_july;\n august = en_august;\n september = en_september;\n october = en_october;\n november = en_november;\n december = en_december;\n\n greeting_startup = en_greeting_startup;\n\n date_pattern = en_date_pattern;\n upcoming_events_soon_pattern = en_upcoming_events_soon_pattern;\n\n app_search = en_app_search;\n app_email = en_app_email;\n app_youtube = en_app_youtube;\n app_calendar = en_app_calendar;\n app_news = en_app_news;\n\n google_account = en_google_account;\n settings = en_settings;\n back = en_back;\n only_mirror = en_only_mirror;\n\n settings_title = en_settings_title;\n calendar_title = en_calendar_title;\n email_title = en_email_title;\n news_title = en_news_title;\n google_account_title = en_google_account_title;\n\n google_account_function_heading_signed_in = en_google_account_function_heading_signed_in;\n google_account_function_heading_permissions = en_google_account_function_heading_permissions;\n google_account_function_permission_calendar = en_google_account_function_permission_calendar;\n google_account_function_permission_gmail = en_google_account_function_permission_gmail;\n google_account_function_permission_profile = en_google_account_function_permission_profile;\n google_account_function_heading_signed_out = en_google_account_function_heading_signed_out;\n google_account_function_heading_features = en_google_account_function_heading_features;\n google_account_function_feature_gmail = en_google_account_function_feature_gmail;\n google_account_function_feature_profile = en_google_account_function_feature_profile;\n google_account_function_feature_calendar = en_google_account_function_feature_calendar;\n\n settings_system_title = en_settings_system_title;\n settings_calendar_title = en_settings_calendar_title;\n settings_weather_title = en_settings_weather_title;\n\n settings_languages_subtitle = en_settings_languages_subtitle;\n settings_temperature_unit_subtitle = en_settings_temperature_unit_subtitle;\n settings_only_mirror_subtitle = en_settings_only_mirror_subtitle;\n settings_sources_subtitle = en_settings_sources_subtitle;\n settings_location_subtitle = en_settings_location_subtitle;\n\n settings_english_label = en_settings_english_label;\n settings_german_label = en_settings_german_label;\n settings_celsius_label = en_settings_celsius_label;\n settings_farenheit_label = en_settings_farenheit_label;\n settings_show_nothing_label = en_settings_show_nothing_label;\n settings_show_quote_label = en_settings_show_quote_label;\n settings_normal_entries_label = en_settings_normal_entries_label;\n settings_birthdays_label = en_settings_birthdays_label;\n settings_holidays_label = en_settings_holidays_label;\n\n settings_location_placeholder = en_settings_location_placeholder;\n break;\n case Languages.GERMAN:\n daytime_night = de_daytime_night;\n daytime_morning = de_daytime_morning;\n daytime_noon = de_daytime_noon;\n daytime_afternoon = de_daytime_afternoon;\n daytime_evening = de_daytime_evening;\n\n greeting_night = de_greeting_night;\n greeting_morning = de_greeting_morning;\n greeting_noon = de_greeting_noon;\n greeting_afternoon = de_greeting_afternoon;\n greeting_evening = de_greeting_evening;\n\n sunday = de_sunday;\n monday = de_monday;\n tuesday = de_tuesday;\n wednesday = de_wednesday;\n thursday = de_thursday;\n friday = de_friday;\n saturday = de_saturday;\n\n abbreviation_sunday = de_abbreviation_sunday;\n abbreviation_monday = de_abbreviation_monday;\n abbreviation_tuesday = de_abbreviation_tuesday;\n abbreviation_wednesday = de_abbreviation_wednesday;\n abbreviation_thursday = de_abbreviation_thursday;\n abbreviation_friday = de_abbreviation_friday;\n abbreviation_saturday = de_abbreviation_saturday;\n\n january = de_january;\n february = de_february;\n march = de_march;\n apil = de_april;\n may = de_may;\n june = de_june;\n july = de_july;\n august = de_august;\n september = de_september;\n october = de_october;\n november = de_november;\n december = de_december;\n\n greeting_startup = de_greeting_startup;\n\n date_pattern = de_date_pattern;\n upcoming_events_soon_pattern = de_upcoming_events_soon_pattern;\n\n app_search = de_app_search;\n app_email = de_app_email;\n app_youtube = de_app_youtube;\n app_calendar = de_app_calendar;\n app_news = de_app_news;\n\n google_account = de_google_account;\n settings = de_settings;\n back = de_back;\n only_mirror = de_only_mirror;\n\n settings_title = de_settings_title;\n calendar_title = de_calendar_title;\n email_title = de_email_title;\n news_title = de_news_title;\n google_account_title_base = de_google_account_title;\n\n google_account_function_heading_signed_in = de_google_account_function_heading_signed_in;\n google_account_function_heading_permissions = de_google_account_function_heading_permissions;\n google_account_function_permission_calendar = de_google_account_function_permission_calendar;\n google_account_function_permission_gmail = de_google_account_function_permission_gmail;\n google_account_function_permission_profile = de_google_account_function_permission_profile;\n google_account_function_heading_signed_out = de_google_account_function_heading_signed_out;\n google_account_function_heading_features = de_google_account_function_heading_features;\n google_account_function_feature_gmail = de_google_account_function_feature_gmail;\n google_account_function_feature_profile = de_google_account_function_feature_profile;\n google_account_function_feature_calendar = de_google_account_function_feature_calendar;\n\n settings_system_title = de_settings_system_title;\n settings_calendar_title = de_settings_calendar_title;\n settings_weather_title = de_settings_weather_title;\n\n settings_languages_subtitle = de_settings_languages_subtitle;\n settings_temperature_unit_subtitle = de_settings_temperature_unit_subtitle;\n settings_only_mirror_subtitle = de_settings_only_mirror_subtitle;\n settings_sources_subtitle = de_settings_sources_subtitle;\n settings_location_subtitle = de_settings_location_subtitle;\n\n settings_english_label = de_settings_english_label;\n settings_german_label = de_settings_german_label;\n settings_celsius_label = de_settings_celsius_label;\n settings_farenheit_label = de_settings_farenheit_label;\n settings_show_nothing_label = de_settings_show_nothing_label;\n settings_show_quote_label = de_settings_show_quote_label;\n settings_normal_entries_label = de_settings_normal_entries_label;\n settings_birthdays_label = de_settings_birthdays_label;\n settings_holidays_label = de_settings_holidays_label;\n\n settings_location_placeholder = de_settings_location_placeholder;\n break;\n }\n\n weatherFunction();\n timerFunction();\n if(signedIn){\n refreshCalendarEntryData();\n }\n}", "title": "" }, { "docid": "d90a3bcf3c34dc00d5f254a27233c391", "score": "0.52633184", "text": "function set_editor_language(editor,language_code){\n\tget_editor_ime_selector(editor).selectLanguage(language_code);\n\t//Setup the default input method as configured\n\tif(TranslatorsDeskGlobals.default_input_methods(language_code)){\n\t\tset_editor_input_method(editor, TranslatorsDeskGlobals.default_input_methods(language_code))\n\t}\n}", "title": "" }, { "docid": "22322c543db7f2fe376b3af1f1a2e4d0", "score": "0.5260216", "text": "function getLanguage() {\n \"use strict\";\n return AquaThiefGame.language;\n}", "title": "" }, { "docid": "fbeb46171147d17590ede866e91a7027", "score": "0.5259237", "text": "function changeLanguage(languageCode) {\n recognition.lang = languageCode;\n}", "title": "" }, { "docid": "842bbc7083600fa5cd1ca3ef9b7259a2", "score": "0.5243472", "text": "function MapLanguageToFlag(lang) {\n switch (lang) {\n case \"V\":\n lang = \"vn\";\n break;\n case \"I\":\n lang = \"id\";\n break;\n case \"E\":\n lang = \"gb\";\n break;\n case \"M\":\n lang = \"mm\";\n break;\n case \"T\":\n lang = \"et\";\n break;\n case \"K\":\n lang = \"ko\";\n break;\n default:\n lang = \"df\";\n }\n\n return lang;\n}", "title": "" }, { "docid": "e0bae13b495f802beeb484e1641298f0", "score": "0.52418673", "text": "function setI18nLanguage (lang) {\n i18n.locale = lang;\n axios.defaults.headers.common['Accept-Language'] = lang;\n document.querySelector('html').setAttribute('lang', lang);\n return lang;\n}", "title": "" }, { "docid": "2b37f5f0974994199ae7e709c15d9287", "score": "0.52351516", "text": "function setLanguageConfig(inStr) {\n if (typeof(Storage) !== \"undefined\") {\n // Web storage is supported\n\t\ttry {\n\t\t\tlocalStorage.setItem('TPBankUserLang', inStr);\n\t\t}\n\t\tcatch(err) {\n\t\t\tlogInfo('Browser not support local store');\n\t\t}\n }\n else {\n // Web storage is NOT supported\n logInfo('Browser not support local store');\n }\n}", "title": "" }, { "docid": "433cb76b53d90642115311030bb40586", "score": "0.5229038", "text": "function LoginLibV18__setLanguageCode(languageCode) {\n return new Promise(function(resolve, reject) {\n // Block#: qR6iUAA45gzy77nbO/:I\n _that.LoginLibV18_currentLanguage = (com.fc.JavaScriptDistLib.TextLib.convertToText(languageCode));\n // Block#: gn,E,Emb!afJ|(k^T=Pl\n com.fc.JavaScriptDistLib.Storage.add('language', com.fc.JavaScriptDistLib.TextLib.convertToText(languageCode))\n });\n }", "title": "" }, { "docid": "37bb88e8823d59352965825bc1de4c5d", "score": "0.5217528", "text": "function setModelLanguage(model, language) {\n StaticServices.modelService.get().setMode(model, StaticServices.modeService.get().getOrCreateMode(language));\n}", "title": "" }, { "docid": "22e14ddacc62a2ddc0d555708920e627", "score": "0.52147967", "text": "getAvailableLanguages() {\n if (!this._availableLanguages) {\n this._availableLanguages = [];\n for (let language in this._props) {\n this._availableLanguages.push(language);\n }\n }\n return this._availableLanguages;\n }", "title": "" }, { "docid": "9eab5be5397515cfa0fe28651eaab305", "score": "0.5213731", "text": "function changeLanguage(language)\n{\n\tvar createUser = false;\n\tvar resetPass= false;\n\n\tif(document.body.contains(document.getElementById(\"createUserDiv\"))) createUser = true;\n\tif(document.body.contains(document.getElementById(\"passwordResetDiv\"))) resetPass = true;\n\n\t/* Load the home page with the correct language */\n\tif(language == \"en\")\n\t{\n\t\twindow.location.href = 'index_en.html';\n\t}\n\telse\n\t{\n\t\twindow.location.href = 'index.html';\n\t}\n\n\t// DOES NOT WORK\n\n\t/* Inject in the page the code for the section the user was before of the language change. */\n\tif(createUser == true)\n\t{\n\t\tinjectCreateUser();\n\t}\n\telse if(resetPass == true)\n\t{\n\t\tinjectPasswordReset();\n\t}\n}", "title": "" }, { "docid": "d5883eee979948d120f7413a02f6fb2d", "score": "0.5212459", "text": "function isSupportedByLangService(language) {\n switch (language) {\n case 'css':\n case 'scss':\n case 'less':\n return true;\n default:\n return false;\n }\n}", "title": "" }, { "docid": "9cac597fb4db9c7697c9c58717b03134", "score": "0.5200944", "text": "onClickSwitchLanguage() {\n this.model.switchLanguage();\n this.render();\n }", "title": "" }, { "docid": "e0bbaebe3a8b5f3b2d025059ad391591", "score": "0.5199857", "text": "function changeLanguage(lang)\r\n\t\t\t\t{\r\n\t\t\t\t\tvar langResources = getLanguageResources()[lang];\r\n\t\t\t\t\t\r\n\t\t\t\t\t//localStorage.setItem(\"uravupaalamLanguage\",JSON.stringify(lang));\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(\"span[name='label']\").each(function(i, elt)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$(elt).text(langResources[$(elt).attr(\"caption\")]);\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\t$(\"div[name='label']\").each(function(i, elt)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$(elt).text(langResources[$(elt).attr(\"caption\")]);\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(\"a[name='label']\").each(function(i, elt)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$(elt).text(langResources[$(elt).attr(\"caption\")]);\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(\"option[name='label']\").each(function(i, elt)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$(elt).text(langResources[$(elt).attr(\"caption\")]);\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tlocalStorage.setItem(\"uravupaalamLanguage\",JSON.stringify(lang));\r\n\t\t\t\t\t\r\n\t\t\t\t}", "title": "" }, { "docid": "521e9dc87029f26e68859e5c8a948363", "score": "0.518947", "text": "function changeLanguage(lang){\n language = languages[lang];\n $(\"#current_language\").html(lang);\n editor.getSession().setMode(\"ace/mode/\"+language);\n if(isDriver){\n socket.emit(\"lang_change\", {language: lang});\n }\n}", "title": "" } ]
ad0312c104298bff802a307bf383f0a3
hide mute toggle if the current tech doesn't support volume control
[ { "docid": "9ad99f9c63ac07118f29a88d11dbbe42", "score": "0.7128578", "text": "function updateVisibility() {\n if (player.tech_ && player.tech_['featuresVolumeControl'] === false) {\n this.addClass('vjs-hidden');\n } else {\n this.removeClass('vjs-hidden');\n }\n }", "title": "" } ]
[ { "docid": "cb3750a2191ee5bc9ab7cff154935e7a", "score": "0.7850713", "text": "toggleVolume() {\n if (this.isMuted) {\n this.unmute();\n } else {\n this.mute();\n }\n }", "title": "" }, { "docid": "eaf4d1254784c86d03067fad24dc525f", "score": "0.7658586", "text": "function toggleMute() {\n video.muted = !video.muted;\n \n if (video.muted) {\n volume.setAttribute('data-volume', volume.value);\n volume.value = 0;\n } else {\n volume.value = volume.dataset.volume;\n }\n }", "title": "" }, { "docid": "6a99a5826343dbfe53776dabd188ac71", "score": "0.7603418", "text": "function muteVideo() {\n\tvideo.muted = !video.muted;\n\tif (video.muted) {\n\t\t$('#volumeOn').css('display', 'none');\n\t\t$('#volumeOff').css('display', 'inline-block');\n\t}\n\telse {\n\t\t$('#volumeOff').css('display', 'none');\n\t\t$('#volumeOn').css('display', 'inline-block');\n\t}\n}", "title": "" }, { "docid": "abfe782d35836fe7f3a7fecc648e629e", "score": "0.7545891", "text": "function setMute() {\n if($('#muteButton').hasClass('btn-info')) {\n\t\t$('#muteButton').removeClass('btn-info').addClass('btn-danger');\n\t\t$('#mute').removeClass('icon-volume-up').addClass('icon-volume-off');\n\t\t//vwfMedia.setMute( true );\n \n vwf_view.kernel.callMethod( vwf_view.kernel.application(), \"setLocalMute\", { \"moniker\": vwf_view.kernel.moniker() , \"value\": true } );\n }\n else {\n\t\t$('#muteButton').removeClass('btn-danger').addClass('btn-info');\n\t\t$('#mute').removeClass('icon-volume-off').addClass('icon-volume-up');\n\t\t//vwfMedia.setMute( false );\n\n vwf_view.kernel.callMethod( vwf_view.kernel.application(), \"setLocalMute\", { \"moniker\": vwf_view.kernel.moniker() , \"value\": false } );\n }\n}", "title": "" }, { "docid": "bde4d44f6a6b3c17af7fc51b951ea089", "score": "0.7533629", "text": "toggleVolume () {\n\t\tconst volumeButton = this.wrapperPlayer.querySelector('.v-volume')\n\n\t\tif (volumeButton.classList.contains('v-muted')) {\n\t\t\tthis.unMute()\n\t\t} else {\n\t\t\tthis.mute()\n\t\t}\n\t}", "title": "" }, { "docid": "0a918f54dd7fcdab645d0561e331834c", "score": "0.75190085", "text": "function mute() {\n track.enabled = false;\n }", "title": "" }, { "docid": "104e9165d0c0e19317c472baa2232546", "score": "0.7410205", "text": "function setMuteStop() {\r\n setMuteOn = false;\r\n }", "title": "" }, { "docid": "0f6cb156d42e5bf4bb68bef4d2fce579", "score": "0.73923516", "text": "function toggleMute() {\n \n const volume = document.getElementById('volume');\n const video = document.getElementById('video');\n video.muted = !video.muted;\n if (video.muted) {\n volume.setAttribute('data-volume', volume.value);\n volume.value = 0;\n } else {\n volume.value = volume.dataset.volume;\n }\n}", "title": "" }, { "docid": "c246c3aa18ab89e5e08f443e13678239", "score": "0.7343077", "text": "function toggleMute(){\n if(is_muted){\n unmute();\n }else{\n mute();\n }\n}", "title": "" }, { "docid": "90e0e29faf26384973ff38ba408db613", "score": "0.7340744", "text": "function mute(){\n localStream.getAudioTracks()[0].enabled = !(localStream.getAudioTracks()[0].enabled);\n console.log('muted');\n $('.btn-secondary span').toggleClass('fa-microphone fa-microphone-slash');\n \n}", "title": "" }, { "docid": "0cda3fa06756dbf88786bc17744de8a5", "score": "0.7312455", "text": "function audioMute() {\n if (soundMute === false) {\n soundMute = true;\n lastVolume = volumeSlider.value;\n volumeSlider.value = 0;\n } else if (soundMute === true) {\n soundMute = false;\n volumeSlider.value = lastVolume;\n }\n}", "title": "" }, { "docid": "ec0fcc0ab53c46621a89b8d871c9f70f", "score": "0.73106456", "text": "function d(){c.tech_&&c.tech_.featuresVolumeControl===!1?this.addClass(\"vjs-hidden\"):this.removeClass(\"vjs-hidden\")}", "title": "" }, { "docid": "dc005425b57a827dfb1cdf3c0edde320", "score": "0.7309473", "text": "function toggleMute() {\n if (videoPlayer.muted) {\n // Change the cutton to be a mute button\n changeButtonIcon(muteIcon, 'glyphicon-headphones', 'glyphicon-volume-off');\n // Unmute the media player\n videoPlayer.muted = false;\n } else {\n // Change the button to be an unmute button\n changeButtonIcon(muteIcon, 'glyphicon-volume-off', 'glyphicon-headphones');\n // Mute the media player\n videoPlayer.muted = true;\n }\n}", "title": "" }, { "docid": "ef5f88ecc73d94d44660ae2a47533b20", "score": "0.73035014", "text": "function toggleMute() {\n mute = !mute;\n if (mute) {\n $(\"#mute\").html(\"Unmute\");\n } else {\n $(\"#mute\").html(\"Mute\");\n }\n}", "title": "" }, { "docid": "49460a42b5626a3aa9589fabd918556f", "score": "0.7275607", "text": "function toggleMute() {\n\tif (videoScreen.muted) {\n\t\t// Change the cutton to be a mute button\n\t\tchangeButtonType(muteBtn, 'mute');\n\t\t// Unmute the media player\n\t\tvideoScreen.muted = false;\n\t\tvideoWebcam.muted = false;\n\t}\n\telse {\n\t\t// Change the button to be an unmute button\n\t\tchangeButtonType(muteBtn, 'unmute');\n\t\t// Mute the media player\n\t\tvideoScreen.muted = true;\n\t\tvideoWebcam.muted = true;\n\t}\n}", "title": "" }, { "docid": "e412a68d636768e2944b2709a3a989ce", "score": "0.72693056", "text": "function vidmute() {\n if (vid.muted) {\n vid.muted = false;\n muteBtn.innerHTML = \"<i class='fa fa-volume-up'></i>\";\n } else {\n vid.muted = true;\n muteBtn.innerHTML = \"<i class='fa fa-volume-off'></i>\";\n }\n}", "title": "" }, { "docid": "24c581c0d5abb2f7ec2b58876f9962e2", "score": "0.7248474", "text": "function unMute() { \n if (cpCmndMute == true) { \n cpCmndMute = false; \n }\n }", "title": "" }, { "docid": "bdfc0785d16cebbffe2885162ca2c0da", "score": "0.724575", "text": "function toggleMute() {\n\t\t\t\tvideo.muted = !video.muted;\n\t\t\t}", "title": "" }, { "docid": "22187a2b6f3570c8adba546389a430e7", "score": "0.7229033", "text": "function muteUnmute(){\n if(music.volume > 0){\n currentVolume = music.volume;\n music.volume = 0;\n updateVolumeBar();\n } else {\n music.volume = currentVolume;\n updateVolumeBar();\n }\n}", "title": "" }, { "docid": "de92f6db8558f22151a6c8cfdbdd9101", "score": "0.72060823", "text": "function muteWebCam() {\n if (localStream.getAudioTracks()[0].enabled) {\n localStream.getAudioTracks()[0].enabled = false;\n // $('#mute').val('Unmute');\n $('.wrtc-button-mute').html('<i class=\"fa fa-microphone-slash fa-2x\"></i>');\n }\n else {\n localStream.getAudioTracks()[0].enabled = true;\n // $('#mute').val('Mute');\n $('.wrtc-button-mute').html('<i class=\"fa fa-microphone fa-2x\"></i>');\n }\n }", "title": "" }, { "docid": "4ea1c38bd6d1c2a0b5f7888bade4c5c8", "score": "0.71677655", "text": "function mutedControl(){\n video.muted = !video.muted;\n updateVolBtn();\n}", "title": "" }, { "docid": "4d92679a0e6d4919725a6196decae657", "score": "0.7160139", "text": "function vidMute() {\n\tif (video.muted) {\n\t\tvolumeRange.value = lastVal;\n\t\tvideo.muted = false;\n\t\tmuteBtn.classList.remove('glyphicon-volume-off');\n\t\tmuteBtn.classList.add('glyphicon-volume-up');\n\t\tvolumeRange.value = volumeRange.value / 100;\n\t\tvolumeRange.value = lastVal;\n\t} else {\n\t\tvideo.muted = true;\n\t\tvolumeRange.value = 0;\n\t\tmuteBtn.classList.remove('glyphicon-volume-up');\n\t\tmuteBtn.classList.add('glyphicon-volume-off');\n\t}\n}", "title": "" }, { "docid": "80b1f412f2a5a668d38ac09f03449780", "score": "0.7121079", "text": "toggleVolumeOnAndOff() {\n const {\n volume,\n handleVolumeChange,\n } = this.props;\n\n if (volume === 0) {\n handleVolumeChange(65);\n } else {\n handleVolumeChange(0);\n }\n }", "title": "" }, { "docid": "f9da2e7e10bb4b7bb9db4f347a60ac01", "score": "0.7100318", "text": "function muteUnmuted(){\t\t\t\n\t\t\tif(audioPlayer.muted){\n\t\t\t\taudioPlayer.muted=false;\n\t\t\t\t$(\"#sound_button #button #reverseIcon\").css({\"display\":\"none\"});\n\t\t\t\t$(\"#sound_button #button #icon\").css({\"display\":\"block\"});\n\t\t\t\t$(\"#soundBar #slideBar\").slider(\"enable\")\n\t\t\t\t.animate({\"opacity\":1},500);\n\t\t\t}else{\n\t\t\t\taudioPlayer.muted=true;\n\t\t\t\t$(\"#sound_button #button #reverseIcon\").css({\"display\":\"block\"});\n\t\t\t\t$(\"#sound_button #button #icon\").css({\"display\":\"none\"});\t\n\t\t\t\t$(\"#soundBar #slideBar\").slider(\"disable\")\t\n\t\t\t\t.animate({\"opacity\":0.5},500);\t\t\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "a275fa3e03aa542585cec160cdfe9170", "score": "0.70760435", "text": "function updateVisibility() {\n if (player.tech_ && player.tech_.featuresVolumeControl === false) {\n this.addClass('vjs-hidden');\n } else {\n this.removeClass('vjs-hidden');\n }\n }", "title": "" }, { "docid": "a275fa3e03aa542585cec160cdfe9170", "score": "0.70760435", "text": "function updateVisibility() {\n if (player.tech_ && player.tech_.featuresVolumeControl === false) {\n this.addClass('vjs-hidden');\n } else {\n this.removeClass('vjs-hidden');\n }\n }", "title": "" }, { "docid": "a275fa3e03aa542585cec160cdfe9170", "score": "0.70760435", "text": "function updateVisibility() {\n if (player.tech_ && player.tech_.featuresVolumeControl === false) {\n this.addClass('vjs-hidden');\n } else {\n this.removeClass('vjs-hidden');\n }\n }", "title": "" }, { "docid": "a275fa3e03aa542585cec160cdfe9170", "score": "0.70760435", "text": "function updateVisibility() {\n if (player.tech_ && player.tech_.featuresVolumeControl === false) {\n this.addClass('vjs-hidden');\n } else {\n this.removeClass('vjs-hidden');\n }\n }", "title": "" }, { "docid": "a275fa3e03aa542585cec160cdfe9170", "score": "0.70760435", "text": "function updateVisibility() {\n if (player.tech_ && player.tech_.featuresVolumeControl === false) {\n this.addClass('vjs-hidden');\n } else {\n this.removeClass('vjs-hidden');\n }\n }", "title": "" }, { "docid": "127afe6b5ca05a349378b7f447a43d56", "score": "0.70530707", "text": "function toggleMute() {\r\n var myVideo = document.getElementById(\"myVideo\");\r\n var mute = document.getElementById(\"mute\");\r\n if (myVideo.muted) {\r\n mute.innerHTML = \"Mute\";\r\n myVideo.muted = false;\r\n } else {\r\n mute.innerHTML = \"Unmute\";\r\n myVideo.muted = true;\r\n }\r\n}", "title": "" }, { "docid": "df80d17206283762f6f9c223fedb81fb", "score": "0.7052991", "text": "function muteUnmute() {\n if (userStream.getAudioTracks()[0].enabled) {\n userStream.getAudioTracks()[0].enabled = false;\n micButton.style.backgroundImage = 'url(\"/images/mic_off.png\")';\n } else {\n userStream.getAudioTracks()[0].enabled = true;\n micButton.style.backgroundImage = 'url(\"/images/mic.png\")';\n }\n}", "title": "" }, { "docid": "0ecb08a85493a1a1f5340f40f2e9e7f2", "score": "0.701421", "text": "mute() {\r\n this.setMuted(true);\r\n }", "title": "" }, { "docid": "01414068142f4556734ee3a83b785f1e", "score": "0.6998182", "text": "function updateVisibility() {\n\t if (player.tech_ && player.tech_['featuresVolumeControl'] === false) {\n\t this.addClass('vjs-hidden');\n\t } else {\n\t this.removeClass('vjs-hidden');\n\t }\n\t }", "title": "" }, { "docid": "5b441721251a90019c2b59ff79f9341f", "score": "0.69890803", "text": "muteMic() { \n if (this.localStream) {\n this.muted = true\n this.localStream.getAudioTracks()[0].enabled = false\n }\n }", "title": "" }, { "docid": "51164f2612e4f34d934c8d4123b6335d", "score": "0.6987345", "text": "function toggleMuteAudio(){\n $(\"#mainTheme\").prop(\"muted\",!$(\"#mainTheme\").prop(\"muted\"));\n}", "title": "" }, { "docid": "cc6bd3eb46b35452327e62adca4e0326", "score": "0.6971425", "text": "isMuted() { return; }", "title": "" }, { "docid": "2811e32d2668648fe28e5b7c28f3ec04", "score": "0.6958224", "text": "mute () {\n\t\tthis.methodMute()\n\t\tthis.wrapperPlayer.querySelector('.v-volume').classList.add('v-muted')\n\t}", "title": "" }, { "docid": "35f897dee3b60ad2b2794242cb499f19", "score": "0.6951555", "text": "function toggleVolume() { // Run On Click On Icon Volume For Mute Volume\n 'use strict';\n buttonVolume.classList.toggle('fa-volume-up');\n buttonVolume.classList.toggle('fa-volume-off');\n if (buttonVolume.classList.contains('fa-volume-off')) {\n video.muted = true;\n rangeVolume.value = 0;\n iconCloseVolume.style.display = \"block\";\n } else {\n video.muted = false;\n rangeVolume.value = volumeVal;\n iconCloseVolume.style.display = \"none\";\n if (rangeVolume.value === 0) {\n video.volume = 0.2;\n rangeVolume.value = 0.2;\n iconCloseVolume.style.display = 'none';\n rangeVolume.onchange = function () { video.muted = false; video.volume = this.value; };\n rangeVolume.onmousemove = function () { video.muted = false; video.volume = this.value; };\n }\n }\n}", "title": "" }, { "docid": "24c27687968ceacad916e335f7810f5c", "score": "0.6949374", "text": "unmuteMic() {\n if (this.localStream) {\n this.muted = false\n this.localStream.getAudioTracks()[0].enabled = true\n }\n }", "title": "" }, { "docid": "484f47a3cd7ed1aded0419780a97e61d", "score": "0.69370115", "text": "function volumen() {\n\n\t\t\t\tsoundtrack.volume = (volumeAudio.value) * 0.01;\n\t\t\t\taudioUpdate =soundtrack.volume\n\t\t\t\trangeUpdate = volumeAudio.value\n\t\t\t\tif (soundtrack.volume > 0) {\n\t\t\t\t\tvolumeOff.style.display = 'none'\n\t\t\t\t\tvolumeOn.style.display = 'block'\n\t\t\t\t} else {\n\t\t\t\t\tvolumeOn.style.display = 'none'\n\t\t\t\t\tvolumeOff.style.display = 'block'\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "fead27db4149a853c626d8b6da69c94a", "score": "0.6933194", "text": "unMute () {\n\t\tthis.methodUnMute()\n\t\tthis.wrapperPlayer.querySelector('.v-volume').classList.remove('v-muted')\n\t}", "title": "" }, { "docid": "52357bfcc6fa8daa92b91cb388abd359", "score": "0.6917357", "text": "function toggleMute(con){\n\tcreatejs.Sound.setMute(con);\t\n}", "title": "" }, { "docid": "52357bfcc6fa8daa92b91cb388abd359", "score": "0.6917357", "text": "function toggleMute(con){\n\tcreatejs.Sound.setMute(con);\t\n}", "title": "" }, { "docid": "6a240d04905b1a7f80df8b0a9f346725", "score": "0.6916589", "text": "_onVolumeClick() {\n const {\n muteVideoRequest,\n userDid,\n muteNowPlaying,\n mutePreview,\n } = this.props;\n muteVideoRequest({\n muteNowPlaying: userDid && muteNowPlaying ? muteNowPlaying : mutePreview,\n mutePreview: !mutePreview,\n userDid: !!(userDid && muteNowPlaying),\n });\n }", "title": "" }, { "docid": "68d986ed0e32079ae014f2b0eaa53bed", "score": "0.69037527", "text": "function updateVolumeIcon() {\n volumeIcons.forEach(icon => {\n icon.classList.add('hidden');\n });\n \n volumeButton.setAttribute('data-title', 'Mute (m)')\n \n if (video.muted || video.volume === 0) {\n volumeMute.classList.remove('hidden');\n volumeButton.setAttribute('data-title', 'Unmute (m)')\n } else if (video.volume > 0 && video.volume <= 0.5) {\n volumeLow.classList.remove('hidden');\n } else {\n volumeHigh.classList.remove('hidden');\n }\n }", "title": "" }, { "docid": "fae1031091188cba04010175fe05c171", "score": "0.69024146", "text": "function unmute() {\n track.enabled = true;\n }", "title": "" }, { "docid": "da73e5e681578f728e8bbb50eb6f3427", "score": "0.688267", "text": "function mute() {\n sendCmd(\"mute\");\n }", "title": "" }, { "docid": "8de8d0da736b845cc59e4ddcfa557c6f", "score": "0.68742377", "text": "function muteSong() {\r\n if (mute == false) {\r\n soundIcon.classList.remove(\"fa-volume-up\");\r\n soundIcon.classList.add(\"fa-volume-mute\");\r\n track.volume = 0;\r\n mute = true;\r\n }\r\n else {\r\n soundIcon.classList.remove(\"fa-volume-mute\");\r\n soundIcon.classList.add(\"fa-volume-up\");\r\n track.volume = 1;\r\n mute = false;\r\n }\r\n}", "title": "" }, { "docid": "ce5497e7062991af6155efcce2c9ad43", "score": "0.68420976", "text": "unmute() {\r\n this.setMuted(false);\r\n }", "title": "" }, { "docid": "f8d2c8d2d93f5ed81c1c7e3e2f269aab", "score": "0.681876", "text": "toggleMuted() {\r\n this.setMuted(!this._muted);\r\n }", "title": "" }, { "docid": "6666901a5abb12e3e6b623fa173a9cbc", "score": "0.68060845", "text": "function onVolumeControlClick(){\n\tif(_CONFIG.mute){\n\t\t_CONFIG.mute = false;\n\t\t_CONFIG.theme.volume = 1;\n\t\tdocument.getElementById(\"volumeControl\").src = \"./assets/volume_on.png\";\n\t}else{\n\t\t_CONFIG.mute = true;\n\t\t_CONFIG.theme.volume = 0;\n\t\tdocument.getElementById(\"volumeControl\").src = \"./assets/volume_off.png\";\n\n\t\t// Update Achievement\n\t\tincrementAchievementProgress(6, 1);\n\t}\n}", "title": "" }, { "docid": "76cfa9383fe35f83435d74f6dbe56577", "score": "0.68007445", "text": "toggleVolume() {\n this.volumeOn = !this.volumeOn;\n this.setProgress(this.getProgressPlayed());\n if (this.isPlaying()) {\n this.play();\n }\n }", "title": "" }, { "docid": "144d212516a70dd4df70315168df6cd6", "score": "0.679783", "text": "function handleVolumeClick() {\n if (videoPlayer.muted) {\n videoPlayer.muted = false;\n volumeBtn.innerHTML = '<i class=\"fas fa-volume-up\"></i>'\n volumeRange.value = videoPlayer.volume //unmute하면 원래 음량range로\n } else {\n videoPlayer.muted = true;\n volumeBtn.innerHTML = '<i class=\"fas fa-volume-mute\"></i>';\n volumeRange.value = 0; //mute되면 range value값이 0이 되도록.\n }\n}", "title": "" }, { "docid": "406c449cea047d20d67903d430680c22", "score": "0.67764485", "text": "getMuted() {\r\n return this.volume === 0 ? true : this._muted;\r\n }", "title": "" }, { "docid": "99f43935b1822f2286cad960ff45da3e", "score": "0.6757708", "text": "function offVolume(){\n\t\t\t\t/*if (Audio === undefined) {\n\t\t\t\t\tAudio = document.getElementById($scope.objectPlayList[0])\n\t\t\t\t}*/\n\t\t\t\tsoundtrack.volume = 0\n\t\t\t\tvolumeAudio.value = 0\n\n\t\t\t\tvolumeOn.style.display = 'none'\n\t\t\t\tvolumeOff.style.display = 'block'\n\t\t\t}", "title": "" }, { "docid": "ed9a1115965f122e42022f6ae5984d3e", "score": "0.67544746", "text": "isMuted() {\n const track = this.localAudioTrack || this.localVideoTrack;\n if (!track) {\n return false;\n }\n return !track.enabled;\n }", "title": "" }, { "docid": "5208f6bcf44cb78318407186043150d3", "score": "0.67411274", "text": "function processMute (data) {\n controls.setMute(data)\n}", "title": "" }, { "docid": "87636e942e654c4349623974f2bac332", "score": "0.6736174", "text": "function muteSound(){\n if (muted) {\n muted = false;\n document.getElementById(\"mute\").innerHTML = \"Mute Sound\";\n } else {\n muted = true;\n document.getElementById(\"mute\").innerHTML = \"Unmute Sound\";\n }\n}", "title": "" }, { "docid": "19a692d3761df11ef87e1cfa1b3f9a2b", "score": "0.6714285", "text": "function mute(music) {\n if (sound === true) {\n sound = false;\n music.volume = 0;\n\n\n } else {\n sound = true;\n\n }\n playSound(music);\n}", "title": "" }, { "docid": "fd3772d86a64c9b6856bb576a98ba4fb", "score": "0.6702017", "text": "function muteMic() { // stream is your local WebRTC stream\n\t\t\t\tconsole.log(\"mic muted\");\n \t\t\t\t var audioTracks = mystream.getAudioTracks();\n \t\t\t\tfor (var i = 0, l = audioTracks.length; i < l; i++) {\n \t\t\t\t audioTracks[i].enabled = false;//!audioTracks[i].enabled;\n \t\t\t\t }\n\t\t\t}", "title": "" }, { "docid": "171f60390108e7c1f8198790d8e92afd", "score": "0.6682819", "text": "function muteUnmuteHandler0(e) {\n console.log(' call muter');\n clearInterval(creative.myTimer_endVideoShort);\n \n // moveVideoControls();\n creative.myVideo.vidPauseBtn.style.visibility = 'visible';\n\n if (creative.myVideo.vid.volume == 0.0) {\n // Enabler.counter(\"Unmute video 0\", true);\n creative.myVideo.vid.volume = 1.0;\n creative.myVideo.vidMuteBtn.style.visibility = 'visible';\n creative.myVideo.vidUnmuteBtn.style.visibility = 'hidden';\n } else {\n // Enabler.counter(\"Mute video 0\", true);\n creative.myVideo.vid.volume = 0.0;\n creative.myVideo.vidMuteBtn.style.visibility = 'hidden';\n creative.myVideo.vidUnmuteBtn.style.visibility = 'visible';\n }\n}", "title": "" }, { "docid": "9bb9e98f0491b7a7af8bf190a63c3053", "score": "0.66749763", "text": "function musicController() {\n if (audio.isMusicMuted === true) {\n audio.isMusicMuted = false;\n audio.musicBtn.innerHTML = \"On\";\n playMusic();\n } else if (audio.isMusicMuted === false) {\n audio.isMusicMuted = true;\n audio.musicBtn.innerHTML = \"Off\";\n stopMusic();\n }\n}", "title": "" }, { "docid": "a1786e04499f97bbf6b93a8e3364cad0", "score": "0.66748315", "text": "set muted(value) {\n this.media.muted = value;\n // if(value === true){\n // this.media.muted = true\n // }else{\n // this.media.muted = false\n // }\n }", "title": "" }, { "docid": "4bcd84e402ea9ffb1526470d4e2bc799", "score": "0.6669756", "text": "function mute(){\n if (video.muted){\n video.muted = false;\n }else {\n video.muted = true;\n }\n}", "title": "" }, { "docid": "48b735b351c4815e90725466294b877c", "score": "0.6668874", "text": "onAudioMute (id, isMuted) {\n if (APP.conference.isLocalId(id)) {\n localVideoThumbnail.showAudioIndicator(isMuted);\n } else {\n let remoteVideo = remoteVideos[id];\n if (!remoteVideo)\n return;\n\n remoteVideo.showAudioIndicator(isMuted);\n if (APP.conference.isModerator) {\n remoteVideo.updateRemoteVideoMenu(isMuted);\n }\n }\n }", "title": "" }, { "docid": "ae6d0bd7cb821838635eb087b1c6f464", "score": "0.666219", "text": "function soundEffectController() {\n if (audio.isSoundMuted === true) {\n audio.isSoundMuted = false;\n audio.soundEffectBtn.innerHTML = \"On\";\n } else if (audio.isSoundMuted === false) {\n audio.isSoundMuted = true;\n audio.soundEffectBtn.innerHTML = \"Off\";\n }\n}", "title": "" }, { "docid": "de1078568747dcdf7421c0bc0f35a7d6", "score": "0.6649464", "text": "function _videoVolume(event) {\n var element = event.target;\n var delayer = muteDelays[element.id];\n\n if (delayer) {\n clearTimeout(delayer);\n }\n\n if (element.muted || element.volume === 0) {\n muteDelays[element.id] = setTimeout(function () {\n console.log('videoMuted', event);\n sendEvent('mute');\n }, 100);\n } else {\n muteDelays[element.id] = setTimeout(function () {\n console.log('videoUnMuted', event);\n sendEvent('unmute');\n }, 100);\n }\n }", "title": "" }, { "docid": "d155b0e8ac5e231626cba479365a6e14", "score": "0.6643933", "text": "function muteMe(elem, muteToggle) {\n\telem.muted = muteToggle;\n}", "title": "" }, { "docid": "5b686d559ee600c2a93356c9db7adffb", "score": "0.6642016", "text": "unmute() {\n this.media.muted = false;\n }", "title": "" }, { "docid": "4dfd08c90b95a85227e6c49e70931dd4", "score": "0.66417575", "text": "get isMuted() {\n\t\treturn this._refs.video.muted;\n\t}", "title": "" }, { "docid": "af1460179231bf961fb7af05e88eb83e", "score": "0.66266423", "text": "function toggleMusic(musicElm, maxVolLvl, minVolLvl, zeroVolLvl){\n\t\tif (musicElm.volume >= minVolLvl)\n\t\t{\n\t\t\tmusicElm.volume = zeroVolLvl;\t\n\t\t} else\n\t\t{\n\t\t\tmusicElm.volume = maxVolLvl;\n\t\t}\t\t\t\t\n\t}", "title": "" }, { "docid": "80108c3a3a7cc93beeb0d10af4ad2b4b", "score": "0.6614683", "text": "function showMuteButton(call) {\r\n var peerconnection = call.getPeerConnection();\r\n if (peerconnection == null) {\r\n // For certain rehydration case, peerconnection maybe null, we also need to show buttons.\r\n muteButton(call, true);\r\n return;\r\n }\r\n peerconnection.getLocalStreams().map(function(stream) {\r\n stream.getAudioTracks().map(function(audioTrack) {\r\n muteButton(call, audioTrack.enabled);\r\n });\r\n });\r\n }", "title": "" }, { "docid": "d3277291a286472e8d3b31ba973329a9", "score": "0.6596109", "text": "function toggleMuteAudio(){ \n $(\"audio\").prop(\"muted\",!$(\"audio\").prop(\"muted\")); //prop is for property\n}", "title": "" }, { "docid": "34317466ba4b5c1eb2b3a1a4a2925b0e", "score": "0.6574878", "text": "mute () {\n this._muted = true;\n }", "title": "" }, { "docid": "4ac577e719a3de89b232b08cf0857aee", "score": "0.6573261", "text": "function UnMuteThisVideo(){\n\t\tytp.unMute();\n\t\tTweenLite.set('#muteOff', {alpha: 1, y: 0});\n\t\tTweenLite.set('#muteOn', {alpha: 0, y: -40});\n\t\tEnabler.counter('YTVideo UnMute');\n}", "title": "" }, { "docid": "222adbea14746fa8309bb8638ba75085", "score": "0.6572383", "text": "function muteRemote() {\n var inverse = remoteVid.muted ? false : true\n remoteVid.muted = inverse;\n if (inverse) {\n remotemutebtn.className = \"btn btn-primary float-left w-100\"\n remotemutebtn.innerHTML = \"Unmute\"\n }\n else {\n remotemutebtn.className = \"btn float-left w-100 btn-outline-primary\"\n remotemutebtn.innerHTML = \"Mute\"\n }\n}", "title": "" }, { "docid": "e6c3c4238d81088e1e6059411419d5ec", "score": "0.6569686", "text": "isMuted () {\n return this.tag ? this.tag.muted : null\n }", "title": "" }, { "docid": "99b4a90f8f5af8b66fa37b0e02f6caaa", "score": "0.65680826", "text": "methodMute () {\n\t\tthis.player.muted = true\n\t\tthis.player.setAttribute('muted', '')\n\t}", "title": "" }, { "docid": "98331a16274cd155c4c81b4b585fb365", "score": "0.65459365", "text": "function updateVolumeIcon() {\n \n const volumeIcons = document.querySelectorAll('.volume-button g');\n const volumeButton = document.getElementById('volume-button');\n\n const video = document.getElementById('video');\n\n const volumeLow = document.querySelector(\"#volume-low\");\n const volumeHigh = document.querySelector(\"#volume-high\");\n\n volumeIcons.forEach((icon) => {\n icon.setAttribute('visibility', 'hidden');\n });\n\n volumeButton.setAttribute('data-title', 'Mute (m)');\n\n const volumeMute = document.querySelector(\"#volume-mute\");\n if (video.muted || video.volume === 0) {\n volumeMute.setAttribute('visibility',\"visible\"); //.classList.remove('hidden');\n \n volumeButton.setAttribute('data-title', 'Unmute (m)');\n\n } else if (video.volume > 0 && video.volume <= 0.5) {\n volumeLow.setAttribute('visibility',\"visible\"); //.classList.remove('hidden');\n } else {\n volumeHigh.setAttribute('visibility',\"visible\"); //.classList.remove('hidden');\n }\n}", "title": "" }, { "docid": "641b68f830696d7ca8157dfd9ac7d609", "score": "0.654446", "text": "mute() {\n this._muted = true;\n }", "title": "" }, { "docid": "9186a042b0b1efd6eec63d28f31e3cd0", "score": "0.65440273", "text": "function mute(){\n\t var song = document.querySelector('audio');\n\t if(song.muted)\n\t {\n\t song.muted=false;\n\t }\n else\n\t {\n\t\t song.muted = true;\n\n\t\t }\n }", "title": "" }, { "docid": "d7424bc1817d4e2691889cfdb2df3dd0", "score": "0.65425825", "text": "_onTrackMuteChanged(jitsiTrack) {\n if (jitsiTrack.isLocal()) {\n return;\n }\n const participant = jitsiTrack.getParticipantId();\n const isMuted = jitsiTrack.isMuted();\n\n this.debug(\"Mute changed to\", isMuted, \"for\", jitsiTrack.getType(), \"for participant\", participant);\n\n if (jitsiTrack.getType() === \"video\") {\n this._render();\n }\n }", "title": "" }, { "docid": "6056999d6732bd1a5e39ef266263f13b", "score": "0.6529063", "text": "mute() {\n this.media.muted = true;\n }", "title": "" }, { "docid": "2d7a8b56eeaf2f96f080e79c7f23ee73", "score": "0.6523607", "text": "mute() {\n this.media.muted = true;\n }", "title": "" }, { "docid": "cab012e360d7668c7236c39a9cb21463", "score": "0.6518662", "text": "function muteLocalAudio() {\n logger(\"Local Function: <b style='color:darkBlue'>muteLocalAudio()</b>\");\n if ($(\"#btn_mute_local_audio\").html() == \"Mute Audio\") {\n logger(\"Agora Function: <b style='color:indigo'>local_stream.disableAudio()</b>\");\n local_stream.disableAudio();\n } else {\n logger(\"Agora Function: <b style='color:indigo'>local_stream.enableAudio()</b>\");\n local_stream.enableAudio();\n }\n }", "title": "" }, { "docid": "a8729e2df9e2b41439c4359fec73c7d3", "score": "0.6512634", "text": "function muteAudio() {\n let player = document.getElementById('animationAudio')\n let muteButtonText = document.getElementById('muteButton')\n console.log(player.muted)\n if (player.muted === false) {\n muteButtonText.innerHTML = \"Unmute audio\"\n return player.muted = true\n } else if (player.muted === true) {\n muteButtonText.innerHTML = \"Mute audio\"\n return player.muted = false\n }\n }", "title": "" }, { "docid": "c9fbdcc6629554c03e18e34435c78f02", "score": "0.64974964", "text": "function myAudio(){\n const enabled = myVideoStream.getAudioTracks()[0].enabled;\n if (enabled) { // if I am already unmuted\n myVideoStream.getAudioTracks()[0].enabled = false;\n unmuteMe();\n } else {\n muteMe();\n myVideoStream.getAudioTracks()[0].enabled = true;\n }\n}", "title": "" }, { "docid": "1f92bba48aabe1c295dd0ace582d902c", "score": "0.6492599", "text": "switchPower(event){\n var powerChoice = document.getElementById('mute');\n (powerChoice.checked)? ( this.setMute(false)) : ( this.setMute(true)) ;\n }", "title": "" }, { "docid": "96ce434b945e987ca0d92764c72585ac", "score": "0.6489471", "text": "function disableMute(e) { \n e.preventDefault()\n if (mute === true) {\n setMute(false)}\n else{\n setMute(true)\n }\n }", "title": "" }, { "docid": "d55f46d09cb45974779eb9d9a414e425", "score": "0.64793074", "text": "setMuted(isMute) {\r\n if (isMute)\r\n this.audio.volume = 0;\r\n else\r\n this.audio.volume = this._volume;\r\n this._muted = isMute;\r\n this.emit(PlayerEvent.VolumeChange, this.audio.volume);\r\n }", "title": "" }, { "docid": "ee67c149748042c7b8fe513e882ede13", "score": "0.64585894", "text": "function changeVolume(value, isMuted, directUpdate){ \n proxyVolume = value;\n if(directUpdate) volumeSlider.value = proxyVolume;\n var imageToTake;\n if (isMuted){\n imageToTake = \"speaker_none.png\";\n }else{\n if (value < 33){\n imageToTake = \"speaker_low.png\";\n }\n else if (value < 66){\n imageToTake = \"speaker_medium.png\";\n }else{\n imageToTake = \"speaker_full.png\";\n }\n }\n muteButton.src = imageToTake;\n}", "title": "" }, { "docid": "6f66c2a0b4a375b087c312766fcdb40c", "score": "0.64536345", "text": "volumeHack_() {\n const self = this;\n if (!self.hasInteractedWithMedia_) {\n const volume = self.getVolume_();\n\n // Pick a new volume that is slightly different than the current\n // volume, making sure to not go out of the allowed bounds.\n let newVolume = volume + 0.1;\n if (newVolume > 1.0) {\n newVolume = volume - 0.1;\n }\n\n self.tileRenderer_.setVolume(newVolume);\n self.tileRenderer_.setVolume(volume);\n self.hasInteractedWithMedia_ = true;\n }\n }", "title": "" }, { "docid": "496588642620ae3e3ae0fcb0577093f4", "score": "0.6446005", "text": "function updateVolume() {\n if (video.muted) {\n video.muted = false;\n }\n video.volume = volume.value;\n}", "title": "" }, { "docid": "0a5a9bed4c780dff0615fb06377de793", "score": "0.644458", "text": "function muteMe(elem) {\n elem.muted = true;\n }", "title": "" }, { "docid": "687628de9db8b24062181337d71c2800", "score": "0.6431044", "text": "muteVideo() {\n if (this.localStream) {\n this.videoMuted = true\n this.localStream.getVideoTracks()[0].enabled = false\n }\n }", "title": "" }, { "docid": "40e2f5ff0bc903bae0891e4d88cb869f", "score": "0.6427835", "text": "function toggleMuteSound(elem) {\n\tif(elem.muted == false) {\n\t\telem.muted = true;\n\t\telem.pause();\n\t} else {\n\t\telem.muted = false;\n\t\tif(elem.loop) {\n\t\t\telem.play();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "916f8563adf1d6fbe39b85b878eb1693", "score": "0.6426823", "text": "function musikOnOff(type) {\r\n\tif(type == \"off\") {\r\n\t\tplayMusik[played].pause();\r\n\t\tmusikPlay = false;;\r\n\t}else {\r\n\t\tplayMusik[played].play();\r\n\t\tmusikPlay = true;\r\n\t}\r\n}", "title": "" } ]